:root {
  --paper: #eadfc8;
  --paper-bright: #fff1d9;
  --paper-dim: #bfb196;
  --ink: #0b0907;
  --panel: rgba(13, 10, 7, 0.88);
  --panel-2: rgba(23, 18, 13, 0.82);
  --line: rgba(234, 223, 200, 0.24);
  --line-strong: rgba(234, 223, 200, 0.42);
  --red: #8d221b;
  --red-lit: #bd382d;
  --gold: #c6a35a;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.64);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  /* 民国味主标题：优先楷体，退回衬线 */
  --kai: "STKaiti", "KaiTi", "楷体", "Noto Serif SC", "Songti SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: #090806;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.app, .stage {
  width: 100vw;
  height: 100vh;
}

.stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.scene-bg {
  position: absolute;
  inset: 0;
  background: #0c0b09 center / cover no-repeat;
  transform: scale(1.035);
  filter: contrast(1.08) brightness(0.76) saturate(0.82);
  transition: background-image 520ms ease, opacity 320ms ease, filter 320ms ease;
  z-index: 0;
}
.stage.time-reading .scene-bg {
  background-image: none !important;
  background-color: #000;
  filter: none;
  opacity: 1;
}
.stage.time-reading .scene-scrim {
  background: #000;
}
.stage.time-reading .grain {
  opacity: 0;
}
.stage.time-reading .dialogue-panel,
.stage.time-reading .choice-layer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stage.black-scene .scene-bg {
  background-image: none !important;
  background-color: #000;
  filter: none;
  opacity: 1;
  transform: none;
}
.stage.black-scene .scene-scrim {
  background: #000;
}
.stage.black-scene .grain,
.stage.black-scene .topbar,
.stage.black-scene .time-hud,
.stage.black-scene .archive-toggle,
.stage.black-scene .auto-play-toggle,
.stage.black-scene .dialogue-tools {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.stage.black-scene .dialogue-panel {
  left: 50%;
  right: auto;
  bottom: clamp(52px, 8vh, 88px);
  width: min(900px, calc(100vw - 40px));
  min-height: 176px;
  transform: translateX(-50%);
  border-color: rgba(234, 223, 200, 0.2);
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.94), rgba(0, 0, 0, 0.92)),
    radial-gradient(120% 90% at 50% 0%, rgba(198, 163, 90, 0.08), transparent 58%);
  box-shadow:
    0 30px 120px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 rgba(234, 223, 200, 0.1),
    inset 0 0 0 1px rgba(198, 163, 90, 0.06);
}
.stage.black-scene .dialogue-panel::before {
  left: 24px;
  right: 24px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.42), transparent);
}
.stage.black-scene .text-box {
  color: #f7ead4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.scene-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.64), rgba(5, 4, 3, 0.06) 24%, rgba(5, 4, 3, 0.2) 50%, rgba(5, 4, 3, 0.86) 100%),
    radial-gradient(70% 60% at 55% 38%, rgba(70, 52, 34, 0.08), rgba(5, 4, 3, 0.58) 78%);
}

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

.auto-play-toggle {
  position: absolute;
  z-index: 9;
  top: 22px;
  right: 24px;
  width: 128px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: rgba(198, 163, 90, 0.72);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.86);
  transition: color 160ms ease, transform 160ms ease, text-shadow 160ms ease;
  overflow: visible;
}
.auto-play-toggle::after {
  content: "";
  position: absolute;
  inset: 3px 5px;
  border: 1px solid rgba(198, 163, 90, 0);
  border-radius: 1px;
  pointer-events: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.auto-play-toggle span {
  position: relative;
  z-index: 2;
}
.auto-play-toggle:hover,
.auto-play-toggle:focus-visible,
.auto-play-toggle.active {
  color: #efd889;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 14px rgba(198, 163, 90, 0.34);
  outline: none;
}
.auto-play-toggle:hover,
.auto-play-toggle:focus-visible {
  transform: translateY(-2px);
}
.auto-play-toggle:hover::after,
.auto-play-toggle:focus-visible::after {
  border-color: rgba(198, 163, 90, 0.18);
}
.auto-play-toggle.active::after {
  border-color: rgba(198, 163, 90, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 160, 0.05),
    0 0 18px rgba(198, 163, 90, 0.12);
}
.auto-play-beam {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  width: 14px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 241, 183, 0.08) 16%,
    rgba(255, 233, 143, 1) 50%,
    rgba(255, 241, 183, 0.08) 84%,
    transparent 100%
  );
  opacity: 0;
  transform-origin: center center;
  offset-path: path("M 5 3 H 123 V 27 H 5 V 3");
  offset-anchor: 50% 50%;
  offset-rotate: auto;
  filter:
    drop-shadow(0 0 4px rgba(255, 224, 132, 0.54))
    drop-shadow(0 0 9px rgba(198, 163, 90, 0.24));
  pointer-events: none;
}
.auto-play-toggle.active .auto-play-beam {
  opacity: 0.72;
  animation: autoBeamCw 5600ms linear infinite;
}
.auto-play-toggle.active .auto-play-beam.second {
  animation-delay: -2800ms;
}
@keyframes autoBeamCw {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}
.title-screen:not(.hidden) ~ .auto-play-toggle,
.stage.time-reading .auto-play-toggle {
  display: none;
}

.topbar {
  position: absolute;
  z-index: 10;
  top: 18px;
  left: 18px;
  right: 18px;
  display: none;
  align-items: center;
  gap: 12px;
  min-width: 0;
  pointer-events: none;
}

.icon-btn,
.archive-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--paper);
  background: rgba(10, 8, 6, 0.62);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.icon-btn:hover,
.archive-toggle:hover { border-color: var(--gold); color: var(--gold); }

.brand { min-width: 0; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.brand-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.brand-sub {
  margin-top: 1px;
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.progress {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.62);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--paper-dim);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.title-screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: block;
  padding: 0;
  background: #0a0806;
  transition: opacity 260ms ease, visibility 260ms ease;
}
.title-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.title-screen.hidden .cover-photo,
.title-screen.hidden .cover-vignette,
.title-screen.hidden .cover-title,
.title-screen.hidden .cover-quote,
.title-screen.hidden .cover-menu,
.title-screen.hidden .cover-mentor-link,
.title-screen.hidden .cover-footer {
  display: none;
}
.title-screen.in-game-menu {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(58, 38, 22, 0.2), rgba(0, 0, 0, 0) 42%),
    rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(5px);
}
.title-screen.in-game-menu .cover-hero {
  background: transparent;
}
.title-screen.in-game-menu .cover-photo,
.title-screen.in-game-menu .cover-vignette,
.title-screen.in-game-menu .cover-title,
.title-screen.in-game-menu .cover-quote,
.title-screen.in-game-menu .cover-menu,
.title-screen.in-game-menu .cover-device-hint,
.title-screen.in-game-menu .cover-mentor-link,
.title-screen.in-game-menu .cover-intro-link,
.title-screen.in-game-menu .cover-footer {
  display: none;
}
.title-screen.in-game-menu .cover-panel {
  z-index: 30;
}
.cover-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
.cover-hero {
  position: relative;
  width: 100%;
  height: 100%;
  background: #1a0e08;
  overflow: hidden;
}
.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.1) saturate(0.85) brightness(0.85);
}
.cover-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.36) 0%, transparent 28%, transparent 48%, rgba(10, 8, 6, 0.7) 76%, rgba(10, 8, 6, 0.96) 100%),
    radial-gradient(110% 90% at 50% 48%, transparent 56%, rgba(10, 8, 6, 0.42) 100%);
}
.cover-title {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5vw, 72px);
  bottom: clamp(168px, 20vh, 230px);
}
.cover-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 56px;
  line-height: 1.1;
  letter-spacing: 0.15em;
  color: #f0e0c0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}
.cover-sub {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: #a0896e;
  letter-spacing: 0.38em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.cover-quote {
  position: absolute;
  z-index: 2;
  top: clamp(32px, 6.5vh, 64px);
  right: clamp(30px, 5.4vw, 78px);
  max-width: min(560px, 45vw);
  padding: 4px 22px 6px 0;
  text-align: left;
}
/* 羽化暗晕：让题词从右上角最亮的夕照天空里浮出来，又不显成硬卡片 */
.cover-quote::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -24px -38px -30px -46px;
  background: radial-gradient(120% 105% at 72% 42%, rgba(8, 6, 4, 0.78) 0%, rgba(8, 6, 4, 0.52) 46%, rgba(8, 6, 4, 0) 80%);
  filter: blur(3px);
  pointer-events: none;
}
.cover-quote p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 600;
  color: #f6e8c8;
  line-height: 1.64;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 5px 18px rgba(0, 0, 0, 0.78);
}
.cover-quote p::before,
.cover-quote p::after {
  color: rgba(214, 179, 106, 0.82);
  font-size: 0.86em;
  font-weight: 400;
  letter-spacing: 0;
}
.cover-quote p::before {
  content: "“";
  margin-right: 0.18em;
}
.cover-quote p::after {
  content: "”";
  margin-left: 0.18em;
}
.cover-quote p span {
  display: block;
  white-space: nowrap;
}
.cover-by {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.32em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
.cover-by::before {
  content: "";
  width: clamp(34px, 5vw, 60px);
  height: 1px;
  background: linear-gradient(90deg, rgba(198, 163, 90, 0), var(--gold));
}
.cover-menu {
  position: absolute;
  z-index: 4;
  right: clamp(34px, 5.6vw, 86px);
  top: 50%;
  transform: translateY(-38%);
  width: min(280px, 22vw);
  display: grid;
  gap: 12px;
}
.cover-menu::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28px -30px;
  background:
    radial-gradient(95% 72% at 58% 48%, rgba(8, 6, 4, 0.74), rgba(8, 6, 4, 0.42) 54%, rgba(8, 6, 4, 0) 82%),
    linear-gradient(90deg, rgba(8, 6, 4, 0), rgba(8, 6, 4, 0.46) 26%, rgba(8, 6, 4, 0.7));
  filter: blur(2px);
  pointer-events: none;
}
.cover-menu-item {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 18px 10px 16px;
  border: 1px solid rgba(198, 163, 90, 0.26);
  border-left-color: rgba(198, 163, 90, 0.66);
  border-radius: 2px;
  color: #e8d5a3;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.6), rgba(20, 14, 9, 0.72) 38%, rgba(10, 8, 6, 0.48)),
    linear-gradient(180deg, rgba(255, 238, 190, 0.06), rgba(0, 0, 0, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.08), 0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(5px);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.cover-menu-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: linear-gradient(180deg, rgba(198, 163, 90, 0), rgba(198, 163, 90, 0.94), rgba(198, 163, 90, 0));
  opacity: 0.58;
}
.cover-menu-item::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(198, 163, 90, 0), rgba(198, 163, 90, 0.82));
  opacity: 0;
  transform: translateY(-50%) translateX(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.cover-menu-kicker {
  font-family: var(--serif);
  color: rgba(198, 163, 90, 0.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  writing-mode: vertical-rl;
}
.cover-menu-title {
  font-family: var(--serif);
  font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.76);
}
.cover-device-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100vw - 48px));
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid rgba(226, 190, 112, 0.54);
  border-radius: 999px;
  background: rgba(8, 6, 4, 0.84);
  color: rgba(255, 241, 211, 0.98);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.82), 0 0 16px rgba(198, 163, 90, 0.28);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 235, 186, 0.14);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
}
.cover-device-hint.show {
  animation: deviceHintToast 3000ms ease forwards;
}
@keyframes deviceHintToast {
  0% { opacity: 0; transform: translate(-50%, -44%) scale(0.98); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(0.99); }
}
.cover-menu-item:hover,
.cover-menu-item:focus-visible {
  color: #fff1d0;
  border-color: rgba(232, 213, 163, 0.64);
  border-left-color: var(--gold);
  background:
    linear-gradient(90deg, rgba(141, 34, 27, 0.72), rgba(42, 24, 15, 0.8) 42%, rgba(13, 10, 7, 0.58)),
    linear-gradient(180deg, rgba(255, 238, 190, 0.1), rgba(0, 0, 0, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.12), 0 16px 42px rgba(0, 0, 0, 0.34), 0 0 28px rgba(141, 34, 27, 0.22);
  transform: translateX(-6px);
  outline: none;
}
.cover-menu-item:hover::after,
.cover-menu-item:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.cover-mentor-link {
  position: absolute;
  z-index: 4;
  right: clamp(34px, 5.6vw, 86px);
  top: calc(50% + 232px);
  width: min(280px, 22vw);
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  padding: 0 0 0 20px;
  border: 1px solid rgba(99, 129, 123, 0.5);
  border-right-color: rgba(223, 209, 161, 0.4);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(15, 38, 38, 0.68), rgba(24, 25, 18, 0.62) 64%, rgba(92, 63, 31, 0.36)),
    linear-gradient(180deg, rgba(223, 209, 161, 0.12), rgba(0, 0, 0, 0.06));
  color: rgba(224, 226, 201, 0.9);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.34em;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(240, 225, 178, 0.12),
    inset 6px 0 0 rgba(82, 122, 116, 0.72),
    0 13px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.cover-mentor-link::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 48px;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, rgba(223, 209, 161, 0), rgba(223, 209, 161, 0.42), rgba(223, 209, 161, 0));
}
.cover-mentor-link span {
  position: relative;
  z-index: 1;
}
.cover-mentor-link i {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 42px;
  border-left: 1px solid rgba(223, 209, 161, 0.18);
  background:
    linear-gradient(135deg, transparent 0 49%, rgba(223, 209, 161, 0.42) 50%, transparent 52%),
    radial-gradient(circle at 50% 50%, rgba(223, 209, 161, 0.32), rgba(223, 209, 161, 0) 42%);
}
.cover-mentor-link:hover,
.cover-mentor-link:focus-visible {
  color: #f8efd0;
  border-color: rgba(161, 184, 164, 0.78);
  background:
    linear-gradient(90deg, rgba(20, 63, 61, 0.8), rgba(28, 29, 19, 0.72) 62%, rgba(111, 79, 37, 0.42)),
    linear-gradient(180deg, rgba(240, 225, 178, 0.16), rgba(0, 0, 0, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(240, 225, 178, 0.18),
    inset 6px 0 0 rgba(104, 152, 144, 0.9),
    0 16px 42px rgba(0, 0, 0, 0.36),
    0 0 26px rgba(66, 128, 119, 0.2);
  transform: translateX(-4px);
  outline: none;
}
.cover-intro-link {
  position: absolute;
  z-index: 4;
  right: clamp(34px, 5.6vw, 86px);
  top: calc(50% + 286px);
  width: min(280px, 22vw);
  min-height: 38px;
  border: 1px solid rgba(198, 163, 90, 0.28);
  border-radius: 999px;
  background: rgba(8, 6, 5, 0.44);
  color: rgba(232, 213, 163, 0.82);
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.05), 0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(5px);
}
.cover-intro-link:hover,
.cover-intro-link:focus-visible {
  color: #fff1d0;
  border-color: rgba(198, 163, 90, 0.68);
  background: rgba(111, 42, 28, 0.48);
  outline: none;
}
.cover-panel {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: min(920px, calc(100vw - 56px));
  height: min(650px, calc(100vh - 88px));
  min-height: 0;
  max-height: none;
  transform: translate(-50%, -50%);
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(214, 180, 107, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(38, 25, 15, 0.99), rgba(8, 7, 5, 0.97) 44%, rgba(24, 15, 10, 0.99)),
    radial-gradient(95% 72% at 10% 10%, rgba(141, 34, 27, 0.38), rgba(141, 34, 27, 0) 58%),
    radial-gradient(80% 70% at 92% 12%, rgba(198, 163, 90, 0.18), rgba(198, 163, 90, 0) 62%);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(255, 238, 190, 0.045),
    inset 0 1px 0 rgba(255, 237, 190, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px) saturate(1.06);
}
.cover-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(234, 223, 200, 0.12);
  border-top-color: rgba(214, 180, 107, 0.34);
  border-left-color: rgba(214, 180, 107, 0.28);
  border-radius: 4px;
  pointer-events: none;
}
.cover-panel::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.76), transparent);
  pointer-events: none;
}
.cover-panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid rgba(214, 180, 107, 0.16);
  border-left: 4px solid rgba(198, 163, 90, 0.72);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.42), rgba(17, 12, 8, 0.34) 48%, rgba(198, 163, 90, 0.06)),
    rgba(5, 4, 3, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.08);
}
.cover-panel-kicker {
  color: rgba(198, 163, 90, 0.82);
  font-size: 12px;
  letter-spacing: 0.32em;
}
.cover-panel h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0.24em;
  color: #f0e0c0;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.78);
}
.cover-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(214, 180, 107, 0.34);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(234, 223, 200, 0.1), transparent 42%),
    rgba(8, 6, 5, 0.52);
  color: rgba(234, 223, 200, 0.74);
  font-size: 22px;
  line-height: 1;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}
.cover-panel-close:hover {
  color: #fff1d0;
  border-color: rgba(198, 163, 90, 0.72);
  background: rgba(111, 42, 28, 0.44);
  transform: rotate(90deg);
}
.chapter-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(268px, 0.74fr) minmax(0, 1fr);
  gap: 20px;
  height: calc(100% - 94px);
  min-height: 0;
  padding-top: 20px;
}
.chapter-slots {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(214, 180, 107, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(234, 223, 200, 0.055), rgba(234, 223, 200, 0.02)),
    rgba(5, 4, 3, 0.34);
  scrollbar-color: rgba(198, 163, 90, 0.48) rgba(10, 8, 6, 0.3);
}
.chapter-slot {
  position: relative;
  min-height: 54px;
  padding: 10px 14px 10px 16px;
  border: 1px solid rgba(234, 223, 200, 0.075);
  border-left: 3px solid rgba(198, 163, 90, 0.18);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(234, 223, 200, 0.035), rgba(234, 223, 200, 0.012)),
    rgba(6, 5, 4, 0.24);
  text-align: left;
  color: rgba(234, 223, 200, 0.38);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.chapter-save-btn {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(232, 213, 163, 0.42);
  border-left: 4px solid rgba(232, 213, 163, 0.92);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.58), rgba(32, 20, 13, 0.72)),
    radial-gradient(90% 120% at 100% 0%, rgba(198, 163, 90, 0.18), transparent 64%);
  color: #f1ddb0;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.1), 0 12px 28px rgba(0, 0, 0, 0.2);
}
.chapter-save-btn span {
  grid-row: span 2;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  writing-mode: vertical-rl;
  color: rgba(232, 213, 163, 0.82);
}
.chapter-save-btn strong {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.16em;
}
.chapter-save-btn small {
  color: rgba(234, 223, 200, 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.chapter-save-btn:hover,
.chapter-save-btn:focus-visible {
  color: #fff1d0;
  border-color: rgba(232, 213, 163, 0.68);
  transform: translateX(3px);
  outline: none;
}
.chapter-slot-num {
  font-family: var(--serif);
  font-size: 12px;
  color: rgba(198, 163, 90, 0.56);
  letter-spacing: 0.18em;
}
.chapter-slot-title {
  margin-top: 5px;
  min-height: 22px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.1em;
}
.chapter-slot.grouped .chapter-slot-title {
  font-size: 18px;
}
.chapter-slot-sub {
  margin-top: 4px;
  color: rgba(198, 163, 90, 0.58);
  font-size: 11px;
  letter-spacing: 0.18em;
}
.chapter-slot.unlocked {
  color: #e8d5a3;
  border-color: rgba(198, 163, 90, 0.28);
  border-left-color: rgba(198, 163, 90, 0.78);
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.26), rgba(20, 14, 9, 0.5)),
    rgba(6, 5, 4, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.06);
}
.chapter-slot.unlocked:hover,
.chapter-slot.unlocked.active {
  color: #fff1d0;
  border-color: rgba(232, 213, 163, 0.48);
  border-left-color: var(--gold);
  background:
    linear-gradient(90deg, rgba(141, 34, 27, 0.54), rgba(42, 24, 15, 0.72)),
    rgba(6, 5, 4, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 235, 186, 0.1);
  transform: translateX(3px);
}
.chapter-slot.current {
  border-right-color: rgba(198, 163, 90, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.1), 0 0 0 1px rgba(198, 163, 90, 0.12);
}
.chapter-slot-current {
  position: absolute;
  top: 9px;
  right: 10px;
  min-width: 42px;
  padding: 2px 7px;
  border: 1px solid rgba(198, 163, 90, 0.48);
  color: #f0d78f;
  background: rgba(10, 8, 6, 0.58);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-align: center;
}
.chapter-slot.locked {
  cursor: default;
}
.chapter-detail {
  min-height: 0;
  overflow: auto;
  padding: 28px 30px;
  border: 1px solid rgba(198, 163, 90, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(239, 224, 192, 0.94), rgba(215, 196, 158, 0.9)),
    radial-gradient(90% 70% at 12% 0%, rgba(198, 163, 90, 0.12), transparent 58%);
  box-shadow: inset 0 1px 0 rgba(255, 248, 225, 0.48), 0 18px 44px rgba(0, 0, 0, 0.24);
}
.chapter-detail-empty {
  display: flex;
  min-height: 290px;
  align-items: center;
  justify-content: center;
  color: rgba(45, 31, 20, 0.44);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-align: center;
}
.chapter-detail-kicker {
  color: rgba(111, 42, 28, 0.82);
  font-size: 12px;
  letter-spacing: 0.24em;
}
.chapter-detail h3 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.22;
  color: #1d140d;
  letter-spacing: 0.1em;
  text-shadow: none;
}
.chapter-detail-time {
  margin-top: 10px;
  color: rgba(45, 31, 20, 0.58);
  font-size: 13px;
  letter-spacing: 0.12em;
}
.chapter-detail-desc {
  margin: 26px 0 0;
  color: rgba(28, 19, 12, 0.82);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.9;
}
.chapter-scene-figure {
  position: relative;
  margin: 26px 0 0;
  aspect-ratio: 16 / 7;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid rgba(111, 42, 28, 0.22);
  border-radius: 4px;
  background: rgba(45, 31, 20, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 225, 0.22),
    0 12px 30px rgba(45, 31, 20, 0.16);
}
.chapter-scene-figure::before,
.chapter-scene-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.chapter-scene-figure::before {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(16, 10, 6, 0.02), rgba(16, 10, 6, 0.22)),
    radial-gradient(90% 90% at 50% 48%, transparent 45%, rgba(18, 11, 7, 0.34) 100%);
}
.chapter-scene-figure::after {
  z-index: 2;
  border: 1px solid rgba(255, 239, 198, 0.12);
  box-shadow: inset 0 0 36px rgba(17, 10, 6, 0.24);
}
.chapter-scene-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.1) contrast(0.96) saturate(0.86);
}
.chapter-child-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.chapter-child-btn {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid rgba(198, 163, 90, 0.24);
  border-left: 3px solid rgba(198, 163, 90, 0.62);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.14), rgba(255, 248, 225, 0.16)),
    rgba(255, 248, 225, 0.22);
  color: #2b1d12;
  text-align: left;
}
.chapter-child-btn span {
  color: rgba(111, 42, 28, 0.78);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.chapter-child-btn strong {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
}
.chapter-child-btn:hover {
  color: #111;
  border-color: rgba(232, 213, 163, 0.58);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(198, 163, 90, 0.3), rgba(255, 248, 225, 0.26));
}
.chapter-jump-btn {
  margin-top: 28px;
  min-width: 158px;
  padding: 12px 22px;
  border: 1px solid rgba(198, 163, 90, 0.52);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.92), rgba(44, 25, 14, 0.92)),
    rgba(10, 8, 6, 0.28);
  color: #f2dfae;
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: 0.18em;
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.08);
}
.chapter-jump-btn:hover {
  color: #fff1d0;
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(141, 34, 27, 0.24);
}
.chapter-jump-btn:disabled {
  cursor: default;
  color: rgba(234, 223, 200, 0.46);
  border-color: rgba(198, 163, 90, 0.26);
  background: rgba(10, 8, 6, 0.34);
  box-shadow: none;
}
.archive-panel {
  width: min(1040px, calc(100vw - 56px));
}
.archive-board {
  position: relative;
  z-index: 1;
  height: calc(100% - 98px);
  min-height: 0;
}
.archive-shelf {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(214, 180, 107, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(19, 13, 9, 0.42), rgba(8, 6, 5, 0.52)),
    radial-gradient(90% 70% at 16% 4%, rgba(198, 163, 90, 0.1), transparent 62%);
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.05);
}
.archive-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.archive-photo-card {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid rgba(198, 163, 90, 0.18);
  border-radius: 4px;
  background: rgba(10, 8, 6, 0.32);
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.archive-photo-card::after,
.archive-photo-num {
  display: none;
}
.archive-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 24 / 17;
  object-fit: cover;
  filter: sepia(0.12) saturate(0.78) contrast(0.96);
  opacity: 0.9;
  transition: opacity 160ms ease, filter 160ms ease, transform 220ms ease;
}
.archive-photo-card:hover,
.archive-photo-card:focus-visible {
  border-color: rgba(232, 213, 163, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  transform: translateY(-2px);
  outline: none;
}
.archive-photo-card:hover img,
.archive-photo-card:focus-visible img {
  opacity: 1;
  filter: sepia(0.04) saturate(0.9) contrast(1);
  transform: scale(1.025);
}
.archive-preview {
  position: fixed;
  z-index: 80;
  inset: 0;
  pointer-events: none;
}
.archive-lightbox-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(5px) saturate(0.88);
  pointer-events: auto;
}
.archive-lightbox {
  position: fixed;
  z-index: 81;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 58px 18px 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.archive-lightbox-close {
  position: fixed;
  z-index: 82;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  min-width: 92px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(214, 180, 107, 0.34);
  border-radius: 999px;
  background: rgba(8, 6, 5, 0.82);
  color: rgba(234, 223, 200, 0.86);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 235, 186, 0.08);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.archive-lightbox-close span {
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}
.archive-lightbox-close strong {
  font-size: 13px;
}
.archive-lightbox-close:hover {
  color: #fff1d0;
  border-color: rgba(198, 163, 90, 0.72);
  background: rgba(111, 42, 28, 0.72);
}
.archive-expanded-photo {
  width: min(980px, 84vw);
  max-height: calc(100vh - 180px);
  margin: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: auto;
}
.archive-expanded-photo img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  filter: sepia(0.04) saturate(0.92) contrast(0.98);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.72);
}
.archive-qa {
  position: relative;
  z-index: 3;
  width: min(760px, 84vw);
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 8px;
  pointer-events: auto;
  border: 1px solid rgba(214, 180, 107, 0.28);
  background: linear-gradient(180deg, rgba(22, 17, 12, 0.82), rgba(7, 6, 5, 0.9));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 232, 184, 0.08);
  backdrop-filter: blur(14px);
}
.archive-qa-title {
  display: none;
  color: rgba(240, 210, 138, 0.9);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.archive-qa-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 0;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.archive-qa-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 16px;
  background: transparent;
  color: #f7f7f7;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.08em;
  outline: none;
}
.archive-qa-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}
.archive-qa-form button {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  background: #f5f5f5;
  color: #070707;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.archive-qa-form button:disabled {
  color: rgba(0, 0, 0, 0.42);
}
.archive-answer {
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.56);
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
}
.archive-answer.error {
  color: #f2d0c8;
}
.mentor-panel {
  width: min(820px, calc(100vw - 56px));
}
.mentor-board {
  position: relative;
  z-index: 1;
  height: calc(100% - 82px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}
.mentor-note {
  padding: 14px 18px;
  border: 1px solid rgba(234, 223, 200, 0.18);
  border-left: 3px solid rgba(198, 163, 90, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 12, 9, 0.68), rgba(8, 6, 5, 0.54)),
    radial-gradient(120% 120% at 0% 0%, rgba(198, 163, 90, 0.08), transparent 52%);
  box-shadow:
    inset 0 1px 0 rgba(234, 223, 200, 0.08),
    inset 0 0 0 1px rgba(198, 163, 90, 0.04);
}
.mentor-note span {
  display: block;
  color: rgba(255, 239, 190, 0.94);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.18em;
}
.mentor-note p {
  margin: 8px 0 0;
  color: rgba(234, 223, 200, 0.72);
  font-size: 14px;
  line-height: 1.72;
}
.mentor-envelope {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(234, 223, 200, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(16, 12, 9, 0.72), rgba(8, 6, 5, 0.64)),
    radial-gradient(120% 120% at 0% 0%, rgba(198, 163, 90, 0.08), transparent 48%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(234, 223, 200, 0.08),
    inset 0 0 0 1px rgba(198, 163, 90, 0.05);
}
.mentor-envelope::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.5), transparent);
  pointer-events: none;
}
.mentor-letter {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(198, 163, 90, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 246, 222, 0.94), rgba(224, 209, 168, 0.9)),
    radial-gradient(85% 80% at 20% 0%, rgba(255, 255, 255, 0.42), transparent 58%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 14px 34px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.mentor-letter::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background:
    linear-gradient(rgba(104, 75, 42, 0.18) 1px, transparent 1px) 0 38px / 100% 34px,
    radial-gradient(80% 30% at 50% 0%, rgba(255, 255, 255, 0.36), transparent 70%);
}
.mentor-letter::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(130, 82, 36, 0.32), transparent);
  pointer-events: none;
}
.mentor-letter-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 9px 18px 0;
  color: rgba(82, 50, 26, 0.88);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.mentor-letter-label::before {
  content: "";
  width: 3px;
  height: 20px;
  margin-right: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(141, 34, 27, 0.82), rgba(198, 163, 90, 0.54));
  box-shadow: 0 0 8px rgba(141, 34, 27, 0.18);
}
.mentor-answer {
  min-height: 0;
  overflow: auto;
  padding: 8px 20px 18px;
  border: 0;
  background: transparent;
  color: rgba(32, 22, 14, 0.88);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  white-space: pre-wrap;
  box-shadow: none;
  position: relative;
  z-index: 1;
}
.mentor-answer.error {
  color: #6f2a1c;
}
.mentor-form {
  display: grid;
  grid-template-rows: auto auto;
}
.mentor-input-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  padding: 6px 14px 14px;
}
.mentor-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid rgba(117, 75, 36, 0.2);
  border-radius: 6px;
  background: rgba(255, 249, 231, 0.42);
  color: rgba(38, 25, 15, 0.92);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}
.mentor-form textarea::placeholder {
  color: rgba(79, 57, 38, 0.54);
}
.mentor-form textarea:focus {
  border-color: rgba(141, 34, 27, 0.38);
  box-shadow: 0 0 0 2px rgba(198, 163, 90, 0.16);
}
.mentor-form button {
  border: 1px solid rgba(89, 52, 28, 0.24);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(141, 34, 27, 0.9), rgba(93, 28, 22, 0.94)),
    rgba(10, 8, 6, 0.16);
  color: #fff1c6;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.16em;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 192, 0.18),
    0 8px 20px rgba(60, 24, 14, 0.18);
}
.mentor-form button:disabled {
  color: rgba(82, 50, 26, 0.38);
  border-color: rgba(117, 75, 36, 0.14);
  background: rgba(117, 75, 36, 0.12);
  box-shadow: none;
}

/* 导师问答：按游戏内对话框重构为“上导师、下我”的书信往返。 */
.mentor-panel {
  width: min(980px, calc(100vw - 56px));
  height: min(720px, calc(100vh - 74px));
}
.mentor-board {
  height: calc(100% - 82px);
  grid-template-rows: minmax(0, 1fr);
}
.mentor-note {
  display: none;
}
.mentor-envelope {
  grid-template-rows: minmax(0, 1fr) 42px auto;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.mentor-envelope::before {
  display: none;
}
.mentor-letter {
  border: 1px solid rgba(234, 223, 200, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(16, 12, 9, 0.78), rgba(8, 6, 5, 0.7)),
    radial-gradient(140% 120% at 0% 0%, rgba(198, 163, 90, 0.07), transparent 46%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(234, 223, 200, 0.10),
    inset 0 0 0 1px rgba(198, 163, 90, 0.06);
}
.mentor-letter::before {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.48), transparent);
  inset: 0 20px auto;
  height: 1px;
}
.mentor-letter::after {
  display: none;
}
.mentor-letter-label {
  min-height: 38px;
  padding: 10px 18px 0;
  color: var(--paper-bright);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.mentor-letter-label::before {
  background: linear-gradient(180deg, var(--gold), rgba(198, 163, 90, 0.28));
  box-shadow: 0 0 8px rgba(198, 163, 90, 0.35);
}
.mentor-answer {
  padding: 10px 22px 22px;
  color: #f5ead5;
  font-family: var(--serif);
  font-size: clamp(17px, 1.65vw, 22px);
  line-height: 1.78;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.55);
}
.mentor-answer.error {
  color: #ffd8ce;
}
.mentor-mail-route {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  color: rgba(198, 163, 90, 0.78);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.86);
  opacity: 0.42;
}
.mentor-mail-route::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.38), transparent);
}
.mentor-mail-route i {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 34px;
  height: 22px;
  border: 1px solid rgba(198, 163, 90, 0.72);
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(198, 163, 90, 0.55) 50%, transparent 52%),
    linear-gradient(45deg, transparent 48%, rgba(198, 163, 90, 0.45) 50%, transparent 52%),
    rgba(18, 13, 9, 0.92);
  box-shadow: 0 0 14px rgba(198, 163, 90, 0.18);
  transform: translateX(-50%);
}
.mentor-mail-route span {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  opacity: 0;
}
.mentor-panel.sending .mentor-mail-route {
  opacity: 1;
}
.mentor-panel.sending .mentor-mail-route i {
  animation: mentorMailTravel 1600ms ease-in-out infinite;
}
.mentor-panel.sending .mentor-mail-route span {
  opacity: 1;
}
@keyframes mentorMailTravel {
  0% { transform: translateX(calc(-50% + 180px)); opacity: 0.15; }
  18% { opacity: 1; }
  48% { transform: translateX(-50%); opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translateX(calc(-50% - 180px)); opacity: 0.15; }
}
.mentor-form {
  grid-template-rows: auto auto;
}
.mentor-input-row {
  padding: 8px 18px 18px;
  grid-template-columns: minmax(0, 1fr) 96px;
}
.mentor-form textarea {
  min-height: 92px;
  border: 1px solid rgba(234, 223, 200, 0.16);
  border-radius: 8px;
  background: rgba(5, 4, 3, 0.46);
  color: #f5ead5;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.mentor-form textarea::placeholder {
  color: rgba(234, 223, 200, 0.46);
}
.mentor-form textarea:focus {
  border-color: rgba(198, 163, 90, 0.52);
  box-shadow: 0 0 0 2px rgba(198, 163, 90, 0.12);
}
.mentor-form button {
  border: 1px solid rgba(198, 163, 90, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(77, 45, 22, 0.72), rgba(31, 20, 12, 0.86)),
    radial-gradient(120% 120% at 50% 0%, rgba(198, 163, 90, 0.22), transparent 58%);
  color: #efd889;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 192, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.24);
}
.mentor-form button:disabled {
  color: rgba(198, 163, 90, 0.42);
  border-color: rgba(198, 163, 90, 0.16);
  background: rgba(8, 6, 5, 0.52);
}
.settings-panel {
  width: min(920px, calc(100vw - 56px));
  height: min(650px, calc(100vh - 88px));
  min-height: 0;
}
.settings-board {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 16px;
  height: calc(100% - 94px);
  padding-top: 20px;
}
.intro-panel {
  width: min(760px, calc(100vw - 56px));
  height: auto;
  min-height: 0;
}
.intro-board {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 26px 30px 28px;
  margin-top: 20px;
  border: 1px solid rgba(198, 163, 90, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(239, 224, 192, 0.94), rgba(215, 196, 158, 0.9)),
    radial-gradient(90% 70% at 12% 0%, rgba(198, 163, 90, 0.12), transparent 58%);
  color: rgba(28, 19, 12, 0.84);
  font-family: var(--serif);
  box-shadow: inset 0 1px 0 rgba(255, 248, 225, 0.48), 0 18px 44px rgba(0, 0, 0, 0.24);
}
.intro-board p {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
}
.intro-board .intro-prose {
  font-family: var(--kai);
  font-size: 19px;
  line-height: 2.08;
  font-weight: 500;
  letter-spacing: 0.045em;
  color: rgba(31, 22, 14, 0.9);
  text-align: justify;
  text-justify: inter-ideograph;
}
.intro-board .intro-prose:first-child {
  padding-top: 2px;
  font-size: 20px;
  color: rgba(24, 17, 11, 0.94);
}
.intro-board .intro-note-copy {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(111, 42, 28, 0.14);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.76;
  letter-spacing: 0.035em;
  color: rgba(55, 38, 25, 0.62);
}
.intro-board .intro-note-copy + .intro-note-copy {
  margin-top: -6px;
  padding-top: 0;
  border-top: 0;
}
.intro-page {
  display: grid;
  gap: 18px;
}
.intro-page[hidden] {
  display: none;
}
.intro-page-play {
  gap: 14px;
}
.play-guide {
  display: grid;
  gap: 12px;
}
.play-guide-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 13px 15px;
  border: 1px solid rgba(111, 42, 28, 0.18);
  border-left: 3px solid rgba(111, 42, 28, 0.52);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 248, 225, 0.38), rgba(111, 42, 28, 0.045)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.play-guide-key {
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 0 10px;
  border: 1px solid rgba(111, 42, 28, 0.26);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(66, 37, 21, 0.92), rgba(31, 21, 13, 0.92)),
    rgba(111, 42, 28, 0.88);
  color: #f7e6b9;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 238, 190, 0.14), 0 8px 18px rgba(54, 28, 14, 0.2);
}
.play-guide-row h3 {
  margin: 0 0 5px;
  color: rgba(37, 25, 15, 0.94);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.play-guide-row p {
  color: rgba(38, 28, 18, 0.78);
  font-family: var(--kai);
  font-size: 16px;
  line-height: 1.74;
  letter-spacing: 0.035em;
}
.intro-placeholder {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 34px;
  border: 1px dashed rgba(111, 42, 28, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.24), rgba(111, 42, 28, 0.05)),
    radial-gradient(80% 90% at 50% 0%, rgba(198, 163, 90, 0.14), transparent 64%);
  text-align: center;
}
.intro-placeholder span {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(70, 33, 20, 0.86);
}
.intro-placeholder p {
  max-width: 440px;
  color: rgba(45, 31, 20, 0.66);
  font-size: 15px;
  line-height: 1.8;
}
.intro-highlights {
  display: grid;
  gap: 18px;
  padding: 2px 0 4px;
}
.intro-highlight-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.intro-highlight-item h3 {
  margin: 4px 0 0;
  color: rgba(38, 27, 16, 0.92);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.intro-highlight-item p {
  color: rgba(30, 22, 14, 0.84);
  font-family: var(--kai);
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.045em;
  text-align: justify;
  text-justify: inter-ideograph;
}
.intro-highlight-item mark {
  display: inline;
  padding: 0 0.18em 0.04em;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(123, 111, 15, 0.88), rgba(92, 82, 10, 0.9));
  color: #fff4b8;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
.intro-notes {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(111, 42, 28, 0.22);
}
.intro-notes span {
  color: rgba(45, 31, 20, 0.72);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.intro-notes span::before {
  content: "卷";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border: 1px solid rgba(111, 42, 28, 0.32);
  border-radius: 999px;
  color: rgba(111, 42, 28, 0.78);
  font-size: 12px;
}
.intro-start-btn {
  justify-self: center;
  min-width: 170px;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid rgba(111, 42, 28, 0.42);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(111, 42, 28, 0.92), rgba(44, 25, 14, 0.92));
  color: #f2dfae;
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: 0.18em;
}
.intro-start-btn:hover {
  color: #fff1d0;
  border-color: rgba(111, 42, 28, 0.72);
  box-shadow: 0 0 28px rgba(111, 42, 28, 0.24);
}
.setting-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 16px 20px;
  border: 1px solid rgba(198, 163, 90, 0.24);
  border-left: 4px solid rgba(198, 163, 90, 0.64);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.28), rgba(6, 5, 4, 0.42)),
    rgba(6, 5, 4, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.045);
}
.setting-name {
  font-family: var(--serif);
  color: #e8d5a3;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.setting-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 14px;
}
.setting-control output {
  color: rgba(234, 223, 200, 0.72);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: right;
}
.setting-control input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}
.setting-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(198, 163, 90, 0.78), rgba(198, 163, 90, 0.22));
}
.setting-control input[type="range"]::-webkit-slider-thumb {
  margin-top: -5px;
}
.setting-control input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(198, 163, 90, 0.78), rgba(198, 163, 90, 0.22));
}
.setting-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.setting-segments button,
.setting-return-btn {
  min-height: 42px;
  border: 1px solid rgba(198, 163, 90, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(234, 223, 200, 0.035), rgba(0, 0, 0, 0.02)),
    rgba(10, 8, 6, 0.46);
  color: rgba(234, 223, 200, 0.76);
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: 0.16em;
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.04);
}
.setting-segments button:hover,
.setting-segments button.active,
.setting-return-btn:hover {
  color: #fff1d0;
  border-color: var(--gold);
  background:
    linear-gradient(90deg, rgba(111, 42, 28, 0.7), rgba(20, 14, 9, 0.78)),
    rgba(10, 8, 6, 0.28);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 235, 186, 0.08);
}
.setting-return-btn {
  justify-self: center;
  min-width: 164px;
  margin-top: auto;
  padding: 0 22px;
}
.setting-save-note {
  justify-self: center;
  max-width: 430px;
  margin: -4px 0 0;
  color: rgba(234, 223, 200, 0.52);
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: 0.08em;
  text-align: center;
}
.cover-footer {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 24px clamp(28px, 5vw, 72px) 28px;
  border-top: 1px solid #2a1f15;
  background: rgba(10, 8, 6, 0.9);
  backdrop-filter: blur(8px);
}
.cover-chapters {
  display: flex;
  min-width: 0;
}
.cover-chapter {
  padding: 0 24px;
  border-right: 1px solid #2a1f15;
}
.cover-chapter:first-child { padding-left: 0; }
.cover-chapter:last-child { border-right: 0; }
.cover-chapter-num {
  font-size: 11px;
  color: #5a4530;
  letter-spacing: 0.3em;
}
.cover-chapter-name {
  margin-top: 4px;
  color: #c4a87a;
  font-size: 14px;
  letter-spacing: 0.15em;
  white-space: nowrap;
}
.cover-chapter.active .cover-chapter-name { color: #e8d5a3; }
.cover-stats {
  display: flex;
  gap: 24px;
}
.cover-stat { text-align: right; }
.cover-stat-num {
  color: #d4a574;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.cover-stat-num span {
  margin-left: 2px;
  color: #6b5540;
  font-size: 11px;
}
.cover-stat-label {
  margin-top: 2px;
  color: #5a4530;
  font-size: 10px;
  letter-spacing: 0.3em;
}
.time-overlay {
  position: absolute;
  z-index: 11;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 36px));
  padding: 26px 32px;
  text-align: center;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(90deg, transparent, rgba(10,8,6,0.78) 18%, rgba(10,8,6,0.82) 82%, transparent);
  box-shadow: 0 20px 80px rgba(0,0,0,0.45);
  animation: timeIn 420ms ease both;
}
/* 报幕淡出：不再"啪一下"消失 */
.time-overlay.leaving {
  animation: none;
  transition: opacity 520ms ease, transform 520ms ease;
  opacity: 0;
  transform: translate(-50%, -58%);
  pointer-events: none;
}
.time-overline {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.22em;
}
.time-title {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  color: var(--paper-bright);
}
.time-overlay p {
  margin: 10px auto 0;
  max-width: 640px;
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.7;
}
@keyframes timeIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.archive-toggle {
  display: none;
  position: absolute;
  z-index: 12;
  top: 112px;
  right: 18px;
  width: auto;
  padding: 0 13px;
  font-size: 13px;
}

.time-hud {
  display: none;
  position: absolute;
  z-index: 10;
  top: 72px;
  right: 18px;
  max-width: min(440px, calc(100vw - 36px));
  padding: 9px 13px;
  border: 1px solid rgba(195, 164, 92, 0.36);
  border-radius: 6px;
  background: rgba(10, 8, 6, 0.68);
  backdrop-filter: blur(7px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.32);
  text-align: right;
}
.time-hud-chapter {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.time-hud-current {
  margin-top: 3px;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.archive-card {
  position: absolute;
  z-index: 13;
  right: 18px;
  top: 162px;
  width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid rgba(195, 164, 92, 0.42);
  border-radius: 6px;
  background: rgba(12, 10, 8, 0.86);
  backdrop-filter: blur(8px);
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.7;
  box-shadow: var(--shadow);
}
.archive-label {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  margin-bottom: 5px;
}

.choice-layer {
  position: absolute;
  z-index: 9;
  top: clamp(138px, 31vh, 260px);
  right: clamp(20px, 5vw, 76px);
  width: min(390px, 34vw);
  display: grid;
  gap: 9px;
  justify-items: stretch;
}

.puzzle-layer {
  position: absolute;
  inset: 0;
  z-index: 18;
  background: #090806;
}
.puzzle-layer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #090806;
}

.input-card {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(195, 164, 92, 0.32);
  border-right-color: rgba(240, 210, 138, 0.58);
  background: linear-gradient(90deg, rgba(9, 8, 7, 0.54), rgba(12, 10, 8, 0.86));
  backdrop-filter: blur(10px);
  border-radius: 2px;
  box-shadow: 0 18px 54px rgba(0,0,0,0.38);
}
.input-card label {
  display: block;
  margin-bottom: 7px;
  color: #f0d28a;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.input-card textarea {
  width: 100%;
  resize: none;
  min-height: 70px;
  border: 1px solid rgba(230, 221, 200, 0.2);
  border-radius: 2px;
  background: rgba(7, 6, 5, 0.78);
  color: #f4e7cf;
  padding: 9px 10px;
  line-height: 1.55;
  outline: none;
}
.input-card textarea:focus { border-color: var(--gold); }

.choices {
  width: 100%;
  display: grid;
  gap: 8px;
}
.choice-btn {
  position: relative;
  text-align: left;
  border: 1px solid rgba(230, 221, 200, 0.2);
  border-right-color: rgba(240, 210, 138, 0.5);
  background: linear-gradient(90deg, rgba(9, 8, 7, 0.48), rgba(18, 15, 12, 0.86));
  color: #f4e7cf;
  backdrop-filter: blur(10px);
  border-radius: 2px;
  padding: 11px 16px 11px 18px;
  line-height: 1.55;
  min-height: 46px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.34);
  text-shadow: 0 1px 8px rgba(0,0,0,0.76);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.choice-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(240, 210, 138, 0.68);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.choice-btn:hover,
.choice-btn.selected {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(90, 24, 18, 0.7), rgba(35, 22, 14, 0.9));
  transform: translateX(-4px);
}
.choice-btn:hover::before,
.choice-btn.selected::before {
  opacity: 1;
}

.dialogue-panel {
  position: absolute;
  z-index: 8;
  left: clamp(14px, 4vw, 64px);
  right: clamp(14px, 4vw, 64px);
  bottom: clamp(54px, 7vh, 78px);
  min-height: 174px;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(234, 223, 200, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(16, 12, 9, 0.76), rgba(8, 6, 5, 0.68)),
    radial-gradient(140% 120% at 0% 0%, rgba(198, 163, 90, 0.07), transparent 46%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(234, 223, 200, 0.10),
    inset 0 0 0 1px rgba(198, 163, 90, 0.06);
  backdrop-filter: blur(11px) saturate(1.06);
}
/* 顶部金色细线：低调的高级点缀 */
.dialogue-panel::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.5), transparent);
  pointer-events: none;
}

.dialogue-tools {
  position: absolute;
  right: 4px;
  bottom: -38px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 3;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.86);
}
.dialogue-tool-btn {
  position: relative;
  min-width: 0;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(198, 163, 90, 0.76);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  box-shadow: none;
  transition: color 160ms ease, transform 160ms ease, text-shadow 160ms ease;
}
.dialogue-tool-btn::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198, 163, 90, 0.7), transparent);
  opacity: 0;
  transform: scaleX(0.72);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}
.dialogue-tool-btn:hover,
.dialogue-tool-btn:focus-visible {
  color: #efd889;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 14px rgba(198, 163, 90, 0.34);
  transform: translateY(-2px);
  outline: none;
}
.dialogue-tool-btn:hover::before,
.dialogue-tool-btn:focus-visible::before {
  opacity: 1;
  transform: scaleX(1);
}
.dialogue-tool-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}
.space-cue {
  position: absolute;
  left: 50%;
  bottom: -38px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--gold);
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
}
.space-cue span {
  min-width: 82px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.22em;
  text-align: center;
}
.space-cue i {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--gold);
  filter: drop-shadow(0 2px 8px rgba(198, 163, 90, 0.5));
  animation: cueBounce 1300ms ease-in-out infinite;
}
@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(5px); opacity: 1; }
}

.portrait-frame {
  position: relative;
  width: 116px;
  height: 140px;
  align-self: center;
  border: 1px solid rgba(195, 164, 92, 0.42);
  border-radius: 7px;
  background: rgba(17, 13, 9, 0.8);
  box-shadow: inset 0 0 0 1px rgba(198, 163, 90, 0.12), 0 6px 20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(8, 6, 5, 0.42));
}
.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  filter: contrast(1.03) saturate(0.9);
}
.portrait.on { display: block; }
.dialogue-panel.no-portrait { grid-template-columns: 1fr; }
.dialogue-panel.no-portrait .portrait-frame { display: none; }

.dialogue-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}
.speaker-row {
  display: flex;
  align-items: center;
  min-height: 34px;
}
.speaker-name {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 32px;
  padding: 3px 2px 3px 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--paper-bright);
}
.speaker-name::before {
  content: "";
  width: 3px;
  height: 21px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), rgba(198, 163, 90, 0.28));
  box-shadow: 0 0 8px rgba(198, 163, 90, 0.35);
}
/* 旁白：不显示说话人标签，台词在框内垂直居中 */
.dialogue-panel.narrator .speaker-row { display: none; }
.dialogue-panel.narrator .dialogue-main {
  grid-template-rows: 1fr;
  align-items: center;
}
.text-box {
  min-height: 66px;
  max-height: 116px;
  overflow: auto;
  padding-right: 8px;
  color: #f5ead5;
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.72;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.55);
}
.text-box p { margin: 0; }
.text-box .quote { color: #fff4df; font-family: var(--serif); }

.primary-btn,
.ghost-btn {
  min-width: 92px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
}
.primary-btn { color: #fff2df; background: var(--red); }
.primary-btn:hover { background: var(--red-lit); }
.ghost-btn {
  color: var(--paper-dim);
  background: rgba(12, 10, 8, 0.28);
  border-color: var(--line);
}
.ghost-btn:hover { color: var(--paper); border-color: var(--gold); }
.ghost-btn:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 760px) {
  .topbar { top: 10px; left: 10px; right: 10px; }
  .brand-title { font-size: 16px; }
  .brand-sub { display: none; }
  .progress { padding: 5px 9px; }
  .title-screen {
    padding: 0;
    overflow: hidden;
  }
  .cover-stage { width: 100%; height: 100%; }
  .cover-hero {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
  .cover-title {
    left: 18px;
    right: 18px;
    bottom: 392px;
  }
  .cover-title h1 {
    font-size: clamp(30px, 8vw, 42px);
    letter-spacing: 0.08em;
  }
  .cover-sub {
    font-size: 11px;
    letter-spacing: 0.18em;
  }
  .cover-quote {
    top: 18px;
    right: 18px;
    left: 36px;
    max-width: none;
  }
  .cover-quote p { font-size: 13px; line-height: 1.62; letter-spacing: 0.05em; }
  .cover-quote p span { white-space: normal; }
  .cover-quote::before { inset: -16px -22px -18px -30px; }
  .cover-menu {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 172px;
    width: auto;
    transform: none;
    gap: 8px;
  }
  .cover-menu::before {
    inset: -18px -16px;
  }
  .cover-menu-item {
    grid-template-columns: 38px 1fr;
    min-height: 48px;
    padding: 8px 14px 8px 12px;
  }
  .cover-menu-kicker {
    font-size: 10px;
  }
  .cover-menu-title {
    font-size: 17px;
    letter-spacing: 0.18em;
  }
  .cover-device-hint {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(390px, calc(100vw - 36px));
    min-height: 54px;
    padding: 12px 18px;
    font-size: 17px;
    letter-spacing: 0.1em;
    text-indent: 0.1em;
  }
  .cover-mentor-link {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 126px;
    width: auto;
    min-height: 38px;
    grid-template-columns: 1fr 40px;
    padding-left: 18px;
    font-size: 16px;
  }
  .cover-mentor-link i {
    min-height: 38px;
  }
  .cover-intro-link {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 80px;
    width: auto;
    min-height: 36px;
    font-size: 14px;
  }
  .cover-panel {
    left: 50%;
    top: 50%;
    width: calc(100vw - 20px);
    height: min(650px, calc(100vh - 40px));
    min-height: 0;
    max-height: none;
    transform: translate(-50%, -50%);
    overflow: hidden;
    padding: 16px;
  }
  .title-screen.in-game-menu .cover-panel {
    width: calc(100vw - 20px);
    height: min(650px, calc(100vh - 40px));
  }
  .settings-panel {
    width: calc(100vw - 20px);
    height: min(650px, calc(100vh - 40px));
  }
  .intro-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 40px);
    overflow: auto;
  }
  .intro-board {
    padding: 18px;
  }
  .intro-board p {
    font-size: 15px;
    line-height: 1.78;
  }
  .intro-board .intro-prose {
    font-size: 17px;
    line-height: 1.92;
    letter-spacing: 0.03em;
  }
  .intro-board .intro-prose:first-child {
    font-size: 18px;
  }
  .intro-board .intro-note-copy {
    font-size: 13px;
    line-height: 1.68;
  }
  .play-guide {
    gap: 10px;
  }
  .play-guide-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
  }
  .play-guide-key {
    min-height: 36px;
    justify-self: start;
    min-width: 96px;
    font-size: 13px;
  }
  .play-guide-row h3 {
    font-size: 16px;
  }
  .play-guide-row p {
    font-size: 15px;
    line-height: 1.68;
  }
  .intro-highlights {
    gap: 16px;
  }
  .intro-highlight-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .intro-highlight-item h3 {
    font-size: 16px;
    letter-spacing: 0.06em;
  }
  .intro-highlight-item p {
    font-size: 15px;
    line-height: 1.78;
    letter-spacing: 0.03em;
  }
  .setting-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .setting-control {
    grid-template-columns: minmax(0, 1fr) 46px;
  }
  .cover-panel h2 {
    font-size: 25px;
  }
  .chapter-board {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(138px, 0.45fr) minmax(0, 1fr);
    gap: 12px;
    height: calc(100% - 70px);
  }
  .chapter-slots { padding: 9px; }
  .chapter-slot {
    min-height: 48px;
    padding: 9px 12px;
  }
  .chapter-slot-title { font-size: 15px; letter-spacing: 0.08em; }
  .chapter-detail {
    min-height: 0;
    padding: 16px;
  }
  .chapter-detail-empty {
    min-height: 180px;
  }
  .chapter-detail h3 {
    font-size: 22px;
  }
  .chapter-detail-desc {
    font-size: 16px;
    line-height: 1.76;
  }
  .chapter-scene-figure {
    margin-top: 18px;
    aspect-ratio: 16 / 8.5;
    min-height: 116px;
  }
  .archive-board {
    height: calc(100% - 70px);
  }
  .archive-shelf {
    padding: 9px;
  }
  .archive-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .archive-lightbox {
    width: 100vw;
    height: 100vh;
    gap: 8px;
    padding: 52px 8px 14px;
  }
  .archive-lightbox-close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    min-width: 78px;
    height: 36px;
    padding: 0 10px;
  }
  .archive-expanded-photo {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 150px);
  }
  .archive-expanded-photo img {
    max-height: calc(100vh - 160px);
  }
  .archive-qa {
    width: calc(100vw - 28px);
    margin: 0 auto max(8px, env(safe-area-inset-bottom));
    padding: 8px;
  }
  .archive-qa-title {
    font-size: 15px;
  }
  .archive-qa-form {
    grid-template-columns: minmax(0, 1fr) 72px;
    min-height: 44px;
  }
  .archive-qa-form input {
    padding: 0 12px;
    font-size: 13px;
    letter-spacing: 0.04em;
  }
  .archive-qa-form button {
    min-height: 44px;
    font-size: 12px;
    letter-spacing: 0.1em;
  }
  .archive-answer {
    max-height: 118px;
    font-size: 13px;
  }
  .mentor-board {
    height: calc(100% - 70px);
    gap: 10px;
  }
  .mentor-envelope {
    padding: 10px;
    gap: 10px;
  }
  .mentor-mail-route {
    min-height: 34px;
    font-size: 11px;
  }
  .mentor-mail-route i {
    width: 28px;
    height: 18px;
  }
  .mentor-mail-route span {
    margin-top: 18px;
  }
  @keyframes mentorMailTravel {
    0% { transform: translateX(calc(-50% + 92px)); opacity: 0.15; }
    18% { opacity: 1; }
    48% { transform: translateX(-50%); opacity: 1; }
    82% { opacity: 1; }
    100% { transform: translateX(calc(-50% - 92px)); opacity: 0.15; }
  }
  .mentor-note {
    padding: 12px;
  }
  .mentor-note span {
    font-size: 16px;
  }
  .mentor-note p,
  .mentor-answer {
    font-size: 14px;
  }
  .mentor-letter-label {
    min-height: 30px;
    padding: 8px 12px 0;
    font-size: 15px;
  }
  .mentor-answer {
    padding: 6px 14px 14px;
    line-height: 1.76;
  }
  .mentor-input-row {
    grid-template-columns: 1fr;
    padding: 6px 10px 10px;
    gap: 8px;
  }
  .mentor-form textarea {
    min-height: 68px;
  }
  .mentor-form button {
    min-height: 42px;
  }
  .settings-board {
    height: calc(100% - 70px);
    gap: 11px;
    overflow: auto;
  }
  .setting-row {
    min-height: 0;
    padding: 13px 14px;
  }
  .cover-footer {
    position: absolute;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding: 18px;
  }
  .cover-chapters {
    flex-wrap: wrap;
    gap: 14px 0;
  }
  .cover-chapter {
    width: 50%;
    padding: 0 14px 0 0;
  }
  .cover-chapter:nth-child(2n) { border-right: 0; padding-left: 14px; }
  .cover-chapter-name { font-size: 13px; }
  .cover-stats {
    width: 100%;
    justify-content: space-between;
  }
  .cover-stat { text-align: left; }
  .time-hud {
    top: 58px;
    left: 10px;
    right: 10px;
    max-width: none;
    text-align: left;
    padding: 7px 10px;
  }
  .time-hud-chapter { font-size: 11px; }
  .time-hud-current { font-size: 14px; }
  .archive-toggle { top: 116px; right: 10px; height: 36px; }
  .archive-card { right: 10px; top: 158px; width: calc(100vw - 20px); }
  .dialogue-panel {
    left: 10px;
    right: 10px;
    bottom: 46px;
    min-height: 182px;
    grid-template-columns: 82px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .portrait-frame { width: 82px; height: 104px; align-self: start; margin-top: 32px; }
  .speaker-name { font-size: 16px; }
  .text-box { max-height: 98px; font-size: 17px; line-height: 1.65; }
  .choice-layer {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 236px;
    width: auto;
    max-height: calc(100vh - 270px);
    overflow: auto;
  }
  .input-card textarea { min-height: 58px; }
  .choice-btn { padding: 9px 11px; font-size: 14px; }
}
