/* ===== 王星宇 · 23 岁生日祝福站 ===== */

:root {
  --day-top: #9fd4e0;
  --day-mid: #c8e4d0;
  --day-sand: #f0e0c8;
  --day-flower: #e8b4c0;
  --dusk-top: #e8a078;
  --dusk-mid: #c07090;
  --dusk-sea: #4a6080;
  --night-top: #0c1228;
  --night-mid: #1a2744;
  --night-sea: #0e1a30;
  --ink: #2a2430;
  --ink-soft: rgba(42, 36, 48, 0.72);
  --paper: #f7f1e8;
  --star: #f2e9d8;
  --accent: #d4899a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --phase: 0;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Zen Maru Gothic", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--night-top);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  display: block;
}

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

/* ===== 天空层 ===== */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky-day,
.sky-dusk,
.sky-night {
  position: absolute;
  inset: 0;
  transition: opacity 0.15s linear;
}

.sky-day {
  background:
    radial-gradient(ellipse 80% 50% at 70% 18%, rgba(255, 244, 210, 0.55), transparent 55%),
    linear-gradient(180deg, var(--day-top) 0%, var(--day-mid) 42%, var(--day-sand) 72%, #d9c4a8 100%);
  opacity: calc(1 - var(--phase) * 1.35);
}

.sky-dusk {
  background:
    radial-gradient(ellipse 70% 45% at 78% 28%, rgba(255, 180, 120, 0.5), transparent 60%),
    linear-gradient(180deg, #f0b090 0%, var(--dusk-mid) 40%, var(--dusk-sea) 75%, #2a3858 100%);
  opacity: var(--dusk-opacity, 0);
}

.sky-night {
  background:
    radial-gradient(ellipse 50% 40% at 65% 20%, rgba(120, 140, 200, 0.25), transparent 55%),
    linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 45%, var(--night-sea) 100%);
  opacity: calc((var(--phase) - 0.35) / 0.65);
}

.horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 28%;
  height: 18%;
  background:
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(232, 180, 192, 0.35), transparent 70%);
  opacity: calc(1 - var(--phase) * 1.1);
  transform: translateY(calc(var(--phase) * 40px));
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background:
    linear-gradient(
      180deg,
      rgba(126, 184, 201, calc(0.55 - var(--phase) * 0.35)) 0%,
      rgba(40, 70, 100, calc(0.2 + var(--phase) * 0.55)) 45%,
      rgba(10, 20, 40, calc(0.15 + var(--phase) * 0.7)) 100%
    );
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%);
}

.foam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28%;
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: calc(0.7 - var(--phase) * 0.4);
  animation: foam-drift 7s ease-in-out infinite;
}

@keyframes foam-drift {
  0%, 100% { transform: translateX(-3%); opacity: 0.35; }
  50% { transform: translateX(3%); opacity: 0.55; }
}

.petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: calc(1 - var(--phase) * 1.2);
}

.petal {
  position: absolute;
  top: -10%;
  width: 10px;
  height: 14px;
  border-radius: 60% 40% 60% 40%;
  background: radial-gradient(circle at 30% 30%, #f5c8d2, #d4899a);
  animation: petal-fall linear infinite;
  opacity: 0.75;
}

@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(40px, 110vh, 0) rotate(360deg); }
}

.stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: calc((var(--phase) - 0.45) / 0.4);
}

/* 全屏背景流星雨（挂在固定天空层） */
.meteor-shower {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1s ease;
}

.meteor-shower.is-on {
  opacity: 1;
}

.meteor-shower span {
  position: absolute;
  width: 140px;
  height: 2px;
  border-radius: 2px;
  /* 头在左（运动方向：左下），尾在右（拖向右上） */
  background: linear-gradient(
    90deg,
    #fff 0%,
    rgba(255, 248, 220, 0.95) 18%,
    rgba(255, 250, 230, 0.35) 55%,
    rgba(255, 250, 230, 0.08) 82%,
    transparent 100%
  );
  filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.9));
  opacity: 0;
  will-change: transform, opacity;
  animation: meteor-rain-full 3.2s linear infinite;
}

.meteor-shower span::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 0 10px 3px rgba(255, 236, 190, 0.85);
}

@keyframes meteor-rain-full {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-40deg);
  }
  6% { opacity: 1; }
  70% { opacity: 0.85; }
  100% {
    opacity: 0;
    transform: translate3d(-120vw, 135vh, 0) rotate(-40deg);
  }
}

/* ===== 音乐按钮 ===== */

.music-btn {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(42, 36, 48, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  border: 1px solid rgba(42, 36, 48, 0.12);
  font-size: 12px;
  letter-spacing: 0.08em;
}

body.is-night .music-btn {
  background: rgba(247, 241, 232, 0.18);
  color: var(--star);
  border-color: rgba(255, 255, 255, 0.22);
}

.music-btn[hidden] {
  display: none;
}

/* 开场日间也显示音乐按钮 */
body.intro-mode .music-btn {
  background: rgba(42, 36, 48, 0.12);
  color: var(--ink);
  border-color: rgba(42, 36, 48, 0.12);
}

.music-btn.is-playing .music-icon {
  animation: pulse-note 1.2s ease-in-out infinite;
}

@keyframes pulse-note {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

/* ===== 开场 ===== */

.intro {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(48px + var(--safe-top))
    24px
    calc(40px + var(--safe-bottom));
  text-align: center;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro.is-leaving {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.intro-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(232, 180, 192, 0.35), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(255, 255, 255, 0.2), transparent 50%);
  pointer-events: none;
}

.intro-date {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.intro-name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 14vw, 4.4rem);
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(255, 255, 255, 0.35);
}

.intro-sub {
  position: relative;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

/* 信封 */

.envelope {
  position: relative;
  margin-top: 56px;
  width: min(220px, 58vw);
  aspect-ratio: 1.35 / 1;
  -webkit-user-select: none;
  user-select: none;
}

.envelope-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -8%;
  height: 18%;
  background: radial-gradient(ellipse, rgba(42, 36, 48, 0.22), transparent 70%);
  filter: blur(4px);
}

.envelope-body {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 800px;
}

.envelope-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #f3e6d4, #e8d2bc 55%, #dcc4a8);
  border: 1px solid rgba(90, 60, 50, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.envelope-front::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 48%, rgba(90, 60, 50, 0.08) 50%, transparent 52%);
}

.wax {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #e8a0a8, #b85c6a 70%);
  color: #f8e8e0;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(120, 40, 50, 0.25);
  z-index: 1;
}

.envelope-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
  background: linear-gradient(180deg, #ead7c0, #d9c0a4);
  border: 1px solid rgba(90, 60, 50, 0.15);
  transform-origin: top center;
  transform: rotateX(0deg);
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.envelope-letter {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18%;
  height: 70%;
  background: var(--paper);
  border: 1px solid rgba(90, 60, 50, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  letter-spacing: 0.25em;
  font-size: 14px;
  color: var(--ink-soft);
  z-index: 2;
  transform: translateY(12%);
  opacity: 0;
  transition: transform 0.8s 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s 0.25s ease;
}

.envelope.is-opening .envelope-letter {
  transform: translateY(-42%);
  opacity: 1;
}

.envelope-hint {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  animation: hint-breathe 2.4s ease-in-out infinite;
}

@keyframes hint-breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.envelope.is-opening .envelope-hint {
  opacity: 0;
  animation: none;
}

/* ===== 旅程 ===== */

.journey {
  position: relative;
  z-index: 5;
}

.journey[hidden] {
  display: none;
}

.journey.is-visible {
  display: block;
  animation: journey-in 0.9s ease forwards;
}

@keyframes journey-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.stop {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(72px + var(--safe-top))
    22px
    calc(48px + var(--safe-bottom));
}

.stop-start {
  position: relative;
  overflow: hidden;
  /* 锁定为一整屏，拆信封后直接落在爱心 */
  height: 100dvh;
  height: 100svh;
  min-height: 100dvh;
  min-height: 100svh;
  max-height: 100dvh;
  max-height: 100svh;
  padding: 0 !important;
  display: block;
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.heart-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding:
    calc(16px + var(--safe-top))
    16px
    calc(20px + var(--safe-bottom));
  box-sizing: border-box;
}

.heart-label {
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

.stop-title.heart-title {
  margin: 0 0 8px;
  position: relative;
  z-index: 2;
  font-family: "Allura", "Great Vibes", "Segoe Script", cursive;
  font-size: clamp(2.15rem, 9.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: #3a2e36;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 28px rgba(196, 90, 114, 0.14);
}

.heart-line {
  margin: 0 0 6px;
  position: relative;
  z-index: 2;
  font-size: 13px;
}

.heart-hit {
  position: relative;
  width: min(72vw, 320px);
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.heart-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.heart-love {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -40%) scale(0.92);
  width: 90%;
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-size: clamp(1.7rem, 7.5vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: #c45a72;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 20px rgba(255, 255, 255, 0.45);
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 3;
}

.heart-love.is-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.heart-hint {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(42, 36, 48, 0.5);
  transition: opacity 0.35s ease;
}

.heart-hint.is-hide {
  opacity: 0;
}

.heart-scroll {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + var(--safe-bottom));
  margin: 0;
  color: rgba(42, 36, 48, 0.45) !important;
}

.heart-hit.is-pulse {
  animation: heart-tap 0.55s ease;
}

@keyframes heart-tap {
  0% { transform: scale(1); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

#intro[hidden],
.journey[hidden] {
  display: none !important;
}

.stop-inner {
  width: min(420px, 100%);
  text-align: center;
}

.stop-label {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(42, 36, 48, 0.55);
  margin-bottom: 16px;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.2);
}

/* 日间文案偏深色，夜间偏浅 */
.stop-start .stop-title,
.stop-start .stop-line,
.stop-photo .stop-line,
.stop-photo figcaption {
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.25);
}

body.is-night .stop-label,
body.is-night .stop-title,
body.is-night .stop-line,
body.is-night .stop-photo figcaption,
body.is-night .finale-name,
body.is-night .finale-letter,
body.is-night .finale-from {
  color: var(--star);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

body.is-night .stop-photo figcaption {
  color: rgba(242, 233, 216, 0.85);
}

.stop-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6.5vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.stop-line {
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.scroll-cue {
  margin-top: 48px;
  font-size: 11px;
  letter-spacing: 0.24em;
  opacity: 0.55;
  animation: cue-bob 2s ease-in-out infinite;
}

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* 照片 */

.photo-frame {
  position: relative;
  margin: 0 auto 20px;
  width: min(280px, 72vw);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.photo-frame.is-in {
  opacity: 1;
  transform: translateY(0);
}

.photo-frame.tilt-left.is-in {
  transform: rotate(-2.2deg);
}

.photo-frame.tilt-right.is-in {
  transform: rotate(2.2deg);
}

.photo-frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
  box-shadow:
    0 12px 40px rgba(20, 30, 50, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.08)),
    linear-gradient(160deg, #b8d4c8, #d4a8b0);
}

.photo-frame figcaption {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.16em;
}

.photo-frame:has(img.missing)::before {
  content: "待放入照片";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: rgba(42, 36, 48, 0.45);
  pointer-events: none;
  z-index: 1;
}

/* ===== 点星 ===== */

.stop-stars {
  position: relative;
  overflow: hidden;
}

.stop-stars .stop-title,
.stop-stars .stop-line {
  color: var(--star);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.stop-inner-stars {
  position: relative;
  z-index: 3;
  pointer-events: none;
  padding-top: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stop-inner-stars .stop-title {
  font-size: clamp(1.4rem, 6vw, 1.85rem);
  margin-bottom: 8px;
  transition: opacity 0.45s ease, transform 0.45s ease, letter-spacing 0.45s ease;
}

.stop-inner-stars .stop-title.is-complete {
  font-size: clamp(1.35rem, 6.2vw, 1.95rem);
  letter-spacing: 0.06em;
  text-shadow:
    0 2px 16px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(255, 220, 160, 0.45);
  animation: star-title-grow 2.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.star-title-en {
  margin: -2px 0 10px;
  max-width: 18em;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(255, 246, 220, 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(6px) scale(0.92);
  transition: opacity 0.55s ease 0.12s, transform 0.55s ease 0.12s;
}

.star-title-en.is-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: star-en-grow 2.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

@keyframes star-title-grow {
  0% { transform: scale(0.9); opacity: 0.75; letter-spacing: 0.02em; }
  100% { transform: scale(1.14); opacity: 1; letter-spacing: 0.08em; }
}

@keyframes star-en-grow {
  0% { transform: translateY(4px) scale(0.92); font-size: 11px; }
  100% { transform: translateY(0) scale(1.08); font-size: 13px; }
}

.stop-inner-stars .stop-line {
  font-size: 13px;
}

/* 全部点亮后：只留中央中英一句，其余淡出（不影响滚动） */
.stop-stars.is-star-focus .sky-word,
.stop-stars.is-star-focus .sky-taps,
.stop-stars.is-star-focus .stop-label,
.stop-stars.is-star-focus .stop-line,
.stop-stars.is-star-focus .meteor {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.9s ease;
}

.stop-stars.is-star-focus .sky-tap {
  pointer-events: none !important;
}

.stop-stars.is-star-focus .stop-title,
.stop-stars.is-star-focus .star-title-en {
  opacity: 1;
  pointer-events: none;
}

.star-words {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.sky-taps {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.sky-tap {
  position: absolute;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  color: #fff6d8;
  -webkit-tap-highlight-color: transparent;
}

.sky-tap-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  z-index: 1;
  /* 立体高光 + 暖金质感 */
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7))
    drop-shadow(0 3px 4px rgba(40, 24, 8, 0.45))
    drop-shadow(0 0 6px rgba(255, 214, 140, 0.55))
    drop-shadow(0 0 14px rgba(255, 200, 120, 0.28));
  animation: sky-twinkle 3.2s ease-in-out infinite;
}

.sky-tap-icon::after {
  content: "";
  position: absolute;
  left: 22%;
  top: 16%;
  width: 38%;
  height: 30%;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.05) 70%,
    transparent
  );
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.sky-tap:nth-child(3n) .sky-tap-icon {
  animation-duration: 3.8s;
  animation-delay: 0.4s;
}

.sky-tap:nth-child(3n + 1) .sky-tap-icon {
  animation-duration: 2.9s;
  animation-delay: 1.1s;
}

.sky-tap:nth-child(3n + 2) .sky-tap-icon {
  animation-duration: 3.5s;
  animation-delay: 0.7s;
}

.sky-tap-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* 渐变填色：更有金属光泽 */
.sky-tap-icon svg path,
.sky-tap-icon svg circle[fill]:not([fill="none"]),
.sky-tap-icon svg ellipse[fill]:not([fill="none"]) {
  fill: url(#starGlow);
}

.sky-tap-icon svg ellipse[fill="none"],
.sky-tap-icon svg circle[fill="none"] {
  fill: none;
  stroke: url(#starMetal);
}

.sky-tap-wave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(255, 236, 190, 0.75);
  box-shadow: 0 0 10px rgba(255, 220, 150, 0.45);
  animation: sky-wave 2.2s ease-out infinite;
  pointer-events: none;
  opacity: 0.95;
}

.sky-tap-wave.delay {
  animation-delay: 1.1s;
}

/* 未点亮：更强光波引导 */
.sky-tap:not(.is-lit) .sky-tap-wave {
  border-color: rgba(255, 240, 200, 0.9);
  box-shadow:
    0 0 12px rgba(255, 230, 160, 0.55),
    0 0 22px rgba(255, 200, 120, 0.28);
}

.sky-tap:not(.is-lit)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 230, 170, 0.28), transparent 70%);
  animation: sky-pulse-ring 2.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* 已点亮：弱化 */
.sky-tap.is-lit {
  opacity: 0.38;
  filter: saturate(0.55) brightness(0.85);
}

.sky-tap.is-lit .sky-tap-icon {
  width: 26px;
  height: 26px;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25))
    drop-shadow(0 0 4px rgba(255, 220, 150, 0.25));
  animation: sky-twinkle-lit 4.5s ease-in-out infinite;
}

.sky-tap.is-lit .sky-tap-wave,
.sky-tap.is-lit::before {
  opacity: 0 !important;
  animation: none !important;
}

.sky-tap:active .sky-tap-icon {
  transform: translate(-50%, -50%) scale(0.92);
}

/* 轻柔闪烁，接近背景星 */
@keyframes sky-twinkle {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.97); }
  40% { opacity: 0.88; transform: translate(-50%, -50%) scale(1.03); }
  70% { opacity: 0.62; transform: translate(-50%, -50%) scale(0.99); }
}

@keyframes sky-twinkle-lit {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.75; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes sky-wave {
  0% {
    width: 18px;
    height: 18px;
    opacity: 0.85;
  }
  100% {
    width: 64px;
    height: 64px;
    opacity: 0;
  }
}

@keyframes sky-pulse-ring {
  0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.15); }
}

.sky-word {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.9);
  transition: opacity 0.55s ease, transform 1.2s ease;
  white-space: nowrap;
  max-width: 30vw;
}

.sky-word .sky-zh {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #fff6d8;
  text-shadow:
    0 0 10px rgba(255, 220, 160, 0.65),
    0 2px 12px rgba(0, 0, 0, 0.45);
}

.sky-word .sky-en {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #ffe8f0;
  text-shadow:
    0 0 8px rgba(255, 180, 200, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.4);
}

.sky-word.is-show {
  opacity: 0.95;
  transform: translate3d(var(--drift, 0px), var(--rise, -12px), 0) scale(1);
}

.meteor {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff8e0, transparent);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 6px #ffe8a0);
  z-index: 1;
}

.meteor.is-shooting {
  animation: meteor-fly 1.1s ease-out forwards;
}

@keyframes meteor-fly {
  0% { opacity: 0; transform: translate3d(40vw, -10vh, 0) rotate(-35deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(-40vw, 50vh, 0) rotate(-35deg); }
}

.stop-stars {
  position: relative;
  overflow: hidden;
}

/* ===== 终章 ===== */

.stop-finale {
  min-height: 100dvh;
}

.finale-inner {
  position: relative;
}

.finale-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 3rem);
  letter-spacing: 0.16em;
  margin-bottom: 28px;
  color: var(--star);
}

/* 与星海页英文一致：Times New Roman italic */
.finale-en {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.finale-letter {
  text-align: left;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: rgba(242, 233, 216, 0.92);
  padding: 0 4px;
}

.finale-letter p + p {
  margin-top: 10px;
}

.finale-closing {
  margin-top: 18px !important;
  color: #f0d0b8;
}

.finale-from {
  margin-top: 28px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(242, 233, 216, 0.65);
  text-align: right;
}

.finale-from .finale-en {
  letter-spacing: 0.02em;
  margin-right: 0.25em;
}

.finale-name .finale-en {
  font-size: 0.72em;
  margin-right: 0.2em;
  vertical-align: baseline;
}

.stop-finale .stop-label .finale-en {
  letter-spacing: 0.14em;
}

.finale-letter .finale-en {
  letter-spacing: 0.04em;
}

.play-cta {
  margin-top: 36px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--star);
  font-size: 13px;
  letter-spacing: 0.12em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.play-cta:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.16);
}

.play-cta.is-playing {
  border-color: rgba(240, 208, 184, 0.55);
  background: rgba(240, 208, 184, 0.12);
}

.finale-petals {
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

.finale-petals.is-active {
  opacity: 1;
}

.finale-petal {
  position: absolute;
  top: -5%;
  width: 8px;
  height: 12px;
  border-radius: 60% 40% 60% 40%;
  background: radial-gradient(circle at 30% 30%, #f8d8c8, #c890a0);
  animation: petal-fall 9s linear infinite;
  opacity: 0.7;
}

/* 日间开场时 sky phase 为 0；旅程滚动后由 JS 更新 */
body.intro-mode {
  --phase: 0.08;
}

body.intro-mode .sky-night,
body.intro-mode .stars-canvas {
  opacity: 0 !important;
}

/* ===== 终章入口：打开礼物 ===== */
.gift-open-btn {
  margin-top: 14px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(240, 208, 184, 0.55);
  background: rgba(240, 208, 184, 0.14);
  color: var(--star);
  font-size: 13px;
  letter-spacing: 0.14em;
}

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

/* 互动按钮光波引导 */
.btn-guide {
  position: relative;
  isolation: isolate;
  overflow: visible;
  animation: claim-btn-breathe 2.4s ease-in-out infinite;
}

.btn-guide::before,
.btn-guide::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% + 18px);
  height: calc(100% + 14px);
  border-radius: 999px;
  border: 1.5px solid rgba(255, 230, 170, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: btn-guide-halo 2.2s ease-out infinite;
}

.btn-guide::after {
  animation-delay: 1.1s;
}

.btn-guide > span,
.btn-guide.gift-btn {
  position: relative;
  z-index: 1;
}

.btn-guide-sm::before,
.btn-guide-sm::after {
  width: calc(100% + 10px);
  height: calc(100% + 8px);
  border-width: 1px;
  opacity: 0.85;
}

@keyframes btn-guide-halo {
  0% {
    width: calc(100% + 8px);
    height: calc(100% + 6px);
    opacity: 0.7;
  }
  100% {
    width: calc(100% + 42px);
    height: calc(100% + 34px);
    opacity: 0;
  }
}

/* ===== 生日吹蜡烛互动弹窗 ===== */
.gift-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + var(--safe-top))
    14px
    calc(12px + var(--safe-bottom));
}

.gift-modal[hidden] {
  display: none !important;
}

.gift-blur {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(90, 50, 120, 0.35), transparent 65%),
    linear-gradient(180deg, rgba(18, 10, 32, 0.72), rgba(28, 16, 48, 0.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gift-petals,
.gift-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.gift-petal {
  position: absolute;
  top: -8%;
  width: 9px;
  height: 12px;
  border-radius: 60% 40% 60% 40%;
  background: radial-gradient(circle at 30% 30%, #f7c6d8, #c56a9a);
  animation: petal-fall linear infinite;
  opacity: 0.75;
}

.gift-spark {
  position: absolute;
  width: 6px;
  height: 10px;
  border-radius: 1px;
  opacity: 0;
  animation: confetti-burst 1.4s ease-out forwards;
}

@keyframes confetti-burst {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(220deg) scale(1); }
}

.gift-frame {
  position: relative;
  z-index: 3;
  width: min(420px, 100%);
  min-height: min(720px, 92dvh);
  max-height: 94dvh;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(232, 200, 120, 0.45);
  background:
    radial-gradient(ellipse 80% 50% at 50% 18%, rgba(180, 120, 220, 0.22), transparent 55%),
    linear-gradient(165deg, rgba(48, 28, 72, 0.92), rgba(24, 14, 40, 0.94) 55%, rgba(36, 22, 56, 0.95));
  box-shadow:
    0 0 0 1px rgba(255, 230, 170, 0.12) inset,
    0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gift-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(340px, 92%);
  transform: translate(-50%, -50%);
  opacity: 0.55;
  pointer-events: none;
}

.gift-wisteria {
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 90px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 40px 70px at 18% 0%, #9b5fb8 0%, transparent 70%),
    radial-gradient(ellipse 36px 80px at 28% 10%, #c48ad0 0%, transparent 70%),
    radial-gradient(ellipse 40px 70px at 78% 0%, #9b5fb8 0%, transparent 70%),
    radial-gradient(ellipse 34px 78px at 86% 12%, #e8a0c0 0%, transparent 70%),
    radial-gradient(circle 8px at 22% 55%, #f2a0b8, transparent 70%),
    radial-gradient(circle 7px at 80% 50%, #f0b8c8, transparent 70%);
  opacity: 0.9;
}

.gift-step {
  position: absolute;
  inset: 0;
  padding: 72px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gift-step.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  position: relative;
  inset: auto;
  width: 100%;
  flex: 1;
}

.gift-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #f8e8c8;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  margin-bottom: 8px;
}

.gift-sub,
.gift-hint {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(240, 220, 255, 0.78);
  text-align: center;
  margin-bottom: 14px;
}

.gift-btn {
  margin-top: auto;
  min-width: 180px;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1px solid rgba(240, 210, 140, 0.55);
  background: linear-gradient(180deg, rgba(240, 210, 140, 0.28), rgba(180, 130, 70, 0.22));
  color: #fff4d8;
  font-size: 14px;
  letter-spacing: 0.16em;
  box-shadow: 0 0 20px rgba(240, 200, 120, 0.18);
}

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

.gift-btn.is-glow {
  animation: btn-glow 0.7s ease;
}

.gift-btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
}

.claim-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 18px 28px;
}

.claim-wrap .claim-btn {
  position: relative;
  z-index: 2;
  margin-top: 0;
  min-width: 200px;
  font-size: 15px;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, rgba(255, 230, 160, 0.42), rgba(200, 140, 60, 0.32));
  border-color: rgba(255, 230, 170, 0.85);
  box-shadow:
    0 0 18px rgba(255, 220, 140, 0.45),
    0 0 36px rgba(240, 180, 90, 0.25);
  animation: claim-btn-breathe 2.2s ease-in-out infinite;
}

.claim-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  height: 54px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 230, 170, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: claim-halo 2.2s ease-out infinite;
}

.claim-halo.delay {
  animation-delay: 1.1s;
}

.claim-spark {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8e0 0%, #ffd78a 45%, transparent 70%);
  box-shadow: 0 0 12px rgba(255, 230, 160, 0.9);
  pointer-events: none;
  animation: claim-spark 1.6s ease-in-out infinite;
}

@keyframes claim-halo {
  0% {
    width: 200px;
    height: 48px;
    opacity: 0.75;
  }
  100% {
    width: 280px;
    height: 88px;
    opacity: 0;
  }
}

@keyframes claim-btn-breathe {
  0%, 100% {
    box-shadow:
      0 0 16px rgba(255, 220, 140, 0.4),
      0 0 28px rgba(240, 180, 90, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 24px rgba(255, 236, 180, 0.7),
      0 0 42px rgba(255, 200, 100, 0.35);
    transform: scale(1.03);
  }
}

@keyframes claim-spark {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(240, 200, 120, 0.18); }
  50% { box-shadow: 0 0 28px rgba(255, 230, 160, 0.65); }
}

/* 蛋糕 */
.cake-wrap {
  position: relative;
  width: 180px;
  height: 210px;
  margin: 8px auto 18px;
  z-index: 2;
}

.cake-wrap.is-enter {
  animation: cake-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cake-wrap.is-pop {
  animation: cake-pop 0.45s ease;
}

.cake-wrap-sm {
  width: 150px;
  height: 180px;
  margin-top: 10px;
}

@keyframes cake-in {
  from { opacity: 0; transform: translateY(28px) scale(0.86); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes cake-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.cake {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.cake-plate {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4%;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7f2ea, #e6ddd0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(180deg, #fffdf9, #f3ebe3 70%, #e9dfd4);
  box-shadow: inset 0 -6px 10px rgba(180, 150, 130, 0.15);
}

.tier-bottom {
  width: 78%;
  height: 58px;
  bottom: 14%;
}

.tier-top {
  width: 58%;
  height: 44px;
  bottom: 38%;
  z-index: 2;
}

.tier .drip {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 18px;
  border-radius: 40%;
  background: radial-gradient(ellipse at 20% 0%, #fff 0%, transparent 45%),
    radial-gradient(ellipse at 50% 0%, #fff 0%, transparent 40%),
    radial-gradient(ellipse at 80% 0%, #fff 0%, transparent 45%),
    linear-gradient(180deg, #fff, transparent);
  opacity: 0.95;
}

.ribbon {
  position: absolute;
  left: 50%;
  bottom: 36%;
  transform: translateX(-50%);
  width: 62%;
  height: 10px;
  z-index: 3;
  background: linear-gradient(180deg, #e04555, #b01e30);
  border-radius: 2px;
}

.ribbon .bow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: #c6283a;
  border-radius: 40%;
  box-shadow:
    -14px 0 0 #d63a4a,
    14px 0 0 #d63a4a;
}

.ribbon .bow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 3px;
  height: 28px;
  background: #b01e30;
  transform: translateX(-50%) rotate(12deg);
  transform-origin: top;
  box-shadow: -6px 2px 0 #b01e30;
}

.berries {
  position: absolute;
  left: 50%;
  bottom: 56%;
  transform: translateX(-50%);
  width: 52%;
  height: 18px;
  z-index: 4;
}

.berries i {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7a8a, #c9182e 70%);
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.2);
}

.berries i:nth-child(1) { left: 4%; top: 4px; }
.berries i:nth-child(2) { left: 14%; top: 0; }
.berries i:nth-child(3) { left: 24%; top: 5px; }
.berries i:nth-child(4) { left: 34%; top: 1px; }
.berries i:nth-child(5) { left: 44%; top: 4px; }
.berries i:nth-child(6) { left: 54%; top: 0; }
.berries i:nth-child(7) { left: 64%; top: 5px; }
.berries i:nth-child(8) { left: 74%; top: 1px; }
.berries i:nth-child(9) { left: 84%; top: 4px; }
.berries i:nth-child(10) { left: 42%; top: -6px; width: 12px; height: 12px; }

.candle {
  position: absolute;
  left: 50%;
  bottom: 62%;
  transform: translateX(-50%);
  width: 6px;
  height: 56px;
  z-index: 5;
}

.candle-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, #c6283a, #ff5a6a 45%, #b01e30);
}

.wick {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 2px;
  height: 8px;
  transform: translateX(-50%);
  background: #4a3030;
  border-radius: 1px;
}

.flame {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 12px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6c8, #ffb84a 40%, #ff6a2a 75%, transparent 80%);
  animation: flame-flicker 0.35s ease-in-out infinite alternate;
  box-shadow: 0 0 12px rgba(255, 180, 60, 0.75);
  opacity: 0;
}

.candle.is-lit .flame,
.cake-wrap.is-enter .flame,
[data-step="1"] .flame,
[data-step="2"] .flame {
  opacity: 1;
}

.candle.is-out .flame {
  opacity: 0 !important;
  animation: none;
}

.smoke {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 4px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 40%;
  background: linear-gradient(180deg, rgba(200, 200, 200, 0.5), transparent);
  opacity: 0;
}

.candle.is-out .smoke {
  opacity: 1;
  animation: smoke-up 1.2s ease-out forwards;
}

@keyframes flame-flicker {
  from { transform: translateX(-50%) scale(1) rotate(-4deg); }
  to { transform: translateX(-50%) scale(1.08) rotate(5deg); }
}

@keyframes smoke-up {
  from { opacity: 0.7; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-40%) translateY(-18px); }
}

/* 吹气条 */
.blow-meter {
  position: relative;
  width: min(280px, 86%);
  height: 28px;
  margin: 4px auto 8px;
  border-radius: 8px;
  border: 1px solid rgba(120, 190, 255, 0.45);
  background: rgba(20, 40, 80, 0.45);
  overflow: hidden;
}

.blow-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #4db7ff, #7cf0ff);
  box-shadow: 0 0 12px rgba(90, 200, 255, 0.55);
  transition: width 0.05s linear;
}

.blow-wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  z-index: 1;
  pointer-events: none;
}

.blow-wave span {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: rgba(180, 230, 255, 0.75);
  animation: wave-bar 0.5s ease-in-out infinite alternate;
}

.blow-wave span:nth-child(odd) { animation-delay: 0.1s; }
.blow-wave span:nth-child(3n) { animation-delay: 0.2s; height: 55%; }

@keyframes wave-bar {
  from { transform: scaleY(0.5); opacity: 0.5; }
  to { transform: scaleY(1.3); opacity: 1; }
}

.blow-ripples {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.blow-ripples.is-on::before,
.blow-ripples.is-on::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(140, 210, 255, 0.45);
  border-radius: 50%;
  animation: ripple 1s ease-out infinite;
}

.blow-ripples.is-on::after {
  animation-delay: 0.35s;
}

@keyframes ripple {
  from { transform: scale(0.6); opacity: 0.7; }
  to { transform: scale(3.2); opacity: 0; }
}

.wish-stage {
  position: relative;
  width: min(240px, 72vw);
  height: 180px;
  margin: 8px auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wish-orbit {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(240, 212, 138, 0.28);
  box-shadow:
    0 0 24px rgba(240, 200, 120, 0.18),
    inset 0 0 30px rgba(180, 120, 255, 0.12);
  animation: wish-orbit 6s linear infinite;
}

.wish-star {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(255, 220, 150, 0.55));
  transition: transform 0.45s ease, filter 0.45s ease;
}

.wish-star.is-glow {
  animation: wish-pulse 2.2s ease-in-out infinite;
}

.wish-star.is-grant {
  transform: scale(1.25);
  filter: drop-shadow(0 0 22px rgba(255, 236, 180, 0.95));
}

.wish-star-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9b0 45%, #e8b860 100%);
  box-shadow: 0 0 18px rgba(255, 230, 160, 0.85);
}

.wish-star-ray {
  position: absolute;
  inset: 8px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255, 236, 190, 0.95) 50%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(255, 236, 190, 0.95) 50%, transparent 54%),
    linear-gradient(45deg, transparent 47%, rgba(255, 220, 160, 0.7) 50%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(255, 220, 160, 0.7) 50%, transparent 53%);
  animation: wish-spin 8s linear infinite;
}

.wish-whisper {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(255, 232, 190, 0.72);
  font-family: var(--font-display);
}

@keyframes wish-orbit {
  to { transform: rotate(360deg); }
}

@keyframes wish-spin {
  to { transform: rotate(-360deg); }
}

@keyframes wish-pulse {
  0%, 100% { transform: scale(1); opacity: 0.88; }
  50% { transform: scale(1.08); opacity: 1; }
}

.wish-toast {
  margin: 8px 0 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 230, 170, 0.14);
  border: 1px solid rgba(240, 210, 140, 0.4);
  color: #ffe9b8;
  letter-spacing: 0.14em;
  font-family: var(--font-display);
  animation: toast-in 0.55s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 礼盒 */
.treasure {
  position: relative;
  width: 160px;
  height: 150px;
  margin: 20px auto;
}

.treasure-glow {
  position: absolute;
  inset: 10% 5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 140, 0.55), transparent 70%);
  filter: blur(6px);
  animation: glow-pulse 1.6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

.treasure-box {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 100px;
  height: 78px;
  transform: translateX(-50%);
}

.box-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(160deg, #6b3d9a, #3d2060 55%, #2a1545);
  border: 1px solid rgba(240, 210, 140, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 230, 170, 0.12);
}

.box-lid {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 8px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(160deg, #8a52b8, #5a2f88);
  border: 1px solid rgba(240, 210, 140, 0.5);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.treasure-box.is-open .box-lid {
  transform: rotateX(-118deg) translateY(-6px);
}

.box-bow {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  background: #e8c878;
  border-radius: 40%;
  z-index: 3;
  box-shadow: -12px 0 0 #d4b05e, 12px 0 0 #d4b05e;
}

/* 礼物卡片 */
.gift-card {
  width: min(400px, 98%);
  margin: 0 auto 6px;
  padding: 8px 6px 6px;
  border-radius: 16px;
  border: 1px solid rgba(232, 200, 120, 0.5);
  background:
    linear-gradient(160deg, rgba(90, 50, 130, 0.55), rgba(40, 24, 70, 0.75));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: translateX(120%);
  opacity: 0;
  overflow: visible;
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
}

.gift-step[data-step="6"] {
  padding-top: 36px !important;
  padding-bottom: 12px !important;
  justify-content: flex-start;
}

.gift-step[data-step="6"] .gift-title {
  margin-bottom: 4px;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
}

.gift-step[data-step="6"] .gift-btn.ghost {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  margin-top: 10px;
  background: rgba(28, 16, 48, 0.92);
}

.gift-card.is-in {
  animation: card-slide 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes card-slide {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.gift-card-lead {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(240, 220, 255, 0.72);
  margin-bottom: 8px;
}

.gift-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.gift-nav {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(240, 210, 140, 0.45);
  background: rgba(40, 24, 70, 0.75);
  color: #f0d48a;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
  padding: 0 0 2px;
}

.gift-nav:active {
  transform: scale(0.94);
  background: rgba(90, 50, 130, 0.85);
}

.gift-nav:disabled {
  opacity: 0.35;
}

.gift-gallery {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  padding: 4px 0 6px;
}

.gift-gallery::-webkit-scrollbar {
  display: none;
}

.gift-item {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  color: inherit;
  perspective: 1400px;
  -webkit-perspective: 1400px;
}

.gift-flip {
  position: relative;
  /* 三张统一竖版画幅，整体放大适应页面 */
  width: min(100%, 340px);
  aspect-ratio: 3 / 4;
  max-height: min(60vh, 520px);
  margin: 0 auto;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-item.is-flipped .gift-flip {
  transform: rotateY(180deg);
}

.gift-flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(232, 200, 120, 0.35);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-sizing: border-box;
}

.gift-item.is-active .gift-flip-face {
  border-color: rgba(240, 210, 140, 0.85);
  box-shadow: 0 0 0 1px rgba(240, 210, 140, 0.25);
}

.gift-flip-front {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: #120a1c;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gift-flip-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #120a1c;
  pointer-events: none;
}

.gift-flip-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 244, 220, 0.9);
  background: rgba(20, 12, 36, 0.55);
  border: 1px solid rgba(240, 210, 140, 0.35);
  pointer-events: none;
}

.gift-flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 18px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, rgba(120, 70, 180, 0.35), transparent 60%),
    linear-gradient(165deg, rgba(48, 28, 72, 0.98), rgba(22, 14, 40, 0.98));
  text-align: center;
}

.gift-back-name {
  font-family: var(--font-display);
  font-size: clamp(15px, 4.2vw, 18px);
  letter-spacing: 0.12em;
  color: #f8e8c8;
  margin-bottom: 6px;
}

.gift-back-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(240, 220, 255, 0.65);
}

.gift-back-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: 0.04em;
  color: #ffe9b8;
  word-break: break-all;
  margin: 4px 0 14px;
  user-select: all;
  -webkit-user-select: all;
}

.gift-back-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin-bottom: 8px;
}

.gift-back-actions .gift-btn {
  margin-top: 0;
  min-width: 0;
  flex: 1 1 auto;
  padding: 11px 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.gift-flip-back-btn {
  margin-top: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: rgba(240, 220, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.gift-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 2px 0 10px;
}

.gift-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gift-dots span.is-on {
  background: #f0d48a;
  transform: scale(1.25);
}

.track-panel {
  margin-top: 2px;
  padding: 8px 8px 7px;
  border-radius: 10px;
  border: 1px solid rgba(124, 240, 255, 0.28);
  background: rgba(20, 40, 80, 0.35);
  width: 92%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.track-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(240, 220, 255, 0.7);
  margin-bottom: 3px;
}

.track-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #ffe9b8;
  word-break: break-all;
  margin-bottom: 6px;
  line-height: 1.35;
  user-select: all;
  -webkit-user-select: all;
}

.track-copy {
  min-width: 0;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 11px;
}

.track-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
}

.track-actions .gift-btn {
  margin-top: 0;
  min-width: 0;
  flex: 1 1 0;
  padding: 7px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.track-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.track-copy.is-copied {
  border-color: rgba(124, 240, 255, 0.65);
  background: rgba(80, 180, 220, 0.22);
}

body.gift-lock {
  overflow: hidden;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 收好礼物后：邀请聊天 ===== */
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.chat-modal[hidden] {
  display: none !important;
}

.chat-modal.is-show {
  opacity: 1;
}

.chat-blur {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 28, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chat-card {
  position: relative;
  z-index: 1;
  width: min(340px, 92vw);
  padding: 28px 22px 22px;
  border-radius: 22px;
  border: 1px solid rgba(240, 210, 140, 0.45);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(180, 120, 220, 0.28), transparent 60%),
    linear-gradient(165deg, rgba(48, 28, 72, 0.96), rgba(22, 14, 40, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
  transform: translateY(12px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-modal.is-show .chat-card {
  transform: translateY(0) scale(1);
}

.chat-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 230, 190, 0.65);
  margin-bottom: 14px;
}

.chat-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.6vw, 1.25rem);
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: #fff4d8;
  margin-bottom: 22px;
}

.chat-cta {
  margin-top: 0;
  min-width: 200px;
}

.chat-later {
  display: block;
  margin: 14px auto 0;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: rgba(240, 220, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.chat-tip {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 220, 160, 0.72);
  line-height: 1.5;
}

body.chat-lock {
  overflow: hidden;
}
