/* finesse · register=h5 · morph=B-paged-deck · A=林间墨绿 + 米白信纸 + 陶土橙/葵黄
 * B=ArkPixel12(display) / PingFang(读) · C=整屏铺满的信纸 + 木架场景
 * D=CSS3D 信封拆封 + Canvas 像素引擎 + FLIP 大图 · E=黄昏花园婚礼现场（木三角架 / 垂坠布幔 / 花艺）
 * SOUL=9 SPECTACLE=7 DENSITY=4 */

@font-face {
  font-family: "PixelCN";
  src: url("../fonts/pixel-cn.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ───────────── tokens ───────────── */
:root {
  --forest-950: #10170f;
  --forest-900: #172015;
  --forest-800: #202b1c;
  --forest-700: #2b3a24;
  --forest-600: #3a4b2e;
  --forest-500: #4d6139;

  --paper:      #f7efda;
  --paper-2:    #efe2c4;
  --paper-deep: #e5d5b3;
  --paper-dark: #cbb98f;

  --ink:    #2f3427;
  --ink-2:  #565a45;
  --ink-3:  #6b6a52;

  --coral:      #c97457;
  --coral-deep: #9c5340;
  --coral-soft: #e8b7a2;
  --gold:       #c9993f;
  --sage:       #7c8659;
  --seal:       #b0553c;

  --font-px: "PixelCN", "Zpix", ui-monospace, monospace;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --ease: cubic-bezier(.32, .86, .28, 1);
  --ease-out: cubic-bezier(.22, .92, .24, 1);
  --pad: 22px;
}

/* ───────────── reset / frame ───────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow-x: clip; }
body {
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #222a1d 0%, #0d110b 62%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, canvas { display: block; }
::selection { background: var(--coral-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

.phone {
  position: relative; isolation: isolate;
  width: 100%; height: 100%; overflow: hidden;
  background: var(--forest-900);
  display: flex; flex-direction: column;
}

.os-status, .home-ind { display: none; }

/* desktop phone frame */
@media (min-width: 560px) {
  body { background: radial-gradient(120% 90% at 50% 0%, #26301f 0%, #0e120b 64%); }
  .phone {
    width: 406px; height: min(880px, 94vh);
    border-radius: 46px;
    border: 1px solid rgba(255, 240, 220, .1);
    box-shadow: 0 46px 120px -30px rgba(0, 0, 0, .92), 0 0 0 10px #131a11, 0 0 0 11px rgba(255, 235, 215, .06);
    overflow: hidden;
  }
  .os-status {
    display: flex; align-items: center; justify-content: space-between;
    flex: none; height: 44px; padding: 2px 26px 0;
    color: #f4e7d3; font-size: 12.5px; font-weight: 500;
    letter-spacing: .02em; position: relative; z-index: 60;
    pointer-events: none;
  }
  .os-status__right { display: flex; align-items: center; gap: 5px; }
  .home-ind {
    display: block; position: absolute; z-index: 70;
    width: 118px; height: 4px; border-radius: 99px;
    background: rgba(246, 236, 216, .9); opacity: .22;
    left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom) + 6px);
    pointer-events: none;
  }
  #app { position: relative; }
  .hud { top: 52px; }
}

#app { flex: 1; position: relative; overflow: hidden; }
.deck { position: absolute; inset: 0; }

/* ───────────── screens & page turn ───────────── */
.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: clip;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--paper);
  opacity: 0; visibility: hidden;
  transform: translateY(70px) scale(.965);
  transition: transform .68s var(--ease), opacity .44s ease, visibility .68s;
  will-change: transform, opacity;
}
.screen::-webkit-scrollbar { width: 0; height: 0; }
.screen.on  { opacity: 1; visibility: visible; transform: none; z-index: 3; }
.screen.out { opacity: 0; visibility: visible; transform: translateY(-46px) scale(.94); z-index: 2; }

.pad { padding: calc(env(safe-area-inset-top) + 58px) var(--pad) calc(env(safe-area-inset-bottom) + 34px); }
.pad--tight { padding-bottom: calc(env(safe-area-inset-bottom) + 22px); }

/* ───────────── shared type ───────────── */
.kicker {
  font-family: var(--font-px); font-size: 12px; line-height: 1.4;
  letter-spacing: .2em; text-transform: uppercase; color: var(--coral-deep);
}
.head { margin-top: 14px; }
.head--center { text-align: center; }
.h2 {
  font-family: var(--font-px); font-size: 36px; line-height: 1.18;
  letter-spacing: .06em; color: var(--ink); margin-top: 12px;
}
.sub {
  margin-top: 12px; font-size: 13.5px; line-height: 1.85;
  color: var(--ink-2); letter-spacing: .01em;
}

/* ───────────── HUD ───────────── */
.hud {
  position: absolute; z-index: 55;
  top: calc(env(safe-area-inset-top) + 14px); right: 20px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .4s ease, transform .4s var(--ease);
  pointer-events: none;
}
.hud.on { opacity: .9; transform: none; }
.hud__bar { display: flex; gap: 3px; }
.hud__seg {
  width: 7px; height: 4px; display: block;
  background: rgba(47, 52, 39, .2);
  transition: background .3s ease;
}
.hud__seg.on { background: var(--coral); }
.hud__seg.cur { background: var(--coral-deep); }
body[data-page="1"] .hud__seg, body[data-page="2"] .hud__seg, body[data-page="6"] .hud__seg {
  background: rgba(246, 236, 216, .26);
}
body[data-page="1"] .hud__seg.on, body[data-page="2"] .hud__seg.on, body[data-page="6"] .hud__seg.on { background: var(--coral-soft); }
body[data-page="1"] .hud__seg.cur, body[data-page="2"] .hud__seg.cur, body[data-page="6"] .hud__seg.cur { background: #fbf2df; }
.navback {
  position: absolute; z-index: 56;
  left: 12px; top: calc(env(safe-area-inset-top) + 4px);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%;
  color: #3c4231;
  background: #fbf5e6;
  border: 1px solid rgba(47, 52, 39, .16);
  box-shadow: 0 2px 10px -2px rgba(24, 34, 18, .35), 0 1px 0 rgba(255, 255, 255, .7) inset;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, transform .2s ease;
}
.navback.on { opacity: 1; visibility: visible; }
.navback:active { transform: scale(.9); }

body[data-page="2"] .hud { opacity: 0; }

/* ───────────── 1 · cover ───────────── */
.s-cover {
  background: linear-gradient(180deg, #96c9ee 0%, #c3dcf2 56%, #c8d7ae 100%);
  overflow: hidden;
}
.scene-wrap { position: absolute; inset: 0; overflow: hidden; }
.scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  visibility: hidden;
}
.scene-photo {
  position: absolute; left: 50%; top: 0;
  width: calc(var(--pw, 390px) * var(--scene-s, 1));
  max-width: none; height: auto;
  transform: translateX(-50%) translateY(calc(var(--auto-y, 0px) + var(--art-y, 0px)));
  opacity: 0;
  transition: opacity .5s ease;
}
.scene-photo.ready { opacity: 1; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}
.scene-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(0deg, rgba(40, 56, 36, .28) 0%, transparent 22%);
}
/* 图片加载失败、退回 Canvas 场景时才需要压暗 */
body.no-art .s-cover { background: var(--forest-900); }
body.no-art .s-cover .scene-vignette {
  background:
    radial-gradient(78% 42% at 50% 26%, rgba(8, 12, 7, .72) 0%, rgba(8, 12, 7, .5) 46%, transparent 74%),
    linear-gradient(180deg, rgba(9, 14, 8, .72) 0%, rgba(9, 14, 8, .36) 20%, rgba(9, 14, 8, .06) 38%, transparent 52%),
    linear-gradient(0deg, rgba(13, 19, 11, .58) 0%, rgba(13, 19, 11, 0) 26%),
    radial-gradient(90% 62% at 50% 48%, transparent 46%, rgba(13, 19, 11, .3) 100%);
}
body.no-art .cover .kicker { color: rgba(250, 235, 214, .82); text-shadow: 0 2px 8px rgba(16, 24, 14, .5); }
body.no-art .cover__title { color: #fdf2dd; text-shadow: 3px 3px 0 rgba(18, 28, 16, .55), 0 10px 26px rgba(16, 24, 14, .4); }
body.no-art .cover__names { color: #fffaee; text-shadow: 2px 2px 0 rgba(8, 13, 7, .7), 0 8px 20px rgba(6, 10, 5, .8); }
body.no-art .cover__date { color: #f3e0c4; text-shadow: 0 2px 8px rgba(16, 24, 14, .5); }
body.no-art .cover__lunar { color: rgba(247, 230, 205, .72); text-shadow: 0 2px 8px rgba(16, 24, 14, .5); }

.cover {
  position: absolute; left: 0; right: 0;
  top: calc(env(safe-area-inset-top) + 54px);
  padding: 0 26px; text-align: center; pointer-events: none;
}
.cover .kicker { color: #55707f; text-shadow: none; }
.cover__title {
  font-family: var(--font-px); font-size: 48px; line-height: 1.06;
  letter-spacing: .04em; color: #2b3a33;
  margin-top: 16px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .55);
}
.cover__names {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 20px;
  font-family: var(--font-px); font-size: 24px; line-height: 1.3;
  color: #33453c; letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.px-heart {
  width: 15px; height: 13px; display: block; flex: none;
  background: var(--coral);
  clip-path: polygon(50% 100%, 0 40%, 0 20%, 20% 0, 50% 20%, 80% 0, 100% 20%, 100% 40%);
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .22);
}
.cover__date {
  margin-top: 18px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .42em;
  color: #44585a; text-indent: .42em;
}
.cover__date + .cover__lunar { margin-top: 9px; }
.cover__lunar {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .12em;
  color: rgba(52, 68, 64, .78);
}

/* envelope peek */
.peek {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--peek-h, 128px) + 64px);
  background: none; border: 0; padding: 0; display: block;
  z-index: 6;
}
.peek__hint {
  position: absolute; left: 0; right: 0; bottom: calc(var(--peek-h, 128px) * .42);
  z-index: 3;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .16em;
  color: #6b4f2e;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .72 } 50% { opacity: 1 } }
.caret {
  width: 5px; height: 9px; display: block; background: #6b5030;
  animation: blink 1.15s steps(1, end) infinite;
}
@keyframes blink { 0%,55% { opacity: 1 } 56%,100% { opacity: 0 } }

.peek {
  transition: opacity .45s ease, transform .55s var(--ease);
}
body.opening .peek { opacity: 0; transform: translateY(26px); pointer-events: none; }
.peek__env {
  position: absolute; left: 50%; bottom: -58px;
  z-index: 1;
  transform: translateX(-50%) scale(var(--env-k, 1));
  transform-origin: 50% 100%;
  width: 340px; height: 186px;
  background: linear-gradient(178deg, #f7edda 0%, #ecd9b7 62%, #e0c9a4 100%);
  border-radius: 3px;
  box-shadow: 0 -2px 0 rgba(255, 250, 238, .55) inset, 0 -18px 40px -12px rgba(40, 18, 32, .55);
}
.peek__flap {
  position: absolute; left: 0; top: 0; width: 100%; height: 104px;
  background: linear-gradient(180deg, #fbf2e0 0%, #f0dfc1 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 8px 10px rgba(70, 56, 34, .3));
}
.fold {
  position: absolute; top: 0; left: 0;
  width: 199px; height: 1px;
  background: rgba(150, 116, 84, .4);
  transform-origin: 0 50%;
}
.fold--l { transform: translate(0, 1px) rotate(31.4deg); }
.fold--r { transform: translate(0, 1px) rotate(148.6deg); }

.peek__flap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(96, 78, 48, .14));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.peek__edge {
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: rgba(255, 250, 238, .6);
}
.peek__seal {
  position: absolute; left: 50%; top: 84px;
  width: 42px; height: 42px; margin-left: -21px;
  display: grid; place-items: center;
  font-family: var(--font-px); font-size: 24px; color: #f8e6cf;
  background: radial-gradient(circle at 35% 30%, #c4654a 0%, #a54d36 60%, #8c4530 100%);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(78, 40, 26, .5), inset 0 0 0 2px rgba(255, 226, 200, .22);
  transform: rotate(-4deg);
}

/* ───────────── envelope overlay ───────────── */
.env-layer {
  position: absolute; inset: 0; z-index: 130;
  display: none; pointer-events: none;
  background: rgba(16, 24, 14, 0);
  transition: background .5s ease;
}
.env-layer.on { display: block; background: rgba(16, 24, 14, .42); }
.env-layer.lift { background: rgba(16, 24, 14, 0); }
.env {
  position: absolute; left: 50%; top: 50%;
  width: 312px; height: 202px;
  transform: translate(-50%, -50%) translateY(72vh) scale(.92);
  transition: transform .82s var(--ease-out);
  perspective: 1400px;
  transform-style: preserve-3d;
}
.env-layer.rise .env { transform: translate(-50%, -50%) translateY(0) scale(1); }
.env__back, .env__front { box-shadow: 0 0 0 1px rgba(150, 116, 84, .16) inset, 0 1px 0 rgba(255, 253, 245, .5) inset; }
.env-layer.sink .env {
  transform: translate(-50%, -50%) translateY(64%) scale(.84);
  opacity: 0;
  transition: transform .7s cubic-bezier(.4, 0, .8, .4), opacity .42s ease;
}
.env__back, .env__front, .env__liner { position: absolute; inset: 0; border-radius: 3px; }
.env__back {
  background: linear-gradient(170deg, #faf1df 0%, #eeddc0 58%, #e3cda8 100%);
  box-shadow: inset 0 0 0 1px rgba(150, 116, 84, .18), inset 0 -34px 40px -34px rgba(120, 84, 60, .45);
}
.env__liner {
  inset: 6px 6px auto; height: 108px;
  background: repeating-linear-gradient(45deg, rgba(201, 116, 87, .26) 0 3px, rgba(201, 116, 87, .08) 3px 6px);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  opacity: 0; transition: opacity .5s ease .1s;
}
.env-layer.flap .env__liner { opacity: 1; }
.env__front {
  background:
    radial-gradient(rgba(150, 116, 84, .07) .5px, transparent .5px) 0 0 / 4px 4px,
    linear-gradient(180deg, #f1e2c6 0%, #e5cfa9 58%, #d6bd93 100%);
  clip-path: polygon(0 0, 50% 44%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 0 1px 0 rgba(255, 253, 245, .55) inset, 0 -16px 28px -20px rgba(64, 52, 32, .55) inset;
}
.env__flap {
  position: absolute; left: 0; top: 0; width: 100%; height: 112px;
  background: linear-gradient(180deg, #f8ecd7 0%, #eedcbc 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  filter: drop-shadow(0 9px 10px rgba(70, 56, 34, .34));
  transition: transform .62s cubic-bezier(.55, .02, .28, 1), opacity .26s ease .4s;
  box-shadow: 0 1px 0 rgba(255, 253, 245, .7) inset;
  z-index: 3;
}
.env-layer.flap .env__flap { transform: rotateX(-168deg); opacity: 0; }
.env__seal {
  position: absolute; left: 50%; top: 88px;
  width: 46px; height: 46px; margin-left: -23px;
  display: grid; place-items: center;
  font-family: var(--font-px); font-size: 24px; color: #f8e6cf;
  background: radial-gradient(circle at 34% 28%, #c45c53 0%, #a54d36 58%, #8a3632 100%);
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(78, 40, 26, .45), inset 0 0 0 2px rgba(255, 226, 200, .22);
  transform: rotate(-4deg);
  z-index: 5;
  transition: opacity .3s ease, transform .46s var(--ease);
}
.env-layer.flap .env__seal { opacity: 0; transform: translateY(-8px) scale(.7) rotate(-18deg); }
.env__glow {
  position: absolute; inset: -40px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 226, 186, .28), transparent 70%);
  opacity: 0; transition: opacity .6s ease;
  z-index: -1;
}
.env-layer.flap .env__glow { opacity: 1; }

/* letter extraction */
.s-letter.extracting {
  opacity: 1; visibility: visible;
  transform: translateY(26%) scale(.44);
  transform-origin: 50% 34%;
  transition: none;
  z-index: 120;
  box-shadow: 0 -30px 70px -20px rgba(12, 18, 11, .8);
}
.s-letter.extracting .paper { box-shadow: 0 24px 60px -30px rgba(16, 24, 14, .8); }
.s-letter.extracted {
  transform: none;
  transition: transform 1.02s var(--ease-out), box-shadow .8s ease;
}

/* ───────────── 2 · letter ───────────── */
.s-letter { background: var(--paper); }
.letter-scroll {
  min-height: 100%;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 26px);
}
.paper {
  position: relative;
  margin: 0;
  background: var(--paper);
  padding: 0 20px 26px;
}
.paper__texture {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(rgba(150, 116, 84, .16) .5px, transparent .5px),
    radial-gradient(rgba(255, 255, 255, .7) .5px, transparent .5px);
  background-size: 4px 4px, 4px 4px;
  background-position: 0 0, 2px 2px;
  mix-blend-mode: multiply;
}


.ribbon {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px;
  margin: 0 -20px; padding: calc(env(safe-area-inset-top) + 8px) 18px 8px 58px;
  background: linear-gradient(180deg, #2a3623 0%, #1f2a1b 100%);
  color: #f0dcc0;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .16em;
}
.ribbon::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: repeating-linear-gradient(90deg, rgba(32, 43, 28, .85) 0 6px, transparent 6px 10px);
}
.ribbon__no { opacity: .55; letter-spacing: .1em; }

.letter__title {
  position: relative;
  font-family: var(--font-px); font-size: 36px; line-height: 1.24;
  letter-spacing: .04em; color: var(--ink);
  margin: 26px 0 0;
}
.letter__from {
  margin-top: 12px; font-size: 12.5px; letter-spacing: .06em; color: var(--ink-3);
}

.medallions {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 22px 0 4px;
}
.medal {
  width: 104px; padding: 7px 7px 6px;
  background: #fbf3e3;
  border: 1px solid rgba(150, 116, 84, .4);
  box-shadow: 3px 3px 0 rgba(150, 116, 84, .16);
  text-align: center;
}
.medal canvas, .medal img {
  width: 100%; height: auto;
  aspect-ratio: 44 / 72;
  object-fit: contain;
  object-position: 50% 100%;
  background: linear-gradient(180deg, #f6e6c9, #ecd6b2);
  border: 1px solid rgba(150, 116, 84, .22);
}
.medal figcaption {
  margin-top: 7px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em;
  color: var(--ink); line-height: 1.5;
}
.medal figcaption span {
  display: block; font-size: 12px; letter-spacing: .18em;
  color: var(--coral-deep); transform: scale(.82); transform-origin: 50% 60%;
}
.medal__join {
  font-size: 15px; color: var(--coral); transform: translateY(-8px);
}

.rule {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 18px; color: var(--coral);
}
.rule i { flex: 1; height: 0; border-top: 1px dashed rgba(150, 116, 84, .45); }
.rule b { font-size: 11px; opacity: .8; }

.letter__body { position: relative; }
.letter__body p {
  font-size: 15px; line-height: 2.05; color: #45322f;
  letter-spacing: .015em;
}
.letter__body p + p { margin-top: 11px; }
.letter__body p:first-child { font-weight: 600; }

.sign {
  position: relative; margin-top: 26px; text-align: right;
  padding-right: 68px;
}
.sign__names {
  font-family: var(--font-px); font-size: 24px; letter-spacing: .05em; color: var(--ink);
}
.sign__meta { margin-top: 8px; font-size: 12px; letter-spacing: .1em; color: var(--ink-3); }
.seal {
  position: absolute; right: 2px; top: -2px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-family: var(--font-px); font-size: 24px; color: #fbe9d2;
  background: var(--seal);
  clip-path: polygon(6% 0, 94% 0, 100% 8%, 100% 92%, 94% 100%, 6% 100%, 0 92%, 0 8%);
  transform: rotate(-6deg);
  opacity: .92;
  box-shadow: inset 0 0 0 2px rgba(255, 226, 200, .25);
}
.paper__foot {
  margin-top: 18px; text-align: center;
  font-size: 11.5px; letter-spacing: .08em; color: var(--ink-3);
}

/* ───────────── buttons ───────────── */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 26px; padding: 17px 18px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .18em;
  text-indent: .18em;
  border-radius: 2px;
  transition: transform .16s ease, box-shadow .16s ease, filter .2s ease;
  min-height: 54px;
}
.btn__mark { font-style: normal; font-size: 11px; opacity: .7; text-indent: 0; }
.btn--ink {
  background: linear-gradient(180deg, #33422b 0%, #24301f 100%);
  color: #f6e8d2;
  box-shadow: 0 4px 0 #182014, 0 10px 24px -14px rgba(20, 30, 18, .9);
}
.btn--ink:active { transform: translateY(3px); box-shadow: 0 1px 0 #182014, 0 4px 10px -8px rgba(20, 30, 18, .9); }
.btn--coral {
  background: linear-gradient(180deg, #d0805f 0%, #b05f45 100%);
  color: #fdf1e2;
  box-shadow: 0 4px 0 #8a4632, 0 12px 26px -16px rgba(120, 50, 60, .9);
}
.btn--coral:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a4632; }
.btn--block { margin-top: 18px; }
.btn[disabled] { filter: grayscale(.35) brightness(.92); opacity: .7; pointer-events: none; }

.btn--ghost {
  margin-top: 12px;
  color: var(--ink);
  background: rgba(255, 250, 238, .6);
  border: 1px solid rgba(90, 92, 70, .34);
  box-shadow: 0 3px 0 rgba(90, 92, 70, .16);
}
.btn--ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(90, 92, 70, .16); }
.linkbtn {
  display: block; width: 100%; margin-top: 18px; padding: 14px 0;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .1em;
  color: var(--ink-3); text-align: center;
}
.linkbtn:active { opacity: .6; }
.linkbtn--light { color: rgba(252, 242, 224, .92); text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* ───────────── 3 · gallery ───────────── */
.s-gallery { background: var(--paper); }
.s-gallery::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(150, 116, 84, .2) .5px, transparent .5px);
  background-size: 4px 4px;
}
.deck-photos {
  position: relative; height: 366px; margin-top: 12px;
  display: grid; place-items: center;
  touch-action: pan-y;
  perspective: 1200px;
}
.polaroids { position: relative; width: 286px; height: 358px; }
.polaroid {
  position: absolute; inset: 0;
  padding: 12px 12px 0;
  background: linear-gradient(180deg, #fbf4e6 0%, #f3e8d3 100%);
  border: 1px solid rgba(150, 116, 84, .34);
  box-shadow: 0 18px 34px -22px rgba(26, 34, 22, .7), 0 2px 0 rgba(255, 255, 255, .5) inset;
  transform:
    translateX(calc(var(--d, 0) * 22px + var(--dx, 0px) * (1 - abs(var(--d, 0)) * .35)))
    scale(calc(1 - abs(var(--d, 0)) * .06))
    rotate(calc(var(--d, 0) * 2.6deg));
  transition: transform .52s var(--ease), opacity .4s ease;
  opacity: calc(1 - abs(var(--d, 0)) * .18);
  will-change: transform;
}
.polaroid[data-hide="1"] { opacity: 0; pointer-events: none; }
.polaroid__img {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: #e6d3b4; overflow: hidden;
  border: 1px solid rgba(150, 116, 84, .22);
}
.polaroid__img canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid__img::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), inset 0 -10px 20px -14px rgba(60, 30, 30, .6);
  pointer-events: none;
}
.polaroid__tape {
  position: absolute; top: -9px; left: 50%; width: 64px; height: 20px;
  margin-left: -32px; transform: rotate(-2deg);
  background: rgba(214, 186, 140, .55);
  border-left: 1px dashed rgba(255, 255, 255, .5);
  border-right: 1px dashed rgba(255, 255, 255, .5);
}
.polaroid__cap {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 12px 2px 0;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .04em; color: var(--ink-2);
}
.polaroid__cap em { font-style: normal; color: var(--coral); letter-spacing: .06em; }

.photo-meta {
  display: flex; align-items: center; gap: 14px; margin-top: 2px;
}
.photo-meta__mid { flex: 1; text-align: center; }
.photo-count {
  margin-top: 6px; font-family: var(--font-px); font-size: 12px;
  letter-spacing: .1em; color: var(--ink-3);
}
.photo-count b { color: var(--coral-deep); font-weight: 400; }
.photo-count span { margin-left: .3em; }
.rnd {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  color: var(--ink-2);
  border: 1px solid rgba(150, 116, 84, .4);
  border-radius: 50%;
  background: rgba(255, 250, 238, .6);
  transition: transform .18s ease, background .2s ease;
}
.rnd:active { transform: scale(.9); background: rgba(201, 116, 87, .14); }
.photo-tip {
  margin-top: 8px; text-align: center;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em;
  color: var(--ink-3);
}

/* ───────────── 4 · ticket ───────────── */
.s-ticket { background: var(--paper-deep); }
.s-ticket::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .3;
  background-image:
    repeating-linear-gradient(45deg, rgba(150, 116, 84, .1) 0 1px, transparent 1px 5px);
}
.ticket {
  position: relative; margin-top: 22px;
  background: var(--paper);
  border: 1px solid rgba(140, 106, 74, .4);
  box-shadow: 0 20px 40px -26px rgba(38, 44, 28, .7), 0 2px 0 rgba(255, 255, 255, .45) inset;
  --ticketbg: var(--paper-deep);
}
.ticket__top {
  padding: 20px 20px 16px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(201, 116, 87, .16), transparent 60%),
    linear-gradient(180deg, #f8efdb, #f2e5cc);
}
.ticket__brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket__no {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .1em; color: var(--ink-3);
}
.ticket__us {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em; color: var(--coral-deep);
}
.ticket__date {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  margin-top: 14px;
  font-family: var(--font-px); color: var(--ink);
  line-height: 1;
}
.ticket__date b { font-size: 48px; font-weight: 400; letter-spacing: .02em; }
.ticket__date i { font-style: normal; font-size: 24px; color: var(--coral); transform: translateY(-8px); }
.ticket__date em { font-style: normal; font-size: 12px; letter-spacing: .2em; color: var(--ink-3); margin-left: 6px; }
.ticket__lunar {
  margin-top: 10px; text-align: center;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .1em; color: var(--ink-2);
}
.perf {
  position: relative; height: 22px; display: grid; place-items: center;
  background-image:
    radial-gradient(circle 9px at -1px 50%, var(--ticketbg) 97%, transparent 100%),
    radial-gradient(circle 9px at calc(100% + 1px) 50%, var(--ticketbg) 97%, transparent 100%);
  background-repeat: no-repeat;
}
.perf::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: 50%;
  border-top: 1px dashed rgba(140, 106, 74, .55);
}
.perf span {
  position: relative; background: var(--paper); padding: 0 8px;
  color: var(--ink-3); font-size: 11px; transform: rotate(90deg);
}
.ticket__body { padding: 6px 20px 20px; }
.tk-block + .tk-block { margin-top: 20px; }
.tk-label {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .12em;
  color: var(--ink); font-weight: 400;
}
.tk-label span {
  font-size: 12px; letter-spacing: .16em; color: var(--ink-3); opacity: .7;
  transform: scale(.85); transform-origin: 0 60%;
}
.run { list-style: none; margin-top: 12px; }
.run li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 0 9px 2px;
}
.run li + li { border-top: 1px dashed rgba(140, 106, 74, .22); }
.run li b {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .04em;
  color: var(--coral-deep); min-width: 44px;
}
.run li span { flex: 1; font-size: 14px; color: var(--ink); letter-spacing: .02em; }
.run li i {
  font-style: normal; font-family: var(--font-px); font-size: 12px;
  color: var(--ink-3); opacity: .55; letter-spacing: .04em;
}
.run li::before {
  content: ""; position: absolute; left: -2px; top: 50%;
  width: 5px; height: 5px; transform: translateY(-50%);
  background: var(--coral-soft);
}
.run li { padding-left: 16px; }

.venue__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px;
}
.venue__name {
  font-family: var(--font-px); font-size: 24px; letter-spacing: .06em; color: var(--ink);
}
.addr-copy {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; flex: none;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .04em;
  color: var(--coral-deep);
  background: rgba(201, 116, 87, .08);
  border: 1px solid rgba(156, 83, 64, .34);
  transition: transform .14s ease, background .2s ease;
}
.addr-copy::after { content: ""; position: absolute; inset: -9px -10px; }
.addr-copy:active { transform: scale(.95); background: rgba(201, 116, 87, .18); }
.venue__addr {
  margin-top: 10px; font-size: 13px; line-height: 1.75; color: var(--ink-2);
}

.nav-pair { display: flex; gap: 10px; margin-top: 12px; }
.btn-nav {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 10px 8px;
  background: linear-gradient(180deg, #fbf4e4, #f0e3ca);
  border: 1px solid rgba(140, 106, 74, .38);
  box-shadow: 0 3px 0 rgba(140, 106, 74, .22);
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn-nav:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(140, 106, 74, .22); }
.btn-nav span {
  display: flex; flex-direction: column; gap: 3px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em; color: var(--ink);
}
.btn-nav em {
  font-style: normal; font-size: 12px; letter-spacing: .12em;
  color: var(--ink-3); transform: scale(.78); transform-origin: 50% 0;
}
.pin { width: 12px; height: 16px; display: block; flex: none; clip-path: polygon(50% 100%, 0 42%, 0 0, 100% 0, 100% 42%); }
.pin--amap { background: var(--coral-deep); }
.pin--baidu { background: var(--ink-2); }

.mapbox {
  position: relative; margin-top: 12px; height: 148px;
  border: 1px solid rgba(140, 106, 74, .3);
  background: #e8dcc4; overflow: hidden;
}
.mapbox canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.mapbox__tag {
  position: absolute; padding: 3px 6px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .04em;
  color: var(--ink-2); background: rgba(250, 243, 228, .9);
  border: 1px solid rgba(140, 106, 74, .26);
  white-space: nowrap;
}
.mapbox__tag--from { left: 6px; bottom: 6px; }
.mapbox__tag--to { right: 8px; top: 7px; color: var(--coral-deep); }
.mapbox__tag--note {
  right: 8px; bottom: 7px;
  color: var(--ink-3); background: rgba(250, 243, 228, .8);
  border-style: dashed;
}

/* ───────────── 5 · guestbook ───────────── */
.s-book { background: #efe1c7; }
.s-book::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: radial-gradient(rgba(150, 116, 84, .18) .5px, transparent .5px);
  background-size: 4px 4px;
}
.book {
  position: relative; margin-top: 22px; height: 334px;
  padding: 18px 20px 18px 42px;
  background: linear-gradient(180deg, #fbf4e4, #f4e8d1);
  border: 1px solid rgba(140, 106, 74, .35);
  box-shadow: 0 18px 36px -24px rgba(38, 44, 28, .8), 0 2px 0 rgba(255, 255, 255, .5) inset;
  overflow: hidden;
}
.book__binding {
  position: absolute; left: 15px; top: 22px; bottom: 22px; width: 12px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
}
.book__binding i { width: 8px; height: 8px; border-radius: 50%; background: var(--paper-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.book__binding::before {
  content: ""; position: absolute; left: 3.5px; top: -6px; bottom: -6px; width: 1px;
  background: rgba(140, 106, 74, .35);
}
.book__pages { position: relative; height: 100%; }
.wish-page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  transition: opacity .34s ease, transform .34s var(--ease);
}
.wish-page[hidden] { display: none; }
.wish-page.is-out-l { opacity: 0; transform: translateX(-16px) rotate(-1.2deg); }
.wish-page.is-out-r { opacity: 0; transform: translateX(16px) rotate(1.2deg); }
.wish-page__quote {
  font-family: var(--font-px); font-size: 24px; color: var(--coral-soft);
  line-height: 1; margin-bottom: 10px;
}
.wish-page__msg {
  font-size: 16px; line-height: 1.95; color: #43302e;
  max-height: 148px; overflow: hidden;
  word-break: break-word;
}
.wish-page__who {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed rgba(140, 106, 74, .4);
}
.wish-page__name {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em; color: var(--ink);
}
.wish-page__tag {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .04em;
  color: var(--coral-deep); background: rgba(201, 116, 87, .1);
  padding: 3px 6px; transform: scale(.9); transform-origin: 0 50%;
}
.wish-page__time { margin-left: auto; font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.wish-empty { text-align: center; color: var(--ink-3); font-size: 14px; line-height: 1.95; }
.wish-empty__no {
  display: block; margin: 0 auto 12px;
  font-family: var(--font-px); font-size: 44px; line-height: 1;
  letter-spacing: .06em; color: rgba(184, 112, 82, .28);
}
.book-bar {
  display: flex; align-items: center; gap: 16px; margin-top: 14px;
}
.book-bar .book-count { flex: 1; text-align: center; margin: 0; }
.book-bar .rnd { width: 44px; height: 44px; }
.book-count {
  font-family: var(--font-px); font-size: 12px; letter-spacing: .12em; color: var(--ink-3);
}
.book-count b { color: var(--coral-deep); font-weight: 400; }
.book-count span { margin-left: 6px; }

/* ───────────── 6 · end ───────────── */
.s-end { background: var(--forest-950); overflow: hidden; }
.s-end .scene-vignette {
  background:
    linear-gradient(180deg, rgba(12, 18, 10, .88) 0%, rgba(12, 18, 10, .62) 30%, rgba(12, 18, 10, .12) 48%, transparent 58%),
    linear-gradient(0deg, rgba(12, 18, 10, .78) 0%, transparent 30%);
}
.end {
  position: absolute; left: 0; right: 0;
  top: calc(env(safe-area-inset-top) + 56px);
  padding: 0 28px; text-align: center;
}
.end .kicker { color: rgba(244, 220, 196, .6); }
.end__title {
  font-family: var(--font-px); font-size: 36px; line-height: 1.34;
  letter-spacing: .04em; color: #fdf0da; margin-top: 14px;
  text-shadow: 3px 3px 0 rgba(30, 14, 26, .5);
}
.end__text {
  margin-top: 16px; font-size: 13.5px; line-height: 1.95;
  color: rgba(246, 230, 208, .8); letter-spacing: .04em;
}
.end__sign {
  margin-top: 18px; font-family: var(--font-px); font-size: 12px;
  letter-spacing: .1em; color: rgba(246, 230, 208, .9);
}
.end__sign span { display: block; margin-top: 8px; opacity: .5; letter-spacing: .18em; }
.end__foot {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 26px);
  padding: 0 28px; text-align: center;
}
.end__tip {
  margin-top: 6px; font-family: var(--font-px); font-size: 12px;
  letter-spacing: .06em; color: rgba(246, 230, 208, .38);
}

/* ───────────── sheet ───────────── */
.scrim {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(28, 16, 24, .5);
  opacity: 0; transition: opacity .34s ease;
}
.scrim.on { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 90;
  max-height: 88%;
  padding: 10px 22px calc(env(safe-area-inset-bottom) + 20px);
  background: var(--paper);
  border-top: 1px solid rgba(140, 106, 74, .4);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -24px 60px -20px rgba(16, 24, 14, .75);
  transform: translateY(102%);
  transition: transform .46s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.sheet.on { transform: none; }
.sheet.dragging { transition: none; }
.sheet__grab {
  width: 100%; height: 26px; display: grid; place-items: center;
  margin-bottom: 4px; touch-action: none;
}
.sheet__grab i { width: 42px; height: 4px; border-radius: 99px; background: rgba(60, 56, 38, .22); }
.sheet__head h2 {
  font-family: var(--font-px); font-size: 24px; letter-spacing: .05em; color: var(--ink);
}
.sheet__head p { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }

.form { margin-top: 18px; }
.field { display: block; margin-top: 16px; }
.field__label {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em; color: var(--ink);
  margin-bottom: 8px;
}
.field__label em {
  font-style: normal; color: var(--ink-3); letter-spacing: .02em;
  transform: scale(.88); transform-origin: 0 50%;
}
.field input, .field textarea {
  width: 100%; padding: 13px 12px;
  font-size: 15px; line-height: 1.6; color: var(--ink);
  background: #fbf4e4;
  border: 1px solid rgba(140, 106, 74, .38);
  border-radius: 2px;
  transition: border-color .2s ease, background .2s ease;
  appearance: none;
}
.field input::placeholder, .field textarea::placeholder { color: #7f665c; font-size: 14px; opacity: 1; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--coral);
  background: #fdf8ec;
  box-shadow: 0 0 0 3px rgba(201, 116, 87, .12);
}
.field textarea { resize: none; min-height: 96px; }
.field__count {
  display: block; text-align: right; margin-top: 5px;
  font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
}
.choice { display: flex; gap: 10px; }
.choice__opt {
  flex: 1; padding: 12px 12px; text-align: left;
  background: #fbf4e4;
  border: 1px solid rgba(140, 106, 74, .38);
  transition: border-color .2s ease, background .2s ease, transform .16s ease;
}
.choice__opt b { display: block; font-family: var(--font-px); font-size: 12px; letter-spacing: .06em; color: var(--ink); }
.choice__opt span { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.choice__opt.on {
  border-color: var(--coral); background: rgba(201, 116, 87, .1);
  box-shadow: inset 0 0 0 1px var(--coral);
}
.choice__opt:active { transform: scale(.98); }
.field--guests { overflow: hidden; transition: opacity .25s ease, max-height .3s ease, margin .3s ease; max-height: 90px; }
.field--guests.hide { opacity: 0; max-height: 0; margin-top: 0; pointer-events: none; }
.stepper { display: flex; align-items: center; gap: 0; }
.stepper button {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-size: 18px; color: var(--ink);
  background: #fbf4e4; border: 1px solid rgba(140, 106, 74, .38);
  transition: background .18s ease, transform .14s ease;
}
.stepper button:active { background: rgba(201, 116, 87, .14); transform: scale(.94); }
.stepper output {
  min-width: 58px; height: 46px; display: grid; place-items: center;
  font-family: var(--font-px); font-size: 24px; color: var(--ink);
  border-top: 1px solid rgba(140, 106, 74, .38);
  border-bottom: 1px solid rgba(140, 106, 74, .38);
  background: #fdf8ec;
}
.stepper__unit { margin-left: 10px; font-size: 12px; color: var(--ink-3); }
.form__err {
  min-height: 18px; margin-top: 12px;
  font-size: 12px; color: var(--seal); letter-spacing: .02em;
}
.form__note {
  margin-top: 10px; text-align: center;
  font-size: 11px; color: var(--ink-3); line-height: 1.7;
}

/* ───────────── lightbox ───────────── */
.lightbox {
  position: absolute; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 17, 11, .965);
  opacity: 0; visibility: hidden;
  transition: opacity .32s ease, visibility .32s;
}
.lightbox.on { opacity: 1; visibility: visible; }
.lightbox__inner { width: 100%; padding: 0 18px; }
.lightbox__frame {
  border: 8px solid #f6ecd8;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
  transform-origin: 50% 50%;
  transition: transform .38s var(--ease-out);
  transform: scale(.92);
}
.lightbox.on .lightbox__frame { transform: scale(1); }
.lightbox__frame canvas { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.lightbox__frame img { width: 100%; height: auto; display: block; }
.lightbox__frame [hidden] { display: none; }
.lightbox__cap {
  margin-top: 16px; text-align: center;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .08em; color: rgba(246, 236, 216, .85);
}
.lightbox__hint {
  margin-top: 8px; text-align: center;
  font-size: 11px; letter-spacing: .08em; color: rgba(246, 236, 216, .35);
}
.lightbox__close {
  position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 14px;
  width: 46px; height: 46px; display: grid; place-items: center;
  font-size: 16px; color: #f6ecd8; opacity: .7;
}
.lightbox__close:active { transform: scale(.9); }

/* ───────────── toast ───────────── */
.toast {
  position: absolute; left: 50%; z-index: 130;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  transform: translate(-50%, 10px);
  padding: 11px 16px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .06em;
  color: #f8edda; background: rgba(24, 34, 21, .95);
  border: 1px solid rgba(255, 235, 210, .14);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .8);
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease, transform .28s var(--ease);
  white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── petals ───────────── */
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -16px;
  width: 5px; height: 5px;
  background: #f3dfae;
  animation: fall linear infinite;
  opacity: .8;
  box-shadow: 0 0 6px rgba(255, 214, 140, .5);
}
.petal:nth-child(3n) { background: #e9bf62; width: 4px; height: 4px; }
.petal:nth-child(4n) { background: #f8eed6; }
.petal:nth-child(5n) { background: #d97a5c; }
@keyframes fall {
  0%   { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .85; }
  100% { transform: translate3d(var(--sx, 30px), 96vh, 0) rotate(var(--rot, 320deg)); opacity: .1; }
}

/* ───────────── entrance reveal ───────────── */
.reveal { opacity: 0; }
.screen.on .reveal {
  animation: rise .82s var(--ease-out) both calc(var(--i, 0) * 95ms + 120ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ───────────── responsive nips ───────────── */
@media (max-height: 740px) {
  .cover { top: calc(env(safe-area-inset-top) + 26px); }
  .cover__title { font-size: 34px; margin-top: 10px; }
  .cover__names { font-size: 21px; margin-top: 10px; gap: 9px; }
  .cover__date { margin-top: 12px; }
  .cover__date + .cover__lunar { margin-top: 6px; }
  .end { top: calc(env(safe-area-inset-top) + 32px); }
  .end__title { font-size: 30px; margin-top: 10px; }
  .end__text { margin-top: 10px; line-height: 1.7; }
  .end__sign { margin-top: 12px; }
  .deck-photos { height: 330px; }
  .polaroids { width: 258px; height: 320px; }
    .book { height: 262px; }
}
@media (max-width: 359px) {
  :root { --pad: 18px; }
  .cover__title { font-size: 36px; }
  .polaroids { width: 268px; height: 340px; }
  .deck-photos { height: 354px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .petals, .layer-cloud { display: none; }
  .reveal { opacity: 1; }
}

/* page-turn direction helper + guestbook entrance */
.screen.prep-up { transform: translateY(-46px) scale(.94); transition: none; }
.wish-page { animation: wishIn .42s var(--ease-out) both; }
@keyframes wishIn {
  from { opacity: 0; transform: translateY(10px) rotate(.6deg); }
  to   { opacity: 1; transform: none; }
}


/* 阅读提示 */
.scrollcue[hidden] { display: none; }
.scrollcue {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px);
  z-index: 45; transform: translate(-50%, 8px);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-px); font-size: 12px; letter-spacing: .1em;
  color: #f6e8d2; background: rgba(24, 34, 21, .72);
  border: 1px solid rgba(255, 235, 210, .14);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ease);
}
.scrollcue.on { opacity: 1; transform: translate(-50%, 0); }
.scrollcue i {
  width: 5px; height: 5px; display: block;
  border-right: 1px solid #f6e8d2; border-bottom: 1px solid #f6e8d2;
  transform: rotate(45deg) translate(-1px, -1px);
  animation: cueBob 1.4s steps(2, end) infinite;
}
@keyframes cueBob { 0%,100% { transform: rotate(45deg) translate(-1px,-1px) } 50% { transform: rotate(45deg) translate(1px,1px) } }


/* 背景图模式：浅色天空上的深色标题 */
body.has-art .s-end { background: #2d3638; }


/* 新人立绘：直接用原图缩下来，交给浏览器高质量缩放 */
.couple-cards {
  /* --pw 是手机框宽度，由 JS 写入；--scene-s / --auto-y 由 layoutScene() 按屏高算。
     780:1452 的图，草地在地平线 91.3% 处，
     所以草地距图顶 = 宽度 × 1452/780 × 0.913 = 宽度 × 1.6996 */
  position: absolute; left: 50%;
  top: calc(var(--pw, 390px) * 1.6996 * var(--scene-s, 1));
  transform: translate(-50%, calc(-100% + var(--auto-y, 0px) + var(--people-y, 0px)));
  display: flex; align-items: flex-end; gap: 2px;
  z-index: 5;
}
.couple-cards img { display: block; height: calc(224px * var(--scene-s, 1)); width: auto; }
.couple-cards img {
  opacity: 0;
  transition: opacity .5s ease .1s;
  animation: bobCard .9s steps(1, end) infinite;
  will-change: transform;
}
.couple-cards img.in { opacity: 1; }
@keyframes bobCard {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .couple-cards img { animation: none; }
}
.couple-cards::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -6px; height: 14px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(28, 40, 20, .45), rgba(28, 40, 20, 0) 72%);
  filter: blur(2px); z-index: -1;
}


/* 位置调试面板（?debug=1） */
.dbg {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 200;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(24, 20, 16, .92);
  color: #f7efda; font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.dbg__title { font-size: 11px; opacity: .6; margin-bottom: 6px; }
.dbg label { display: flex; align-items: center; gap: 8px; height: 30px; }
.dbg input[type=range] { flex: 1; accent-color: #c97457; }
.dbg b { width: 34px; text-align: right; font-weight: 400; color: #e8b27a; }
.dbg button {
  margin-top: 4px; padding: 6px 10px; border-radius: 4px;
  background: #c97457; color: #fff; font-size: 12px;
}
