/* ═══ 全民考古籍 · 树形画布 ═══ */
:root {
  --paper: #f2ede2; --panel: #fffdf8; --ink: #33302b; --muted: #8b7f6c;
  --line: #e3dac7; --edge: #c9bda3;
  --accent: #a5804e; --accent-deep: #8c5a2e; --root-red: #8c2f23;
  --run: #c98a2e; --ok: #4d8a5f; --err: #b3402f; --idle: #b9ad97; --wait: #7a4ea8;
  --shadow: 0 1px 3px rgba(74, 58, 27, .08), 0 4px 14px rgba(74, 58, 27, .05);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink); background: var(--paper); overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ───── 顶栏 ───── */
#topbar {
  display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 30;
}
.tb-logo {
  width: 30px; height: 30px; border-radius: 50%; background: var(--root-red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.tb-title {
  font-weight: 700; font-size: 15px; max-width: 34vw; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tb-chip {
  font-size: 12px; color: var(--accent-deep); background: #f4ead9; border: 1px solid #e6d5b8;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.tb-chip.busy { color: #9a6b1a; background: #fdf3e0; border-color: #ecd9ae; }
.tb-chip.busy::before { content: "◈ "; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.tb-spacer { flex-grow: 1; }
.tb-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px;
  font-size: 13px; color: #5d5342; white-space: nowrap; transition: all .15s;
}
.tb-btn:hover { border-color: var(--accent); background: #faf5ec; }
.tb-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.tb-btn.primary:hover { background: #96743f; }
.tb-btn.danger:hover { border-color: #cf8a80; color: #a33; background: #fdf3f1; }
.tb-btn.sm { padding: 3px 9px; }
.tb-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-zoom { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
#zoom-pct { font-size: 12px; color: var(--muted); width: 40px; text-align: center; }

/* ───── 主区 ───── */
#main { display: flex; height: calc(100vh - 54px); }
#viewport {
  position: relative; flex-grow: 1; overflow: hidden; background:
    radial-gradient(rgba(120, 100, 60, .055) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--paper);
  cursor: grab; touch-action: none;
}
#viewport.panning { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
#edges path { fill: none; stroke: var(--edge); stroke-width: 2; }
#edges path.fuse { stroke: var(--accent); stroke-dasharray: 7 5; stroke-width: 2; }
#edges path.ghost { stroke: #b49bd0; stroke-dasharray: 5 5; }
#edges path.preview { stroke: var(--root-red); stroke-width: 2.5; stroke-dasharray: 6 4; }
#nodes-layer { position: absolute; left: 0; top: 0; }

/* ───── 树节点 ───── */
.knode {
  position: absolute; width: 216px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px 8px; box-shadow: var(--shadow);
  cursor: pointer; user-select: none; transition: box-shadow .15s, border-color .15s;
}
.knode:hover { border-color: #cbb98f; }
.knode.selected { border-color: var(--accent); box-shadow: 0 0 0 2.5px rgba(165, 128, 78, .25), var(--shadow); }
.knode.appear { animation: nodein .28s cubic-bezier(.2, .8, .3, 1.1); }
@keyframes nodein { from { opacity: 0; transform: scale(.86); } }

.kn-head { display: flex; align-items: flex-start; gap: 7px; }
.kn-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--idle);
  margin-top: 5px; flex-shrink: 0;
}
.kn-title {
  font-weight: 600; font-size: 13.5px; line-height: 1.4; flex-grow: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all;
}
.kn-meta { font-size: 11px; color: var(--muted); margin-top: 4px; padding-left: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-badges { position: absolute; top: -9px; right: 10px; display: flex; gap: 4px; }
.kb { font-size: 10px; font-weight: 700; color: #fff; border-radius: 999px; padding: 1px 7px; }
.kb.fusion { background: var(--accent); }
.kb.synth { background: #8c6b2f; }
.kb.root { background: var(--root-red); }

/* 状态 */
.knode.st-running { border-color: #e3c078; }
.knode.st-running .kn-dot { background: var(--run); animation: pulse 1.1s ease-in-out infinite; }
.knode.st-running::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 2.5px;
  border-radius: 2px; background: linear-gradient(90deg, transparent, var(--run), transparent);
  animation: sweep 1.4s linear infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(201, 138, 46, .22); } }
@keyframes sweep { from { transform: translateX(-70%); } to { transform: translateX(70%); } }
.knode.st-done .kn-dot { background: var(--ok); }
.knode.st-error .kn-dot { background: var(--err); }
.knode.st-awaiting .kn-dot { background: var(--wait); }

/* 根 / 融合 / 收束 形态 */
.knode.kind-root { width: 268px; border: 2px solid var(--root-red); background: #fffaf6; }
.knode.kind-root .kn-title { font-size: 15px; }
.knode.kind-fusion { border-style: double; border-width: 4px; border-color: #c9a76a; }
.knode.kind-synthesis { border-color: #c9a76a; background: #fbf6ea; }

/* 折叠钮 */
.kn-collapse {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: -11px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px;
  font-size: 10.5px; padding: 1px 9px; line-height: 1.5; z-index: 2;
}
.kn-collapse:hover { border-color: var(--accent); color: var(--accent-deep); }

/* 提案幽灵节点 */
.knode.ghost { border-style: dashed; background: rgba(253, 250, 252, .8); }
.knode.ghost.off { opacity: .45; }
.knode.ghost .kn-title { color: #5d4a78; }
.ghost-q { font-size: 11px; color: var(--muted); margin-top: 3px; padding-left: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ghost-ops { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ghost-ops input { accent-color: var(--wait); width: 14px; height: 14px; cursor: pointer; }
.ghost-ops .gbtn {
  border: none; background: none; font-size: 12px; color: var(--muted); padding: 0 3px;
}
.ghost-ops .gbtn:hover { color: var(--wait); }
.knode.ghost-add {
  display: flex; align-items: center; justify-content: center; color: var(--wait);
  font-size: 13px; border-style: dashed; background: rgba(250, 246, 252, .55);
  box-shadow: none; padding: 18px 0;
}
.knode.ghost-add:hover { background: #f6effb; }

/* 连线模式 */
body.connect #viewport { cursor: crosshair; }
body.connect .knode { border-color: #d8c49b; }
body.connect .knode:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(165, 128, 78, .28); }
body.connect .knode.conn-src { border-color: var(--root-red); box-shadow: 0 0 0 3px rgba(140, 47, 35, .25); }
#connect-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: rgba(51, 48, 43, .88); color: #f5efe2; font-size: 12.5px;
  padding: 7px 16px; border-radius: 999px; pointer-events: none;
}

/* 图例 */
#legend {
  position: absolute; left: 14px; bottom: 12px; z-index: 10; display: flex; gap: 12px;
  font-size: 11.5px; color: var(--muted); background: rgba(255, 253, 248, .85);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; pointer-events: none;
}
#legend span { display: flex; align-items: center; gap: 4px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg-dot.lg-run { background: var(--run); animation: pulse 1.1s infinite; }
.lg-line { width: 16px; height: 0; border-top: 2px solid var(--edge); display: inline-block; }
.lg-line.fuse { border-top-style: dashed; border-top-color: var(--accent); }

/* ───── 检视器 ───── */
#inspector {
  width: 372px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
}
.ins-empty { color: var(--muted); text-align: center; padding: 60px 20px; font-size: 13px; }
.ins-sec { padding: 14px 18px; border-bottom: 1px solid #efe8d8; }
.ins-sec h4 { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; letter-spacing: .05em; }
.ins-close {
  position: absolute; right: 340px; top: 0; z-index: 5; border: 1px solid var(--line); background: var(--panel);
  border-radius: 0 0 0 8px; padding: 4px 10px; font-size: 12px; color: var(--muted);
}
.insp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.insp-title { font-size: 16px; font-weight: 700; flex-grow: 1; line-height: 1.4; word-break: break-all; }
.ins-x { border: none; background: none; font-size: 15px; color: var(--muted); padding: 2px 4px; margin: -4px -6px 0 0; }
.ins-x:hover { color: var(--ink); }
.knode.kind-root .kn-title { -webkit-line-clamp: 3; font-size: 14.5px; }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.st-pending { background: #efe9de; color: #8a7a63; }
.st-running { background: #fdf3e0; color: #9a6b1a; }
.st-awaiting { background: #f3e8fb; color: #7a4ea8; }
.st-done { background: #e9f4ec; color: #2e7d4f; }
.st-error { background: #fbeeec; color: #b3402f; }
.st-running .spin { animation: rot 1s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.abtn {
  border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 10px;
  font-size: 12px; color: #5d5342;
}
.abtn:hover { border-color: var(--accent); background: #faf5ec; }
.abtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.abtn.danger { color: #a33; }
.abtn.danger:hover { border-color: #cf8a80; background: #fdf3f1; }
.insp-q { font-size: 12.5px; color: #6d6250; background: #faf6ee; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.kv { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.md { line-height: 1.75; font-size: 13.5px; }
.md p { margin: .35em 0; }
.md blockquote { border-left: 3px solid #c9ab7c; background: #faf7f1; padding: .25em .8em; margin: .4em 0; color: #5d5044; }
.md h1, .md h2, .md h3 { font-size: 1.05em; margin: .6em 0 .3em; }
.evi { font-size: 12px; color: #5d5044; background: #faf7f1; border: 1px dashed var(--line); border-radius: 6px; padding: 5px 8px; margin: 4px 0; }
.evi b { color: var(--accent-deep); }
.logline { font-size: 11.5px; color: #8a7a63; border-left: 2px solid var(--line); padding-left: 8px; margin: 4px 0; word-break: break-all; }
.progbar { height: 7px; border-radius: 99px; background: #efe8d8; overflow: hidden; }
.progbar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #c9a76a); transition: width .4s; }

/* ───── 仪表盘: 指标卡 / 计量条 / 档位分布 ───── */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.metric {
  background: #faf7f1; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 4px 7px; text-align: center; transition: transform .15s;
}
.metric:hover { transform: translateY(-1px); }
.metric i { font-style: normal; font-size: 13px; display: block; line-height: 1.4; }
.metric b { display: block; font-size: 17px; line-height: 1.35; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric span { font-size: 10.5px; color: var(--muted); }
.metric.ok b { color: var(--ok); }
.metric.hot { background: #fdf6e7; border-color: #ecd9ae; }
.metric.hot b { color: #9a6b1a; }
.metric.err b { color: var(--err); }
.meter { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.meter > span { min-width: 56px; }
.meter .bar { flex: 1; height: 6px; border-radius: 99px; background: #efe8d8; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #c9a76a); border-radius: 99px; transition: width .4s; }
.meter .bar i.warn { background: linear-gradient(90deg, #c98a2e, #e0aa55); }
.meter em { font-style: normal; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.vbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin-top: 9px; background: #efe8d8; }
.vbar i { height: 100%; transition: width .4s; }
.vlegend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.vlegend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.vlegend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.nd-last {
  margin-top: 9px; font-size: 11.5px; color: #8a7a63; border-left: 2px solid #e3d5b8;
  padding-left: 8px; word-break: break-all; line-height: 1.5;
}
.dash-note { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: right; }
.statchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.schip { font-size: 11.5px; border-radius: 999px; padding: 2px 10px; background: #f3eee3; color: #6d6250; }
.schip b { font-weight: 700; }
.mini-node { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.mini-node:hover { background: #f6f1e6; }
.mini-node .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mini-node .t { flex-grow: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ───── 落地层 ───── */
#landing {
  position: absolute; inset: 0; z-index: 15; background: var(--paper); overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
}
.land-card { max-width: 640px; margin: 9vh 20px 40px; text-align: center; }
.land-emoji { font-size: 46px; margin-bottom: 10px; }
.land-card h1 { font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.land-sub { color: var(--muted); font-size: 13.5px; margin: 14px 0 26px; line-height: 1.9; }
.land-sub b { color: var(--accent-deep); }
.land-input { display: flex; gap: 0; }
.land-input input {
  flex-grow: 1; border: 1.5px solid var(--line); border-right: none; border-radius: 999px 0 0 999px;
  padding: 12px 22px; font-size: 14.5px; outline: none; background: #fff;
}
.land-input input:focus { border-color: var(--accent); }
.land-input button {
  border: none; background: var(--accent); color: #fff; font-weight: 600; font-size: 14.5px;
  border-radius: 0 999px 999px 0; padding: 0 26px;
}
.land-input button:hover { background: #96743f; }
.land-input button:disabled { background: #c9bda3; cursor: wait; }
.land-status { margin-top: 12px; color: #9a6b1a; font-size: 13px; }
#recent-wrap { margin-top: 44px; text-align: left; }
#recent-wrap h3 { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
}
.recent-item:hover { border-color: var(--accent); }
.recent-item .t { flex-grow: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; }
.recent-item .m { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ───── 模态框 / toast ───── */
#modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(43, 36, 24, .45);
  display: flex; align-items: center; justify-content: center;
}
#modal {
  background: var(--panel); border-radius: 14px; width: min(560px, 92vw);
  max-height: 84vh; overflow-y: auto; padding: 22px 24px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  animation: modalin .18s ease-out;
}
@keyframes modalin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
#modal h3 { font-size: 16px; margin-bottom: 12px; }
#modal .m-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.7; }
#modal label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
#modal input[type=text], #modal textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  font: inherit; font-size: 13.5px; outline: none; background: #fff;
}
#modal input:focus, #modal textarea:focus { border-color: var(--accent); }
#modal textarea { resize: vertical; min-height: 74px; }
.m-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.m-acts .abtn { padding: 6px 18px; }
.ckrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.ckrow:hover { background: #f6f1e6; }
.ckrow input { accent-color: var(--accent); width: 15px; height: 15px; }
.ckrow .t { flex-grow: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: rgba(51, 48, 43, .92); color: #f5efe2; font-size: 13px;
  padding: 9px 20px; border-radius: 999px; animation: modalin .2s;
}
#toast.err { background: rgba(140, 47, 35, .94); }

/* 滚动条 */
#inspector::-webkit-scrollbar, #modal::-webkit-scrollbar, #landing::-webkit-scrollbar { width: 8px; }
#inspector::-webkit-scrollbar-thumb, #modal::-webkit-scrollbar-thumb, #landing::-webkit-scrollbar-thumb {
  background: #d8cdb6; border-radius: 4px;
}

/* ───── 空画布引导 ───── */
#empty-hint {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 10px; background: rgba(255, 253, 248, .92);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px;
  box-shadow: var(--shadow); pointer-events: none; animation: modalin .3s ease-out;
}
.eh-step { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 88px; }
.eh-step i {
  font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.eh-step b { font-size: 12.5px; }
.eh-step span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.eh-arrow { color: #c9bda3; font-size: 14px; }

/* ───── 小地图 ───── */
#minimap {
  position: absolute; right: 14px; bottom: 14px; z-index: 10; width: 176px; height: 122px;
  background: rgba(255, 253, 248, .9); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
}
#minimap svg { width: 100%; height: 100%; display: block; }
#minimap .mm-node { fill: #c9bda3; }
#minimap .mm-node.mm-run { fill: var(--run); }
#minimap .mm-node.mm-done { fill: var(--ok); }
#minimap .mm-node.mm-err { fill: var(--err); }
#minimap .mm-node.mm-root { fill: var(--root-red); }
#minimap .mm-view { fill: rgba(140, 47, 35, .10); stroke: var(--root-red); stroke-width: 1; }

/* ───── 命令面板 (⌘K) ───── */
#palette-mask {
  position: fixed; inset: 0; z-index: 120; background: rgba(43, 36, 24, .35);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh;
  backdrop-filter: blur(2px);
}
#palette {
  width: min(560px, 92vw); background: var(--panel); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(30, 22, 8, .30); animation: modalin .16s ease-out;
}
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #efe8d8; color: var(--muted); }
#palette-input { flex-grow: 1; border: none; outline: none; font: inherit; font-size: 15px; background: none; color: var(--ink); }
.pal-esc { font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; color: var(--muted); }
#palette-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.pal-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px;
}
.pal-item .pi-ico { width: 22px; text-align: center; flex-shrink: 0; font-size: 14px; }
.pal-item .pi-label { flex-grow: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pal-item .pi-hint { font-size: 11px; color: var(--muted); }
.pal-item .pi-hint kbd {
  font-family: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
  background: #f6f1e6; font-size: 10.5px;
}
.pal-item.on { background: #f3ecdd; }
.pal-item.on .pi-label { font-weight: 600; }
.pal-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.pal-foot { padding: 8px 14px; border-top: 1px solid #efe8d8; font-size: 11px; color: var(--muted); }
.pal-sep { font-size: 10.5px; color: var(--muted); padding: 8px 12px 3px; letter-spacing: .08em; }

/* 快捷键帮助表格 */
.kbd-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; font-size: 13px; margin-top: 6px; }
.kbd-grid kbd {
  font-family: inherit; border: 1px solid var(--line); border-radius: 5px; padding: 1px 8px;
  background: #f6f1e6; font-size: 12px; box-shadow: 0 1px 0 var(--line);
}

/* ───── 视图切换 segmented ───── */
#view-tabs {
  display: flex; background: #efe9db; border-radius: 9px; padding: 2.5px; gap: 2px;
}
.vt {
  border: none; background: none; border-radius: 7px; padding: 4px 13px;
  font-size: 12.5px; font-weight: 600; color: #8b7f6c; white-space: nowrap;
}
.vt:hover { color: var(--ink); }
.vt.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(74, 58, 27, .12); }

/* ───── 考证路线图谱 ───── */
#routemap {
  position: absolute; inset: 0; z-index: 12; overflow: auto; background: var(--paper);
  padding: 22px 26px 40px;
}
.rm-head { max-width: 980px; margin: 0 auto 18px; }
.rm-question {
  font-size: 17px; font-weight: 700; line-height: 1.5; padding-bottom: 12px;
  border-bottom: 2px solid var(--root-red); margin-bottom: 4px;
}
.rm-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rm-branches { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; max-width: 1280px; margin: 0 auto; }
.rm-branch { flex: 1 1 260px; min-width: 250px; max-width: 420px; }
.rm-node {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--idle);
  border-radius: 10px; padding: 10px 13px; margin-bottom: 8px; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.rm-node:hover { transform: translateY(-1px); border-color: #cbb98f; }
.rm-node.v-yes { border-left-color: var(--ok); }
.rm-node.v-no { border-left-color: var(--err); }
.rm-node.v-doubt { border-left-color: #c98a2e; }
.rm-node.v-run { border-left-color: var(--run); }
.rm-node.v-none { border-left-color: var(--idle); }
.rm-node.v-syn { border-left-color: #8c6b2f; background: #fbf6ea; }
.rm-top { display: flex; align-items: center; gap: 7px; }
.rm-badge {
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px; flex-shrink: 0;
}
.v-yes > .rm-top .rm-badge { background: #e9f4ec; color: #2e7d4f; }
.v-no > .rm-top .rm-badge { background: #fbeeec; color: #b3402f; }
.v-doubt > .rm-top .rm-badge { background: #fdf3e0; color: #9a6b1a; }
.v-run > .rm-top .rm-badge { background: #fdf3e0; color: #9a6b1a; }
.v-none > .rm-top .rm-badge { background: #efe9de; color: #8a7a63; }
.v-syn > .rm-top .rm-badge { background: #f4ead9; color: #8c5a2e; }
.rm-title { font-weight: 600; font-size: 13.5px; line-height: 1.45; word-break: break-all; }
.rm-verdict {
  font-size: 12px; color: #5d5044; line-height: 1.6; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rm-cites { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.rm-cite {
  font-size: 11px; border: 1px dashed #d8cdb6; background: #faf7f1; color: var(--accent-deep);
  border-radius: 999px; padding: 1.5px 9px; cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rm-cite:hover { border-color: var(--accent); background: #f4ead9; }
.rm-more { font-size: 11px; color: var(--muted); }
.rm-children { margin-left: 15px; border-left: 2px solid #e6ddc9; padding-left: 10px; }
.rm-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 13.5px; }
