:root {
  --night: #1c2338;
  --cloth: #2f3b5e;
  --foil: #d2b97f;
  --foil-deep: #a8853f;
  --paper: #f6f0ee;
  --paper-edge: #e7dcd8;
  --ink: #2a2d3a;
  --ink-soft: #6d6873;
  --rose: #b4536a;
  --moon: #efe6dc;      /* 夜色里的文字 */

  --font: "LXGW WenKai", "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
}
html.is-locked, html.is-locked body { overflow: hidden; height: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

/* ---------- 固定背景层 ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--paper);
}
.stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--rose);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ---------- 通用按钮 ---------- */

.pill {
  border: 0;
  border-radius: 999px;
  padding: 11px 28px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.pill:hover { background: var(--rose); }
.ghost {
  border: 0;
  background: none;
  padding: 10px 8px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
}
.ghost:hover { color: var(--rose); }

/* =========================================================
 * 封面 + 密码（最上层）
 * ======================================================= */

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, #2a3352 0%, transparent 70%),
    var(--night);
  overflow: hidden;
}
.intro-stage {
  perspective: 2400px;
  display: grid;
  place-items: center;
}
.book3d {
  position: relative;
  width: min(460px, calc((100svh - 48px) * 0.72), calc(100vw - 36px));
  aspect-ratio: 0.72;
  transform-style: preserve-3d;
}
.book3d::before {
  content: "";
  position: absolute;
  inset: 5px -6px -6px 5px;
  border-radius: 2px 10px 10px 2px;
  background: var(--paper-edge);
  box-shadow: 3px 3px 0 #d9ccc7, 6px 6px 0 #cbbcb6, 0 30px 60px rgba(5, 8, 20, 0.55);
}

.inner-page {
  position: absolute;
  inset: 0;
  border-radius: 2px 10px 10px 2px;
  background:
    linear-gradient(90deg, rgba(60, 30, 40, 0.12) 0, rgba(60, 30, 40, 0) 26px),
    var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10% 11%;
}

.gate-kicker { margin: 0 0 8px; color: var(--rose); font-size: 15px; }
.gate-q { margin: 0; font-size: clamp(22px, 5.4vmin, 28px); line-height: 1.45; }
.gate input {
  width: 100%;
  margin-top: 34px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 22px;
  outline: none;
}
.gate input:focus { border-bottom-color: var(--rose); }
.gate-row { display: flex; justify-content: flex-end; margin-top: 18px; }
.gate-msg { min-height: 1.8em; margin: 16px 0 0; font-size: 16px; color: var(--rose); }

.cover3d {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  cursor: pointer;
}
.cover3d .face,
.fcover .face {
  position: absolute;
  inset: 0;
  border-radius: 2px 10px 10px 2px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.face.front {
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(255, 255, 255, 0.07), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 5px),
    var(--cloth);
  color: var(--foil);
  box-shadow: inset 14px 0 18px -10px rgba(0, 0, 0, 0.5);
}
.face.back {
  transform: rotateY(180deg);
  background: linear-gradient(270deg, #dccfca, var(--paper-edge) 30%);
  border-radius: 10px 2px 2px 10px;
}

.dedication {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  font-size: clamp(18px, 4vmin, 22px);
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

.cover-frame {
  position: absolute;
  inset: 18px 18px 18px 30px;
  border: 1px solid rgba(210, 185, 127, 0.45);
  pointer-events: none;
}
.cover-frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(210, 185, 127, 0.22);
}
.cover-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 36px 40px 48px;
  text-align: center;
}
.cover-numeral {
  font-size: clamp(110px, 30vmin, 200px);
  line-height: 0.85;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, #f1e2b5 0%, var(--foil) 40%, #a88a4e 75%, #e6d29d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cover-title { margin-top: 18px; font-size: clamp(24px, 5vmin, 32px); letter-spacing: 0.12em; }
.cover-line { margin-top: 14px; font-size: 15px; color: rgba(210, 185, 127, 0.75); letter-spacing: 0.06em; }
.cover-hint {
  position: absolute;
  bottom: 42px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: rgba(210, 185, 127, 0.75);
  animation: breathe 2.6s ease-in-out infinite;
}
.is-countdown .cover-hint { animation: none; color: rgba(210, 185, 127, 0.9); }
.is-countdown.cover3d { cursor: default; }
@keyframes breathe { 50% { opacity: 0.35; } }

.gate.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* =========================================================
 * 滚动故事
 * ======================================================= */

.story { position: relative; }
section { position: relative; }

/* ---------- 开场 ---------- */

.hero {
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 0 24px;
}
.hero-inner {
  position: relative;
  width: 100%;
  max-width: 720px;
  display: grid;
  place-items: center;
}
.hero-inner > * { grid-area: 1 / 1; }
.hero-top { display: flex; flex-direction: column; align-items: center; }

.big26 {
  width: min(86vw, 560px);
  overflow: visible;
  transform-origin: 50% 58%;
}
.big26 text {
  font-family: var(--font);
  font-size: 300px;
  font-weight: 700;
  letter-spacing: -12px;
  fill: url(#foil);
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 6.5vw, 44px);
  font-weight: 400;
  letter-spacing: 0.14em;
}
.hero-line { margin: 12px 0 0; font-size: 16px; color: var(--ink-soft); letter-spacing: 0.04em; }
.hero-title .ch { display: inline-block; }

.intro-lines {
  font-size: clamp(26px, 6.4vw, 46px);
  line-height: 1.7;
  font-weight: 700;
}
.intro-lines p { margin: 0; opacity: 0; }

.scroll-hint {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-hint span {
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--ink-soft), transparent);
  animation: drip 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- 时间线 ---------- */

.timeline { padding: 18svh 0 26svh; overflow-x: hidden; }  /* 照片入场前的偏移不能撑宽页面 */
.section-title {
  margin: 0 0 12svh;
  text-align: center;
  font-size: clamp(30px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.tl-track {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}
.tl-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 2px;
  background: rgba(42, 45, 58, 0.1);
}
.tl-line span {
  display: block;
  height: 100%;
  background: linear-gradient(var(--rose), var(--foil-deep));
  transform-origin: top;
  transform: scaleY(0);
}
.tl-items { display: grid; gap: 22svh; }

.tl-item {
  position: relative;
  isolation: isolate;
  padding-left: 52px;
}
.tl-dot {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid rgba(42, 45, 58, 0.25);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.tl-item.is-lit .tl-dot {
  background: var(--rose);
  border-color: var(--rose);
  box-shadow: 0 0 0 6px rgba(180, 83, 106, 0.15);
}
.tl-year {
  position: absolute;
  top: -0.42em;
  right: -4px;
  font-size: clamp(90px, 26vw, 220px);
  font-weight: 700;
  line-height: 1;
  color: rgba(168, 133, 63, 0.12);
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
.tl-photo {
  margin: 0;
  width: min(100%, 420px);
  background: #fff;
  padding: 10px 10px 0;
  box-shadow: 0 1px 2px rgba(40, 20, 30, 0.12), 0 18px 40px rgba(40, 20, 30, 0.18);
}
.tl-clip {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #ece4e1;
}
.tl-clip img,
.tl-clip .placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tl-clip .placeholder {
  display: grid;
  place-items: center;
  color: #b3a6a8;
  font-size: 15px;
  background: linear-gradient(135deg, #efe5e3, #e2d6d6);
}
.tl-photo figcaption { height: 34px; }
.tl-date { margin: 22px 0 0; font-size: 15px; color: var(--rose); }
.tl-text { margin: 8px 0 0; max-width: 20em; font-size: clamp(18px, 4.6vw, 22px); line-height: 1.8; }

@media (min-width: 900px) {
  .tl-line { left: 50%; margin-left: -1px; }
  .tl-items { gap: 16svh; }
  .tl-item {
    width: 50%;
    padding: 0 76px 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
  }
  .tl-item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 0 76px;
    align-items: flex-start;
    text-align: left;
  }
  .tl-dot { left: auto; right: -9px; }
  .tl-item:nth-child(even) .tl-dot { left: -7px; right: auto; }
  .tl-year { right: auto; left: -40%; }
  .tl-item:nth-child(even) .tl-year { left: auto; right: -40%; }
  .tl-text { max-width: 18em; }
}

/* ---------- 3D 回忆 ---------- */

.gallery3d { display: none; position: relative; height: 100svh; overflow: hidden; }
html.has-3d .gallery3d { display: block; }
html.has-3d .timeline { display: none; }
.g3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.g3d-title {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  font-size: clamp(30px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.g3d-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(8svh, 48px);
  margin: 0 auto;
  max-width: 26em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 14px var(--paper), 0 0 4px var(--paper);
}
.g3d-date { margin: 0; font-size: 15px; color: var(--rose); letter-spacing: 0.06em; }
.g3d-text { margin: 8px 0 0; font-size: clamp(18px, 4.6vw, 23px); line-height: 1.75; }

/* ---------- 关灯 ---------- */

.lights {
  height: 100svh;
  display: grid;
  place-items: center;
  color: var(--moon);
  text-align: center;
}
.lights-line {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(34px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0;
}

/* ---------- 蛋糕 ---------- */

.cake-scene {
  height: 100svh;
  display: grid;
  place-items: center;
  color: var(--moon);
  padding: 40px 20px;
}
.cake-inner {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cake-kicker { margin: 0; font-size: clamp(22px, 5.6vw, 30px); letter-spacing: 0.08em; }
.cake-wrap { width: 100%; margin: 4svh 0 2svh; }
.cake-wrap svg { width: 100%; height: auto; overflow: visible; display: block; }
.cake-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 120px;
  opacity: 0;
}
.cake-scene .pill { background: var(--moon); color: var(--night); }
.cake-scene .pill:hover { background: #fff; }
.cake-scene .ghost { color: rgba(239, 230, 220, 0.7); }
.cake-status { margin: 4px 0 0; min-height: 1.6em; font-size: 16px; color: rgba(239, 230, 220, 0.8); }
.breath {
  width: 140px;
  height: 3px;
  border-radius: 2px;
  background: rgba(239, 230, 220, 0.15);
  overflow: hidden;
  visibility: hidden;
}
.breath.is-on { visibility: visible; }
.breath span { display: block; height: 100%; width: 0; background: var(--foil); transition: width 0.08s linear; }

.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 0.18s ease-in-out infinite alternate;
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}
.flame:nth-of-type(3n) { animation-duration: 0.22s; }
.flame:nth-of-type(4n) { animation-duration: 0.15s; }
.flame.is-out { animation: none; transform: scale(0.1, 0); opacity: 0; }
@keyframes flicker {
  from { transform: scale(1, 1) skewX(-2deg); }
  to   { transform: scale(0.92, 1.08) skewX(2deg); }
}
.glow { transition: opacity 0.6s; }
.smoke {
  fill: none;
  stroke: rgba(220, 210, 220, 0.6);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
}
.smoke.is-rising { animation: smoke 1.6s ease-out forwards; }
@keyframes smoke {
  0%   { opacity: 0; transform: translateY(0); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px); }
}

/* ---------- 信 ---------- */

.letter-scene {
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 0 18px;
}
.letter {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(36px, 8vw, 64px) clamp(24px, 7vw, 60px);
  background: #fbf7f5;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(40, 20, 30, 0.06), 0 30px 70px rgba(40, 20, 30, 0.14);
}
/* 信纸的可视区域：长信在这里面往上走，上下边缘淡出 */
.letter-window {
  max-height: calc(100svh - 190px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent 0, #000 28px, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(transparent 0, #000 28px, #000 calc(100% - 36px), transparent 100%);
}
.letter-inner { padding: 20px 0 30px; }
.letter-body p {
  margin: 0 0 1.1em;
  font-size: clamp(18px, 4.6vw, 21px);
  line-height: 2;
}
.letter-body .ch { opacity: 0.14; }
.signature { margin: 2em 0 0; text-align: right; font-size: 20px; opacity: 0; }

/* ---------- 礼物 & 兑换券 ---------- */

.gifts {
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
  perspective: 900px;
}
.gift-line {
  margin: 0 0 6svh;
  font-size: clamp(22px, 5.6vw, 30px);
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr;
  min-height: 84px;
  background: var(--rose);
  color: #fff6f3;
  border-radius: 8px;
  transform-origin: 50% 0;
  /* 两侧的半圆缺口 */
  -webkit-mask: radial-gradient(circle 10px at 74px 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 10px at 74px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 10px at 74px 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 10px at 74px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket:nth-child(3n + 2) { background: var(--cloth); }
.ticket:nth-child(3n + 3) { background: #8a6a3a; }
.ticket-stub {
  display: grid;
  place-items: center;
  border-right: 2px dashed rgba(255, 246, 243, 0.4);
  font-size: 22px;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}
.ticket-body { display: flex; align-items: center; padding: 16px 20px; font-size: 18px; line-height: 1.5; }

/* ---------- 合书 ---------- */

.finale {
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}
.finale-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 2400px;
}
.fbook {
  position: relative;
  width: min(340px, 62vw, calc((100svh - 220px) * 0.72));
  aspect-ratio: 0.72;
  transform-style: preserve-3d;
}
.fbook::before {
  content: "";
  position: absolute;
  inset: 4px -5px -5px 4px;
  border-radius: 2px 8px 8px 2px;
  background: var(--paper-edge);
  box-shadow: 2px 2px 0 #d9ccc7, 4px 4px 0 #cbbcb6, 0 24px 50px rgba(40, 20, 30, 0.3);
}
.fpage {
  position: absolute;
  inset: 0;
  border-radius: 2px 8px 8px 2px;
  background: linear-gradient(90deg, rgba(60, 30, 40, 0.12) 0, rgba(60, 30, 40, 0) 20px), #fbf7f5;
  display: grid;
  place-items: center;
  padding: 14%;
}
.fpage-text { margin: 0; font-size: clamp(18px, 4.6vw, 22px); line-height: 1.8; text-align: center; }
.fcover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: rotateY(-168deg);
}
.fcover .face.front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.fcover .cover-frame { inset: 12px 12px 12px 22px; }
.fcover-title {
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: 0.12em;
  background: linear-gradient(160deg, #f1e2b5 0%, var(--foil) 40%, #a88a4e 75%, #e6d29d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fcover-sub { margin-top: 12px; font-size: 14px; letter-spacing: 0.3em; color: rgba(210, 185, 127, 0.7); }
.finale-wish {
  margin: 6svh 0 0;
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0;
}
.again { margin-top: 10px; opacity: 0; }

/* ---------- 电影感浮层 ---------- */

.bars { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 11svh;
  background: #07090f;
  transform: scaleY(0);
}
.bar.top { top: 0; transform-origin: top; }
.bar.bottom { bottom: 0; transform-origin: bottom; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 45;
  pointer-events: none;
  opacity: 0.07;
  background-size: 180px 180px;
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 4%); }
  40%  { transform: translate(5%, -7%); }
  60%  { transform: translate(-3%, 8%); }
  80%  { transform: translate(7%, 2%); }
  100% { transform: translate(-2%, -5%); }
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  background: radial-gradient(ellipse 95% 85% at 50% 50%, transparent 62%, rgba(20, 10, 18, 0.16) 100%);
}
.flicker {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  background: #05060b;
  opacity: 0;
}

.title-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
  padding: 0 24px;
}
.title-card p {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(20px, 5vw, 30px);
  letter-spacing: 0.18em;
  color: var(--ink);
  opacity: 0;
}

/* 照片缓慢推拉 */
.dev, .kb {
  position: absolute;
  inset: 0;
}
.kb {
  position: absolute;
  inset: 0;
  animation: kenburns 14s ease-in-out infinite alternate;
}
.tl-item:nth-child(2n) .kb { animation-name: kenburns-b; animation-duration: 16s; }
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.12) translate(-3%, -2%); }
}
@keyframes kenburns-b {
  from { transform: scale(1.1) translate(3%, 2%); }
  to   { transform: scale(1) translate(0, 0); }
}

/* 流星 */
.shooting {
  position: fixed;
  top: 12svh;
  left: 0;
  width: 220px;
  height: 2px;
  z-index: 22;
  pointer-events: none;
  opacity: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 244, 220, 0), rgba(255, 244, 220, 0.9) 85%, #fff);
  box-shadow: 0 0 10px rgba(255, 230, 180, 0.8);
}

/* ---------- 浮层 ---------- */

.music-toggle {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 35, 56, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.music-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--foil);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.music-toggle.is-playing svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* 减少动效时不固定，长内容正常展开 */
.rm .cake-scene, .rm .letter-scene, .rm .gifts { height: auto; min-height: 100svh; padding-top: 12svh; padding-bottom: 12svh; }
.rm .letter-window { max-height: none; -webkit-mask-image: none; mask-image: none; }

/* ---------- 减少动效：直接展示最终状态 ---------- */

@media (prefers-reduced-motion: reduce) {
  .flame, .cover-hint, .scroll-hint span, .music-toggle.is-playing svg, .grain, .kb { animation: none; }
}
