/* ═══════════════════════════════════════════
   一封家书 · 致母亲
   Letter to Mother — 信件式纪念网站
   ═══════════════════════════════════════════ */

:root {
  --paper: #fbf7ec;
  --paper-deep: #f5eeda;
  --ink: #3e3a33;
  --ink-soft: #6b6355;
  --ink-faint: #9a9182;
  --seal: #a33d2e;
  --seal-deep: #7e2c21;
  --gold: #b8965e;
  --bg: #e9e1cf;
  --bg-deep: #d9cfb8;
  --line: rgba(62, 58, 51, 0.14);
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --handwrite: "Ma Shan Zheng", "Kaiti SC", "STKaiti", "KaiTi", cursive;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(163, 61, 46, 0.18); }

/* ── 通用渐显动画（舒缓版） ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.3s; }
.reveal[data-delay="2"] { transition-delay: 0.6s; }
.reveal[data-delay="3"] { transition-delay: 0.9s; }

/* ── 正文手写式逐字浮现 ── */
.char {
  display: inline-block;
  opacity: 0;
  transform: scale(0.5);
  transform-origin: left bottom;
  transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: opacity, transform;
}
.char.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════
   封面 · 信封开场
   ═══════════════════════════════════════════ */

.cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(201, 169, 106, 0.18) 0%, rgba(201,169,106,0.04) 40%, transparent 70%),
    radial-gradient(120% 120% at 50% 30%, #1a1712 0%, #0d0c0a 58%, #060505 100%);
  transition: opacity 1.1s ease 0.25s, visibility 0s linear 1.35s;
  overflow: hidden;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 32% at 22% 18%, rgba(232, 207, 154, 0.16) 0%, transparent 70%),
    radial-gradient(38% 28% at 78% 72%, rgba(201, 169, 106, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* 封面金色光尘 */
.cover-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ═══ 封面金色光柱（参考图式舞台灯光） ═══ */
.light-beams {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.beam {
  position: absolute;
  top: -15%;
  width: 240px;
  height: 140%;
  background: linear-gradient(
    180deg,
    rgba(217, 194, 138, 0)    0%,
    rgba(217, 194, 138, 0.22) 18%,
    rgba(232, 207, 154, 0.34) 36%,
    rgba(217, 194, 138, 0.18) 60%,
    rgba(217, 194, 138, 0)    100%
  );
  filter: blur(32px);
  transform-origin: top center;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}
.beam-1 { left:  8%; transform: rotate(-12deg); animation: beamSway1 9.5s  ease-in-out infinite; }
.beam-2 { left: 30%; width: 320px; transform: rotate(-7deg);  animation: beamSway2 12s  -2s ease-in-out infinite; }
.beam-3 { left: 56%; width: 280px; transform: rotate(-10deg); animation: beamSway3 10.5s -5s ease-in-out infinite; }
.beam-4 { left: 78%; width: 200px; transform: rotate(-14deg); animation: beamSway4 13s  -1s ease-in-out infinite; }

@keyframes beamSway1 {
  0%, 100% { opacity: 0.55; transform: translateX(0)    rotate(-12deg); }
  50%      { opacity: 0.9;  transform: translateX(18px) rotate(-10deg); }
}
@keyframes beamSway2 {
  0%, 100% { opacity: 0.55; transform: translateX(0)    rotate(-7deg); }
  50%      { opacity: 0.9;  transform: translateX(-14px) rotate(-5deg); }
}
@keyframes beamSway3 {
  0%, 100% { opacity: 0.55; transform: translateX(0)    rotate(-10deg); }
  50%      { opacity: 0.9;  transform: translateX(20px) rotate(-8deg); }
}
@keyframes beamSway4 {
  0%, 100% { opacity: 0.55; transform: translateX(0)    rotate(-14deg); }
  50%      { opacity: 0.9;  transform: translateX(-12px) rotate(-12deg); }
}

/* ═══ 封面四角仪式感装饰（参考图风格） ═══ */
.cover-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  color: rgba(217, 194, 138, 0.55);
  font-family: var(--sans);
}

/* 左上：M 圆形徽标 */
.deco-mark {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(217, 194, 138, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0;
  color: rgba(232, 207, 154, 0.78);
  background: rgba(20, 16, 10, 0.25);
  backdrop-filter: blur(2px);
}
.deco-mark::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(217, 194, 138, 0.18);
}

/* 左上副小标（在 M 标右侧） */
.deco-topleft {
  position: absolute;
  top: 38px;
  left: 84px;
  line-height: 1.55;
}
.deco-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(232, 207, 154, 0.7);
  font-family: var(--sans);
}
.deco-eyebrow-thin {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(217, 194, 138, 0.42);
}

/* 右上：序号 01 + 长划线 */
.deco-topright {
  position: absolute;
  top: 38px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.deco-num {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 4px;
  color: rgba(232, 207, 154, 0.78);
}
.deco-num-line {
  display: inline-block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, rgba(217, 194, 138, 0.65), rgba(217, 194, 138, 0));
}

/* 右上副小英文 */
.deco-sub-en {
  position: absolute;
  top: 78px;
  right: 30px;
  font-size: 10px;
  letter-spacing: 4px;
  color: rgba(217, 194, 138, 0.42);
  text-align: right;
}

/* 右下：底部小字 */
.deco-foot {
  position: absolute;
  bottom: 26px;
  right: 30px;
  margin: 0;
  font-size: 10px;
  letter-spacing: 5px;
  color: rgba(217, 194, 138, 0.4);
  font-family: var(--sans);
}
.cover.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cover-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 24px;
  text-align: center;
  animation: coverFadeIn 1.4s ease both;
  position: relative;
  z-index: 3;
}
@keyframes coverFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 信封本体 */
.envelope {
  position: relative;
  width: min(400px, 84vw);
  aspect-ratio: 420 / 288;
  cursor: pointer;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
  will-change: transform, opacity;
}
.envelope.shrink {
  animation: envShrink 0.7s cubic-bezier(0.5, 0, 0.4, 1) forwards;
}
@keyframes envShrink {
  to { opacity: 0; transform: scale(1.08) translateY(-16px); }
}

.env-back,
.env-front,
.env-flap,
.env-letter {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
}

/* 信封后壁 */
.env-back {
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #f3e3bd 0%, #e6d2a2 55%, #d9c18c 100%);
  border-radius: 8px;
  z-index: 1;
  transition: opacity 0.5s ease;
}

/* 信封内信纸（默认藏在信封里，抽出动画） */
.env-letter {
  top: 9%;
  width: 78%;
  height: 60%;
  background: var(--paper);
  border-radius: 4px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(0);
  transition: transform 0.75s cubic-bezier(0.3, 0, 0.2, 1),
              opacity 0.35s ease 0.05s;
  will-change: transform, opacity;
}
.env-letter-line {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(62, 58, 51, 0.12);
}
.env-letter-line.short { width: 55%; }
.env-letter-seal-mini {
  margin-top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--seal);
  align-self: flex-end;
  opacity: 0.75;
}

/* 信封前壁（下半） */
.env-front {
  top: 34%;
  width: 100%;
  height: 66%;
  background: linear-gradient(160deg, #f0dfb2 0%, #e3cd97 100%);
  border-radius: 0 0 8px 8px;
  z-index: 3;
  transition: opacity 0.5s ease;
}
.env-front::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  width: 58%;
  height: 26%;
  transform: translateX(-50%);
  border: 1.5px dashed rgba(126, 93, 48, 0.35);
  border-radius: 4px;
}

/* 信封封口（纯 2D 翻转，避免 3D 穿模） */
.env-flap {
  top: 0;
  width: 100%;
  height: 58%;
  background: linear-gradient(160deg, #f6e8c4 0%, #ead7a8 100%);
  border-radius: 8px 8px 0 0;
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: scaleY(1);
  transition: transform 0.6s cubic-bezier(0.5, 0, 0.3, 1),
              opacity 0.5s ease 0.25s;
  will-change: transform, opacity;
}
.envelope.open .env-flap {
  transform: scaleY(-1);
  opacity: 0;
  z-index: 0;
}
/* 封口翻开后，信纸从信封口徐徐升起 */
.envelope.open .env-letter {
  opacity: 1;
  transform: translateY(-118%);
  z-index: 2;
}
/* 信纸升起后，信封前后壁淡出，避免"信纸穿墙"感 */
.envelope.open .env-back,
.envelope.open .env-front {
  opacity: 0;
  transition-delay: 0.28s;
}

/* 火漆印章 */
.env-seal {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0503e 0%, var(--seal) 55%, var(--seal-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 2px 6px rgba(255, 255, 255, 0.18);
  transition: transform 0.5s ease 0.15s, opacity 0.5s ease 0.2s;
  animation: sealPulse 2.6s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 2px 6px rgba(255,255,255,0.18); }
  50%      { box-shadow: 0 6px 20px rgba(163,61,46,0.5), inset 0 2px 6px rgba(255,255,255,0.22); }
}
.env-seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.5);
}
.seal-word {
  font-family: var(--kai);
  font-size: 26px;
  color: rgba(255, 244, 236, 0.95);
  letter-spacing: 2px;
}
.envelope.open .env-seal {
  transform: translate(-50%, -50%) scale(1.6) rotate(8deg);
  opacity: 0;
}

/* 封面文字 */
.cover-title {
  font-family: var(--kai);
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: 12px;
  text-indent: 12px;
  color: #d9c28a;
  text-shadow:
    0 0 6px rgba(217, 194, 138, 0.55),
    0 0 18px rgba(201, 169, 106, 0.45),
    0 0 44px rgba(201, 169, 106, 0.30),
    0 0 80px rgba(201, 169, 106, 0.18);
  animation: titleGlow 3.6s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% {
    text-shadow:
      0 0 6px rgba(217, 194, 138, 0.55),
      0 0 18px rgba(201, 169, 106, 0.45),
      0 0 44px rgba(201, 169, 106, 0.30),
      0 0 80px rgba(201, 169, 106, 0.18);
  }
  50% {
    text-shadow:
      0 0 8px rgba(217, 194, 138, 0.75),
      0 0 24px rgba(201, 169, 106, 0.60),
      0 0 60px rgba(201, 169, 106, 0.42),
      0 0 110px rgba(201, 169, 106, 0.26);
  }
}
.cover-sub {
  font-size: 15px;
  color: rgba(242, 232, 210, 0.62);
  letter-spacing: 6px;
  margin-top: -14px;
}
.cover-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 30px;
  border: 1px solid rgba(242, 232, 210, 0.4);
  border-radius: 40px;
  background: transparent;
  color: #f2e8d2;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}
.cover-cta:hover {
  background: rgba(242, 232, 210, 0.1);
  border-color: rgba(242, 232, 210, 0.7);
  transform: translateY(-2px);
}
.cover-cta svg { transition: transform 0.4s ease; }
.cover-cta:hover svg { transform: translateY(3px); }

/* ═══════════════════════════════════════════
   章节导航
   ═══════════════════════════════════════════ */

.chapter-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 8px;
  border-radius: 40px;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}
.chapter-nav.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(62, 58, 51, 0.25);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.nav-dot:hover {
  background: rgba(62, 58, 51, 0.5);
  transform: scale(1.3);
}
.nav-dot.is-active {
  background: var(--seal);
  box-shadow: 0 0 0 4px rgba(163, 61, 46, 0.18);
  transform: scale(1.25);
}

/* ═══════════════════════════════════════════
   分页信纸主体（每页一屏，scroll-snap）
   ═══════════════════════════════════════════ */

main {
  position: relative;
  scroll-snap-type: y mandatory;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vh, 56px) 20px;
}

.page-inner {
  position: relative;
  width: min(760px, 100%);
  background: var(--paper);
  border-radius: 4px;
  padding: clamp(32px, 5.5vw, 60px) clamp(26px, 6vw, 72px);
  box-shadow: 0 30px 70px rgba(60, 50, 30, 0.18), 0 4px 16px rgba(60, 50, 30, 0.1);
  /* 信纸横线纹理 */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 34px,
      rgba(80, 90, 130, 0.08) 34px,
      rgba(80, 90, 130, 0.08) 35px
    );
}

/* 信纸页边折叠阴影（左右） */
.page-inner::before,
.page-inner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, rgba(62, 58, 51, 0.06), transparent);
}
.page-inner::before { left: 0; }
.page-inner::after { right: 0; transform: scaleX(-1); }

/* 落款页信纸：无横线、居中 */
.page-inner--sign {
  background: var(--paper);
  background-image: none;
  text-align: center;
  max-width: 560px;
}

/* ── 信头 ── */
.letter-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 42px;
  padding-bottom: 26px;
  border-bottom: 1px dashed var(--line);
}
.seal-mark {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0503e 0%, var(--seal) 55%, var(--seal-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(126, 44, 33, 0.35), inset 0 2px 4px rgba(255,255,255,0.2);
}
.seal-mark::before {
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.55);
}
.seal-mark span {
  font-family: var(--kai);
  font-size: 22px;
  color: rgba(255, 244, 236, 0.95);
}
.letter-greeting {
  font-family: var(--kai);
  font-size: clamp(22px, 3.4vw, 28px);
  letter-spacing: 3px;
  color: var(--ink);
}
.letter-epigraph {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 4px;
}

/* ── 正文段落 ── */
.letter-paragraph {
  font-family: var(--handwrite);
  font-size: 17px;
  color: var(--ink-soft);
  text-indent: 2em;
  margin-bottom: 22px;
  line-height: 1.72;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   照片 · 贴纸与拍立得
   ═══════════════════════════════════════════ */

.photo {
  margin: 34px auto;
  width: min(300px, 86%);
  position: relative;
}
.photo--wide { width: min(380px, 88%); }

/* 拍立得：白边 + 轻微倾斜 */
.photo--polaroid .photo-frame {
  background: #fffdf6;
  padding: 10px 10px 38px;
  border-radius: 3px;
  box-shadow: 0 8px 22px rgba(62, 58, 51, 0.16);
  position: relative;
}
.photo--polaroid .photo-frame::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  height: 10px;
  background: rgba(62, 58, 51, 0.05);
}
.tilt-left  { transform: rotate(-2.2deg); }
.tilt-right { transform: rotate(2deg); }

/* 胶带贴纸照片 */
.photo--tape .photo-frame {
  position: relative;
  background: #fffdf6;
  padding: 8px;
  border-radius: 2px;
  box-shadow: 0 6px 16px rgba(62, 58, 51, 0.14);
  transform: rotate(-1.5deg);
}
.photo--tape .photo-frame::before,
.photo--tape .photo-frame::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 26px;
  background: rgba(214, 194, 148, 0.5);
  border-left: 1px dashed rgba(160, 140, 100, 0.35);
  border-right: 1px dashed rgba(160, 140, 100, 0.35);
}
.photo--tape .photo-frame::before { top: -10px; left: 50%; transform: translateX(-50%) rotate(-4deg); }
.photo--tape .photo-frame::after  { bottom: -10px; left: 50%; transform: translateX(-50%) rotate(3deg); }

/* 照片占位区域 */
.photo-frame { position: relative; }
.photo-placeholder {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(184, 150, 94, 0.16) 25%, transparent 25%, transparent 50%, rgba(184, 150, 94, 0.16) 50%, rgba(184, 150, 94, 0.16) 75%, transparent 75%),
    linear-gradient(45deg, #efe6cf 0%, #e5d9ba 100%);
  background-size: 22px 22px, 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.placeholder-hint {
  font-size: 13px;
  color: rgba(126, 103, 66, 0.75);
  letter-spacing: 2px;
  background: rgba(251, 247, 236, 0.85);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px dashed rgba(126, 103, 66, 0.4);
}
.photo-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  letter-spacing: 2px;
}

/* 双照片 */
.photo-duo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 20px 0 30px;
}
.photo-duo .photo {
  margin: 0;
  width: min(240px, 78%);
}

/* ═══════════════════════════════════════════
   落款 · 封印
   ═══════════════════════════════════════════ */

.signoff {
  text-align: center;
  position: relative;
}
.signoff-rule {
  width: 100px;
  height: 1px;
  margin: 0 auto 40px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.signoff-text {
  font-family: var(--kai);
  font-size: 18px;
  color: var(--ink-soft);
  letter-spacing: 3px;
  margin-bottom: 10px;
}
.signoff-name {
  margin-top: 34px;
}
.sign-name {
  font-family: var(--kai);
  font-size: 26px;
  color: var(--ink);
  letter-spacing: 5px;
}
.sign-date {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 3px;
}
.signoff-seal {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}
.wax-seal {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0503e 0%, var(--seal) 55%, var(--seal-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(126, 44, 33, 0.4), inset 0 2px 6px rgba(255,255,255,0.2);
  position: relative;
  animation: sealGlow 3s ease-in-out infinite;
}
@keyframes sealGlow {
  0%, 100% { box-shadow: 0 8px 22px rgba(126,44,33,0.4), inset 0 2px 6px rgba(255,255,255,0.2); }
  50%      { box-shadow: 0 10px 32px rgba(163,61,46,0.55), inset 0 2px 6px rgba(255,255,255,0.24); }
}
.wax-seal::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
}
.wax-seal span {
  font-family: var(--kai);
  font-size: 24px;
  color: rgba(255, 244, 236, 0.95);
  line-height: 1.15;
  letter-spacing: 2px;
}
.signoff-foot {
  margin-top: 40px;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 3px;
}

/* ═══════════════════════════════════════════
   结尾 · 光尘（分页最后一屏）
   ═══════════════════════════════════════════ */

.page--finale {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep) 0%, #2e2a22 100%);
  padding: 60px 20px;
}
.stardust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.finale-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #f2e8d2;
}
.finale-eyebrow {
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(242, 232, 210, 0.5);
  margin-bottom: 26px;
}
.finale-title {
  font-family: var(--kai);
  font-size: clamp(44px, 9vw, 84px);
  letter-spacing: 18px;
  text-indent: 18px;
  color: #f7efdd;
  text-shadow: 0 0 40px rgba(201, 169, 106, 0.35);
}
.finale-sub {
  margin-top: 24px;
  font-size: 16px;
  color: rgba(242, 232, 210, 0.66);
  letter-spacing: 4px;
}

/* ═══════════════════════════════════════════
   响应式 · 手机优先
   ═══════════════════════════════════════════ */

/* ── 中等屏（平板 / 大手机横屏） ── */
@media (max-width: 768px) {
  .cover-scene { gap: 20px; }
  .envelope { width: min(360px, 84vw); }
  .page { padding: 20px 14px; }
  .page-inner { padding: 34px 24px 42px; }
  .letter-paragraph { font-size: 15px; line-height: 2.05; }
  .chapter-nav { right: 12px; gap: 12px; }
}

/* ── 手机竖屏 ── */
@media (max-width: 640px) {
  .chapter-nav { right: 8px; gap: 11px; padding: 10px 6px; }
  .nav-dot { width: 7px; height: 7px; }
  .page { padding: 16px 12px; }
  .page-inner { padding: 28px 18px 36px; }
  .letter-paragraph { font-size: 15px; }
  .letter-greeting { font-size: 23px; }
  .seal-mark { width: 44px; height: 44px; }
  .seal-mark span { font-size: 18px; }
  .seal-mark::before { width: 36px; height: 36px; }
  .letter-head { margin-bottom: 28px; }
  .photo { width: min(230px, 88%); }
  .photo--wide { width: min(280px, 90%); }
  .photo-duo { flex-direction: column; align-items: center; }
  .photo-duo .photo { width: min(220px, 80%); }
  .signoff { margin-top: 0; }
  .wax-seal { width: 78px; height: 78px; }
  .wax-seal span { font-size: 20px; }
  .finale-title { letter-spacing: 12px; text-indent: 12px; }

  /* 封面 */
  .cover-scene { gap: 18px; padding: 18px; }
  .envelope { width: min(330px, 86vw); }
  .env-seal { width: 54px; height: 54px; }
  .seal-word { font-size: 22px; }
  .env-seal::before { inset: 5px; }
  .cover-title { font-size: clamp(24px, 7vw, 32px); letter-spacing: 9px; text-indent: 9px; }
  .cover-sub { font-size: 13px; letter-spacing: 4px; margin-top: -8px; }
  .cover-cta { padding: 13px 26px; font-size: 14px; letter-spacing: 3px; }

  /* 四角装饰 · 手机端紧凑 */
  .deco-mark { top: 16px; left: 16px; width: 32px; height: 32px; font-size: 14px; }
  .deco-topleft { top: 20px; left: 56px; }
  .deco-eyebrow { font-size: 9px; letter-spacing: 2.5px; }
  .deco-eyebrow-thin { display: none; }
  .deco-topright { top: 20px; right: 16px; gap: 6px; }
  .deco-num { font-size: 11px; letter-spacing: 3px; }
  .deco-num-line { width: 28px; }
  .deco-sub-en { display: none; }
  .deco-foot { bottom: 14px; right: 16px; font-size: 9px; letter-spacing: 3px; }

  /* 信纸横线纹理与移动端行距同步 */
  .page-inner {
    background-image:
      repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(80, 90, 130, 0.08) 31px,
        rgba(80, 90, 130, 0.08) 32px
      );
  }
}

/* ── 小屏手机 ── */
@media (max-width: 400px) {
  .envelope { width: min(300px, 90vw); }
  .page-inner { padding: 24px 14px 32px; }
  .letter-greeting { font-size: 21px; }
  .chapter-nav { right: 6px; gap: 10px; }
}

/* ── 触控友好：主按钮点击区域 ── */
@media (hover: none) {
  .cover-cta { min-height: 48px; }
  .nav-dot { min-width: 16px; min-height: 16px; display: flex; align-items: center; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .char { opacity: 1; transform: none; transition: none; }
  .env-seal { animation: none; }
  .wax-seal { animation: none; }
  .cover-title { animation: none; }
  .beam { animation: none !important; }
  .envelope .env-flap,
  .envelope .env-letter,
  .envelope .env-back,
  .envelope .env-front { transition: none; }
  html { scroll-behavior: auto; }
}
