@font-face {
  font-family: "XiaoWei";
  src: url("../assets/fonts/xiaowei.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "LongCang";
  src: url("../assets/fonts/longcang.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* 粉白、清新、明亮。不用大面积橙色和黑色。 */
  --bg: #fff4f8;
  --bg-2: #ffe8f1;
  --white: #ffffff;
  --pink: #ff8fb8;
  --pink-btn: #e2588f;
  --pink-deep: #c93e78;
  --pink-soft: #ffd6e6;
  --lilac: #b79bea;
  --lilac-soft: #efe6ff;
  --mint: #bfe6d2;
  --sky: #dff1fb;
  --butter: #ffe9a0;
  --film: #efe2fb;
  --paper: #fffafc;
  --paper-line: #fbd3e3;
  --ink: #5d2f58;
  --ink-soft: #85597f;
  --line: #f1c6da;

  --f-voice: "XiaoWei", "Songti SC", "STSong", "Noto Serif SC", serif;
  --f-hand: "LongCang", "Kaiti SC", "STKaiti", "KaiTi", cursive;
  --f-code: ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: 20px;
  --lift: 0 14px 30px -16px rgba(120, 60, 110, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-voice);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--pink-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--pink-btn); outline-offset: 4px; border-radius: 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
[data-art] svg { display: block; width: 100%; height: 100%; }

/* 天空：粉白，带几朵手绘云和小点点 */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    linear-gradient(180deg, #fde7f1 0%, var(--bg) 40%, #fff9fb 70%, #f4eeff 100%);
}
.sky::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, #ffc6dc 1.6px, transparent 2px),
    radial-gradient(circle, #d9c8fb 1.4px, transparent 1.8px);
  background-size: 46px 46px, 62px 62px;
  background-position: 0 0, 23px 31px;
  opacity: .55;
}
.cl {
  position: absolute; width: 140px; height: 54px;
  background: #fff; border-radius: 40px;
  box-shadow: 0 6px 14px -8px rgba(160, 110, 160, .3);
  animation: drift 40s linear infinite;
}
.cl::before, .cl::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cl::before { width: 64px; height: 64px; left: 22px; top: -30px; }
.cl::after { width: 48px; height: 48px; left: 72px; top: -20px; }
.cl1 { top: 9%; left: -160px; }
.cl2 { top: 46%; left: -160px; transform: scale(.7); animation-duration: 56s; animation-delay: -20s; }
.cl3 { top: 78%; left: -160px; transform: scale(.85); animation-duration: 48s; animation-delay: -36s; }
@keyframes drift { to { translate: calc(100vw + 320px) 0; } }

/* 音乐 */
.music {
  position: fixed; z-index: 30;
  top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .85);
  display: grid; place-items: center;
  box-shadow: var(--lift);
}
.music svg { width: 20px; height: 20px; fill: none; stroke: var(--pink-deep); stroke-width: 1.6; stroke-linejoin: round; }
.music.playing svg { animation: spin 6s linear infinite; }
.music:not(.playing) { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 通用 */
.scene {
  min-height: 100svh;
  padding: calc(64px + env(safe-area-inset-top)) var(--gutter) 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.h2 { font-size: 28px; line-height: 1.3; font-weight: 400; margin: 0 0 6px; letter-spacing: .04em; color: var(--ink); text-wrap: balance; }
.lede { margin: 0 0 28px; color: var(--ink-soft); font-size: 15px; max-width: 24em; text-wrap: balance; }
.hint { margin: 26px 0 0; color: var(--ink-soft); font-size: 15px; letter-spacing: .2em; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.tiny { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }

.primary {
  margin-top: 32px;
  min-height: 50px; padding: 0 30px;
  border: 2px solid var(--pink-deep); border-radius: 999px;
  background: var(--pink-btn);
  color: #fff;
  font-size: 17px; letter-spacing: .08em;
  box-shadow: 0 10px 20px -12px rgba(120, 40, 90, .55);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.primary:active { transform: translateY(2px) scale(.98); box-shadow: 0 4px 10px -6px rgba(120, 40, 90, .55); }
.ghost {
  margin-top: 16px; min-height: 44px; padding: 0 18px;
  border: 1.5px dashed var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .7); color: var(--ink-soft); font-size: 14px;
}
.ghost:active { background: var(--white); }

/* ---------- 信封 ---------- */
.scene-envelope { position: fixed; inset: 0; z-index: 20; padding-top: 0; transition: opacity .9s var(--ease-out), visibility .9s; }
.scene-envelope.gone { opacity: 0; visibility: hidden; }
.env-stage { position: relative; animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-.6deg); } }
.envelope {
  position: relative;
  width: min(80vw, 380px); aspect-ratio: 1.2;
  perspective: 900px;
  filter: drop-shadow(0 22px 26px rgba(150, 80, 130, .28));
}
.env-body {
  position: absolute; inset: 0; border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  padding: 18px 20px;
  text-align: left; color: var(--ink);
  overflow: hidden;
}
.env-body::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(155deg, transparent 49.7%, var(--line) 50%, transparent 50.5%),
    linear-gradient(25deg, transparent 49.7%, var(--line) 50%, transparent 50.5%);
  opacity: .7;
}
.env-flap {
  position: absolute; inset: 0 0 auto 0; height: 44%; z-index: 2;
  background: #ffe3ee;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 1s var(--ease-out);
  border-radius: 12px 12px 0 0;
}
.envelope.open .env-flap { transform: rotateX(180deg); }
.stamp { position: absolute; bottom: 16px; right: 16px; width: 19%; aspect-ratio: 60/72; z-index: 1;
  --perf: radial-gradient(circle 2.4px, #0000 96%, #000) -3.5px -3.5px / 7px 7px round;
  -webkit-mask: linear-gradient(#000 0 0) content-box, var(--perf);
  mask: linear-gradient(#000 0 0) content-box, var(--perf);
  padding: 5px; background: #fff; transform: rotate(4deg);
  filter: drop-shadow(0 2px 2px rgba(150, 80, 130, .25));
}
.stamp svg { display: block; width: 100%; height: 100%; }
.postmark { position: absolute; bottom: 12px; right: 15%; width: 24%; color: #b23a6f; transform: rotate(-12deg); z-index: 2; }
.env-to { position: absolute; left: 22px; right: 22px; top: 55%; margin: 0; text-align: center; font-size: clamp(14px, 4vw, 17px); letter-spacing: .14em; z-index: 1; }
.env-en { display: block; font-family: var(--f-hand); font-size: 1.25em; letter-spacing: .06em; color: var(--pink-deep); line-height: 1.2; }
.env-name { display: block; font-size: 1.7em; line-height: 1.3; letter-spacing: .24em; }
.env-from { position: absolute; left: 22px; bottom: 18px; max-width: 52%; margin: 0; font-family: var(--f-hand); font-size: clamp(14px, 3.8vw, 17px); color: var(--ink-soft); z-index: 1; }
.seal {
  position: absolute; z-index: 3; left: 50%; top: 44%;
  width: 24%; aspect-ratio: 1; padding: 0; border: 0; background: none;
  transform: translate(-50%, -50%);
  transition: transform .5s var(--ease-out), opacity .5s;
  filter: drop-shadow(0 6px 6px rgba(160, 40, 90, .3));
}
.seal svg { width: 100%; height: 100%; display: block; }
.seal:active { transform: translate(-50%, -50%) scale(.92); }
.envelope.open .seal { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
.env-pig, .env-dog { position: absolute; width: 25%; aspect-ratio: 1; bottom: -24%; z-index: 4; }
.env-pig { left: -9%; transform: rotate(-8deg); }
.env-dog { right: -9%; transform: rotate(8deg); }

/* ---------- 水晶球 ---------- */
.globe-line { margin: 0 0 18px; font-size: 18px; letter-spacing: .12em; color: var(--pink-deep); min-height: 1.75em; }
.globe-wrap {
  position: relative;
  width: min(84vw, 380px); aspect-ratio: 300 / 372;
  touch-action: none; user-select: none; -webkit-user-select: none;
  filter: drop-shadow(0 24px 28px rgba(150, 90, 150, .3));
}
.globe-wrap.shaking { animation: wobble .6s var(--ease-out); }
@keyframes wobble { 20% { transform: rotate(-4deg); } 45% { transform: rotate(3deg); } 70% { transform: rotate(-1.5deg); } }
.globe-svg, .snow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.snow { pointer-events: none; }
.globe-after { margin-top: 26px; animation: rise 1.4s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
.dates { margin: 0; font-family: var(--f-code); font-size: 13px; letter-spacing: .18em; color: var(--lilac); color: #8f6fd0; }
.bday { margin: 8px 0 12px; font-weight: 400; font-size: clamp(28px, 8vw, 42px); line-height: 1.3; letter-spacing: .06em; color: var(--ink); text-wrap: balance; }
.bday span { color: var(--pink-deep); }
.sub { margin: 0 auto; max-width: 22em; font-size: 15px; color: var(--ink-soft); }

/* ---------- 胶卷（浅紫色的片基） ---------- */
.scene-film { justify-content: flex-start; padding-left: 0; padding-right: 0; }
.film {
  width: min(92vw, 440px);
  background: var(--film);
  border: 2px solid #ddc9f3;
  border-radius: 6px;
  padding: 0 34px;
  position: relative;
  box-shadow: var(--lift);
}
.film::before, .film::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 12px;
  background: repeating-linear-gradient(180deg, transparent 0 8px, var(--bg) 8px 19px);
  clip-path: inset(0 2px round 3px);
}
.film::before { left: 5px; }
.film::after { right: 5px; }
.film-leader {
  height: 140px; display: grid; place-items: center;
  font-family: var(--f-code); font-size: 11px; letter-spacing: .3em; color: #a0558f;
}
.chapter { padding: 34px 6px 22px; text-align: left; position: relative; }
.chapter h3 { margin: 0; font-family: var(--f-hand); font-weight: 400; font-size: 28px; line-height: 1.25; color: var(--pink-deep); padding-right: 64px; text-wrap: balance; }
.chapter p { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); padding-right: 64px; }
.chapter .sticker { position: absolute; right: 0; top: 22px; width: 62px; height: 62px; transform: rotate(8deg); }
.chapter .sheet-btn {
  margin-top: 12px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1.5px dashed var(--pink); background: rgba(255, 255, 255, .7); color: var(--pink-deep); font-size: 13px;
}
.frame { position: relative; margin: 0 0 14px; }
.frame-btn {
  display: block; width: 100%; padding: 0; border: 0; background: #fff;
  aspect-ratio: 2 / 3; position: relative; overflow: hidden; border-radius: 3px;
  box-shadow: 0 0 0 2px #fff;
}
.frame-btn .pic { position: absolute; inset: 0; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-btn .pic {
  filter: invert(1) hue-rotate(180deg) saturate(.5) brightness(1.1) blur(1.5px);
  transition: filter 2.6s var(--ease-out);
}
.frame-btn::after {
  content: ""; position: absolute; inset: 0;
  background: #b89be8; mix-blend-mode: multiply; opacity: .5;
  transition: opacity 2.6s var(--ease-out);
  pointer-events: none;
}
.frame.developed .frame-btn .pic { filter: none; }
.frame.developed .frame-btn::after { opacity: 0; }
.edge {
  position: absolute; top: 0; bottom: 0; width: 16px;
  writing-mode: vertical-rl;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  font-family: var(--f-code); font-size: 9.5px; letter-spacing: .14em;
  color: #a0558f;
  pointer-events: none;
}
.edge-l { left: -17px; transform: rotate(180deg); }
.edge-r { right: -17px; }
.cap {
  position: absolute; left: 10px; bottom: 8px; right: 10px; margin: 0;
  font-family: var(--f-hand); font-size: 19px; text-align: left; color: #fff;
  text-shadow: 0 1px 4px rgba(60, 20, 50, .55);
  opacity: 0; transition: opacity 1.2s 1.6s;
}
.frame.developed .cap { opacity: 1; }
.frame-blank .frame-btn { background: #fff; cursor: default; border: 2px dashed var(--pink); }
.frame-blank .frame-btn::after { display: none; }
.blank-note { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; font-family: var(--f-hand); font-size: 26px; color: var(--pink-deep); padding: 20px; }
.blank-note .mini { width: 74px; height: 74px; }
.film-end { margin-top: 40px; padding: 0 var(--gutter); color: var(--ink-soft); font-size: 15px; }
.film-end p { margin: 0; }

/* 占位照片 */
.ph {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 6px;
  background:
    linear-gradient(160deg, #ffe1ec 0%, #f6eaff 55%, #e3f3fb 100%);
  color: var(--ink-soft); font-size: 14px; text-align: center; padding: 16px;
}
.ph svg { width: 34px; height: 34px; fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.ph b { font-weight: 400; font-size: 12px; letter-spacing: .2em; color: var(--pink-deep); }

/* ---------- 大图 / 印样 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(255, 244, 248, .97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(56px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  animation: fade .35s var(--ease-out);
}
@keyframes fade { from { opacity: 0; } }
.viewer-fig { margin: 0; width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.viewer-img {
  position: relative; width: min(100%, 62svh * .667); aspect-ratio: 2 / 3;
  background: #fff; padding: 10px 10px 46px; border-radius: 4px;
  box-shadow: 0 20px 36px -16px rgba(120, 60, 110, .45);
  border: 1.5px solid var(--line);
}
.viewer-img .inner { position: relative; width: 100%; height: 100%; overflow: hidden; }
.viewer-fig figcaption { margin-top: -38px; position: relative; font-family: var(--f-hand); font-size: 21px; color: var(--ink); min-height: 30px; }
.viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; background: none; }
.viewer svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viewer-nav { margin-top: 22px; display: flex; align-items: center; gap: 22px; font-family: var(--f-code); font-size: 12px; color: var(--ink-soft); }
.viewer-nav button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; }

.sheet {
  position: fixed; inset: 0; z-index: 35; overflow-y: auto;
  background: var(--bg);
  padding: calc(64px + env(safe-area-inset-top)) var(--gutter) 48px;
  animation: fade .35s var(--ease-out);
}
.sheet h3 { margin: 0 0 4px; font-family: var(--f-hand); font-weight: 400; font-size: 32px; color: var(--pink-deep); }
.sheet .sheet-sub { margin: 0 0 20px; font-size: 14px; color: var(--ink-soft); }
.sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 640px; margin: 0 auto; }
@media (min-width: 640px) { .sheet-grid { grid-template-columns: repeat(3, 1fr); } }
.polaroid { border: 1.5px solid var(--line); padding: 7px 7px 28px; background: #fff; border-radius: 3px; box-shadow: var(--lift); position: relative; }
.polaroid:nth-child(3n+1) { transform: rotate(-1.6deg); }
.polaroid:nth-child(3n+2) { transform: rotate(1.2deg); }
.polaroid .pic { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
.polaroid span { position: absolute; left: 8px; right: 8px; bottom: 4px; font-family: var(--f-hand); font-size: 16px; color: var(--ink); text-align: left; }
.sheet-close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 1.5px solid var(--line); background: #fff; border-radius: 50%; display: grid; place-items: center; }
.sheet-close svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }

/* ---------- 地图 ---------- */
.map-card {
  width: min(94vw, 560px);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--lift);
  position: relative;
}
.map-svg { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--sky); }
.map-land { fill: #fff6fa; stroke: #e9a9c6; stroke-width: .8; stroke-linejoin: round; }
.route-now { fill: none; stroke: var(--pink-btn); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 5 5; animation: march 1.2s linear infinite; }
.route-later { fill: none; stroke: #9b7fd9; stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 1 6; }
@keyframes march { to { stroke-dashoffset: -20; } }
.map-dot { fill: #fff; stroke: var(--pink-btn); stroke-width: 2; }
.map-dot-later { fill: #fff; stroke: #9b7fd9; stroke-width: 1.6; }
.map-label { font-family: var(--f-voice); font-size: 10px; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.map-label-later { fill: #6f52b5; }
.map-legend { display: flex; gap: 16px; justify-content: flex-end; padding: 8px 6px 2px; font-size: 12px; color: var(--ink-soft); }
.map-legend i { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px dashed var(--pink-btn); }
.map-legend .lg-dot { border-top: 2px dotted #9b7fd9; }
.clocks { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.clock { display: flex; flex-direction: column; align-items: center; min-width: 110px; padding: 12px 14px 10px; background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--lift); }
.clock-art { width: 54px; height: 54px; margin-top: -36px; }
.clock b { font-weight: 400; font-family: var(--f-code); font-size: 26px; color: var(--pink-deep); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.clock span { font-size: 13px; color: var(--ink-soft); }
.clock-sep { width: 26px; height: 26px; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } 60% { transform: scale(1); } }
.map-note { margin: 22px auto 0; max-width: 22em; font-size: 15px; color: var(--ink-soft); text-wrap: balance; }

/* ---------- 邮局 ---------- */
.postcards { display: grid; gap: 22px; width: min(92vw, 460px); }
.postcard { perspective: 1200px; border: 0; padding: 0; background: none; width: 100%; aspect-ratio: 3 / 2; }
.pc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s var(--ease-out); }
.postcard.flipped .pc-inner { transform: rotateY(180deg); }
.pc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; overflow: hidden; box-shadow: var(--lift); border: 3px solid #fff; }
.pc-front svg { width: 100%; height: 100%; display: block; }
.pc-label { position: absolute; left: 14px; bottom: 10px; text-align: left; color: #fff; text-shadow: 0 1px 4px rgba(60, 20, 50, .4); }
.pc-label b { display: block; font-weight: 400; font-size: 24px; line-height: 1.1; letter-spacing: .12em; }
.pc-label small { font-family: var(--f-code); font-size: 10px; letter-spacing: .3em; }
.pc-back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, var(--paper-line) 31px 32px) 0 14px / 100% calc(100% - 28px) no-repeat,
    #fff;
  color: var(--ink); text-align: left;
  display: grid; grid-template-columns: 1fr 26%; gap: 12px; padding: 14px 16px;
}
.pc-back p { margin: 0; font-family: var(--f-hand); font-size: clamp(16px, 4.4vw, 20px); line-height: 32px; white-space: pre-line; }
.pc-back .pc-mark { border-left: 1.5px solid var(--paper-line); padding-left: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-soft); }
.pc-back .pc-mark i { display: block; width: 100%; aspect-ratio: 5/6; border: 1.5px dashed var(--pink); border-radius: 4px; padding: 3px; }

.h2-home { margin-top: 64px; }
.stamps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 150px)); gap: 18px 16px; justify-content: center; }
@media (min-width: 560px) { .stamps { grid-template-columns: repeat(4, 130px); } }
.stamps li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.stamps .st {
  width: 100%; aspect-ratio: 5 / 6; padding: 8px; background: #fff;
  --perf: radial-gradient(circle 3.4px, #0000 96%, #000) -5px -5px / 10px 10px round;
  -webkit-mask: linear-gradient(#000 0 0) content-box, var(--perf);
  mask: linear-gradient(#000 0 0) content-box, var(--perf);
  filter: drop-shadow(0 4px 6px rgba(150, 80, 130, .25));
}
.stamps li:nth-child(odd) .st { transform: rotate(-2deg); }
.stamps li:nth-child(even) .st { transform: rotate(2deg); }
.stamps svg { display: block; width: 100%; height: 100%; }

/* ---------- 信 ---------- */
.paper {
  width: min(92vw, 560px);
  background:
    repeating-linear-gradient(180deg, transparent 0 35px, var(--paper-line) 35px 36px) 0 0 / 100% 100%,
    var(--paper);
  color: var(--ink);
  text-align: left;
  padding: 44px 26px 44px;
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--lift);
  line-height: 36px;
  position: relative;
}
.paper-sticker { position: absolute; width: 74px; height: 74px; }
.ps-kitten { top: -30px; right: -10px; transform: rotate(12deg); }
.ps-bunny { bottom: -26px; left: -12px; transform: rotate(-10deg); }
.quote { margin: 0 0 36px; padding: 0; color: var(--ink-soft); }
.quote p { margin: 0; font-size: 18px; letter-spacing: .1em; }
.quote cite { display: block; font-style: normal; font-size: 13px; letter-spacing: .1em; }
.letter-to { margin: 0; font-family: var(--f-hand); font-weight: 400; font-size: 28px; line-height: 36px; color: var(--pink-deep); }
.letter-body p { margin: 0; text-indent: 2em; font-size: 17px; }
.letter-body p, .letter-days, .letter-sign { opacity: 0; transform: translateY(8px); filter: blur(4px); transition: opacity 1.4s var(--ease-out), transform 1.4s var(--ease-out), filter 1.4s var(--ease-out); }
.paper.reading .letter-body p, .paper.reading .letter-days, .paper.reading .letter-sign { opacity: 1; transform: none; filter: none; }
.letter-days { margin: 36px 0 0; font-size: 15px; color: var(--ink-soft); }
.letter-days b { font-weight: 400; color: var(--pink-deep); font-size: 20px; font-variant-numeric: tabular-nums; }
.letter-sign { margin: 0; text-align: right; font-family: var(--f-hand); font-size: 23px; color: var(--ink); }

/* ---------- 蛋糕 ---------- */
.cake-wrap { width: min(88vw, 420px); position: relative; }
.cake-svg { width: 100%; display: block; overflow: visible; }
.candle { cursor: pointer; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .9s ease-in-out infinite alternate; transition: opacity .3s, transform .3s; }
.candle:nth-child(3n) .flame { animation-duration: .7s; }
.candle:nth-child(3n+1) .flame { animation-duration: 1.1s; }
@keyframes flicker { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.92, 1.08) skewX(3deg); } 100% { transform: scale(1.04, .95) skewX(-2deg); } }
.candle.out .flame { opacity: 0; transform: scale(.2); animation: none; }
.candle.out .glow { opacity: 0; }
.glow { transition: opacity .4s; }
.smoke { opacity: 0; fill: none; stroke: #c7b3e6; stroke-width: 1.4; stroke-linecap: round; }
.candle.out .smoke { animation: smoke 1.8s var(--ease-out) forwards; }
@keyframes smoke { 0% { opacity: .8; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-26px); } }
.scene-cake.wishing .candle { pointer-events: none; }
.cake-actions { display: flex; flex-direction: column; align-items: center; }

/* ---------- 第 25 张 ---------- */
.final-kick { margin: 0 0 16px; font-family: var(--f-code); font-size: 12px; letter-spacing: .4em; color: var(--pink-deep); }
.frame25 { width: min(78vw, 360px); background: var(--film); border: 2px solid #ddc9f3; padding: 14px 30px; position: relative; border-radius: 6px; box-shadow: var(--lift); }
.frame25 .frame { margin: 0; }
.final-line { margin: 28px auto 0; max-width: 20em; font-size: clamp(20px, 5.6vw, 26px); line-height: 1.6; letter-spacing: .05em; color: var(--ink); text-wrap: balance; }
.final-days { margin: 14px auto 0; max-width: 21em; font-size: 14px; color: var(--ink-soft); text-wrap: balance; }
.final-days b { font-weight: 400; color: var(--pink-deep); font-size: 18px; font-variant-numeric: tabular-nums; }
.final-duo { margin-top: 26px; display: flex; align-items: flex-end; gap: 4px; }
.final-duo > div:nth-child(1), .final-duo > div:nth-child(3) { width: 78px; height: 78px; }
.final-duo > div:nth-child(2) { width: 30px; height: 30px; margin-bottom: 40px; animation: beat 1.4s ease-in-out infinite; }

/* ---------- 两个小家伙 ---------- */
.buddy {
  position: fixed; z-index: 25; bottom: calc(6px + env(safe-area-inset-bottom));
  width: 64px; height: 64px; padding: 0; border: 0; background: none;
  animation: peek .9s var(--ease-out) both;
}
.buddy.dog { left: 6px; }
.buddy.pig { right: 6px; }
.buddy:active { transform: rotate(-6deg) scale(.95); }
@keyframes peek { from { transform: translateY(110%); } }
.bubble {
  position: fixed; z-index: 26; bottom: calc(74px + env(safe-area-inset-bottom));
  max-width: min(64vw, 260px);
  background: #fff; color: var(--ink);
  border: 2px solid var(--line);
  font-size: 15px; line-height: 1.5; text-align: left;
  padding: 10px 14px; border-radius: 16px;
  box-shadow: var(--lift);
  animation: rise .5s var(--ease-out) both;
}
.bubble.from-dog { left: 14px; border-bottom-left-radius: 4px; }
.bubble.from-pig { right: 14px; border-bottom-right-radius: 4px; }

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

/* ---------- 口令门 ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scene-gate { position: fixed; inset: 0; z-index: 22; background: transparent; transition: opacity .7s var(--ease-out), visibility .7s; }
.scene-gate.gone { opacity: 0; visibility: hidden; }
.gate-pig { width: 120px; height: 120px; margin-bottom: 8px; }
.gate-pig.nope { animation: nope .5s var(--ease-out); }
@keyframes nope { 20% { transform: translateX(-10px) rotate(-6deg); } 40% { transform: translateX(9px) rotate(5deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }
.gate-title { margin: 0 0 6px; font-weight: 400; font-size: 26px; letter-spacing: .08em; text-wrap: balance; }
.gate-form { display: flex; flex-direction: column; align-items: center; }
.gate-input {
  width: 200px; height: 64px; text-align: center;
  font-family: var(--f-code); font-size: 32px; letter-spacing: .5em; text-indent: .5em;
  color: var(--pink-deep); background: #fff;
  border: 2px solid var(--line); border-radius: 18px;
  box-shadow: var(--lift); outline: none;
}
.gate-input::placeholder { color: #b8678c; }
.gate-input:focus { border-color: var(--pink-btn); }
.gate-form .primary { margin-top: 22px; }
