/* ==========================================================================
   Scenes — 八个场景的样式
   ========================================================================== */

/* ======================================================================
   01 · 序章 Hero
   ====================================================================== */
.scene-hero .scene-inner {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.hero-cast {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(-30px, -2vw, 0px);
  margin-bottom: clamp(20px, 3.4vh, 40px);
  width: 100%;
}

.hero-char {
  width: clamp(112px, 15vw, 210px);
  flex-shrink: 0;
  position: relative;
  filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.55));
  animation: float 6.5s var(--ease-in-out) infinite;
}

.hero-char.ds {
  animation-delay: -3.2s;
  margin-left: clamp(-28px, -2.6vw, -8px);
}

.hero-char.db {
  margin-right: clamp(-28px, -2.6vw, -8px);
}

.hero-char svg {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-13px) rotate(0.7deg);
  }
}

/* 中间的心 */
.hero-heart {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  width: clamp(30px, 4vw, 54px);
  z-index: 4;
  pointer-events: none;
  animation: heart-beat 2.4s var(--ease-in-out) infinite;
}

@keyframes heart-beat {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 14px rgba(255, 107, 157, 0.55));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.17);
    filter: drop-shadow(0 0 26px rgba(255, 107, 157, 0.85));
  }
}

.hero-title {
  font-size: clamp(27px, 6.4vw, 86px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(12px, 1.8vh, 20px);
  /* 中文标题尽量不拆单字 */
  text-wrap: balance;
}

.hero-title .l1 {
  display: block;
}

.hero-title .l2 {
  display: block;
  font-size: 0.52em;
  letter-spacing: 0.02em;
  font-weight: 600;
  margin-top: 0.32em;
  color: var(--text-2);
}

.hero-sub {
  font-size: clamp(13.5px, 1.5vw, 17px);
  color: var(--text-2);
  line-height: 1.8;
  max-width: 40ch;
  margin: 0 auto clamp(24px, 3.6vh, 40px);
}

.hero-actions {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 99px;
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.34s var(--ease-out);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.34s var(--ease-out);
}

.btn-primary {
  background: linear-gradient(112deg, #4d6bfe, #8b5cf6 52%, #ff6b9d);
  color: #fff;
  box-shadow: 0 14px 36px -14px rgba(77, 107, 254, 0.85);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px -14px rgba(124, 94, 246, 0.9);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

/* 滚动提示 —— 已弃用，保留类名防止旧缓存报错 */
.scroll-hint {
  display: none !important;
}

@keyframes hint-fade {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* ======================================================================
   02 · 心之树
   ====================================================================== */
.scene-tree .scene-inner {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.tree-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
}

.tree-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  display: grid;
  place-items: center;
}

#treeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.tree-tip {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
  transition: opacity 0.5s;
  pointer-events: none;
}

.tree-tip.gone {
  opacity: 0;
}

/* 情书 */
.letter {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(22px, 2.6vw, 34px);
  border-radius: var(--radius-l);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.072),
    rgba(255, 255, 255, 0.018)
  );
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  position: relative;
  overflow: hidden;
}

.letter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 60% at 0% 0%,
    rgba(255, 138, 61, 0.13),
    transparent 60%
  );
  pointer-events: none;
}

.letter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
}

.letter-head .av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
}

.letter-head .av svg {
  width: 100%;
  height: 100%;
}

.letter-who {
  line-height: 1.24;
}

.letter-who b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.letter-who span {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}

.letter-arrow {
  margin-left: auto;
  color: var(--aurora-pink);
  font-size: 17px;
  opacity: 0.8;
}

.letter-body {
  position: relative;
  font-size: clamp(13.5px, 1.22vw, 15.5px);
  line-height: 2.05;
  color: var(--text-1);
  min-height: 12em;
}

.letter-body p {
  margin: 0;
}

.letter-body .dim {
  color: var(--text-3);
  font-size: 0.9em;
}

.letter-sign {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.letter-sign .sig {
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.letter-sign .heart-mini {
  width: 15px;
  height: 15px;
  color: var(--aurora-pink);
  animation: heart-beat-s 2.2s var(--ease-in-out) infinite;
}

@keyframes heart-beat-s {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

/* ======================================================================
   03 · 时间花园
   ====================================================================== */
.scene-garden .scene-inner {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.garden-clock {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 2.2vw, 26px);
  margin: clamp(18px, 3vh, 34px) 0 clamp(20px, 3vh, 32px);
  flex-wrap: wrap;
  width: 100%;
}

.clock-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.clock-num {
  font-family: var(--font-mono);
  font-size: clamp(30px, 7.4vw, 74px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #9fb2ff 62%, #7c94ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 22px rgba(77, 107, 254, 0.35));
}

.clock-unit.warm .clock-num {
  background: linear-gradient(180deg, #fff, #ffc48a 62%, #ff8a3d);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 22px rgba(255, 138, 61, 0.35));
}

.clock-lbl {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}

.clock-sep {
  font-family: var(--font-mono);
  font-size: clamp(20px, 4vw, 42px);
  color: var(--text-4);
  line-height: 1;
  padding-bottom: 0.34em;
}

.garden-note {
  font-size: clamp(13px, 1.4vw, 15.5px);
  color: var(--text-2);
  line-height: 1.8;
  max-width: 46ch;
  margin: 0 auto clamp(22px, 3.4vh, 36px);
}

.garden-note b {
  color: var(--text-1);
  font-weight: 600;
}

/* 花园画布 */
.garden-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.9;
}

.scene-garden .scene-inner {
  position: relative;
}

/* 里程碑 */
.milestones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 11px;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}

.ms {
  padding: 15px 16px;
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.042);
  border: 1px solid var(--border);
  text-align: left;
  transition: all 0.34s var(--ease-out);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ms:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.ms-k {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 5px;
}

.ms-v {
  font-size: 13.5px;
  color: var(--text-1);
  font-weight: 500;
  line-height: 1.5;
}

/* ======================================================================
   04 · 代码情书
   ====================================================================== */
.scene-code .scene-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(26px, 4.4vw, 70px);
  align-items: center;
}

.code-panel {
  border-radius: var(--radius-m);
  overflow: hidden;
  background: rgba(6, 9, 20, 0.72);
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.14vw, 13.6px);
  line-height: 1.92;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.code-dots i:nth-child(1) {
  background: #ff5f57;
}
.code-dots i:nth-child(2) {
  background: #febc2e;
}
.code-dots i:nth-child(3) {
  background: #28c840;
}

.code-file {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-left: 4px;
}

.code-body {
  padding: 16px clamp(12px, 1.6vw, 20px) 20px;
  overflow-x: auto;
  white-space: pre;
  color: #c8d3ee;
  tab-size: 2;
}

.code-body::-webkit-scrollbar {
  height: 4px;
}

.ln {
  display: block;
}

.ln .gutter {
  display: inline-block;
  width: 2.4em;
  color: rgba(255, 255, 255, 0.15);
  user-select: none;
  text-align: right;
  padding-right: 1.3em;
}

.tk-kw {
  color: #c792ea;
}
.tk-str {
  color: #a5e07a;
}
.tk-cm {
  color: rgba(160, 178, 215, 0.45);
  font-style: italic;
}
.tk-fn {
  color: #82aaff;
}
.tk-num {
  color: #f78c6c;
}
.tk-cls {
  color: #ffcb6b;
}
.tk-op {
  color: #89ddff;
}
.tk-heart {
  color: #ff6b9d;
}

/* 右侧对话 */
.chat {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  opacity: 0;
  transform: translateY(14px);
  transition: all 0.6s var(--ease-out);
}

.chat-row.show {
  opacity: 1;
  transform: none;
}

.chat-row.right {
  flex-direction: row-reverse;
}

.chat-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  margin-bottom: 2px;
}

.chat-av svg {
  width: 100%;
  height: 100%;
}

.bubble {
  padding: 11px 16px;
  border-radius: 17px 17px 17px 6px;
  font-size: clamp(13px, 1.18vw, 14.6px);
  line-height: 1.68;
  max-width: 30ch;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text-1);
  position: relative;
}

.chat-row.right .bubble {
  border-radius: 17px 17px 6px 17px;
  background: linear-gradient(
    135deg,
    rgba(77, 107, 254, 0.28),
    rgba(139, 92, 246, 0.2)
  );
  border-color: rgba(124, 148, 255, 0.32);
}

.bubble .who {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
  font-weight: 600;
}

/* ======================================================================
   05 · 故事幻灯片（滚动叙事）
   ====================================================================== */
.scene-story .scene-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(22px, 3.6vw, 56px);
  align-items: center;
  min-height: 0;
}

.story-frame {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 100%;
  background: #0a0e1c;
  border: 1px solid var(--border);
  box-shadow: 0 32px 76px -36px rgba(0, 0, 0, 0.95);
}

.story-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transform: scale(1.045);
}

.story-slide.on {
  opacity: 1;
  transform: scale(1);
}

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

.story-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(5, 7, 15, 0.82) 100%
  );
  pointer-events: none;
}

.story-cap {
  position: absolute;
  left: clamp(16px, 2.4vw, 26px);
  right: clamp(16px, 2.4vw, 26px);
  bottom: clamp(16px, 2.4vw, 26px);
  z-index: 2;
  font-size: clamp(12.5px, 1.5vw, 17px);
  font-weight: 500;
  line-height: 1.55;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
  transition: opacity 0.4s;
}

.story-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.story-progress {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.sp-bar {
  height: 3px;
  flex: 1;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: background 0.3s;
}

.sp-bar:hover {
  background: rgba(255, 255, 255, 0.24);
}

.sp-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ds-blue-soft), var(--aurora-pink));
  transition: width 0.2s linear;
}

.sp-bar.done i {
  width: 100%;
}

.story-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.story-nav .idx {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  margin-right: auto;
  letter-spacing: 0.06em;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.3s var(--ease-out);
  flex-shrink: 0;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.nav-btn:active {
  transform: scale(0.92);
}

.nav-btn svg {
  width: 15px;
  height: 15px;
}

/* ======================================================================
   06 · 影像走廊
   ====================================================================== */
.scene-gallery .scene-inner {
  justify-content: center;
  gap: clamp(18px, 3vh, 34px);
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(9px, 1.2vw, 15px);
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: min(56vh, 520px);
  overflow: hidden;
}

.gcard {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: #0b0f1d;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.45s var(--ease-out);
  min-height: 0;
}

.gcard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.75s var(--ease-out), filter 0.45s;
  filter: saturate(0.86) brightness(0.86);
}

.gcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 45%,
    rgba(5, 7, 15, 0.88) 100%
  );
  pointer-events: none;
  transition: opacity 0.4s;
}

.gcard:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 26px 52px -22px rgba(0, 0, 0, 0.9);
}

.gcard:hover img {
  transform: scale(1.07);
  filter: saturate(1.05) brightness(1);
}

.gcap {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  z-index: 2;
}

.gcap b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.gcap span {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(4, 6, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s linear 0.4s;
}

.lightbox.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s, visibility 0s;
}

.lightbox img {
  max-width: min(100%, 1000px);
  max-height: 82vh;
  border-radius: var(--radius-m);
  box-shadow: 0 40px 90px -30px #000;
  transform: scale(0.94);
  transition: transform 0.45s var(--ease-out);
}

.lightbox.on img {
  transform: scale(1);
}

.lb-close {
  position: absolute;
  top: calc(18px + var(--safe-t));
  right: clamp(14px, 3vw, 30px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
}

.lb-close svg {
  width: 18px;
  height: 18px;
}

/* ======================================================================
   07 · 极光与星轨
   ====================================================================== */
.scene-aurora .scene-inner {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.sky-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  z-index: -1;
  mask-image: radial-gradient(ellipse 78% 68% at 50% 50%, #000 24%, transparent 82%);
  -webkit-mask-image: radial-gradient(
    ellipse 78% 68% at 50% 50%,
    #000 24%,
    transparent 82%
  );
  animation: sky-drift 42s ease-in-out infinite alternate;
}

@keyframes sky-drift {
  0% {
    transform: scale(1.06) translate(0, 0);
  }
  100% {
    transform: scale(1.16) translate(-1.6%, -1.2%);
  }
}

.stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--dur, 3.4s) ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.7);
  }
  50% {
    opacity: var(--peak, 0.9);
    transform: scale(1);
  }
}

.aurora-line {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 240px;
  pointer-events: none;
  z-index: -1;
  filter: blur(42px);
  opacity: 0.5;
}

.aurora-line.l1 {
  top: 16%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(53, 224, 200, 0.42),
    rgba(77, 107, 254, 0.5),
    transparent
  );
  animation: wave 16s ease-in-out infinite alternate;
}

.aurora-line.l2 {
  bottom: 12%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 107, 157, 0.36),
    rgba(139, 92, 246, 0.42),
    transparent
  );
  animation: wave 21s ease-in-out infinite alternate-reverse;
}

@keyframes wave {
  0% {
    transform: translateX(-4%) skewY(-3deg);
  }
  100% {
    transform: translateX(4%) skewY(3deg);
  }
}

.wish {
  font-size: clamp(19px, 3.1vw, 38px);
  font-weight: 600;
  line-height: 1.52;
  letter-spacing: -0.012em;
  max-width: 24ch;
  margin: 0 auto;
}

.wish .quote-mark {
  color: var(--text-4);
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.16em;
}

.wish-sub {
  margin: clamp(20px, 3vh, 32px) auto 0;
  font-size: clamp(12.5px, 1.3vw, 15px);
  color: var(--text-3);
  letter-spacing: 0.04em;
  max-width: 40ch;
}

/* ======================================================================
   08 · 告白终端
   ====================================================================== */
.scene-terminal .scene-inner {
  justify-content: center;
  align-items: center;
  position: relative;
}

.term-wrap {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.neon-title {
  text-align: center;
  font-size: clamp(23px, 5.2vw, 56px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.34;
  margin: 0;
  padding: 10px 0;
}

.neon-title span {
  display: inline-block;
  animation: neon 3.6s var(--ease-in-out) infinite;
  animation-delay: calc(var(--i) * 0.11s);
}

@keyframes neon {
  0%,
  100% {
    opacity: 0.42;
    text-shadow: 0 0 8px currentColor, 0 0 22px currentColor;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 14px currentColor, 0 0 42px currentColor,
      0 0 70px currentColor;
  }
}

.terminal {
  border-radius: var(--radius-m);
  overflow: hidden;
  background: rgba(4, 7, 16, 0.82);
  border: 1px solid var(--border);
  box-shadow: 0 30px 76px -34px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.term-bar .dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aurora-mint);
  box-shadow: 0 0 10px var(--aurora-mint);
  animation: pulse-dot 2s ease-in-out infinite;
}

.term-body {
  padding: clamp(16px, 2.2vw, 26px);
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: 2;
  min-height: clamp(190px, 28vh, 260px);
  max-height: 42vh;
  overflow-y: auto;
  color: #b8c6e6;
}

.term-body::-webkit-scrollbar {
  width: 4px;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line .p {
  color: var(--aurora-mint);
}
.term-line .ok {
  color: #a5e07a;
}
.term-line .hi {
  color: #ffd479;
}
.term-line .pink {
  color: #ff8fb4;
}
.term-line .dim2 {
  color: rgba(160, 178, 215, 0.42);
}

.term-final {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 1.12em;
  color: #fff;
}

.term-actions {
  display: flex;
  gap: 11px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ======================================================================
   响应式
   ====================================================================== */
@media (max-width: 900px) {
  .scene-tree .scene-inner,
  .scene-code .scene-inner,
  .scene-story .scene-inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    scrollbar-width: none;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
  .scene-tree .scene-inner::-webkit-scrollbar,
  .scene-code .scene-inner::-webkit-scrollbar,
  .scene-story .scene-inner::-webkit-scrollbar {
    display: none;
  }

  /* 代码情书：代码块与对话严格上下排列，不重叠 */
  .scene-code .code-panel,
  .scene-code .chat {
    flex: 0 0 auto;
    width: 100%;
    max-width: 560px;
    min-width: 0;
  }

  .scene-code .chat {
    gap: 11px;
  }

  .tree-stage {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }

  .tree-canvas-wrap {
    max-width: min(72vw, 320px);
    aspect-ratio: 1;
  }

  .letter,
  .code-panel,
  .story-frame {
    width: 100%;
    max-width: 560px;
  }

  .story-frame {
    aspect-ratio: 16 / 10;
    max-height: 34vh;
  }

  .letter-body {
    min-height: 0;
  }

  .gallery-grid {
    max-height: none;
    overflow-y: visible;
  }

  .scene-gallery .scene-inner {
    overflow-y: auto;
    scrollbar-width: none;
    justify-content: flex-start;
    justify-items: stretch;
  }

  .scene-gallery .scene-inner::-webkit-scrollbar {
    display: none;
  }

  .gallery-head {
    flex: 0 0 auto;
    padding-bottom: 4px;
  }

  /* Hero 移动端 */
  .hero-cast {
    margin-bottom: 18px;
  }

  .hero-title .l2 {
    font-size: 0.56em;
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .scene-hero .scene-inner {
    justify-content: center;
    padding-top: calc(64px + var(--safe-t));
    overflow-y: auto;
    scrollbar-width: none;
  }

  .scene-hero .scene-inner::-webkit-scrollbar {
    display: none;
  }

  .hero-char {
    width: clamp(96px, 27vw, 140px);
  }

  /* 手机端标题略小，避免孤字换行 */
  .hero-title {
    font-size: clamp(24px, 7vw, 34px);
  }

  .hero-title .l1 {
    display: block;
    max-width: 12ch;
    margin: 0 auto;
  }

  .hero-title .l2 {
    font-size: 0.5em;
  }

  .hero-sub {
    font-size: 13px;
  }

  /* 树场景：画布不要占满整屏 */
  .tree-canvas-wrap {
    max-width: min(78vw, 300px);
  }

  .tree-stage {
    align-items: flex-start;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 9px;
    max-height: none;
    overflow: visible;
    flex: 0 0 auto;
  }

  .gcard {
    aspect-ratio: 3 / 4;
  }

  .gcap b {
    font-size: 12px;
  }

  .gcap span {
    font-size: 9.5px;
  }

  .milestones {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ms {
    padding: 12px 13px;
  }
  .ms-v {
    font-size: 12.5px;
  }

  .clock-sep {
    display: none;
  }

  .garden-clock {
    gap: 6px 18px;
  }

  .clock-unit {
    min-width: 62px;
  }

  .bubble {
    max-width: 24ch;
    font-size: 13px;
    padding: 10px 13px;
  }

  .chat-av {
    width: 26px;
    height: 26px;
  }

  .term-body {
    min-height: 200px;
    font-size: 11.5px;
    line-height: 1.95;
  }

  .neon-title {
    line-height: 1.4;
  }

  .story-cap {
    font-size: 12px;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  .hero-cast {
    margin-bottom: 14px;
  }
  .hero-char {
    width: clamp(92px, 12vw, 150px);
  }
  .scroll-hint {
    display: none;
  }
  .letter-body {
    min-height: 9em;
  }
}
