/* ============================================================
   场景内容：序言 / 故事 / 足迹 / 情书 / 封底 / 灯箱
   ============================================================ */

/* ---------- 方案B：照片蒙太奇开场（无文字） ---------- */
.scene-montage {
  background: #120c08;
}

.montage-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.montage-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: montageFade 24s linear infinite;
  animation-delay: calc(var(--i) * -6s);
  will-change: opacity;
}

.montage-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.12);
  animation: montageKen 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes montageFade {
  0%, 2% { opacity: 0; }
  6%     { opacity: 1; }
  22%    { opacity: 1; }
  26%    { opacity: 0; }
  100%   { opacity: 0; }
}

@keyframes montageKen {
  from { transform: scale(1.12) translate(0, 0); }
  to   { transform: scale(1.3) translate(-1.8%, -1.4%); }
}

/* 滚动离开时暂停轮播，节省性能 */
.scene-montage:not(.active) .montage-slide {
  animation-play-state: paused;
}

/* ---------- 故事场景：纸面留白相册版式 ---------- */
.scene-story {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px 58px;
  background:
    radial-gradient(ellipse at 50% 26%, rgba(255, 250, 240, 0.92), transparent 62%),
    var(--surface);
}

.story-frame {
  width: min(96vw, 1060px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* FadeContent：故事屏内容进入视口时逐层浮现 */
.scene-story .story-frame > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.scene-story.active .story-frame > * {
  opacity: 1;
  transform: translateY(0);
}

.scene-story.active .story-frame > *:nth-child(1) { transition-delay: 0.04s; }
.scene-story.active .story-frame > *:nth-child(2) { transition-delay: 0.12s; }
.scene-story.active .story-frame > *:nth-child(3) { transition-delay: 0.2s; }
.scene-story.active .story-frame > *:nth-child(4) { transition-delay: 0.28s; }
.scene-story.active .story-frame > *:nth-child(5) { transition-delay: 0.36s; }

.story-meta {
  text-align: center;
  max-width: 640px;
}

.scene-story .scene-kicker {
  color: var(--foil);
  text-shadow: none;
}

.scene-story .scene-title {
  color: var(--ink);
  text-shadow: none;
}

.scene-story .scene-summary {
  color: var(--ink-soft);
  text-shadow: none;
  margin-left: auto;
  margin-right: auto;
}

.story-photo-wrap {
  width: 100%;
  max-width: 1000px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-book);
  padding: 12px 12px 34px;
  margin: 0;
}

.story-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72svh;
  margin: 0 auto;
  object-fit: contain;
  background: var(--surface);
}

.story-photo-caption {
  font-family: var(--font-hand);
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 12px 4px 0;
}

.story-photo-caption.empty {
  display: none;
}

/* 故事场景里的其余照片：纸面胶片条 */
.scene-story .strip-thumb {
  background: var(--paper);
  border-color: var(--hairline);
}

.scene-kicker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(253, 248, 240, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.scene-kicker .scene-no {
  color: #ffc2a6;
  font-size: 13px;
}

.scene-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5.5vw, 2.7rem);
  letter-spacing: 0.08em;
  color: var(--cream);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

/* SplitText：场景标题逐词上浮 */
.scene-title .word,
.scene-heading .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}

.scene-title .word-inner,
.scene-heading .word-inner {
  display: inline-block;
  transform: translateY(118%);
  transition: transform 0.75s cubic-bezier(0.22, 0.7, 0.2, 1);
  transition-delay: calc(var(--i) * 0.06s);
}

.scene.active .scene-title .word-inner,
.scene.active .scene-heading .word-inner {
  transform: translateY(0);
}

.scene-summary {
  margin-top: 10px;
  max-width: 56ch;
  color: rgba(253, 248, 240, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.scene-note {
  margin-top: 14px;
  font-family: var(--font-hand);
  color: #ffd9c4;
  max-width: 52ch;
  white-space: pre-line;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.scene-note:empty { display: none; }

/* 其余照片：小胶片条 */
.scene-strip {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 640px;
}

.strip-thumb {
  flex: 0 0 92px;
  width: 92px;
  height: 74px;
  padding: 4px;
  background: rgba(250, 246, 236, 0.92);
  border: 1px solid rgba(253, 248, 240, 0.55);
  border-radius: 3px;
  cursor: zoom-in;
  overflow: hidden;
  transform: perspective(760px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 0.7, 0.2, 1), box-shadow 0.3s, opacity 0.25s;
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(40, 30, 22, 0.16);
}

.strip-thumb:hover {
  opacity: 1;
  box-shadow: 0 10px 24px rgba(40, 30, 22, 0.3);
}

.strip-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.12);
}

.scene-video {
  margin-top: 18px;
  width: 100%;
  max-width: 330px;
  max-height: 190px;
  border: 1px solid rgba(253, 248, 240, 0.4);
  border-radius: 4px;
  background: #120c08;
}

/* 无照片的视频记忆：暖色空镜 */
.scene-media-empty {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(168, 67, 42, 0.22), transparent 65%),
    linear-gradient(160deg, #3b2b23 0%, #241a14 100%);
}

/* ---------- 足迹场景（纸面页） ---------- */
.scene-map {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 250, 240, 0.85), transparent 62%),
    var(--surface);
}

.scene-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  letter-spacing: 0.12em;
  color: var(--ink);
}

.kicker-center {
  color: var(--foil);
  text-shadow: none;
  letter-spacing: 0.36em;
}

.scene-map .scene-content.center {
  justify-content: flex-start;
  align-items: stretch;
  padding: 34px 0 0;
  width: 100%;
}

.map-stage {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
  align-items: stretch;
  height: calc(100svh - 150px);
  min-height: 480px;
}

.map-canvas-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
}

#city-map {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--hairline);
  background: var(--paper);
  box-shadow: var(--shadow-book);
  position: relative;
  overflow: hidden;
}

#city-map::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(200, 190, 164, 0.5);
  pointer-events: none;
  z-index: 2;
}

#city-map svg {
  display: block;
  width: 100%;
  height: 100%;
}

.china-boundary {
  fill: rgba(200, 190, 164, 0.16);
  stroke: var(--hairline);
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.node-core {
  transition: r 0.25s ease, fill 0.25s ease;
}

.node-hit {
  pointer-events: all;
}

.map-node:hover .node-core,
.map-node.selected .node-core {
  r: 6.5;
  fill: #a8432a;
}

.map-label {
  font-family: var(--font-display);
  fill: var(--ink);
  font-size: 15px;
  letter-spacing: 0.14em;
  pointer-events: all;
  cursor: pointer;
}

/* ---------- 城市回忆相册面板 ---------- */
.map-album {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--foil);
  box-shadow: var(--shadow-book);
  padding: 26px 26px 18px;
  overflow-y: auto;
  height: 100%;
  max-height: none;
  min-height: 0;
  text-align: left;
}

.album-kicker {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--foil);
}

.album-city {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  margin-top: 8px;
  color: var(--ink);
}

.album-note {
  margin-top: 6px;
  font-family: var(--font-hand);
  color: var(--ink-soft);
  font-size: 1rem;
}

.album-count {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--hairline);
  padding-bottom: 14px;
}

.album-memory {
  margin-top: 18px;
}

.album-memory-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.album-date {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--foil);
}

.album-mtitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.album-msummary {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.album-photos {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.album-photo {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 6px 6px 4px;
  cursor: zoom-in;
  transform: perspective(760px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 0.7, 0.2, 1), box-shadow 0.3s;
  box-shadow: 0 2px 8px rgba(40, 30, 22, 0.1);
}

.album-photo:hover {
  box-shadow: var(--shadow-book);
}

.album-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: sepia(0.1);
  background: var(--surface);
}

.album-photo figcaption {
  font-family: var(--font-hand);
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 6px 2px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-photo figcaption.empty {
  display: none;
}

/* FadeContent：切换城市时相册面板内容逐层浮现 */
.map-album > * {
  animation: albumIn 0.55s ease both;
}

.map-album > *:nth-child(1) { animation-delay: 0.03s; }
.map-album > *:nth-child(2) { animation-delay: 0.1s; }
.map-album > *:nth-child(3) { animation-delay: 0.17s; }
.map-album > *:nth-child(4) { animation-delay: 0.24s; }
.map-album > *:nth-child(5) { animation-delay: 0.31s; }
.map-album > *:nth-child(6) { animation-delay: 0.38s; }

@keyframes albumIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 地图节点：常态展示，仅保留克制的悬停反馈 */
.map-node { cursor: pointer; }

.map-label {
  transition: transform 0.35s cubic-bezier(0.22, 0.7, 0.2, 1), fill 0.35s;
}

.map-node:hover .map-label {
  transform: translateY(-4px);
  fill: #a8432a;
}

/* ---------- 视频影像栏：胶片式流转 ---------- */
.scene-videos {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 56px 0 48px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(168, 67, 42, 0.16), transparent 55%),
    linear-gradient(180deg, #1b1511 0%, #0f0b08 100%);
}

.scene-videos .videos-head {
  text-align: center;
}

.scene-videos .scene-heading {
  color: #f6efe3;
}

.scene-videos .kicker-center {
  color: #e8a283;
}

.film-reel {
  position: relative;
  width: 100%;
}

/* 胶片齿孔：上下两条黑色带 */
.film-sprocket {
  position: relative;
  height: 18px;
  background: #080604;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.film-sprocket::before {
  content: "";
  position: absolute;
  inset: 2px 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 14px,
    rgba(246, 239, 227, 0.16) 14px 26px,
    transparent 26px 40px
  );
}

.film-track {
  display: flex;
  align-items: center;
  width: max-content;
  padding: 30px 0 34px;
  will-change: transform;
}

.film-card {
  position: relative;
  flex: 0 0 clamp(250px, 26vw, 360px);
  height: clamp(300px, 46svh, 460px);
  margin-left: 16px;
  padding: 10px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -14px 26px rgba(255, 255, 255, 0.05),
    0 26px 52px rgba(0, 0, 0, 0.5);
}

.film-card:first-child {
  margin-left: 0;
}

/* 液态流动描边 */
.film-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.06) 38%,
    rgba(232, 162, 131, 0.4) 68%,
    rgba(255, 255, 255, 0.55)
  );
  background-size: 220% 220%;
  animation: glassFlow 9s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes glassFlow {
  0%, 100% { background-position: 0% 40%; }
  50%      { background-position: 100% 60%; }
}

.film-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  background: #000;
}

.film-cap {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 8, 6, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #f6efe3;
}

.film-title {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-meta {
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(246, 239, 227, 0.72);
  white-space: nowrap;
}

/* ---------- 她的写真集（全屏写真集轮播） ---------- */
.scene-photobook {
  display: flex;
  flex-direction: column;
  padding: 52px 0 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(168, 67, 42, 0.16), transparent 55%),
    linear-gradient(180deg, #1b1511 0%, #0f0b08 100%);
}

.pb-head {
  text-align: center;
}

.scene-photobook .scene-heading {
  color: #f6efe3;
}

.scene-photobook .kicker-center {
  color: #e8a283;
}

.pb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 26px;
  overflow: hidden;
}

.pb-main {
  position: absolute;
  inset: 0;
}

.pb-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}

.pb-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: opacity 1s ease;
}

.pb-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #0b0806;
  transform: scale(1);
}

.pb-slide.is-active img {
  will-change: transform;
  animation: pb-ken 7s ease-out forwards;
}

@keyframes pb-ken {
  from { transform: scale(1.02); }
  to   { transform: scale(1.14); }
}

.pb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18vh 24px 34px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.18rem;
  letter-spacing: 0.14em;
  color: var(--cream);
  background: linear-gradient(transparent, rgba(10, 7, 5, 0.55) 55%, rgba(10, 7, 5, 0.78));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease 0.35s, transform 0.9s ease 0.35s;
}

.pb-slide.is-active .pb-caption {
  opacity: 1;
  transform: none;
}

.pb-counter {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(246, 239, 227, 0.78);
}

.pb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 227, 0.28);
  background: rgba(15, 10, 7, 0.28);
  color: var(--cream);
  font-size: 24px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.25s, border-color 0.25s;
}

.pb-prev { left: 18px; }
.pb-next { right: 18px; }

.pb-arrow:hover {
  background: rgba(168, 67, 42, 0.72);
  border-color: transparent;
}

.pb-strip {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
  max-width: min(88vw, 720px);
  overflow-x: auto;
  padding: 6px 8px;
  scrollbar-width: none;
}

.pb-strip::-webkit-scrollbar { display: none; }

.pb-thumb {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid rgba(246, 239, 227, 0.24);
  background: #000;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}

.pb-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-thumb.is-active {
  border-color: #e8a283;
  transform: translateY(-4px);
}

/* ---------- 美食 · 多宫格大图流动 ---------- */
.scene-foodgrid {
  display: flex;
  flex-direction: column;
  padding: 52px 0 30px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(200, 120, 70, 0.14), transparent 55%),
    linear-gradient(180deg, #1b1511 0%, #0f0b08 100%);
}

.food-head {
  text-align: center;
  flex: 0 0 auto;
}

.scene-foodgrid .scene-heading {
  color: #f6efe3;
}

.scene-foodgrid .kicker-center {
  color: #e8a283;
}

.food-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
  min-height: 0;
}

.food-row {
  position: relative;
  display: flex;
  gap: 16px;
  width: 100%;
  height: clamp(190px, 27svh, 270px);
  overflow: hidden;
}

.food-card {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(300px, 33vw, 460px);
  height: clamp(190px, 27svh, 270px);
  overflow: hidden;
  border: 1px solid rgba(246, 239, 227, 0.16);
  border-radius: 12px;
  background: #0b0806;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  will-change: transform;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.food-card:hover {
  border-color: rgba(232, 162, 131, 0.75);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.55);
}

.food-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.08) saturate(0.95);
  transition: transform 4s ease;
}

.food-card:hover img {
  transform: scale(1.06);
}

/* ---------- 情书场景（信封 × 信纸 × 声音） ---------- */
.scene-letters {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 250, 240, 0.9), transparent 64%),
    var(--surface);
}

.scene-letters .scene-heading { margin-top: 12px; }

.letters-intro {
  margin-top: 10px;
  font-family: var(--font-hand);
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.letters-wrap {
  margin-top: 26px;
  width: min(94vw, 720px);
  max-height: 56vh;
  overflow-y: auto;
  display: grid;
  gap: 22px;
  padding: 6px;
}

.letter {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-book);
}

.letter::before {
  /* 信封口盖的斜向折痕，极淡，不影响阅读 */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 44%, rgba(168, 67, 42, 0.07) 44%, rgba(168, 67, 42, 0.07) 46%, transparent 46%),
    linear-gradient(45deg, transparent 44%, rgba(168, 67, 42, 0.07) 44%, rgba(168, 67, 42, 0.07) 46%, transparent 46%);
}

.letter summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.letter[open] summary {
  border-bottom-color: var(--hairline);
}

.letter summary::-webkit-details-marker { display: none; }

.letter-seal {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(253, 248, 240, 0.78);
  background:
    radial-gradient(circle at 34% 30%, #c05c3a, var(--foil) 58%, #7e3018 100%);
  color: var(--cream);
  font-family: var(--font-hand);
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(120, 50, 28, 0.35);
}

.letter-heading {
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.letter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.08em;
}

.letter-date {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.letter-fold {
  font-family: var(--font-ui);
  color: var(--foil);
  transition: transform 0.35s;
}

.letter[open] .letter-fold { transform: rotate(180deg); }

.letter-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.letter-paper {
  overflow: hidden;
  min-height: 0;
  padding: 0 26px;
  transition: padding 0.3s ease 0.18s;
}

.letter[open] .letter-body {
  grid-template-rows: 1fr;
}

.letter[open] .letter-paper {
  padding: 6px 26px 24px;
}

.letter-paper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.letter-text {
  font-family: var(--font-hand);
  font-size: 1.02rem;
  line-height: 2.05;
  color: var(--ink);
  white-space: pre-line;
  padding-top: 18px;
  min-height: 2.05em;
}

.letter-text.typing::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--foil);
  animation: caret-blink 0.8s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.letter-sign {
  margin-top: 18px;
  text-align: right;
  font-family: var(--font-hand);
  letter-spacing: 0.12em;
  color: var(--foil);
}

/* ---------- 封底 ---------- */
.scene-outro {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255, 250, 240, 0.9), transparent 62%),
    var(--surface);
}

.outro-line {
  font-family: var(--font-hand);
  font-size: 1.55rem;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.back-heart {
  margin: 22px auto 18px;
  width: 54px;
  height: 54px;
  line-height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--foil);
  color: var(--foil);
  font-size: 21px;
  animation: quiet-beat 2.6s ease-in-out infinite;
}

.outro-date {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--ink-soft);
}

@keyframes quiet-beat {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.07); }
  60%      { transform: scale(1); }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 13, 9, 0.94);
  padding: 48px 54px;
  animation: lbBack 0.4s ease both;
}

.lightbox[hidden] { display: none; }

@keyframes lbBack {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-figure {
  max-width: 92vw;
  max-height: 88vh;
  text-align: center;
}

.lb-figure img {
  display: block;
  max-width: 92vw;
  max-height: 74vh;
  margin: 0 auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: lbImgIn 0.55s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}

@keyframes lbImgIn {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#lb-caption {
  margin-top: 18px;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: #f6efe3;
}

#lb-caption.lb-empty {
  display: none;
}

#lb-meta {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(246, 239, 227, 0.65);
}

.lb-nav, .lb-close {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(246, 239, 227, 0.35);
  background: rgba(246, 239, 227, 0.08);
  color: #f6efe3;
  font-size: 22px;
  line-height: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s;
}

.lb-nav:hover, .lb-close:hover { background: rgba(246, 239, 227, 0.22); }

.lb-close { top: 22px; right: 26px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .scene-content { padding: 64px 18px 42px; }

  .scene-kicker { gap: 10px; font-size: 10px; }
  .strip-thumb { flex-basis: 78px; width: 78px; height: 64px; }

  .scene-story { padding: 40px 14px 52px; }
  .story-frame { gap: 14px; }
  .story-photo-wrap { padding: 8px 8px 26px; }
  .story-photo { max-height: 52svh; }

  .scene-map .scene-content.center { padding: 44px 14px 0; }

  .map-stage {
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .map-canvas-wrap { height: 42vh; min-height: 300px; }
  #city-map { min-height: 0; height: 100%; }
  .map-album { min-height: 0; max-height: 48vh; padding: 20px 18px 14px; }
  .album-photos { gap: 10px; }

  .scene-videos { padding: 44px 0 40px; gap: 12px; }
  .film-card {
    flex-basis: clamp(220px, 70vw, 300px);
    height: 38svh;
    margin-left: 10px;
  }
  .film-cap { padding: 8px 10px; }
  .film-meta { display: none; }

  .scene-photobook { padding: 44px 0 0; }
  .pb-stage { margin-top: 18px; }
  .pb-arrow { width: 40px; height: 40px; font-size: 18px; }
  .pb-prev { left: 8px; }
  .pb-next { right: 8px; }
  .pb-thumb { width: 46px; height: 46px; }
  .pb-caption { padding: 14vh 18px 30px; font-size: 1.02rem; }
  .pb-counter { top: 12px; right: 14px; }

  .scene-foodgrid { padding: 44px 0 24px; }
  .food-stage { gap: 10px; margin-top: 20px; }
  .food-row { gap: 10px; height: 23svh; }
  .food-card {
    width: 70vw;
    height: 23svh;
    border-radius: 10px;
  }

  .letters-wrap { max-height: 62vh; }
  .letter summary { padding: 16px 16px; gap: 12px; }
  .letter-seal { width: 40px; height: 40px; font-size: 0.95rem; }
  .letter-paper { padding: 0 16px; }
  .letter[open] .letter-paper { padding: 4px 16px 18px; }
  .letter-text { font-size: 0.98rem; }

  .lightbox { padding: 60px 12px 30px; }
  .lb-figure img { max-height: 62vh; }
  .lb-nav { width: 40px; height: 40px; font-size: 18px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-path { animation: none; }
  .back-heart { animation: none; }
  .montage-slide,
  .montage-slide img {
    animation: none;
    transform: none;
  }
  .montage-slide { opacity: 0; }
  .montage-slide:nth-child(1) { opacity: 1; }
  .pb-slide.is-active img { animation: none; transform: scale(1); }
  .pb-caption { transition: none; opacity: 1; transform: none; }
  .food-row.food-static {
    position: relative;
    display: flex;
    gap: 16px;
    width: auto;
    height: auto;
    overflow-x: auto;
  }
  .food-row.food-static .food-card {
    position: static;
    flex: 0 0 clamp(300px, 33vw, 460px);
    width: clamp(300px, 33vw, 460px);
    height: clamp(190px, 27svh, 270px);
  }
  .food-card img { transition: none; }
  .food-card:hover img { transform: none; }
  .scene-title .word-inner,
  .scene-heading .word-inner {
    transform: none;
    transition: none;
  }
  .scene-story .story-frame > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .album-photo,
  .strip-thumb {
    transform: none;
    transition: none;
    will-change: auto;
  }
  .map-album > * { animation: none; }
  .letter-body { transition: none; }
  .lightbox,
  .lb-figure img { animation: none; }
  .map-label { transition: none; }
  .film-card::before { animation: none; }
  .letter-text.typing::after {
    animation: none;
  }
}

/* ---------- 视频预览灯箱 ---------- */
.video-lb {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 7, 5, 0.94);
  padding: 42px;
  animation: lbBack 0.35s ease both;
}

.video-lb[hidden] { display: none; }

.vl-figure {
  max-width: min(92vw, 960px);
  text-align: center;
}

.vl-figure video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #000;
}

#vl-caption {
  margin-top: 16px;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: #f6efe3;
}

@media (max-width: 640px) {
  .video-lb { padding: 60px 12px 30px; }
  .vl-figure video { max-height: 64vh; }
}
