:root {
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1f2328; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --code: #f3f4f6;
  --stale: #fde68a; --retired: #fca5a5; --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111315; --panel: #1a1d21; --ink: #e5e7eb; --muted: #9ca3af; --line: #2b3036; --code: #22262b; --stale: #7c5e10; --retired: #7f1d1d; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
header { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: .3px; } .brand span { color: var(--muted); font-weight: 400; }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--ink); white-space: nowrap; }
nav a.active { background: var(--code); font-weight: 600; }
.right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
main { padding: 18px 20px 60px; max-width: 1400px; margin: 0 auto; }
h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 16px 0 8px; } h4 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.grid { display: grid; gap: 16px; } .grid.two { grid-template-columns: 340px 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--panel); }
.item:hover, .item.active { border-color: var(--accent); }
.item .title { font-weight: 600; } .item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; background: var(--code); color: var(--muted); margin-right: 4px; vertical-align: middle; }
.tag.pending { color: var(--warn); } .tag.revising { color: var(--accent); } .tag.approved { color: var(--ok); } .tag.rejected { color: var(--bad); }
.tag.fact { color: #2563eb; } .tag.experience { color: #7c3aed; } .tag.preference { color: #0891b2; } .tag.feedback { color: #dc2626; } .tag.reference { color: #6b7280; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button.danger { color: var(--bad); }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
input, textarea, select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); width: 100%; }
textarea { min-height: 80px; font-family: var(--mono); font-size: 12.5px; }
pre, code { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--code); padding: 10px 12px; border-radius: 6px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.retired td { color: var(--muted); text-decoration: line-through; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.diff pre { margin: 0; } .diff .old { border-left: 3px solid var(--bad); } .diff .new { border-left: 3px solid var(--ok); }
@media (prefers-color-scheme: dark) { .conflict { color: #fde68a; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; font-size: 13px; }
.stat { display: flex; gap: 18px; flex-wrap: wrap; } .stat div b { display: block; font-size: 22px; }
.tree ul { list-style: none; padding-left: 14px; margin: 0; } .tree li { padding: 1px 0; white-space: nowrap; }
.tree .dir { color: var(--muted); cursor: pointer; } .tree .file { cursor: pointer; } .tree .file.active { color: var(--accent); font-weight: 600; }
.blockbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.blockbar div { font-size: 10px; color: #fff; overflow: hidden; white-space: nowrap; padding: 0 4px; line-height: 18px; }
.doc { max-width: 900px; } .doc h1 { font-size: 22px; } .doc h2 { font-size: 18px; margin-top: 28px; border-bottom: 1px solid var(--line); padding-bottom: 4px; } .doc h3 { font-size: 15px; }
.doc table { font-size: 13px; margin: 8px 0; } .doc pre { font-size: 12px; }
.doc img, .doc svg { max-width: 100%; }
canvas#graph { width: 100%; height: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#toast { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; z-index: 20; max-width: min(720px, 92vw); box-shadow: 0 6px 20px -8px rgba(0,0,0,.4); font-size: 13px; line-height: 1.5; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); min-width: 360px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 12px 0 0; }
.md-body :is(h1,h2,h3) { margin-top: 14px; }
.stale-note { background: var(--stale); color: #111; padding: 4px 8px; border-radius: 6px; font-size: 12px; display: inline-block; }
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; } .searchbar input { flex: 1; }
.svg-state { max-width: 720px; }
td.small { word-break: break-all; }

/* ---- 审核页 ------------------------------------------------------------ */
.review { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } .rv-side { position: static !important; max-height: none !important; } .rv-main { min-height: 0; } .rv-placeholder { padding: 28px 16px; } header { gap: 10px 14px; padding: 8px 12px; } }
.rv-side { position: sticky; top: 62px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 10px; }
.rv-side-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.count { font-size: 12px; font-weight: 600; background: var(--code); color: var(--muted); border-radius: 10px; padding: 0 8px; line-height: 20px; }
.count.warn { background: var(--stale); color: #7c2d12; }
.rv-filters { display: flex; gap: 6px; } .rv-filters input { flex: 1; } .rv-filters select { width: auto; max-width: 45%; }
.rv-list { overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; min-height: 80px; }
.rv-item { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); border-left: 3px solid var(--warn); transition: border-color .12s, background .12s; }
.rv-item.revising { border-left-color: var(--accent); }
.rv-item:hover { border-color: var(--accent); border-left-color: var(--accent); }
.rv-item.active { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border-color: var(--accent); border-left-color: var(--accent); }
.rv-item-top { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.rv-item-top .agent { font-weight: 600; color: var(--ink); } .rv-item-top .when { margin-left: auto; white-space: nowrap; }
.rv-item-title { margin: 4px 0 6px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-item-pills, .pill { font-size: 11.5px; }
.rv-item-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--code); color: var(--muted); line-height: 16px; white-space: nowrap; }
.pill.rev { color: var(--ink); } .pill.revising { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pill.conflict { background: var(--stale); color: #7c2d12; font-weight: 600; }
.op-obs { --op: #2563eb; } .op-retire { --op: #dc2626; } .op-adr { --op: #b45309; } .op-rej { --op: #be123c; } .op-sum { --op: #d97706; } .op-log { --op: #6b7280; } .op-focus { --op: #7c3aed; } .op-l3 { --op: #0f766e; } .op-x { --op: #6b7280; }
.pill.op-obs, .pill.op-retire, .pill.op-adr, .pill.op-rej, .pill.op-sum, .pill.op-log, .pill.op-focus, .pill.op-l3 { color: var(--op); background: color-mix(in srgb, var(--op) 12%, transparent); }
.rv-empty { padding: 28px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; line-height: 1.7; }
.rv-side-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-alerts .alert { background: var(--stale); color: #111; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px; }
@media (prefers-color-scheme: dark) { .rv-alerts .alert { color: #fde68a; } .count.warn, .pill.conflict { color: #fde68a; } }
.rv-reconfirm { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rv-reconfirm > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.rv-reconfirm > summary::-webkit-details-marker { display: none; }
.rv-reconfirm > summary::before { content: '▸'; color: var(--muted); font-weight: 400; } .rv-reconfirm[open] > summary::before { content: '▾'; }
.rv-reconfirm > summary .muted { font-weight: 400; margin-left: auto; }
.rv-reconfirm .list { padding: 0 10px 10px; max-height: 320px; overflow: auto; }
.rc-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; } .rc-item .meta { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.rc-actions, .rc-retire { display: flex; gap: 6px; align-items: center; } .rc-retire input { flex: 1; font-size: 12px; padding: 4px 6px; }
button.small { padding: 3px 9px; font-size: 12px; }
button.ok-outline { color: var(--ok); border-color: var(--ok); }
button.armed { outline: 2px solid var(--warn); outline-offset: 1px; }

.rv-main { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 60vh; display: flex; flex-direction: column; }
.rv-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); padding: 60px 20px; text-align: center; line-height: 1.8; }
.rv-placeholder .big { font-size: 40px; opacity: .3; }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--code); color: var(--muted); vertical-align: 1px; }
.rv-head { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.rv-head h2 { font-size: 17px; margin: 6px 0; line-height: 1.4; }
.rv-status-line { display: flex; align-items: center; gap: 8px; }
.rv-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; } .rv-meta b { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--mono); }
.rv-nav { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.banner { padding: 10px 20px; font-size: 13px; border-bottom: 1px solid var(--line); }
.banner.warn { background: color-mix(in srgb, var(--stale) 45%, var(--panel)); }
.rv-changes { padding: 12px 20px 4px; } .rv-changes h3, .rv-log h3 { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.chg { border: 1px solid var(--line); border-left: 3px solid var(--op, var(--line)); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.chg.has-conflict { border-color: var(--warn); border-left-color: var(--warn); }
.chg-head { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: color-mix(in srgb, var(--op, var(--muted)) 6%, var(--panel)); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.op-badge { font-weight: 600; color: var(--op, var(--ink)); }
.chg-target { font-family: var(--mono); font-size: 12px; color: var(--muted); } .chg-target:hover { color: var(--accent); text-decoration: underline; }
.chg-remove { margin-left: auto; color: var(--muted); } .chg-remove:hover { color: var(--bad); }
.chg-body { padding: 10px 12px; }
.chg-body pre { margin: 0; max-height: 360px; }
.obs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 14px; line-height: 1.55; }
.obs .obs-text { flex: 1 1 auto; min-width: 200px; }
.obs.new { padding-left: 10px; border-left: 3px solid var(--ok); } .obs.existing { padding-left: 10px; border-left: 3px solid var(--muted); font-size: 13px; margin: 6px 0; } .obs.retire { padding-left: 10px; border-left: 3px solid var(--bad); }
.hashtag { font-size: 12px; color: var(--accent); opacity: .85; } .obs-meta { flex-basis: 100%; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.diff-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
@media (max-width: 700px) { .diff { grid-template-columns: 1fr; } }
.conflict { margin: 0 12px 12px; padding: 8px 12px; background: var(--stale); color: #111; border-radius: 8px; font-size: 13px; }
.conflict-head { margin-bottom: 4px; }
.rv-evidence { padding: 0 20px; } .rv-evidence summary, .rv-log summary { cursor: pointer; font-weight: 600; } .rv-evidence summary .muted { font-weight: 400; margin-left: 6px; }
.rv-evidence pre { max-height: 240px; }
.rv-log { padding: 12px 20px 16px; }
.timeline { list-style: none; margin: 0 0 10px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 2px 0 10px 14px; display: flex; gap: 12px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -19px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.timeline li.tl-approve::before, .timeline li.tl-approved::before { background: var(--ok); } .timeline li.tl-reject::before, .timeline li.tl-rejected::before { background: var(--bad); } .timeline li.tl-feedback::before { background: var(--warn); } .timeline li.tl-revised::before, .timeline li.tl-edited::before { background: var(--accent); }
.tl-when { color: var(--muted); min-width: 70px; font-size: 12px; padding-top: 1px; } .tl-note { color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.rv-actions { position: sticky; bottom: 0; margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel); border-radius: 0 0 12px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -8px 16px -12px rgba(0,0,0,.25); }
.rv-actions.closed { padding: 10px 20px; }
.rv-actions textarea { min-height: 36px; height: 36px; font-family: var(--font); font-size: 13.5px; resize: none; overflow: hidden; }
.rv-actions textarea.shake { animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rv-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .rv-btns .spacer { flex: 1; }
.rv-btns button { padding: 7px 14px; } .rv-btns kbd { margin-left: 4px; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.15); color: inherit; } .rv-btns button.danger kbd, .rv-btns button.ghost kbd { border-color: var(--line); background: var(--code); color: var(--muted); }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; } @keyframes spin { to { transform: rotate(360deg); } }
.dlg-json { width: min(860px, 92vw); } .dlg-json textarea { min-height: 50vh; font-size: 12.5px; }
dialog::backdrop { background: rgba(0,0,0,.35); }
