/* ============================================================
   DeepSeek Harness 交互式学习站 — 样式
   深色主题 · DeepSeek 蓝 · 无外部依赖
   ============================================================ */

:root {
  --bg: #0a0e1a;
  --bg-2: #0e1424;
  --panel: #121a30;
  --panel-2: #17203c;
  --border: rgba(148, 163, 255, 0.14);
  --border-soft: rgba(148, 163, 255, 0.09);
  --text: #e6ebf7;
  --text-dim: #9aa7c7;
  --text-faint: #6b7695;
  --blue: #4d6bfe;
  --blue-2: #7aa2ff;
  --cyan: #38bdf8;
  --teal: #2dd4bf;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(77, 107, 254, 0.16), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(56, 189, 248, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15.5px;
  min-height: 100vh;
}

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

::selection { background: rgba(77, 107, 254, 0.45); }

/* ---------- 布局骨架 ---------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: rgba(10, 14, 26, 0.92);
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px 30px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-logo {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(77, 107, 254, 0.4);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; font-size: 15.5px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--text-faint); margin-top: 1px; }

.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-faint); margin: 18px 8px 8px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--text-dim); font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(77, 107, 254, 0.1); color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(77,107,254,.22), rgba(56,189,248,.12)); color: #fff; }
.nav a .ico { width: 17px; text-align: center; font-size: 14px; opacity: 0.9; }

.sidebar-foot { margin-top: 22px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border-soft); font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.sidebar-foot b { color: var(--text-dim); }

.main { flex: 1; min-width: 0; padding: 0 34px 80px; }

.topbar {
  display: none; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(10px);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.topbar-title { font-weight: 700; font-size: 14px; }
.hamburger {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  width: 38px; height: 34px; font-size: 17px; cursor: pointer;
}

.section { display: none; padding-top: 26px; max-width: 1040px; margin: 0 auto; animation: fadeUp 0.35s ease; }
.section.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 通用组件 ---------- */

.h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.25; }
.h2 { font-size: 22px; font-weight: 750; margin: 0 0 6px; letter-spacing: -0.2px; }
.h3 { font-size: 16.5px; font-weight: 700; margin: 0 0 8px; }
.lead { color: var(--text-dim); font-size: 16.5px; max-width: 720px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
  border: 1px solid var(--border); color: var(--text-dim);
  background: rgba(148, 163, 255, 0.07);
}
.tag.blue { color: var(--blue-2); border-color: rgba(77,107,254,.4); background: rgba(77,107,254,.12); }
.tag.teal { color: var(--teal); border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.1); }
.tag.amber { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.1); }
.tag.red { color: var(--red); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.1); }
.tag.violet { color: var(--violet); border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.1); }

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mt { margin-top: 18px; }
.mt-lg { margin-top: 30px; }
.mb { margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #3b5bdb);
  color: #fff; font-weight: 650; font-size: 14px;
  border: none; cursor: pointer; transition: transform .12s, box-shadow .12s;
  box-shadow: 0 6px 16px rgba(77, 107, 254, 0.3);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(77,107,254,.4); text-decoration: none; }
.btn.ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); box-shadow: none;
}
.btn.ghost:hover { color: var(--text); background: rgba(148,163,255,.08); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn.teal { background: linear-gradient(135deg, #0ea5a4, #14b8a6); box-shadow: 0 6px 16px rgba(45,212,191,.25); }

code, .code-inline {
  font-family: var(--mono); font-size: 0.88em;
  background: rgba(77, 107, 254, 0.13);
  border: 1px solid rgba(77,107,254,.18);
  padding: 1.5px 6px; border-radius: 6px;
  color: #bcd0ff; white-space: nowrap;
}
pre {
  background: #0b1120;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d5def5;
}
pre code { background: none; border: none; padding: 0; color: inherit; white-space: pre; }

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

/* ---------- 首页 Hero ---------- */

.hero { padding: 26px 0 8px; }
.hero .h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  background: linear-gradient(92deg, #fff 30%, var(--blue-2) 70%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-tagline { font-size: 17px; color: var(--text-dim); margin-top: 8px; }
.hero-sub { color: var(--text-faint); font-size: 14px; margin-top: 6px; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(148,163,255,.08); border: 1px solid var(--border-soft); color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip b { color: var(--text); }

.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.arch-hero {
  margin-top: 30px;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: stretch;
}
.arch-hero-box {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
}
.box-title { font-weight: 750; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.box-title .ico { font-size: 18px; }
.pipe {
  display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center;
}
.pipe-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(148,163,255,.05); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 13px; font-size: 13px;
}
.pipe-row .arrow { color: var(--blue-2); font-weight: 700; flex: 0 0 auto; }
.pipe-row .lbl { font-weight: 650; flex: 0 0 92px; color: var(--blue-2); }
.pipe-row .desc { color: var(--text-dim); }

.feature-card { transition: transform .15s, border-color .15s; }
.feature-card:hover { transform: translateY(-3px); border-color: rgba(77,107,254,.4); }
.feature-ico { font-size: 24px; margin-bottom: 10px; }
.feature-card h3 { font-size: 15.5px; margin-bottom: 5px; }
.feature-card p { font-size: 13.5px; color: var(--text-dim); }

/* ---------- 概念卡 ---------- */

.concept-search {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px;
  padding: 11px 16px; font-size: 14px; outline: none;
}
.concept-search:focus { border-color: var(--blue); }
.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.concept-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 15px 17px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.concept-card:hover { border-color: rgba(77,107,254,.5); transform: translateY(-2px); }
.concept-card.open { border-color: rgba(77,107,254,.65); }
.concept-term { font-weight: 750; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.concept-term .en { color: var(--text-faint); font-weight: 550; font-size: 12px; font-family: var(--mono); }
.concept-one { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.concept-more { display: none; margin-top: 10px; font-size: 13px; color: var(--text-dim); border-top: 1px dashed var(--border-soft); padding-top: 10px; }
.concept-card.open .concept-more { display: block; }
.concept-empty { color: var(--text-faint); text-align: center; padding: 30px 0; }

/* ---------- 架构图 ---------- */

.arch-wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start; }
.arch-canvas {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; overflow-x: auto;
}
.arch-node {
  fill: rgba(77, 107, 254, 0.10); stroke: rgba(122, 162, 255, 0.45); stroke-width: 1.3;
  rx: 9; cursor: pointer; transition: fill .15s;
}
.arch-node:hover, .arch-node.sel { fill: rgba(77, 107, 254, 0.30); }
.arch-node.core { fill: rgba(56, 189, 248, 0.10); stroke: rgba(56, 189, 248, 0.5); }
.arch-node.core:hover, .arch-node.core.sel { fill: rgba(56, 189, 248, 0.3); }
.arch-node.cap { fill: rgba(45, 212, 191, 0.08); stroke: rgba(45, 212, 191, 0.45); }
.arch-node.cap:hover, .arch-node.cap.sel { fill: rgba(45, 212, 191, 0.26); }
.arch-node.persist { fill: rgba(251, 191, 36, 0.07); stroke: rgba(251, 191, 36, 0.45); }
.arch-node.persist:hover, .arch-node.persist.sel { fill: rgba(251, 191, 36, 0.22); }
.arch-label { fill: #cfd8f5; font-size: 12.5px; font-weight: 650; pointer-events: none; }
.arch-label.sub { fill: #8fa0c8; font-size: 10.5px; font-weight: 500; }
.arch-link { stroke: rgba(122, 162, 255, 0.35); stroke-width: 1.4; }
.arch-link.bright { stroke: rgba(122, 162, 255, 0.75); stroke-width: 2; }

.arch-detail {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px; min-height: 320px;
}
.arch-detail h3 { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.arch-detail .kicker { font-family: var(--mono); font-size: 11px; color: var(--blue-2); }
.arch-detail p { font-size: 13.5px; color: var(--text-dim); margin-top: 9px; }
.arch-detail ul { margin: 9px 0 0 18px; font-size: 13px; color: var(--text-dim); }
.arch-detail li { margin: 4px 0; }
.arch-hint { font-size: 12px; color: var(--text-faint); margin-top: 14px; }

/* 架构图（HTML 分层版） */
.arch-layer { margin-bottom: 4px; }
.arch-layer-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); margin: 10px 2px 8px; font-weight: 700;
}
.arch-nodes { display: flex; flex-wrap: wrap; gap: 9px; }
.arch-node-box {
  border: 1.2px solid var(--border); border-radius: 10px;
  padding: 9px 13px; cursor: pointer; text-align: left;
  background: rgba(148, 163, 255, 0.06); transition: transform .12s, border-color .12s, box-shadow .12s;
  min-width: 110px;
}
.arch-node-box:hover { transform: translateY(-2px); border-color: rgba(122, 162, 255, 0.7); }
.arch-node-box .n-label { font-weight: 750; font-size: 13px; color: var(--text); font-family: var(--mono); }
.arch-node-box .n-sub { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.arch-node-box.blue { border-color: rgba(122, 162, 255, 0.45); background: rgba(77, 107, 254, 0.1); }
.arch-node-box.core { border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.08); }
.arch-node-box.cap { border-color: rgba(45, 212, 191, 0.42); background: rgba(45, 212, 191, 0.06); }
.arch-node-box.persist { border-color: rgba(251, 191, 36, 0.42); background: rgba(251, 191, 36, 0.06); }
.arch-node-box.more { border-style: dashed; cursor: default; border-color: rgba(148, 163, 255, 0.3); }
.arch-node-box.sel { outline: 2px solid var(--blue); outline-offset: 1px; }
.arch-arrow { text-align: center; color: var(--blue-2); font-size: 11px; margin: 8px 0 2px; letter-spacing: 2px; opacity: 0.8; }

body.nav-open .sidebar { display: block; position: fixed; inset: 0 auto 0 0; box-shadow: var(--shadow); z-index: 60; }

/* ---------- 轮次流程 ---------- */

.turn-stage {
  display: grid; grid-template-columns: 150px 1fr; gap: 0; margin-top: 20px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
}
.turn-steps { border-right: 1px solid var(--border-soft); background: rgba(10,14,26,.5); }
.turn-step-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: none; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 12.5px; text-align: left;
  border-bottom: 1px solid var(--border-soft); font-family: var(--sans);
  transition: background .12s, color .12s;
}
.turn-step-btn:hover { background: rgba(77,107,254,.08); }
.turn-step-btn.active { background: rgba(77,107,254,.16); color: #fff; }
.turn-step-btn .idx {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: rgba(148,163,255,.12); color: var(--text-dim);
}
.turn-step-btn.active .idx { background: var(--blue); color: #fff; }
.turn-step-btn.done .idx { background: rgba(52,211,153,.25); color: var(--green); }
.turn-detail { padding: 24px 26px; }
.turn-detail .ev {
  font-family: var(--mono); font-size: 13px; color: var(--cyan);
  background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.2);
  padding: 2px 8px; border-radius: 7px; white-space: nowrap;
}
.turn-detail .stage-title { font-weight: 750; font-size: 17px; margin: 12px 0 8px; }
.turn-detail p { font-size: 14px; color: var(--text-dim); }
.turn-detail .note {
  margin-top: 12px; font-size: 12.5px; color: var(--text-faint);
  border-left: 3px solid var(--blue); padding-left: 12px;
}
.turn-controls { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.turn-progress { height: 5px; background: rgba(148,163,255,.1); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.turn-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .3s; }

.pipeline-list { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.pipe-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--border-soft);
  border-radius: 8px; margin-bottom: 8px; background: rgba(148,163,255,.04);
}
.pipe-item .pl { font-family: var(--mono); font-size: 12px; color: var(--cyan); flex: 0 0 200px; }
.pipe-item .pd { font-size: 12.5px; color: var(--text-dim); }

/* ---------- 代码游乐场 ---------- */

.play-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.play-tab {
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer;
}
.play-tab:hover { color: var(--text); }
.play-tab.active { background: rgba(77,107,254,.18); border-color: var(--blue); color: #fff; }

.play-desc { font-size: 13.5px; color: var(--text-dim); margin-bottom: 12px; }
.play-desc code { font-size: 0.85em; }

.editor-wrap { border: 1px solid var(--border-soft); border-radius: 11px; overflow: hidden; background: #0b1120; }
.editor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: rgba(148,163,255,.06);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
}
.editor-head .dots { display: flex; gap: 6px; }
.editor-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.editor-head .dot.r { background: #f87171; } .editor-head .dot.y { background: #fbbf24; } .editor-head .dot.g { background: #34d399; }
.codebox { position: relative; }
.codebox textarea, .codebox pre {
  margin: 0; border: none; border-radius: 0; width: 100%;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  padding: 16px 18px; tab-size: 2;
}
.codebox textarea {
  display: block; background: transparent; color: transparent; caret-color: #cdd8f8;
  resize: vertical; min-height: 220px; outline: none; white-space: pre; overflow: auto;
}
.codebox pre {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background: transparent;
}
.codebox pre code.hl { color: #d5def5; }
.tk-kw { color: #c792ea; } .tk-str { color: #c3e88d; } .tk-num { color: #f78c6c; }
.tk-com { color: #5c6a94; font-style: italic; } .tk-fn { color: #82aaff; } .tk-type { color: #ffcb6b; }

.play-run-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.console {
  margin-top: 14px; background: #060a14; border: 1px solid var(--border-soft);
  border-radius: 11px; font-family: var(--mono); font-size: 12.5px;
  min-height: 96px; max-height: 300px; overflow-y: auto; padding: 12px 16px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.console .log { color: #9fb4e8; }
.console .ok { color: var(--green); }
.console .err { color: var(--red); }
.console .evt { color: var(--amber); }
.console .dim { color: var(--text-faint); }
.console-empty { color: var(--text-faint); }

/* ---------- 包地图 ---------- */

.pkg-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pkg-search { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 15px; font-size: 13.5px; outline: none; }
.pkg-search:focus { border-color: var(--blue); }
.pkg-group-title { font-size: 13px; font-weight: 750; color: var(--blue-2); text-transform: uppercase; letter-spacing: 1.2px; margin: 20px 0 10px; }
.pkg-group-title:first-child { margin-top: 0; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pkg-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 11px;
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.pkg-card:hover { border-color: rgba(77,107,254,.5); transform: translateY(-2px); }
.pkg-name { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--blue-2); }
.pkg-role { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }
.pkg-keys { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.pkg-key { font-family: var(--mono); font-size: 10.5px; color: var(--cyan); background: rgba(56,189,248,.09); border: 1px solid rgba(56,189,248,.18); padding: 1px 7px; border-radius: 6px; }
.pkg-more { display: none; margin-top: 9px; font-size: 12px; color: var(--text-faint); border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.pkg-card.open .pkg-more { display: block; }

/* ---------- 测验 ---------- */

.quiz-box { max-width: 720px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.quiz-progress { flex: 1; min-width: 160px; height: 7px; background: rgba(148,163,255,.12); border-radius: 4px; overflow: hidden; }
.quiz-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .3s; border-radius: 4px; }
.quiz-score { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.quiz-score b { color: var(--text); }
.quiz-q { font-size: 18px; font-weight: 700; line-height: 1.5; min-height: 54px; }
.quiz-q .qn { color: var(--text-faint); font-weight: 600; margin-right: 8px; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.quiz-opt {
  text-align: left; padding: 13px 16px; border-radius: 11px; cursor: pointer;
  background: var(--panel-2); border: 1.5px solid var(--border-soft);
  color: var(--text-dim); font-size: 14.5px; font-family: var(--sans);
  transition: border-color .12s, background .12s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--blue); color: var(--text); }
.quiz-opt.correct { border-color: var(--green); background: rgba(52,211,153,.12); color: #d1fae5; }
.quiz-opt.wrong { border-color: var(--red); background: rgba(248,113,113,.12); color: #fee2e2; }
.quiz-opt:disabled { cursor: default; opacity: .75; }
.quiz-feedback { margin-top: 16px; padding: 13px 16px; border-radius: 11px; font-size: 13.5px; display: none; }
.quiz-feedback.good { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); color: #d1fae5; }
.quiz-feedback.bad { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: #fee2e2; }
.quiz-next { margin-top: 18px; }
.quiz-done { text-align: center; padding: 40px 20px; }
.quiz-done .big { font-size: 46px; font-weight: 850; background: linear-gradient(92deg, var(--blue-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.quiz-done .grade { font-size: 20px; margin-top: 6px; font-weight: 700; }
.quiz-best { margin-top: 8px; font-size: 13px; color: var(--text-faint); }

/* ---------- 闪卡 ---------- */

.flash-wrap { max-width: 620px; margin: 0 auto; }
.flash-card {
  height: 300px; perspective: 1200px; cursor: pointer; position: relative;
}
.flash-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s; }
.flash-card.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); padding: 30px 32px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.flash-back { transform: rotateY(180deg); background: linear-gradient(150deg, rgba(77,107,254,.16), var(--panel)); }
.flash-front .f-term { font-size: 26px; font-weight: 800; }
.flash-front .f-hint { margin-top: 14px; font-size: 13px; color: var(--text-faint); }
.flash-back .f-term { font-size: 19px; font-weight: 800; color: var(--blue-2); }
.flash-back .f-desc { margin-top: 14px; font-size: 14.5px; color: var(--text-dim); line-height: 1.8; }
.flash-back .f-en { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.flash-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.flash-count { font-size: 13px; color: var(--text-faint); }
.kbd { font-family: var(--mono); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; font-size: 11px; color: var(--text-dim); background: rgba(148,163,255,.06); }

/* ---------- 学习路径 ---------- */

.path-step {
  display: flex; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--border-soft); border-radius: 12px; margin-bottom: 12px;
  background: var(--panel); transition: border-color .15s;
}
.path-step.done { border-color: rgba(52,211,153,.35); }
.path-num {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: rgba(77,107,254,.15); color: var(--blue-2);
}
.path-step.done .path-num { background: rgba(52,211,153,.18); color: var(--green); }
.path-body { flex: 1; }
.path-body h3 { font-size: 15.5px; }
.path-body p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.path-go { margin-top: 8px; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.path-check { align-self: center; }
.path-check input { width: 22px; height: 22px; accent-color: var(--green); cursor: pointer; }
.path-progress-bar { height: 9px; border-radius: 5px; background: rgba(148,163,255,.12); overflow: hidden; margin: 16px 0 22px; }
.path-progress-bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--teal), var(--green)); transition: width .3s; }
.path-pct { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

/* ---------- 资源 ---------- */

.cmd-row {
  display: flex; align-items: center; gap: 12px;
  background: #0b1120; border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.cmd-row .cmd { font-family: var(--mono); font-size: 12.8px; flex: 1; color: #bcd0ff; overflow-x: auto; white-space: nowrap; }
.cmd-row .cmt { font-size: 12px; color: var(--text-faint); flex: 0 0 210px; text-align: right; }
.copy-btn {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 8px; font-size: 12px; font-weight: 650;
  background: rgba(77,107,254,.16); color: var(--blue-2); border: 1px solid rgba(77,107,254,.35); cursor: pointer;
  transition: background .12s;
}
.copy-btn:hover { background: rgba(77,107,254,.3); }
.copy-btn.copied { background: rgba(52,211,153,.2); border-color: var(--green); color: var(--green); }

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 8px; }
.link-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 11px;
  padding: 15px 16px; transition: border-color .15s, transform .15s; color: var(--text);
}
.link-card:hover { border-color: rgba(77,107,254,.5); transform: translateY(-2px); text-decoration: none; }
.link-card .lc-ico { font-size: 20px; }
.link-card .lc-t { font-weight: 700; font-size: 14px; }
.link-card .lc-d { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

.faq-item { border: 1px solid var(--border-soft); border-radius: 11px; margin-bottom: 10px; background: var(--panel); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; padding: 14px 17px; background: none; border: none;
  color: var(--text); font-size: 14.5px; font-weight: 650; cursor: pointer; font-family: var(--sans);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q .chev { transition: transform .2s; color: var(--text-faint); }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 17px 15px; font-size: 13.5px; color: var(--text-dim); }
.faq-item.open .faq-a { display: block; }

/* ---------- 页脚 ---------- */

.footer {
  max-width: 1040px; margin: 50px auto 0; padding: 22px 0 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-faint);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 20px; border-radius: 11px; font-size: 13.5px; z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .arch-wrap { grid-template-columns: 1fr; }
  .arch-hero { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; }
  .main { padding: 0 18px 60px; }
  .turn-stage { grid-template-columns: 1fr; }
  .turn-steps { border-right: none; border-bottom: 1px solid var(--border-soft); }
  .turn-step-btn { display: inline-flex; width: auto; border-bottom: none; border-right: 1px solid var(--border-soft); }
  .turn-steps { display: flex; overflow-x: auto; }
  .cmd-row { flex-wrap: wrap; }
  .cmd-row .cmt { flex: 1 1 100%; text-align: left; }
  /* 防止移动端横向溢出 */
  .arch-hero-box, .pipe-row, .box-title, .arch-detail, .feature-card { min-width: 0; }
  .pipe-row .desc, .turn-detail .ev, .arch-node-box .n-sub { overflow-wrap: anywhere; }
  code, .code-inline { white-space: normal; overflow-wrap: anywhere; }
  .turn-detail .ev { white-space: normal; }
  .quiz-q { overflow-wrap: anywhere; }
}
@media (max-width: 560px) {
  .h1 { font-size: 26px; }
  .turn-detail { padding: 18px; }
}
