/* ==========================================================================
   万圣夜 · 一封信   styles.css
   顺序：变量 → 背景 → HUD → 通用 → 封面 → 信 → 南瓜灯 → 糖果 → 相册
        → 回信 → 结尾 → 动效 → 响应式
   ========================================================================== */

/* ------------------------------ 1. 变量 ------------------------------ */
:root {
  --bg-0: #05030a;
  --bg-1: #0b0718;
  --bg-2: #17102c;

  --ink: #efe6da;
  --ink-2: #c9bcd4;
  --ink-3: #8e829f;

  --amber: #ffb26b;
  --amber-hot: #ff7a1a;
  --moon: #f7ead0;

  --line: rgba(239, 230, 218, .13);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ------------------------------ 2. 基础 ------------------------------ */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--serif);
  color: var(--ink);
  background: #05030a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

::selection { background: rgba(255, 150, 60, .3); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #07040e; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 170, 100, .16);
  border-radius: 99px;
  border: 3px solid #07040e;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 170, 100, .3); }

/* --------------------------- 3. 背景层 --------------------------- */
.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.moon {
  position: fixed;
  top: 8vh;
  right: 9vw;
  width: clamp(78px, 11vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 34%, #fffaf0 0%, var(--moon) 42%, #d9c9a4 72%, #b9a780 100%);
  box-shadow:
    0 0 60px 10px rgba(247, 234, 208, .18),
    0 0 160px 60px rgba(247, 234, 208, .09),
    0 0 320px 140px rgba(180, 140, 255, .06);
  opacity: .92;
}

.moon::after {
  content: "";
  position: absolute;
  inset: -140%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 234, 208, .1), transparent 62%);
  z-index: -1;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 整个页面的底色（月亮光晕 + 紫色雾气 + 竖向渐变） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 82% 6%, rgba(247, 234, 208, .09), transparent 62%),
    radial-gradient(720px 520px at 12% 78%, rgba(126, 74, 190, .16), transparent 66%),
    radial-gradient(1100px 700px at 50% 108%, rgba(255, 122, 26, .1), transparent 62%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, #04020a 100%);
}

/* ------------------------------ 4. HUD ------------------------------ */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: rgba(255, 255, 255, .04);
  pointer-events: none;
}

.progress i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #ff8a3d, #ffd08a 60%, #fff2d0);
  box-shadow: 0 0 12px rgba(255, 150, 60, .8);
}

.sound {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-2);
  background: rgba(22, 14, 38, .66);
  border: 1px solid rgba(255, 190, 120, .22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color .3s, border-color .3s, transform .3s;
}

.sound:hover { color: var(--amber); border-color: rgba(255, 190, 120, .5); transform: translateY(-2px); }
.sound:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.sound__note { font-family: var(--sans); font-size: 17px; line-height: 1; transform: translateY(-1px); }

.sound__ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 190, 120, .55);
  opacity: 0;
}

.sound[aria-pressed="true"] { color: var(--amber); border-color: rgba(255, 190, 120, .55); }
.sound[aria-pressed="true"] .sound__ring { animation: ring 2.4s var(--ease) infinite; }

/* 还没放歌时，右下角冒出来的小箭头 */
.sound.is-calling { animation: sound-call 2.4s ease-in-out infinite; }

@keyframes sound-call {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 90, .4); }
  65%      { box-shadow: 0 0 0 13px rgba(255, 170, 90, 0); }
}

.soundprompt {
  position: fixed;
  right: max(76px, calc(env(safe-area-inset-right) + 76px));
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 26px));
  z-index: 61;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .08em;
  color: var(--ink-2);
  background: rgba(22, 14, 38, .74);
  border: 1px solid rgba(255, 190, 120, .26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateX(12px) scale(.94);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.soundprompt.in { opacity: 1; transform: none; }

.soundprompt__arrow {
  color: var(--amber);
  font-size: 1.05rem;
  line-height: 1;
  animation: nudge 1.7s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); opacity: .7; }
  50%      { transform: translateX(5px); opacity: 1; }
}

@keyframes ring {
  0% { opacity: .7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.55); }
}

/* ------------------------------ 5. 通用 ------------------------------ */
main { position: relative; z-index: 1; }

.scene {
  position: relative;
  padding: clamp(72px, 13vh, 150px) 0;
}

.wrap {
  width: min(100% - 44px, 660px);
  margin: 0 auto;
}

.wrap--center { text-align: center; }

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 1.1vw + 1.1rem, 1.8rem);
  font-weight: 400;
  letter-spacing: .1em;
  color: #fdf4e6;
}

@keyframes title-swap {
  0%   { opacity: 1; filter: none; }
  42%  { opacity: 0; filter: blur(6px); }
  100% { opacity: 1; filter: none; }
}
.h2.swap { animation: title-swap .6s var(--ease); }

.lead {
  margin: 0 auto 34px;
  max-width: 30em;
  font-size: .95rem;
  line-height: 1.9;
  color: var(--ink-3);
}

.btn {
  --glow: 0;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .86em 2em;
  font-family: var(--sans);
  font-size: .95rem;
  letter-spacing: .18em;
  color: #ffe9cd;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255, 190, 120, .32);
  background: linear-gradient(180deg, rgba(255, 175, 95, .16), rgba(255, 110, 30, .07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 8px 28px -14px rgba(255, 130, 40, calc(.5 + var(--glow)));
  transition: transform .35s var(--ease), box-shadow .35s var(--ease),
              border-color .35s, background .35s;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 210, 150, .62);
  background: linear-gradient(180deg, rgba(255, 185, 110, .26), rgba(255, 110, 30, .12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 14px 40px -12px rgba(255, 130, 40, .75);
}

.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

.btn--sm { padding: .62em 1.4em; font-size: .84rem; letter-spacing: .12em; }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
  box-shadow: none;
}
.btn--ghost:hover { color: var(--ink); border-color: rgba(239, 230, 218, .3); box-shadow: none; }

.btn--glow { animation: breathe 4.5s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 8px 28px -14px rgba(255,130,40,.45), 0 0 0 0 rgba(255,160,80,.22); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 14px 40px -12px rgba(255,130,40,.7), 0 0 0 9px rgba(255,160,80,0); }
}

/* ------------------------------ 6. 封面 ------------------------------ */
.scene--cover {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 0 0 26vh;
  overflow: hidden;
}

.cover__wrap {
  position: relative;
  z-index: 2;
  width: min(100% - 44px, 720px);
  text-align: center;
  animation: rise-in 1.4s var(--ease) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.cover__to {
  margin: 0 0 10px;
  font-size: .9rem;
  letter-spacing: .4em;
  color: var(--amber);
  opacity: .85;
}

.cover__title {
  margin: 0 0 26px;
  font-size: clamp(2.1rem, 5.6vw, 3.7rem);
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: .06em;
  color: #fdf6ea;
  text-shadow: 0 0 60px rgba(255, 200, 140, .18);
}

.cover__title span { display: block; }

.cover__title .hl {
  background: linear-gradient(180deg, #ffe6bb 8%, #ffae5c 55%, #ff7a1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 140, 50, .45));
}

.cover__sub {
  margin: 0 auto 34px;
  max-width: 26em;
  font-size: clamp(.9rem, .5vw + .82rem, 1.02rem);
  line-height: 2;
  color: var(--ink-2);
  opacity: .82;
}

.cover__hint {
  margin: 22px 0 0;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .22em;
  color: var(--ink-3);
  opacity: .7;
}

.cover__pumpkin {
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: clamp(190px, 27vw, 320px);
  transform: translateX(-50%);
  z-index: 3;
  opacity: .95;
  pointer-events: none;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .8));
  /* 底部融进黑夜，免得被 section 边缘硬切 */
  -webkit-mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, .45) 82%, transparent 99%);
  mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, .45) 82%, transparent 99%);
  transition: filter 1.6s var(--ease), opacity 1.6s var(--ease), transform 1.6s var(--ease);
}

.cover__pumpkin svg { width: 100%; height: auto; display: block; }

.is-lit .cover__pumpkin,
.cover__pumpkin.is-lit {
  filter:
    drop-shadow(0 30px 60px rgba(0, 0, 0, .7))
    drop-shadow(0 0 70px rgba(255, 140, 50, .45));
}

.cover__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22vh;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(6, 3, 12, .5) 48%, var(--bg-0) 98%);
}

.scroll-cue { display: none; }

/* ------------------------------ 7. 信纸 ------------------------------ */
.scene--letter { padding-top: clamp(60px, 10vh, 120px); }

.paper {
  position: relative;
  padding: clamp(30px, 5.4vw, 60px) clamp(24px, 5vw, 56px) clamp(76px, 8.5vw, 96px);
  border-radius: 20px;
  border: 1px solid rgba(255, 190, 120, .14);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 170, 90, .08), transparent 60%),
    linear-gradient(175deg, rgba(30, 20, 48, .82), rgba(12, 8, 22, .9));
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 信纸上的细纹理 */
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .28;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, .014) 0 1px,
    transparent 1px 4px
  );
}

.paper__to {
  margin: 0 0 26px;
  font-size: 1.02rem;
  letter-spacing: .16em;
  color: var(--amber);
  opacity: .9;
}

.paper__body > * + * { margin-top: 1.7em; }

.paper__body p {
  margin: 0;
  font-size: clamp(1rem, .45vw + .9rem, 1.1rem);
  line-height: 2.1;
  letter-spacing: .03em;
  color: #e6dccd;
  text-align: justify;
  text-justify: inter-ideograph;
  text-indent: 2em;
}

.paper__body p + p { margin-top: 1.15em; }

.paper__body .quote { text-indent: 0; }

.paper__body .quote {
  margin: 2em auto;
  max-width: 22em;
  padding: 0;
  border: 0;
  text-align: center;
  font-size: clamp(1.05rem, .6vw + .9rem, 1.2rem);
  line-height: 2;
  letter-spacing: .12em;
  color: #ffe3bd;
  text-shadow: 0 0 34px rgba(255, 160, 70, .35);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 40px;
  margin: 2.1em 0 !important;
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  max-width: 90px;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 120, .4), transparent);
}

.rule span {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: rgba(255, 190, 120, .75);
  box-shadow: 0 0 14px rgba(255, 160, 80, .8);
}

.paper__sign {
  margin: 2.6em 0 0;
  text-align: right;
  font-size: .98rem;
  letter-spacing: .1em;
  color: var(--ink-2);
  opacity: .9;
}

.paper__seal {
  position: absolute;
  right: clamp(18px, 4vw, 40px);
  bottom: clamp(14px, 3vw, 28px);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.15rem;
  color: rgba(255, 226, 190, .9);
  background: radial-gradient(circle at 35% 30%, #a33f1c, #6a1f0c 62%, #3d1105);
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, .5),
    inset 0 2px 5px rgba(255, 200, 150, .35),
    0 6px 18px -6px rgba(0, 0, 0, .9);
  opacity: .9;
  transition: transform .6s var(--ease);
}

.paper__seal::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 210, 170, .35);
}

.paper:hover .paper__seal { transform: rotate(-8deg) scale(1.04); }

/* ---------------------------- 8. 南瓜灯 ---------------------------- */
.lantern__btn {
  position: relative;
  display: block;
  width: clamp(190px, 30vw, 280px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .75));
  transition: transform .8s var(--ease), filter 1.2s var(--ease);
}

.lantern__btn:hover { transform: translateY(-6px); }
.lantern__btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 12px; border-radius: 24px; }

.lantern__pumpkin { display: block; }
.lantern__pumpkin svg { width: 100%; height: auto; display: block; }

.lantern__glow {
  position: absolute;
  inset: -30% -20% -10%;
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(circle at 50% 60%, rgba(255, 150, 60, .55), rgba(255, 120, 40, .12) 45%, transparent 70%);
  transition: opacity 1.6s var(--ease);
}

.lantern__btn.is-lit { filter: drop-shadow(0 24px 40px rgba(0,0,0,.7)) drop-shadow(0 0 50px rgba(255, 140, 50, .4)); }
.lantern__btn.is-lit .lantern__glow { opacity: 1; animation: glow-pulse 5s ease-in-out infinite; }

@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.lantern__after {
  min-height: 3em;
  margin: 30px auto 0;
  max-width: 26em;
  font-size: .98rem;
  line-height: 1.95;
  letter-spacing: .05em;
  color: #ffd9ae;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.4s var(--ease) .25s, transform 1.4s var(--ease) .25s;
}

.lantern__after.show { opacity: .95; transform: none; }

/* 刻出来的笑脸：暗着的时候是黑洞，点亮后透出暖光 */
.pk-face {
  fill: #2a1002;
  transition: fill 1.4s var(--ease), filter 1.4s var(--ease);
}

.scene--cover.is-lit .pk-face,
.lantern__btn.is-lit .pk-face {
  fill: #ffe7ae;
  filter: drop-shadow(0 0 10px rgba(255, 180, 90, .95));
}

/* 空着回信就摇一下 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.reply__text.shake { animation: shake .45s ease; }

/* 火花粒子（点亮时） */
.spark {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  background: #ffd28a;
  box-shadow: 0 0 10px 2px rgba(255, 170, 80, .9);
  animation: spark-fly var(--dur, 1.4s) var(--ease) forwards;
}

@keyframes spark-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); }
}

/* ----------------------------- 9. 糖果 ----------------------------- */
.candy__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 300px;
  justify-content: center;
}

.candy__jar {
  position: relative;
  width: 150px;
  height: 166px;
  margin-bottom: 6px;
  transition: transform .5s var(--ease);
}

.candy__jar:hover { transform: translateY(-4px) rotate(-1.5deg); }

.candy__lid {
  position: absolute;
  left: 50%;
  top: 0;
  width: 88px;
  height: 17px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: linear-gradient(180deg, #c1905e, #7a4f2b);
  box-shadow: inset 0 1px 0 rgba(255, 230, 200, .5);
}

.candy__lid::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 28px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #d3a271, #8a5c33);
}

.candy__body {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 132px;
  height: 148px;
  transform: translateX(-50%);
  border-radius: 18px 18px 28px 28px;
  border: 1px solid rgba(255, 240, 220, .28);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 42%, transparent 70%),
    linear-gradient(180deg, rgba(120, 90, 170, .22), rgba(60, 40, 100, .18));
  box-shadow:
    inset 0 0 24px rgba(255, 220, 255, .12),
    inset 0 -10px 20px rgba(0, 0, 0, .25),
    0 20px 40px -20px rgba(0, 0, 0, .9);
  backdrop-filter: blur(2px);
}

.candy__body::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 16px;
  height: 62%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent);
  filter: blur(3px);
}

.candy__sweet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 25px;
  height: 25px;
  border-radius: 50% 50% 46% 54% / 54% 46% 50% 50%;
  background: radial-gradient(circle at 32% 28%, #fff8, transparent 55%), var(--c);
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .7), 0 0 14px -2px var(--c);
  animation: float-y 5s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes float-y {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(2px, -5px) rotate(12deg); }
}

.candy__note {
  margin: 6px 0 0;
  min-height: 4.6em;
  max-width: 24em;
  font-size: clamp(.98rem, .5vw + .88rem, 1.08rem);
  line-height: 2;
  letter-spacing: .06em;
  color: #ffe6c6;
  opacity: .95;
}

.candy__note.pop { animation: note-pop .7s var(--ease); }

@keyframes note-pop {
  0%   { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(4px); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.01); filter: none; }
  100% { opacity: .95; transform: none; }
}

.candy__count {
  margin: 20px 0 0;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .2em;
  color: var(--ink-3);
  opacity: .65;
}

.scene--candy .btn { margin-top: 26px; }

/* ----------------------------- 10. 相册 ----------------------------- */
.photos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.photos__grid figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.photos__grid img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }

.photos__grid figcaption {
  padding: 9px 11px;
  font-size: .78rem;
  color: var(--ink-3);
}

/* ----------------------------- 11. 回信 ----------------------------- */
.reply__box {
  border-radius: 16px;
  border: 1px solid rgba(255, 190, 120, .16);
  background: linear-gradient(175deg, rgba(28, 18, 46, .8), rgba(12, 8, 22, .9));
  box-shadow: 0 30px 70px -40px #000, inset 0 1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
  transition: border-color .4s, box-shadow .4s;
}

.reply__box:focus-within {
  border-color: rgba(255, 200, 140, .45);
  box-shadow: 0 30px 70px -40px #000, 0 0 46px -14px rgba(255, 150, 60, .55);
}

.reply__text {
  display: block;
  width: 100%;
  min-height: 148px;
  padding: 22px 24px 8px;
  border: 0;
  resize: vertical;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 2;
  letter-spacing: .04em;
  color: var(--ink);
  background: transparent;
  outline: none;
}

.reply__text::placeholder { color: rgba(200, 188, 212, .35); }

.reply__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.reply__count {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--ink-3);
  opacity: .7;
}

.reply__acts { display: flex; flex-wrap: wrap; gap: 10px; }

.reply__err {
  display: none;
  margin: 0;
  padding: 0 clamp(16px, 3vw, 24px) 16px;
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.85;
  color: #ff9b78;
}

.reply__err.show { display: block; }

.reply__sealed {
  margin-top: 8px;
  padding: 34px 24px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed rgba(255, 190, 120, .26);
  background: radial-gradient(80% 100% at 50% 0%, rgba(255, 160, 80, .09), transparent 70%);
  animation: rise-in .9s var(--ease) both;
}

.reply__sealed[hidden] { display: none; }

.reply__envelope {
  display: block;
  width: 124px;
  height: auto;
  margin: 0 auto 22px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .6));
  transform: rotate(-2deg);
}

.reply__sealedTitle {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: .12em;
  color: #ffe4c2;
}

.reply__sealedHint {
  margin: 0 0 24px;
  font-size: .84rem;
  line-height: 1.9;
  color: var(--ink-3);
}

.reply__sealed .reply__acts { justify-content: center; }

/* ----------------------------- 12. 结尾 ----------------------------- */
.scene--end {
  padding-bottom: clamp(90px, 16vh, 190px);
  text-align: center;
}

.end__line {
  margin: 0 0 22px;
  font-size: clamp(1.5rem, 2.4vw + .9rem, 2.4rem);
  line-height: 1.7;
  letter-spacing: .14em;
  color: #fff3e2;
  text-shadow: 0 0 70px rgba(255, 170, 90, .35);
}

.end__footer {
  margin: 0 0 40px;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: .6;
}

.end__top {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .2em;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color .3s, border-color .3s;
}

.end__top:hover { color: var(--amber); border-color: rgba(255, 190, 120, .5); }

/* --------------------------- 13. 滚动显影 --------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(5px);
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease),
    filter 1.1s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}

.reveal.is-in { opacity: 1; transform: none; filter: none; }

/* --------------------------- 14. noscript --------------------------- */
.noscript {
  position: relative;
  z-index: 10;
  margin: 40px auto;
  max-width: 30em;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 190, 120, .3);
  background: rgba(20, 12, 34, .9);
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1.9;
  text-align: center;
  color: var(--ink-2);
}

/* --------------------------- 15. 响应式 --------------------------- */
@media (max-width: 640px) {
  .scene--cover { padding-bottom: 15vh; }
  .cover__pumpkin { bottom: 0; width: clamp(180px, 52vw, 240px); }
  .moon { top: 5vh; right: 6vw; }
  .wrap { width: calc(100% - 32px); }
  .cover__title { letter-spacing: .04em; }
  /* 信很长，手机上别用 backdrop-filter 糊一大片，滚动会掉帧 */
  .paper {
    border-radius: 16px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background:
      radial-gradient(120% 80% at 50% -10%, rgba(255, 170, 90, .07), transparent 60%),
      linear-gradient(175deg, rgba(28, 19, 45, .95), rgba(11, 7, 20, .97));
  }
  .paper__body p { text-align: left; }
  .candy__stage { min-height: 270px; }
  .sound { width: 42px; height: 42px; }
}

@media (max-width: 380px) {
  .btn { padding: .8em 1.5em; letter-spacing: .12em; }
  .cover__title { font-size: 1.95rem; }
}

/* 大屏时信纸稍微宽一点，读起来更舒服 */
@media (min-width: 1100px) {
  .wrap { width: min(100% - 44px, 700px); }
}

/* ------------------------ 16. 减少动态效果 ------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .sky { display: none; }
}
