:root {
  --bg: #fafaf7;
  --ink: #1f1f1d;
  --muted: #6f6f68;
  --faint: #a2a29a;
  --line: #e7e4dc;
  --stage: #101010;
  --stage-soft: #1b1b19;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { image-orientation: from-image; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ---------- 顶栏 ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(20px, 5vw, 58px) 0;
}
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 22px; }
.nav a, .nav button {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav a:hover, .nav button:hover { color: var(--ink); border-color: var(--ink); }

.site-footer {
  margin-top: 70px;
  padding: 0 clamp(20px, 5vw, 58px) 34px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* ---------- 首页：随机漫游 ---------- */
.home-main { padding: 4vh 24px 0; }
.random-wrap {
  width: min(980px, 94vw);
  margin: 0 auto;
  text-align: center;
}
.intro {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--faint);
  margin-bottom: 20px;
}

.stage {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 auto;
  background: var(--stage);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}
.screen {
  position: relative;
  width: 100%;
  min-height: clamp(360px, 56vh, 660px);
  display: grid;
  place-items: center;
}
.stage-img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
}
.stage-img.is-active {
  opacity: 1;
  transform: translateY(0);
}

.stage-enter-hint {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.stage:hover .stage-enter-hint, .stage:focus-visible .stage-enter-hint {
  opacity: 1;
  transform: translateY(0);
}

.photo-caption {
  max-width: 720px;
  margin: 36px auto 0;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.teaser {
  font-family: var(--serif);
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.9;
}
.series-line {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--faint);
}
.series-line b { color: var(--muted); font-weight: 500; }
.play-state { margin-left: 10px; }

.home-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.home-actions a, .home-actions button {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.home-actions a:hover, .home-actions button:hover {
  color: var(--ink);
  border-color: currentColor;
}

/* ---------- 照片墙 ---------- */
.page-main {
  padding: 34px clamp(20px, 5vw, 58px) 0;
}
.page-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 22px;
}
.masonry {
  columns: 3 250px;
  column-gap: 12px;
}
.tile {
  position: relative;
  display: block;
  break-inside: avoid;
  margin: 0 0 12px;
  overflow: hidden;
  background: #ecebe4;
  border-radius: 3px;
}
.tile img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1);
  transition: transform 0.6s var(--ease);
}
.tile:hover img { transform: scale(1.025); }
.tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 14px 12px;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, transparent, rgba(10, 10, 9, 0.62));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.tile:hover .tile-label, .tile:focus-visible .tile-label {
  opacity: 1;
  transform: translateY(0);
}
.tile-count { color: rgba(255, 255, 255, 0.72); margin-left: 8px; }

/* ---------- 组图详情页 ---------- */
.series-main {
  padding: 44px clamp(20px, 8vw, 110px) 0;
  max-width: 1120px;
  margin: 0 auto;
}
.series-head { text-align: center; margin-bottom: 34px; }
.series-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin: 0;
}
.series-sub {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--faint);
  text-transform: uppercase;
}
.series-meta {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.viewer {
  position: relative;
  background: var(--stage);
  border-radius: 5px;
  overflow: hidden;
}
.viewer-screen {
  position: relative;
  width: 100%;
  height: clamp(380px, 64vh, 680px);
  display: grid;
  place-items: center;
}
.viewer-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  cursor: zoom-in;
}
.viewer-img.is-active {
  opacity: 1;
  transform: translateY(0);
}
.viewer-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.viewer:hover .viewer-arrow, .viewer-arrow:focus-visible { opacity: 1; }
.viewer-arrow:hover { background: rgba(255, 255, 255, 0.18); }
.viewer-arrow.prev { left: 14px; }
.viewer-arrow.next { right: 14px; }
.viewer-arrow:disabled { display: none; }

.photo-counter {
  position: absolute;
  left: 16px;
  bottom: 13px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  z-index: 2;
  pointer-events: none;
}

.thumb-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.thumb {
  width: 96px;
  height: 72px;
  padding: 0;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-current, .thumb:hover { opacity: 1; border-color: rgba(31, 31, 29, 0.55); }

.series-caption {
  margin: 34px auto 0;
  max-width: 640px;
  min-height: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.03em;
}
.series-caption:empty { display: none; }

.story-block {
  max-width: 660px;
  margin: 72px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 56px;
}
.story-block h2 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0 0 28px;
}
.story-text {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.05;
  color: #35352f;
  white-space: pre-line;
}
.photo-meta-list {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  line-height: 2;
  list-style: none;
  padding-left: 0;
}
.photo-meta-list li b { color: var(--muted); font-weight: 500; }

.series-exits {
  max-width: 660px;
  margin: 64px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.exit-link {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.exit-link:hover { color: var(--ink); border-color: currentColor; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(13, 13, 12, 0.94);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.14em;
}

/* ---------- 空态 / 小屏适配 ---------- */
@media (max-width: 760px) {
  .site-header { align-items: center; flex-wrap: wrap; }
  .nav { gap: 14px; }
  .nav a { font-size: 12px; }
  .screen { min-height: 56vw; }
  .viewer-screen { height: 70vw; max-height: 58vh; }
  .thumb { width: 76px; height: 58px; }
  .series-main { padding-top: 28px; }
  .story-block { margin-top: 52px; }
  .stage-enter-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .stage-img, .viewer-img { transform: none !important; }
}
