/* 《青松苑 4 号楼》一屏流沉浸样式系统 (v1.1.0)
 * - 锁定 100dvh 零外层滚动，选项永远处于首屏底端
 * - 去提示化：隐藏冗余数字角标与红边剧透，用时钟、微光与光影传递压迫感
 */

:root {
  --paper: #0E1013;
  --surface: #151920;
  --surface-elev: #1B2028;
  --ink: #F0F2F5;
  --ink2: #C8CFD8;
  --mute: #8D96A3;
  --hair: #2A303A;

  --yellow-paper: #EAE3D2;
  --paper-ink: #1C1B18;
  --stamp-red: #C83226;
  --accent: #D93829;
  --accent-text: #FF8577;
  --ballpoint-blue: #2A5CA8;
  --accent-2: #3B8EE6;
  --accent-2-text: #85C4FF;
  --crt-green: #4E8C62;
  --crt-bright: #68C184;
  --rust-brown: #8C4A2B;
  --gold-seal: #C9A86A;
  --red-pen: #9E2A2B;

  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ambient-tint: rgba(78, 140, 98, 0.06);
  --ambient-line: rgba(78, 140, 98, 0.35);
  --vignette-alpha: 0.14;
  --vignette-color: 0, 0, 0;
}

html[data-book="B1"] { --ambient-tint: rgba(130, 195, 160, 0.07); --ambient-line: #4E8C62; }
html[data-book="B2"] { --ambient-tint: rgba(78, 140, 98, 0.10); --ambient-line: #68C184; }
html[data-book="B3"] { --ambient-tint: rgba(186, 118, 56, 0.09); --ambient-line: #8C4A2B; }
html[data-book="B4"] { --ambient-tint: rgba(205, 214, 224, 0.07); --ambient-line: #8E96A0; }

html[data-exposure-tier="0"] { --vignette-alpha: 0.12; --vignette-color: 0, 0, 0; }
html[data-exposure-tier="1"] { --vignette-alpha: 0.32; --vignette-color: 8, 4, 6; }
html[data-exposure-tier="2"] { --vignette-alpha: 0.56; --vignette-color: 48, 8, 12; }
html[data-exposure-tier="3"] { --vignette-alpha: 0.78; --vignette-color: 70, 6, 10; }

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse at 50% 0%, var(--ambient-tint) 0%, transparent 65%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 3px
    );
}

.hidden { display: none !important; }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* 雨夜粒子底层画布 */
.rain-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 38;
}

/* 时间倒流过场遮罩 */
.rewind-layer {
  position: fixed;
  inset: 0;
  z-index: 118;
  background: rgba(8, 10, 13, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.rewind-layer.active {
  opacity: 1;
  pointer-events: all;
}
.rewind-clock {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(217, 56, 41, 0.45);
}
.rewind-sub {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--yellow-paper);
  text-align: center;
  letter-spacing: 0.04em;
}

/* 视觉污染层 */
.exposure-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: radial-gradient(
    circle at 50% 45%,
    transparent 42%,
    rgba(var(--vignette-color), var(--vignette-alpha)) 100%
  );
  transition: background 0.45s ease;
}

.exposure-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 41;
  opacity: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(104, 193, 132, 0.04) 0px,
    rgba(104, 193, 132, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  transition: opacity 0.4s ease;
}

html[data-book="B2"] .exposure-scanlines { opacity: 0.75; }

@keyframes fluorescent-flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.86; }
  98% { opacity: 0.98; }
  99% { opacity: 0.89; }
}
html[data-book="B1"] .top-hud { animation: fluorescent-flicker 11s infinite; }

@keyframes clock-glitch {
  0%, 92%, 100% { transform: translateX(0); color: var(--ink); }
  93% { transform: translateX(-1px); color: var(--accent-text); }
  95% { transform: translateX(1px); color: var(--accent-2-text); }
}
html[data-exposure-tier="1"] .hud-clock,
html[data-exposure-tier="2"] .hud-clock { animation: clock-glitch 18s infinite; }

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hud-clock.is-urgent {
  color: var(--accent-text);
  animation: pulse-red 1.3s infinite;
}

html[data-exposure-tier="2"] .option-btn.is-hallucination {
  text-shadow: -1px 0 rgba(217, 56, 41, 0.7), 1px 0 rgba(59, 142, 230, 0.7);
}

/* 悬浮非占位证物提示（丝滑升降） */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translate(-50%, -10px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.floating-toast {
  position: fixed;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
  background: rgba(18, 24, 34, 0.95);
  border: 1px solid rgba(59, 142, 230, 0.6);
  color: #CFE6FF;
  font-size: 12px;
  padding: 5px 12px;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-toast.is-hiding {
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.97);
}

/* 黑屏过渡层 */
.exposure-blackout {
  position: fixed;
  inset: 0;
  background: #050506;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.exposure-blackout.active { opacity: 1; pointer-events: all; }
.blackout-quote {
  max-width: 340px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.7;
  color: #EAE3D2;
}

/* 居中阅读视口：移动端贴边、桌面端自适应舒适宽度 */
.app-shell {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(14, 16, 19, 0.94);
  border-left: 1px solid rgba(42, 48, 58, 0.5);
  border-right: 1px solid rgba(42, 48, 58, 0.5);
  position: relative;
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 660px;
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.55);
  }
}

/* 40px 顶部固定细栏 HUD */
.top-hud {
  flex: 0 0 40px;
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(14, 16, 19, 0.96);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 1px 0 var(--ambient-line);
  z-index: 30;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-icon-btn {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--ink2);
  height: 26px;
  padding: 0 7px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.hud-clock {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crt-bright);
  box-shadow: 0 0 5px rgba(104, 193, 132, 0.55);
}
.ap-dot.spent { background: #262C35; box-shadow: none; }
.ap-dot.danger { background: var(--accent); box-shadow: 0 0 7px rgba(217, 56, 41, 0.9); }

.anomaly-box {
  display: flex;
  align-items: center;
  gap: 5px;
}
.anomaly-label {
  font-size: 10.5px;
  color: var(--mute);
  white-space: nowrap;
}
html[data-exposure-tier="1"] .anomaly-label { color: #D49A45; }
html[data-exposure-tier="2"] .anomaly-label,
html[data-exposure-tier="3"] .anomaly-label { color: var(--accent-text); }

.anomaly-track {
  width: 32px;
  height: 4px;
  background: #232832;
  border-radius: 2px;
  overflow: hidden;
}
.anomaly-fill {
  height: 100%;
  background: var(--accent-2);
  transition: width 0.35s ease, background 0.35s ease;
}
html[data-exposure-tier="1"] .anomaly-fill { background: #D49A45; }
html[data-exposure-tier="2"] .anomaly-fill,
html[data-exposure-tier="3"] .anomaly-fill { background: var(--accent); animation: pulse-red 1.2s infinite; }

/* 主视口容器：自适应舒适阅读区（隐藏原生滚动条） */
.main-stage {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .main-stage {
    padding: 20px 28px 28px;
  }
}

/* PLAY 视图自适应活动布局：信息与选项同处舒适阅读区 */
@keyframes docEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

button {
  touch-action: manipulation;
  user-select: none;
}
button > * {
  pointer-events: none;
}

.play-layout {
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
}

.stage-doc-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px;
}

.stage-doc-zone > * {
  animation: docEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stage-options-zone {
  flex: 0 0 auto;
  padding-top: 14px;
  border-top: 1px solid rgba(42, 48, 58, 0.55);
  transition: opacity 0.28s ease;
}
.stage-options-zone.is-waiting-seq {
  opacity: 0.22;
  pointer-events: none;
}
.options-prompt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink2);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.options-prompt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ambient-line);
  box-shadow: 0 0 6px var(--ambient-line);
  flex-shrink: 0;
}

.wx-skip-hint {
  font-size: 11px;
  color: var(--accent-2-text);
  cursor: pointer;
}
.wx-seq-item.wx-pending {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.wx-seq-item.wx-entering {
  animation: docEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wx-msg.is-recalling {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.wx-sys-note.is-recalled {
  color: #9AA4B2;
  animation: docEnter 0.24s ease both;
}

.stage-options-zone .option-btn {
  animation: optEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stage-options-zone .option-btn:nth-child(1) { animation-delay: 0.03s; }
.stage-options-zone .option-btn:nth-child(2) { animation-delay: 0.05s; }
.stage-options-zone .option-btn:nth-child(3) { animation-delay: 0.07s; }
.stage-options-zone .option-btn:nth-child(4) { animation-delay: 0.09s; }
.stage-options-zone .option-btn:nth-child(5) { animation-delay: 0.11s; }
.stage-options-zone .option-btn:nth-child(6) { animation-delay: 0.13s; }

@keyframes bannerShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.scene-banner-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 280px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(110deg, #12161d 30%, #1d2430 50%, #12161d 70%);
  background-size: 200% 100%;
  animation: bannerShimmer 1.6s linear infinite;
}

.scene-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  filter: contrast(1.06) brightness(0.92);
  transition: opacity 0.34s ease;
}
.scene-banner-img.is-loaded {
  opacity: 1;
}

/* =========================================================
 * 三幕互动式开场分镜 (ColdOpen)
 * ========================================================= */
.cold-open-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  animation: docEnter 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cold-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}
.cold-topbar.is-centered {
  justify-content: center;
}
.cold-mini-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hair);
  color: var(--ink2);
  font-size: 11.5px;
  padding: 4px 8px;
  cursor: pointer;
}
.cold-dots { display: flex; gap: 6px; align-items: center; }
.cold-dot { width: 16px; height: 3px; background: #2A303A; transition: background 0.25s ease; }
.cold-dot.done { background: var(--accent-2); }
.cold-dot.active { background: var(--stamp-red); }

.cold-stage-center {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
.cold-stage-center.compact-gap { gap: 8px; }
.cold-caption-wrap { text-align: center; }
.cold-eyebrow { font-size: 11px; color: var(--accent-text); letter-spacing: 0.08em; margin-bottom: 4px; }
.cold-headline {
  font-family: var(--font-display);
  font-size: 19.5px;
  font-weight: 900;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

/* 第1幕：执勤证登记卡 */
.badge-card {
  background: var(--surface-elev);
  border: 1px solid var(--hair);
  border-top: 3px solid var(--accent-2);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.badge-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--accent-2-text);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 6px;
}
.badge-seal {
  border: 1px solid var(--stamp-red);
  color: var(--accent-text);
  padding: 1px 5px;
  font-size: 10px;
}
.badge-field { display: flex; flex-direction: column; gap: 5px; }
.badge-label { font-size: 11.5px; color: var(--mute); }
.badge-name-row { display: flex; gap: 6px; }
.badge-input {
  flex: 1;
  min-width: 0;
  background: #0D1014;
  border: 1px solid #353D4B;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 7px 10px;
  outline: none;
}
.badge-input:focus { border-color: var(--accent-2); }
.badge-rand-btn {
  background: var(--surface);
  border: 1px solid var(--hair);
  color: var(--ink2);
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
}
.gender-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gender-pill {
  background: #101318;
  border: 1px solid var(--hair);
  color: var(--mute);
  padding: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.gender-pill.active {
  border-color: var(--accent-2);
  background: rgba(59, 142, 230, 0.14);
  color: var(--ink);
}
.badge-duty {
  background: rgba(0, 0, 0, 0.28);
  border-left: 2px solid var(--stamp-red);
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink2);
}

/* 第2幕：孤楼疑云对比 */
.intel-grid { display: flex; flex-direction: column; gap: 10px; }
.intel-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--accent-2);
  padding: 10px 12px;
}
.intel-card.is-red { border-left-color: var(--stamp-red); }
.intel-tag { font-size: 11px; color: var(--accent-2-text); margin-bottom: 6px; }
.intel-card.is-red .intel-tag { color: var(--accent-text); }
.intel-desc { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink2); }
.mini-elev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #090B0E;
  border: 1px solid #252B34;
}
.mini-led { font-size: 13.5px; font-weight: 700; color: #FF5B4D; min-width: 72px; }
.mini-led.is-glitch { color: #FFF; text-shadow: -1px 0 #FF3B30, 1px 0 #3B8EE6; }
.mini-keys { display: flex; gap: 5px; }
.mini-keys span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #4A5260;
  color: var(--ink2);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-keys span.welded { border-style: dashed; border-color: #5C2B2E; color: #8A4348; }

/* 第3幕：拦停与录音机紧凑样式 */
.scene-quote-bar {
  background: rgba(200, 50, 38, 0.1);
  border-left: 2px solid var(--stamp-red);
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #EBD8D5;
}
.recorder-box.compact { padding: 7px 10px; }
.recorder-box.compact .recorder-head { margin-bottom: 5px; }
.wave-strip.compact { height: 20px; }
.witness-stack.compact { gap: 5px; }
.witness-card.compact { padding: 6px 9px; }
.witness-card.compact .witness-quote { font-size: 12.5px; line-height: 1.42; }
.dossier-head { display: flex; justify-content: space-between; align-items: center; }

/* 废弃旧版电梯面板样式已清理，改用 .mini-elev-row */

/* 分镜2：录音机与动态声波 */
.recorder-box {
  background: #0A0D10;
  border: 1px solid #2A323C;
  padding: 10px 12px;
}
.recorder-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--crt-bright);
  margin-bottom: 8px;
}
.wave-strip {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
@keyframes wavePulse {
  0%, 100% { height: 22%; opacity: 0.55; }
  50% { height: 95%; opacity: 1; }
}
.wave-bar {
  flex: 1;
  height: 40%;
  background: var(--crt-bright);
  animation: wavePulse 0.72s ease-in-out infinite;
}
.wave-bar:nth-child(3n) { background: var(--accent); }

.witness-stack { display: flex; flex-direction: column; gap: 7px; }
.witness-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--accent-2);
  padding: 8px 10px;
  animation: docEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.witness-who { font-size: 11px; color: var(--accent-2-text); margin-bottom: 2px; }
.witness-quote { font-size: 13px; line-height: 1.48; color: var(--ink); }

/* 分镜3：档案袋与撕封条动效 */
.dossier-envelope {
  position: relative;
  background: #D9CEB2;
  color: #1D1B17;
  padding: 16px 14px 20px;
  border: 1px solid #B7AA8A;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.52);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}
.dossier-envelope.is-torn { transform: scale(1.04); opacity: 0.12; }
.dossier-head {
  font-size: 11px;
  font-weight: 700;
  color: #5C523D;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.dossier-body-text p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: #24211C; }
.dossier-seal-band {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.seal-half {
  flex: 1;
  background: var(--stamp-red);
  color: #FFF5F2;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 6px 4px;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease;
}
.seal-knot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #9E1F16;
  color: #FFE7E2;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #F2B5AA;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.dossier-envelope.is-torn .seal-half.left { transform: translateX(-28px) rotate(-6deg); opacity: 0; }
.dossier-envelope.is-torn .seal-half.right { transform: translateX(28px) rotate(6deg); opacity: 0; }
.dossier-envelope.is-torn .seal-knot { transform: scale(1.4); opacity: 0; }

.btn-primary.cold-cta,
.cold-cta {
  flex: 0 0 auto;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}
@keyframes ctaBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 50, 38, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(200, 50, 38, 0); }
}
.cold-cta.pulse-cta { animation: ctaBreath 1.8s infinite; }

/* =========================================================
 * 一屏流档案大厅
 * ========================================================= */
.lobby-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.lobby-banner {
  position: relative;
  height: clamp(88px, 14dvh, 128px);
  border: 1px solid var(--hair);
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(110deg, #12161d 30%, #1d2430 50%, #12161d 70%);
  background-size: 200% 100%;
  animation: bannerShimmer 1.6s linear infinite;
}
.lobby-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.48) contrast(1.08);
  display: block;
  transition: opacity 0.34s ease;
}
.lobby-banner img.is-loaded {
  opacity: 1;
}
.lobby-banner-overlay {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(14, 16, 19, 0.88), rgba(14, 16, 19, 0.4));
}
.lobby-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
}
.lobby-sub {
  font-size: 11.5px;
  color: var(--mute);
  margin-top: 2px;
}
.lobby-counter {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink2);
  line-height: 1.45;
}

.book-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  overflow-y: auto;
  overflow-x: hidden;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--hair);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.book-card.unlocked { border-left-color: var(--accent-2); }
.book-card.completed { border-left-color: var(--gold-seal); }
.book-tag-rec {
  border: 1px solid rgba(201, 168, 106, 0.55);
  background: rgba(201, 168, 106, 0.1);
  padding: 1px 5px;
}

.book-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.book-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.book-meta {
  font-size: 11.5px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-teaser {
  font-size: 12.5px;
  color: var(--ink2);
  margin: 0;
  line-height: 1.4;
}
.book-actions {
  display: flex;
  gap: 6px;
}

.lobby-save-tip {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--mute);
  text-align: center;
  letter-spacing: 0.02em;
}

.lobby-footer-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.btn-primary, .btn-secondary, .btn-danger {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--stamp-red); color: #FFF7F5; flex: 1; }
.btn-secondary { background: transparent; border-color: var(--hair); color: var(--ink2); }
.btn-danger { background: transparent; border-color: var(--stamp-red); color: var(--accent-text); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================================================
 * 六大 DocStyle 紧凑拟真皮肤
 * ========================================================= */
.doc-card.style-narrative { padding: 4px 4px; }
.doc-card.style-narrative .doc-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--ink);
}
.doc-card.style-narrative p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.82;
  letter-spacing: 0.015em;
  color: #E2E6ED;
}
.doc-card.style-narrative p:last-child { margin-bottom: 0; }
.doc-card.style-narrative p.audio-cue {
  padding-left: 12px;
  border-left: 2px solid var(--ambient-line);
  color: var(--ink2);
  font-style: italic;
}

.doc-card.style-red_stamp_notice {
  position: relative;
  background: var(--yellow-paper);
  color: var(--paper-ink);
  padding: 18px 18px 20px;
  border: 1px solid #C8BE9E;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}
.notice-header {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--stamp-red);
  padding-bottom: 7px;
  margin-bottom: 11px;
  border-bottom: 2px double var(--stamp-red);
}
.doc-card.style-red_stamp_notice p {
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.72;
  color: #211F1B;
  margin: 0 0 10px;
}
.doc-card.style-red_stamp_notice p:last-of-type { margin-bottom: 0; }
.official-seal-wrap {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 74px;
  height: 74px;
  opacity: 0.72;
  transform: rotate(-8deg);
  pointer-events: none;
}

.doc-card.style-blue_handwrite {
  position: relative;
  margin-top: 8px;
  background: #EFE7CF;
  color: var(--ballpoint-blue);
  padding: 20px 18px 16px;
  border: 1px solid #CFC3A2;
  transform: rotate(-0.4deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
}
.tape-strip {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(1.5deg);
  width: 72px;
  height: 16px;
  background: rgba(236, 229, 200, 0.58);
  border-left: 1px dashed rgba(0, 0, 0, 0.18);
  border-right: 1px dashed rgba(0, 0, 0, 0.18);
}
.doc-card.style-blue_handwrite .doc-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ballpoint-blue);
  margin: 0 0 10px;
  border-bottom: 1px dashed rgba(42, 92, 168, 0.35);
  padding-bottom: 5px;
}
.doc-card.style-blue_handwrite p {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ballpoint-blue);
  margin: 0 0 9px;
}
.doc-card.style-blue_handwrite p.red-ink { color: var(--red-pen); font-weight: 600; }
.doc-card.style-blue_handwrite p.imprint-line {
  color: rgba(42, 92, 168, 0.62);
  font-size: 12.5px;
  border-top: 1px dotted rgba(42, 92, 168, 0.3);
  padding-top: 6px;
  margin-top: 6px;
}

.doc-card.style-wechat_group {
  background: #111317;
  border: 1px solid #2A2E35;
  overflow: hidden;
}
.wx-topbar {
  background: #181B20;
  border-bottom: 1px solid #262A32;
  padding: 7px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.wx-feed { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.wx-time-pill {
  align-self: center;
  background: rgba(255, 255, 255, 0.07);
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 7px;
}
.wx-sys-note { align-self: center; font-size: 11.5px; color: #7E8794; }
.wx-msg { display: flex; gap: 8px; align-items: flex-start; }
.wx-msg.is-me { flex-direction: row-reverse; }
.wx-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: #272E3A;
  border: 1px solid #3A4252;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.wx-avatar.cat { background: #14171D; border-color: var(--accent-2); color: var(--accent-2-text); }
.wx-avatar.manager { background: #2D1819; border-color: var(--stamp-red); color: var(--accent-text); }
.wx-bubble-col { max-width: 80%; display: flex; flex-direction: column; gap: 2px; }
.wx-sender-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mute); }
.wx-ts-anomaly {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid rgba(217, 56, 41, 0.45);
  padding: 0 4px;
}
.wx-bubble {
  background: #232730;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.48;
  border: 1px solid #2F3542;
}
.wx-msg.is-me .wx-bubble { background: #24573D; border-color: #327252; }

.doc-card.style-cctv_log {
  background: #07100B;
  border: 1px solid #22462F;
  padding: 11px 12px;
  font-family: var(--font-mono);
  color: var(--crt-bright);
}
.cctv-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1E3E29;
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-size: 11px;
}
.rec-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 4px;
  animation: pulse-red 1s infinite;
}
.cctv-delay-tag { color: var(--accent-text); border: 1px solid rgba(217, 56, 41, 0.5); padding: 0 4px; }
.doc-card.style-cctv_log p {
  font-family: var(--font-mono);
  font-size: 12.2px;
  line-height: 1.56;
  margin: 0 0 6px;
  color: #8DE0A6;
}
.doc-card.style-cctv_log p:last-child { margin-bottom: 0; }

.doc-card.style-express_slip {
  background: #E5E1D8;
  color: #1A1A19;
  padding: 12px;
  border-top: 2px dashed #8F897B;
  border-bottom: 2px dashed #8F897B;
  position: relative;
  overflow: hidden;
}
.express-waterstain {
  position: absolute;
  right: -18px;
  top: -18px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 74, 43, 0.22), transparent 70%);
  pointer-events: none;
}
.express-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1A1A19;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.express-waybill { font-family: var(--font-mono); font-size: 13.5px; font-weight: 700; }
.doc-card.style-express_slip p { font-size: 13px; line-height: 1.52; color: #20201E; margin: 0 0 5px; }
.express-sign-row {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed #6B6559;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #46423A;
}

/* =========================================================
 * 选项区：双列紧凑网格 + 单列自适应
 * ========================================================= */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.options-stack.is-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.options-stack.is-grid .option-btn.span-full {
  grid-column: 1 / -1;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--ambient-line);
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.42;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.opt-cost {
  font-size: 10.5px;
  color: var(--mute);
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid rgba(141, 150, 163, 0.28);
  border-radius: 2px;
}
.option-btn:hover:not(:disabled) { background: var(--surface-elev); border-color: var(--ink2); }
.option-btn:active:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.dock-btn:active,
.clue-card:active,
.verdict-choice:active {
  background: #202632;
  border-color: var(--accent-2);
}
.option-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 42px 底部常驻双入口 */
.bottom-dock {
  flex: 0 0 42px;
  height: 42px;
  width: 100%;
  background: rgba(14, 16, 19, 0.98);
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: stretch;
  z-index: 35;
}
.dock-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  position: relative;
  transition: background 0.16s ease, transform 0.12s ease;
}
.dock-btn:hover { background: rgba(255, 255, 255, 0.03); }

@keyframes hintBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 142, 230, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(59, 142, 230, 0); }
}

.dock-btn.has-hint .dock-dot.blue {
  animation: hintBreath 1.6s infinite;
}
.dock-btn.has-hint::after {
  content: "可比对";
  font-size: 10px;
  color: var(--accent-2-text);
  border: 1px solid rgba(59, 142, 230, 0.45);
  padding: 0 4px;
  margin-left: 2px;
}
.dock-divider { width: 1px; background: var(--hair); margin: 8px 0; }
.dock-dot { width: 6px; height: 6px; border-radius: 50%; }
.dock-dot.red { background: var(--stamp-red); }
.dock-dot.blue { background: var(--accent-2); }
.dock-badge { font-size: 11px; padding: 1px 5px; background: #232832; color: var(--ink2); }

/* =========================================================
 * 一屏一题《结案推理卷》
 * ========================================================= */
.verdict-view {
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}
.verdict-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 8px;
}
.verdict-dots { display: flex; gap: 6px; }
.verdict-step-dot {
  width: 22px;
  height: 22px;
  border: 1px solid var(--hair);
  background: var(--surface);
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.verdict-step-dot.answered { border-color: var(--accent-2); color: var(--accent-2-text); }
.verdict-step-dot.active { background: var(--stamp-red); border-color: var(--stamp-red); color: #FFF; }
.verdict-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: docEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.verdict-q-title { font-weight: 700; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.verdict-choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 11px;
  background: var(--surface);
  border: 1px solid var(--hair);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink2);
}
.verdict-choice.checked {
  border-color: var(--accent-2);
  background: rgba(59, 142, 230, 0.12);
  color: var(--ink);
}
.verdict-footer { display: flex; gap: 8px; flex: 0 0 auto; }

/* =========================================================
 * 一屏三栏切页结局页
 * ========================================================= */
.ending-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.ending-head-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  padding: 10px 12px;
  flex-shrink: 0;
}
.ending-tier-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  margin-bottom: 4px;
  border: 1px solid currentColor;
}
.ending-tier-badge.TE { color: var(--gold-seal); }
.ending-tier-badge.NE { color: #9BA5B2; }
.ending-tier-badge.BE { color: var(--accent-text); }
.ending-title { font-family: var(--font-display); font-size: 20px; font-weight: 900; margin: 0 0 6px; }
.ending-metrics { display: flex; gap: 12px; font-size: 12px; color: var(--mute); }

.ending-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex-shrink: 0;
}
.ending-tab-btn {
  padding: 7px 6px;
  background: var(--surface);
  border: 1px solid var(--hair);
  color: var(--mute);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.ending-tab-btn.active {
  border-color: var(--ambient-line);
  color: var(--ink);
  background: var(--surface-elev);
}
.ending-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--hair);
  padding: 12px;
}
.share-preview-img {
  max-height: min(35dvh, 250px);
  width: auto;
  max-width: 100%;
  display: block;
  border: 1px solid var(--hair);
  margin: 8px auto;
}
.ending-actions-bar { flex: 0 0 auto; display: flex; gap: 6px; }

/* 抽屉丝滑滑入滑出 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  transition: background 0.14s ease;
}
.drawer-backdrop.is-open {
  background: rgba(0, 0, 0, 0.68);
  pointer-events: auto;
}
.drawer-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 82dvh;
  background: #13161B;
  border-top: 2px solid var(--ambient-line);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.14s ease;
}
@media (min-width: 768px) {
  .drawer-sheet { max-width: 660px; }
}
.drawer-backdrop.is-open .drawer-sheet {
  opacity: 1;
}

/* 首次入场引导浮层 */
.guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(6, 8, 10, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.guide-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.guide-card {
  width: 100%;
  max-width: 410px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #14181F;
  border: 1px solid var(--hair);
  border-top: 3px solid var(--stamp-red);
  padding: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
}
.guide-eyebrow {
  font-size: 10.5px;
  color: var(--accent-text);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.guide-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 10px;
  color: var(--ink);
}
.guide-context {
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--ambient-line);
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink2);
  margin-bottom: 10px;
}
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}
.guide-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--hair);
  padding: 9px 10px;
}
.guide-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2-text);
  border: 1px solid rgba(59, 142, 230, 0.4);
  padding: 1px 5px;
  flex-shrink: 0;
  margin-top: 2px;
}
.guide-step strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}
.guide-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.48;
  color: var(--ink2);
}
.guide-confirm-btn {
  width: 100%;
  padding: 10px;
  font-size: 13.5px;
}
.drawer-header {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-eyebrow { font-size: 10.5px; color: var(--mute); }
.drawer-title { margin: 2px 0 0; font-family: var(--font-display); font-size: 16.5px; }
.drawer-close {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--ink2);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.drawer-body {
  padding: 12px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--stamp-red);
}
.rule-item.is-survivor { border-left-color: var(--accent-2); }
.rule-item.is-refuted { opacity: 0.65; border-left-style: dashed; }
.rule-source { font-size: 11px; color: var(--mute); margin-bottom: 3px; display: flex; justify-content: space-between; }
.rule-text { font-size: 13.5px; color: var(--ink); }
.rule-text.struck { text-decoration: line-through; color: var(--mute); }

.compare-tray { background: #181C23; border: 1px solid var(--hair); padding: 10px; }
.compare-slots { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 6px; margin-bottom: 8px; }
.compare-slot {
  min-height: 40px;
  border: 1px dashed #3A4252;
  padding: 5px 6px;
  font-size: 11.5px;
  color: var(--mute);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.compare-slot.filled { border-style: solid; border-color: var(--accent-2); color: var(--ink); background: rgba(59, 142, 230, 0.08); }
.compare-wire { height: 2px; background: var(--hair); }
.compare-wire.matched { background: var(--stamp-red); box-shadow: 0 0 8px rgba(217, 56, 41, 0.8); }
.clue-grid { display: flex; flex-direction: column; gap: 7px; }
.clue-card { padding: 9px 10px; background: var(--surface); border: 1px solid var(--hair); cursor: pointer; }
.clue-card.selected { border-color: var(--accent-2); background: rgba(59, 142, 230, 0.1); }
.clue-card-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.clue-card-desc { font-size: 12px; color: var(--ink2); line-height: 1.45; }
.verified-contra-box {
  padding: 8px 10px;
  background: rgba(200, 50, 38, 0.12);
  border: 1px solid var(--stamp-red);
  font-size: 12.5px;
  line-height: 1.5;
}
.codex-item {
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.codex-item.locked { opacity: 0.45; }

/* =========================================================
 * 紧凑视口高度温和适配（保持舒适阅读字号与呼吸感，无可见滚动条）
 * ========================================================= */
@media (max-height: 750px) {
  .top-hud { flex: 0 0 38px; height: 38px; }
  .main-stage { padding: 12px 14px 18px; }
  .bottom-dock { flex: 0 0 40px; height: 40px; }

  /* 开场四幕与档案大厅保持整洁不裁切 */
  .cold-open-view { gap: 8px; }
  .cold-stage-center { gap: 9px; }
  .cold-stage-center.compact-gap { gap: 6px; }
  .cold-headline { font-size: 18px; }
  .badge-card { padding: 11px 12px; gap: 8px; }
  .intel-grid { gap: 8px; }
  .intel-card { padding: 9px 11px; }
  .scene-quote-bar { padding: 6px 9px; font-size: 12.5px; line-height: 1.48; }
  .recorder-box.compact { padding: 6px 9px; }
  .wave-strip.compact { height: 16px; }
  .witness-card.compact { padding: 6px 9px; }
  .witness-card.compact .witness-quote { font-size: 12.5px; line-height: 1.42; }
  .dossier-envelope { padding: 13px 13px 15px; }
  .dossier-body-text p { font-size: 13.5px; line-height: 1.56; margin-bottom: 7px; }
  .btn-primary.cold-cta, .cold-cta { padding: 10px 14px; font-size: 13.5px; }

  .lobby-view { gap: 7px; }
  .lobby-banner { height: 76px; }
  .lobby-title { font-size: 18px; }
  .book-list { gap: 6px; }
  .book-card { padding: 8px 11px; gap: 4px; }
  .book-title { font-size: 15px; }
  .book-teaser { font-size: 12.5px; line-height: 1.4; }
  .book-actions .btn-primary,
  .book-actions .btn-secondary,
  .lobby-footer-bar button { padding: 6px 9px; font-size: 12.5px; }

  /* 游玩视图保持舒适字号与行高 */
  .play-layout { gap: 14px; }
  .scene-banner-wrap, .scene-banner-img { max-height: 200px; }
  .share-preview-img { max-height: min(30dvh, 210px); }
  .guide-card { padding: 14px 16px; }
  .guide-steps { gap: 8px; margin-bottom: 12px; }
  .guide-step { padding: 8px 10px; }
}

@media (max-height: 640px) {
  .lobby-banner { height: 64px; }
  .scene-banner-wrap, .scene-banner-img { max-height: 168px; }
  .cold-headline { font-size: 16px; }
  .dossier-envelope { padding: 9px 11px 11px; }
}

.compare-rules-toggle {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 9px;
}
.compare-rules-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  background: rgba(12, 14, 18, 0.7);
  border: 1px solid var(--hair);
}
.clue-role-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}
.clue-role-tag.is-claim {
  color: #FFB4AA;
  background: rgba(200, 50, 38, 0.14);
  border: 1px solid rgba(200, 50, 38, 0.42);
}
.clue-role-tag.is-proof {
  color: var(--accent-2-text);
  background: rgba(59, 142, 230, 0.14);
  border: 1px solid rgba(59, 142, 230, 0.42);
}

/* =========================================================
 * 封面页（细雨暗夜老楼 · 拆封档案）
 * ========================================================= */
.cover-layer {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
  background: #07090b;
  color: #E5E7EB;
  transition: opacity 0.5s ease;
}
.cover-layer.is-leaving { opacity: 0; pointer-events: none; }
.cover-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.cover-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  opacity: 0.8;
  filter: contrast(1.06) saturate(0.85);
  animation: coverBreath 26s ease-in-out infinite alternate;
}
@keyframes coverBreath {
  0% { transform: scale(1.02); }
  100% { transform: scale(1.08) translate3d(-0.6%, -0.8%, 0); }
}
.cover-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(7, 9, 11, 0.16) 0%, rgba(7, 9, 11, 0.72) 68%, rgba(4, 6, 8, 0.96) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.85) 0%, rgba(5, 7, 10, 0.28) 38%, rgba(5, 7, 10, 0.72) 76%, rgba(5, 7, 10, 0.96) 100%);
}
.cover-top, .cover-main, .cover-foot { position: relative; z-index: 2; }
.cover-top {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cover-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #D1D5DB;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: 999px;
}
.cover-audio-btn { cursor: pointer; font-family: inherit; }
.cover-sep { opacity: 0.3; }
.cover-amber { color: #FCD34D; }
.cover-green { color: #34D399; }
.cover-rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444; box-shadow: 0 0 8px #EF4444;
  animation: coverRec 1.5s infinite;
}
@keyframes coverRec { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.22; } }

.cover-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cover-main > * { animation: coverUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cover-main > :nth-child(1) { animation-delay: 0.08s; }
.cover-main > :nth-child(2) { animation-delay: 0.2s; }
.cover-main > :nth-child(3) { animation-delay: 0.34s; }
.cover-main > :nth-child(4) { animation-delay: 0.4s; }
.cover-main > :nth-child(5) { animation-delay: 0.52s; }
@keyframes coverUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cover-dept {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 4px 12px; margin-bottom: 20px;
  font-size: 12px; letter-spacing: 0.22em; color: rgba(209, 213, 219, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.45); border-radius: 3px;
}
.cover-dept i { color: rgba(239, 68, 68, 0.8); font-style: normal; }
.cover-title-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.9);
}
.cover-glitch { display: inline-block; color: #FEE2E2; transition: color 80ms ease; }
.cover-glitch.is-glitching {
  color: #F87171;
  text-shadow: -2px 0 rgba(239, 68, 68, 0.8), 2px 0 rgba(56, 189, 248, 0.65);
  transform: skewX(-8deg);
}
.cover-seal {
  position: absolute; top: -22px; right: -20px;
  padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  color: #EF4444; border: 2px solid rgba(220, 38, 38, 0.78);
  background: rgba(0, 0, 0, 0.4); border-radius: 2px; transform: rotate(-7deg);
  box-shadow: 0 0 18px rgba(185, 28, 28, 0.25);
  animation: coverStamp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
@keyframes coverStamp {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.75); }
  100% { opacity: 0.92; transform: rotate(-7deg) scale(1); }
}
.cover-hook { margin: 0 0 18px; max-width: 360px; font-size: 14.5px; line-height: 1.8; color: rgba(209, 213, 219, 0.92); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9); }
.cover-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 26px; font-size: 12px; color: rgba(209, 213, 219, 0.85); }
.cover-tags span { padding: 4px 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.cover-card {
  width: 100%; max-width: 360px; padding: 18px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}
.cover-returning { text-align: left; margin-bottom: 14px; padding: 10px 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; }
.cover-returning-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.cover-returning-row:last-child { margin-bottom: 0; }
.cover-dim { color: #9CA3AF; font-size: 11.5px; }
.cover-dim b { color: #E5E7EB; }
.cover-gate { text-align: left; margin-bottom: 12px; }
.cover-code-input {
  width: 100%; padding: 10px 12px; font-size: 14px; letter-spacing: 0.1em; color: #fff;
  background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; outline: none;
}
.cover-code-input:focus { border-color: rgba(239, 68, 68, 0.8); }
.cover-code-input.is-shaking { animation: codeShake 0.34s ease; border-color: rgba(239, 68, 68, 0.85); }
@keyframes codeShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.cover-code-error { margin: 6px 0 0; font-size: 12px; color: #F87171; }
.cover-primary {
  width: 100%; padding: 14px 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.12em; color: #fff; cursor: pointer;
  border: none; border-radius: 12px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #991b1b 0%, #b91c1c 55%, #7f1d1d 100%);
  box-shadow: 0 10px 30px -8px rgba(185, 28, 28, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.cover-primary b { color: #FECACA; font-weight: 400; }
.cover-primary:disabled { opacity: 0.6; }
.cover-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-22deg); animation: coverShimmer 4.8s ease-in-out infinite; pointer-events: none;
}
@keyframes coverShimmer { 0%, 72% { left: -120%; } 100% { left: 160%; } }
.cover-secondary {
  width: 100%; margin-top: 10px; padding: 10px 14px; font-family: inherit; font-size: 13px; color: #D1D5DB; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
}
.cover-subhint { margin: 12px 0 0; font-size: 11px; color: rgba(156, 163, 175, 0.9); }
.cover-foot { max-width: 640px; margin: 0 auto; padding: 8px 16px 16px; text-align: center; font-size: 11px; line-height: 1.7; color: rgba(156, 163, 175, 0.8); }
.cover-copyright { margin-top: 4px; font-size: 10px; opacity: 0.58; letter-spacing: 0.03em; }
.lobby-series-foot { text-align: center; font-size: 10.5px; color: var(--mute); opacity: 0.72; padding: 4px 0 2px; }
