/* ===== 企业知识库选型工作台 · 设计系统 ===== */
:root {
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --ink: #17202e;
  --muted: #5b6676;
  --faint: #8a94a6;
  --line: #e3e7ee;
  --accent: #2f5bd7;
  --accent-deep: #1e40af;
  --accent-soft: #eaf0fd;
  --good: #15803d;
  --good-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- 顶部导航 ---- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 6px; height: 56px;
}
.brand { font-weight: 700; font-size: 15px; margin-right: 14px; white-space: nowrap; }
.brand span { color: var(--accent); }
.topnav a.navlink {
  color: var(--muted); font-size: 14px; padding: 6px 12px;
  border-radius: 8px; white-space: nowrap;
}
.topnav a.navlink:hover { background: var(--canvas); text-decoration: none; color: var(--ink); }
.topnav a.navlink.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav-progress { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; }

/* ---- 布局 ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 36px 20px 80px; }
.wrap.wide { max-width: 1240px; }
.pagehead { margin-bottom: 28px; }
.kicker {
  font-size: 13px; font-weight: 600; letter-spacing: .12em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 6px;
}
h1 { font-size: 32px; line-height: 1.3; margin: 0 0 10px; }
h2 { font-size: 23px; margin: 40px 0 14px; padding-top: 8px; }
h3 { font-size: 18px; margin: 26px 0 10px; }
p.lead { font-size: 17px; color: var(--muted); max-width: 46em; }
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

/* ---- 卡片与网格 ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
}
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.route-card { display: block; color: var(--ink); transition: border-color .15s, transform .15s; }
.route-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.route-card .rc-num { font-size: 13px; font-weight: 700; color: var(--accent); }
.route-card h3 { margin: 4px 0 6px; }
.route-card p { margin: 0; font-size: 14px; color: var(--muted); }
.route-card .rc-tools { margin-top: 10px; font-size: 13px; color: var(--faint); }

/* ---- callout 四分法 ---- */
.callout {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 8px; padding: 14px 18px; margin: 18px 0;
  background: var(--surface); font-size: 15px;
}
.callout .co-tag { font-weight: 700; margin-right: 6px; }
.callout.intuition { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.intuition .co-tag { color: var(--accent-deep); }
.callout.trap { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.trap .co-tag { color: var(--warn); }
.callout.summary { border-left-color: var(--good); background: var(--good-soft); }
.callout.summary .co-tag { color: var(--good); }
.callout.source { border-left-color: var(--faint); background: var(--canvas); font-size: 14px; }
.callout.source .co-tag { color: var(--muted); }

/* ---- 徽章 ---- */
.badge-verify {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.5;
  color: var(--warn); border: 1px dashed var(--warn); border-radius: 999px;
  padding: 0 9px; margin: 0 3px; vertical-align: 1px; background: var(--warn-soft);
  cursor: help;
}
.pill {
  display: inline-block; font-size: 12.5px; font-weight: 600; line-height: 1.6;
  border-radius: 999px; padding: 1px 10px; white-space: nowrap;
}
.pill.high { color: var(--bad); background: var(--bad-soft); }
.pill.mid { color: var(--warn); background: var(--warn-soft); }
.pill.low { color: var(--good); background: var(--good-soft); }
.pill.unknown { color: var(--warn); background: var(--warn-soft); border: 1px dashed var(--warn); }
.pill.biz { color: var(--muted); background: var(--canvas); border: 1px solid var(--line); }
.pill.type { color: var(--accent-deep); background: var(--accent-soft); }
.pill.neutral { color: var(--muted); background: var(--canvas); border: 1px solid var(--line); }
.stars { color: #d97706; letter-spacing: 1px; white-space: nowrap; font-size: 14px; }
.stars .off { color: #d7dce5; }

/* ---- 按钮与控件 ---- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 14px; font-weight: 600; font-family: inherit;
  border-radius: 8px; padding: 8px 16px; cursor: pointer; transition: all .12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.btn.sm { padding: 4px 11px; font-size: 13px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

select, input[type="text"] {
  font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: var(--surface);
}
input[type="range"] { accent-color: var(--accent); width: 180px; }

/* ---- 演示卡片 ---- */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 22px 0; overflow: hidden; }
.demo-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.demo-head h3 { margin: 0; font-size: 16px; }
.demo-head .dh-sub { font-size: 13px; color: var(--faint); }
.demo-body { padding: 18px 20px; }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 16px; }
.ctl label { font-size: 14px; font-weight: 600; }
.ctl output { font-family: var(--mono); font-size: 13px; color: var(--accent-deep); margin-left: 6px; }
.readouts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.readout {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  border-radius: 8px; padding: 5px 12px; border: 1px solid var(--line); background: var(--canvas);
}
.readout.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.readout.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.readout.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.readout.info { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
.demo-note { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.demo-note::before { content: "▸ "; color: var(--accent); }

/* ---- 表格 ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.cmp { border-collapse: collapse; width: 100%; font-size: 14px; }
table.cmp th, table.cmp td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cmp thead th {
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  font-size: 13px; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid var(--line); user-select: none;
}
table.cmp thead th.sortable { cursor: pointer; }
table.cmp thead th.sortable:hover { color: var(--accent); }
table.cmp tbody tr { cursor: pointer; transition: background .1s; }
table.cmp tbody tr:hover { background: var(--accent-soft); }
table.cmp tbody tr.expanded { background: var(--accent-soft); }
table.cmp td.name { font-weight: 700; white-space: nowrap; }
table.cmp td.name small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
tr.detail-row td { background: #fbfcfe; cursor: default; padding: 0; }
.detail-box { padding: 20px 24px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 760px) { .detail-box { grid-template-columns: 1fr; } }
.detail-box h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.detail-box ul { margin: 0; padding-left: 18px; font-size: 14px; }
.detail-box li { margin-bottom: 5px; }

/* ---- 筛选工具条 ---- */
.toolbar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center;
  margin-bottom: 16px; position: sticky; top: 64px; z-index: 20;
}
.toolbar .tb-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: var(--surface); font-family: inherit; font-size: 13px;
  padding: 5px 12px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.count-note { font-size: 13px; color: var(--faint); margin-left: auto; }

/* ---- 向导 ---- */
.wiz-step { display: none; }
.wiz-step.on { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wiz-step.on { animation: none; } }
.wiz-q { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.wiz-qsub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.opt-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px; font-family: inherit; font-size: 15px; color: var(--ink);
  transition: border-color .12s, background .12s;
}
.opt-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt-card strong { display: block; font-size: 15.5px; }
.opt-card span { font-size: 13.5px; color: var(--muted); }
.wiz-dots { display: flex; gap: 8px; margin-bottom: 20px; }
.wiz-dots i { width: 34px; height: 4px; border-radius: 2px; background: var(--line); }
.wiz-dots i.done { background: var(--accent); }
.rec-card { border: 1.5px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; margin-bottom: 14px; }
.rec-card.alt { border-color: var(--line); }
.rec-rank { font-size: 12.5px; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.rec-card h3 { margin: 2px 0 8px; }
.rec-why { font-size: 14.5px; margin: 0 0 8px; }
.rec-warn { font-size: 13.5px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }

/* ---- 时间线（生态地壳运动） ---- */
.timeline { position: relative; margin: 20px 0 10px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--accent);
}
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.bad::before { border-color: var(--bad); }
.tl-date { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.tl-item.warn .tl-date { color: var(--warn); }
.tl-item.bad .tl-date { color: var(--bad); }
.tl-title { font-weight: 700; margin: 2px 0; }
.tl-desc { font-size: 14px; color: var(--muted); }

/* ---- 速度演示专用 ---- */
.stage-track { position: relative; height: 54px; background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.stage-seg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; border-right: 2px solid #fff; }
.stage-seg:last-child { border-right: 0; }
.stage-cursor { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); border-radius: 2px; }
.latency-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- 页末三件套 ---- */
.pageend { margin-top: 56px; }
.done-row { display: flex; align-items: center; gap: 14px; margin: 26px 0; }
.done-state { font-size: 13.5px; color: var(--good); font-weight: 600; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .prevnext { grid-template-columns: 1fr; } }
.pn-card {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 14px 18px; color: var(--ink);
}
.pn-card:hover { border-color: var(--accent); text-decoration: none; }
.pn-card .pn-dir { font-size: 12.5px; color: var(--faint); }
.pn-card .pn-title { font-weight: 700; margin-top: 2px; }
.pn-card.next { text-align: right; }

footer.sitefoot {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 22px 20px 40px;
  text-align: center; font-size: 13px; color: var(--faint);
}
