/* ===== 变量与基础 · 浪漫氛围 ===== */
:root {
  --color-bg: #0d0818;
  --color-bg-top: #1a0e28;
  --color-surface: rgba(40, 28, 52, 0.5);
  --color-primary: #f0c4cc;
  --color-primary-dim: #d4a4b0;
  --color-accent: #c8dcff;
  --color-cyan: #a8d4ec;
  --color-gold: #f5e0c4;
  --color-text: #faf5fb;
  --color-text-muted: #c4b4d4;
  --font-serif: "Noto Serif SC", "Source Han Serif CN", serif;
  --font-display: "ZCOOL KuaiLe", "Noto Serif SC", sans-serif;
  --radius: 24px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-serif);
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(240, 196, 204, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 85% 25%, rgba(232, 180, 188, 0.16) 0%, transparent 48%),
    radial-gradient(ellipse 75% 55% at 15% 75%, rgba(245, 224, 196, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 55% 50%, rgba(200, 220, 255, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, var(--color-bg-top) 0%, #120a1c 35%, var(--color-bg) 100%);
  color: var(--color-text);
  overflow-x: hidden;
}

.music-controls {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 7, 18, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 248, 252, 0.9);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(248, 212, 228, 0.06);
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}

.music-toggle:hover {
  transform: translateY(-1px);
  background: rgba(248, 212, 228, 0.12);
  border-color: rgba(248, 212, 228, 0.22);
}

.music-toggle:active {
  transform: translateY(0);
}

.music-toggle .music-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.music-toggle.is-playing .music-icon {
  animation: music-pulse 1.1s ease-in-out infinite;
  background: rgba(248, 212, 228, 0.16);
  border-color: rgba(248, 212, 228, 0.26);
}

.music-volume {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 7, 18, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(248, 212, 228, 0.05);
}

.music-volume input[type="range"] {
  width: 120px;
  accent-color: rgba(248, 212, 228, 0.9);
}

@keyframes music-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.05); }
}

@media (max-width: 480px) {
  .music-toggle {
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
  }
  .music-toggle .music-text { display: none; }
  .music-controls { gap: 0.4rem; }
  .music-volume { padding: 0.5rem 0.6rem; }
  .music-volume input[type="range"] { width: 92px; }
}

.page {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

/* 全页固定光场：偏粉金浪漫 */
.page::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 50% at 25% 15%, rgba(248, 212, 228, 0.18) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 78% 28%, rgba(240, 196, 212, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 50% 88%, rgba(245, 228, 208, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 55% 45%, rgba(200, 220, 255, 0.08) 0%, transparent 48%);
  filter: blur(14px) saturate(1.08);
  opacity: 0.96;
  transform: translate3d(0, 0, 0);
  animation: ambient-drift 14s ease-in-out infinite;
}

@keyframes ambient-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.95; }
  50% { transform: translate3d(0, -12px, 0) scale(1.02); opacity: 0.85; }
}

.page > * {
  position: relative;
  z-index: 1;
}

/* 全局画布：星空粒子背景 */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

/* ===== 开场 Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
}

@keyframes hero-bg-pulse { /* 保留占位，避免旧引用报错 */ }

.hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--color-primary);
  text-shadow: 0 0 72px rgba(248, 196, 212, 0.4), 0 0 28px rgba(232, 180, 188, 0.3), 0 0 16px rgba(200, 220, 255, 0.12), 0 2px 20px rgba(0, 0, 0, 0.2);
  animation: hero-title-float 4s ease-in-out infinite;
}

@keyframes hero-title-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

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

.hero-title .sub {
  font-size: 0.45em;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 0.25em;
  text-shadow: 0 0 36px rgba(212, 188, 220, 0.35), 0 0 16px rgba(232, 200, 220, 0.2);
}

.hero-tagline {
  position: relative;
  z-index: 1;
  margin-top: 1.25rem;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  opacity: 0.88;
  font-weight: 400;
}

.hero-hint {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  opacity: 0.85;
  transition: opacity 0.4s var(--ease-out);
}

/* 首屏底部：无硬边，与粒子区完全融合 */
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 120% 150% at 50% 100%,
    rgba(248, 212, 228, 0.04) 0%,
    rgba(248, 212, 228, 0.02) 25%,
    transparent 50%
  );
}

.hero-dots::before,
.hero-dots::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(248, 220, 232, 0.4);
  bottom: 20%;
  animation: hero-dot-float 4s var(--ease-out) infinite;
}

.hero-dots::before {
  left: 30%;
  animation-delay: 0s;
}

.hero-dots::after {
  right: 30%;
  animation-delay: 1.2s;
}

@keyframes hero-dot-float {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.6; transform: translateY(-5px); }
}

.scroll-indicator {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  z-index: 1;
}

.scroll-hand {
  display: block;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(248, 212, 228, 0.4));
  animation: scroll-hand-move 2.2s var(--ease-out) infinite;
}

.scroll-hand svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes scroll-hand-move {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(6px); opacity: 0.65; }
}

/* ===== 粒子区域：与首屏同一背景，无分割线 ===== */
.particle-section {
  min-height: 200vh;
  position: relative;
  --particle-progress: 0;
  background: transparent;
}

.particle-stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

/* 粒子区「空位」过渡：刚进入时居中一句文案 + 光晕，随滚动渐隐 */
.particle-intro {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88%, 420px);
  text-align: center;
  pointer-events: none;
  z-index: 2;
  opacity: clamp(0, calc(1 - var(--particle-progress, 0) * 3), 1);
  transition: opacity 0.4s var(--ease-out);
}

.particle-intro-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(232, 180, 188, 0.12) 0%, rgba(184, 212, 255, 0.06) 40%, transparent 70%);
  border-radius: 50%;
  animation: particle-intro-glow 8s ease-in-out infinite;
}

@keyframes particle-intro-glow {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.particle-intro-text {
  position: relative;
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  font-weight: 500;
  color: rgba(255, 250, 253, 0.94);
  letter-spacing: 0.22em;
  text-shadow: 0 0 48px rgba(248, 212, 228, 0.35), 0 0 20px rgba(232, 196, 220, 0.2);
}

.particle-intro-sub {
  position: relative;
  margin: 0;
  font-size: clamp(0.8rem, 2.2vw, 0.9rem);
  color: var(--color-text-muted);
  letter-spacing: 0.18em;
  opacity: 0.9;
}

.particle-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86vw, 560px);
  height: min(66vw, 400px);
  transform: translate(-50%, -50%);
  border-radius: calc(var(--radius) + 10px);
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(248, 212, 228, 0.16) 0%, transparent 65%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 80px rgba(248, 212, 228, 0.18),
    0 0 100px rgba(232, 196, 220, 0.1);
  opacity: calc(0.08 + var(--particle-progress, 0) * 0.22);
  transition: opacity 0.2s var(--ease-out);
}

.particle-stage.has-image::after {
  display: none;
}

.particle-img-fallback {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 2;
}

.particle-stage.has-image .particle-img-fallback[src] {
  display: block;
}

.particle-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, rgba(40, 32, 58, 0.6) 0%, rgba(28, 22, 42, 0.8) 100%);
  color: var(--color-text-muted);
  font-size: 1rem;
  border: 1px dashed rgba(232, 180, 188, 0.2);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.particle-placeholder small {
  font-size: 0.8rem;
  opacity: 0.8;
}

.particle-stage.has-image .particle-placeholder {
  display: none;
}

/* 浪漫文案：随滚动进度一点点露出（与图片同节奏） */
.romantic-text {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: min(85%, 320px);
  text-align: center;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  clip-path: inset(0 0 calc(100% * (1 - var(--particle-progress, 0))) 0);
  transition: clip-path 0.15s var(--ease-out);
  opacity: calc(0.15 + var(--particle-progress, 0) * 0.85);
}

.romantic-text .romantic-line {
  margin: 0 0 0.4em;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  font-weight: 500;
  color: rgba(255, 250, 253, 0.96);
  text-shadow: 0 0 32px rgba(248, 212, 228, 0.45), 0 0 12px rgba(232, 196, 220, 0.25), 0 1px 6px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.romantic-text .romantic-line:last-child {
  margin-bottom: 0;
}

/* ===== 打开惊喜：入场动画 + 氛围动效，与上方「都是为你」距离更近 ===== */
.surprise-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10vh 2rem 3rem;
  position: relative;
  background: transparent;
  gap: 1rem;
}

.surprise-section .surprise-head,
.surprise-section .surprise-drip,
.surprise-section .surprise-wrap {
  will-change: opacity, transform;
}

.surprise-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.surprise-head {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  font-weight: 500;
  color: rgba(255, 248, 252, 0.82);
  letter-spacing: 0.22em;
  text-shadow: 0 0 40px rgba(248, 212, 228, 0.28), 0 0 18px rgba(232, 196, 220, 0.15);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.surprise-section.is-visible .surprise-head {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.surprise-drip {
  width: 1px;
  height: clamp(32px, 8vw, 48px);
  background: linear-gradient(180deg, rgba(232, 180, 188, 0.25) 0%, rgba(184, 212, 255, 0.12) 50%, transparent 100%);
  border-radius: 1px;
  opacity: 0;
  transform: translateY(12px) scaleY(0.6);
  transform-origin: top;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  animation: surprise-drip 3s ease-in-out infinite;
}

.surprise-section.is-visible .surprise-drip {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  transition-delay: 0.2s;
}

@keyframes surprise-drip {
  0%, 100% { opacity: 0.7; filter: brightness(0.9); }
  50% { opacity: 1; filter: brightness(1); }
}

.surprise-wrap {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: min(560px, 92vw);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.surprise-section.is-visible .surprise-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.35s;
}

.surprise-intro {
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  opacity: 0.92;
  text-shadow: 0 0 24px rgba(232, 180, 188, 0.2);
}

/* ===== 摩斯密码面板 ===== */
.morse-panel {
  width: min(520px, 92vw);
  margin: 0 auto 1.25rem;
  padding: 1.1rem 1.1rem 0.95rem;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(40, 28, 52, 0.55) 0%, rgba(20, 14, 34, 0.48) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(248, 212, 228, 0.06);
  backdrop-filter: blur(12px);
  overflow: hidden;
  max-height: 520px;
  transition:
    max-height 0.55s var(--ease-out),
    margin 0.55s var(--ease-out),
    padding 0.55s var(--ease-out),
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.morse-panel.shake {
  animation: morse-shake 0.45s ease;
  border-color: rgba(248, 212, 228, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(248, 212, 228, 0.12), 0 0 50px rgba(248, 212, 228, 0.12);
}

@keyframes morse-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.morse-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(255, 248, 252, 0.9);
  text-shadow: 0 0 24px rgba(248, 212, 228, 0.25);
}

.morse-tip {
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: rgba(196, 180, 212, 0.9);
  letter-spacing: 0.08em;
}

.morse-display {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.morse-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: center;
  justify-items: center;
  font-size: 0.98rem;
  letter-spacing: 0.1em;
  color: rgba(255, 250, 253, 0.96);
  text-shadow: 0 0 18px rgba(248, 212, 228, 0.22);
}

.morse-chunk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0.32rem 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* 解锁成功态：面板变简洁，不再显示键盘 */
.morse-panel.solved .morse-tip,
.morse-panel.solved .keypad {
  display: none;
}

.morse-panel.solved .morse-pin {
  opacity: 0;
  height: 0;
  margin: 0;
}

.morse-panel.solved .morse-display {
  padding: 1rem 1rem;
  background: rgba(0, 0, 0, 0.12);
}

.morse-panel.solved .morse-text {
  color: rgba(248, 212, 228, 0.95);
  font-weight: 600;
}

.morse-text {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: rgba(248, 212, 228, 0.88);
  opacity: 0.95;
}

.morse-pin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.morse-pin-dot {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.morse-pin-dot.filled {
  background: linear-gradient(90deg, rgba(248, 212, 228, 0.35) 0%, rgba(248, 212, 228, 0.85) 60%, rgba(200, 220, 255, 0.65) 100%);
  border-color: rgba(248, 212, 228, 0.22);
  box-shadow: 0 0 18px rgba(248, 212, 228, 0.25);
}

.keypad {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.key {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 248, 252, 0.92);
  border-radius: 16px;
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.key:hover {
  transform: translateY(-1px);
  background: rgba(248, 212, 228, 0.12);
  border-color: rgba(248, 212, 228, 0.22);
}

.key:active {
  transform: translateY(0);
}

.key.ghost {
  background: rgba(0, 0, 0, 0.12);
  color: rgba(196, 180, 212, 0.95);
}

.morse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.morse-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 248, 252, 0.9);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.morse-btn:hover {
  transform: translateY(-1px);
  background: rgba(248, 212, 228, 0.12);
  border-color: rgba(248, 212, 228, 0.2);
}

.morse-btn:active {
  transform: translateY(0);
}

.morse-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(196, 180, 212, 0.95);
}

.morse-status {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 248, 252, 0.78);
  letter-spacing: 0.06em;
}

.surprise-section.is-unlocked .morse-panel {
  pointer-events: none;
}

.surprise-section.panel-collapsed .morse-panel {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
}

.unlock-toast {
  width: min(520px, 92vw);
  margin: -0.25rem auto 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: rgba(248, 212, 228, 0.14);
  border: 1px solid rgba(248, 212, 228, 0.22);
  color: rgba(255, 248, 252, 0.92);
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.surprise-section.just-unlocked .unlock-toast {
  opacity: 1;
  transform: translateY(0);
}

/* 信封：亮色纸感，与深色背景对比明显 */
.envelope {
  position: relative;
  width: min(268px, 74vw);
  height: 0;
  padding-bottom: min(192px, 53vw);
  margin: 0.9rem auto 0;
  perspective: 1000px;
  transform-style: preserve-3d;
  animation: envelope-float 6s ease-in-out infinite;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 56px rgba(248, 212, 228, 0.22));
}

.surprise-section.panel-collapsed .envelope {
  margin-top: 0.35rem;
}

@keyframes envelope-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 信体：亮象牙白，与深色背景区分明显 */
.envelope-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68%;
  background: linear-gradient(180deg, #fefcfb 0%, #faf6f3 30%, #f4ede8 100%);
  border: 1px solid rgba(210, 190, 180, 0.85);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 2px 0 12px rgba(255, 255, 255, 0.15),
    inset -2px 0 12px rgba(255, 255, 255, 0.1),
    0 4px 4px rgba(0, 0, 0, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.2);
}

/* 开口处一条线，保持可见但不抢眼 */
.envelope-body::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 2%, rgba(200, 175, 165, 0.6) 15%, rgba(180, 158, 148, 0.7) 50%, rgba(200, 175, 165, 0.6) 85%, transparent 98%);
  border-radius: 0 0 1px 1px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 信纸横线（内里） */
.envelope-body::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 14%;
  bottom: 12%;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 20px,
    rgba(220, 200, 190, 0.12) 20px,
    rgba(220, 200, 190, 0.12) 21px
  );
  border-radius: 2px;
  pointer-events: none;
}

/* 信封盖：亮色三角折片，轮廓清晰 */
.envelope-flap {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 0;
  height: 44%;
  background: linear-gradient(180deg, #fdf9f7 0%, #f8f2ee 40%, #f0e8e2 100%);
  border: 1px solid rgba(210, 192, 182, 0.85);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 10px 20px rgba(255, 255, 255, 0.2),
    0 2px 0 rgba(180, 160, 150, 0.35),
    0 6px 20px rgba(0, 0, 0, 0.15);
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out);
  backface-visibility: hidden;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
}

/* 盖片底边折线阴影 */
.envelope-flap::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 0;
  height: 8px;
  background: linear-gradient(180deg, rgba(140, 120, 110, 0.25) 0%, transparent 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  pointer-events: none;
}

.envelope.is-open .envelope-flap {
  transform: rotateX(-155deg);
}

/* 火漆：蜡封质感，稍大易点 */
.envelope-seal {
  position: absolute;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(100, 55, 62, 0.88);
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.1em;
  background: radial-gradient(ellipse 45% 40% at 50% 45%, rgba(230, 190, 195, 0.9), rgba(195, 145, 155, 0.95) 45%, rgba(155, 100, 110, 0.98) 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -3px 10px rgba(50, 30, 35, 0.25),
    inset 0 0 20px rgba(180, 130, 140, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 14px rgba(130, 85, 95, 0.35);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.envelope-seal:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.4),
    inset 0 -3px 10px rgba(50, 30, 35, 0.25),
    0 5px 18px rgba(140, 95, 105, 0.4);
}

.envelope-seal:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.surprise-section:not(.is-unlocked) .envelope-seal {
  animation: seal-pulse 2.8s ease-in-out infinite;
}

@keyframes seal-pulse {
  0%, 100% {
    box-shadow:
      inset 0 2px 6px rgba(255, 255, 255, 0.35),
      inset 0 -3px 10px rgba(50, 30, 35, 0.25),
      inset 0 0 20px rgba(180, 130, 140, 0.2),
      0 2px 4px rgba(0, 0, 0, 0.2),
      0 4px 14px rgba(130, 85, 95, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  50% {
    box-shadow:
      inset 0 2px 6px rgba(255, 255, 255, 0.38),
      inset 0 -3px 10px rgba(50, 30, 35, 0.25),
      inset 0 0 20px rgba(180, 130, 140, 0.22),
      0 5px 18px rgba(140, 95, 105, 0.42),
      0 10px 26px rgba(248, 212, 228, 0.18),
      0 0 0 1px rgba(255, 255, 255, 0.16);
  }
}

.surprise-section.is-unlocked .envelope-seal-text::after { content: ""; }

.envelope-seal-text {
  white-space: nowrap;
}

.envelope-seal-text {
  display: block;
  padding: 0 2px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 -0.5px 0 rgba(80, 45, 52, 0.5);
}

/* ===== 惊喜弹层 ===== */
.surprise-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(12, 8, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s var(--ease-out);
}

.surprise-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.surprise-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: linear-gradient(160deg, rgba(40, 32, 58, 0.85) 0%, rgba(28, 22, 42, 0.9) 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(232, 180, 188, 0.15);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 80px rgba(232, 180, 188, 0.08);
  transform: scale(0.92) translateY(24px);
  transition: transform 0.45s var(--ease-out), box-shadow 0.4s var(--ease-out);
  backdrop-filter: blur(16px);
}

.surprise-overlay.is-open .surprise-modal {
  transform: scale(1) translateY(0);
  box-shadow: var(--shadow), 0 0 0 1px rgba(232, 180, 188, 0.2), 0 0 100px rgba(232, 180, 188, 0.12);
}

.surprise-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.3s var(--ease-out), background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.surprise-close:hover {
  color: var(--color-primary);
  background: rgba(232, 180, 188, 0.15);
  border-color: rgba(232, 180, 188, 0.25);
}

.surprise-content h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
}

.surprise-message {
  margin-bottom: 1.5rem;
}

.surprise-message p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.surprise-message p:last-child {
  margin-bottom: 0;
}

/* ===== 奖品海报 ===== */
.prize {
  margin: 1.5rem 0 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 隐藏礼物：机密档案卡（解密 + 盖章） */
.classified-card {
  position: relative;
  border-radius: 18px;
  padding: 1.05rem 1.1rem 1rem;
  background:
    radial-gradient(ellipse 90% 80% at 20% 10%, rgba(248, 212, 228, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 90% 80% at 80% 20%, rgba(200, 220, 255, 0.1) 0%, transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  filter: blur(6px) saturate(0.9);
}

.classified-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: rgba(255, 248, 252, 0.7);
  margin-bottom: 0.75rem;
}

.classified-tag {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.classified-id {
  opacity: 0.9;
}

.classified-body {
  position: relative;
  border-radius: 14px;
  padding: 0.95rem 1rem 0.9rem;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.classified-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: 0.12em;
  color: rgba(248, 212, 228, 0.96);
  text-shadow: 0 0 26px rgba(248, 212, 228, 0.22);
}

.classified-sub {
  margin: 0.55rem 0 0;
  color: rgba(255, 248, 252, 0.82);
  letter-spacing: 0.08em;
}

.classified-scan {
  position: absolute;
  left: -20%;
  right: -20%;
  top: -40%;
  height: 70%;
  background: linear-gradient(180deg, transparent 0%, rgba(248, 212, 228, 0.12) 45%, transparent 100%);
  transform: translateY(-120%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.classified-stamp {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 2px solid rgba(248, 212, 228, 0.55);
  color: rgba(248, 212, 228, 0.92);
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  transform: rotate(-10deg) scale(1.2);
  opacity: 0;
  filter: drop-shadow(0 0 18px rgba(248, 212, 228, 0.25));
}

.surprise-overlay.is-open .classified-card.reveal {
  animation: classified-in 0.7s var(--ease-out) forwards;
}

.surprise-overlay.is-open .classified-card.reveal .classified-scan {
  animation: classified-scan 0.9s ease-in-out 0.25s forwards;
}

.surprise-overlay.is-open .classified-card.reveal .classified-stamp {
  animation: classified-stamp 0.42s cubic-bezier(0.2, 0.9, 0.2, 1) 1.05s forwards;
}

@keyframes classified-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(8px) saturate(0.9); }
  65% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) saturate(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) saturate(1.02); }
}

@keyframes classified-scan {
  0% { transform: translateY(-120%); opacity: 0.0; }
  30% { opacity: 0.9; }
  100% { transform: translateY(220%); opacity: 0.0; }
}

@keyframes classified-stamp {
  0% { opacity: 0; transform: rotate(-10deg) scale(1.4); }
  60% { opacity: 1; transform: rotate(-10deg) scale(1.05); }
  100% { opacity: 1; transform: rotate(-10deg) scale(1.0); }
}

.prize h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: rgba(248, 212, 228, 0.95);
  letter-spacing: 0.12em;
}

.prize-sub {
  margin: 0 0 0.9rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

.prize-card {
  border-radius: 18px;
  padding: 1.1rem 1.1rem 1rem;
  background:
    radial-gradient(ellipse 80% 70% at 20% 20%, rgba(248, 212, 228, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 80% 70% at 80% 30%, rgba(200, 220, 255, 0.14) 0%, transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  margin-bottom: 0.9rem;
}

.prize-card-title {
  font-size: 0.85rem;
  color: rgba(255, 248, 252, 0.78);
  letter-spacing: 0.16em;
}

.prize-card-name {
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: rgba(255, 248, 252, 0.96);
  text-shadow: 0 0 30px rgba(248, 212, 228, 0.25);
}

.prize-card-note {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: rgba(196, 180, 212, 0.95);
  letter-spacing: 0.08em;
}

.prize-card-footer {
  margin-top: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255, 248, 252, 0.7);
  letter-spacing: 0.1em;
}

.prize-card.prize-card-min {
  padding: 1.05rem 1.1rem 1rem;
  background:
    radial-gradient(ellipse 90% 80% at 20% 10%, rgba(248, 212, 228, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 90% 80% at 80% 20%, rgba(200, 220, 255, 0.1) 0%, transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.surprise-sign {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: right;
  margin: 0;
}

/* 摩斯码在手机端放大，保证可读性 */
@media (max-width: 540px) {
  .morse-code {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    gap: 0.45rem;
  }
  .morse-chunk { padding: 0.28rem 0.35rem; border-radius: 12px; }
}
