/* =======================================================
   ✨ SHUQI XU · SWEET 16 专属高级质感视觉系统 ✨
   Editorial & Luxury Celestial Aesthetic
   ======================================================= */

:root {
  --bg-main: #080711;
  --bg-gradient: radial-gradient(circle at 50% 15%, #1c1432 0%, #0d0a1a 55%, #05040a 100%);
  --gold-primary: #f5dda7;
  --gold-secondary: #cba358;
  --gold-glow: rgba(245, 221, 167, 0.35);
  --rose-accent: #e2a5bc;
  --text-white: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.4);
  --glass-surface: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  --font-serif-en: 'Cormorant Garamond', Georgia, serif;
  --font-serif-cn: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  color: var(--text-white);
  font-family: var(--font-sans);
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

/* 背景 Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ==================== 顶部导航栏 ==================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0);
  z-index: 100;
  background: linear-gradient(180deg, rgba(8, 7, 17, 0.9) 0%, transparent 100%);
  pointer-events: none;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-primary);
  animation: pulseDot 2.5s infinite alternate;
}

.brand-text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: var(--gold-primary);
  opacity: 0.9;
}

.nav-controls {
  pointer-events: auto;
}

.music-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.music-pill:active {
  transform: scale(0.96);
}

.disc-icon {
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
}

.disc-icon svg {
  width: 100%;
  height: 100%;
}

.music-pill.playing .disc-icon svg {
  animation: spinRecord 4s linear infinite;
}

.music-text {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.audio-bars span {
  width: 2px;
  height: 3px;
  background: var(--gold-primary);
  border-radius: 1px;
  transition: height 0.2s;
}

.music-pill.playing .audio-bars span:nth-child(1) { animation: barGrow 0.7s infinite ease-in-out; }
.music-pill.playing .audio-bars span:nth-child(2) { animation: barGrow 0.7s infinite ease-in-out 0.2s; }
.music-pill.playing .audio-bars span:nth-child(3) { animation: barGrow 0.7s infinite ease-in-out 0.4s; }

/* ==================== 微信提示条 ==================== */
.wechat-tip-bar {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 400px;
  background: rgba(245, 221, 167, 0.15);
  border: 1px solid rgba(245, 221, 167, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--gold-primary);
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: slideDownTip 0.4s ease-out;
}

.wechat-tip-bar span strong {
  color: #ffffff;
  font-size: 14px;
}

.btn-close-tip {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
}

@keyframes slideDownTip {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==================== 视口与场景系统 (彻底杜绝层级遮挡) ==================== */
.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  overflow: hidden;
}

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-top: 65px;
  padding-bottom: 85px;
  display: none; /* 非激活状态彻底 display:none，不阻挡任何下层 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scene.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 50 !important; /* 激活场景层级置顶 */
  animation: fadeInScene 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScene {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.scene-inner {
  width: 100%;
  max-width: 440px;
  padding: 10px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.flex-center {
  margin: auto;
}

/* ==================== 场景 1: 典雅序章封面 ==================== */
.cover-card {
  width: 100%;
  max-width: 340px;
  background: rgba(22, 16, 42, 0.75);
  border: 1px solid rgba(245, 221, 167, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  padding: 32px 24px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px rgba(245, 221, 167, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 20;
}

.cover-ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ornament-line {
  width: 35px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-secondary), transparent);
}

.ornament-star {
  font-size: 14px;
  color: var(--gold-primary);
  animation: pulseDot 2s infinite alternate;
}

.cover-eyebrow {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold-secondary);
  margin-bottom: 12px;
}

.cover-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.cover-name-en {
  font-family: var(--font-serif-en);
  font-size: 44px;
  font-weight: 300;
  letter-spacing: 8px;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(245, 221, 167, 0.4);
}

.cover-name-cn {
  font-family: var(--font-serif-cn);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--gold-primary);
}

.cover-sub {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-top: 4px;
}

.cover-divider {
  width: 40px;
  height: 1px;
  background: var(--gold-primary);
  opacity: 0.4;
  margin: 18px 0 16px;
}

.cover-quote {
  font-family: var(--font-serif-cn);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-white);
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.cover-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--gold-secondary);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.btn-cover-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #f5dda7 0%, #cba358 100%);
  color: #120d22;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 14px 30px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 30;
  pointer-events: auto;
  box-shadow: 0 8px 30px rgba(203, 163, 88, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-cover-enter * {
  pointer-events: none;
}

.btn-cover-enter svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.btn-cover-enter:active {
  transform: scale(0.95);
}

.cover-footer-tip {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

/* ==================== 场景 2: 拍立得画廊 ==================== */
.hero-header {
  margin-bottom: 12px;
}

.eyebrow-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold-secondary);
  margin-bottom: 6px;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.title-en {
  font-family: var(--font-serif-en);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--text-white);
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

.title-cn {
  font-family: var(--font-serif-cn);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--gold-primary);
  opacity: 0.9;
}

.hero-quote {
  font-family: var(--font-serif-cn);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 5px;
}

/* 拍立得舞台与堆叠 */
.polaroid-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.polaroid-stack {
  position: relative;
  width: 290px;
  height: 385px;
  perspective: 1000px;
  cursor: pointer;
  z-index: 10;
}

.polaroid-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  transform-origin: center bottom;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.85) rotate(0deg);
}

.polaroid-item.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1) rotate(-1deg);
  z-index: 10;
}

.polaroid-item.prev {
  opacity: 0;
  transform: translateX(-120%) rotate(-12deg);
  z-index: 11;
}

.polaroid-item.next {
  opacity: 0.45;
  transform: translateY(12px) scale(0.94) rotate(3deg);
  z-index: 8;
  pointer-events: auto;
}

.polaroid-item.next-2 {
  opacity: 0.2;
  transform: translateY(22px) scale(0.88) rotate(-4deg);
  z-index: 6;
}

/* 拍立得相纸质感 */
.polaroid-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fbfbfc;
  padding: 14px 14px 18px;
  border-radius: 4px;
  box-shadow: 
    0 20px 45px -10px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

/* 顶部半透明和纸胶带 */
.polaroid-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: rgba(245, 221, 167, 0.55);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 15;
  opacity: 0.9;
}

.photo-wrapper {
  position: relative;
  width: 100%;
  height: 285px;
  background: #110d22;
  overflow: hidden;
  border-radius: 2px;
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.film-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 65%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.light-leak {
  position: absolute;
  top: -20%;
  right: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(245, 221, 167, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.polaroid-caption {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.caption-date {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #8b8893;
}

.caption-text {
  font-family: var(--font-serif-cn);
  font-size: 11px;
  font-weight: 400;
  color: #1a1725;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caption-num {
  font-family: var(--font-serif-en);
  font-size: 10px;
  color: #a5a2ad;
  text-align: right;
}

/* 画廊控制器 */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 18px;
  position: relative;
  z-index: 20;
}

.nav-arrow {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: var(--glass-blur);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.nav-arrow * {
  pointer-events: none;
}

.nav-arrow svg {
  width: 16px;
  height: 16px;
}

.nav-arrow:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.dots-indicator {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: auto;
}

.dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.interaction-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  opacity: 0.6;
}

.tip-line {
  width: 25px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.tip-text {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

/* ==================== 场景 3: 16束烛光 ==================== */
.scene-header {
  margin-bottom: 24px;
}

.gold-subtitle {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold-secondary);
  display: block;
  margin-bottom: 6px;
}

.scene-heading {
  font-family: var(--font-serif-cn);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-white);
}

.scene-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
}

.candles-stage {
  position: relative;
  width: 280px;
  height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 25px;
  z-index: 10;
}

.cake-podium {
  position: relative;
  width: 220px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.podium-disc {
  position: absolute;
  border-radius: 50%;
}

.podium-top {
  width: 200px;
  height: 80px;
  background: radial-gradient(ellipse at center, #24163f 0%, #130a24 100%);
  border: 1px solid rgba(245, 221, 167, 0.35);
  box-shadow: 0 0 35px rgba(245, 221, 167, 0.15), inset 0 0 20px rgba(245, 221, 167, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.podium-number {
  font-family: var(--font-serif-en);
  font-size: 42px;
  font-weight: 400;
  color: var(--gold-primary);
  opacity: 0.85;
  letter-spacing: 4px;
  text-shadow: 0 0 15px var(--gold-glow);
}

.podium-base {
  width: 230px;
  height: 90px;
  background: #090412;
  border: 1px solid rgba(255, 255, 255, 0.05);
  bottom: -15px;
  z-index: 1;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

/* 16 根优雅烛光排布 */
.candles-array {
  position: absolute;
  top: -45px;
  width: 230px;
  height: 100px;
  z-index: 10;
  pointer-events: auto;
}

.taper-candle {
  position: absolute;
  width: 4px;
  height: 38px;
  background: linear-gradient(180deg, #f5dda7 0%, #a67c2e 100%);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease;
  pointer-events: auto;
}

.taper-candle:active {
  transform: scale(1.25);
}

.taper-flame {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 14px;
  background: radial-gradient(ellipse at bottom, #ffffff 0%, #ffde59 40%, #ff6b35 85%, transparent 100%);
  border-radius: 50% 50% 35% 35%;
  filter: drop-shadow(0 0 8px rgba(255, 190, 11, 0.85));
  animation: flickerFlame 0.35s infinite alternate ease-in-out;
  transition: opacity 0.3s, transform 0.3s;
}

.taper-candle.out .taper-flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.1);
}

.taper-candle.out::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 10px;
  background: radial-gradient(circle, rgba(245, 221, 167, 0.6), transparent);
  border-radius: 50%;
  animation: candleSmoke 0.8s forwards ease-out;
}

/* 许愿操作栏 */
.candles-action-bar {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 30;
  margin-top: 10px;
}

.btn-luxury {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f5dda7 0%, #cba358 100%);
  color: #120d22;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 14px 28px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 40;
  pointer-events: auto;
  box-shadow: 0 8px 25px rgba(203, 163, 88, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-luxury * {
  pointer-events: none;
}

.btn-luxury:active {
  transform: scale(0.96);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 26px;
  border-radius: 30px;
  cursor: pointer;
  position: relative;
  z-index: 40;
  pointer-events: auto;
}

.btn-secondary * {
  pointer-events: none;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* 许愿完成弹窗 (顶层全屏蒙层) */
.aesthetic-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 3, 8, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.modal-card {
  width: 85%;
  max-width: 320px;
  background: rgba(26, 19, 45, 0.95);
  border: 1px solid rgba(245, 221, 167, 0.35);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 221, 167, 0.2);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 100000;
}

.modal-starlight {
  font-size: 28px;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-serif-cn);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--gold-primary);
}

.modal-divider {
  width: 30px;
  height: 1px;
  background: var(--gold-primary);
  opacity: 0.5;
  margin: 12px auto;
}

.modal-quote {
  font-family: var(--font-serif-cn);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-white);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.modal-btn-confirm {
  background: var(--gold-primary);
  color: #120d22;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 9px 24px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
}

/* ==================== 场景 4: 烟花 HUD ==================== */
#scene-fireworks {
  padding: 0;
}

#fireworks-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  touch-action: none;
}

.fireworks-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 68px 16px 85px;
}

.floating-header {
  pointer-events: auto;
}

.fireworks-dock-panel {
  pointer-events: auto;
  background: rgba(18, 13, 34, 0.75);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.palette-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.palette-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.color-dot.gold { background: #f5dda7; box-shadow: 0 0 6px #f5dda7; }
.color-dot.rose { background: #e2a5bc; box-shadow: 0 0 6px #e2a5bc; }
.color-dot.cyan { background: #70d6ff; box-shadow: 0 0 6px #70d6ff; }
.color-dot.heart { background: #ff5d8f; box-shadow: 0 0 6px #ff5d8f; }

.palette-btn.active {
  background: rgba(245, 221, 167, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-fire-auto {
  background: linear-gradient(135deg, rgba(245, 221, 167, 0.2), rgba(226, 165, 188, 0.2));
  border: 1px solid var(--gold-secondary);
  color: var(--gold-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 9px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-fire-auto svg {
  width: 14px;
  height: 14px;
}

/* ==================== 场景 5: 十六岁星语签 ==================== */
.fortune-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 340px;
  margin: 10px 0 20px;
  perspective: 1000px;
}

.flip-card {
  width: 100%;
  height: 160px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
}

.flip-front {
  background: linear-gradient(145deg, rgba(28, 20, 50, 0.85) 0%, rgba(13, 10, 26, 0.85) 100%);
  border: 1px solid rgba(245, 221, 167, 0.25);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.roman-num {
  font-family: var(--font-serif-en);
  font-size: 13px;
  color: var(--gold-secondary);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.front-symbol {
  font-size: 20px;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.front-label {
  font-family: var(--font-serif-cn);
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--text-white);
}

.flip-back {
  background: linear-gradient(145deg, #24163f 0%, #130a24 100%);
  border: 1px solid var(--gold-primary);
  transform: rotateY(180deg);
  box-shadow: 0 8px 25px rgba(245, 221, 167, 0.2);
}

.flip-back p {
  font-family: var(--font-serif-cn);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--gold-primary);
}

.cards-footer {
  margin-top: 10px;
}

.footer-note {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* ==================== 底部导航栏 ==================== */
.bottom-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 400px;
  z-index: 100;
  margin-bottom: env(safe-area-inset-bottom, 0);
}

.dock-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(14, 10, 26, 0.88);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 35px;
  padding: 6px 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  pointer-events: auto;
}

.nav-item * {
  pointer-events: none;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-dim);
  transition: stroke 0.25s ease, transform 0.25s ease;
}

.nav-item.active {
  color: var(--gold-primary);
  background: rgba(245, 221, 167, 0.1);
}

.nav-item.active svg {
  stroke: var(--gold-primary);
  transform: translateY(-1px);
}

/* ==================== 辅助类与微动画 ==================== */
.hidden {
  display: none !important;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

@keyframes spinRecord {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes barGrow {
  0%, 100% { height: 3px; }
  50% { height: 9px; }
}

@keyframes flickerFlame {
  0% { transform: translateX(-50%) scale(1) rotate(-1deg); }
  100% { transform: translateX(-50%) scale(1.08, 1.15) rotate(1deg); }
}

@keyframes candleSmoke {
  0% { transform: translate(-50%, 0) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -20px) scale(2); opacity: 0; }
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
