/* ══════════════════════════════════════════════════════════════
   大梦 · 梦境两重天 样式表
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #06060b;
  --bg-2: #0b0b14;
  --panel: rgba(14, 16, 26, 0.82);
  --panel-solid: #0e101a;
  --line: rgba(120, 200, 255, 0.16);
  --line-strong: rgba(120, 220, 255, 0.4);
  --ink: #dfe7f2;
  --ink-dim: #93a2b8;
  --ink-faint: #5e6b80;
  --cyan: #54e0ff;
  --mint: #7ef2c0;
  --magenta: #ff5fa2;
  --brass: #ffd479;
  --danger: #ff4d5e;
  --violet: #c9a3ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  --serif: "Songti SC", "SimSun", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Cascadia Mono", "Courier New", monospace;
  --r: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(84, 224, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 92% 110%, rgba(255, 95, 162, 0.10), transparent 62%),
    radial-gradient(700px 500px at 50% 50%, rgba(126, 242, 192, 0.05), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

::selection { background: rgba(84, 224, 255, 0.32); }

/* ───────────── 全局特效 ───────────── */

.fx { position: fixed; inset: 0; pointer-events: none; z-index: 900; }

.fx-scan {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
}

.fx-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: noiseShift 0.6s steps(3) infinite;
}

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

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

/* 崩塌特效 */
.fx-collapse {
  position: fixed; inset: 0; z-index: 1200;
  display: none;
  align-items: center; justify-content: center;
  background: #000;
  overflow: hidden;
}
.fx-collapse.is-on { display: flex; animation: collapseIn 2.1s ease-in forwards; }
.fx-collapse__grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(rgba(84, 224, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 95, 162, 0.28) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  transform: perspective(500px) rotateX(58deg);
  animation: gridRush 2.1s linear forwards;
}
.fx-collapse__text {
  position: relative;
  font-family: var(--mono);
  letter-spacing: 0.4em;
  font-size: clamp(14px, 3.6vw, 30px);
  color: #fff;
  text-shadow: 3px 0 var(--magenta), -3px 0 var(--cyan);
  animation: glitchText 0.14s steps(2) infinite;
}
@keyframes collapseIn { 0% { opacity: 0; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes gridRush { from { background-position: 0 0, 0 0; opacity: 0.2; } to { background-position: 0 620px, 180px 0; opacity: 1; } }
@keyframes glitchText {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-3px, 2px); }
  100% { transform: translate(2px, -1px); }
}

/* ───────────── 屏幕切换 ───────────── */

#app { position: relative; z-index: 1; }

.screen { display: none; min-height: 100vh; }
.screen.is-active { display: block; }

.hidden { display: none !important; }

/* ───────────── 标题页 ───────────── */

.title-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 22px 60px;
  text-align: center;
  gap: 10px;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.8;
}

h1.glitch {
  position: relative;
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(42px, 11vw, 96px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #fff;
  text-shadow:
    0 0 22px rgba(84, 224, 255, 0.5),
    0 0 60px rgba(255, 95, 162, 0.28);
}
h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%; overflow: hidden;
}
h1.glitch::before {
  color: var(--cyan);
  clip-path: inset(0 0 62% 0);
  animation: glitchA 3.4s infinite steps(1);
  opacity: 0.85;
}
h1.glitch::after {
  color: var(--magenta);
  clip-path: inset(58% 0 0 0);
  animation: glitchB 2.7s infinite steps(1);
  opacity: 0.85;
}
@keyframes glitchA {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-4px, -3px); }
  95% { transform: translate(3px, 1px); }
  97% { transform: translate(-2px, 2px); }
}
@keyframes glitchB {
  0%, 90%, 100% { transform: translate(0, 0); }
  91% { transform: translate(4px, 2px); }
  94% { transform: translate(-3px, -1px); }
  96% { transform: translate(2px, -2px); }
}

.title-sub {
  font-family: var(--mono);
  letter-spacing: 0.5em;
  font-size: clamp(10px, 2.4vw, 14px);
  color: var(--ink-dim);
  margin: 0 0 12px;
}

.title-line {
  max-width: 620px;
  font-family: var(--serif);
  font-size: clamp(14px, 1.9vw, 17px);
  line-height: 2;
  color: var(--ink-dim);
  margin: 0 0 22px;
}

.title-form {
  display: flex; flex-direction: column; gap: 10px;
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.title-form label {
  font-size: 12px; color: var(--ink-faint);
  font-family: var(--mono); letter-spacing: 0.08em;
  text-align: left;
}
.title-form input {
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 16px;
  font-family: var(--sans);
  outline: none;
}
.title-form input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(84, 224, 255, 0.14); }

.title-meta {
  margin-top: 20px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 760px;
}
.meta-pill {
  font-family: var(--mono); font-size: 11px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.35);
}

.title-foot {
  margin-top: 24px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
}
.badge {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  padding: 4px 9px; border-radius: 6px;
}

/* ───────────── 按钮 ───────────── */

.btn {
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.04em;
}
.btn:hover { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-lg { padding: 14px 26px; font-size: 16px; letter-spacing: 0.16em; }
.btn-mini { padding: 6px 11px; font-size: 12px; }
.btn-ghost { background: transparent; }
.btn-primary {
  background: linear-gradient(180deg, rgba(84, 224, 255, 0.22), rgba(84, 224, 255, 0.08));
  border-color: rgba(84, 224, 255, 0.5);
  color: #eafaff;
  box-shadow: 0 0 24px rgba(84, 224, 255, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, rgba(84, 224, 255, 0.32), rgba(84, 224, 255, 0.14)); }
.btn-danger {
  background: linear-gradient(180deg, rgba(255, 77, 94, 0.22), rgba(255, 77, 94, 0.08));
  border-color: rgba(255, 77, 94, 0.55);
  color: #ffe9ec;
}
.btn-danger:hover { background: linear-gradient(180deg, rgba(255, 77, 94, 0.34), rgba(255, 77, 94, 0.14)); }

.btn-mobile-only { display: none; }

/* ───────────── 过场 ───────────── */

.intro-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 12vh 24px 14vh;
}
.intro-title {
  font-family: var(--serif);
  font-size: clamp(30px, 7vw, 54px);
  margin: 10px 0 26px;
  color: #fff;
  text-shadow: 0 0 30px rgba(84, 224, 255, 0.35);
}
.intro-body p {
  font-family: var(--serif);
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 2.1;
  color: #c8d3e2;
  margin: 0 0 18px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}
.intro-body p:nth-child(1) { animation-delay: 0.1s; }
.intro-body p:nth-child(2) { animation-delay: 0.35s; }
.intro-body p:nth-child(3) { animation-delay: 0.6s; }
.intro-body p:nth-child(4) { animation-delay: 0.85s; }
.intro-body p:nth-child(5) { animation-delay: 1.1s; }
.intro-body p:nth-child(6) { animation-delay: 1.35s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.intro-brief {
  margin: 28px 0 34px;
  padding: 18px 20px;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 95, 162, 0.06);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  color: #e6d5de;
  animation: fadeUp 0.7s ease 1.55s forwards;
  opacity: 0;
}

/* ───────────── 游戏界面布局 ───────────── */

.hud {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(6, 6, 11, 0.96), rgba(6, 6, 11, 0.82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.hud-left { display: flex; align-items: baseline; gap: 10px; }
.hud-layer {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--bg); background: var(--cyan);
  padding: 3px 8px; border-radius: 4px; font-weight: 700;
}
.hud-title { font-family: var(--serif); font-size: 18px; color: #fff; letter-spacing: 0.08em; }

.hud-stab { flex: 1 1 220px; min-width: 180px; max-width: 420px; }
.stab-label {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--ink-faint); margin-bottom: 4px;
}
.stab-track {
  height: 8px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.stab-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  box-shadow: 0 0 14px rgba(84, 224, 255, 0.6);
  transition: width 0.5s ease, background 0.4s ease;
}
.stab-bar.is-warn { background: linear-gradient(90deg, var(--brass), #ff9a5f); }
.stab-bar.is-crit { background: linear-gradient(90deg, var(--danger), var(--magenta)); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.hud-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.hud-chip {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 9px; background: rgba(0, 0, 0, 0.35);
}
.hud-chip b { color: var(--cyan); font-weight: 600; }

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 350px;
  gap: 0;
  min-height: calc(100vh - 57px);
}

.col { min-width: 0; }
.col-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--ink-faint); text-transform: uppercase;
  padding: 12px 14px 8px;
  display: flex; justify-content: space-between; align-items: center;
}

.col-rooms {
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column;
}
.room-list { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.room-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: left;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 14px;
  transition: all 0.15s ease;
}
.room-item:hover { background: rgba(84, 224, 255, 0.07); color: var(--ink); border-color: var(--line); }
.room-item.is-active {
  background: linear-gradient(90deg, rgba(84, 224, 255, 0.16), transparent);
  border-color: rgba(84, 224, 255, 0.45);
  color: #fff;
}
.room-item.is-active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.room-glyph {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--serif); font-size: 15px;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.4);
}
.room-item.is-active .room-glyph { border-color: rgba(84, 224, 255, 0.5); }
.room-name { flex: 1; line-height: 1.3; }
.room-count {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
}
.room-item.is-clear .room-count { color: var(--mint); }

.col-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.mini-progress {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}
.mini-progress b { color: var(--cyan); }

.col-main { padding: 22px clamp(16px, 3vw, 34px) 60px; }

.col-note {
  border-left: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 57px);
  position: sticky; top: 57px;
}
.tabs { display: flex; gap: 2px; padding: 0 10px; }
.tab {
  flex: 1;
  font-family: var(--sans); font-size: 12px;
  padding: 8px 4px;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--ink-faint); cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab b { font-family: var(--mono); font-size: 10px; opacity: 0.75; }

.note-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ───────────── 场景 ───────────── */

.scene-head { margin-bottom: 20px; }
.scene-sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em;
  color: var(--cyan); opacity: 0.75;
}
.scene-title {
  font-family: var(--serif); font-size: clamp(24px, 4vw, 38px);
  margin: 6px 0 14px; color: #fff;
  text-shadow: 0 0 26px rgba(84, 224, 255, 0.22);
}
.scene-desc {
  font-family: var(--serif); font-size: 16px; line-height: 2.05;
  color: #b9c6d8; max-width: 720px;
  padding-left: 14px; border-left: 1px solid var(--line);
}

.scene-note {
  margin: 18px 0 0; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 8px;
  font-size: 13px; color: var(--ink-faint); line-height: 1.8;
  max-width: 720px;
}

.sec-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--ink-faint); text-transform: uppercase;
  margin: 30px 0 12px; display: flex; align-items: center; gap: 10px;
}
.sec-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.spot-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.spot {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  cursor: pointer; text-align: left;
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  transition: all 0.15s ease;
}
.spot:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(84, 224, 255, 0.13), rgba(84, 224, 255, 0.03));
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.spot:disabled { cursor: not-allowed; opacity: 0.45; }
.spot-dot {
  width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2.2s infinite;
}
.spot.is-found .spot-dot { background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: none; }
.spot.is-locked .spot-dot { background: #445; box-shadow: none; animation: none; }
.spot-label { flex: 1; line-height: 1.45; }
.spot-tag {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px;
}
.spot.is-found .spot-tag { color: var(--mint); border-color: rgba(126, 242, 192, 0.35); }

/* ───────────── 线索 / 结论 卡片 ───────────── */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  animation: cardIn 0.35s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.card:hover { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.06); }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-kind {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--cyan);
  flex: 0 0 auto;
}
.card-name { font-size: 14px; color: #fff; line-height: 1.4; flex: 1; }
.card-note {
  margin-top: 8px; font-size: 12.5px; line-height: 1.75;
  color: var(--ink-faint); font-family: var(--serif);
  border-left: 2px solid rgba(255, 95, 162, 0.5); padding-left: 8px;
}
.card-room { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 6px; }

.card.is-conc { border-left: 2px solid var(--magenta); }
.card.is-conc .card-kind { color: var(--magenta); border-color: rgba(255, 95, 162, 0.4); }

.empty {
  padding: 26px 16px; text-align: center;
  font-size: 13px; color: var(--ink-faint); line-height: 1.9;
  border: 1px dashed var(--line); border-radius: var(--r);
}

/* 人物卡 */
.person {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer; text-align: left; width: 100%;
  font-family: var(--sans); color: var(--ink);
  transition: all 0.15s ease;
}
.person:hover { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.07); }
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px; color: #0a0a12;
  font-weight: 700;
  position: relative;
}
.avatar::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid currentColor; opacity: 0.4;
}
.person-info { min-width: 0; }
.person-name { font-size: 14px; color: #fff; }
.person-title { font-size: 11.5px; color: var(--ink-faint); font-family: var(--mono); margin-top: 2px; }

/* 日志 */
.logline {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  color: var(--ink-dim); padding: 5px 0;
  border-bottom: 1px dashed rgba(120, 200, 255, 0.09);
}
.logline b { color: var(--cyan); font-weight: 500; }
.logline.is-clue b { color: var(--mint); }
.logline.is-break b { color: var(--magenta); }
.logline.is-win b { color: var(--brass); }
.logline.is-collapse b { color: var(--danger); }

/* ───────────── 弹层 ───────────── */

.modal-root {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-root.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 3, 8, 0.78); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #0d1018, #08090f);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(84, 224, 255, 0.08) inset;
  animation: modalIn 0.22s ease;
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--cyan); opacity: 0.8; }
.modal-title { font-family: var(--serif); font-size: 22px; margin: 4px 0 0; color: #fff; letter-spacing: 0.05em; }
.modal-x {
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: 0 0 30px;
}
.modal-x:hover { color: #fff; border-color: var(--line-strong); }

.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.modal-foot:empty { display: none; }

.clue-text {
  font-family: var(--serif); font-size: 16px; line-height: 2.1; color: #cdd8e6;
  white-space: pre-wrap;
}
.clue-note {
  margin-top: 16px; padding: 12px 14px;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 95, 162, 0.06);
  font-family: var(--serif); font-size: 14.5px; line-height: 1.95; color: #f0d9e5;
}

.dialogue { display: flex; flex-direction: column; gap: 12px; }
.dline {
  font-family: var(--serif); font-size: 15.5px; line-height: 2;
  color: #c8d3e2; padding-left: 12px;
  border-left: 1px solid var(--line);
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}
.dline.is-you { color: #8fd8ff; border-left-color: rgba(84, 224, 255, 0.6); font-style: italic; }
.dline.is-break { color: #ffc2d9; border-left-color: var(--magenta); }
.dline.is-ok { color: #a9f2d4; border-left-color: var(--mint); }

.topic-list { display: flex; flex-direction: column; gap: 8px; }
.topic {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink); cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 14px;
  transition: all 0.15s ease;
}
.topic:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.09); }
.topic:disabled { opacity: 0.42; cursor: not-allowed; }
.topic.is-asked { border-color: rgba(126, 242, 192, 0.28); }
.topic-ico { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.topic.is-asked .topic-ico { color: var(--mint); }
.topic-label { flex: 1; }

.confront-box {
  margin-top: 18px; padding: 14px;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: rgba(0, 0, 0, 0.3);
}
.confront-box h4 {
  margin: 0 0 4px; font-size: 13px; color: var(--brass);
  font-family: var(--mono); letter-spacing: 0.1em; font-weight: 600;
}
.confront-box p { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; }
.confront-row { display: flex; gap: 8px; flex-wrap: wrap; }
select, .input {
  flex: 1 1 200px;
  padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.5);
  color: var(--ink); font-family: var(--sans); font-size: 13.5px; outline: none;
  min-width: 0;
}
select:focus, .input:focus { border-color: var(--line-strong); }

/* 指认表单 */
.form-sec { margin-bottom: 22px; }
.form-sec > h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--cyan); margin: 0 0 10px; font-weight: 600;
}
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  cursor: pointer; font-size: 14px; line-height: 1.6;
  transition: all 0.15s ease;
}
.opt:hover { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.06); }
.opt input { margin-top: 3px; accent-color: #54e0ff; flex: 0 0 auto; }
.opt.is-picked { border-color: rgba(84, 224, 255, 0.6); background: rgba(84, 224, 255, 0.11); }
.opt-sub { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; font-family: var(--mono); }
.opt-avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: #0a0a12;
}

.warn-line {
  font-family: var(--mono); font-size: 11.5px; color: var(--brass);
  margin-top: 8px; letter-spacing: 0.04em;
}

/* 排行榜 */
.board { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.board th, .board td { padding: 9px 8px; text-align: left; border-bottom: 1px solid rgba(120, 200, 255, 0.12); }
.board th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-faint); font-weight: 500; }
.board td { font-family: var(--mono); color: var(--ink-dim); }
.board td.nm { font-family: var(--sans); color: #fff; }
.board tr:first-child td { color: var(--brass); }
.board .mono { color: var(--cyan); }

/* ───────────── 结局 ───────────── */

.end-wrap { max-width: 800px; margin: 0 auto; padding: 12vh 24px 14vh; }
.end-title {
  font-family: var(--serif); font-size: clamp(28px, 6vw, 48px);
  color: #fff; margin: 10px 0 24px; letter-spacing: 0.06em;
  text-shadow: 0 0 34px rgba(126, 242, 192, 0.35);
}
.end-body p {
  font-family: var(--serif); font-size: clamp(15px, 1.9vw, 17.5px);
  line-height: 2.15; color: #c8d3e2; margin: 0 0 16px;
}
.end-stats {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0;
}
.stat-pill {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; background: var(--panel); min-width: 118px;
}
.stat-pill span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--ink-faint); }
.stat-pill b { display: block; font-size: 20px; color: var(--cyan); margin-top: 4px; font-family: var(--mono); }
.end-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ───────────── Toast ───────────── */

.toast-root {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 1500; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 12, 20, 0.94);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.3s ease, toastOut 0.4s ease 3.1s forwards;
}
.toast.is-good { border-color: rgba(126, 242, 192, 0.55); color: #b7f7dc; }
.toast.is-bad { border-color: rgba(255, 77, 94, 0.55); color: #ffc6cc; }
.toast.is-info { border-color: rgba(84, 224, 255, 0.55); color: #cdf1ff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ───────────── 证据分级 / 角色标签 ───────────── */

.tier {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.tier-3 { color: #ffe6a8; background: rgba(255, 212, 121, 0.16); border: 1px solid rgba(255, 212, 121, 0.45); }
.tier-2 { color: #cdf1ff; background: rgba(84, 224, 255, 0.14); border: 1px solid rgba(84, 224, 255, 0.4); }
.tier-1 { color: #9aa6b8; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }

.card-tags { display: flex; gap: 6px; align-items: center; margin-top: 7px; flex-wrap: wrap; }

.rtag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid;
}
.rtag-route { color: var(--mint); border-color: rgba(126, 242, 192, 0.4); }
.rtag-identity { color: var(--magenta); border-color: rgba(255, 95, 162, 0.42); }
.rtag-motive { color: var(--violet); border-color: rgba(201, 163, 255, 0.42); }
.rtag-scene { color: var(--ink-faint); border-color: var(--line); }

/* 指认表单里的证据分组 */
.ev-group { margin-bottom: 18px; }
.ev-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 8px;
  border-left: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
}
.ev-head b { color: var(--cyan); font-size: 13.5px; letter-spacing: 0.05em; }
.ev-head span { font-size: 12px; color: var(--ink-faint); flex: 1 1 180px; line-height: 1.6; }
.ev-head i {
  font-style: normal; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-faint); white-space: nowrap;
}
.ev-head.is-need { border-left-color: var(--danger); background: rgba(255, 77, 94, 0.07); }
.ev-head.is-need b { color: #ffb3bb; }
.ev-head.is-need i { color: var(--danger); }
.ev-head.is-ok { border-left-color: var(--mint); background: rgba(126, 242, 192, 0.05); }
.ev-head.is-ok b { color: var(--mint); }
.ev-head.is-ok i { color: var(--mint); }

.ev-meter {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(0, 0, 0, 0.35);
}
.ev-meter.is-ok { border-color: rgba(126, 242, 192, 0.45); background: rgba(126, 242, 192, 0.05); }
.ev-meter > div { flex: 1 1 150px; }
.ev-meter span {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--ink-faint); margin-bottom: 3px;
}
.ev-meter b { font-family: var(--mono); font-size: 15px; color: var(--cyan); font-weight: 600; }
.ev-meter b.is-bad { color: var(--danger); }

.ev-tip { font-size: 12px; line-height: 1.9; color: var(--ink-faint); margin: 0 0 16px; }
.ev-tip .tier { margin: 0 2px; }

/* 崩塌诊断 */
.diag {
  flex: 1 1 100%;
  border: 1px solid rgba(255, 77, 94, 0.35);
  border-radius: var(--r);
  background: rgba(255, 77, 94, 0.06);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.diag-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em;
  color: var(--danger); margin-bottom: 6px;
}
.diag p { margin: 0 0 10px; font-family: var(--serif); font-size: 14.5px; line-height: 1.9; color: #f4d7db; }
.diag-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  padding: 4px 0; border-top: 1px dashed rgba(255, 77, 94, 0.18);
}
.diag-row b { color: var(--ink); font-weight: 600; }
.diag-row b.ok { color: var(--mint); }
.diag-row b.bad { color: #ff9aa4; }

/* ───────────── 三条数值（校园层） ───────────── */

.hud-meters { flex: 1 1 300px; display: flex; gap: 14px; min-width: 0; flex-wrap: wrap; }
.meter { flex: 1 1 130px; min-width: 110px; }
.meter-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-faint); margin-bottom: 3px;
}
.meter-top b { font-size: 12px; color: var(--cyan); letter-spacing: 0; }
.meter-track {
  height: 7px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.meter-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  box-shadow: 0 0 12px rgba(84, 224, 255, 0.5);
  transition: width 0.45s ease, background 0.4s ease;
}
.meter.is-threat .meter-fill { background: linear-gradient(90deg, #ffd479, var(--magenta)); box-shadow: 0 0 12px rgba(255, 95, 162, 0.5); }
.meter.is-progress .meter-fill { background: linear-gradient(90deg, #bfffd8, var(--mint)); box-shadow: 0 0 14px rgba(126, 242, 192, 0.6); }
.meter.is-resource .meter-fill { background: linear-gradient(90deg, var(--cyan), #9fd0ff); }
.meter.state-warn .meter-fill { background: linear-gradient(90deg, var(--brass), #ff9a5f); }
.meter.state-crit .meter-fill { background: linear-gradient(90deg, var(--danger), var(--magenta)); animation: pulse 0.9s infinite; }
.meter.state-done .meter-fill { background: linear-gradient(90deg, #bfffd8, #7ef2c0); }

/* ───────────── 时间轴（校园层） ───────────── */

.timeline-bar {
  display: flex; gap: 4px; padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  overflow-x: auto;
}
.tl-item {
  flex: 1 1 0; min-width: 78px;
  text-align: center; padding: 6px 8px;
  border-radius: 8px; border: 1px solid transparent;
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  transition: all 0.2s ease;
}
.tl-item span { display: block; font-size: 9px; opacity: 0.6; margin-top: 2px; }
.tl-item.is-done { color: var(--mint); border-color: rgba(126, 242, 192, 0.2); background: rgba(126, 242, 192, 0.05); }
.tl-item.is-now {
  color: #fff; border-color: rgba(84, 224, 255, 0.6);
  background: linear-gradient(180deg, rgba(84, 224, 255, 0.2), rgba(84, 224, 255, 0.05));
  box-shadow: 0 0 18px rgba(84, 224, 255, 0.2);
}
.tl-item.is-todo { opacity: 0.45; }

/* ───────────── 行动条（校园层） ───────────── */

.action-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(84, 224, 255, 0.04);
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
}
.action-pips { display: flex; gap: 5px; }
.pip {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: rgba(84, 224, 255, 0.35);
}
.pip.is-used { background: transparent; opacity: 0.3; }
.action-bar .hint { color: var(--ink-faint); font-size: 11px; }
.action-bar .btn { margin-left: auto; }

/* 军训任务卡 */
.task-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r);
  border: 1px solid rgba(255, 212, 121, 0.35);
  background: linear-gradient(180deg, rgba(255, 212, 121, 0.1), rgba(255, 212, 121, 0.02));
  flex-wrap: wrap;
}
.task-card.is-done { border-color: rgba(126, 242, 192, 0.35); background: rgba(126, 242, 192, 0.06); }
.task-card .tc-body { flex: 1 1 220px; min-width: 0; }
.task-card .tc-title { color: #fff; font-size: 14.5px; }
.task-card .tc-desc { font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; margin-top: 4px; font-family: var(--serif); }
.task-card .tc-cost { font-family: var(--mono); font-size: 10.5px; color: var(--brass); }
.task-card.is-done .tc-cost { color: var(--mint); }

/* ───────────── 同化度视觉渐变：越同化越"舒服"越假 ───────────── */

body.assim-1 .fx-scan { opacity: 0.34; }
body.assim-1 .fx-noise { opacity: 0.03; }
body.assim-2 .fx-scan { opacity: 0.16; }
body.assim-2 .fx-noise { opacity: 0.015; }
body.assim-2 { --line: rgba(180, 220, 255, 0.22); --ink-dim: #b9c6d8; }
body.assim-3 .fx-scan,
body.assim-3 .fx-noise { opacity: 0; }
body.assim-3 { --line: rgba(220, 240, 255, 0.3); --ink-dim: #ccd8e8; --ink-faint: #8fa0b5; --bg: #0b0d14; }
body.assim-3 .scene-desc,
body.assim-3 .clue-text { filter: brightness(1.12); }
body.assim-4 {
  --bg: #141824; --line: rgba(240, 250, 255, 0.36);
  --ink: #f2f6fb; --ink-dim: #d8e2ee; --ink-faint: #a9b7c8;
  --danger: #ff8f9c; --magenta: #ffb3d0;
}
body.assim-4 .fx-scan, body.assim-4 .fx-noise { opacity: 0; }
body.assim-4 .glitch::before, body.assim-4 .glitch::after { display: none; }
body.assim-4 .module-hint { opacity: 0.9; }

/* ───────────── 终局：锚点 ───────────── */

.anchor-scene { font-family: var(--serif); }
.anchor-scene p { font-size: 15.5px; line-height: 2.1; color: #cdd8e6; margin: 0 0 14px; }
.anchor-choices { display: grid; gap: 12px; margin-top: 22px; }
.anchor-choice {
  text-align: left; padding: 16px 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  cursor: pointer; color: var(--ink); font-family: var(--sans);
  transition: all 0.16s ease;
}
.anchor-choice:hover { border-color: var(--line-strong); background: rgba(84, 224, 255, 0.08); transform: translateY(-1px); }
.anchor-choice.is-stay { border-color: rgba(255, 212, 121, 0.35); }
.anchor-choice.is-stay:hover { background: rgba(255, 212, 121, 0.09); }
.anchor-choice b { display: block; font-size: 15.5px; color: #fff; margin-bottom: 4px; }
.anchor-choice span { font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; }

/* 终章（医疗舱） */
.epilogue { font-family: var(--serif); }
.epilogue p { font-size: clamp(15px, 1.9vw, 17.5px); line-height: 2.15; color: #c8d3e2; margin: 0 0 14px; }
.epilogue p.is-line { color: #9fe8ff; font-style: italic; }

/* ───────────── 过场：梦的规则 ───────────── */

.intro-block {
  margin: 0 0 16px; padding: 14px 16px;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 95, 162, 0.06);
}
.intro-block b { display: block; color: #fff; font-size: 14px; margin-bottom: 6px; font-family: var(--sans); }
.intro-block p { margin: 0; font-family: var(--serif); font-size: 15px; line-height: 2; color: #e6d5de; }
.intro-block.is-hint { border-left-color: var(--cyan); background: rgba(84, 224, 255, 0.05); }
.intro-block.is-hint p { color: #cfe3ee; font-size: 14.5px; }

.rule-box {
  margin: 0 0 16px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(0, 0, 0, 0.32);
}
.rule-head {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.3em;
  color: var(--brass); margin-bottom: 12px;
}
.rule { padding: 8px 0; border-top: 1px dashed rgba(120, 200, 255, 0.14); }
.rule:first-of-type { border-top: none; padding-top: 0; }
.rule b {
  display: block; font-size: 14px; color: var(--cyan);
  font-family: var(--sans); margin-bottom: 4px; letter-spacing: 0.03em;
}
.rule p {
  margin: 0; font-family: var(--serif); font-size: 14px;
  line-height: 1.95; color: var(--ink-dim);
}

/* ───────────── 当前目标提示条 ───────────── */

.goal-ico { font-size: 17px; flex: 0 0 auto; }
.goal-text { flex: 1 1 220px; min-width: 0; color: var(--ink); font-family: var(--sans); font-size: 13.5px; }
.goal-text i {
  display: block; font-style: normal; font-size: 11.5px;
  color: var(--ink-faint); margin-top: 2px; line-height: 1.6;
}

/* 锚点卡 */
.anchor-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--r);
  border: 1px solid rgba(255, 95, 162, 0.5);
  background: linear-gradient(180deg, rgba(255, 95, 162, 0.13), rgba(255, 95, 162, 0.03));
  box-shadow: 0 0 30px rgba(255, 95, 162, 0.14);
  animation: cardIn 0.5s ease;
}
.anchor-card .tc-body { flex: 1 1 220px; min-width: 0; }
.anchor-card .tc-title { color: #fff; font-size: 15.5px; }
.anchor-card .tc-desc { font-size: 13px; color: var(--ink-dim); line-height: 1.8; margin-top: 4px; font-family: var(--serif); }

/* ───────────── 响应式 ───────────── */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .col-note {
    position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 92vw);
    z-index: 200; transform: translateX(102%);
    transition: transform 0.26s ease;
    background: #0a0c14;
    max-height: 100vh;
  }
  .col-note.is-open { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.7); }
  .btn-mobile-only { display: inline-block; }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-rooms { border-right: none; border-bottom: 1px solid var(--line); }
  .room-list {
    flex-direction: row; overflow-x: auto; padding-bottom: 12px;
    scrollbar-width: thin;
  }
  .room-item { flex: 0 0 auto; min-width: 132px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .room-item.is-active::before { display: none; }
  .col-main { padding: 18px 14px 70px; }
  .hud { gap: 10px; padding: 8px 12px; }
  .hud-stab { order: 3; flex: 1 1 100%; max-width: none; }
  .hud-right { gap: 6px; }
  .spot-grid { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
}
