/* ===========================================================
   《我藏了十二件小事》 — 一间暖光的房间，一柜抽屉
   =========================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --ink: #f7e9d5;
  --ink-2: rgba(247, 233, 213, .68);
  --ink-3: rgba(247, 233, 213, .42);
  --bg: #120d0a;
  --wood-hi: #5b3d28;
  --wood-md: #3b2515;
  --wood-lo: #241609;
  --brass: #d8b271;
  --brass-hi: #f2dcaa;
  --brass-lo: #8a6630;
  --glow: #ffb765;
  --glow-hi: #ffe6bf;
  --paper: #f6ecd9;
  --paper-ink: #3a2a19;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .78, .2, 1);
}

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }

/* ---------- 房间的氛围层 ---------- */

.room {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #3a2413 0%, #1e1410 42%, #120d0a 78%),
    var(--bg);
}

.room__light {
  position: absolute;
  left: 50%;
  top: -14%;
  width: min(140vw, 1100px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 50%, rgba(255, 170, 90, .30) 0%, rgba(255, 150, 70, .13) 32%, rgba(255, 140, 60, 0) 66%);
  animation: breathe 11s ease-in-out infinite;
}

.room__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .55) 100%);
}

.room__grain {
  position: absolute;
  inset: -50%;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  animation: grain 1.4s steps(3) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

@keyframes breathe {
  0%, 100% { opacity: .82; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.motes { position: absolute; inset: 0; }

.mote {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 184, .95), rgba(255, 180, 110, 0));
  animation: drift linear infinite;
  opacity: 0;
}

@keyframes drift {
  0% { opacity: 0; transform: translate3d(0, 14px, 0) scale(.7); }
  12% { opacity: .85; }
  70% { opacity: .5; }
  100% { opacity: 0; transform: translate3d(var(--dx, 10px), -70vh, 0) scale(1.1); }
}

/* ---------- 舞台 ---------- */

.stage { position: relative; z-index: 1; }

/* ---------- 封面 ---------- */

.cover {
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(32px, 9vh, 80px) 22px clamp(40px, 8vh, 72px);
  gap: 0;
}

.cover__eyebrow {
  margin: 0 0 clamp(18px, 4vh, 30px);
  font-size: 11px;
  letter-spacing: .62em;
  text-indent: .62em;
  color: rgba(232, 196, 148, .72);
  animation: riseIn .9s var(--ease) both;
}

.cover__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.95rem, 8.4vw, 3.7rem);
  line-height: 1.42;
  letter-spacing: .04em;
  color: #fbeee0;
  text-shadow: 0 0 42px rgba(255, 170, 95, .22);
  animation: riseIn 1.1s var(--ease) .08s both;
}

.cover__title .hl {
  position: relative;
  display: inline-block;
  padding: 0 .06em;
  color: var(--glow-hi);
}

.cover__title .hl::after {
  content: "";
  position: absolute;
  left: .02em;
  right: .02em;
  bottom: .08em;
  height: .42em;
  background: linear-gradient(90deg, rgba(255, 178, 96, 0), rgba(255, 178, 96, .34), rgba(255, 178, 96, 0));
  border-radius: 50%;
  z-index: -1;
}

.cover__lede {
  margin: clamp(20px, 3.6vh, 30px) 0 0;
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.9vw, 1.12rem);
  line-height: 2.05;
  letter-spacing: .06em;
  color: var(--ink-2);
  animation: riseIn 1.1s var(--ease) .2s both;
}

.namefield {
  display: inline-flex;
  align-items: baseline;
  gap: .5em;
  margin: clamp(26px, 4.4vh, 38px) 0 0;
  font-family: var(--serif);
  font-size: clamp(.92rem, 3.7vw, 1.05rem);
  color: var(--ink-2);
  letter-spacing: .08em;
  animation: riseIn 1.1s var(--ease) .32s both;
}

.namefield__name {
  display: inline-block;
  min-width: 2.4em;
  padding: 0 6px 4px;
  border-bottom: 1px dashed rgba(216, 178, 113, .55);
  color: var(--glow-hi);
  font-family: var(--serif);
  font-size: 1.12em;
  letter-spacing: .12em;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 178, 96, .5);
}

.brass-btn {
  position: relative;
  margin-top: clamp(30px, 5vh, 44px);
  min-height: 50px;
  padding: 0 2.1em;
  border: 1px solid rgba(90, 60, 20, .8);
  border-radius: 3px;
  background: linear-gradient(180deg, #f0d9a6 0%, #d8b271 38%, #b78c4a 100%);
  color: #2c1c08;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .34em;
  text-indent: .34em;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 246, 220, .8) inset,
    0 -2px 0 rgba(90, 60, 20, .35) inset,
    0 10px 26px -8px rgba(255, 160, 80, .45),
    0 2px 6px rgba(0, 0, 0, .5);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), filter .35s var(--ease);
  animation: riseIn 1.1s var(--ease) .44s both;
  -webkit-tap-highlight-color: transparent;
}

.brass-btn:hover { filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255,246,220,.9) inset, 0 -2px 0 rgba(90,60,20,.35) inset, 0 14px 32px -8px rgba(255,170,90,.6), 0 3px 8px rgba(0,0,0,.5); }
.brass-btn:active { transform: translateY(2px) scale(.995); }
.brass-btn:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 4px; }
.brass-btn--wide { width: min(100%, 320px); margin-top: 34px; }

.cover__tiny {
  margin: clamp(24px, 4vh, 34px) 0 0;
  font-size: 11px;
  letter-spacing: .38em;
  text-indent: .38em;
  color: rgba(247, 233, 213, .3);
  animation: riseIn 1.1s var(--ease) .56s both;
}

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

/* ---------- 柜子 ---------- */

.hall {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(46px, 8vh, 66px) 16px clamp(110px, 15vh, 132px);
  animation: riseIn .85s var(--ease) both;
}

.back-btn {
  position: absolute;
  top: clamp(6px, 1.6vh, 14px);
  left: 12px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(216, 178, 113, .22);
  border-radius: 999px;
  background: rgba(20, 14, 10, .5);
  color: rgba(247, 233, 213, .6);
  font-size: 11px;
  letter-spacing: .16em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .3s, border-color .3s, background .3s;
}

.back-btn:hover { color: rgba(255, 226, 186, .95); border-color: rgba(216, 178, 113, .5); background: rgba(40, 26, 16, .7); }
.back-btn:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 2px; }

.hall__head { text-align: center; margin-bottom: clamp(20px, 3.6vh, 30px); }

.hall__kicker {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .58em;
  text-indent: .58em;
  color: rgba(232, 196, 148, .6);
}

.hall__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 5.6vw, 1.75rem);
  letter-spacing: .16em;
  text-indent: .16em;
  color: #f7e7d2;
}

.progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.dots { display: flex; gap: 7px; }

.dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 214, 160, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 160, .22);
  transition: background .6s var(--ease), box-shadow .6s var(--ease), transform .6s var(--ease);
}

.dots i.on {
  background: var(--glow-hi);
  box-shadow: 0 0 10px rgba(255, 180, 100, .9), 0 0 22px rgba(255, 150, 60, .5);
  transform: scale(1.18);
}

.progress__text {
  margin: 0;
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(247, 233, 213, .4);
}

.progress__text b { color: rgba(255, 214, 160, .92); font-weight: 600; letter-spacing: .1em; }

.cabinet { display: flex; justify-content: center; }

.cabinet__body {
  position: relative;
  width: 100%;
  padding: 16px 14px 18px;
  border: 1px solid #150c04;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 214, 168, .16), rgba(255, 214, 168, 0) 8%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, .10) 0 2px, rgba(255, 210, 160, .025) 2px 5px, rgba(0, 0, 0, 0) 5px 11px),
    linear-gradient(180deg, #61422c 0%, #4a2f1c 26%, #33200f 68%, #26170a 100%);
  box-shadow:
    0 1px 0 rgba(255, 224, 184, .22) inset,
    0 -4px 0 rgba(0, 0, 0, .45) inset,
    0 26px 54px -18px rgba(0, 0, 0, .9),
    0 0 100px rgba(255, 150, 70, .12);
}

.cabinet__plaque {
  margin: 2px auto 14px;
  padding: 7px 10px 6px;
  width: fit-content;
  max-width: 100%;
  border-radius: 2px;
  border: 1px solid rgba(70, 46, 16, .85);
  background: linear-gradient(180deg, #e9cd92, #c8a163 55%, #a67f44);
  color: #40300f;
  font-family: var(--serif);
  font-size: clamp(8.5px, 2.5vw, 10px);
  letter-spacing: .3em;
  text-indent: .3em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 0 rgba(255, 246, 215, .75) inset, 0 -1px 0 rgba(80, 55, 20, .5) inset, 0 3px 8px rgba(0, 0, 0, .45);
}

.cabinet__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 1.8vw, 11px);
}

/* ---------- 抽屉 ---------- */

.drawer {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 700px;
  -webkit-tap-highlight-color: transparent;
}

.drawer__face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, .55);
  background:
    linear-gradient(180deg, rgba(255, 226, 188, .12), rgba(0, 0, 0, 0) 42%),
    repeating-linear-gradient(88deg, rgba(0, 0, 0, .085) 0 1px, rgba(255, 210, 160, .03) 1px 4px, rgba(0, 0, 0, 0) 4px 9px),
    linear-gradient(180deg, #4f3421 0%, #38230f 55%, #2a1a0c 100%);
  box-shadow:
    0 1px 0 rgba(255, 226, 185, .16) inset,
    0 -2px 5px rgba(0, 0, 0, .5) inset,
    0 2px 0 #170e05,
    0 6px 12px -4px rgba(0, 0, 0, .6);
  transition: transform .5s var(--ease), box-shadow .55s var(--ease), background .7s var(--ease), border-color .5s;
  transform: translateZ(0);
}

.drawer:hover .drawer__face,
.drawer:focus-visible .drawer__face {
  transform: translateY(-2px) translateZ(12px);
  box-shadow:
    0 1px 0 rgba(255, 232, 195, .3) inset,
    0 -2px 5px rgba(0, 0, 0, .45) inset,
    0 3px 0 #170e05,
    0 12px 20px -6px rgba(0, 0, 0, .7),
    0 0 24px rgba(255, 165, 85, .18);
}

.drawer:focus-visible { outline: 2px solid rgba(255, 210, 150, .8); outline-offset: 3px; border-radius: 3px; }

.drawer__num {
  position: absolute;
  top: 8px;
  left: 9px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255, 220, 178, .42);
  transition: color .5s, opacity .5s;
}

.drawer__handle {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  width: 26px;
  max-width: 34%;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f4dcae 0%, #b48b4b 55%, #7a5723 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(60, 40, 12, .7);
  transition: background .5s, box-shadow .5s;
}

.drawer__mini {
  position: absolute;
  inset: 19% 16% 26%;
  display: block;
  color: #6b3d18;
  opacity: 0;
  transform: scale(.86) translateY(4px);
  transition: opacity .55s var(--ease), transform .6s var(--ease);
}

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

.drawer.is-lit .drawer__face {
  border-color: rgba(255, 206, 150, .45);
  background:
    radial-gradient(115% 100% at 50% 26%, #fff1d8 0%, #ffd9a5 34%, #e8a862 68%, #b96f33 100%);
  box-shadow:
    0 0 0 1px rgba(255, 226, 184, .35) inset,
    0 0 20px rgba(255, 190, 120, .75) inset,
    0 2px 0 #170e05,
    0 10px 24px -6px rgba(0, 0, 0, .55),
    0 0 34px rgba(255, 160, 70, .45);
}

.drawer.is-lit .drawer__num { color: rgba(90, 52, 20, .78); }
.drawer.is-lit .drawer__handle {
  background: linear-gradient(180deg, #8d5f2b, #5f3c15);
  box-shadow: 0 1px 1px rgba(255, 240, 210, .5), 0 0 6px rgba(120, 70, 25, .6);
}
.drawer.is-lit .drawer__mini { opacity: 1; transform: scale(1) translateY(0); }

.drawer.is-just-lit .drawer__face { animation: drawerFlash 1.2s var(--ease); }

@keyframes drawerFlash {
  0% { filter: brightness(2.1); }
  40% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}

.drawer.is-hint::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 208, 154, .6), 0 0 26px rgba(255, 172, 92, .5);
  animation: hintPulse 2.8s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: .18; }
  50% { opacity: .92; }
}

.cabinet__body.is-full {
  box-shadow:
    0 1px 0 rgba(255, 224, 184, .28) inset,
    0 -4px 0 rgba(0, 0, 0, .45) inset,
    0 26px 54px -18px rgba(0, 0, 0, .9),
    0 0 130px rgba(255, 160, 75, .3);
}

.cabinet__body.is-full .cabinet__plaque {
  box-shadow: 0 1px 0 rgba(255, 246, 215, .8) inset, 0 -1px 0 rgba(80, 55, 20, .5) inset, 0 3px 8px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 190, 110, .55);
}

.hall__note {
  margin: 26px auto 0;
  max-width: 30em;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(.85rem, 3.4vw, .95rem);
  line-height: 1.95;
  letter-spacing: .07em;
  color: rgba(247, 233, 213, .46);
}

.hall__note.is-fin {
  color: rgba(255, 214, 160, .8);
}

.hall__actions { display: flex; justify-content: center; }

/* ---------- 抽屉卡片 ---------- */

.specimen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.specimen__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 3, .72);
  -webkit-backdrop-filter: blur(7px) saturate(.8);
  backdrop-filter: blur(7px) saturate(.8);
  animation: fadeIn .45s var(--ease) both;
}

.specimen__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  padding: clamp(22px, 6vw, 32px) clamp(20px, 5.5vw, 30px) clamp(20px, 5vw, 26px);
  border: 1px solid rgba(214, 174, 112, .38);
  border-radius: 5px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 178, 104, .16) 0%, rgba(255, 150, 70, 0) 62%),
    linear-gradient(180deg, #241811 0%, #1a110b 55%, #140d08 100%);
  box-shadow:
    0 1px 0 rgba(255, 222, 180, .22) inset,
    0 0 0 1px rgba(0, 0, 0, .5),
    0 40px 80px -24px rgba(0, 0, 0, .95),
    0 0 70px rgba(255, 150, 70, .14);
  animation: cardIn .55s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.specimen__x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(247, 233, 213, .5);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .25s, background .25s;
}

.specimen__x:hover { color: var(--glow-hi); background: rgba(216, 178, 113, .12); }
.specimen__x:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 1px; }

.specimen__index {
  margin: 0;
  font-size: 10px;
  letter-spacing: .52em;
  text-indent: .52em;
  color: rgba(226, 184, 128, .72);
  text-align: center;
}

.specimen__art {
  height: clamp(126px, 27vh, 186px);
  margin: 6px auto 4px;
  display: grid;
  place-items: center;
  color: #ffcf95;
  filter: drop-shadow(0 0 22px rgba(255, 170, 90, .35));
}

.specimen__art svg {
  width: auto;
  height: 100%;
  max-width: 78%;
  display: block;
  overflow: visible;
}

.specimen__art svg .draw {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawLine 1.5s var(--ease) .12s forwards;
}

@keyframes drawLine { to { stroke-dashoffset: 0; } }

.specimen__title {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 6vw, 1.6rem);
  letter-spacing: .14em;
  text-indent: .14em;
  text-align: center;
  color: #fbeada;
}

.specimen__text {
  margin: 16px 0 0;
  min-height: 4.1em;
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.9vw, 1.02rem);
  line-height: 2.05;
  letter-spacing: .05em;
  text-align: center;
  color: rgba(247, 233, 213, .82);
}

.specimen__text .ch { opacity: 0; animation: charIn .5s var(--ease) forwards; }
.specimen__text .nl { display: block; height: .2em; }

@keyframes charIn {
  from { opacity: 0; transform: translateY(4px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.specimen__close {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  border: 1px solid rgba(214, 174, 112, .45);
  border-radius: 3px;
  background: rgba(216, 178, 113, .07);
  color: rgba(255, 226, 186, .92);
  font-size: 13px;
  letter-spacing: .34em;
  text-indent: .34em;
  cursor: pointer;
  transition: background .3s, border-color .3s, color .3s, transform .25s;
  -webkit-tap-highlight-color: transparent;
}

.specimen__close:hover { background: rgba(216, 178, 113, .16); border-color: rgba(232, 196, 148, .75); }
.specimen__close:active { transform: translateY(1px); }
.specimen__close:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 3px; }

/* ---------- 猜一猜 ---------- */

.guess {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(214, 174, 112, .16);
}

.guess__q {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.9vw, 1.02rem);
  line-height: 1.8;
  letter-spacing: .05em;
  color: rgba(255, 214, 160, .94);
}

.guess__opts { display: grid; gap: 9px; }

.guess__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(214, 174, 112, .3);
  border-radius: 3px;
  background: rgba(216, 178, 113, .05);
  color: rgba(247, 233, 213, .86);
  font-family: var(--serif);
  font-size: clamp(.9rem, 3.7vw, .98rem);
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .25s, border-color .25s, color .25s, transform .2s;
}

.guess__opt:hover:not(:disabled) { background: rgba(216, 178, 113, .13); border-color: rgba(232, 196, 148, .6); }
.guess__opt:active:not(:disabled) { transform: translateY(1px); }
.guess__opt:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 2px; }
.guess__opt:disabled { cursor: default; }

.guess__key {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 178, 113, .4);
  border-radius: 50%;
  font-size: 11px;
  letter-spacing: 0;
  color: rgba(255, 214, 160, .8);
}

.guess__label { min-width: 0; }

.guess__opt.is-right {
  border-color: rgba(232, 196, 148, .85);
  background: rgba(255, 190, 110, .16);
  color: #fff1dc;
}

.guess__opt.is-right .guess__key { border-color: rgba(255, 214, 160, .9); color: #ffe2b6; }

.guess__opt.is-wrong {
  border-color: rgba(186, 116, 86, .5);
  background: rgba(140, 70, 50, .15);
  color: rgba(247, 233, 213, .58);
}

.guess__res { margin-top: 14px; animation: resIn .5s var(--ease) both; }

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

.guess__verdict {
  margin: 0 0 8px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
}

.guess__verdict.is-right { color: #ffd9a2; }
.guess__verdict.is-wrong { color: rgba(247, 233, 213, .5); }

.guess__reveal {
  font-family: var(--serif);
  font-size: clamp(.92rem, 3.8vw, 1rem);
  line-height: 2;
  letter-spacing: .05em;
  color: rgba(255, 229, 198, .9);
}

.guess__reveal p { margin: 0 0 .45em; }
.guess__reveal p:last-child { margin-bottom: 0; }

.extra__debt { display: block; margin: .6em auto 0; max-width: 24em; text-align: left; }

/* ---------- 结尾 ---------- */

.finale {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 7vh, 64px) 18px calc(48px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 85% at 50% 0%, #4a2c14 0%, #241508 44%, #0c0703 100%);
  animation: fadeIn .8s var(--ease) both;
}

.finale__sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.star {
  position: absolute;
  border-radius: 50%;
  background: #ffe7c4;
  animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: .18; transform: scale(.8); }
  50% { opacity: .95; transform: scale(1.15); }
}

.finale__glow {
  position: absolute;
  left: 50%;
  top: -30%;
  width: min(150vw, 900px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 190, 120, .26), rgba(255, 150, 70, 0) 62%);
  pointer-events: none;
}

.letter {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  padding: clamp(28px, 7vw, 46px) clamp(24px, 6.6vw, 44px);
  border-radius: 2px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%),
    linear-gradient(178deg, #f8efdd 0%, #f2e5cd 55%, #e9d9bd 100%);
  color: var(--paper-ink);
  box-shadow:
    0 0 0 1px rgba(255, 244, 222, .6) inset,
    0 40px 70px -30px rgba(0, 0, 0, .95),
    0 0 90px rgba(255, 170, 90, .18);
  transform-origin: 50% 0;
  animation: paperUp 1.5s var(--ease) both;
}

.letter::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 90, 45, .035) 0 1px, rgba(0, 0, 0, 0) 1px 26px);
  border-radius: 2px;
}

@keyframes paperUp {
  from { opacity: 0; transform: translateY(60px) rotateX(-12deg) scale(.97); }
  to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.letter__to {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 4.3vw, 1.2rem);
  letter-spacing: .12em;
  color: #3a2a19;
  opacity: 0;
  animation: lineIn .9s var(--ease) .9s forwards;
}

.letter__body p {
  margin: 0 0 1.15em;
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.9vw, 1.02rem);
  line-height: 2.15;
  letter-spacing: .045em;
  color: #45321d;
  opacity: 0;
  animation: lineIn 1.1s var(--ease) forwards;
  animation-delay: var(--d, 1.6s);
}

.letter__body p.strong {
  color: #2f2011;
  font-size: clamp(1rem, 4.2vw, 1.1rem);
  letter-spacing: .07em;
}

.letter__body p.space { margin-bottom: 1.9em; }

@keyframes lineIn {
  from { opacity: 0; transform: translateY(9px); filter: blur(1.5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.letter__sign {
  margin: 1.8em 0 0;
  text-align: right;
  font-family: var(--serif);
  font-size: clamp(.85rem, 3.4vw, .92rem);
  letter-spacing: .08em;
  color: rgba(58, 42, 25, .78);
  opacity: 0;
  animation: lineIn 1s var(--ease) 6.4s forwards;
}

.letter__date {
  margin: 8px 0 0;
  text-align: right;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(58, 42, 25, .45);
  opacity: 0;
  animation: lineIn 1s var(--ease) 6.9s forwards;
}

.extra {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  margin-top: clamp(26px, 4vh, 38px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  animation: lineIn 1.2s var(--ease) 7.6s forwards;
}

.extra__drawer {
  position: relative;
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  border: 1px solid rgba(214, 174, 112, .3);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 214, 168, .1), rgba(0, 0, 0, 0) 40%),
    linear-gradient(180deg, #4a3120 0%, #2e1d10 100%);
  color: rgba(255, 226, 186, .85);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  box-shadow: 0 1px 0 rgba(255, 226, 185, .16) inset, 0 12px 24px -12px rgba(0, 0, 0, .9);
  transition: box-shadow .4s, border-color .4s, transform .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.extra__drawer:hover { border-color: rgba(232, 196, 148, .6); box-shadow: 0 0 30px rgba(255, 165, 85, .2), 0 1px 0 rgba(255,226,185,.2) inset; }
.extra__drawer:active { transform: translateY(1px); }
.extra__drawer:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 3px; }

.extra__num {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: rgba(226, 184, 128, .75);
}

.extra__label {
  font-family: var(--serif);
  font-size: clamp(.9rem, 3.6vw, .98rem);
  letter-spacing: .3em;
  text-indent: .3em;
  color: rgba(247, 233, 213, .62);
}

.extra__note {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(.88rem, 3.5vw, .96rem);
  line-height: 2.1;
  letter-spacing: .08em;
  color: rgba(255, 226, 186, .82);
  animation: lineIn 1.2s var(--ease) both;
  text-shadow: 0 0 30px rgba(255, 170, 90, .4);
}

.finale__actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(30px, 5vh, 46px);
  opacity: 0;
  animation: lineIn 1.2s var(--ease) 8.2s forwards;
}

.ghost-btn {
  min-height: 46px;
  padding: 0 1.8em;
  border: 1px solid rgba(216, 178, 113, .34);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 226, 186, .8);
  font-size: 12px;
  letter-spacing: .3em;
  text-indent: .3em;
  cursor: pointer;
  transition: background .3s, border-color .3s;
  -webkit-tap-highlight-color: transparent;
}

.ghost-btn:hover { background: rgba(216, 178, 113, .1); border-color: rgba(216, 178, 113, .6); }
.ghost-btn:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 3px; }

/* ---------- 声音 ---------- */

.sound-toggle {
  position: fixed;
  z-index: 55;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(216, 178, 113, .28);
  border-radius: 999px;
  background: rgba(18, 13, 10, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 226, 186, .66);
  font-size: 10px;
  letter-spacing: .16em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sound-toggle:focus-visible { outline: 2px solid var(--glow-hi); outline-offset: 2px; }

.sound-toggle__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sound-toggle__bars i {
  display: block;
  width: 2px;
  height: 5px;
  background: currentColor;
  border-radius: 1px;
  transition: height .3s;
}
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i { animation: bar 1.1s ease-in-out infinite; }
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i:nth-child(2) { animation-delay: .18s; }
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i:nth-child(3) { animation-delay: .36s; }

@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 11px; } }

/* ---------- 大屏 ---------- */

@media (min-width: 620px) {
  .cabinet__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cabinet__body { padding: 20px 18px 22px; }
  .hall__title { letter-spacing: .22em; text-indent: .22em; }
}

@media (min-width: 900px) {
  .cover__lede { font-size: 1.14rem; }
  .letter { max-width: 560px; }
}

/* ---------- 补充 ---------- */

body.is-locked { overflow: hidden; }

.specimen__art svg { animation: artIn .9s var(--ease) .1s both; }

@keyframes artIn {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

.specimen__text .ln { display: block; }

.letter__body p.gap { margin: 0 0 .5em; height: 0; }

/* ---------- 减少动态 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .letter__to, .letter__body p, .letter__sign, .letter__date, .extra, .extra__note, .finale__actions { opacity: 1; }
  .specimen__text .ch { opacity: 1; }
  .letter__body p.gap { height: .5em; }
}
