/* ==========================================================================
   CTF 作战室 · 设计系统
   深色是主场景（长时间盯终端），浅色给打印/投影/白天教室。
   只用系统字体与纯 CSS，无外部字体、无 CDN —— 离线机房也能完整还原。
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --bg: #080b10;
  --bg-soft: #0b1017;
  --surface: #0e141d;
  --surface-2: #121a25;
  --surface-3: #172231;
  --line: #1c2836;
  --line-strong: #2a3a4e;
  --line-glow: rgba(69, 224, 160, 0.28);

  --text: #e7eef8;
  --text-2: #a8b7c9;
  --text-3: #74869a;
  --text-inverse: #07110d;

  --accent: #45e0a0;
  --accent-soft: rgba(69, 224, 160, 0.12);
  --accent-line: rgba(69, 224, 160, 0.34);
  --blue: #4cc2ff;
  --blue-soft: rgba(76, 194, 255, 0.12);
  --violet: #b18cff;
  --violet-soft: rgba(177, 140, 255, 0.13);
  --amber: #ffc857;
  --amber-soft: rgba(255, 200, 87, 0.13);
  --red: #ff7a7a;
  --red-soft: rgba(255, 122, 122, 0.13);
  --cyan: #54d6d0;
  --cyan-soft: rgba(84, 214, 208, 0.12);

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px var(--line), 0 20px 60px -30px rgba(69, 224, 160, 0.45);

  --sidebar-w: 256px;
  --topbar-h: 62px;
  --content-max: 1120px;

  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

[data-theme="light"] {
  --bg: #eef2f7;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --surface-3: #e9eff6;
  --line: #dbe4ee;
  --line-strong: #c3d1e0;
  --line-glow: rgba(10, 143, 95, 0.28);

  --text: #0d1722;
  --text-2: #43566b;
  --text-3: #6c8096;
  --text-inverse: #ffffff;

  --accent: #0a8f5f;
  --accent-soft: rgba(10, 143, 95, 0.1);
  --accent-line: rgba(10, 143, 95, 0.3);
  --blue: #0b74c4;
  --blue-soft: rgba(11, 116, 196, 0.09);
  --violet: #6f45d8;
  --violet-soft: rgba(111, 69, 216, 0.09);
  --amber: #a56a00;
  --amber-soft: rgba(165, 106, 0, 0.1);
  --red: #c0362f;
  --red-soft: rgba(192, 54, 47, 0.09);
  --cyan: #0a7f7a;
  --cyan-soft: rgba(10, 127, 122, 0.09);

  --shadow-sm: 0 1px 2px rgba(15, 35, 60, 0.06);
  --shadow: 0 18px 40px -24px rgba(15, 35, 60, 0.35);
  --shadow-glow: 0 0 0 1px var(--line), 0 24px 60px -34px rgba(10, 143, 95, 0.4);
}

/* ---------- 2. 重置与基础 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -12%, rgba(69, 224, 160, 0.09), transparent 62%),
    radial-gradient(760px 480px at 4% 6%, rgba(76, 194, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 38%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(120, 150, 180, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 150, 180, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(10, 143, 95, 0.09), transparent 60%),
    radial-gradient(760px 480px at 0% 4%, rgba(11, 116, 196, 0.07), transparent 58%),
    linear-gradient(180deg, #f8fafc, var(--bg) 50%);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }

img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0 0 0.9em; padding-left: 1.35em; }
li { margin: 0.18em 0; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* 内联 SVG 图标的默认尺寸：没有这条，组件里的裸 icon() 会撑成整屏。 */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

::selection { background: var(--accent-line); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. 应用骨架 ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 20, 29, 0.92), rgba(8, 11, 16, 0.86));
  backdrop-filter: blur(12px);
  z-index: 40;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 251, 0.9));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(18px, 3.2vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
}

.view {
  flex: 1;
  width: 100%;
}

.view-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(22px, 3.4vw, 40px) clamp(18px, 3.2vw, 40px) 72px;
}

.footer {
  padding: 22px clamp(18px, 3.2vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}
.footer a { color: var(--text-2); }

/* ---------- 4. 品牌与导航 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), #1f9f73);
  color: #04140e;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 8px 24px -10px var(--line-glow);
}
[data-theme="light"] .brand-mark { color: #fff; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 15.5px; letter-spacing: 0.01em; }
.brand-text small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-3);
}

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-group {
  margin: 14px 10px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}
.nav-link.is-active .nav-icon { color: var(--accent); }
.nav-icon { width: 17px; height: 17px; flex: none; color: var(--text-3); }
.nav-label { flex: 1; min-width: 0; }
.nav-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 7px;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.mini-progress {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.mini-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 7px;
}
.mini-progress-top b { color: var(--text); font-family: var(--font-mono); font-size: 13px; }

.profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
}
.profile-chip:hover { border-color: var(--line-strong); color: var(--text); }
.profile-avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--blue), var(--violet));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.profile-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-group { color: var(--text-3); font-size: 11px; }

/* ---------- 5. 顶栏 ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-3);
}
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { opacity: 0.5; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.env-badge .live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

.top-progress {
  display: none;
  visibility: hidden;
  width: 120px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.top-progress span { display: block; height: 100%; background: var(--accent); }
.top-progress.has-value { visibility: visible; }

/* ---------- 6. 通用排版与分区 ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--accent);
}
.page-title { font-size: clamp(26px, 3vw, 36px); }
.page-lede {
  max-width: 66ch;
  margin-top: 9px;
  color: var(--text-2);
  font-size: 15px;
}

.section { margin-top: 38px; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 15px;
}
.section-title { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.section-title .mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); font-weight: 400; }
.section-desc { color: var(--text-2); font-size: 13.5px; max-width: 64ch; margin-top: 4px; }
.section-action { font-size: 13px; white-space: nowrap; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.divider { height: 1px; background: var(--line); margin: 26px 0; border: 0; }

.callout {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
}
.callout.warn { border-left-color: var(--amber); }
.callout.danger { border-left-color: var(--red); }
.callout.ok { border-left-color: var(--accent); }
.callout b { color: var(--text); }
.callout .ci { flex: none; color: var(--blue); margin-top: 2px; }
.callout.warn .ci { color: var(--amber); }
.callout.danger .ci { color: var(--red); }
.callout.ok .ci { color: var(--accent); }

/* ---------- 7. 卡片 / 按钮 / 徽标 ---------- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.card-hover:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.card-title { font-size: 15.5px; font-weight: 620; }
.card-desc { color: var(--text-2); font-size: 13px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  transition: background 0.16s, border-color 0.16s, transform 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(160deg, var(--accent), #2fbe86);
  border-color: transparent;
  color: #04140e;
  font-weight: 650;
  box-shadow: 0 10px 26px -14px rgba(69, 224, 160, 0.8);
}
[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { background: linear-gradient(160deg, #5cebaf, var(--accent)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: var(--red-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  white-space: nowrap;
}
.chip-misc { color: var(--text-2); }
.chip-crypto { color: var(--violet); background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.chip-forensics { color: var(--cyan); background: var(--cyan-soft); border-color: color-mix(in srgb, var(--cyan) 30%, transparent); }
.chip-stego { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip-web { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.chip-pwn { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.chip-day { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text-2);
}
.badge-ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge-warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 32%, transparent); background: var(--amber-soft); }
.badge-muted { color: var(--text-3); }

.difficulty { display: inline-flex; align-items: center; gap: 4px; }
.difficulty .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
}
.difficulty .dot.on { background: var(--amber); border-color: var(--amber); }
.difficulty .lvl { margin-left: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ---------- 8. 进度 ---------- */
.progress {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6ff0bc);
  transition: width 0.5s var(--ease);
}
.progress.thin { height: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat-value em { font-style: normal; font-size: 13px; color: var(--text-3); font-weight: 400; }
.stat-label { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.stat.accent .stat-value { color: var(--accent); }

.ring {
  --pct: 0;
  --size: 60px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-3) 0);
  position: relative;
  flex: none;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
}
.ring span {
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 9. 首页 Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(22px, 3.4vw, 46px);
  align-items: center;
  padding: 10px 0 8px;
}
.hero-title {
  font-size: clamp(30px, 3.55vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 10px 0 16px;
}
.hero-title .grad {
  background: linear-gradient(100deg, var(--accent), var(--blue) 60%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede { color: var(--text-2); font-size: 16px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 18px; }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}
.hero-facts b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }

.terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, #0b121b, #0a0f16);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
[data-theme="light"] .terminal { background: #0d1722; }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.terminal-bar i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 6px; color: #74869a; font-size: 11px; letter-spacing: 0.08em; }
.terminal-body { padding: 15px 16px 18px; line-height: 1.95; color: #b7c6d8; }
.t-line { white-space: pre-wrap; word-break: break-word; }
.t-line .prompt { color: var(--accent); }
.t-line .cmd { color: #e7eef8; }
.t-line .ok { color: var(--accent); }
.t-line .dim { color: #5d7186; }
.t-line .flag { color: var(--amber); }
.caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1.15s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.env-card { display: flex; flex-direction: column; gap: 10px; }
.env-card .env-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent);
}
.env-card h3 { font-size: 15px; }
.env-card p { font-size: 13px; color: var(--text-2); }
.env-card .env-meta { margin-top: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ---------- 10. 课程 / 时间线 ---------- */
.day-timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 12px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 42px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74px; height: 74px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  font-family: var(--font-mono);
  color: var(--text-3);
  transition: border-color 0.18s, background 0.18s;
}
.tl-node b { display: block; font-size: 21px; line-height: 1; color: var(--text); }
.tl-node small { font-size: 9.5px; letter-spacing: 0.12em; margin-top: 4px; }
.tl-item.done .tl-node { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tl-item.active .tl-node { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  transition: border-color 0.18s, transform 0.18s var(--ease);
}
.tl-card:hover { border-color: var(--line-strong); transform: translateX(3px); }
.tl-card .tl-main { flex: 1; min-width: 220px; }
.tl-card h3 { font-size: 16px; margin-bottom: 3px; }
.tl-card p { font-size: 13px; color: var(--text-2); margin: 0; }
.tl-card .tl-side { display: flex; align-items: center; gap: 10px; }
.tl-card .tl-pct { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); min-width: 46px; text-align: right; }
.tl-card .chip { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }

.day-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(680px 240px at 88% -40%, var(--accent-soft), transparent 70%),
    var(--surface);
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 26px;
}
.day-hero .day-flag {
  position: absolute;
  top: 18px; right: 22px;
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  opacity: 0.045;
  pointer-events: none;
}
.day-hero h1 { font-size: clamp(24px, 2.6vw, 32px); margin: 8px 0 8px; }
.day-hero .day-lede { color: var(--text-2); max-width: 68ch; font-size: 14.5px; }
.day-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
.day-aside { position: sticky; top: calc(var(--topbar-h) + 18px); display: flex; flex-direction: column; gap: 14px; }
.aside-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 15px; }
.aside-card h4 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.aside-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.aside-list li { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; }
.aside-list .n { font-family: var(--font-mono); color: var(--text-3); }

/* 学习目标 / 概念 */
.goal-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.goal-list li {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text-2);
}
.goal-list .g-index {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  padding-top: 2px;
}

.concept {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.concept > h3 { font-size: 16px; margin-bottom: 9px; display: flex; align-items: center; gap: 9px; }
.concept .concept-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.concept .points { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); list-style: none; }
.concept .points li { position: relative; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.concept .points li::before {
  content: "▸";
  position: absolute;
  left: 2px;
  color: var(--accent);
}

/* 正文 markdown 排版（题解/题干） */
.article { font-size: 14px; color: var(--text-2); }
.article > *:first-child { margin-top: 0; }
.article h3 { font-size: 16px; color: var(--text); margin: 1.4em 0 0.55em; }
.article h4 { font-size: 14px; color: var(--text); margin: 1.2em 0 0.5em; }
.article p { margin: 0 0 0.8em; }
.article strong { color: var(--text); font-weight: 650; }
.article a { text-decoration: underline; text-underline-offset: 2px; }
.article ul, .article ol { margin: 0 0 0.9em; padding-left: 1.35em; }
.article li { margin: 0.24em 0; }
.article code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.86em;
  word-break: break-word;
}
.article pre {
  margin: 0 0 1em;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a1018;
  color: #c6d4e4;
  overflow: auto;
  font-size: 12px;
  line-height: 1.65;
}
[data-theme="light"] .article pre { background: #0d1722; }
.article pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.article blockquote {
  margin: 0 0 1em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--text-3);
}
.article hr { border: 0; height: 1px; background: var(--line); margin: 1.3em 0; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 12.5px; }
.article th, .article td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.article th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.article td { color: var(--text-2); }

/* ---------- 11. 案例卡与案例详情 ---------- */
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.case-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.case-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.case-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.case-card h3 { font-size: 15px; line-height: 1.4; }
.case-card .case-brief { color: var(--text-3); font-size: 12.5px; }
.case-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.case-card.is-solved { border-color: var(--accent-line); }
.case-card.is-solved::after {
  content: "✓ 已解";
  position: absolute;
  top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
}
.case-card { position: relative; }
.solved-mark { color: var(--accent); }

.case-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.case-side { position: sticky; top: calc(var(--topbar-h) + 18px); display: flex; flex-direction: column; gap: 14px; }

.case-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 22px;
}
.case-banner .cb-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.case-banner h1 { font-size: clamp(22px, 2.6vw, 30px); }
.case-banner .cb-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px; font-size: 12px; color: var(--text-3); }
.case-banner .cb-meta b { color: var(--text-2); font-weight: 550; }

.prompt-box {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.prompt-box > h3 { font-size: 13px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.1em; margin-bottom: 10px; }

.artifact-list { display: flex; flex-direction: column; gap: 8px; }
.artifact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.artifact .a-icon { color: var(--blue); flex: none; }
.artifact .a-main { flex: 1; min-width: 0; }
.artifact .a-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.artifact .a-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.artifact .a-actions { display: flex; gap: 6px; flex: none; }

.steps { display: flex; flex-direction: column; gap: 14px; }
.step-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.step-num {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.step-head h3 { font-size: 14.5px; flex: 1; }
.step-body { padding: 15px 16px; }
.step-check {
  margin-top: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  border: 1px dashed var(--accent-line);
  font-size: 12.5px;
  color: var(--text-2);
}
.step-check b { color: var(--accent); }

/* ---------- 12. 工具调用 / 代码块 ---------- */
.toolcall {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.toolcall-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.toolcall-head .tc-label { color: var(--text-3); letter-spacing: 0.06em; }
.toolcall-head .tc-name {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  padding: 1px 6px;
}
.toolcall-head .tc-actions { margin-left: auto; display: flex; gap: 6px; }
.toolcall-args {
  margin: 0;
  padding: 10px 13px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.toolcall-args .k { color: var(--blue); }
.toolcall-args .s { color: var(--accent); }

.code {
  position: relative;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a1018;
  overflow: hidden;
}
[data-theme="light"] .code { background: #0d1722; }
.code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #74869a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code-head .copy-btn { margin-left: auto; }
.code pre {
  margin: 0;
  padding: 13px 15px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #c6d4e4;
  white-space: pre;
}
.code pre.wrap { white-space: pre-wrap; word-break: break-word; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-3); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent-line); }

/* ---------- 13. 提示 / 题解 / Flag ---------- */
.hint-list { display: flex; flex-direction: column; gap: 9px; }
.hint {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.hint summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  list-style: none;
  user-select: none;
}
.hint summary::-webkit-details-marker { display: none; }
.hint summary:hover { color: var(--text); }
.hint summary .hint-lv {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  background: var(--amber-soft);
  border-radius: 5px;
  padding: 0 6px;
}
.hint summary .hint-arrow { margin-left: auto; color: var(--text-3); transition: transform 0.18s; }
.hint[open] summary .hint-arrow { transform: rotate(90deg); }
.hint-body { padding: 0 13px 12px; font-size: 13px; color: var(--text-2); }

.solution {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-top: 22px;
}
.solution > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  background: var(--surface-2);
}
.solution > summary::-webkit-details-marker { display: none; }
.solution > summary .sol-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-3);
}
.solution > .solution-body { padding: 18px 20px; border-top: 1px solid var(--line); }
.solution[open] .sol-arrow { transform: rotate(90deg); }
.sol-arrow { transition: transform 0.18s; color: var(--text-3); }

.flag-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  margin-top: 18px;
}
.flag-panel h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.flag-panel .fp-desc { font-size: 12px; color: var(--text-3); margin-bottom: 11px; }
.flag-form { display: flex; gap: 8px; }
.flag-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.flag-input:focus { border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.flag-input::placeholder { color: var(--text-3); }
.flag-status { margin-top: 9px; font-size: 12.5px; min-height: 1.4em; font-family: var(--font-mono); }
.flag-status.ok { color: var(--accent); }
.flag-status.err { color: var(--red); }
.flag-status.busy { color: var(--text-3); }

.mark-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

/* ---------- 14. 题板 ---------- */
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 14px;
}
.search-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
}
.search-input:focus { outline: none; border-color: var(--accent-line); }
.filter-group { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-btn {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.is-active { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }

.board-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;
}
table.board-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
.board-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.board-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board-table tr:last-child td { border-bottom: 0; }
.board-table tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.board-table .b-title { color: var(--text); font-weight: 550; }
.board-table .b-title:hover { color: var(--accent); }
.board-table .b-id { font-family: var(--font-mono); color: var(--text-3); font-size: 11px; }
.board-table .b-flag { font-family: var(--font-mono); color: var(--accent); font-size: 11.5px; word-break: break-all; }
.board-table .b-note input {
  width: 100%;
  min-width: 130px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12px;
}
.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.status-btn .s-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status-btn.solved { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.status-btn.solved .s-dot { background: var(--accent); }
.status-btn.stuck { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 32%, transparent); background: var(--amber-soft); }
.status-btn.stuck .s-dot { background: var(--amber); }

/* ---------- 15. 工具箱 ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  padding: 6px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-3); color: var(--text); }

.quick-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.quick-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.quick-panel label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; margin-bottom: 7px; }
.quick-input, .quick-select, .quick-output {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.quick-input { min-height: 130px; resize: vertical; }
.quick-input:focus, .quick-select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-output { min-height: 130px; white-space: pre-wrap; word-break: break-word; color: var(--accent); overflow: auto; }
.quick-row { display: flex; gap: 8px; align-items: center; margin: 9px 0; flex-wrap: wrap; }
.quick-note { font-size: 12px; color: var(--text-3); }
.op-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.op-btn {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
}
.op-btn:hover { color: var(--text); border-color: var(--line-strong); }
.op-btn.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }

.cheat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cheat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.cheat-card h3 { font-size: 14px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
table.cheat { width: 100%; border-collapse: collapse; font-size: 12px; }
.cheat th, .cheat td { border-bottom: 1px solid var(--line); padding: 6px 7px; text-align: left; vertical-align: top; }
.cheat th { color: var(--text-3); font-weight: 500; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; }
.cheat td { color: var(--text-2); }
.cheat code { color: var(--text); font-size: 11.5px; }

/* ---------- 16. 环境 / 部署 ---------- */
.setup-track {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.setup-track > h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.setup-track .track-for { font-size: 12px; color: var(--text-3); margin: 3px 0 14px; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.step-list > li { position: relative; padding-left: 34px; }
.step-list > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
.step-list h4 { font-size: 13.5px; margin-bottom: 4px; }
.step-list p { font-size: 13px; color: var(--text-2); }
.setup-checks { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.setup-checks li { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; }
.setup-checks li::before { content: "✓"; color: var(--accent); font-family: var(--font-mono); }

.trouble-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.trouble-table th, .trouble-table td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.trouble-table th { background: var(--surface-2); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.trouble-table td { color: var(--text-2); }
.trouble-table td:first-child { color: var(--text); font-weight: 550; }

/* ---------- 17. 汇总 ---------- */
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13.5px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

.import-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.import-drop:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text-2); }
.import-drop strong { color: var(--text); font-size: 14px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.data-table th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.data-table td { color: var(--text-2); }
.data-table td b { color: var(--text); }
.imported-list { display: flex; flex-direction: column; gap: 6px; }

/* ---------- 17.5 模拟赛 ---------- */
.exam-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 14px; }
.exam-timer { background: radial-gradient(420px 180px at 12% 0%, var(--accent-soft), transparent 70%), var(--surface); }
.exam-clock {
  font-family: var(--font-mono);
  font-size: clamp(44px, 6vw, 68px);
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.12;
  margin: 10px 0 2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.exam-clock.is-low { color: var(--red); }
.exam-score { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; }
.exam-score b { font-family: var(--font-mono); font-size: 42px; line-height: 1; color: var(--accent); letter-spacing: -0.02em; }
.exam-score span { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); }
.exam-grade {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.exam-grade b { font-family: var(--font-mono); font-size: 22px; color: var(--text); }
.exam-grade span { font-size: 12px; color: var(--text-3); }
@media (max-width: 980px) {
  .exam-grid { grid-template-columns: minmax(0, 1fr); }
  .exam-clock { font-size: 52px; }
}

/* ---------- 18. 空态 / Toast ---------- */
.empty {
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 13.5px;
  background: var(--surface);
}
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s var(--ease);
}
.toast.ok { border-left: 3px solid var(--accent); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 19. 杂项 ---------- */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.text-right { text-align: right; }

.breadcrumb-nav { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb-nav a { color: var(--text-3); }
.breadcrumb-nav a:hover { color: var(--text); }
.breadcrumb-nav .sep { opacity: 0.5; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.pager .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1180px) {
  .day-layout { grid-template-columns: minmax(0, 1fr) 248px; gap: 20px; }
  .case-detail { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-104%);
    transition: transform 0.24s var(--ease);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  }
  .app.nav-open .sidebar { transform: none; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(3, 7, 11, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
  }
  .app.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .top-progress { display: block; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .day-layout, .case-detail { grid-template-columns: minmax(0, 1fr); }
  .day-aside, .case-side { position: static; }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar { gap: 10px; }
  .crumb .crumb-page { display: none; }
  .env-badge { display: none; }
  .hero-title { font-size: clamp(30px, 8vw, 40px); }
  .grid-2, .grid-3, .three-up, .case-grid, .quick-grid, .cheat-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-item { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .tl-node { width: 56px; height: 56px; border-radius: 14px; }
  .tl-node b { font-size: 17px; }
  .tl-item::before { left: 27px; }
  .filter-bar { width: 100%; }
  .board-toolbar { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 5; }
  .pager .btn { max-width: 100%; }
  .pager { flex-direction: column; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sidebar, .topbar, .footer, .toast-stack, .copy-btn, .mark-actions, .flag-panel { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #111; }
  .card, .concept, .step-block, .case-banner, .day-hero { break-inside: avoid; border-color: #ccc; }
}
