:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f9fafb; --line: #e5e7eb; --text: #1f2937; --muted: #6b7280;
  --accent: #2563eb; --accent-soft: #e8efff; --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #b91c1c; --bad-soft: #fdecec; --info-soft: #eef2f7; --shadow: 0 1px 2px rgba(15, 23, 42, .06);
  --radius: 10px; --side: 216px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --panel: #181b21; --panel-2: #1e222a; --line: #2a2f38; --text: #e5e7eb; --muted: #9aa3af;
    --accent: #6b9bff; --accent-soft: #1e2a44; --ok: #4ade80; --ok-soft: #173024; --warn: #fbbf24; --warn-soft: #33290f;
    --bad: #f87171; --bad-soft: #3a1b1b; --info-soft: #222833; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--panel); border-right: 1px solid var(--line);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px;
  color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .group { color: var(--muted); font-size: 12px; padding: 14px 10px 6px; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px;
  text-align: center; line-height: 20px; }
.main { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 20px; margin: 0; }
.head .sub { color: var(--muted); font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  cursor: default; }
.stat.link { cursor: pointer; }
.stat.link:hover { border-color: var(--accent); }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.alert .n { color: var(--bad); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { width: 100%; min-height: 120px; resize: vertical; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 14px; cursor: pointer;
  white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { padding: 3px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 3px 12px; cursor: pointer; background: var(--panel);
  font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .c { opacity: .75; margin-left: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--panel-2); white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.title { max-width: 420px; min-width: 220px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--info-soft);
  color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.blue { background: var(--accent-soft); color: var(--accent); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; color: var(--muted); }

.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--panel); z-index: 21;
  border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.drawer .dh { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; gap: 10px; }
.drawer .dh h3 { margin: 0; font-size: 16px; }
.drawer .db { padding: 16px 18px; overflow-y: auto; flex: 1; }
.drawer .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end; }
.modal { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, calc(100% - 32px));
  background: var(--panel); border-radius: 12px; z-index: 22; border: 1px solid var(--line); }
.modal .mb { padding: 18px; max-height: 70vh; overflow-y: auto; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }

.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.form-row > label { color: var(--muted); }
.radio-line { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-line label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.article { white-space: pre-wrap; line-height: 1.85; background: var(--panel-2); border-radius: 8px; padding: 14px;
  font-size: 15px; }
.issues li { margin-bottom: 6px; }
.card-md { white-space: pre-wrap; font-size: 12.5px; color: var(--muted); background: var(--panel-2);
  border-radius: 8px; padding: 12px; max-height: 260px; overflow-y: auto; }
.binding { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.binding .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px;
  color: var(--muted); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 40; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }
.login { max-width: 360px; margin: 14vh auto; }
.login h1 { font-size: 20px; text-align: center; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 2px 6px 8px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav .group { padding: 6px 10px; }
  .nav a { white-space: nowrap; margin: 0; }
  .main { padding: 16px 16px 60px; }
  .form-row { grid-template-columns: 1fr; gap: 4px; }
}

.article-html { line-height: 1.85; background: var(--panel-2); border-radius: 8px; padding: 14px; overflow-wrap: anywhere; }
.article-html img { max-width: 100% !important; height: auto !important; }
.article-html * { max-width: 100%; box-sizing: border-box; }

.diff { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.7; background: var(--panel-2); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.diff .add { background: var(--ok-soft); color: var(--ok); }
.diff .del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.diff .hunk { color: var(--muted, #888); }

.alert-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line, #eee); }
.alert-row:first-of-type { border-top: 0; }

.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); margin: 12px 0; }
.kpi { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi .n { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.mix { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line); }
.mix span { display: block; min-width: 0; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 12px; color: var(--muted); }
.mix-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.rv-charts { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .rv-charts { grid-template-columns: 1fr; } }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .trend-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .hover-line { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2.5; }
.chart-tip { position: absolute; top: 2px; right: 4px; font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.rank-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.rank-val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.click { cursor: pointer; user-select: none; }
/* 终审台：被挡下句子的提醒（2026-10-11） */
mark.risk { background: #fff1a8; color: inherit; padding: 0 2px; border-radius: 3px; }
.risk-note { color: var(--bad); font-weight: 600; font-size: 13px; }
.risk-basis { display: block; color: var(--muted, #888); font-size: 12.5px; margin: 2px 0 8px; padding-left: 8px; border-left: 3px solid var(--line, #ddd); }
.edit-area { width: 100%; min-height: 360px; font: inherit; line-height: 1.7; padding: 10px; border-radius: 8px; border: 1px solid var(--line, #ddd); background: var(--panel, #fff); color: inherit; box-sizing: border-box; }
@media (prefers-color-scheme: dark) { mark.risk { background: #5a4a00; } }
/* 终审台：核对清单点一下跳到文中那一句（2026-10-12） */
.risk-link { cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.risk-link:hover { background: rgba(217,163,0,.12); }
.risk-go { color: var(--accent, #2f6fde); white-space: nowrap; }
.risk-no { display: inline-block; min-width: 18px; text-align: center; font-size: 12px; color: #fff; background: #d9a300; border-radius: 9px; margin-right: 3px; }
.risk-wrap { scroll-margin-top: 80px; }
.risk-wrap.flash mark.risk { animation: riskflash 1.6s ease 2; }
@keyframes riskflash { 0%,100% { background: #fff1a8; } 50% { background: #ffb347; } }
