:root {
  --bg-0: #0d0716;
  --bg-1: #1a0f2b;
  --gold: #f6cd7c;
  --gold-deep: #d99b3c;
  --cream: #fff6e8;
  --pink: #ff7aa2;
  --text: #f3ead9;
  --text-dim: #b8a894;
  --card: rgba(255, 255, 255, 0.05);
  --card-line: rgba(246, 205, 124, 0.22);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  line-height: 1.9;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(217, 155, 60, 0.18), transparent 60%),
    radial-gradient(55% 45% at 85% 25%, rgba(255, 122, 162, 0.14), transparent 62%),
    radial-gradient(70% 60% at 50% 100%, rgba(120, 70, 200, 0.18), transparent 65%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, #090510 100%);
}

#fireworks {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- 音乐按钮 ---------- */
.music-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  background: rgba(20, 12, 32, 0.7);
  backdrop-filter: blur(10px);
  color: var(--gold);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.music-btn:hover {
  transform: translateY(-2px);
  background: rgba(36, 22, 56, 0.85);
  box-shadow: 0 8px 24px rgba(246, 205, 124, 0.18);
}
.music-btn.playing .music-icon { animation: pulse 1.1s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

/* ---------- 首屏 ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 96px 24px 64px;
  position: relative;
}

.hero-eyebrow {
  margin: 0 0 18px;
  letter-spacing: 0.55em;
  font-size: 12px;
  color: var(--gold-deep);
  animation: fadeUp 1s 0.1s both;
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 8vw, 82px);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.25;
  background: linear-gradient(100deg, #fff2d8 0%, var(--gold) 40%, var(--gold-deep) 70%, #fff2d8 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite, fadeUp 1s 0.25s both;
}

.hero-title span { white-space: nowrap; }

.hero-sub {
  min-height: 1.9em;
  margin: 22px 0 0;
  font-size: clamp(15px, 2.2vw, 19px);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  animation: fadeUp 1s 0.45s both;
}

.hero-sub .caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  vertical-align: -0.15em;
  background: var(--gold);
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 1s 0.6s both;
}

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.btn-primary {
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: #2a1606;
  font-weight: 700;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(217, 155, 60, 0.4);
}

.btn-ghost {
  border-color: var(--card-line);
  color: var(--gold);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  background: rgba(246, 205, 124, 0.1);
}

.scroll-hint {
  position: absolute;
  bottom: 34px;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  animation: floaty 2.4s ease-in-out infinite;
}

/* ---------- 通用区块 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 110px 24px;
  text-align: center;
}

.section-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(100deg, #fff2d8, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-title::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-desc {
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.06em;
}

/* ---------- 蛋糕 ---------- */
.cake-stage {
  position: relative;
  margin-top: 64px;
  display: flex;
  justify-content: center;
}

.glow {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 460px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(246, 205, 124, 0.35), transparent 72%);
  filter: blur(12px);
  opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none;
}
.glow.on { opacity: 1; }

.cake {
  position: relative;
  width: 300px;
  height: 320px;
  transform: scale(1);
  transition: transform 0.4s;
}
.cake.blown { animation: cakeBounce 0.7s ease; }

/* 盘子 */
.cake-plate {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 300px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #efe4d0, #b9a98f);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

/* 底层 */
.cake-bottom {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 260px;
  height: 96px;
  transform: translateX(-50%);
  border-radius: 10px 10px 16px 16px;
  background: linear-gradient(180deg, #c98a5c, #a2673f);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.12);
}

/* 中层 */
.cake-mid {
  position: absolute;
  left: 50%;
  bottom: 108px;
  width: 216px;
  height: 76px;
  transform: translateX(-50%);
  border-radius: 8px 8px 12px 12px;
  background: linear-gradient(180deg, #e0a674, #bf8351);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.14);
}

/* 奶油边 */
.cake-drip {
  position: absolute;
  left: 50%;
  bottom: 176px;
  width: 224px;
  height: 26px;
  transform: translateX(-50%);
  background: var(--cream);
  border-radius: 14px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.08);
}
.cake-drip::after {
  content: "";
  position: absolute;
  inset: 16px -2px auto;
  height: 20px;
  background:
    radial-gradient(circle at 10% 0, var(--cream) 0 12px, transparent 13px),
    radial-gradient(circle at 30% 0, var(--cream) 0 14px, transparent 15px),
    radial-gradient(circle at 52% 0, var(--cream) 0 13px, transparent 14px),
    radial-gradient(circle at 74% 0, var(--cream) 0 15px, transparent 16px),
    radial-gradient(circle at 94% 0, var(--cream) 0 12px, transparent 13px);
}

/* 顶层 */
.cake-top {
  position: absolute;
  left: 50%;
  bottom: 190px;
  width: 200px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, #fff9ef, #eedcc2);
}

/* 蜡烛 */
.candles {
  position: absolute;
  left: 50%;
  bottom: 230px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 20px;
  z-index: 3;
}

.candle {
  position: relative;
  width: 10px;
  height: 52px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #ff8fab 0 6px, #fff3f7 6px 12px);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: transform 0.2s;
}
.candle:hover { transform: translateY(-3px); }

.flame {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 12px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 72%, #fff8d0 0 22%, #ffc94d 42%, #ff7a1a 72%, rgba(255, 106, 0, 0.15) 100%);
  box-shadow: 0 0 18px 6px rgba(255, 176, 60, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
  animation: flicker 0.9s ease-in-out infinite alternate;
}
.candle.lit .flame { opacity: 1; }

.smoke {
  position: absolute;
  left: 50%;
  top: -16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(220, 220, 220, 0.75);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}
.candle.out .smoke { animation: smokeUp 1.3s ease-out forwards; }

.cake-tip {
  margin-top: 34px;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.cake-tip b { color: var(--gold); font-size: 20px; }

/* ---------- 卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  margin-top: 56px;
  text-align: left;
}

.card {
  padding: 30px 26px;
  border-radius: 18px;
  border: 1px solid var(--card-line);
  background: var(--card);
  backdrop-filter: blur(8px);
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.cards .card:hover {
  transform: translateY(-8px);
  border-color: rgba(246, 205, 124, 0.5);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42);
}

.card-icon { font-size: 26px; }
.card h3 {
  margin: 14px 0 8px;
  font-size: 19px;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.95;
}

/* ---------- 相册 ---------- */
.album {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 56px;
}

.polaroid {
  margin: 0;
  padding: 14px 14px 8px;
  background: #fbf6ee;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: transform 0.4s, opacity 0.9s;
}
.polaroid.visible { opacity: 1; }
.polaroid:nth-child(odd) { transform: rotate(-2.2deg); }
.polaroid:nth-child(even) { transform: rotate(1.8deg); }
.polaroid:hover { transform: rotate(0deg) translateY(-8px) scale(1.03); }

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  background: #e7dfd2;
}

.polaroid figcaption {
  padding: 12px 4px 6px;
  color: #6b5b47;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.08em;
}

/* ---------- 信 ---------- */
.letter {
  max-width: 720px;
  margin: 56px auto 0;
  padding: 52px 52px 44px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid var(--card-line);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.07), rgba(255, 250, 240, 0.03));
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4);
}

.letter p {
  margin: 0 0 18px;
  font-size: 16px;
  color: #e6dccb;
  line-height: 2.15;
}
.letter-top {
  color: var(--gold) !important;
  font-size: 18px !important;
  letter-spacing: 0.1em;
}
.letter-sign {
  margin-top: 34px !important;
  text-align: right;
  color: var(--gold-deep) !important;
  letter-spacing: 0.12em;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 80px 24px 120px;
  color: var(--text-dim);
}
.footer p {
  margin: 0 0 32px;
  font-size: 15px;
  letter-spacing: 0.14em;
}

/* ---------- 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes shine { to { background-position: 220% 0; } }
@keyframes floaty {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(8px); opacity: 1; }
}
@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-2deg); }
  to { transform: translateX(-50%) scale(1.12) rotate(2deg); }
}
@keyframes smokeUp {
  0% { opacity: 0.8; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(2.6); }
}
@keyframes cakeBounce {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.06, 0.94); }
  65% { transform: scale(0.98, 1.03); }
}

@media (max-width: 640px) {
  .section { padding: 80px 20px; }
  .letter { padding: 34px 24px 30px; }
  .letter p { font-size: 15px; }
  .cake { width: 260px; transform: scale(0.92); }
  .glow { width: 340px; }
  .music-btn { top: 12px; right: 12px; padding: 8px 13px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .polaroid { opacity: 1; }
}
