:root {
  --bg: #0a0f1c;
  --panel: rgba(19, 28, 46, 0.94);
  --line: rgba(120, 160, 220, 0.16);
  --text: #e8eefc;
  --muted: #8a9ab8;
  --accent: #8ef0ff;
  --lit: #ffd166;
  --cond: #6fd6ff;
  --fog: #6a7488;
  --hard: #ff9f43;
}

* { box-sizing: border-box; }

/* 必须放在所有 display 规则之前：下面的 .panel/.probe/.tip 都重设了 display，
   会把 [hidden] 自带的 display:none 覆盖掉，导致隐藏元素一直显示。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(1200px 780px at 50% 18%, #1e2d4d 0%, #121c31 40%, #070b14 100%) fixed;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

/* ───────── 方块标签 ───────── */

.labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

.blk-label {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: #e7f0ff;
  background: rgba(9, 14, 24, 0.66);
  border: 1px solid rgba(150, 190, 255, 0.14);
  will-change: transform, opacity;
}

.blk-label.is-lit {
  color: #ffe9b0;
  border-color: rgba(255, 209, 102, 0.38);
  background: rgba(30, 24, 12, 0.72);
}

.blk-label.is-condensed {
  color: #cdeeff;
  border-color: rgba(126, 216, 255, 0.32);
}

.blk-label.is-hard {
  color: #ffd3a3;
  border-color: rgba(255, 170, 77, 0.42);
}

.blk-label.is-fog {
  color: #97a4bb;
  border-color: rgba(150, 165, 190, 0.16);
  background: rgba(9, 14, 24, 0.44);
}

/* ───────── 顶栏 ───────── */

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.92), rgba(8, 12, 22, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
}

.brand .dot {
  width: 10px; height: 10px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transform: rotate(45deg);
}

.searchbox { position: relative; flex: 1; max-width: 460px; }

#search {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 30, 0.75);
  color: var(--text);
  font-size: 14px;
  outline: none;
  backdrop-filter: blur(8px);
}

#search:focus { border-color: rgba(142, 240, 255, 0.5); }
#search::placeholder { color: #63708a; }

.results {
  position: absolute;
  top: 44px; left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  max-height: 320px;
  overflow: auto;
}

.hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.hit:hover { background: rgba(142, 240, 255, 0.1); }
.hit-title { font-size: 14px; }
.hit-meta { font-size: 12px; color: var(--muted); }
.no-hit { margin: 0; padding: 10px; color: var(--muted); font-size: 13px; }

.hud-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.stats { font-size: 13px; color: var(--muted); }
.stat-num { color: var(--lit); font-weight: 700; font-size: 16px; }

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(20, 30, 48, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: rgba(34, 50, 76, 0.95); border-color: rgba(142, 240, 255, 0.35); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #2b6f86, #1d5468);
  border-color: rgba(142, 240, 255, 0.45);
  color: #eafcff;
  font-weight: 600;
}
.mode-btn { white-space: nowrap; }

.who {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #a9bad6;
  cursor: pointer;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who:hover { color: var(--text); border-color: rgba(142, 240, 255, 0.35); }
.who:empty { display: none; }

/* ───────── 图例 / 提示 ───────── */

.legend {
  position: fixed;
  left: 20px; bottom: 20px;
  display: flex;
  gap: 16px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.72);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  z-index: 9;
  backdrop-filter: blur(8px);
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.sw {
  width: 11px; height: 11px;
  border-radius: 2px;
  display: inline-block;
}

.sw.lit { background: var(--lit); box-shadow: 0 0 8px var(--lit); }
.sw.cond { background: rgba(111, 214, 255, 0.55); border: 1px solid var(--cond); }
.sw.fog { background: rgba(106, 116, 136, 0.35); border: 1px solid #55607a; }
.sw.hard { background: var(--hard); }

.hint {
  position: fixed;
  left: 50%; bottom: 58px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px;
  color: #6d7d9a;
  z-index: 9;
  pointer-events: none;
  white-space: nowrap;
}

/* ───────── 悬停提示 ───────── */

.tip {
  position: fixed;
  top: 0; left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(10, 16, 28, 0.94);
  border: 1px solid var(--line);
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.tip b { font-size: 13px; }
.tip span { font-size: 11px; color: var(--muted); }

/* ───────── 方块面板 ───────── */

.panel {
  position: fixed;
  top: 76px;
  right: 18px;
  bottom: 18px;
  width: min(460px, calc(100vw - 36px));
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  animation: slide-in 0.22s ease-out;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.panel-head {
  position: sticky;
  top: 0;
  padding: 16px 18px 12px;
  background: linear-gradient(180deg, rgba(15, 22, 36, 0.98) 70%, rgba(15, 22, 36, 0.82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.panel-head h2 { margin: 8px 0 0; font-size: 21px; letter-spacing: 0.01em; }

.panel-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 32px; }

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag[style*="--c"] { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.tag-lit { color: var(--lit); border-color: rgba(255, 209, 102, 0.4); background: rgba(255, 209, 102, 0.1); }
.tag-condensed { color: var(--cond); border-color: rgba(111, 214, 255, 0.35); }
.tag-fog { color: #93a0b8; }
.tag-hard { color: var(--hard); border-color: rgba(255, 159, 67, 0.4); }

.icon-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

.panel-body { padding: 16px 18px 28px; }

.brief {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(142, 240, 255, 0.05);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #b9c8e4;
  line-height: 1.7;
}

.mod { margin-bottom: 20px; }
.mod h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #7f92b4;
  text-transform: uppercase;
}

.mod p { margin: 0; font-size: 14px; line-height: 1.8; color: #d3ddf0; }
.mod ol, .mod ul { margin: 0; padding-left: 20px; }
.mod li { font-size: 14px; line-height: 1.8; color: #d3ddf0; margin-bottom: 4px; }
.mod-sub { font-size: 12px !important; color: var(--muted) !important; margin: 10px 0 6px !important; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--hard); font-size: 12px; margin-top: 10px !important; }

/* ───────── 门槛 ───────── */

.gate {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.04);
}

.gate-title { font-size: 13px !important; color: #ffd98a !important; margin-bottom: 10px !important; }
.gate-sub { font-size: 12px !important; color: var(--muted) !important; margin: 12px 0 6px !important; }
.gate-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.gate-note { margin-top: 12px !important; font-size: 12px !important; color: #8a95ab !important; line-height: 1.6 !important; }

/* ───────── 芯片 ───────── */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #b8c6e0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover { border-color: rgba(142, 240, 255, 0.4); color: var(--text); }
.chip-lit { border-color: rgba(255, 209, 102, 0.35); color: #ffd98a; }
.chip-condensed { border-color: rgba(111, 214, 255, 0.3); color: #a6e6ff; }
.chip-fog { color: #7c879b; border-style: dashed; }

/* ───────── 自测 ───────── */

.quiz {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.quiz .q { font-size: 14px; line-height: 1.7; margin-bottom: 10px !important; }

.opts { display: flex; flex-direction: column; gap: 7px; }

.opt {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 30, 0.7);
  color: #cfdaee;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.opt:hover:not(:disabled) { border-color: rgba(142, 240, 255, 0.45); background: rgba(142, 240, 255, 0.07); }
.opt:disabled { cursor: default; }
.opt.is-correct { border-color: rgba(126, 231, 135, 0.6); background: rgba(126, 231, 135, 0.12); color: #b6f5bd; }
.opt.is-wrong { border-color: rgba(255, 120, 120, 0.55); background: rgba(255, 120, 120, 0.1); color: #ffc0c0; }

.explain { margin-top: 10px !important; font-size: 12.5px !important; color: #9fb2d0 !important; line-height: 1.7 !important; }

.mod-actions { margin-top: 14px; }

/* ───────── 探路 ───────── */

.probe {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 16, 0.66);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.probe-card {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.probe-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.probe-step { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.probe-from { font-size: 12px; color: #7f92b4; margin: 0 0 10px; }
.probe-q { font-size: 17px; line-height: 1.7; margin: 0 0 16px; }
.probe-feedback { margin-top: 14px; }
.probe-feedback .ok { color: #9df0a5; font-size: 13px; line-height: 1.7; margin: 0 0 12px; }
.probe-feedback .no { color: #ffb3b3; font-size: 13px; line-height: 1.7; margin: 0 0 12px; }

.probe-lead { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.probe-suggest { font-size: 24px; margin: 0 0 12px; color: var(--accent); }
.probe-reason { font-size: 13.5px; line-height: 1.8; color: #b9c8e4; margin: 0 0 20px; }
.probe-actions { display: flex; gap: 10px; }

.probe .icon-btn { position: static; }

/* ───────── 提示条 ───────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  z-index: 50;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(20, 30, 48, 0.96);
  border: 1px solid rgba(142, 240, 255, 0.25);
  color: #dbe8ff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 80vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 启动遮罩 ───────── */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.45s;
}

.boot.done { opacity: 0; pointer-events: none; }

.boot-inner { text-align: center; font-size: 14px; color: var(--muted); line-height: 1.9; }
.boot-inner small { font-size: 12px; color: #5d6a80; }

/* ───────── 三维场景舞台 ───────── */

.stage {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(7px);
}

.stage-card {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(16, 24, 40, 0.97);
  border: 1px solid rgba(140, 180, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: stage-in 0.2s ease-out;
}

@keyframes stage-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.stage-heading h3 { margin: 0; font-size: 17px; letter-spacing: 0.01em; }
.stage-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.stage .icon-btn { position: static; flex: none; }

.stage-view {
  position: relative;
  height: 380px;
  background: radial-gradient(620px 400px at 50% 32%, #1b2b49, #0b1322);
}

.stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.stage-readout {
  margin: 0;
  padding: 10px 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #bcd0ec;
  background: rgba(142, 240, 255, 0.05);
  border-bottom: 1px solid var(--line);
}

.stage-params {
  padding: 15px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.param-row {
  display: grid;
  grid-template-columns: 132px 1fr 78px;
  align-items: center;
  gap: 14px;
}

.param-name { font-size: 12.5px; color: var(--muted); }
.param-val { font-size: 12.5px; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }

.param-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(140, 180, 255, 0.22);
  outline: none;
  cursor: pointer;
}

.param-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(142, 240, 255, 0.75);
  cursor: pointer;
}

.param-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 720px) {
  .stage { padding: 10px; }
  .stage-view { height: 240px; }
  .param-row { grid-template-columns: 96px 1fr 62px; gap: 8px; }
}

/* ───────── 学习包 ───────── */

.lab {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(7px);
}

.lab-card {
  width: min(1080px, 100%);
  height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(16, 24, 40, 0.98);
  border: 1px solid rgba(140, 180, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: stage-in 0.2s ease-out;
}

.lab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.lab-head h2 { margin: 0; font-size: 17px; }
.lab-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.lab-head-actions { display: flex; align-items: center; gap: 8px; }
.lab .icon-btn { position: static; }

.lab-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.lab-import { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.drop {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px 16px;
  border: 1px dashed rgba(140, 180, 255, 0.3);
  border-radius: 12px;
  background: rgba(142, 240, 255, 0.03);
  cursor: pointer;
  text-align: center;
}

.drop:hover { border-color: rgba(142, 240, 255, 0.5); background: rgba(142, 240, 255, 0.07); }
.drop input { display: none; }
.drop b { font-size: 13.5px; }
.drop span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.or { margin: 2px 0; font-size: 11.5px; color: var(--muted); text-align: center; }

.paste {
  flex: 1;
  min-height: 120px;
  resize: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.7;
  outline: none;
}

.paste:focus { border-color: rgba(142, 240, 255, 0.4); }

.lab-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lab-note { font-size: 12px; color: var(--hard); line-height: 1.5; }

.lab-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lab-list h3 {
  margin: 0 0 2px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #7f92b4;
  text-transform: uppercase;
}

.pack-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.pack-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.pack-open b { font-size: 13.5px; }
.pack-open span { font-size: 11.5px; color: var(--muted); }
.pack-item .icon-btn { width: 26px; height: 26px; }

.lab-body.reading { grid-template-columns: 180px minmax(0, 1fr) 340px; }

.sec-nav { overflow-y: auto; display: flex; flex-direction: column; gap: 3px; min-height: 0; }

.sec-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #b8c6e0;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.sec-item:hover { background: rgba(142, 240, 255, 0.06); }
.sec-item.is-active {
  background: rgba(142, 240, 255, 0.1);
  border-color: rgba(142, 240, 255, 0.3);
  color: #eafcff;
}

.sec-no { color: #5f7292; font-variant-numeric: tabular-nums; flex: none; }
.sec-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sec-main { overflow-y: auto; padding-right: 10px; min-height: 0; }
.sec-main h3 { margin: 0 0 14px; font-size: 19px; }
.sec-main p { margin: 0 0 12px; font-size: 14px; line-height: 1.9; color: #d3ddf0; }
.sec-tools { display: flex; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }

.quiz-head {
  margin: 24px 0 10px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: #7f92b4;
  text-transform: uppercase;
}

.sec-src {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.src-head { margin-bottom: 8px; font-size: 11.5px; color: var(--muted); }
.src-scroll { flex: 1; overflow-y: auto; }

.src-scroll pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.9;
  color: #93a4c0;
}

.src-scroll mark {
  background: rgba(142, 240, 255, 0.2);
  color: #eafcff;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(142, 240, 255, 0.4);
}

.ok-line { color: #9df0a5 !important; }
.no-line { color: #ffb3b3 !important; }

.frag-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }

.frag-list li {
  padding: 9px 11px;
  border-radius: 9px;
  border-left: 2px solid rgba(142, 240, 255, 0.4);
  background: rgba(142, 240, 255, 0.05);
}

.frag-list b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.frag-list span { font-size: 12.5px; line-height: 1.7; color: #a9bad6; }

/* ───────── 登录 ───────── */

.auth {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(900px 600px at 50% 30%, #16233c, #060a12 70%);
}

.auth-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 18px;
  background: rgba(18, 27, 44, 0.96);
  border: 1px solid rgba(140, 180, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
}

.auth-brand .dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--accent);
}

.auth-lead { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.auth-tab.is-on { background: rgba(142, 240, 255, 0.14); color: #eafcff; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 12px; color: var(--muted); }

.auth-field input {
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.auth-field input:focus { border-color: rgba(142, 240, 255, 0.45); }

.auth-msg { margin: 0; font-size: 12.5px; line-height: 1.6; }
.auth-msg.bad { color: #ffb3b3; }
.auth-msg.good { color: #9df0a5; }

.auth-submit { height: 42px; font-size: 14px; }

.auth-skip {
  padding: 4px;
  border: 0;
  background: none;
  color: #7f90ad;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-skip:hover { color: var(--accent); }

@media (max-width: 980px) {
  .lab { padding: 10px; }
  .lab-body { grid-template-columns: 1fr; }
  .lab-body.reading { grid-template-columns: 1fr; }
  .sec-src { display: none; }
  .sec-nav { flex-direction: row; overflow-x: auto; }
  .sec-item { white-space: nowrap; }
}

/* ═══════════════════════════════════════════
   游戏化主题覆盖：暖色纸 + 木头 + 白天校园
   放在最后，靠顺序覆盖前面的科技风配色
   ═══════════════════════════════════════════ */

:root {
  --bg: #e7e2d2;
  --panel: rgba(252, 247, 236, 0.97);
  --line: rgba(122, 94, 60, 0.22);
  --text: #3a2f23;
  --muted: #8b7a60;
  --accent: #b9742a;
  --lit: #d99a2b;
  --cond: #4a86b8;
  --fog: #9a9384;
  --hard: #c46a2a;
}

html, body {
  background: linear-gradient(180deg, #a9cdf0 0%, #c7dff0 38%, #e2e9d8 68%, #dfe6cd 100%) fixed;
  color: var(--text);
}

/* 顶栏改成半透明米色横条 */

.hud {
  background: linear-gradient(180deg, rgba(250, 245, 232, 0.94), rgba(250, 245, 232, 0));
}

.brand { color: #4a3a26; }
.brand .dot { background: #c08a3e; box-shadow: 0 0 10px rgba(192, 138, 62, 0.6); }

#search {
  background: rgba(255, 252, 244, 0.9);
  border-color: rgba(122, 94, 60, 0.3);
  color: #3a2f23;
}
#search::placeholder { color: #a3937a; }
#search:focus { border-color: rgba(185, 116, 42, 0.55); }

.results {
  background: rgba(255, 252, 244, 0.98);
  border-color: rgba(122, 94, 60, 0.28);
  box-shadow: 0 16px 34px rgba(70, 52, 30, 0.22);
}
.hit { color: #3a2f23; }
.hit:hover { background: rgba(185, 116, 42, 0.1); }
.hit-meta { color: var(--muted); }

.stats { color: #6b5a42; }
.stat-num { color: #b9742a; }

.who {
  background: rgba(255, 252, 244, 0.9);
  border-color: rgba(122, 94, 60, 0.28);
  color: #6b5a42;
}
.who:hover { color: #3a2f23; border-color: rgba(185, 116, 42, 0.5); }

.btn {
  background: rgba(255, 251, 241, 0.95);
  border-color: rgba(122, 94, 60, 0.3);
  color: #4a3a26;
}
.btn:hover { background: #f6ecd7; border-color: rgba(185, 116, 42, 0.55); }
.btn.primary {
  background: linear-gradient(180deg, #d4a24f, #b9742a);
  border-color: #8f5a1e;
  color: #fffaf0;
}

.legend {
  background: rgba(255, 252, 244, 0.88);
  border-color: rgba(122, 94, 60, 0.22);
  color: #6b5a42;
}
.sw.lit { background: #e2b34a; box-shadow: 0 0 8px rgba(217, 154, 43, 0.6); }
.sw.cond { background: rgba(74, 134, 184, 0.45); border-color: #4a86b8; }
.sw.fog { background: rgba(154, 147, 132, 0.35); border-color: #9a9384; }
.sw.hard { background: #c46a2a; }

.hint { color: #7a6a52; }

.tip {
  background: rgba(255, 252, 244, 0.97);
  border-color: rgba(122, 94, 60, 0.3);
  color: #3a2f23;
  box-shadow: 0 10px 22px rgba(70, 52, 30, 0.2);
}
.tip b { color: #3a2f23; }
.tip span { color: var(--muted); }

/* 场景里的标签：纸片感 */

.blk-label {
  background: rgba(255, 251, 241, 0.9);
  border-color: rgba(122, 94, 60, 0.28);
  color: #4a3a26;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(70, 52, 30, 0.14);
}
.blk-label.is-lit {
  background: rgba(255, 244, 214, 0.95);
  border-color: rgba(217, 154, 43, 0.6);
  color: #8a5c12;
}
.blk-label.is-condensed {
  background: rgba(238, 247, 255, 0.92);
  border-color: rgba(74, 134, 184, 0.45);
  color: #2f5b7d;
}
.blk-label.is-hard {
  background: rgba(255, 240, 226, 0.95);
  border-color: rgba(196, 106, 42, 0.5);
  color: #8a4a1a;
}
.blk-label.is-fog {
  background: rgba(240, 236, 224, 0.86);
  border-color: rgba(154, 147, 132, 0.35);
  color: #7a7466;
}

.sign-label {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 6px 18px;
  border-radius: 6px;
  background: rgba(58, 40, 24, 0.86);
  border: 2px solid rgba(226, 179, 74, 0.7);
  color: #f7e6bf;
  box-shadow: 0 6px 18px rgba(60, 40, 20, 0.35);
}

.npc-label {
  font-size: 12.5px;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(58, 40, 24, 0.78);
  border: 1px solid rgba(226, 179, 74, 0.45);
  color: #f0dcb4;
}

/* 面板 */

.panel {
  background: var(--panel);
  border-color: rgba(122, 94, 60, 0.28);
  box-shadow: 0 22px 50px rgba(70, 52, 30, 0.28);
}
.panel-head {
  background: linear-gradient(180deg, rgba(252, 247, 236, 0.99) 70%, rgba(252, 247, 236, 0.86));
  border-bottom-color: rgba(122, 94, 60, 0.2);
}
.panel-head h2 { color: #33291d; }

.tag { background: rgba(122, 94, 60, 0.08); border-color: rgba(122, 94, 60, 0.2); color: #7a6a52; }
.tag-lit { color: #8a5c12; border-color: rgba(217, 154, 43, 0.5); background: rgba(217, 154, 43, 0.12); }
.tag-condensed { color: #2f5b7d; border-color: rgba(74, 134, 184, 0.4); }
.tag-fog { color: #7a7466; }
.tag-hard { color: #8a4a1a; border-color: rgba(196, 106, 42, 0.45); }

.icon-btn { background: rgba(122, 94, 60, 0.07); border-color: rgba(122, 94, 60, 0.22); color: #7a6a52; }
.icon-btn:hover { background: rgba(122, 94, 60, 0.14); color: #3a2f23; }

.brief {
  background: rgba(217, 154, 43, 0.08);
  border-left-color: #c08a3e;
  color: #5c4a33;
}

.mod h3 { color: #8a7452; }
.mod p, .mod li { color: #4a3d2d; }
.mod-sub { color: #8b7a60 !important; }
.muted { color: #8b7a60; }
.warn { color: #b04a1a; }

.gate {
  background: rgba(217, 154, 43, 0.07);
  border-color: rgba(217, 154, 43, 0.45);
}
.gate-title { color: #8a5c12 !important; }
.gate-sub { color: #8b7a60 !important; }
.gate-note { color: #7a6a52 !important; }

.chip {
  background: rgba(255, 252, 244, 0.9);
  border-color: rgba(122, 94, 60, 0.28);
  color: #5c4a33;
}
.chip:hover { border-color: rgba(185, 116, 42, 0.55); color: #3a2f23; }
.chip-lit { border-color: rgba(217, 154, 43, 0.5); color: #8a5c12; }
.chip-condensed { border-color: rgba(74, 134, 184, 0.42); color: #2f5b7d; }
.chip-fog { color: #7a7466; }

.quiz { background: rgba(122, 94, 60, 0.05); border-color: rgba(122, 94, 60, 0.18); }
.opt {
  background: rgba(255, 252, 244, 0.95);
  border-color: rgba(122, 94, 60, 0.25);
  color: #4a3d2d;
}
.opt:hover:not(:disabled) { background: rgba(217, 154, 43, 0.1); border-color: rgba(185, 116, 42, 0.5); }
.opt.is-correct { background: rgba(86, 160, 96, 0.16); border-color: rgba(70, 140, 80, 0.6); color: #276b32; }
.opt.is-wrong { background: rgba(198, 80, 60, 0.12); border-color: rgba(190, 70, 50, 0.55); color: #8e2f1e; }
.explain { color: #7a6a52 !important; }

.probe { background: rgba(60, 45, 28, 0.5); }
.probe-card {
  background: var(--panel);
  border-color: rgba(122, 94, 60, 0.3);
  box-shadow: 0 26px 60px rgba(50, 36, 20, 0.4);
}
.probe-step { color: #8b7a60; }
.probe-from { color: #8a7452; }
.probe-q { color: #33291d; }
.probe-suggest { color: #b9742a; }
.probe-reason { color: #5c4a33; }

.toast {
  background: rgba(58, 40, 24, 0.94);
  border-color: rgba(226, 179, 74, 0.45);
  color: #f6e8c8;
}

/* 场景台 */

.stage { background: rgba(60, 45, 28, 0.5); }
.stage-card {
  background: rgba(252, 247, 236, 0.98);
  border-color: rgba(122, 94, 60, 0.3);
  box-shadow: 0 26px 60px rgba(50, 36, 20, 0.4);
}
.stage-head { border-bottom-color: rgba(122, 94, 60, 0.2); }
.stage-heading h3 { color: #33291d; }
.stage-sub { color: #8b7a60; }
.stage-view { background: radial-gradient(620px 400px at 50% 32%, #dfeaf2, #c9d9e4); }
.stage-readout { background: rgba(217, 154, 43, 0.09); border-bottom-color: rgba(122, 94, 60, 0.18); color: #5c4a33; }
.param-name { color: #7a6a52; }
.param-val { color: #b9742a; }
.param-row input[type="range"] { background: rgba(122, 94, 60, 0.22); }
.param-row input[type="range"]::-webkit-slider-thumb { background: #b9742a; box-shadow: 0 0 8px rgba(185, 116, 42, 0.6); }

/* 学习包 */

.lab { background: rgba(60, 45, 28, 0.5); }
.lab-card {
  background: rgba(252, 247, 236, 0.98);
  border-color: rgba(122, 94, 60, 0.3);
  box-shadow: 0 26px 60px rgba(50, 36, 20, 0.4);
}
.lab-head { border-bottom-color: rgba(122, 94, 60, 0.2); }
.lab-head h2 { color: #33291d; }
.lab-sub { color: #8b7a60; }
.drop { background: rgba(217, 154, 43, 0.06); border-color: rgba(185, 116, 42, 0.4); }
.drop:hover { background: rgba(217, 154, 43, 0.12); border-color: rgba(185, 116, 42, 0.6); }
.drop span { color: #8b7a60; }
.paste { background: rgba(255, 252, 244, 0.95); border-color: rgba(122, 94, 60, 0.25); color: #3a2f23; }
.pack-item { background: rgba(122, 94, 60, 0.05); border-color: rgba(122, 94, 60, 0.2); }
.pack-open { color: #3a2f23; }
.pack-open span { color: #8b7a60; }
.lab-list h3 { color: #8a7452; }
.sec-item { color: #5c4a33; }
.sec-item:hover { background: rgba(217, 154, 43, 0.1); }
.sec-item.is-active { background: rgba(217, 154, 43, 0.16); border-color: rgba(185, 116, 42, 0.45); color: #33291d; }
.sec-no { color: #a3937a; }
.sec-main h3 { color: #33291d; }
.sec-main p { color: #4a3d2d; }
.quiz-head { color: #8a7452; }
.sec-src { border-left-color: rgba(122, 94, 60, 0.2); }
.src-head { color: #8b7a60; }
.src-scroll pre { color: #6b5a42; }
.src-scroll mark { background: rgba(217, 154, 43, 0.28); color: #33291d; box-shadow: 0 0 0 1px rgba(185, 116, 42, 0.5); }
.ok-line { color: #2f7a3d !important; }
.no-line { color: #a83a24 !important; }
.frag-list li { background: rgba(217, 154, 43, 0.09); border-left-color: #c08a3e; }
.frag-list span { color: #6b5a42; }

/* NPC 对话框 */

.dialog {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 65;
  width: min(680px, calc(100vw - 40px));
}

.dialog-box {
  padding: 18px 22px 16px;
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.97);
  border: 2px solid rgba(160, 120, 70, 0.45);
  box-shadow: 0 20px 46px rgba(50, 36, 20, 0.35);
  animation: dialog-in 0.18s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.dialog-name {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  border-radius: 6px;
  background: #6b4a2a;
  color: #f7e6bf;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.dialog-text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.9;
  color: #3a2f23;
}

.dialog-actions { display: flex; align-items: center; gap: 10px; }
.dialog-step { margin-left: auto; font-size: 11.5px; color: #a3937a; }

/* 守关挑战 */

.challenge {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(50, 36, 20, 0.55);
  backdrop-filter: blur(5px);
}

.challenge-card {
  width: min(560px, 100%);
  padding: 20px 22px 22px;
  border-radius: 16px;
  background: rgba(255, 252, 244, 0.98);
  border: 2px solid rgba(160, 120, 70, 0.45);
  box-shadow: 0 26px 60px rgba(50, 36, 20, 0.45);
  animation: dialog-in 0.18s ease-out;
}

.ch-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.ch-head h3 { margin: 0; font-size: 17px; color: #33291d; }
.ch-sub { margin: 4px 0 0; font-size: 11.5px; color: #8b7a60; }

.ch-head .icon-btn { position: static; margin-left: auto; }

.hearts { display: flex; gap: 5px; align-items: center; }

.heart {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(122, 94, 60, 0.18);
  border: 1px solid rgba(122, 94, 60, 0.3);
}

.heart.on { background: #d9694a; border-color: #b04a2a; box-shadow: 0 0 8px rgba(217, 105, 74, 0.5); }

.ch-q { margin: 0 0 14px; font-size: 15.5px; line-height: 1.8; color: #33291d; }
.ch-fb { margin: 14px 0 0; font-size: 13px; line-height: 1.8; color: #6b5a42; }
.ch-result { margin: 8px 0 0; font-size: 16px; color: #33291d; }
.ch-result b { color: #b9742a; font-size: 20px; }
.ch-actions { margin-top: 16px; display: flex; gap: 10px; }

/* 窄屏 */

@media (max-width: 720px) {
  .sign-label { font-size: 15px; padding: 4px 12px; }
  .dialog { bottom: 16px; width: calc(100vw - 24px); }
  .dialog-box { padding: 14px 16px; }
  .dialog-text { font-size: 14px; }
}

/* 进入校园的入口按钮 */

.enter {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.enter-btn {
  padding: 15px 44px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.14em;
  border-radius: 13px;
  border: 2px solid #8f5a1e;
  background: linear-gradient(180deg, #e2b768, #b9742a);
  color: #fffaf0;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(90, 60, 20, 0.34);
  transition: transform 0.12s, box-shadow 0.12s;
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(90, 60, 20, 0.4);
}

.enter-hint {
  margin: 0;
  font-size: 12.5px;
  color: #6b5a42;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

@media (max-width: 720px) {
  .enter { bottom: 72px; }
  .enter-btn { padding: 13px 32px; font-size: 15px; }
}


@media (max-width: 720px) {
  .hud { height: 56px; gap: 10px; padding: 0 12px; }
  .brand { font-size: 15px; }
  #search { height: 34px; font-size: 13px; }
  .stats { display: none; }
  .legend { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; gap: 8px; font-size: 11px; }
  .hint { display: none; }
  .panel { top: 64px; right: 8px; left: 8px; bottom: 8px; width: auto; }
  .mode-btn { display: none; }
}
