/* 五色 · 日式极简
   余白为骨，细线为界；传统色只作点缀，绝不大面积使用。 */

:root {
  --bg: #F7F5F0;      /* 生成り（kinari）米白 */
  --ink: #2B2B2B;     /* 墨 */
  --muted: #8C877D;   /* 利休鼠系的暖灰 */
  --line: #DDD8CF;    /* 细线 */
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Hiragino Sans", "PingFang SC", "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: light; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

[lang="ja"]::before { content: " / "; color: var(--line); }
[lang="ja"] { color: var(--muted); }

/* ---- 页头 ---- */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 34px 48px;
}

.brand {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.3em;
}

.brand rt, .site-title rt {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  padding-bottom: 4px;
}

.color-nav { display: flex; gap: 30px; }

.color-nav a {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.color-nav a:hover { color: var(--accent); }

.color-nav a.is-current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
  align-self: center;
}

.color-nav .nav-upload { --accent: var(--ink); font-size: 13px; }

/* 首页右上角的投稿入口 */
.corner-upload {
  position: absolute;
  top: 36px;
  right: 48px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}

.corner-upload:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- 首页：五色分屏 ---- */

body.page-home {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-head {
  text-align: center;
  padding: 58px 24px 44px;
}

.site-title {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-indent: 0.4em; /* 抵消末字后的字距，保证视觉居中 */
}

.site-sub {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.26em;
  color: var(--ink);
}

.stripes {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 2px;
  margin: 0 56px 56px;
}

.stripe {
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 46px 0 30px;
  background: var(--sc);
  color: var(--fg);
  transition: flex-grow 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.4s;
}

/* 有照片时：<img class="st-bg"> 铺底（async 解码、object-fit 覆盖），
   ::before 覆传统色薄罩 + 底部暗渐变（--wash 由构建写入行内样式） */
.st-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.stripe.st-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(var(--wash), var(--wash)),
    linear-gradient(rgb(0 0 0 / 0) 55%, rgb(0 0 0 / 0.35));
}

.stripe.st-photo {
  text-shadow: 0 1px 14px rgb(0 0 0 / 0.35);
}

.st-label,
.st-count { position: relative; z-index: 2; }

.stripe:hover { flex-grow: 1.28; filter: brightness(1.05); }

.st-label { writing-mode: vertical-rl; }

.st-kanji {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.34em;
}

.stripe .st-kana {
  display: block;
  margin-block-start: 16px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: inherit;
  opacity: 0.85;
}

.stripe .st-kana::before { content: none; }

.st-count {
  font-family: var(--serif);
  font-size: 16px;
  font-feature-settings: "tnum";
}

.st-unit { font-size: 10px; margin-left: 3px; opacity: 0.8; }

/* ---- 颜色页 ---- */

.vertical-title {
  position: fixed;
  left: 46px;
  top: 150px;
  writing-mode: vertical-rl;
  user-select: none;
}

.vt-kanji {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.4em;
  color: var(--accent);
}

.vt-kana {
  display: block;
  margin-block-start: 20px;
  font-size: 11.5px;
  letter-spacing: 0.32em;
}
.vt-kana::before { content: none; }

.grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 52px 90px 150px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 48px 32px;
  align-items: start;
}

/* 瀑布流（masonry.js 启用后）：按时间序放入最短列，消除整行空白 */
.grid.masonry {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.mcol {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.ph-link img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.35s;
}

.ph-link:hover img { opacity: 0.93; }

.ph figcaption {
  margin-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-feature-settings: "tnum";
}

.cap-note { margin-left: 5px; }

/* 来访者投稿标注 */
.cap-sub {
  margin-left: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  padding: 0 5px 1px;
  color: var(--muted);
}

.grid-empty { display: block; }

.empty {
  padding: 130px 24px;
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* ---- 投稿页 ---- */

.upload {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  text-align: center;
}

.up-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.up-title rt {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-bottom: 4px;
}

.up-sub {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.up-form { margin-top: 44px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed #C9C3B8;
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s;
}

.drop:hover, .drop.is-over { border-color: var(--muted); background: #F1EEE6; }

.drop-hint { font-size: 13.5px; letter-spacing: 0.1em; }
.drop-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; }

.up-preview {
  max-height: 240px;
  max-width: 100%;
  display: block;
}

.cf-turnstile { margin: 26px auto 0; display: flex; justify-content: center; }

.up-btn {
  margin-top: 26px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  padding: 12px 46px;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, opacity 0.25s;
}

.up-btn:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.up-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.up-msg { margin-top: 20px; font-size: 12.5px; letter-spacing: 0.08em; color: var(--muted); min-height: 1.6em; }
.up-msg.is-error { color: #A4453E; }

.up-note {
  margin-top: 34px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---- 页脚 ---- */

.site-foot {
  padding: 70px 24px 56px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ---- 灯箱 ---- */

.lightbox {
  border: 0;
  padding: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  background: rgba(247, 245, 240, 0.985);
  color: var(--ink);
}

.lightbox::backdrop { background: transparent; }

.lightbox[open] { animation: lb-fade 0.28s ease; }

@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stripe-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] { animation: none; }
  .ph-link img, .color-nav a, .color-index a { transition: none; }
}

.lb-body {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 84px 40px;
}

.lb-img {
  max-width: 100%;
  max-height: calc(100% - 76px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 6px 28px rgba(43, 43, 43, 0.07);
}

.lb-meta {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  text-align: center;
}

.lb-exif {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #55514A;
  font-feature-settings: "tnum";
}

.lb-date {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--serif);
  color: var(--muted);
  transition: color 0.25s;
  line-height: 1;
  padding: 14px;
}

.lightbox button:hover { color: var(--ink); }
.lightbox button:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.lb-close { top: 18px; right: 22px; font-size: 28px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); font-size: 38px; }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); font-size: 38px; }

/* ---- 移动端 ---- */

@media (max-width: 760px) {
  .site-head { padding: 22px 20px; }
  .brand { font-size: 18px; letter-spacing: 0.22em; }
  .color-nav { gap: 18px; }
  .color-nav a { font-size: 15px; }

  body.page-home { height: auto; min-height: 100dvh; overflow: auto; }
  .home-head { padding: 42px 20px 30px; }
  .site-title { font-size: 38px; }
  .stripes { flex-direction: column; margin: 0 18px 18px; }
  .stripe {
    flex-direction: row;
    padding: 0 26px;
    min-height: 106px;
    /* 点击舒展：0.6s，舒缓曲线 */
    transition: min-height 0.6s cubic-bezier(0.33, 0, 0.18, 1), filter 0.5s ease;
  }
  .stripe:hover { flex-grow: 1; }

  /* 入场：五条色带依次浮现（home.js 挂 anim-in，系统减弱动态效果时不挂） */
  body.anim-in .stripe { animation: stripe-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) backwards; }
  body.anim-in .stripe:nth-child(1) { animation-delay: 0.05s; }
  body.anim-in .stripe:nth-child(2) { animation-delay: 0.13s; }
  body.anim-in .stripe:nth-child(3) { animation-delay: 0.21s; }
  body.anim-in .stripe:nth-child(4) { animation-delay: 0.29s; }
  body.anim-in .stripe:nth-child(5) { animation-delay: 0.37s; }

  /* 点击：被选中的色带大幅长高、其余四条温和收窄（屏风展开的意象），随后进入对应页面 */
  .stripes.opening .stripe { min-height: 58px; }
  .stripes.opening .stripe.is-opening { min-height: 400px; filter: brightness(1.06); }
  .stripe:active { filter: brightness(1.06); }

  .st-label {
    writing-mode: horizontal-tb;
    display: flex;
    align-items: baseline;
    gap: 12px;
  }
  .st-kanji { font-size: 22px; letter-spacing: 0.2em; }
  .stripe .st-kana { margin-block-start: 0; }

  .vertical-title {
    position: static;
    writing-mode: horizontal-tb;
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 30px 24px 0;
  }
  .vt-kanji { font-size: 24px; letter-spacing: 0.2em; }
  .vt-kana { margin-block-start: 0; }

  .grid {
    padding: 24px 20px 72px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 36px 20px;
  }

  .grid.masonry { gap: 20px; }
  .mcol { gap: 28px; }

  .lb-body { padding: 56px 18px 28px; }
  .lb-prev, .lb-next { display: none; } /* 移动端用滑动切换 */
  .lb-exif { font-size: 11px; }
}
