/* ==========================================================================
   我的 AI 开发工作流 · 可视化课程
   设计系统：浅色底 + 靛蓝主色 + 琥珀强调，8px 栅格
   ========================================================================== */

:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --ink: #1b2130;
  --ink-2: #4b556b;
  --ink-3: #7b849b;
  --line: #e3e7f0;
  --line-2: #d3d9e6;
  --brand: #4f46e5;
  --brand-2: #6d63f0;
  --brand-soft: #eeecfd;
  --amber: #f59e0b;
  --amber-soft: #fef3e2;
  --green: #0f9d76;
  --green-soft: #e6f7f1;
  --red: #e0473e;
  --red-soft: #fdeceb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 31, 51, .05), 0 8px 24px -12px rgba(23, 31, 51, .16);
  --shadow-lg: 0 2px 6px rgba(23, 31, 51, .06), 0 24px 48px -20px rgba(23, 31, 51, .25);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --nav-w: 268px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { line-height: 1.35; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
code, kbd {
  font-family: var(--mono); font-size: .88em;
  background: rgba(23, 31, 51, .065); border-radius: 4px; padding: 1px 5px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* ---------- 长 token 兜底：代码片段 / 路径不许撑破容器 ---------- */
body { overflow-wrap: break-word; }
code, kbd { overflow-wrap: anywhere; word-break: break-word; }
.tip, .warn, .quote, .card, .case, .flow-panel, .sop-row,
.nav-subitem, .compare > div, .step-body { min-width: 0; overflow-wrap: break-word; }
table.tb th, table.tb td { overflow-wrap: break-word; }
.tip, .warn, .quote { line-height: 1.85; }

/* ---------- 进度条（顶部） ---------- */
#scrollbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--amber));
  z-index: 100; transition: width .12s linear;
}

/* ---------- 侧栏 ---------- */
#sidenav {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; z-index: 60;
}
#sidenav::-webkit-scrollbar { width: 6px; }
#sidenav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.brand {
  display: flex; align-items: center; gap: 9px; padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--amber));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .6);
}
.brand-txt { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

.nav-scroll { flex: 1 1 auto; overflow-y: auto; padding: 6px 10px 14px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.nav-group {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em;
  padding: 13px 8px 5px; text-transform: uppercase; font-weight: 600;
}

/* 一级项：标题行 + 折叠按钮 */
.nav-row { display: flex; align-items: center; gap: 2px; position: relative; border-radius: var(--radius-sm); }
.nav-row:hover { background: var(--bg-soft); }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 8px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 13px; text-decoration: none; position: relative;
  flex: 1 1 auto; min-width: 0; transition: background .15s, color .15s;
}
.nav-item:hover { color: var(--ink); text-decoration: none; }
.nav-item > span:not(.n):not(.dot-ok):not(.cnt) {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-row.active { background: var(--brand-soft); }
.nav-row.active .nav-item { color: var(--brand); font-weight: 600; }
.nav-row.active::before {
  content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .n {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  min-width: 19px; text-align: center; background: var(--bg-soft);
  border-radius: 5px; padding: 1px 0; flex: 0 0 auto;
}
.nav-row.active .n { background: #fff; color: var(--brand); }
.nav-item .cnt {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3); flex: 0 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; line-height: 15px;
}
.nav-row.active .cnt { border-color: #cfc9fb; color: var(--brand); }
.nav-item .dot-ok {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-2); flex: 0 0 auto; margin-left: auto;
}
.nav-item .dot-ok.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.nav-fold {
  width: 22px; height: 26px; flex: 0 0 auto; border: 0; background: transparent;
  cursor: pointer; color: var(--ink-3); display: grid; place-items: center;
  border-radius: 6px; transition: color .15s, background .15s;
}
.nav-fold:hover { color: var(--brand); background: #fff; }
.nav-fold svg { width: 11px; height: 11px; transition: transform .22s ease; }
.nav-row.open .nav-fold svg { transform: rotate(90deg); }

/* 二级：案例列表 */
.nav-sub {
  max-height: 0; overflow: hidden; transition: max-height .3s cubic-bezier(.3, .8, .3, 1);
  margin-left: 17px; border-left: 1px dashed var(--line-2); padding-left: 7px;
}
.nav-row.open + .nav-sub { max-height: 420px; }
.nav-subitem {
  display: flex; align-items: flex-start; gap: 6px; padding: 5px 6px; margin: 1px 0;
  border-radius: 6px; font-size: 12px; color: var(--ink-3); text-decoration: none;
  line-height: 1.45; transition: all .14s;
}
.nav-subitem:hover { background: var(--bg-soft); color: var(--ink-2); text-decoration: none; }
.nav-subitem.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-subitem .si {
  font-family: var(--mono); font-size: 9.5px; flex: 0 0 auto; margin-top: 2px;
  width: 13px; height: 13px; border-radius: 4px; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--ink-3);
}
.nav-subitem.active .si { background: var(--brand); color: #fff; }
.nav-subitem.cur-case { color: var(--brand); }
.nav-subitem.cur-case .si { background: var(--brand); color: #fff; }

.nav-foot {
  flex: 0 0 auto; padding: 12px 18px 18px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); background: #fff;
}
.nav-progress { height: 5px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; margin-top: 7px; }
.nav-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--green)); transition: width .4s ease; }

/* ---------- 页内案例快速跳转 ---------- */
.case-chips {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.case-chips .cc-label {
  font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em;
  text-transform: uppercase; margin-right: 2px;
}
.case-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink-2); text-decoration: none; transition: all .15s;
}
.case-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.case-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.case-chip i {
  font-style: normal; font-family: var(--mono); font-size: 10px; opacity: .7;
}

.case { scroll-margin-top: 18px; }
.sec { scroll-margin-top: 18px; }

/* ---------- 主区域 ---------- */
main { margin-left: var(--nav-w); padding: 0 0 80px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 32px; }
.wrap-wide { max-width: 1140px; margin: 0 auto; padding: 0 32px; }

/* ---------- 页头 ---------- */
.pagehead {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, .4));
  padding: 34px 0 26px; margin-bottom: 30px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft); border-radius: 999px;
  padding: 4px 12px; margin-bottom: 12px; letter-spacing: .02em;
}
.pagehead h1 { font-size: 30px; letter-spacing: -.02em; }
.pagehead .lead { color: var(--ink-2); font-size: 15px; margin-top: 10px; max-width: 720px; }

/* ---------- Hero（首页专用） ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 400px at 15% -10%, #5b52e8 0%, transparent 60%),
              radial-gradient(900px 380px at 92% 0%, #f59e0b33 0%, transparent 55%),
              linear-gradient(160deg, #1c1a3a, #14142b 60%, #101024);
  padding: 64px 0 72px; margin-bottom: 0;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { font-size: 42px; letter-spacing: -.03em; line-height: 1.2; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #ffd66e, #ff9d4d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: #c7c9e2; font-size: 16px; margin-top: 16px; max-width: 640px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.hero-tags span {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); color: #dcdcf2;
  backdrop-filter: blur(6px);
}
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 11px 20px;
  border-radius: 11px; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: linear-gradient(135deg, var(--brand), #7b6ef6); color: #fff; box-shadow: 0 10px 24px -12px rgba(79, 70, 229, .9); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(79, 70, 229, 1); text-decoration: none; }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .17); text-decoration: none; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-line { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 数据条 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 36px; }
.stat {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat b { display: block; font-size: 25px; letter-spacing: -.02em; font-family: var(--mono); color: #fff; }
.stat span { font-size: 12px; color: #a9acc8; }

/* ---------- 通用区块 ---------- */
section { scroll-margin-top: 24px; }
.sec { margin: 0 0 44px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.sec-head h2 { font-size: 21px; letter-spacing: -.015em; }
.sec-head .idx {
  font-family: var(--mono); font-size: 11.5px; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.sec-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* grid 子项默认 min-width:auto，长代码会把整列撑开 → 必须归零 */
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* ---------- 三段式模板：文件名标签 + 全宽代码块 ---------- */
.tpl-list { display: grid; gap: 12px; }
.tpl-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.tpl-name {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #dcd8fb; border-radius: var(--radius-sm);
  padding: 10px 8px; text-align: center; display: grid; place-items: center;
  word-break: break-all; line-height: 1.4;
}
.tpl-item .say { min-width: 0; }

/* ---------- 六步流程（首页交互） ---------- */
.flow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.flow-step {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 12px; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.flow-step:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.flow-step .num {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: var(--bg-soft); color: var(--ink-3); margin-bottom: 9px;
  transition: background .2s, color .2s;
}
.flow-step .t { font-size: 13px; font-weight: 700; display: block; }
.flow-step .s { font-size: 11.5px; color: var(--ink-3); display: block; margin-top: 2px; }
.flow-step.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.flow-step.active .num { background: var(--brand); color: #fff; }
.flow-step.done { border-color: var(--green); }
.flow-step.done .num { background: var(--green); color: #fff; }
.flow-line { height: 3px; background: var(--bg-soft); border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.flow-line > i { display: block; height: 100%; width: 16.6%; background: linear-gradient(90deg, var(--brand), var(--amber)); transition: width .35s ease; }

.flow-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; min-height: 208px; box-shadow: var(--shadow);
}
.flow-panel h4 { font-size: 16px; margin-bottom: 4px; }
.flow-panel .why { color: var(--ink-2); font-size: 13.5px; margin-bottom: 14px; }
.flow-panel .saybox {
  font-family: var(--mono); font-size: 13.5px; background: #14142b; color: #e8e9f7;
  border-radius: var(--radius-sm); padding: 14px 16px; position: relative;
  min-height: 62px; white-space: pre-wrap; line-height: 1.65;
}
.flow-panel .saybox .cursor { display: inline-block; width: 7px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.flow-panel .whyline { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.flow-panel .whyline b { color: var(--ink); }

/* ---------- 复制块 ---------- */
.say {
  position: relative; font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  background: #fbfbfe; border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 12px 46px 12px 14px; color: #2a2f42;
  white-space: pre-wrap; word-break: break-word;
}
.say.tpl { border-left-color: var(--amber); background: #fffdf7; }
.say.sm { font-size: 12.5px; padding: 10px 42px 10px 12px; }
.copybtn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--line-2); background: #fff; cursor: pointer; display: grid; place-items: center;
  color: var(--ink-3); transition: all .15s;
}
.copybtn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.copybtn.ok { color: #fff; background: var(--green); border-color: var(--green); }
.copybtn svg { width: 14px; height: 14px; }

/* ---------- 案例卡 ---------- */
.case {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;
}
.case-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fcfcff, #fff); }
.case-head .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.case-no {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 6px; padding: 2px 8px;
}
.case-head h3 { font-size: 17.5px; }
.case-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--ink-3); }
.case-meta i { font-style: normal; color: var(--ink-2); font-weight: 600; font-family: var(--mono); }
.case-goal { margin-top: 11px; font-size: 13.5px; color: var(--ink-2); }
.case-goal b { color: var(--ink); }

/* 时间线 */
.steps { padding: 6px 22px 4px; }
.step-row { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.step-row:not(:last-child)::before {
  content: ''; position: absolute; left: 12px; top: 34px; bottom: -4px; width: 2px; background: var(--line);
}
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand); z-index: 1;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand-soft);
}
.step-body { min-width: 0; }
.step-say {
  font-family: var(--mono); font-size: 12.8px; background: #f8f9ff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; color: #2a2f42; white-space: pre-wrap; word-break: break-word;
  position: relative; padding-right: 38px;
}
.step-do { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.step-do em { font-style: normal; color: var(--green); font-weight: 600; }
.step-do s { color: var(--red); text-decoration-thickness: 1px; }

.case-foot { padding: 14px 22px 18px; background: #fbfbfe; border-top: 1px solid var(--line); }
.case-foot .res { font-size: 13.2px; color: var(--ink-2); }
.case-foot .res b { color: var(--green); }
.case-foot .lesson {
  margin-top: 10px; font-size: 13px; background: var(--amber-soft); border-radius: 8px;
  padding: 9px 12px; color: #7a4a06; border: 1px solid #f7e0b8;
}
.case-foot .lesson b { color: #5d3904; }

.case-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- 对照（好/坏） ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.compare > div { padding: 16px 18px; }
.compare .bad { background: var(--red-soft); border-right: 1px solid #f4cfcc; }
.compare .good { background: var(--green-soft); }
.compare h5 { font-size: 12.5px; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.compare .bad h5 { color: #a52e26; }
.compare .good h5 { color: #0a6b52; }
.compare p { font-size: 13.5px; margin: 0; color: var(--ink); }
.compare .note { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ---------- 表格 ---------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 13.3px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.tb th, table.tb td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tb th { background: #fafbff; font-weight: 600; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
table.tb tr:last-child td { border-bottom: 0; }
table.tb td code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }
.tb-wrap { overflow-x: auto; }

/* ---------- 提示 / 强调 ---------- */
.tip, .warn, .quote {
  border-radius: var(--radius-sm); padding: 12px 15px; font-size: 13.5px; margin: 12px 0;
  border: 1px solid;
}
.tip { background: var(--brand-soft); border-color: #dcd8fb; color: #322a8a; }
.warn { background: var(--red-soft); border-color: #f6d3d0; color: #8e2b24; }
.quote { background: #fbfbfe; border-color: var(--line); border-left: 3px solid var(--amber); color: var(--ink-2); }
.tip b, .warn b { font-weight: 700; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: var(--bg-soft); color: var(--ink-2); }
.badge.b { background: var(--brand-soft); color: var(--brand); }
.badge.g { background: var(--green-soft); color: var(--green); }
.badge.a { background: var(--amber-soft); color: #94620a; }
.badge.r { background: var(--red-soft); color: #a52e26; }

/* ---------- 打卡 ---------- */
.check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.check:last-child { border-bottom: 0; }
.check input { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex: 0 0 auto; }
.check label { cursor: pointer; color: var(--ink-2); }
.check input:checked + label { color: var(--ink-3); text-decoration: line-through; }
.checkbar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.checkbar .bar { flex: 1; height: 7px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.checkbar .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--green)); transition: width .35s; }
.checkbar .pct { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); min-width: 42px; }

/* ---------- 课程地图（首页卡） ---------- */
.map-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.map-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 15px; text-decoration: none; color: var(--ink); position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .2s, border-color .2s;
}
.map-card::after {
  content: ''; position: absolute; inset: auto -30% -60% auto; width: 130px; height: 130px;
  border-radius: 50%; background: radial-gradient(circle, var(--brand-soft), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.map-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cfc9fb; text-decoration: none; }
.map-card:hover::after { opacity: 1; }
.map-card .k { font-family: var(--mono); font-size: 11px; color: var(--brand); font-weight: 700; }
.map-card h4 { font-size: 15px; margin: 5px 0 5px; position: relative; z-index: 1; }
.map-card p { font-size: 12.3px; color: var(--ink-3); margin: 0; position: relative; z-index: 1; }
.map-card .n3 { font-size: 11.5px; color: var(--ink-2); margin-top: 9px; position: relative; z-index: 1; }
.map-card .n3 b { color: var(--brand); font-family: var(--mono); }

/* ---------- 出场动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s cubic-bezier(.2, .7, .3, 1), transform .5s cubic-bezier(.2, .7, .3, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- 上一页/下一页 ---------- */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; text-decoration: none; min-width: 180px;
  transition: border-color .15s, box-shadow .15s;
}
.pager a:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.pager a span { font-size: 11.5px; color: var(--ink-3); }
.pager a b { font-size: 13.5px; color: var(--ink); }
.pager a.next { text-align: right; margin-left: auto; }

/* ==========================================================================
   结构图组件（纯 CSS，无外部依赖）
   ========================================================================== */
.fig {
  background: linear-gradient(180deg, #fbfcff, #fff);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; margin: 16px 0; overflow-x: auto;
}
.fig-title {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .07em;
  text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.fig-title::before { content: ''; width: 3px; height: 12px; background: var(--brand); border-radius: 2px; }
.fig-cap {
  font-size: 12.5px; color: var(--ink-3); margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed var(--line); line-height: 1.7;
}
.fig-cap b { color: var(--ink-2); }

/* 横向流程条 */
.fc { display: flex; align-items: stretch; flex-wrap: nowrap; min-width: min-content; }
.fc.wrap { flex-wrap: wrap; row-gap: 10px; }
.fc-node {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 13px; font-size: 12.8px; color: var(--ink); min-width: 92px;
  text-align: center; box-shadow: 0 1px 2px rgba(23, 31, 51, .04); transition: all .18s;
}
.fc-node:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.fc-node b { display: block; font-size: 13.2px; line-height: 1.35; }
.fc-node span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.fc-node.a { border-color: #c9c4f8; background: var(--brand-soft); color: #342d94; }
.fc-node.a span { color: #6d64c4; }
.fc-node.g { border-color: #a9e2cf; background: var(--green-soft); color: #08674e; }
.fc-node.g span { color: #2e8b71; }
.fc-node.r { border-color: #f3c7c3; background: var(--red-soft); color: #96302a; }
.fc-node.r span { color: #b15850; }
.fc-node.y { border-color: #f4dfae; background: var(--amber-soft); color: #85560a; }
.fc-node.y span { color: #a97a24; }
.fc-node.dark { background: #1c1a3a; border-color: #1c1a3a; color: #fff; }
.fc-node.dark span { color: #a9acc8; }
a.fc-node { text-decoration: none; color: var(--ink); }
a.fc-node:hover { text-decoration: none; }
a.fc-node.a { color: #342d94; }
a.fc-node.g { color: #08674e; }
a.fc-node.dark { color: #fff; }
.fc-ar { flex: 0 0 auto; display: grid; place-items: center; width: 26px; color: var(--line-2); font-size: 15px; font-weight: 700; }
.fc-col { flex-direction: column; align-items: flex-start; }
.fc-col .fc-ar { width: auto; height: 22px; padding-left: 20px; }

/* 阶梯 / 升级条 */
.ladder { display: grid; gap: 9px; }
.ladder-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 11px; align-items: center; }
.ladder-lab { font-family: var(--mono); font-size: 11px; font-weight: 700; text-align: right; color: var(--ink-3); line-height: 1.3; }
.ladder-bar { border-radius: 8px; padding: 8px 13px; font-size: 12.6px; border: 1px solid; line-height: 1.5; }
.ladder-bar.s1 { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.ladder-bar.s2 { background: var(--amber-soft); border-color: #f4dfae; color: #85560a; }
.ladder-bar.s3 { background: #fde8e6; border-color: #f3c7c3; color: #8e2b24; }
.ladder-bar.s4 { background: var(--red-soft); border-color: #eeb3ad; color: #7d241e; font-weight: 600; }

/* 树形（缩进 + 折线） */
.tree-box { padding: 2px 0; }
.tn { position: relative; padding: 4px 0 4px 24px; font-size: 13px; line-height: 1.55; }
.tn::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--line-2);
}
.tn:last-child::before { height: 16px; }
.tn::after {
  content: ''; position: absolute; left: 8px; top: 16px; width: 11px; height: 1px; background: var(--line-2);
}
.tn .dot {
  position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.tn.lv1 { font-weight: 700; color: var(--ink); }
.tn.lv2 { color: var(--ink-2); }
.tn.lv3 { color: var(--ink-3); font-size: 12.5px; }
.tn code { background: var(--bg-soft); border-radius: 4px; padding: 0 4px; }

/* 漏斗 / 分层堆叠 */
.funnel { display: grid; gap: 7px; }
.funnel-row {
  margin: 0 auto; border-radius: 9px; padding: 9px 14px; text-align: center;
  font-size: 12.8px; border: 1px solid; box-shadow: 0 1px 2px rgba(23, 31, 51, .04);
}

/* 层带（画布/全景图用） */
.band {
  border: 1px dashed var(--line-2); border-radius: 16px; padding: 26px 22px 20px;
  position: relative; background: rgba(255, 255, 255, .55);
}
.band + .band { margin-top: 22px; }
.band-lab {
  position: absolute; top: -11px; left: 20px; background: #fff; padding: 1px 11px;
  border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--ink-2); letter-spacing: .04em;
}

/* 说人话块 */
.plain {
  background: linear-gradient(135deg, #f2f7ff, #f7f5ff);
  border: 1px solid #dbe6fb; border-left: 3px solid #6d9cf5;
  border-radius: var(--radius-sm); padding: 13px 16px; margin: 14px 0;
  font-size: 13.6px; color: #29364f; line-height: 1.8;
}
.plain b { color: #1b3a6b; }
.plain .ptag {
  display: inline-block; font-size: 11px; font-weight: 700; color: #3f6fc4;
  background: #e4eefc; border-radius: 5px; padding: 1px 7px; margin-right: 7px;
  vertical-align: 1px;
}

/* 误区块 */
.myth {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm); background: #fff;
  border: 1px solid var(--line); margin: 9px 0; font-size: 13.2px;
}
.myth .mk { font-weight: 700; color: var(--red); }
.myth .body { color: var(--ink-2); }
.myth .body b { color: var(--ink); }
.myth.ok { background: var(--green-soft); border-color: #b9e6d6; }
.myth.ok .mk { color: var(--green); }

/* ==========================================================================
   无限画布
   ========================================================================== */
.cv-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.cv-bar .hint { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.cv-btn {
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--ink-2); padding: 6px 11px;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s;
}
.cv-btn:hover { border-color: var(--brand); color: var(--brand); }
.cv-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cv-zoom { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 44px; text-align: center; }
.cv-cluster-jump { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cv-btn.cv-mini-btn { padding: 5px 8px; font-family: var(--mono); font-size: 11.5px; min-width: 30px; justify-content: center; }

.cv-viewport {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: #f3f5fa;
  height: 660px; min-height: 440px; cursor: grab; touch-action: none;
  background-image: radial-gradient(rgba(120, 130, 160, .13) 1px, transparent 1px);
  background-size: 34px 34px;
}
/* 画布页：全宽铺满，不受 wrap-wide 的 1140px 限制 */
.wrap-canvas { max-width: none; margin: 0; padding: 0 20px; }
@media (max-width: 820px) { .wrap-canvas { padding: 0 12px; } }
.cv-viewport.grabbing { cursor: grabbing; }
.cv-world {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  width: 3200px; height: 1800px;
  backface-visibility: hidden;
}
/* will-change 只在拖动期间挂上：大画布长期挂着会让 Chrome 分块光栅化滞后 → 拖动残影 */
.cv-world.will { will-change: transform; }

/* 拖动中：关掉一切会触发重绘的东西（hover 位移 / 过渡 / 阴影 / 命中测试） */
.cv-viewport.is-drag .cv-world { transition: none !important; pointer-events: none; }
.cv-viewport.is-drag .cv-node,
.cv-viewport.is-drag .cv-node:hover {
  transition: none !important;
  box-shadow: none !important;
  transform: none !important;
}
.cv-links { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.cv-links path { fill: none; stroke: #ccd2e4; stroke-width: 2; }
.cv-links path.hi { stroke: var(--brand); stroke-width: 2.6; }

.cv-band {
  position: absolute; border-radius: 22px; border: 1.5px solid #e1e6f2;
  background: rgba(255, 255, 255, .62);
}
.cv-band-lab {
  position: absolute; top: -28px; left: 4px; font-size: 16.5px; font-weight: 800;
  color: var(--ink); white-space: nowrap; pointer-events: none;
  letter-spacing: -.01em;
}
.cv-band-lab span {
  font-weight: 400; font-size: 12.5px; color: var(--ink-3);
  margin-left: 12px; letter-spacing: 0;
}

/* 节点：统一白卡 + 左侧色条，全貌视图下形成整齐色块矩阵 */
.cv-node {
  position: absolute; border-radius: 13px; background: #fff;
  border: 1px solid #e5e9f3; border-left: 6px solid var(--brand);
  padding: 13px 15px; box-shadow: 0 1px 2px rgba(23, 31, 51, .05);
  transition: box-shadow .18s, border-color .18s;
  cursor: pointer; overflow: hidden;
  contain: layout style;
}
/* hover 只改颜色与阴影，绝不动 transform ——
   放大父级里的子元素一旦位移，Chrome 会为它新建图层，拖动/悬停时容易出重影 */
.cv-node:hover { box-shadow: 0 8px 24px -10px rgba(23, 31, 51, .34); border-color: #c9c2f7; z-index: 5; }
.cv-node .ct { font-size: 16px; font-weight: 700; line-height: 1.35; display: flex; align-items: baseline; gap: 8px; }
.cv-node .cs { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.cv-node .cq {
  font-family: var(--mono); font-size: 12.5px; color: #2a2f42; background: #f7f8fd;
  border: 1px solid #ebedf6; border-radius: 7px; padding: 7px 10px; margin-top: 10px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.cv-node .cbadge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 5px; padding: 1px 7px; flex: 0 0 auto;
  align-self: center;
}
.cv-node.step { border-left-color: var(--amber); }
.cv-node.step .ct { font-size: 18px; }
.cv-node.step .cbadge { background: var(--amber); color: #3a2600; }
.cv-node.course { border-left-color: var(--brand); }
.cv-node.course .ct { color: #3b3499; }
.cv-node.prompt { border-left-color: var(--green); }
.cv-node.prompt .cbadge { background: var(--green); }
.cv-node.prompt .cq { margin-top: 8px; font-size: 12px; }
.cv-node.case { border-left-color: #9aa6c6; }
.cv-node.case .ct { font-size: 13.5px; font-weight: 600; }
.cv-node.hub {
  background: linear-gradient(140deg, #4f46e5, #7b6ef6); border: 0; border-left: 0;
  color: #fff; box-shadow: 0 14px 34px -14px rgba(79, 70, 229, .9);
}
.cv-node.hub .cs { color: #e2deff; }
.cv-node.hub .cbadge { background: #fff; color: var(--brand); }
.cv-node.hub .ct { font-size: 19px; }

/* ---------- v3：星团 + 内容节点 ---------- */
.cv-cluster {
  position: absolute; border-radius: 38px; border: 1.5px solid #e1e6f2;
  background: #fff;
}
.cv-cluster .cl-no {
  position: absolute; right: 30px; top: 2px; font-family: var(--mono);
  font-size: 104px; font-weight: 800; line-height: 1; color: rgba(23, 31, 51, .04);
  letter-spacing: -.05em; pointer-events: none; user-select: none;
}
.cv-graticule { position: absolute; inset: 0; pointer-events: none; }
.cv-graticule b {
  position: absolute; font-size: 24px; font-weight: 800; color: #b9c0d4;
  letter-spacing: .02em; white-space: nowrap;
}

/* 六步地标 */
.cv-node.landmark {
  background: linear-gradient(140deg, #262151, #171530); border: 0; border-radius: 20px;
  color: #fff; box-shadow: 0 18px 44px -20px rgba(38, 33, 81, .95);
  padding: 16px 20px;
}
.cv-node.landmark:hover { box-shadow: 0 22px 52px -20px rgba(38, 33, 81, 1); border-color: transparent; }
.lm-no { font-family: var(--mono); font-size: 14px; font-weight: 700; color: #ffd66e; letter-spacing: .12em; }
.lm-t { font-size: 32px; font-weight: 800; margin-top: 1px; letter-spacing: -.02em; }
.lm-s { font-size: 14.5px; color: #b9bce0; margin-top: 7px; line-height: 1.4; }

/* 内容卡（要点 / 一句话） */
.cv-node.chip { padding: 0; border-radius: 12px; border-left-width: 4px; }
.chip-in { display: flex; gap: 9px; padding: 10px 13px; align-items: flex-start; }
.chip-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; min-width: 26px; height: 21px;
  border-radius: 6px; display: grid; place-items: center; padding: 0 4px; margin-top: 1px;
}
.t-b { background: var(--brand-soft); color: var(--brand); }
.t-g { background: var(--green-soft); color: var(--green); }
.t-y { background: var(--amber-soft); color: #94620a; }
.t-r { background: var(--red-soft); color: #a52e26; }
.chip-tx { font-size: 13.4px; line-height: 1.52; color: var(--ink); }

/* 课程大卡 */
.cv-node.topic { border-left-width: 8px; border-radius: 18px; padding: 18px 20px; }
.tp-no { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--brand); letter-spacing: .1em; }
.tp-t { font-size: 22px; font-weight: 800; margin-top: 3px; letter-spacing: -.015em; }
.tp-s { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.tp-go { margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--brand); }

/* 数据卡 */
.cv-node.stat {
  border-left-width: 8px; border-radius: 18px;
  background: linear-gradient(120deg, #fff, #f6f5ff);
  display: flex; flex-direction: column; justify-content: center; padding: 18px 24px;
}
.stnum {
  font-family: var(--mono); font-size: 52px; font-weight: 800; line-height: 1;
  color: var(--brand); letter-spacing: -.04em;
}
.stlab { font-size: 15px; color: var(--ink-2); margin-top: 10px; }

/* 清单卡 */
.cv-node.list { border-left-width: 8px; border-radius: 18px; padding: 18px 22px; }
.lstt { font-size: 16.5px; font-weight: 800; margin-bottom: 10px; }
.lst { margin: 0; padding: 0; list-style: none; }
.lst li {
  position: relative; padding-left: 17px; font-size: 13.4px; line-height: 1.62;
  color: var(--ink-2); margin: 4px 0;
}
.lst li::before {
  content: ''; position: absolute; left: 3px; top: 9px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--line-2);
}
.lstt.tone-r { color: #96302a; }
.lstt.tone-y { color: #85560a; }
.lstt.tone-g { color: #08674e; }

.cv-mini {
  position: absolute; right: 12px; bottom: 12px; width: 156px; height: 92px;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line-2); border-radius: 9px;
  box-shadow: var(--shadow); overflow: hidden; pointer-events: none;
}
.cv-mini i {
  position: absolute; background: #c9cfe3; border-radius: 3px;
}
.cv-mini .vp {
  position: absolute; border: 1.5px solid var(--brand); background: rgba(79, 70, 229, .1); border-radius: 3px;
}

.cv-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px;
  font-size: 12.5px; color: var(--ink-2);
}
.cv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cv-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid; }

/* ---------- 侧栏折叠 ---------- */
main { transition: margin-left .26s cubic-bezier(.3, .8, .3, 1); }
#sidenav { transition: transform .26s cubic-bezier(.3, .8, .3, 1); }
body.nav-collapsed #sidenav { transform: translateX(-100%); box-shadow: none; }
body.nav-collapsed main { margin-left: 0; }

.nav-fold-btn {
  position: fixed; left: calc(var(--nav-w) - 15px); top: 50%; transform: translateY(-50%);
  width: 28px; height: 46px; border-radius: 0 9px 9px 0; border: 1px solid var(--line);
  border-left: 0; background: #fff; cursor: pointer; z-index: 70;
  display: grid; place-items: center; color: var(--ink-3);
  box-shadow: 3px 0 10px -6px rgba(23, 31, 51, .35);
  transition: left .26s cubic-bezier(.3, .8, .3, 1), color .15s, background .15s;
}
.nav-fold-btn:hover { color: var(--brand); background: var(--brand-soft); }
.nav-fold-btn svg { width: 13px; height: 13px; transition: transform .26s; }
body.nav-collapsed .nav-fold-btn { left: 0; border-radius: 0 9px 9px 0; }
body.nav-collapsed .nav-fold-btn svg { transform: rotate(180deg); }

/* ---------- 移动端 ---------- */
#navtoggle {
  display: none; position: fixed; bottom: 20px; right: 20px; z-index: 80;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .8);
  align-items: center; justify-content: center;
}
@media (max-width: 1080px) {
  .wrap, .wrap-wide { padding: 0 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .map-grid { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  #sidenav { transform: translateX(-100%); transition: transform .28s ease; box-shadow: var(--shadow-lg); }
  #sidenav.open { transform: none; }
  main { margin-left: 0; }
  #navtoggle { display: flex; }
  .hero h1 { font-size: 30px; }
  .pagehead h1 { font-size: 24px; }
  .grid-2, .compare { grid-template-columns: 1fr; }
  .tpl-item { grid-template-columns: 1fr; gap: 7px; }
  .tpl-name { text-align: left; display: block; padding: 7px 11px; }
  .nav-fold-btn { display: none; }
  .compare .bad { border-right: 0; border-bottom: 1px solid #f4cfcc; }
  .flow { grid-template-columns: repeat(2, 1fr); }
}
