/* =========================================================================
   宝宝的 24 岁平安夜生日惊喜 · 六幕沉浸式剧场样式表
   ========================================================================= */

:root {
  --bg-cream: #faf5ee;
  --bg-paper: #fffdf9;
  --ink-primary: #3b312a;
  --ink-secondary: #6e5f53;
  --ink-muted: #9a8b7d;
  --accent-gold: #c79a52;
  --accent-gold-light: #f4d99b;
  --accent-matcha: #7d9672;
  --accent-rose: #c97d72;
  --wax-red: #a74c45;
  --wax-red-dark: #7d322c;
  --shadow-soft: 0 16px 40px rgba(87, 67, 48, 0.1);
  --shadow-card: 0 22px 50px rgba(72, 54, 37, 0.14);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-hand: "Ma Shan Zheng", "Kaiti SC", "STKaiti", "KaiTi", cursive;
  --font-en: "Cormorant Garamond", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-serif);
  color: var(--ink-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.75;
  transition: background 1.1s cubic-bezier(0.22, 1, 0.36, 1), color 0.8s ease;
}

/* 白昼暖奶油手账氛围（第 1、2、3、5 幕） */
body.theme-warm {
  background-color: var(--bg-cream);
  background-image:
    radial-gradient(circle at 18% 15%, rgba(242, 220, 188, 0.42), transparent 44%),
    radial-gradient(circle at 85% 24%, rgba(212, 228, 203, 0.38), transparent 46%),
    radial-gradient(circle at 50% 88%, rgba(240, 214, 200, 0.32), transparent 52%);
}

/* 暗灯平安夜星空氛围（第 4 幕吹蜡烛 & 第 6 幕纪念票根） */
body.theme-night {
  background-color: #161321;
  background-image:
    radial-gradient(circle at 50% 24%, rgba(86, 63, 108, 0.46), transparent 54%),
    radial-gradient(circle at 18% 82%, rgba(182, 134, 72, 0.2), transparent 48%),
    radial-gradient(circle at 84% 76%, rgba(164, 98, 114, 0.18), transparent 46%);
  color: #f9f2e7;
}

/* 细腻纸张微粒蒙层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  background-image: radial-gradient(rgba(110, 88, 66, 0.16) 0.55px, transparent 0.55px);
  background-size: 16px 16px;
}

body.theme-night::before {
  opacity: 0.08;
}

#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

#fireworks-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 65;
}

.hidden {
  display: none !important;
}

/* =========================================================================
   顶部极简导航：星光进度点 + 黑胶唱片播放器
   ========================================================================= */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.scene-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  border: 1px solid rgba(199, 168, 128, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(82, 60, 40, 0.08);
  transition: background 0.6s ease, border-color 0.6s ease;
}

body.theme-night .scene-dots {
  background: rgba(28, 23, 39, 0.72);
  border-color: rgba(244, 217, 155, 0.25);
}

.scene-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(154, 139, 125, 0.32);
  cursor: default;
  transition: all 0.35s ease;
  padding: 0;
}

.scene-dot.is-unlocked {
  background: rgba(199, 154, 82, 0.52);
  cursor: pointer;
}

.scene-dot.is-active {
  width: 22px;
  background: var(--accent-gold);
  box-shadow: 0 0 10px rgba(214, 169, 92, 0.55);
}

body.theme-night .scene-dot {
  background: rgba(255, 245, 230, 0.2);
}

body.theme-night .scene-dot.is-unlocked {
  background: rgba(244, 217, 155, 0.52);
}

body.theme-night .scene-dot.is-active {
  background: var(--accent-gold-light);
}

.vinyl-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid rgba(197, 168, 128, 0.42);
  background: rgba(255, 253, 249, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(84, 62, 42, 0.12);
  cursor: pointer;
  color: var(--ink-primary);
  transition: all 0.35s ease;
}

body.theme-night .vinyl-btn {
  background: rgba(28, 23, 39, 0.78);
  border-color: rgba(244, 217, 155, 0.32);
  color: #f9f2e7;
}

.vinyl-disc {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    #2a2420 0px,
    #2a2420 2px,
    #3d352f 2.5px,
    #241f1b 4px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vinyl-disc.spinning {
  animation: spinDisc 6.5s linear infinite;
}

.vinyl-center {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eccb8f, #b98940);
  border: 2px solid #fffdf9;
}

.vinyl-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.22;
  max-width: 114px;
}

.vinyl-title {
  font-family: var(--font-en);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vinyl-artist {
  font-size: 0.66rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body.theme-night .vinyl-artist {
  color: rgba(249, 242, 231, 0.68);
}

.vinyl-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
  opacity: 0.4;
}

.vinyl-status-dot.playing {
  background: var(--accent-matcha);
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(125, 150, 114, 0.24);
}

/* =========================================================================
   剧场舞台与通用幕次切换
   ========================================================================= */

.theater-viewport {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  width: 100%;
}

.scene {
  display: none;
  min-height: 100dvh;
  width: 100%;
  padding: 78px 18px 42px;
}

.scene.is-active {
  display: flex;
  flex-direction: column;
  animation: sceneEnter 0.78s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.scene-inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.center-stage {
  margin: auto;
  text-align: center;
}

.story-stage {
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
}

.kicker {
  font-family: var(--font-en);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.night-kicker {
  color: var(--accent-gold-light);
}

.hand-title {
  font-family: var(--font-hand);
  font-size: clamp(2rem, 7.5vw, 2.6rem);
  font-weight: 400;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.hero-hand-title {
  font-family: var(--font-hand);
  font-size: clamp(2.05rem, 7.6vw, 3.05rem);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.25;
  margin-bottom: 12px;
  text-wrap: balance;
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 5vw, 1.98rem);
  font-weight: 500;
  color: var(--ink-primary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-wrap: balance;
}

.night-title {
  color: #fff8ed;
  text-shadow: 0 2px 18px rgba(244, 217, 155, 0.24);
}

.soft-desc {
  max-width: 460px;
  margin: 0 auto;
  font-size: 0.93rem;
  color: var(--ink-secondary);
  text-wrap: balance;
}

.soft-desc.compact {
  font-size: 0.87rem;
}

.night-desc {
  color: rgba(249, 242, 231, 0.8);
}

.scene-head {
  margin-bottom: 22px;
}

/* =========================================================================
   仪式感按钮系统
   ========================================================================= */

.btn-ritual,
.btn-gold-glow,
.btn-night-outline,
.btn-soft-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-ritual {
  border: none;
  color: #fffdf9;
  background: linear-gradient(135deg, #c99a54 0%, #b17f3c 100%);
  box-shadow: 0 12px 28px rgba(177, 127, 60, 0.32);
}

.btn-ritual:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 32px rgba(177, 127, 60, 0.42);
}

.btn-ritual:active,
.btn-gold-glow:active {
  transform: scale(0.97);
}

.btn-gold-glow {
  border: 1px solid rgba(255, 233, 186, 0.55);
  color: #2b2015;
  font-weight: 500;
  background: linear-gradient(135deg, #fae3b0 0%, #e4bc72 100%);
  box-shadow: 0 0 26px rgba(244, 210, 134, 0.42), 0 10px 24px rgba(0, 0, 0, 0.3);
}

.btn-gold-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(244, 210, 134, 0.58), 0 12px 28px rgba(0, 0, 0, 0.36);
}

.btn-gold-glow.listening {
  background: linear-gradient(135deg, #f3be9e 0%, #dc8f73 100%);
  color: #fffdf9;
}

.btn-night-outline {
  border: 1px solid rgba(244, 217, 155, 0.42);
  background: rgba(255, 250, 240, 0.08);
  color: #f9edd8;
}

.btn-night-outline:hover {
  background: rgba(255, 250, 240, 0.16);
}

.btn-soft-icon {
  padding: 11px 16px;
  border: 1px solid rgba(197, 168, 128, 0.55);
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink-secondary);
  font-size: 0.85rem;
}

.btn-text-link {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 6px 10px;
}

.btn-svg-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-arrow {
  transition: transform 0.25s ease;
}

.btn-ritual:hover .btn-arrow,
.btn-gold-glow:hover .btn-arrow {
  transform: translateX(3px);
}

/* =========================================================================
   第 1 幕：火漆信封开场
   ========================================================================= */

#scene-0 {
  padding-top: 28px;
}

.envelope-flora {
  width: 72px;
  height: 86px;
  margin-bottom: 4px;
  animation: gentleFloat 4.8s ease-in-out infinite;
}

.calla-lily-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 14px rgba(130, 110, 82, 0.15));
}

.envelope-card {
  position: relative;
  width: min(306px, 84vw);
  height: 206px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin-top: 12px;
  perspective: 1100px;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
  outline: none;
}

.envelope-card:hover {
  transform: translateY(-4px);
}

.envelope-back {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(155deg, #f8f0e3, #eadcc6);
  box-shadow: 0 24px 50px rgba(96, 73, 49, 0.2), 0 4px 12px rgba(96, 73, 49, 0.08);
  border: 1px solid rgba(197, 168, 128, 0.48);
}

.envelope-letter-peek {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 16px;
  bottom: 18px;
  border-radius: 10px;
  background: #fffdf8;
  border: 1px solid rgba(212, 193, 165, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(90, 68, 45, 0.08);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s;
  z-index: 2;
}

.peek-line {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 1.14rem;
  color: var(--accent-gold);
}

.peek-sub {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: var(--ink-primary);
}

.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.envelope-pocket::before,
.envelope-pocket::after {
  content: "";
  position: absolute;
  inset: 0;
}

.envelope-pocket::before {
  background: linear-gradient(135deg, #f3e7d5 0%, #ede0cc 100%);
  clip-path: polygon(0 0, 52% 54%, 0 100%);
}

.envelope-pocket::after {
  background: linear-gradient(225deg, #f1e4d0 0%, #e7d7bf 100%);
  clip-path: polygon(100% 0, 48% 54%, 100% 100%);
}

.envelope-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #efe2ce 0%, #e6d5bc 100%);
  clip-path: polygon(0 100%, 50% 12%, 100% 100%);
  z-index: 4;
  pointer-events: none;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #faf3e8 0%, #ebdcca 100%);
  clip-path: polygon(0 0, 100% 0, 50% 96%);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.32, 0.08, 0.24, 1);
  z-index: 5;
  filter: drop-shadow(0 5px 8px rgba(99, 75, 51, 0.14));
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #cc6961 0%, var(--wax-red) 55%, var(--wax-red-dark) 100%);
  box-shadow:
    0 10px 22px rgba(125, 50, 44, 0.38),
    inset 0 2px 4px rgba(255, 224, 210, 0.35),
    inset 0 -3px 6px rgba(68, 22, 18, 0.45);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s ease, opacity 0.45s ease;
  animation: sealPulse 2.3s ease-in-out infinite;
}

.wax-seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.2px solid rgba(255, 228, 206, 0.45);
}

.wax-seal-inner {
  font-family: var(--font-en);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fceadd;
}

.envelope-card.is-opening .wax-seal {
  animation: none;
  transform: scale(1.28);
  opacity: 0;
}

.envelope-card.is-opening .envelope-flap {
  transform: rotateX(-178deg);
  z-index: 1;
}

.envelope-card.is-opening .envelope-letter-peek {
  transform: translateY(-82px) scale(1.04);
}

.envelope-caption {
  margin-top: 26px;
}

.pulse-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid rgba(199, 154, 82, 0.42);
  font-size: 0.83rem;
  color: var(--accent-gold);
  box-shadow: 0 8px 18px rgba(130, 100, 62, 0.1);
  animation: softGlow 2.4s ease-in-out infinite;
}

/* =========================================================================
   第 2 幕：星光序章（逐条解锁）
   ========================================================================= */

.paper-card {
  position: relative;
  width: 100%;
  background: var(--bg-paper);
  border: 1px solid rgba(206, 185, 155, 0.56);
  border-radius: 22px;
  padding: clamp(28px, 5vw, 44px) clamp(18px, 5vw, 38px);
  box-shadow: var(--shadow-card);
}

.paper-tape {
  position: absolute;
  width: 74px;
  height: 20px;
  top: -10px;
  background: rgba(215, 226, 204, 0.76);
  border: 1px solid rgba(154, 177, 141, 0.25);
}

.tape-left {
  left: 22px;
  transform: rotate(-7deg);
}

.tape-right {
  right: 22px;
  background: rgba(238, 219, 188, 0.78);
  transform: rotate(6deg);
}

/* 逐条展开的步进模块 */
.step-block {
  display: none;
  margin-top: 20px;
}

.step-block.is-shown {
  display: block;
  animation: popReveal 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.floral-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 18px;
  max-width: 240px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 168, 128, 0.65), transparent);
}

.mini-lily {
  width: 28px;
  height: 28px;
}

.timer-box {
  background: linear-gradient(180deg, #faf4ea 0%, #f5ece0 100%);
  border: 1px dashed rgba(197, 168, 128, 0.75);
  border-radius: 16px;
  padding: 18px 12px;
}

.timer-lead {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
  text-wrap: balance;
}

.timer-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.8vw, 12px);
}

.timer-unit {
  background: #fffdf9;
  border: 1px solid rgba(206, 185, 155, 0.48);
  border-radius: 11px;
  min-width: clamp(56px, 15vw, 78px);
  padding: 9px 5px 7px;
  box-shadow: 0 5px 12px rgba(105, 80, 52, 0.06);
}

.timer-num {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(1.38rem, 4.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink-primary);
}

.timer-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.timer-sep {
  font-family: var(--font-en);
  font-size: 1.25rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.vows-heading {
  font-size: 0.84rem;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.vows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.vow-item {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #fbf7f0;
  border: 1px solid rgba(206, 185, 155, 0.5);
  position: relative;
}

.vow-item.is-stamped {
  display: flex;
  animation: stampIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.vow-no {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ebd6ae, #d4ac67);
  color: #fffdf9;
  font-family: var(--font-en);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vow-content {
  flex: 1;
  min-width: 0;
}

.vow-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.vow-note {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.vow-seal {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--wax-red);
  border: 1px solid rgba(167, 76, 69, 0.45);
  border-radius: 6px;
  padding: 2px 6px;
  transform: rotate(-8deg);
  flex-shrink: 0;
}

.stage-action {
  margin-top: 24px;
}

/* =========================================================================
   第 3 幕：胶片拍立得 · 单张抽出显影
   ========================================================================= */

.film-counter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.film-counter-text {
  font-family: var(--font-en);
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  color: var(--accent-gold);
  font-weight: 600;
}

.film-pips {
  display: flex;
  gap: 6px;
}

.film-pip {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: rgba(197, 168, 128, 0.3);
  transition: all 0.35s ease;
}

.film-pip.is-done {
  background: rgba(125, 150, 114, 0.72);
}

.film-pip.is-current {
  width: 28px;
  background: var(--accent-gold);
}

.polaroid-deck-stage {
  position: relative;
  width: min(352px, 90vw);
  min-height: 396px;
  margin: 4px auto 22px;
  perspective: 1200px;
}

.deck-back-card {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #f9f3e9;
  border: 1px solid rgba(206, 185, 155, 0.48);
  box-shadow: 0 12px 26px rgba(84, 62, 42, 0.08);
  pointer-events: none;
}

.card-back-2 {
  transform: rotate(-4deg) translate(-6px, 8px);
  opacity: 0.68;
}

.card-back-1 {
  transform: rotate(3deg) translate(6px, 4px);
  opacity: 0.84;
}

.active-polaroid-host {
  position: relative;
  width: 100%;
  min-height: 396px;
  z-index: 3;
}

.polaroid-motion-wrap {
  width: 100%;
  min-height: 396px;
  perspective: 1200px;
  animation: drawCardIn 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid-motion-wrap.is-leaving {
  animation: drawCardOut 0.3s ease forwards;
}

.polaroid-inner {
  position: relative;
  width: 100%;
  min-height: 396px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.polaroid-inner.is-flipped {
  transform: rotateY(180deg);
}

.polaroid-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fffefb;
  border-radius: 10px;
  padding: 15px 15px 18px;
  border: 1px solid rgba(206, 185, 155, 0.56);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.polaroid-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 76px;
  height: 20px;
  background: rgba(235, 218, 188, 0.82);
  border: 1px solid rgba(196, 165, 118, 0.25);
  z-index: 4;
}

.polaroid-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.05;
  border-radius: 5px;
  overflow: hidden;
  background: #f1e9de;
  margin-bottom: 14px;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  display: block;
  animation: developPhoto 1.05s ease forwards;
}

.polaroid-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  position: relative;
  animation: developPhoto 0.9s ease forwards;
}

.polaroid-placeholder::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(120, 98, 74, 0.28);
  border-radius: 4px;
}

.tone-warm-peach { background: linear-gradient(145deg, #f8ece0 0%, #ebd6c3 100%); }
.tone-matcha-cream { background: linear-gradient(145deg, #edf3e7 0%, #d8e5ce 100%); }
.tone-apricot-film { background: linear-gradient(145deg, #f9efe1 0%, #edd9bd 100%); }
.tone-lavender-mist { background: linear-gradient(145deg, #f3eef5 0%, #e4dbe8 100%); }
.tone-honey-amber { background: linear-gradient(145deg, #f7eedc 0%, #e6d4b3 100%); }
.tone-sage-gold { background: linear-gradient(145deg, #eef2e8 0%, #e3d8c2 100%); }

.placeholder-film-no {
  font-family: var(--font-en);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.placeholder-lily {
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  opacity: 0.85;
}

.placeholder-tip {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  max-width: 205px;
}

.polaroid-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.88);
  font-family: var(--font-en);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
}

.zoom-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: none;
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(59, 49, 42, 0.72);
  color: #fffdf9;
  font-size: 0.72rem;
  font-family: var(--font-serif);
  cursor: pointer;
}

.polaroid-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.polaroid-date {
  font-family: var(--font-en);
  font-size: 0.86rem;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
}

.polaroid-caption {
  font-family: var(--font-hand);
  font-size: 1.42rem;
  color: var(--ink-primary);
  line-height: 1.3;
}

.flip-hint {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.76rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.polaroid-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f0e4 100%);
  padding: 26px 22px 20px;
  justify-content: space-between;
}

.back-header {
  border-bottom: 1px dashed rgba(197, 168, 128, 0.62);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.back-date {
  font-family: var(--font-en);
  font-size: 0.84rem;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
}

.back-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink-primary);
  margin-top: 4px;
}

.back-text {
  font-size: 0.95rem;
  line-height: 1.88;
  color: var(--ink-secondary);
  flex: 1;
}

.back-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(206, 185, 155, 0.35);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================================
   第 4 幕：暗灯点烛 · 24 岁抹茶小蛋糕 & 烟花
   ========================================================================= */

.cake-theater {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 8px;
}

.candle-aura {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 212, 126, 0.52) 0%,
    rgba(244, 178, 92, 0.18) 44%,
    rgba(244, 178, 92, 0) 72%
  );
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
  animation: auraPulse 2.4s ease-in-out infinite;
}

.candle-aura.is-off {
  opacity: 0;
  animation: none;
}

.cake-illustration {
  position: relative;
  width: min(286px, 82vw);
  margin: 14px auto 16px;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: filter 0.8s ease;
}

.cake-illustration.is-dark {
  filter: brightness(0.76);
}

.candles-row {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: -86px;
  padding-top: 12px;
}

.candle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle-body {
  width: 11px;
  height: 44px;
  border-radius: 4px 4px 2px 2px;
  background: repeating-linear-gradient(
    -45deg,
    #fff7e8,
    #fff7e8 5px,
    #e5c587 5px,
    #e5c587 9px
  );
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.candle.c2 .candle-body {
  height: 52px;
}

.wick {
  width: 2px;
  height: 6px;
  background: #5c4b40;
  border-radius: 2px;
}

.flame {
  width: 15px;
  height: 24px;
  margin-bottom: -1px;
  border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%;
  background: radial-gradient(circle at 50% 72%, #fffde8 0%, #ffd46e 44%, #f4973c 88%, rgba(244, 151, 60, 0) 100%);
  box-shadow: 0 0 18px rgba(255, 198, 92, 0.92), 0 0 36px rgba(255, 166, 61, 0.52);
  transform-origin: bottom center;
  animation: flicker 1.1s ease-in-out infinite alternate;
  transition: transform 0.25s ease, opacity 0.45s ease;
}

.candle.c2 .flame { animation-delay: 0.2s; }
.candle.c3 .flame { animation-delay: 0.4s; }

.flame.is-unlit,
.flame.extinguished {
  opacity: 0;
  transform: scale(0.1) translateY(8px);
  animation: none;
}

.smoke {
  position: absolute;
  top: -12px;
  width: 12px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 236, 226, 0.72), transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.smoke.rising {
  animation: smokeRise 2.1s ease-out forwards;
}

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

.blow-meter-wrap {
  width: min(260px, 82%);
  margin: 4px auto 14px;
}

.blow-meter-label {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-gold-light);
  margin-bottom: 6px;
}

.blow-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.16);
  overflow: hidden;
}

.blow-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b9d4a6, #f4d99b);
  transition: width 0.08s linear;
}

.cake-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.mic-feedback {
  margin-top: 12px;
  font-size: 0.82rem;
  color: rgba(249, 242, 231, 0.76);
  min-height: 1.4em;
  max-width: 340px;
}

/* =========================================================================
   第 5 幕：手写感长情书 · 逐段温柔展开
   ========================================================================= */

.letter-paper {
  position: relative;
  width: 100%;
  background: #fffdf8;
  border: 1px solid rgba(206, 185, 155, 0.56);
  border-radius: 18px;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 46px);
  box-shadow: var(--shadow-card);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 34px,
    rgba(197, 168, 128, 0.17) 34px,
    rgba(197, 168, 128, 0.17) 35px
  );
  background-position: 0 22px;
}

.letter-watermark {
  position: absolute;
  right: 16px;
  bottom: 20px;
  width: 132px;
  height: 160px;
  opacity: 0.15;
  pointer-events: none;
}

.letter-stamp {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px dashed rgba(196, 122, 108, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(12deg);
  color: rgba(182, 102, 88, 0.76);
  font-family: var(--font-en);
  pointer-events: none;
}

.letter-stamp span { font-size: 0.8rem; font-weight: 600; }
.letter-stamp small { font-size: 0.48rem; letter-spacing: 0.1em; }

.letter-greeting {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  color: var(--ink-primary);
  margin-bottom: 14px;
}

.letter-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.letter-paragraph {
  display: none;
  font-size: clamp(0.95rem, 2.7vw, 1.02rem);
  line-height: 1.98;
  color: var(--ink-primary);
  text-indent: 2em;
}

.letter-paragraph.is-shown {
  display: block;
  animation: inkFadeIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.letter-signoff {
  position: relative;
  z-index: 2;
  margin-top: 28px;
  text-align: right;
  animation: inkFadeIn 0.9s ease forwards;
}

.signoff-lead { font-size: 0.9rem; color: var(--ink-secondary); margin-bottom: 4px; }
.signoff-name { font-family: var(--font-hand); font-size: 1.85rem; color: var(--ink-primary); margin-bottom: 4px; }
.signoff-date { font-size: 0.82rem; color: var(--ink-muted); }

.letter-controls {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   第 6 幕：终幕专属纪念票根
   ========================================================================= */

.keepsake-ticket {
  position: relative;
  width: min(390px, 92vw);
  margin: 8px auto 24px;
  border-radius: 20px;
  background: linear-gradient(155deg, #fffdf8 0%, #f6ecdc 100%);
  color: var(--ink-primary);
  border: 1.5px solid rgba(235, 200, 132, 0.85);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.44),
    0 0 36px rgba(244, 210, 134, 0.24);
  overflow: hidden;
  text-align: left;
  animation: ticketRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ticket-top {
  padding: 22px 22px 16px;
  background: linear-gradient(135deg, rgba(244, 217, 155, 0.22), rgba(185, 208, 171, 0.16));
}

.ticket-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--font-en);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
}

.ticket-pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(199, 154, 82, 0.5);
  background: rgba(255, 253, 249, 0.8);
}

.ticket-main-title {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 1.72rem;
  color: var(--ink-primary);
  line-height: 1.2;
  margin-bottom: 6px;
}

.ticket-sub-quote {
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.ticket-perforation {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}

.perf-line {
  width: 100%;
  border-top: 1.5px dashed rgba(197, 168, 128, 0.65);
  margin: 0 14px;
}

.notch {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1b1727;
}

.notch-left { left: -11px; }
.notch-right { right: -11px; }

.ticket-details {
  padding: 12px 22px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.ticket-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-label {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.cell-val {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-primary);
}

.ticket-footer {
  padding: 12px 22px 16px;
  border-top: 1px solid rgba(206, 185, 155, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  background: rgba(248, 240, 227, 0.65);
}

.ticket-footer strong {
  font-family: var(--font-en);
  font-size: 1.05rem;
  color: var(--wax-red);
}

.ticket-sign {
  font-family: var(--font-hand);
  font-size: 1.12rem;
  color: var(--ink-primary);
}

.finale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* =========================================================================
   照片大图灯箱
   ========================================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(24, 19, 28, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 253, 249, 0.3);
  background: rgba(255, 253, 249, 0.12);
  color: #fffdf9;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox-figure {
  max-width: min(760px, 92vw);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 74dvh;
  border-radius: 10px;
  border: 8px solid #fffdf9;
  object-fit: contain;
}

.lightbox-figure figcaption {
  color: #f6ede2;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  text-align: center;
}

/* =========================================================================
   动效关键帧 & 移动端适配
   ========================================================================= */

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

@keyframes popReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stampIn {
  0% { opacity: 0; transform: translateY(-10px) scale(1.06); }
  65% { opacity: 1; transform: translateY(2px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawCardIn {
  0% { opacity: 0; transform: translateY(28px) scale(0.94) rotate(-2.5deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes drawCardOut {
  to { opacity: 0; transform: translateX(-56px) rotate(-6deg) scale(0.95); }
}

@keyframes developPhoto {
  0% { filter: brightness(1.32) contrast(0.76) saturate(0.45) blur(3px); }
  100% { filter: brightness(1) contrast(0.98) saturate(0.98) blur(0); }
}

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

@keyframes ticketRise {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes sealPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes softGlow {
  0%, 100% { box-shadow: 0 8px 18px rgba(130, 100, 62, 0.1); }
  50% { box-shadow: 0 8px 24px rgba(199, 154, 82, 0.28); }
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes auraPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.92; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 0.72; }
}

@keyframes flicker {
  0% { transform: scale(1, 1) rotate(-2deg); }
  50% { transform: scale(0.94, 1.08) rotate(2.2deg); }
  100% { transform: scale(1.04, 0.96) rotate(-1.5deg); }
}

@keyframes smokeRise {
  0% { opacity: 0.76; transform: translateY(0) scale(0.7); }
  60% { opacity: 0.36; transform: translateY(-30px) translateX(6px) scale(1.45); }
  100% { opacity: 0; transform: translateY(-56px) translateX(-4px) scale(2); }
}

@media (max-width: 640px) {
  .scene {
    padding: 72px 14px 36px;
  }

  .vinyl-meta {
    max-width: 96px;
  }

  .scene-dots {
    gap: 6px;
    padding: 7px 10px;
  }

  .cake-actions,
  .finale-actions {
    flex-direction: column;
    align-items: stretch;
    width: min(268px, 86%);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
