:root {
  --ink: #563748;
  --ink-soft: #7b5a68;
  --cream: #fff9ef;
  --paper: #fff3df;
  --pink: #f6c8d8;
  --pink-deep: #d9819e;
  --lavender: #ded7f4;
  --yellow: #f8e8a7;
  --mint: #ccefd9;
  --shadow: rgba(118, 66, 89, 0.18);
  --line: rgba(117, 66, 90, 0.24);
  --ease: cubic-bezier(.2, .9, .18, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: #f3dce7;
  font-family: "Segoe Print", "LXGW WenKai", "KaiTi", "Microsoft YaHei", system-ui, sans-serif;
}

button {
  font: inherit;
}

.book {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, .64), transparent 28%),
    linear-gradient(135deg, #f8e0ea 0%, #fff4df 48%, #e8e0f6 100%);
}

.paper-noise,
.page::before {
  pointer-events: none;
  position: absolute;
  inset: 0;
  content: "";
  opacity: .36;
  background-image:
    radial-gradient(circle, rgba(92, 52, 69, .14) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 1.8px);
  background-position: 0 0, 9px 12px;
  background-size: 22px 22px, 30px 30px;
  mix-blend-mode: multiply;
}

.page {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(72px, 8vh, 96px) clamp(18px, 4vw, 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateX(4%) rotateY(-5deg) scale(.985);
  transform-origin: right center;
  contain: layout paint style;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  visibility: hidden;
}

.page.active {
  z-index: 2;
  opacity: 1;
  transform: translateX(0) rotateY(0) scale(1);
  visibility: visible;
}

.page.leaving {
  z-index: 1;
  opacity: 0;
  transform: translateX(-4%) rotateY(5deg) scale(.985);
  visibility: visible;
}

.page:not(.active):not(.leaving) {
  content-visibility: hidden;
}

.page:not(.active) *,
.page:not(.active)::before,
.page:not(.active)::after {
  animation-play-state: paused !important;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 磁带页使用浅复古纸张，不沿用其他页面的咖啡厅背景。 */
.page-cassette {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(245, 238, 227, .86), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(215, 200, 178, .34), transparent 38%),
    linear-gradient(145deg, #f5eee3 0%, #ede3d2 46%, #e4d7c3 100%);
}

.page-cassette::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .34;
  background-image:
    radial-gradient(circle, rgba(122, 97, 70, .16) 0 .7px, transparent .9px),
    radial-gradient(circle, rgba(255, 255, 255, .58) 0 .8px, transparent 1px);
  background-position: 0 0, 11px 13px;
  background-size: 21px 21px, 29px 29px;
}

.cassette-paper-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1020px, 88vw);
  aspect-ratio: 1.8;
  border-radius: 48%;
  background: rgba(245, 238, 227, .5);
  box-shadow: 0 8px 8px rgba(60, 45, 30, .1);
  transform: translate(-50%, -50%);
  filter: blur(8px);
}

.cassette-player {
  position: fixed;
  z-index: 8;
  width: 920px;
  max-width: calc(100vw - 64px);
  min-width: 0;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity .22s ease;
}

.cassette-player::before {
  position: absolute;
  inset: 8% 5%;
  z-index: -1;
  border-radius: 18px;
  background: rgba(245, 238, 227, .34);
  box-shadow: 0 8px 8px rgba(60, 45, 30, .1);
  content: "";
}

.cassette-player.is-main {
  left: 50%;
  right: auto;
  top: 50%;
  width: 920px;
  max-width: calc(100vw - 64px);
  transform: translate(-50%, -50%);
}

.cassette-player.is-mini {
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  left: auto;
  width: clamp(150px, 16vw, 230px);
  transform: none;
}

.cassette-player.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cassette-player.is-mini::before {
  inset: 4% 2%;
  border-radius: 8px;
  background: rgba(245, 238, 227, .22);
  box-shadow: 0 5px 7px rgba(60, 45, 30, .1);
}

.cassette-mini-hint {
  position: absolute;
  right: 0;
  bottom: -34px;
  display: none;
  width: max-content;
  max-width: 190px;
  padding: 6px 10px;
  border: 1px solid rgba(104, 82, 59, .22);
  border-radius: 6px;
  color: #665646;
  background: rgba(245, 238, 227, .94);
  box-shadow: 0 4px 6px rgba(60, 45, 30, .1);
  font-size: clamp(.72rem, 1.1vw, .9rem);
  line-height: 1.2;
  white-space: nowrap;
  animation: cassetteHintFloat 3.2s ease-in-out infinite;
  transition: opacity .3s ease;
}

.cassette-player.is-mini .cassette-mini-hint {
  display: block;
}

.cassette-player.has-interacted .cassette-mini-hint {
  opacity: .58;
}

.cassette-tape {
  position: relative;
  width: 100%;
  aspect-ratio: 1100 / 720;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .22s ease, filter .22s ease;
}

.cassette-player.is-mini .cassette-tape:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 8px 7px rgba(60, 45, 30, .16));
}

.cassette-player.is-mini .cassette-tape:active {
  transform: scale(.98);
}

.cassette-tape:focus-visible {
  outline: 3px solid rgba(166, 71, 104, .65);
  outline-offset: 10px;
}

.cassette-tape.is-transitioning {
  cursor: wait;
}

.cassette-video-crop {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  clip-path: polygon(2.5% 0, 97.5% 0, 100% 3.5%, 100% 95%, 97% 100%, 3% 100%, 0 95%, 0 3.5%);
}

.cassette-video {
  position: absolute;
  left: -43.65%;
  top: -30.76%;
  width: 186.18%;
  height: 161.08%;
  max-width: none;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: opacity;
  transition: opacity .14s linear;
}

.cassette-video.active {
  opacity: 1;
}

@media (max-width: 680px) {
  .cassette-player.is-main {
    width: min(354px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }

  .cassette-player.is-mini {
    top: max(16px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: clamp(100px, 27vw, 124px);
  }

  .cassette-mini-hint {
    bottom: -27px;
    padding: 4px 7px;
    font-size: .65rem;
  }

  .cassette-tape:hover {
    transform: none;
    filter: none;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .cassette-player,
  .cassette-tape,
  .cassette-video,
  .cassette-mini-hint {
    transition-duration: .01ms !important;
    animation: none !important;
  }
}

.small-ribbon {
  display: inline-block;
  margin: 0 0 14px;
  padding: 8px 18px;
  color: #76445a;
  background: rgba(255, 255, 255, .68);
  border: 2px dashed rgba(242, 140, 171, .7);
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(242, 140, 171, .2);
}

.cover-layout,
.section-shell,
.letter-layout,
.growth-layout,
.wish-wall,
.desk-scene,
.final-layout {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  text-align: center;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: .95;
  letter-spacing: 0;
  color: #a64768;
  text-shadow: 2px 2px 0 rgba(255, 240, 168, .72), 4px 5px 0 rgba(166, 71, 104, .1);
}

h2 {
  margin: 0 0 clamp(24px, 4vh, 44px);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  color: #8a4565;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .9);
}

.cover-subtitle {
  margin: 16px auto 20px;
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: #7d5068;
}

.doodle-field::before,
.doodle-field::after,
.soft-stickers::before,
.soft-stickers::after {
  position: absolute;
  z-index: 0;
  color: rgba(151, 87, 111, .28);
  font-size: clamp(1.5rem, 4vw, 3.6rem);
  white-space: pre;
  content: "✦   ♡    ˚\A  ribbon   ✿\A  little wish";
  animation: floaty 6s ease-in-out infinite alternate;
}

.doodle-field::before {
  top: 9%;
  left: 7%;
  transform: rotate(-8deg);
}

.doodle-field::after {
  right: 6%;
  bottom: 15%;
  content: "♡  ☆\A  soft note\A     ✿";
  transform: rotate(8deg);
  animation-delay: -2s;
}

.cake {
  position: relative;
  display: inline-grid;
  width: 220px;
  height: 210px;
  margin: 14px auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(-1.5deg);
}

.cake-final {
  cursor: default;
  transform: rotate(1deg);
}

.cake span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cake-top {
  bottom: 94px;
  width: 168px;
  height: 46px;
  border: 3px solid #8c5368;
  border-radius: 48% 52% 42% 58%;
  background: #fff8f4;
  box-shadow: inset 0 -9px 0 #ffd0df;
}

.cake-body {
  bottom: 38px;
  width: 146px;
  height: 72px;
  border: 3px solid #8c5368;
  border-radius: 18px 16px 28px 30px;
  background:
    linear-gradient(90deg, transparent 0 22%, rgba(255, 255, 255, .45) 22% 30%, transparent 30% 52%, rgba(255, 255, 255, .35) 52% 60%, transparent 60%),
    #ffc4d8;
}

.cake-plate {
  bottom: 22px;
  width: 190px;
  height: 26px;
  border: 3px solid #8c5368;
  border-radius: 50%;
  background: #dcd3ff;
}

.candle {
  bottom: 136px;
  width: 20px;
  height: 52px;
  border: 3px solid #8c5368;
  border-radius: 8px;
  background: repeating-linear-gradient(-35deg, #fff6cc 0 8px, #ff9fbd 8px 15px);
}

.flame {
  top: -32px;
  width: 22px;
  height: 30px;
  border-radius: 55% 55% 55% 55%;
  background: radial-gradient(circle at 55% 68%, #fff8aa 0 26%, #ffba47 27% 58%, #ff7e86 62%);
  opacity: 0;
  transform-origin: bottom center;
  filter: drop-shadow(0 0 12px rgba(255, 160, 72, .8));
}

.cake.lit .flame,
.cake-final .flame {
  opacity: 1;
  animation: flameDance .68s ease-in-out infinite alternate;
}

.hint-line {
  margin: 10px 0 16px;
  font-size: 1.1rem;
  color: #9a4265;
}

.sticker-btn,
.page-nav button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(99, 56, 77, .52);
  border-radius: 14px 12px 15px 12px;
  color: #68394d;
  background: #fff1bd;
  box-shadow: 0 3px 0 rgba(190, 113, 145, .55);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
}

.sticker-btn:hover,
.page-nav button:hover:not(:disabled) {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 5px 0 rgba(190, 113, 145, .5);
}

.page-nav button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.page-nav {
  position: fixed;
  z-index: 10;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2px dashed rgba(139, 83, 104, .3);
  border-radius: 20px;
  background: rgba(255, 248, 233, .82);
  backdrop-filter: blur(8px);
}

#pageIndicator {
  min-width: 86px;
  font-size: .92rem;
  color: #7c5265;
}

.page-letter {
  background:
    linear-gradient(rgba(142, 83, 104, .09) 1px, transparent 1px),
    radial-gradient(circle at 78% 15%, rgba(246, 200, 216, .42), transparent 24%),
    linear-gradient(110deg, #fffaf1, #f8e5ed 58%, #eee7fb);
  background-size: 100% 34px, auto;
}

.envelope {
  position: relative;
  width: min(720px, 88vw);
  height: min(520px, 64vh);
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1200px;
}

.envelope-photo-wrap,
.envelope-paper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.envelope-photo-wrap {
  z-index: 3;
  bottom: 12px;
  width: min(650px, 92vw);
  filter: drop-shadow(0 18px 18px rgba(92, 52, 69, .18));
  transform-origin: 50% 78%;
  transition: filter .4s var(--ease);
}

.envelope-photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.envelope-image-missing .envelope-photo-wrap {
  height: 300px;
  border: 1px solid rgba(130, 92, 82, .28);
  border-radius: 20px 18px 22px 19px;
  background:
    linear-gradient(145deg, transparent 0 48%, rgba(159, 119, 97, .18) 49% 51%, transparent 52%),
    linear-gradient(215deg, transparent 0 48%, rgba(159, 119, 97, .14) 49% 51%, transparent 52%),
    #fff8e9;
}

.envelope-image-missing .envelope-photo-wrap img {
  display: none;
}

.envelope-photo-wrap::after {
  position: absolute;
  inset: 10% 8%;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.26), transparent 45%);
  content: "";
  pointer-events: none;
}

.envelope-paper {
  z-index: 2;
  bottom: 48px;
  width: min(520px, 80vw);
  height: min(360px, 48vh);
  padding: clamp(22px, 4vw, 36px);
  overflow: auto;
  border: 1px solid rgba(130, 92, 82, .28);
  border-radius: 10px 9px 12px 10px;
  background:
    linear-gradient(rgba(125, 80, 104, .09) 1px, transparent 1px),
    linear-gradient(135deg, #fffef8, #fff9ec);
  background-size: 100% 30px, auto;
  text-align: left;
  line-height: 1.9;
  white-space: pre-wrap;
  box-shadow: 0 12px 18px rgba(113, 72, 88, .12);
  transform: translate(-50%, 120px) scale(.86);
  opacity: 0;
  transition: transform .92s var(--ease), opacity .62s var(--ease);
}

.envelope.open .envelope-paper {
  transform: translate(-50%, -92px) scale(1);
  opacity: 1;
  transition-delay: .34s;
}

.envelope.open .envelope-photo-wrap {
  animation: envelopeDiscard 1.05s var(--ease) forwards;
}

.corner-stickers,
.soft-stickers,
.cover-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sticker-placeholder {
  position: absolute;
  width: 118px;
  height: 132px;
  display: grid;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, .92);
  border-radius: 18px 14px 17px 13px;
  color: #a35a75;
  background: rgba(255, 255, 255, .62);
  font-size: .82rem;
  transform: rotate(-8deg);
  box-shadow: 0 8px 14px rgba(92, 52, 69, .14);
  overflow: hidden;
}

.sticker-placeholder.missing {
  border: 2px dashed rgba(143, 82, 104, .42);
}

.sticker-placeholder:nth-child(1) {
  left: 7%;
  top: 15%;
}

.sticker-placeholder:nth-child(2) {
  right: 8%;
  bottom: 18%;
  transform: rotate(7deg);
}

.cover-stickers .sticker-placeholder:nth-child(1) {
  left: 8%;
  top: 18%;
}

.cover-stickers .sticker-placeholder:nth-child(2) {
  right: 9%;
  top: 20%;
}

.cover-stickers .sticker-placeholder:nth-child(3) {
  left: 12%;
  bottom: 18%;
  width: 86px;
  height: 86px;
}

.sticker-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-you {
  background:
    radial-gradient(circle at 80% 18%, rgba(248, 232, 167, .52), transparent 22%),
    linear-gradient(145deg, #fff8f5, #f9e3eb 50%, #eee8fb);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.trait-card {
  min-height: 250px;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  transform: rotate(var(--tilt));
}

.trait-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 250px;
  transition: transform .72s var(--ease);
  transform-style: preserve-3d;
}

.trait-card:hover .trait-inner,
.trait-card.flipped .trait-inner {
  transform: rotateY(180deg);
}

.trait-front,
.trait-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  border: 3px solid #8d5268;
  border-radius: 22px 15px 20px 17px;
  background: #fff8e9;
  box-shadow: 0 8px 0 rgba(229, 149, 177, .24);
  backface-visibility: hidden;
}

.trait-back {
  transform: rotateY(180deg);
  background: #fff1f7;
  font-size: .95rem;
  line-height: 1.65;
}

.trait-number {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff0a8;
  border: 2px solid #8d5268;
}

.tiny-sticker {
  width: 44px;
  height: 34px;
  align-self: center;
  border: 2px dashed #e190aa;
  border-radius: 50% 44% 52% 40%;
  background: #dcd3ff;
  animation: floaty 3s ease-in-out infinite alternate;
}

.page-growth {
  background: linear-gradient(125deg, #fff9ef 0%, #f8e4ec 48%, #e9e2f6 100%);
}

.growth-layout {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(280px, 1fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  text-align: left;
}

.growth-layout h2 {
  grid-column: 1 / -1;
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}

.timeline {
  display: grid;
  gap: 22px;
  position: relative;
}

.timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 4px;
  border-radius: 999px;
  background: #e9a7be;
  content: "";
}

.timeline-node {
  position: relative;
  min-height: 58px;
  margin-left: 34px;
  padding: 12px 18px;
  border: 2px solid #8d5268;
  border-radius: 18px 14px 17px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 5px 0 rgba(220, 163, 188, .28);
  cursor: pointer;
  text-align: left;
}

.timeline-node::before {
  position: absolute;
  left: -44px;
  top: 15px;
  width: 22px;
  height: 22px;
  border: 3px solid #8d5268;
  border-radius: 50%;
  background: #fff0a8;
  content: "";
}

.timeline-node.active {
  background: #ffe1ed;
  transform: rotate(-1deg);
}

.timeline-note {
  position: relative;
  min-height: 410px;
  padding: clamp(24px, 4vw, 42px);
  border: 3px solid #8d5268;
  border-radius: 20px 14px 24px 18px;
  background: rgba(255, 253, 244, .8);
  box-shadow: 0 10px 0 rgba(200, 142, 170, .2);
}

.timeline-note h3 {
  margin: 0 0 16px;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
}

.timeline-note p {
  max-width: 60ch;
  margin: 0;
  line-height: 1.9;
}

.dancer {
  position: relative;
  width: 110px;
  height: 140px;
  margin: 0 0 20px auto;
}

.dancer span {
  position: absolute;
  display: block;
  background: #cc6b90;
}

.dancer .head {
  left: 42px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffd1df;
  border: 3px solid #8d5268;
}

.dancer .body {
  left: 50px;
  top: 45px;
  width: 18px;
  height: 52px;
  border-radius: 12px;
}

.arm,
.leg {
  width: 12px;
  height: 48px;
  border-radius: 999px;
  transform-origin: top center;
}

.arm-left { left: 38px; top: 50px; transform: rotate(32deg); }
.arm-right { left: 66px; top: 50px; transform: rotate(-38deg); }
.leg-left { left: 48px; top: 92px; transform: rotate(20deg); }
.leg-right { left: 60px; top: 92px; transform: rotate(-26deg); }

.music-note {
  color: #9a5ad5;
  background: transparent !important;
  font-size: 1.6rem;
  opacity: 0;
}

.note-a { right: 6px; top: 12px; }
.note-b { left: 0; top: 42px; }

.dancer.dancing {
  animation: sway .7s ease-in-out infinite alternate;
}

.dancer.dancing .music-note {
  opacity: 1;
  animation: floaty .9s ease-in-out infinite alternate;
}

.growth-doodles .sun,
.growth-doodles .rainbow,
.growth-doodles .mirror,
.growth-doodles .yoga-mat {
  position: absolute;
  opacity: .5;
}

.growth-doodles .sun {
  left: 7%;
  bottom: 12%;
  width: 78px;
  height: 78px;
  border: 4px solid #e7a63f;
  border-radius: 50%;
  background: #fff0a8;
}

.growth-doodles .rainbow {
  left: 12%;
  top: 14%;
  width: 126px;
  height: 66px;
  border: 10px solid #f28cab;
  border-bottom: 0;
  border-radius: 120px 120px 0 0;
  box-shadow: inset 0 10px 0 #fff0a8, inset 0 22px 0 #dcd3ff;
}

.growth-doodles .mirror {
  right: 8%;
  top: 16%;
  width: 92px;
  height: 150px;
  border: 4px solid #9b789d;
  border-radius: 44% 44% 18px 18px;
  background: rgba(255, 255, 255, .44);
}

.growth-doodles .yoga-mat {
  right: 10%;
  bottom: 12%;
  width: 130px;
  height: 34px;
  border: 3px solid #8d5268;
  border-radius: 999px;
  background: #dcd3ff;
}

.page-wishes {
  background:
    radial-gradient(circle at 20% 12%, rgba(248, 232, 167, .58), transparent 18%),
    radial-gradient(circle at 85% 84%, rgba(222, 215, 244, .62), transparent 18%),
    #f8e3eb;
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: clamp(16px, 3vw, 28px);
}

.wish-card {
  position: relative;
  min-height: 138px;
  padding: 22px;
  border: 2px solid rgba(141, 82, 104, .38);
  border-radius: 12px 18px 13px 16px;
  color: #62384d;
  background: #fff1a7;
  box-shadow: 0 10px 0 rgba(183, 113, 144, .18);
  cursor: pointer;
  transform: rotate(var(--tilt));
}

.wish-card:nth-child(2n) {
  background: #ffd5e3;
}

.wish-card:nth-child(3n) {
  background: #e7ddff;
}

.wish-card.pop {
  animation: cardPop .45s var(--ease);
}

.burst-star {
  position: absolute;
  left: 50%;
  top: 50%;
  color: #e88aaa;
  pointer-events: none;
  animation: burst .74s ease-out forwards;
}

.page-camera {
  background: linear-gradient(180deg, #fff8ee 0%, #f5dce7 100%);
}

.desk-scene {
  display: grid;
  justify-items: center;
}

.camera-stage {
  position: relative;
  width: min(520px, 92vw);
  height: 430px;
  display: grid;
  justify-items: center;
}

.camera {
  position: relative;
  z-index: 2;
  width: min(380px, 78vw);
  height: 230px;
  margin-top: 24px;
  border: 4px solid #70495a;
  border-radius: 34px 24px 30px 26px;
  background:
    linear-gradient(180deg, #ffd1df 0 42%, #fff8e9 42% 100%);
  box-shadow: 0 12px 0 rgba(119, 72, 92, .18);
}

.shutter {
  position: absolute;
  top: 24px;
  right: 42px;
  width: 54px;
  height: 34px;
  border: 3px solid #70495a;
  border-radius: 16px;
  background: #fff0a8;
  cursor: pointer;
}

.camera-lens {
  position: absolute;
  left: 50%;
  top: 86px;
  width: 100px;
  height: 100px;
  border: 9px solid #70495a;
  border-radius: 50%;
  background: radial-gradient(circle, #7c5265 0 20%, #dcd3ff 22% 48%, #fff8e9 50%);
  transform: translateX(-50%);
}

.camera-eye {
  position: absolute;
  left: 42px;
  top: 36px;
  width: 58px;
  height: 42px;
  border: 3px solid #70495a;
  border-radius: 14px;
  background: #dcd3ff;
}

.camera-smile {
  position: absolute;
  left: 46px;
  bottom: 44px;
  width: 44px;
  height: 22px;
  border-bottom: 4px solid #70495a;
  border-radius: 0 0 50px 50px;
}

.photo-slot {
  position: absolute;
  top: 230px;
  width: 230px;
  height: 190px;
  overflow: hidden;
}

.polaroid-card {
  width: 200px;
  height: 170px;
  margin: 0 auto;
  padding: 16px 16px 36px;
  border: 3px solid #70495a;
  border-radius: 10px;
  background: #fffdf4;
  box-shadow: 0 10px 0 rgba(124, 82, 101, .18);
  transform: translateY(-190px);
  transition: transform 1.65s var(--ease);
}

.polaroid-card.printed {
  transform: translateY(16px) rotate(1.5deg);
}

.polaroid-art {
  position: relative;
  height: 112px;
  border: 2px dashed rgba(112, 73, 90, .35);
  border-radius: 12px;
  background: #fff1f7;
}

.cat-outline,
.heart-doodle,
.star-doodle,
.bunny-bow {
  position: absolute;
  display: block;
}

.cat-outline {
  left: 45px;
  top: 32px;
  width: 70px;
  height: 48px;
  border: 4px solid #d66d94;
  border-radius: 50%;
}

.cat-outline::before,
.cat-outline::after {
  position: absolute;
  top: -18px;
  width: 22px;
  height: 24px;
  border: 4px solid #d66d94;
  border-bottom: 0;
  background: #fff1f7;
  content: "";
}

.cat-outline::before {
  left: 6px;
  transform: rotate(-28deg);
}

.cat-outline::after {
  right: 6px;
  transform: rotate(28deg);
}

.heart-doodle {
  right: 22px;
  top: 22px;
  color: #e783a5;
}

.heart-doodle::before {
  content: "♡";
  font-size: 2rem;
}

.star-doodle {
  left: 16px;
  top: 14px;
  color: #d4a42f;
}

.star-doodle::before {
  content: "✦";
  font-size: 1.7rem;
}

.bunny-bow {
  right: 26px;
  bottom: 18px;
  color: #9b73bf;
}

.bunny-bow::before {
  content: "⋈";
  font-size: 2rem;
}

.snap-text {
  height: 34px;
  margin: 10px 0 18px;
  color: #be4f76;
  font-size: 1.8rem;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .25s var(--ease);
}

.snap-text.show {
  opacity: 1;
  transform: scale(1);
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: white;
  opacity: 0;
}

.flash.active {
  animation: flash .36s ease-out;
}

.page-final {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 226, 137, .58), transparent 32%),
    linear-gradient(180deg, #fff2d8 0%, #ffd7e6 56%, #cfc2ff 100%);
}

.night-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.55), transparent 3%),
    radial-gradient(circle at 76% 18%, rgba(255,255,255,.45), transparent 2%),
    radial-gradient(circle at 82% 70%, rgba(255,255,255,.38), transparent 2%);
}

.wish-prompt {
  margin: 0 0 20px;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  color: #78465b;
}

.cake-final {
  display: block;
}

.cake-final .smoke {
  top: -44px;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(120, 70, 91, .34);
  border-left: 0;
  border-bottom: 0;
  border-radius: 50%;
  opacity: 0;
  background: transparent;
}

.final-message {
  width: min(720px, 92vw);
  min-height: 160px;
  margin: 22px auto 18px;
  display: grid;
  gap: 10px;
  place-items: center;
  color: #fff8e9;
  font-size: clamp(1.25rem, 3vw, 2.2rem);
  line-height: 1.7;
  opacity: 0;
}

.final-message span {
  opacity: 0;
  transform: translateY(12px);
}

.page-final.blown {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 217, 134, .42), transparent 30%),
    linear-gradient(180deg, #57415f 0%, #876076 55%, #f4bf9e 100%);
  transition: background 2.2s ease;
}

.page-final.blown .flame {
  animation: extinguish 1.3s ease forwards;
}

.page-final.blown .smoke {
  animation: smoke 1.7s ease forwards .65s;
}

.page-final.blown .cake-final {
  animation: cakeFade 2.2s ease forwards 1.1s;
}

.page-final.blown .final-message {
  opacity: 1;
}

.page-final.blown .final-message span {
  animation: writeIn .9s var(--ease) forwards;
}

.page-final.blown .final-message span:nth-child(2) {
  animation-delay: .55s;
}

.page-final.blown .final-message span:nth-child(3) {
  animation-delay: 1.1s;
}

@keyframes floaty {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(-10px) rotate(4deg); }
}

@keyframes flameDance {
  from { transform: translateX(-50%) rotate(-5deg) scale(.95); }
  to { transform: translateX(-50%) rotate(7deg) scale(1.08); }
}

@keyframes sway {
  from { transform: rotate(-5deg); }
  to { transform: rotate(6deg); }
}

@keyframes cardPop {
  0%, 100% { transform: rotate(var(--tilt)) scale(1); }
  45% { transform: rotate(var(--tilt)) scale(1.08); }
}

@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(.2) rotate(80deg);
  }
}

@keyframes flash {
  0% { opacity: 0; }
  20% { opacity: .95; }
  100% { opacity: 0; }
}

@keyframes envelopeDiscard {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
    filter: drop-shadow(0 18px 18px rgba(92, 52, 69, .18));
  }
  42% {
    opacity: 1;
    transform: translateX(-50%) translateY(36px) rotate(-2deg) scale(.985);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(170px) rotate(-9deg) scale(.9);
    filter: drop-shadow(0 5px 8px rgba(92, 52, 69, .1));
  }
}

@keyframes extinguish {
  0% { opacity: 1; transform: translateX(-50%) rotate(-12deg) scale(1.08); }
  70% { opacity: .55; transform: translateX(-50%) rotate(15deg) scale(.72); }
  100% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.18); }
}

@keyframes smoke {
  0% { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.5); }
  35% { opacity: .7; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-34px) scale(1.4); }
}

@keyframes cakeFade {
  to {
    opacity: .12;
    transform: translateY(18px) scale(.94) rotate(1deg);
  }
}

@keyframes writeIn {
  to {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 0 14px rgba(255, 241, 178, .8);
  }
}

/* ===== 2026-07 调整：咖啡厅手帐风 + 真实信封/扑克牌/塔罗/相机 ===== */
.book {
  background:
    linear-gradient(rgba(255, 248, 238, .72), rgba(255, 222, 232, .5)),
    url("assets/backgrounds/cafe-bg-clean.png") center / cover no-repeat;
}

.book::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 247, 205, .38), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(92, 52, 69, .18));
  z-index: 0;
}

.page {
  z-index: 1;
}

.page.active {
  z-index: 3;
}

.page::before {
  opacity: .16;
}

.page-cover,
.page-letter,
.page-you,
.page-growth,
.page-wishes,
.page-camera,
.page-final {
  background:
    linear-gradient(rgba(255, 248, 238, .72), rgba(255, 227, 236, .52)),
    url("assets/backgrounds/cafe-bg-clean.png") center / cover no-repeat;
}

.cover-layout,
.letter-layout,
.section-shell,
.growth-layout,
.wish-wall,
.desk-scene,
.final-layout {
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(103, 61, 74, .18);
  border-radius: 22px;
  background: rgba(255, 250, 241, .72);
  box-shadow: 0 14px 28px rgba(82, 49, 62, .16);
}

.cover-layout,
.desk-scene,
.final-layout {
  background: rgba(255, 250, 241, .58);
}

.lighter {
  position: absolute;
  left: -160px;
  top: 52%;
  z-index: 4;
  width: 82px;
  height: 38px;
  border: 2px solid #6c4b45;
  border-radius: 12px 6px 6px 12px;
  background: linear-gradient(90deg, #b77d55, #f2c89c 48%, #6f4b44 50% 58%, #d8d3cb 59%);
  box-shadow: 0 8px 12px rgba(67, 42, 48, .2);
  opacity: 0;
}

.lighter::after {
  position: absolute;
  right: -18px;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8d3cb;
  content: "";
}

.lighter-flame {
  position: absolute;
  right: -34px;
  top: 0;
  width: 22px;
  height: 30px;
  border-radius: 55% 50% 55% 45%;
  background: radial-gradient(circle at 50% 70%, #fff6a5 0 25%, #f0a43b 30% 60%, #d45a63 70%);
  filter: drop-shadow(0 0 10px rgba(244, 159, 64, .85));
  transform-origin: bottom center;
  animation: flameDance .5s ease-in-out infinite alternate;
}

.lighter.strike {
  animation: lighterStrike 1.55s var(--ease) forwards;
}

@keyframes lighterStrike {
  0% { opacity: 0; transform: translateX(0) translateY(20px) rotate(-4deg); }
  22% { opacity: 1; transform: translateX(42vw) translateY(0) rotate(1deg); }
  62% { opacity: 1; transform: translateX(47vw) translateY(-12px) rotate(0); }
  100% { opacity: 0; transform: translateX(-20vw) translateY(4px) rotate(-5deg); }
}

.envelope {
  height: min(560px, 66vh);
}

.envelope-paper {
  bottom: 62px;
  width: min(560px, 76vw);
  height: min(380px, 47vh);
  border-color: rgba(114, 78, 62, .22);
  background:
    linear-gradient(rgba(125, 80, 104, .08) 1px, transparent 1px),
    linear-gradient(135deg, #fffdf7, #fff5e8);
  background-size: 100% 32px, auto;
  box-shadow: 0 12px 22px rgba(93, 59, 71, .15);
  transform: translate(-50%, 108px) scale(.9);
}

.envelope.open .envelope-paper {
  transform: translate(-50%, -118px) scale(1);
  transition-delay: .62s;
}

.real-flap {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 7%;
  height: 47%;
  border-radius: 18px 18px 44px 44px;
  background: linear-gradient(180deg, rgba(255, 252, 240, .95), rgba(242, 226, 190, .86));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  box-shadow: 0 16px 20px rgba(91, 67, 45, .18);
  opacity: .95;
  transition: transform .78s var(--ease), opacity .5s;
}

.envelope.open .real-flap {
  transform: rotateX(168deg);
  opacity: .55;
}

.envelope.open .envelope-photo-wrap {
  animation: envelopeDiscard 1.22s var(--ease) forwards .36s;
}

.sticker-placeholder {
  width: 108px;
  height: 138px;
  background: rgba(255, 255, 255, .7);
  border: 6px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
}

.cover-stickers .sticker-placeholder:nth-child(1) { left: 5%; top: 18%; transform: rotate(-8deg); }
.cover-stickers .sticker-placeholder:nth-child(2) { right: 6%; top: 17%; transform: rotate(7deg); }
.cover-stickers .sticker-placeholder:nth-child(3) { right: 12%; bottom: 16%; transform: rotate(-5deg); }
.corner-stickers .sticker-placeholder:nth-child(1) { left: 8%; top: 15%; transform: rotate(-7deg); }
.corner-stickers .sticker-placeholder:nth-child(2) { right: 8%; bottom: 17%; transform: rotate(8deg); }
.soft-stickers .sticker-placeholder:nth-child(1) { left: 4%; bottom: 15%; transform: rotate(8deg); }
.soft-stickers .sticker-placeholder:nth-child(2) { right: 5%; top: 17%; transform: rotate(-8deg); }
.growth-stickers .sticker-placeholder:nth-child(1) { left: 4%; top: 18%; transform: rotate(-6deg); }
.growth-stickers .sticker-placeholder:nth-child(2) { right: 4%; bottom: 14%; transform: rotate(6deg); }
.wishes-stickers .sticker-placeholder:nth-child(1) { left: 4%; bottom: 12%; transform: rotate(-9deg); }
.wishes-stickers .sticker-placeholder:nth-child(2) { right: 5%; top: 14%; transform: rotate(7deg); }
.camera-stickers .sticker-placeholder:nth-child(1) { left: 5%; top: 15%; transform: rotate(-6deg); }
.camera-stickers .sticker-placeholder:nth-child(2) { right: 5%; bottom: 13%; transform: rotate(7deg); }

.growth-stickers,
.wishes-stickers,
.camera-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.poker-table {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
}

.poker-hand {
  position: relative;
  width: min(760px, 92vw);
  height: min(390px, 54vh);
}

.trait-card.poker-card {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: clamp(150px, 17vw, 205px);
  min-height: 285px;
  transform: translateX(calc(-50% + var(--spread))) translateY(var(--lift)) rotate(var(--tilt));
  transform-origin: 50% 120%;
  transition: transform .35s var(--ease), z-index .2s;
}

.trait-card.poker-card:hover,
.trait-card.poker-card.flipped {
  z-index: 5;
  transform: translateX(calc(-50% + var(--spread))) translateY(calc(var(--lift) - 28px)) rotate(var(--tilt)) scale(1.04);
}

.trait-front,
.trait-back {
  border: 1px solid rgba(78, 42, 49, .34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,246,232,.96));
  box-shadow: 0 8px 12px rgba(51, 28, 36, .18);
}

.trait-front::after {
  content: "♡";
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: #c13e61;
  font-size: 1.8rem;
}

.pet-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 18px;
}

.pet-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 14px 12px;
  margin: 0;
  border: 1px solid rgba(83, 52, 64, .28);
  border-radius: 16px;
  background: rgba(255, 250, 242, .78);
  box-shadow: 0 8px 14px rgba(68, 42, 52, .12);
}

.pet-node::before,
.timeline::before {
  display: none;
}

.pet-node img {
  width: min(120px, 24vw);
  height: 150px;
  object-fit: contain;
}

.pet-node.active {
  background: rgba(255, 225, 236, .9);
  transform: translateY(-6px);
}

.pet-stage-img {
  display: block;
  width: min(180px, 34vw);
  height: 230px;
  object-fit: contain;
  margin: -12px auto 12px;
  filter: drop-shadow(0 10px 10px rgba(68, 42, 52, .18));
}

.pet-stage-img.dancing {
  animation: sway .7s ease-in-out infinite alternate;
}

.timeline-note {
  min-height: 410px;
}

.tarot-table {
  position: relative;
  width: min(850px, 94vw);
  height: min(510px, 62vh);
  margin: 0 auto;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 224, 157, .12), transparent 38%),
    linear-gradient(135deg, rgba(36, 30, 38, .92), rgba(55, 43, 58, .88));
  box-shadow: inset 0 0 0 1px rgba(249, 214, 137, .18), 0 18px 32px rgba(48, 29, 40, .2);
  overflow: visible;
}

.wish-card.tarot-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(120px, 15vw, 160px);
  min-height: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--tilt));
  transition: transform .42s var(--ease), z-index .2s;
  perspective: 900px;
}

.wish-card.tarot-card.drawn {
  z-index: 8;
  transform: translate(-50%, -50%) rotate(0deg) scale(1.12);
}

.tarot-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .58s var(--ease);
}

.tarot-card.revealed .tarot-inner {
  transform: rotateY(180deg);
}

.tarot-front,
.tarot-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid #d9b55f;
  border-radius: 14px;
  backface-visibility: hidden;
  color: #f7dc90;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(247, 220, 144, .14) 47% 53%, transparent 54%),
    #242128;
  box-shadow: inset 0 0 0 6px rgba(217, 181, 95, .18), 0 9px 18px rgba(0,0,0,.28);
}

.tarot-front {
  gap: 8px;
  font-size: 1.05rem;
}

.tarot-star {
  font-size: 2.4rem;
}

.tarot-back {
  transform: rotateY(180deg);
  color: #563748;
  background: linear-gradient(135deg, #fff8e9, #ffe3ee);
  line-height: 1.7;
}

.real-camera {
  position: relative;
  z-index: 4;
  width: min(330px, 72vw);
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 16px 18px rgba(47, 31, 35, .24));
}

.real-camera img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.real-camera:active {
  transform: translateY(2px) scale(.99);
}

.camera-stage {
  height: min(520px, 64vh);
  overflow: visible;
}

.photo-slot {
  top: 0;
  width: min(330px, 70vw);
  height: 260px;
  overflow: visible;
  pointer-events: none;
}

.polaroid-card {
  position: absolute;
  left: 50%;
  top: -210px;
  width: 220px;
  height: 250px;
  padding: 14px 14px 52px;
  border: 0;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 12px 22px rgba(48, 30, 40, .26);
  transform: translateX(-50%) translateY(-40px) rotate(-4deg);
  opacity: 0;
  transition: transform .82s var(--ease), opacity .45s var(--ease);
}

.polaroid-card.printed {
  opacity: 1;
  transform: translateX(-50%) translateY(92px) rotate(3deg);
}

.polaroid-card.blown-away {
  animation: photoWind .56s ease-in forwards;
}

.polaroid-card img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 4px;
  background: #eee;
}

.polaroid-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  color: #765264;
  font-size: .9rem;
  text-align: center;
}

@keyframes photoWind {
  to {
    opacity: 0;
    transform: translateX(-170%) translateY(20px) rotate(-24deg);
  }
}

/* ===== 2026-07 第二轮调整：真实素材叠层 + 浅色塔罗 + 无白边贴纸 ===== */
.sticker-placeholder {
  width: 124px;
  height: 142px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.sticker-placeholder img {
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(77, 48, 55, .16));
}

.photo-cake {
  width: min(430px, 82vw);
  height: min(355px, 48vh);
  display: block;
  overflow: visible;
  filter: drop-shadow(0 18px 24px rgba(73, 44, 54, .22));
}

.cake-photo {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: auto;
  transform: translateX(-50%);
  border-radius: 10px;
  pointer-events: none;
}

.photo-cake .cake-top,
.photo-cake .cake-body,
.photo-cake .cake-plate,
.photo-cake .candle,
.photo-cake .flame {
  display: none;
}

.candle-cluster {
  position: absolute;
  left: 50%;
  top: 1%;
  z-index: 3;
  width: 180px;
  height: 126px;
  transform: translateX(-50%);
  pointer-events: none;
}

.photo-candle {
  position: absolute;
  bottom: 0;
  width: 26px;
  height: 112px;
  background: url("assets/objects/candle-body.png") center bottom / contain no-repeat;
  filter: drop-shadow(0 5px 7px rgba(50, 31, 35, .2));
  transform-origin: bottom center;
}

.candle-one { left: 34px; transform: rotate(-3deg); }
.candle-two { left: 78px; transform: translateY(-8px); }
.candle-three { right: 34px; transform: rotate(4deg); }

.real-flame {
  position: absolute;
  left: 50%;
  top: -33px;
  width: 22px;
  height: 36px;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 50% 72%, rgba(255, 255, 225, .98) 0 20%, transparent 22%),
    radial-gradient(circle at 52% 62%, #ffe789 0 34%, #ff9a2e 46%, #db4a35 67%, rgba(128, 36, 83, .2) 78%);
  opacity: 0;
  transform: translateX(-50%) scale(.85);
  transform-origin: bottom center;
  filter:
    drop-shadow(0 0 8px rgba(255, 184, 62, .95))
    drop-shadow(0 0 18px rgba(255, 118, 58, .5));
}

.cake.lit .real-flame,
.cake-final .real-flame {
  opacity: 1;
  animation: realFlameDance .52s ease-in-out infinite alternate;
}

.lighter {
  left: -260px;
  top: 49%;
  width: 190px;
  height: 112px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.lighter img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 12px rgba(48, 34, 36, .28));
}

.lighter::after {
  display: none;
}

.lighter-flame {
  right: 22px;
  top: 4px;
  width: 20px;
  height: 34px;
  background:
    radial-gradient(circle at 50% 70%, rgba(255,255,230,.98) 0 20%, transparent 21%),
    radial-gradient(circle at 50% 58%, #ffef8a 0 34%, #ff9a2e 45%, #d94b37 68%);
  filter: drop-shadow(0 0 10px rgba(255, 177, 57, .9));
  animation: realFlameDance .45s ease-in-out infinite alternate;
}

@keyframes lighterStrike {
  0% { opacity: 0; transform: translateX(0) translateY(22px) rotate(-5deg) scale(.92); }
  18% { opacity: 1; transform: translateX(37vw) translateY(10px) rotate(-2deg) scale(.95); }
  58% { opacity: 1; transform: translateX(45vw) translateY(-24px) rotate(1deg) scale(.95); }
  100% { opacity: 0; transform: translateX(-12vw) translateY(0) rotate(-6deg) scale(.92); }
}

@keyframes realFlameDance {
  from { transform: translateX(-50%) rotate(-5deg) scale(.9, 1); }
  to { transform: translateX(-50%) rotate(6deg) scale(1.06, .96); }
}

.page-final.blown .real-flame {
  animation: extinguish 1.3s ease forwards;
}

.page-final.blown .smoke {
  animation: smoke 1.7s ease forwards .65s;
}

.trait-card:hover .trait-inner {
  transform: none;
}

.trait-card.flipped .trait-inner,
.trait-card.poker-card.flipped .trait-inner {
  transform: rotateY(180deg);
}

.trait-front {
  justify-content: space-between;
  padding: 16px 18px 22px;
}

.trait-front::after,
.tiny-sticker {
  display: none;
}

.trait-character {
  width: 92px;
  height: 100px;
  object-fit: contain;
  align-self: center;
  filter: drop-shadow(0 8px 10px rgba(82, 49, 57, .16));
}

.tarot-table {
  width: min(880px, 94vw);
  height: min(500px, 61vh);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(101, 58, 31, .2), transparent 18% 82%, rgba(79, 43, 24, .18)),
    repeating-linear-gradient(90deg, #9a6239 0 82px, #8b5530 82px 88px, #b17143 88px 168px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 196, .22),
    inset 0 16px 22px rgba(255, 216, 160, .18),
    0 20px 32px rgba(58, 34, 29, .24);
  overflow: hidden;
}

.wish-card.tarot-card {
  width: clamp(118px, 14vw, 152px);
  min-height: 210px;
}

.wish-card.tarot-card.drawn {
  transform: translate(-50%, -50%) rotate(0deg) scale(1.08);
}

.tarot-front,
.tarot-back {
  border: 1px solid rgba(126, 76, 88, .3);
  color: #805065;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 244, 202, .72), transparent 34%),
    linear-gradient(145deg, rgba(255, 250, 240, .98), rgba(255, 224, 236, .96));
  box-shadow:
    inset 0 0 0 7px rgba(255, 255, 255, .42),
    0 9px 16px rgba(70, 38, 31, .22);
}

.tarot-front {
  color: #8a4b62;
}

.tarot-star {
  color: #d99954;
  text-shadow: 0 0 10px rgba(255, 224, 142, .9);
}

.tarot-back {
  color: #563748;
  background: linear-gradient(135deg, #fff9ef, #ffe0ea);
}

.real-camera img {
  object-fit: contain;
}

/* ===== 2026-07 第三轮调整：新蛋糕、原打火机、拍立得半出纸预览 ===== */
.photo-cake {
  width: min(420px, 82vw);
  height: min(480px, 56vh);
  margin-top: 4px;
  transform: rotate(-1deg);
}

.cake-photo {
  max-height: 100%;
  object-fit: contain;
  transition: opacity .8s ease, filter .8s ease, transform .8s ease;
}

.cake-unlit {
  opacity: 1;
}

.cake-lit {
  opacity: 0;
}

.photo-cake.lit .cake-unlit {
  opacity: 0;
}

.photo-cake.lit .cake-lit {
  opacity: 1;
  filter:
    drop-shadow(0 18px 24px rgba(73, 44, 54, .22))
    drop-shadow(0 0 22px rgba(255, 203, 90, .38));
}

.page-final.blown .cake-lit {
  opacity: 0;
}

.page-final.blown .cake-unlit {
  opacity: 1;
}

.page-final.blown .cake-final {
  animation: cakeFade 2.2s ease forwards 1.1s;
}

.cake-final .smoke {
  position: absolute;
  left: 50%;
  top: 11%;
  z-index: 4;
  width: 82px;
  height: 82px;
  border: 4px solid rgba(120, 70, 91, .26);
  border-left: 0;
  border-bottom: 0;
  border-radius: 50%;
  opacity: 0;
  background: transparent;
  transform: translateX(-50%);
}

.lighter {
  left: -160px;
  top: 52%;
  z-index: 5;
  width: 82px;
  height: 38px;
  border: 2px solid #6c4b45;
  border-radius: 12px 6px 6px 12px;
  background: linear-gradient(90deg, #b77d55, #f2c89c 48%, #6f4b44 50% 58%, #d8d3cb 59%);
  box-shadow: 0 8px 12px rgba(67, 42, 48, .2);
  opacity: 0;
}

.lighter::after {
  display: block;
  position: absolute;
  right: -18px;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8d3cb;
  content: "";
}

.lighter-flame {
  right: -34px;
  top: 0;
  width: 22px;
  height: 30px;
}

@keyframes lighterStrike {
  0% { opacity: 0; transform: translateX(0) translateY(20px) rotate(-4deg); }
  22% { opacity: 1; transform: translateX(42vw) translateY(0) rotate(1deg); }
  62% { opacity: 1; transform: translateX(47vw) translateY(-18px) rotate(0); }
  100% { opacity: 0; transform: translateX(-20vw) translateY(4px) rotate(-5deg); }
}

.camera-stage {
  height: min(560px, 68vh);
  align-content: end;
  overflow: visible;
}

.real-camera {
  z-index: 6;
}

.photo-slot {
  position: absolute;
  left: 50%;
  top: 46px;
  z-index: 4;
  width: min(300px, 68vw);
  height: 280px;
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}

.polaroid-card {
  position: absolute;
  left: 50%;
  top: 0;
  width: 226px;
  height: 266px;
  padding: 14px 14px 54px;
  border: 0;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 14px 24px rgba(48, 30, 40, .24);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(210px) rotate(-2deg) scale(.96);
  transition: transform 1.25s var(--ease), opacity .35s var(--ease), box-shadow .45s var(--ease);
}

.polaroid-card.printed {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(78px) rotate(1.5deg) scale(.98);
}

.polaroid-card.preview {
  z-index: 9;
  transform: translateX(-50%) translateY(245px) rotate(-2deg) scale(1.18);
  box-shadow: 0 22px 36px rgba(48, 30, 40, .3);
}

.polaroid-card.blown-away {
  pointer-events: none;
  animation: photoWind .56s ease-in forwards;
}

.polaroid-card img {
  height: 176px;
}

.polaroid-card.preview img {
  height: 176px;
}

.polaroid-caption {
  bottom: 18px;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
  }

  .growth-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .timeline-note {
    text-align: left;
  }

  .wish-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    overflow: hidden;
  }

  .page {
    padding: 58px 14px 104px;
  }

  .page-nav {
    left: 10px;
    right: 10px;
    justify-content: center;
  }

  .card-grid,
  .wish-grid {
    grid-template-columns: 1fr;
    max-height: 64vh;
    overflow: auto;
    padding: 4px 8px 16px;
  }

  .trait-inner,
  .trait-card {
    min-height: 190px;
  }

  .envelope {
    height: 440px;
  }

  .envelope-paper {
    height: 285px;
  }

  .cake {
    width: 190px;
    height: 188px;
  }

  .camera-stage {
    height: 390px;
  }

  .poker-table {
    min-height: 350px;
  }

  .poker-hand {
    height: 320px;
  }

  .trait-card.poker-card {
    width: 126px;
    min-height: 218px;
    bottom: 10%;
  }

  .trait-card.poker-card:nth-child(1) { --spread: -118px; }
  .trait-card.poker-card:nth-child(2) { --spread: -58px; }
  .trait-card.poker-card:nth-child(3) { --spread: 0px; }
  .trait-card.poker-card:nth-child(4) { --spread: 58px; }
  .trait-card.poker-card:nth-child(5) { --spread: 118px; }

  .tarot-table {
    width: min(360px, 96vw);
    height: 410px;
  }

  .wish-card.tarot-card {
    width: 96px;
    min-height: 168px;
  }

  .wish-card.tarot-card:nth-child(1) { --x: -112px; --y: 46px; }
  .wish-card.tarot-card:nth-child(2) { --x: -62px; --y: -48px; }
  .wish-card.tarot-card:nth-child(3) { --x: -10px; --y: 42px; }
  .wish-card.tarot-card:nth-child(4) { --x: 48px; --y: -36px; }
  .wish-card.tarot-card:nth-child(5) { --x: 100px; --y: 48px; }
  .wish-card.tarot-card:nth-child(6) { --x: 12px; --y: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* 本轮修改：第三页牌面、长信纸、拍立得出片交互 */
.envelope {
  height: min(680px, 78vh);
}

.envelope-paper {
  width: min(650px, 84vw);
  height: min(560px, 66vh);
  padding: 34px 38px;
  overflow: hidden;
}

.envelope.open .envelope-paper {
  transform: translate(-50%, -150px) scale(1);
}

#letterBody {
  display: block;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 10px;
  white-space: pre-line;
  line-height: 2;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(136, 79, 102, .38) transparent;
}

#letterBody::-webkit-scrollbar {
  width: 8px;
}

#letterBody::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(136, 79, 102, .34);
}

.trait-number {
  display: none !important;
}

.trait-card.poker-card {
  width: clamp(158px, 17vw, 214px);
  min-height: 300px;
}

.trait-front {
  justify-content: center;
  gap: 16px;
  padding: 18px 18px 24px;
}

.trait-front strong {
  min-height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #38242d;
}

.trait-character {
  width: 126px;
  height: 134px;
  border-radius: 16px;
  object-fit: contain;
}

.trait-back {
  padding: 0;
  overflow: hidden;
  background: #fffaf1;
}

.trait-back-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.photo-slot {
  top: 26px;
  height: 335px;
  pointer-events: none;
}

.polaroid-card {
  width: 238px;
  height: 288px;
  padding: 14px 14px 58px;
  transform: translateX(-50%) translateY(250px) rotate(-2deg) scale(.96);
  transition:
    left .65s var(--ease),
    top .65s var(--ease),
    transform 1.18s var(--ease),
    opacity .35s var(--ease),
    box-shadow .45s var(--ease);
}

.polaroid-card.printed {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(104px) rotate(1.5deg) scale(.98);
}

.polaroid-card.preview {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1.18);
  box-shadow: 0 26px 46px rgba(48, 30, 40, .34);
}

.polaroid-card.blown-away {
  pointer-events: none;
  animation: photoWindFromCenter .68s ease-in forwards;
}

.polaroid-card img {
  height: 192px;
}

.polaroid-card.preview img {
  height: 192px;
}

@keyframes photoWindFromCenter {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.18);
  }
  100% {
    opacity: 0;
    transform: translate(-170%, -70%) rotate(-24deg) scale(.9);
  }
}

@media (max-width: 680px) {
  .envelope-paper {
    width: 88vw;
    height: 58vh;
    padding: 26px 24px;
  }

  .envelope.open .envelope-paper {
    transform: translate(-50%, -122px) scale(1);
  }

  #letterBody {
    font-size: .96rem;
    line-height: 1.9;
  }

  .trait-card.poker-card {
    width: 146px;
    min-height: 270px;
  }

  .trait-character {
    width: 108px;
    height: 116px;
  }

  .polaroid-card.preview {
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.04);
  }
}

/* 本轮最终覆盖：干净背景、完整贴纸、独立蜡烛和居中大照片 */
.book,
.page-cover,
.page-letter,
.page-you,
.page-growth,
.page-wishes,
.page-camera,
.page-final {
  background-image:
    linear-gradient(rgba(255, 248, 238, .72), rgba(255, 227, 236, .52)),
    url("assets/backgrounds/cafe-bg-clean.png");
}

.sticker-placeholder {
  width: 132px;
  height: 132px;
  border: 6px solid rgba(255, 250, 240, .96);
  border-radius: 18px;
  background: #fff8ef;
  box-shadow: 0 12px 18px rgba(69, 42, 52, .18);
  overflow: hidden;
  opacity: 1;
}

.sticker-placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: none;
}

.photo-cake {
  width: min(500px, 84vw);
  height: min(390px, 50vh);
  isolation: isolate;
}

.cake-photo {
  z-index: 1;
  width: 100%;
  border-radius: 18px;
}

.cake-lit {
  display: none !important;
}

.photo-cake.lit .cake-unlit,
.page-final.blown .cake-unlit {
  opacity: 1 !important;
}

.photo-cake::after {
  position: absolute;
  left: 30%;
  top: 44%;
  z-index: 2;
  width: 27%;
  height: 11%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 48%, rgba(237, 216, 214, .94), rgba(220, 202, 192, .78) 64%, rgba(220, 202, 192, 0) 78%);
  filter: blur(2px);
  pointer-events: none;
  content: "";
}

.candle-cluster {
  top: 7%;
  z-index: 5;
  width: 58%;
  height: 36%;
}

.photo-candle {
  left: var(--x);
  bottom: calc(18px + var(--y));
  width: 22px;
  height: 106px;
  transform: translateX(-50%) rotate(var(--r));
}

.real-flame {
  opacity: 0;
}

.cake.lit .real-flame,
.cake-final.lit .real-flame {
  opacity: 1;
}

.page-final.blown .real-flame {
  opacity: 0 !important;
  animation: extinguish 1.2s ease forwards;
}

.lighter {
  left: -245px;
  top: 50%;
  z-index: 7;
  width: 178px;
  height: 110px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lighter img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(51, 36, 41, .28));
}

.polaroid-card.preview {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 60;
  width: min(390px, 82vw);
  height: min(500px, 74vh);
  padding: 18px 18px 82px;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1);
}

.polaroid-card.preview img {
  width: 100%;
  height: calc(100% - 4px);
  object-fit: contain;
  background: #f8f0e8;
}

.polaroid-card.blown-away {
  animation: photoWindFromCenter .72s ease-in forwards;
}

@media (max-width: 680px) {
  .photo-cake {
    width: min(440px, 92vw);
    height: min(350px, 44vh);
  }

  .sticker-placeholder {
    width: 104px;
    height: 104px;
    border-width: 5px;
  }

  .polaroid-card.preview {
    width: 84vw;
    height: 62vh;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  }
}

/* 2026-07-08：蛋糕最终状态修复
   未点燃图不带火焰，点燃后切换到完整带火焰图；禁用旧遮罩和额外蜡烛层。 */
.photo-cake {
  overflow: visible !important;
}

.cake-photo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  transition: opacity .7s ease, filter .7s ease, transform .7s ease;
}

.cake-unlit {
  opacity: 1 !important;
}

.cake-lit {
  opacity: 0 !important;
}

.photo-cake.lit .cake-unlit {
  opacity: 0 !important;
}

.photo-cake.lit .cake-lit {
  opacity: 1 !important;
  filter:
    drop-shadow(0 18px 24px rgba(73, 44, 54, .20))
    drop-shadow(0 0 28px rgba(255, 190, 77, .32)) !important;
}

.page-final.blown .cake-lit {
  opacity: 0 !important;
}

.page-final.blown .cake-unlit {
  opacity: 1 !important;
}

.photo-cake::after,
.candle-cluster,
.photo-candle,
.real-flame {
  display: none !important;
}

/* 2026-07-08：第 5 页愿望墙、完整出片、蜡烛融合和原版打火机 */
.wish-wall {
  width: min(980px, 96vw);
  padding: clamp(18px, 2.6vw, 30px);
  background: rgba(255, 250, 243, .76);
}

.wish-wall h2 {
  margin-bottom: 6px;
}

.wish-subtitle {
  margin: 0 auto 14px;
  color: #8b5d70;
  font-size: clamp(.96rem, 2.2vw, 1.12rem);
  letter-spacing: .04em;
}

.tarot-table {
  position: relative;
  width: min(850px, 92vw);
  height: min(510px, 58vh);
  min-height: 430px;
  margin: 0 auto;
  overflow: visible;
  border: 10px solid rgba(255, 244, 229, .96);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 221, 234, .72), transparent 16%),
    radial-gradient(circle at 86% 20%, rgba(255, 242, 180, .64), transparent 17%),
    radial-gradient(circle at 24% 80%, rgba(232, 222, 255, .46), transparent 18%),
    repeating-linear-gradient(0deg, rgba(156, 110, 83, .08) 0 2px, transparent 2px 18px),
    linear-gradient(135deg, #fff4db, #ffe8ef 48%, #f4dfcc);
  box-shadow:
    inset 0 0 0 2px rgba(183, 122, 146, .24),
    inset 0 20px 34px rgba(255, 255, 255, .34),
    0 18px 28px rgba(87, 54, 63, .18);
}

.tarot-table::before,
.tarot-table::after {
  position: absolute;
  z-index: 6;
  width: 88px;
  height: 30px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .5) 0 8px, transparent 8px 15px),
    rgba(255, 195, 214, .82);
  box-shadow: 0 5px 10px rgba(98, 62, 72, .12);
  content: "";
}

.tarot-table::before {
  left: -22px;
  top: 16px;
  transform: rotate(-12deg);
}

.tarot-table::after {
  right: -20px;
  bottom: 18px;
  transform: rotate(-10deg);
}

.wish-wall::before,
.wish-wall::after {
  position: absolute;
  z-index: 2;
  color: rgba(149, 88, 111, .45);
  font-size: 1.8rem;
  pointer-events: none;
  content: "✦  ♡  ✿";
}

.wish-wall::before {
  left: 7%;
  top: 17%;
  transform: rotate(-8deg);
}

.wish-wall::after {
  right: 8%;
  bottom: 13%;
  transform: rotate(8deg);
}

.wish-card.wish-note {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 4;
  width: clamp(134px, 15vw, 168px);
  height: 132px;
  min-height: 132px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) rotate(var(--tilt));
  transform-style: preserve-3d;
  transition: transform .34s var(--ease), z-index .18s ease;
  animation: wishFloat 4.6s ease-in-out infinite;
}

.wish-card.wish-note:hover {
  z-index: 10;
  transform: translate(-50%, calc(-50% - 10px)) rotate(var(--tilt)) scale(1.04);
}

.wish-note:nth-child(1) { --left: 18%; --top: 23%; }
.wish-note:nth-child(2) { --left: 80%; --top: 23%; }
.wish-note:nth-child(3) { --left: 22%; --top: 52%; }
.wish-note:nth-child(4) { --left: 78%; --top: 52%; }
.wish-note:nth-child(5) { --left: 25%; --top: 80%; }
.wish-note:nth-child(6) { --left: 75%; --top: 80%; }

.wish-note-inner {
  position: absolute;
  inset: 0;
  min-height: 132px;
  transform-style: preserve-3d;
  transition: transform .7s var(--ease);
}

.wish-note.revealed .wish-note-inner {
  transform: rotateY(180deg);
}

.wish-note-front,
.wish-note-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 2px solid rgba(185, 112, 140, .32);
  border-radius: 16px 20px 15px 18px;
  backface-visibility: hidden;
  color: #744458;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .5), transparent 44%),
    #fff3bf;
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, .32),
    0 12px 18px rgba(95, 58, 68, .16);
}

.wish-note:nth-child(2n) .wish-note-front,
.wish-note:nth-child(2n) .wish-note-back {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .5), transparent 44%),
    #ffddea;
}

.wish-note:nth-child(3n) .wish-note-front,
.wish-note:nth-child(3n) .wish-note-back {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .5), transparent 44%),
    #efe4ff;
}

.wish-note-front {
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.wish-note-icon {
  font-size: 2rem;
  line-height: 1;
  color: #d88aa5;
  text-shadow: 0 0 10px rgba(255, 240, 180, .7);
}

.wish-note-back {
  transform: rotateY(180deg);
  font-size: clamp(1rem, 2.3vw, 1.16rem);
  line-height: 1.65;
}

.wish-reveal-message {
  margin: 14px auto 0;
  color: #7a495c;
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  animation: wishMessageIn .8s ease both;
}

@keyframes wishFloat {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -4px; }
}

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

.burst-star {
  z-index: 30;
  color: #e99ab4;
  text-shadow: 0 0 8px rgba(255, 242, 181, .9);
}

.photo-slot {
  z-index: 64;
}

.real-camera {
  z-index: 40;
}

.polaroid-card.printed {
  z-index: 70;
  width: 260px;
  height: 330px;
  padding: 16px 16px 70px;
  transform: translateX(-50%) translateY(-4px) rotate(-2deg) scale(1);
  box-shadow: 0 24px 38px rgba(48, 30, 40, .32);
}

.polaroid-card.printed img {
  width: 100%;
  height: 238px;
  object-fit: contain;
  background: #f8f0e8;
}

.polaroid-card.preview {
  width: min(390px, 82vw);
  height: min(500px, 74vh);
}

.candle-cluster {
  top: 13%;
  width: 54%;
  height: 31%;
}

.photo-candle {
  width: 17px;
  height: 82px;
  bottom: calc(0px + var(--y));
  opacity: .94;
  filter: drop-shadow(0 3px 4px rgba(84, 45, 51, .18));
}

.real-flame {
  top: -27px;
  width: 18px;
  height: 30px;
}

.lighter {
  left: -160px;
  top: 52%;
  width: 82px;
  height: 38px;
  border: 2px solid #6c4b45;
  border-radius: 12px 6px 6px 12px;
  background: linear-gradient(90deg, #b77d55, #f2c89c 48%, #6f4b44 50% 58%, #d8d3cb 59%);
  box-shadow: 0 8px 12px rgba(67, 42, 48, .2);
}

.lighter img {
  display: none;
}

.lighter::after {
  display: block;
  position: absolute;
  right: -18px;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8d3cb;
  content: "";
}

.lighter-flame {
  right: -34px;
  top: 0;
  width: 22px;
  height: 30px;
}

@media (max-width: 680px) {
  .tarot-table {
    width: 92vw;
    height: 500px;
    min-height: 500px;
  }

  .wish-card.wish-note {
    width: 118px;
    height: 116px;
    min-height: 116px;
  }

  .wish-note-inner {
    min-height: 116px;
  }

  .wish-note:nth-child(1) { --left: 25%; --top: 18%; }
  .wish-note:nth-child(2) { --left: 75%; --top: 18%; }
  .wish-note:nth-child(3) { --left: 25%; --top: 47%; }
  .wish-note:nth-child(4) { --left: 75%; --top: 47%; }
  .wish-note:nth-child(5) { --left: 25%; --top: 76%; }
  .wish-note:nth-child(6) { --left: 75%; --top: 76%; }

  .polaroid-card.printed {
    width: 230px;
    height: 300px;
    transform: translateX(-50%) translateY(18px) rotate(-2deg) scale(1);
  }

  .polaroid-card.printed img {
    height: 212px;
  }
}

/* 2026-07-08：新蛋糕图和两段式拍立得出片 */
.photo-cake {
  width: min(520px, 86vw);
  height: min(520px, 58vh);
  overflow: visible;
}

.cake-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.cake-lit {
  display: none !important;
}

.photo-cake.lit .cake-unlit,
.page-final.blown .cake-unlit {
  opacity: 1 !important;
  filter: drop-shadow(0 18px 24px rgba(73, 44, 54, .22));
}

.photo-cake::after,
.candle-cluster,
.photo-candle,
.real-flame {
  display: none !important;
}

.wish-wall::before {
  content: "\2726  \2661  \273F";
}

.wish-wall::after {
  content: "\273F  \2661  \2726";
}

.photo-slot {
  top: 18px;
  z-index: 34;
  height: 390px;
}

.photo-slot:has(.polaroid-card.preview),
.photo-slot:has(.polaroid-card.blown-away) {
  z-index: 90;
}

.real-camera {
  z-index: 45;
}

.polaroid-card {
  z-index: 32;
  transition:
    left .65s var(--ease),
    top .65s var(--ease),
    width .65s var(--ease),
    height .65s var(--ease),
    padding .65s var(--ease),
    transform 2s var(--ease),
    opacity .35s var(--ease),
    box-shadow .45s var(--ease);
}

.polaroid-card.printed {
  z-index: 36;
  width: 248px;
  height: 318px;
  padding: 16px 16px 68px;
  transform: translateX(-50%) translateY(122px) rotate(-2deg) scale(1);
}

.polaroid-card.printed img {
  width: 100%;
  height: 226px;
  object-fit: cover;
}

.polaroid-card.preview {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  width: min(390px, 82vw);
  height: min(500px, 74vh);
  padding: 18px 18px 82px;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  transition:
    left .65s var(--ease),
    top .65s var(--ease),
    width .65s var(--ease),
    height .65s var(--ease),
    padding .65s var(--ease),
    transform .65s var(--ease),
    opacity .35s var(--ease),
    box-shadow .45s var(--ease);
}

.polaroid-card.preview img {
  width: 100%;
  height: calc(100% - 4px);
  object-fit: contain;
}

@media (max-width: 680px) {
  .photo-cake {
    width: min(460px, 94vw);
    height: min(460px, 52vh);
  }

  .polaroid-card.printed {
    width: 220px;
    height: 292px;
    padding: 14px 14px 62px;
    transform: translateX(-50%) translateY(146px) rotate(-2deg) scale(1);
  }

  .polaroid-card.printed img {
    height: 208px;
  }

  .polaroid-card.preview {
    width: 84vw;
    height: 62vh;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  }
}

/* 最终修复：点燃前显示无火蜡烛，点燃后显示火焰。
   这里放在文件末尾，用来覆盖前面残留的旧规则。 */
.photo-cake {
  position: relative !important;
  overflow: visible !important;
}

.cake-photo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}

.cake-unlit {
  opacity: 1 !important;
}

.cake-lit {
  display: block !important;
  opacity: 0 !important;
}

.photo-cake.lit .cake-unlit {
  opacity: 0 !important;
}

.photo-cake.lit .cake-lit {
  opacity: 1 !important;
  filter:
    drop-shadow(0 18px 24px rgba(73, 44, 54, .20))
    drop-shadow(0 0 34px rgba(255, 191, 70, .36)) !important;
}

.page-final.blown .cake-lit {
  opacity: 0 !important;
}

.page-final.blown .cake-unlit {
  opacity: 1 !important;
}

/* 点燃时的保险火焰层：即使浏览器缓存旧图，也会出现六个火焰。 */
.photo-cake::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 214, 96, .82) 0 3.6%, rgba(255, 150, 51, .42) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 214, 96, .82) 0 4.2%, rgba(255, 150, 51, .42) 6.1%, transparent 9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 214, 96, .82) 0 4.4%, rgba(255, 150, 51, .42) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 214, 96, .82) 0 4.4%, rgba(255, 150, 51, .42) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 74% 15%, rgba(255, 214, 96, .82) 0 4.2%, rgba(255, 150, 51, .42) 6.1%, transparent 9%),
    radial-gradient(ellipse at 87% 25%, rgba(255, 214, 96, .82) 0 3.6%, rgba(255, 150, 51, .42) 5.4%, transparent 8.2%);
  mix-blend-mode: screen;
  transition: opacity .45s ease;
}

.photo-cake.lit::before {
  opacity: 1;
  animation: candleGlow .68s ease-in-out infinite alternate;
}

.page-final.blown .photo-cake::before {
  opacity: 0 !important;
  animation: none !important;
}

@keyframes candleGlow {
  from {
    filter: blur(.2px) brightness(.96);
    transform: translateY(0) scaleY(.98);
  }
  to {
    filter: blur(.6px) brightness(1.16);
    transform: translateY(-2px) scaleY(1.04);
  }
}

/* 第 5 页：9 张愿望便利贴墙 */
.page-wishes .wish-wall {
  width: min(1080px, 96vw);
  padding: clamp(16px, 2.2vw, 28px);
  border: 1px solid rgba(164, 104, 124, .18);
  background:
    linear-gradient(rgba(255, 250, 243, .78), rgba(255, 246, 238, .82)),
    rgba(255, 248, 240, .84);
}

.page-wishes .wish-wall h2 {
  margin: 0 0 4px;
  color: #81455f;
}

.page-wishes .wish-subtitle {
  margin: 0 auto 12px;
  color: #8c6172;
  font-size: clamp(.9rem, 2vw, 1.08rem);
}

.page-wishes .tarot-table {
  position: relative;
  width: min(940px, 92vw);
  height: min(600px, calc(100dvh - 210px));
  min-height: 520px;
  margin: 0 auto;
  overflow: visible;
  border: 10px solid rgba(255, 243, 232, .98);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 186, 210, .20), transparent 12%),
    radial-gradient(circle at 83% 22%, rgba(255, 232, 148, .24), transparent 13%),
    radial-gradient(circle at 72% 76%, rgba(216, 204, 250, .26), transparent 16%),
    repeating-linear-gradient(0deg, rgba(177, 123, 82, .08) 0 2px, transparent 2px 9px),
    linear-gradient(135deg, #fff2df, #ffe8ef 52%, #fff6e9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .58),
    inset 0 0 32px rgba(157, 98, 71, .10),
    0 20px 34px rgba(86, 49, 61, .14);
}

.page-wishes .tarot-table::before,
.page-wishes .tarot-table::after {
  content: "";
  position: absolute;
  z-index: 8;
  width: 92px;
  height: 28px;
  border-radius: 7px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .44) 0 8px, transparent 8px 15px),
    rgba(255, 193, 214, .88);
  box-shadow: 0 5px 10px rgba(131, 82, 96, .14);
}

.page-wishes .tarot-table::before {
  left: -22px;
  top: 16px;
  transform: rotate(-12deg);
}

.page-wishes .tarot-table::after {
  right: -20px;
  bottom: 16px;
  transform: rotate(-10deg);
}

.page-wishes .wish-wall::before {
  content: "✦   ♡   ✿";
  left: 5%;
  top: 15%;
}

.page-wishes .wish-wall::after {
  content: "☾   ✦   ❀";
  right: 6%;
  bottom: 11%;
}

.wish-card.wish-note {
  width: clamp(132px, 13.5vw, 166px);
  height: clamp(138px, 18vh, 166px);
  min-height: 138px;
  transform: translate(-50%, -50%) rotate(var(--tilt));
}

.wish-card.wish-note:hover {
  transform: translate(-50%, calc(-50% - 10px)) rotate(var(--tilt)) scale(1.04);
}

.wish-note:nth-child(1) { --left: 18%; --top: 20%; }
.wish-note:nth-child(2) { --left: 50%; --top: 18%; }
.wish-note:nth-child(3) { --left: 82%; --top: 21%; }
.wish-note:nth-child(4) { --left: 18%; --top: 50%; }
.wish-note:nth-child(5) { --left: 50%; --top: 49%; }
.wish-note:nth-child(6) { --left: 82%; --top: 50%; }
.wish-note:nth-child(7) { --left: 18%; --top: 80%; }
.wish-note:nth-child(8) { --left: 50%; --top: 81%; }
.wish-note:nth-child(9) { --left: 82%; --top: 79%; }

.wish-note-inner {
  min-height: 100%;
}

.wish-note-front,
.wish-note-back {
  padding: 13px;
  border-color: rgba(186, 115, 141, .30);
  border-radius: 18px 21px 16px 20px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 244, 186, .70), transparent 27%),
    linear-gradient(145deg, rgba(255, 255, 255, .56), transparent 46%),
    #fff6cd;
}

.wish-note:nth-child(2n) .wish-note-front,
.wish-note:nth-child(2n) .wish-note-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 238, 250, .75), transparent 27%),
    linear-gradient(145deg, rgba(255, 255, 255, .58), transparent 46%),
    #ffe2ee;
}

.wish-note:nth-child(3n) .wish-note-front,
.wish-note:nth-child(3n) .wish-note-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(247, 239, 255, .80), transparent 27%),
    linear-gradient(145deg, rgba(255, 255, 255, .58), transparent 46%),
    #efe5ff;
}

.wish-note-front {
  grid-template-rows: 1fr auto;
  gap: 6px;
  color: #7d4860;
  font-size: clamp(.86rem, 1.6vw, 1rem);
  font-weight: 700;
  letter-spacing: .02em;
}

.wish-note-title {
  display: block;
  max-width: 9em;
  line-height: 1.25;
}

.wish-note-back {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  color: #5f384c;
  font-size: clamp(.76rem, 1.35vw, .92rem);
  line-height: 1.55;
  text-align: left;
}

.wish-doodle {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  filter: drop-shadow(0 5px 8px rgba(132, 82, 96, .12));
}

.wish-doodle::before,
.wish-doodle::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.wish-doodle-star::before {
  inset: 9px;
  background: #ffd977;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 35%);
  transform: rotate(-8deg);
}

.wish-doodle-star::after {
  inset: 16px;
  border-radius: 50%;
  background: rgba(255, 246, 183, .45);
}

.wish-doodle-moon::before {
  width: 38px;
  height: 38px;
  left: 12px;
  top: 8px;
  border-radius: 50%;
  background: #ffe9a5;
  box-shadow: inset -11px 0 0 #f3d7ff;
}

.wish-doodle-heart::before,
.wish-doodle-heart::after {
  width: 25px;
  height: 39px;
  top: 10px;
  border-radius: 25px 25px 0 0;
  background: #f7a4bc;
}

.wish-doodle-heart::before {
  left: 27px;
  transform: rotate(45deg);
  transform-origin: 0 100%;
}

.wish-doodle-heart::after {
  left: 5px;
  transform: rotate(-45deg);
  transform-origin: 100% 100%;
}

.wish-doodle-flower::before {
  width: 16px;
  height: 16px;
  left: 20px;
  top: 20px;
  border-radius: 50%;
  background: #ffe58f;
  box-shadow:
    0 -17px 0 4px #f6acc3,
    16px 0 0 4px #ffc6da,
    0 17px 0 4px #f4b7ce,
    -16px 0 0 4px #ffd0df;
}

.wish-doodle-bow::before,
.wish-doodle-bow::after {
  width: 27px;
  height: 24px;
  top: 17px;
  border: 3px solid #d998c3;
  background: #ffd9ec;
}

.wish-doodle-bow::before {
  left: 4px;
  border-radius: 16px 8px 8px 16px;
}

.wish-doodle-bow::after {
  right: 4px;
  border-radius: 8px 16px 16px 8px;
}

.wish-doodle-bow {
  background: radial-gradient(circle at 50% 52%, #d998c3 0 7px, transparent 8px);
}

.wish-doodle-cake::before {
  width: 40px;
  height: 26px;
  left: 8px;
  bottom: 8px;
  border: 3px solid #d895a7;
  border-radius: 8px 8px 10px 10px;
  background:
    radial-gradient(circle at 30% 28%, #ffb6c9 0 4px, transparent 5px),
    radial-gradient(circle at 70% 28%, #ffcf7e 0 4px, transparent 5px),
    #fff2bd;
}

.wish-doodle-cake::after {
  width: 5px;
  height: 18px;
  left: 26px;
  top: 8px;
  border-radius: 4px;
  background: #fff7dd;
  box-shadow: 0 -7px 0 1px #ffd16a;
}

.wish-doodle-sun::before {
  width: 34px;
  height: 34px;
  left: 11px;
  top: 11px;
  border-radius: 50%;
  background: #ffd873;
  box-shadow:
    0 -18px 0 -9px #ffc56a,
    0 18px 0 -9px #ffc56a,
    18px 0 0 -9px #ffc56a,
    -18px 0 0 -9px #ffc56a,
    13px 13px 0 -9px #ffc56a,
    -13px 13px 0 -9px #ffc56a,
    13px -13px 0 -9px #ffc56a,
    -13px -13px 0 -9px #ffc56a;
}

.wish-doodle-cloud::before {
  width: 42px;
  height: 22px;
  left: 8px;
  top: 25px;
  border-radius: 20px;
  background: #dce9ff;
  box-shadow:
    10px -12px 0 3px #dce9ff,
    23px -9px 0 1px #dce9ff;
}

.wish-doodle-gift::before {
  width: 40px;
  height: 32px;
  left: 8px;
  top: 18px;
  border: 3px solid #d592ae;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 43%, #f7a9c4 44% 56%, transparent 57%),
    linear-gradient(0deg, transparent 40%, #f7a9c4 41% 53%, transparent 54%),
    #fff0b8;
}

.wish-doodle-gift::after {
  width: 28px;
  height: 14px;
  left: 14px;
  top: 7px;
  border: 3px solid #d592ae;
  border-radius: 50% 50% 12px 12px;
  border-bottom: 0;
}

.wish-reveal-message {
  max-width: 720px;
  margin-top: 12px;
  color: #75455a;
  font-weight: 700;
}

@media (max-width: 680px) {
  .page-wishes .wish-wall {
    width: 96vw;
    padding: 14px 10px 18px;
  }

  .page-wishes .tarot-table {
    width: 92vw;
    height: min(560px, calc(100dvh - 190px));
    min-height: 500px;
    border-width: 7px;
  }

  .wish-card.wish-note {
    width: min(27vw, 112px);
    height: 128px;
    min-height: 128px;
  }

  .wish-note:nth-child(1) { --left: 19%; --top: 18%; }
  .wish-note:nth-child(2) { --left: 50%; --top: 17%; }
  .wish-note:nth-child(3) { --left: 81%; --top: 18%; }
  .wish-note:nth-child(4) { --left: 19%; --top: 49%; }
  .wish-note:nth-child(5) { --left: 50%; --top: 49%; }
  .wish-note:nth-child(6) { --left: 81%; --top: 49%; }
  .wish-note:nth-child(7) { --left: 19%; --top: 80%; }
  .wish-note:nth-child(8) { --left: 50%; --top: 81%; }
  .wish-note:nth-child(9) { --left: 81%; --top: 80%; }

  .wish-doodle {
    width: 42px;
    height: 42px;
    transform: scale(.78);
  }

  .wish-note-front {
    padding: 10px 8px;
    font-size: .74rem;
  }

  .wish-note-back {
    padding: 9px;
    font-size: .64rem;
    line-height: 1.45;
  }
}

/* 2026-07-08：整站手帐面板、抽卡交互、结尾蛋糕仪式感优化 */
:is(.cover-layout, .letter-layout, .section-shell, .growth-layout, .wish-wall, .desk-scene, .final-layout) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(180, 116, 140, .26) !important;
  border-radius: 26px 30px 24px 32px !important;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 225, 238, .44), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(240, 226, 255, .35), transparent 22%),
    linear-gradient(180deg, rgba(255, 253, 245, .82), rgba(255, 242, 248, .70)),
    rgba(255, 250, 242, .68) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .66),
    inset 0 0 30px rgba(255, 225, 235, .42),
    0 18px 36px rgba(91, 54, 68, .15) !important;
}

:is(.cover-layout, .letter-layout, .section-shell, .growth-layout, .wish-wall, .desk-scene, .final-layout)::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 0;
  border: 1px dashed rgba(164, 96, 124, .24);
  border-radius: 22px 26px 21px 28px;
  background:
    radial-gradient(circle, rgba(139, 88, 105, .10) 0 1px, transparent 1.5px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(255, 255, 255, .32), transparent 28% 72%, rgba(255, 255, 255, .24));
  pointer-events: none;
}

:is(.cover-layout, .letter-layout, .section-shell, .growth-layout, .wish-wall, .desk-scene, .final-layout)::after {
  content: "✦  ♡  ✿";
  position: absolute;
  right: clamp(18px, 4vw, 54px);
  top: clamp(14px, 3vw, 34px);
  z-index: 1;
  color: rgba(132, 75, 101, .30);
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  letter-spacing: .22em;
  transform: rotate(6deg);
  pointer-events: none;
}

:is(.cover-layout, .letter-layout, .section-shell, .growth-layout, .wish-wall, .desk-scene, .final-layout) > * {
  position: relative;
  z-index: 2;
}

.letter-layout::after {
  content: "✉  ✦  stamp";
  left: clamp(18px, 4vw, 54px);
  right: auto;
  color: rgba(126, 73, 98, .26);
  transform: rotate(-7deg);
}

.section-shell::after {
  content: "♡  ✦  ❀";
}

.growth-layout::after {
  content: "♪  ✦  bow";
}

.wish-wall::after {
  content: "✦  wish  ♡";
}

.desk-scene::after {
  content: "photo  ✦  ♡";
}

.final-layout::after {
  content: "✦  wish  ✦";
  color: rgba(255, 202, 112, .42);
}

.cover-layout::before,
.desk-scene::before,
.final-layout::before {
  border-style: solid;
}

.you-subtitle,
.you-note,
.final-hint {
  margin: 0 auto;
  max-width: 620px;
  color: #86586a;
  font-size: clamp(.9rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.you-subtitle {
  margin-top: -4px;
  margin-bottom: 12px;
}

.you-note {
  margin-top: 8px;
  color: rgba(112, 72, 91, .78);
  font-size: clamp(.82rem, 1.8vw, .98rem);
}

.poker-hand {
  transition: filter .35s ease;
}

.poker-hand.has-active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 1;
  width: min(330px, 72vw);
  height: min(390px, 54vh);
  border-radius: 42%;
  background:
    radial-gradient(circle, rgba(255, 231, 174, .34), transparent 58%),
    radial-gradient(circle, rgba(255, 196, 220, .24), transparent 68%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: focusGlow .7s ease both;
}

.trait-card.poker-card {
  will-change: transform;
  transition:
    transform .62s cubic-bezier(.2, .82, .2, 1),
    filter .42s ease,
    opacity .42s ease,
    z-index .2s ease;
}

.poker-hand.has-active .trait-card.poker-card:not(.active) {
  opacity: .52;
  filter: blur(.5px) saturate(.86);
  transform: translateX(calc(-50% + var(--spread))) translateY(calc(var(--lift) + 12px)) rotate(var(--tilt)) scale(.92);
}

.trait-card.poker-card.active {
  z-index: 30 !important;
  transform: translateX(-50%) translateY(-72px) rotate(0deg) scale(1.24) !important;
}

.trait-card.poker-card.active .trait-inner {
  box-shadow:
    0 26px 44px rgba(72, 43, 59, .26),
    0 0 32px rgba(255, 219, 142, .30);
}

.trait-card.poker-card.active::after {
  content: "✦";
  position: absolute;
  right: -18px;
  top: -24px;
  color: rgba(221, 151, 180, .85);
  font-size: 1.8rem;
  text-shadow: 0 0 12px rgba(255, 235, 165, .85);
  animation: tinyTwinkle 1.2s ease-in-out infinite alternate;
}

.trait-card.poker-card.flipped.active .trait-inner {
  transform: rotateY(180deg);
}

.trait-card.poker-card:hover:not(.active) {
  transform: translateX(calc(-50% + var(--spread))) translateY(calc(var(--lift) - 20px)) rotate(var(--tilt)) scale(1.03);
}

.final-layout {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(10px, 1.8vw, 18px);
  min-height: min(720px, calc(100dvh - 128px));
  padding-top: clamp(22px, 4vw, 42px) !important;
  padding-bottom: clamp(24px, 4vw, 44px) !important;
}

.wish-prompt {
  margin: 0;
  color: #79485c;
  font-size: clamp(1.55rem, 4vw, 2.75rem);
  line-height: 1.15;
}

.final-hint {
  margin-top: -4px;
  color: rgba(121, 72, 92, .76);
  font-size: clamp(.84rem, 1.8vw, 1rem);
}

.cake-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(560px, 86vw);
  min-height: clamp(310px, 45vh, 430px);
  margin: 2px auto 0;
}

.cake-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 11%;
  width: 86%;
  height: 24%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 245, 221, .95), rgba(255, 219, 196, .72) 58%, transparent 72%);
  transform: translateX(-50%);
  box-shadow:
    0 15px 26px rgba(97, 61, 67, .16),
    inset 0 0 0 2px rgba(255, 255, 255, .56);
}

.cake-stage::after {
  content: "✦   ♡   ✦";
  position: absolute;
  left: 50%;
  top: 6%;
  color: rgba(255, 196, 121, .58);
  font-size: clamp(1.1rem, 2.8vw, 1.8rem);
  letter-spacing: .34em;
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
}

.cake-stage .photo-cake {
  width: min(390px, 72vw) !important;
  height: min(390px, 43vh) !important;
  margin: 0 !important;
  transform: rotate(-1deg) translateY(8px) !important;
  filter:
    drop-shadow(0 18px 22px rgba(74, 44, 52, .18))
    drop-shadow(0 0 34px rgba(255, 211, 128, .20)) !important;
}

.cake-stage .cake-photo {
  filter: saturate(.96) contrast(.98);
}

#blowCandle,
#restartBook {
  border-radius: 18px 22px 17px 23px;
  border: 2px solid rgba(135, 79, 103, .62);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, .62), transparent 24%),
    linear-gradient(145deg, #fff4b8, #ffd9ea);
  box-shadow:
    0 7px 0 rgba(141, 82, 104, .38),
    0 14px 22px rgba(87, 52, 68, .16);
}

#blowCandle:hover,
#restartBook:hover {
  transform: translateY(-2px) rotate(-1deg);
}

.page-final.blown .cake-stage {
  animation: cakeStageDim 2s ease forwards .7s;
}

@keyframes focusGlow {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.82);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes tinyTwinkle {
  from {
    opacity: .45;
    transform: translateY(0) rotate(-8deg) scale(.9);
  }
  to {
    opacity: 1;
    transform: translateY(-4px) rotate(8deg) scale(1.08);
  }
}

@keyframes cakeStageDim {
  to {
    opacity: .34;
    transform: translateY(6px) scale(.98);
  }
}

@media (max-width: 680px) {
  :is(.cover-layout, .letter-layout, .section-shell, .growth-layout, .wish-wall, .desk-scene, .final-layout)::after {
    opacity: .65;
    font-size: .92rem;
    letter-spacing: .12em;
  }

  .poker-table {
    min-height: 390px;
  }

  .poker-hand {
    height: 360px;
  }

  .trait-card.poker-card.active {
    transform: translateX(-50%) translateY(-44px) rotate(0deg) scale(1.16) !important;
  }

  .poker-hand.has-active .trait-card.poker-card:not(.active) {
    opacity: .40;
    transform: translateX(calc(-50% + var(--spread))) translateY(calc(var(--lift) + 20px)) rotate(var(--tilt)) scale(.82);
  }

  .final-layout {
    min-height: calc(100dvh - 104px);
    gap: 8px;
  }

  .cake-stage {
    width: 92vw;
    min-height: 330px;
  }

  .cake-stage .photo-cake {
    width: min(315px, 82vw) !important;
    height: min(315px, 39vh) !important;
  }
}

/* 2026-07-08：第一页逐根点蜡烛 + 结尾祝福文字加深 */
.final-message {
  color: #6f3f56 !important;
  padding: clamp(14px, 2vw, 22px);
  border: 1px dashed rgba(132, 74, 100, .28);
  border-radius: 24px 28px 23px 27px;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 229, 238, .45), transparent 28%),
    linear-gradient(135deg, rgba(255, 250, 241, .70), rgba(255, 236, 246, .52));
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .92),
    0 0 18px rgba(255, 235, 181, .34);
}

.final-message span {
  font-weight: 700;
}

.page-final.blown .final-message {
  color: #6f3f56 !important;
}

.cover-layout .lighter {
  left: 50% !important;
  top: 50% !important;
  z-index: 12 !important;
  width: clamp(118px, 13vw, 170px) !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
  transform: translate(-360px, -64px) rotate(-10deg) scale(.94);
  transition:
    transform .42s cubic-bezier(.2, .8, .25, 1),
    opacity .25s ease;
}

.cover-layout .lighter img {
  display: block !important;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 16px rgba(51, 36, 41, .28));
}

.cover-layout .lighter::after {
  display: none !important;
}

.cover-layout .lighter-flame {
  right: 20px !important;
  top: 2px !important;
  width: 20px !important;
  height: 34px !important;
  opacity: 0;
  transform-origin: 50% 85%;
}

.cover-layout .lighter.candle-pass {
  opacity: 1;
}

.cover-layout .lighter.candle-pass .lighter-flame {
  opacity: 1;
  animation: realFlameDance .45s ease-in-out infinite alternate;
}

.cover-layout .lighter.pass-1 { transform: translate(-265px, -132px) rotate(-7deg) scale(.94); }
.cover-layout .lighter.pass-2 { transform: translate(-166px, -178px) rotate(-4deg) scale(.94); }
.cover-layout .lighter.pass-3 { transform: translate(-62px, -202px) rotate(-1deg) scale(.94); }
.cover-layout .lighter.pass-4 { transform: translate(50px, -202px) rotate(1deg) scale(.94); }
.cover-layout .lighter.pass-5 { transform: translate(152px, -178px) rotate(4deg) scale(.94); }
.cover-layout .lighter.pass-6 { transform: translate(248px, -132px) rotate(7deg) scale(.94); }

.cover-layout .lighter.done {
  opacity: 0;
  transform: translate(360px, -118px) rotate(10deg) scale(.9);
}

.photo-cake.lit-count-1::before,
.photo-cake.lit-count-2::before,
.photo-cake.lit-count-3::before,
.photo-cake.lit-count-4::before,
.photo-cake.lit-count-5::before,
.photo-cake.lit-count-6::before {
  opacity: 1;
  animation: candleGlow .68s ease-in-out infinite alternate;
}

.photo-cake.lit-count-1::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%);
}

.photo-cake.lit-count-2::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%);
}

.photo-cake.lit-count-3::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%);
}

.photo-cake.lit-count-4::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%);
}

.photo-cake.lit-count-5::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 74% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%);
}

.photo-cake.lit-count-6::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 224, 110, .92) 0 4.4%, rgba(255, 151, 42, .54) 6.4%, transparent 9.4%),
    radial-gradient(ellipse at 74% 15%, rgba(255, 224, 110, .92) 0 4.2%, rgba(255, 151, 42, .54) 6.1%, transparent 9%),
    radial-gradient(ellipse at 87% 25%, rgba(255, 224, 110, .92) 0 3.6%, rgba(255, 151, 42, .54) 5.4%, transparent 8.2%);
}

@media (max-width: 680px) {
  .cover-layout .lighter {
    width: 108px !important;
  }

  .cover-layout .lighter.pass-1 { transform: translate(-170px, -84px) rotate(-7deg) scale(.9); }
  .cover-layout .lighter.pass-2 { transform: translate(-106px, -116px) rotate(-4deg) scale(.9); }
  .cover-layout .lighter.pass-3 { transform: translate(-40px, -132px) rotate(-1deg) scale(.9); }
  .cover-layout .lighter.pass-4 { transform: translate(32px, -132px) rotate(1deg) scale(.9); }
  .cover-layout .lighter.pass-5 { transform: translate(96px, -116px) rotate(4deg) scale(.9); }
  .cover-layout .lighter.pass-6 { transform: translate(158px, -84px) rotate(7deg) scale(.9); }
  .cover-layout .lighter.done { transform: translate(220px, -80px) rotate(10deg) scale(.86); }
}

/* 2026-07-08：修复第一页和最后一页标题被裁切、打火机从左侧逐根点燃 */
.page-cover,
.page-final {
  place-items: start center !important;
  padding-top: clamp(18px, 3vh, 34px) !important;
  padding-bottom: clamp(92px, 12vh, 132px) !important;
}

.page-cover .cover-layout,
.page-final .final-layout {
  width: min(1040px, 96vw);
  min-height: auto !important;
  max-height: none !important;
  box-sizing: border-box;
}

.page-cover .cover-layout {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: clamp(6px, 1.2vh, 12px);
  padding-top: clamp(16px, 2.2vh, 28px) !important;
  padding-bottom: clamp(18px, 2.4vh, 32px) !important;
}

.page-cover h1 {
  font-size: clamp(2.15rem, 5.2vw, 4.7rem);
  line-height: 1.04;
}

.page-cover .cover-subtitle {
  margin: 4px auto 8px;
  font-size: clamp(1.05rem, 2.4vw, 1.65rem);
}

.page-cover .small-ribbon {
  margin-bottom: 2px;
}

.page-cover .photo-cake {
  width: min(420px, 76vw) !important;
  height: min(380px, 44vh) !important;
}

.page-final .final-layout {
  align-content: start !important;
  gap: clamp(6px, 1.1vh, 12px) !important;
  padding-top: clamp(18px, 2.5vh, 30px) !important;
  padding-bottom: clamp(18px, 2.5vh, 30px) !important;
}

.page-final .wish-prompt {
  max-width: 880px;
  font-size: clamp(1.35rem, 3.2vw, 2.25rem) !important;
  line-height: 1.12;
}

.page-final .final-hint {
  font-size: clamp(.82rem, 1.5vw, .98rem);
  line-height: 1.55;
}

.page-final .cake-stage {
  width: min(500px, 82vw);
  min-height: clamp(220px, 35vh, 345px);
  margin-top: 0;
}

.page-final .cake-stage .photo-cake {
  width: min(340px, 62vw) !important;
  height: min(340px, 37vh) !important;
}

.page-final .final-message {
  width: min(660px, 88vw);
  min-height: auto;
  margin: 8px auto 10px;
  font-size: clamp(1.02rem, 2.15vw, 1.65rem);
  line-height: 1.62;
}

.cover-layout .lighter {
  width: clamp(150px, 15vw, 205px) !important;
  transform: translate(-520px, -138px) rotate(-12deg) scale(.92);
}

.cover-layout .lighter-flame {
  right: 19px !important;
  top: 10px !important;
}

.cover-layout .lighter.pass-0 {
  opacity: 1;
  transform: translate(-560px, -128px) rotate(-12deg) scale(.9);
}

.cover-layout .lighter.pass-1 { transform: translate(-292px, -134px) rotate(-7deg) scale(.92); }
.cover-layout .lighter.pass-2 { transform: translate(-182px, -180px) rotate(-4deg) scale(.92); }
.cover-layout .lighter.pass-3 { transform: translate(-68px, -205px) rotate(-1deg) scale(.92); }
.cover-layout .lighter.pass-4 { transform: translate(54px, -205px) rotate(1deg) scale(.92); }
.cover-layout .lighter.pass-5 { transform: translate(164px, -180px) rotate(4deg) scale(.92); }
.cover-layout .lighter.pass-6 { transform: translate(268px, -134px) rotate(7deg) scale(.92); }

.cover-layout .lighter.done {
  opacity: 0;
  transform: translate(430px, -124px) rotate(10deg) scale(.86);
}

@media (max-width: 680px) {
  .page-cover,
  .page-final {
    padding-top: 14px !important;
    padding-bottom: 112px !important;
  }

  .page-cover h1 {
    font-size: clamp(1.9rem, 9vw, 3rem);
  }

  .page-cover .photo-cake {
    width: min(330px, 84vw) !important;
    height: min(330px, 38vh) !important;
  }

  .page-final .cake-stage .photo-cake {
    width: min(285px, 76vw) !important;
    height: min(285px, 34vh) !important;
  }

  .cover-layout .lighter {
    width: 132px !important;
  }

  .cover-layout .lighter.pass-0 { transform: translate(-270px, -82px) rotate(-12deg) scale(.86); }
  .cover-layout .lighter.pass-1 { transform: translate(-182px, -86px) rotate(-7deg) scale(.86); }
  .cover-layout .lighter.pass-2 { transform: translate(-116px, -118px) rotate(-4deg) scale(.86); }
  .cover-layout .lighter.pass-3 { transform: translate(-44px, -134px) rotate(-1deg) scale(.86); }
  .cover-layout .lighter.pass-4 { transform: translate(36px, -134px) rotate(1deg) scale(.86); }
  .cover-layout .lighter.pass-5 { transform: translate(104px, -118px) rotate(4deg) scale(.86); }
  .cover-layout .lighter.pass-6 { transform: translate(170px, -86px) rotate(7deg) scale(.86); }
  .cover-layout .lighter.done { transform: translate(230px, -82px) rotate(10deg) scale(.82); }
}

/* 2026-07-08：Q 版蜡笔打火机，只保留 CSS 摇曳火焰，不再显示蛋糕图片自带火焰 */
.cake-lit,
.photo-cake.lit .cake-lit,
.page-final .cake-lit {
  display: none !important;
  opacity: 0 !important;
}

.photo-cake .cake-unlit,
.photo-cake.lit .cake-unlit,
.page-final .cake-unlit,
.page-final.blown .cake-unlit {
  display: block !important;
  opacity: 1 !important;
}

.cover-layout .lighter {
  width: 96px !important;
  height: 44px !important;
  border: 3px solid rgba(105, 69, 62, .78) !important;
  border-radius: 20px 10px 10px 20px !important;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, .72), transparent 24%),
    linear-gradient(100deg, #f7a9c5 0 45%, #ffe0a2 45% 72%, #c88d70 72% 100%) !important;
  box-shadow:
    0 8px 0 rgba(157, 92, 105, .22),
    inset 0 -4px 0 rgba(141, 72, 82, .12) !important;
  filter: drop-shadow(0 10px 12px rgba(74, 45, 52, .18));
  transform-origin: 70% 48%;
}

.cover-layout .lighter img {
  display: none !important;
}

.cover-layout .lighter::before {
  content: "";
  position: absolute;
  right: -12px;
  top: 12px;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(105, 69, 62, .72);
  border-left: 0;
  border-radius: 8px 12px 12px 8px;
  background: #eadfd6;
}

.cover-layout .lighter::after {
  display: block !important;
  content: "";
  position: absolute;
  left: 16px;
  top: 10px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 246, 202, .86);
  box-shadow: inset 0 -2px 0 rgba(179, 98, 118, .16);
}

.cover-layout .lighter-flame {
  right: -31px !important;
  top: 3px !important;
  width: 22px !important;
  height: 30px !important;
  border-radius: 60% 48% 56% 44%;
  background:
    radial-gradient(circle at 50% 70%, rgba(255, 255, 214, .98) 0 20%, transparent 21%),
    radial-gradient(circle at 50% 55%, #ffe36f 0 38%, #ff9a36 51%, #e15f45 72%, transparent 74%);
  filter: drop-shadow(0 0 8px rgba(255, 171, 55, .72));
}

.cover-layout .lighter.pass-0 { transform: translate(-430px, -126px) rotate(-8deg) scale(.94); }
.cover-layout .lighter.pass-1 { transform: translate(-212px, -138px) rotate(-6deg) scale(.96); }
.cover-layout .lighter.pass-2 { transform: translate(-154px, -184px) rotate(-4deg) scale(.96); }
.cover-layout .lighter.pass-3 { transform: translate(-96px, -208px) rotate(-2deg) scale(.96); }
.cover-layout .lighter.pass-4 { transform: translate(-42px, -208px) rotate(1deg) scale(.96); }
.cover-layout .lighter.pass-5 { transform: translate(13px, -184px) rotate(4deg) scale(.96); }
.cover-layout .lighter.pass-6 { transform: translate(67px, -138px) rotate(6deg) scale(.96); }
.cover-layout .lighter.done { transform: translate(260px, -122px) rotate(8deg) scale(.88); }

.photo-cake::before {
  mix-blend-mode: normal !important;
  filter: drop-shadow(0 0 5px rgba(255, 178, 52, .45));
}

.photo-cake.lit::before,
.photo-cake.lit-count-1::before,
.photo-cake.lit-count-2::before,
.photo-cake.lit-count-3::before,
.photo-cake.lit-count-4::before,
.photo-cake.lit-count-5::before,
.photo-cake.lit-count-6::before {
  animation: candleGlow .52s ease-in-out infinite alternate !important;
}

.photo-cake.lit::before,
.photo-cake.lit-count-6::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%),
    radial-gradient(ellipse at 74% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%),
    radial-gradient(ellipse at 87% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%) !important;
}

.photo-cake.lit-count-1::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%) !important;
}

.photo-cake.lit-count-2::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%) !important;
}

.photo-cake.lit-count-3::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%) !important;
}

.photo-cake.lit-count-4::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%) !important;
}

.photo-cake.lit-count-5::before {
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 244, 176, .98) 0 1.4%, rgba(255, 151, 42, .86) 2.25%, rgba(222, 78, 50, .62) 3.05%, transparent 3.75%),
    radial-gradient(ellipse at 34% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%),
    radial-gradient(ellipse at 48% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%),
    radial-gradient(ellipse at 61% 10%, rgba(255, 244, 176, .98) 0 1.6%, rgba(255, 151, 42, .86) 2.45%, rgba(222, 78, 50, .62) 3.2%, transparent 4%),
    radial-gradient(ellipse at 74% 15%, rgba(255, 244, 176, .98) 0 1.5%, rgba(255, 151, 42, .86) 2.35%, rgba(222, 78, 50, .62) 3.15%, transparent 3.9%) !important;
}

@media (max-width: 680px) {
  .cover-layout .lighter {
    width: 78px !important;
    height: 36px !important;
    border-width: 2px !important;
  }

  .cover-layout .lighter::before {
    right: -10px;
    top: 10px;
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .cover-layout .lighter-flame {
    right: -26px !important;
    top: 1px !important;
  }

  .cover-layout .lighter.pass-0 { transform: translate(-246px, -80px) rotate(-8deg) scale(.9); }
  .cover-layout .lighter.pass-1 { transform: translate(-152px, -88px) rotate(-6deg) scale(.9); }
  .cover-layout .lighter.pass-2 { transform: translate(-114px, -119px) rotate(-4deg) scale(.9); }
  .cover-layout .lighter.pass-3 { transform: translate(-74px, -134px) rotate(-2deg) scale(.9); }
  .cover-layout .lighter.pass-4 { transform: translate(-28px, -134px) rotate(1deg) scale(.9); }
  .cover-layout .lighter.pass-5 { transform: translate(12px, -119px) rotate(4deg) scale(.9); }
  .cover-layout .lighter.pass-6 { transform: translate(50px, -88px) rotate(6deg) scale(.9); }
}

/* 2026-07-09：火焰与打火机共用蛋糕图片内部坐标，缩放后仍对准六根烛芯 */
.photo-cake::before {
  display: none !important;
}

.photo-cake .cake-visual {
  position: absolute !important;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  aspect-ratio: 842 / 939;
  transform: translateX(-50%);
  overflow: visible;
  pointer-events: none;
}

.photo-cake .cake-visual > .cake-photo {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  object-fit: fill !important;
}

.photo-cake .candle-flames {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  transform: none !important;
  z-index: 9;
  pointer-events: none;
}

.photo-cake .candle-flame {
  --flame-x: 21.17%;
  --flame-y: 19.58%;
  position: absolute !important;
  left: var(--flame-x) !important;
  top: var(--flame-y) !important;
  width: clamp(13px, 3.1%, 19px);
  aspect-ratio: .72;
  opacity: 0;
  transform: translate(-50%, -100%) rotate(2deg) scale(.78);
  transform-origin: 50% 100%;
  border-radius: 64% 44% 60% 40%;
  background:
    radial-gradient(circle at 50% 72%, #fffbd5 0 20%, transparent 22%),
    radial-gradient(ellipse at 50% 58%, #ffe26f 0 39%, #ff9a37 54%, #dc5943 73%, transparent 75%);
  filter: drop-shadow(0 0 6px rgba(255, 165, 53, .72));
  transition: opacity .2s ease, transform .32s ease;
}

.candle-flame:nth-child(2) { --flame-x: 32.78%; --flame-y: 13.53%; }
.candle-flame:nth-child(3) { --flame-x: 46.98%; --flame-y: 10.12%; }
.candle-flame:nth-child(4) { --flame-x: 53.89%; --flame-y: 6.80%; }
.candle-flame:nth-child(5) { --flame-x: 60.80%; --flame-y: 10.23%; }
.candle-flame:nth-child(6) { --flame-x: 75.49%; --flame-y: 13.53%; }
.candle-flame:nth-child(7) { --flame-x: 88.21%; --flame-y: 19.58%; }

.photo-cake .added-center-candle {
  position: absolute !important;
  left: 53.89% !important;
  top: 6.8% !important;
  z-index: 7;
  width: 2.35%;
  height: 26%;
  transform: translateX(-50%) !important;
  border: 1px solid rgba(221, 203, 170, .9);
  border-radius: 6px 6px 4px 4px;
  background:
    linear-gradient(90deg, #f1e9ca 0 16%, #fffdf1 30% 68%, #e9dcb7 84% 100%);
  box-shadow:
    inset 2px 0 rgba(255, 255, 255, .75),
    0 2px 3px rgba(111, 79, 54, .12);
}

.photo-cake .added-center-candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 4px;
  height: 5px;
  border-radius: 50%;
  background: #344052;
  transform: translateX(-50%);
}

.photo-cake.lit .candle-flame,
.photo-cake .candle-flame.is-lit,
.photo-cake.lit-count-1 .candle-flame:nth-child(1),
.photo-cake.lit-count-2 .candle-flame:nth-child(-n + 2),
.photo-cake.lit-count-3 .candle-flame:nth-child(-n + 3),
.photo-cake.lit-count-4 .candle-flame:nth-child(-n + 4),
.photo-cake.lit-count-5 .candle-flame:nth-child(-n + 5),
.photo-cake.lit-count-6 .candle-flame:nth-child(-n + 6),
.photo-cake.lit-count-7 .candle-flame:nth-child(-n + 7) {
  opacity: 1;
  transform: translate(-50%, -100%) rotate(-2deg) scale(1);
  animation: candleFlameFlicker .58s ease-in-out infinite alternate;
}

@keyframes candleFlameFlicker {
  from { transform: translate(-50%, -100%) rotate(-4deg) scale(.92, 1.04); }
  to { transform: translate(-50%, -100%) rotate(4deg) scale(1.05, .94); }
}

.page-final.blown .candle-flame {
  opacity: 0 !important;
  animation: none !important;
  transform: translate(-50%, -100%) scale(.25) !important;
}

/* 打火机火焰停在当前烛芯左侧；六个位置与上面的火焰坐标完全一致 */
.cover-layout .photo-cake .lighter {
  --lighter-x: -16%;
  --lighter-y: 19%;
  position: absolute !important;
  left: var(--lighter-x) !important;
  top: var(--lighter-y) !important;
  z-index: 12;
  opacity: 0;
  transform: translate(-116px, -48%) rotate(-5deg) scale(.96) !important;
  transition:
    left .52s cubic-bezier(.42, 0, .24, 1),
    top .52s cubic-bezier(.42, 0, .24, 1),
    opacity .25s ease,
    transform .52s ease !important;
}

.cover-layout .photo-cake .lighter.candle-pass {
  opacity: 1;
}

.cover-layout .photo-cake .lighter.pass-0 {
  --lighter-x: -12%;
  --lighter-y: 19%;
  opacity: 1;
}

.cover-layout .photo-cake .lighter.pass-1 { --lighter-x: 21.17%; --lighter-y: 19.58%; }
.cover-layout .photo-cake .lighter.pass-2 { --lighter-x: 32.78%; --lighter-y: 13.53%; }
.cover-layout .photo-cake .lighter.pass-3 { --lighter-x: 46.98%; --lighter-y: 10.12%; }
.cover-layout .photo-cake .lighter.pass-4 { --lighter-x: 53.89%; --lighter-y: 6.80%; }
.cover-layout .photo-cake .lighter.pass-5 { --lighter-x: 60.80%; --lighter-y: 10.23%; }
.cover-layout .photo-cake .lighter.pass-6 { --lighter-x: 75.49%; --lighter-y: 13.53%; }
.cover-layout .photo-cake .lighter.pass-7 { --lighter-x: 88.21%; --lighter-y: 19.58%; }

.cover-layout .photo-cake .lighter.pass-1 {
  transition-duration: .7s, .7s, .25s, .7s !important;
}

.cover-layout .photo-cake .lighter:is(.pass-2, .pass-3, .pass-4, .pass-5, .pass-6, .pass-7) {
  transition-duration: .32s, .32s, .25s, .32s !important;
}

.cover-layout .photo-cake .lighter.done {
  --lighter-x: 118%;
  --lighter-y: 19%;
  opacity: 0;
  transform: translate(-116px, -48%) rotate(7deg) scale(.9) !important;
  transition-duration: .6s, .6s, .45s, .6s !important;
}

@media (max-width: 680px) {
  .cover-layout .photo-cake .lighter {
    transform: translate(-94px, -48%) rotate(-5deg) scale(.88) !important;
  }

  .cover-layout .photo-cake .lighter.done {
    transform: translate(-94px, -48%) rotate(7deg) scale(.82) !important;
  }
}

/* 八个火焰都以底部中心接触支架；打火机外壳样式保持不变 */
.cover-layout .photo-cake .lighter .lighter-flame {
  left: calc(100% + 2px) !important;
  right: auto !important;
  top: 12px !important;
  width: 18px !important;
  height: 25px !important;
  transform: translate(-50%, -100%) !important;
  transform-origin: 50% 100%;
  background:
    radial-gradient(circle at 50% 72%, #fffbd5 0 20%, transparent 22%),
    radial-gradient(ellipse at 50% 58%, #ffe26f 0 39%, #ff9a37 54%, #dc5943 73%, transparent 75%);
  filter: drop-shadow(0 0 6px rgba(255, 165, 53, .72));
}

@media (max-width: 680px) {
  .cover-layout .photo-cake .lighter .lighter-flame {
    left: calc(100% - 2px) !important;
    top: 10px !important;
  }
}
