/* searchs index 内部 UI：单一浅色主题，一个强调色，尽量少边框 */
:root {
  --bg:#f7f7f5; --surface:#fff; --line:#e7e5e0; --fg:#171717; --dim:#6b6a66; --muted:#a09e98;
  --acc:#2a78d6; --acc-soft:#e6f0fc; --ok:#008300; --ok-soft:#e5f3e5; --bad:#e34948; --bad-soft:#fce8e7; --warn:#c98500; --warn-soft:#fdf2da;
  --mono:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing:border-box }
html { color-scheme:light }
body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.55 -apple-system, "Segoe UI", Roboto, "PingFang SC", "Noto Sans CJK SC", sans-serif }
a { color:var(--acc); text-decoration:none } a:hover { text-decoration:underline }
b { font-weight:600 }
.dim { color:var(--dim) } .mono { font-family:var(--mono); font-size:12.5px }

header { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:12px 24px; background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5 }
.brand { font-weight:600; font-size:15px } .brand span { color:var(--acc); font-weight:400 }
nav { display:flex; gap:2px }
nav button { background:none; border:0; color:var(--dim); padding:6px 12px; border-radius:6px; cursor:pointer; font:inherit }
nav button:hover { color:var(--fg); background:var(--bg) }
nav button.active { color:var(--fg); background:var(--acc-soft); font-weight:500 }
.tok { margin-left:auto; display:flex; gap:6px } .tok input { width:180px; max-width:40vw }

main { max-width:1040px; margin:0 auto; padding:24px }
.tab { display:none } .tab.active { display:block }
.intro { color:var(--dim); margin:0 0 18px; max-width:760px }

input, select, button { font:inherit }
input, select { background:var(--surface); color:var(--fg); border:1px solid var(--line); border-radius:8px; padding:7px 10px }
input:focus, select:focus { outline:2px solid var(--acc-soft); border-color:var(--acc) }
button { background:var(--surface); color:var(--fg); border:1px solid var(--line); border-radius:8px; padding:7px 14px; cursor:pointer }
button:hover { border-color:var(--dim) }
button.primary { background:var(--acc); border-color:var(--acc); color:#fff }
button.primary:hover { background:#1f66bd }

.searchbar { display:flex; gap:8px; margin-bottom:10px } .searchbar #q { flex:1; font-size:16px; padding:10px 14px }
.opts { display:flex; flex-wrap:wrap; gap:14px; color:var(--dim); margin-bottom:20px; font-size:13px }
.opts label { display:flex; align-items:center; gap:6px } .opts input, .opts select { padding:4px 8px }
.toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:16px }

/* 决策卡 */
.decision { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-bottom:20px }
.decision-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 16px; margin-bottom:6px }
.verdict { font-size:18px; font-weight:600 } .verdict.ok { color:var(--ok) } .verdict.no { color:var(--bad) }
.reason { color:var(--dim) } .reason code { font-family:var(--mono); font-size:12.5px; color:var(--fg); background:var(--bg); padding:1px 6px; border-radius:4px }
.legs { color:var(--muted); font-size:12.5px; margin-bottom:12px }
.sig-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:8px }
.sig { background:var(--bg); border-radius:8px; padding:8px 10px; border-left:3px solid var(--line) }
.sig.pass { border-left-color:var(--ok) } .sig.fail { border-left-color:var(--bad) } .sig.warn { border-left-color:var(--warn) }
.sig .k { font-size:12px; color:var(--dim) }
.sig .v { font-family:var(--mono); font-size:14px; margin:2px 0 } .sig .v small { color:var(--muted); font-family:inherit; margin-left:6px }
.sig .d { font-size:11.5px; color:var(--muted); line-height:1.4 }

/* 结果 */
.hit { padding:14px 0; border-bottom:1px solid var(--line) } .hit:last-child { border-bottom:0 }
.hit .t { font-size:15px } .hit .t .id { color:var(--muted); font-family:var(--mono); font-size:12px; margin-left:8px; cursor:pointer }
.hit .u { color:var(--ok); font-size:12.5px; word-break:break-all }
.hit .t, .hit .s { overflow-wrap:anywhere } .hit .s { margin:4px 0 8px; color:var(--dim) }
.chips { display:flex; flex-wrap:wrap; gap:4px }
.c { font-size:11.5px; padding:1px 8px; border-radius:10px; background:var(--bg); color:var(--dim) }
.c.leg { background:var(--acc-soft); color:#1c5cab } .c.prov { background:#f0ecfa; color:#4a3aa7 } .c.conf { background:var(--ok-soft); color:var(--ok) }
.c.body { background:var(--warn-soft); color:#8a5a00 } .c.click { background:var(--ok-soft); color:var(--ok) }
.help { margin-top:20px; color:var(--dim); font-size:13px } .help summary { cursor:pointer; color:var(--acc) }
.help dl { margin:10px 0 0; display:grid; grid-template-columns:max-content 1fr; gap:6px 14px } .help dt { font-family:var(--mono); font-size:12px; color:var(--fg) } .help dd { margin:0 }

/* 表格 */
.tablewrap { overflow-x:auto; background:var(--surface); border:1px solid var(--line); border-radius:12px }
table { width:100%; border-collapse:collapse; font-size:13px }
th, td { text-align:left; padding:8px 12px; border-bottom:1px solid var(--line); vertical-align:top; white-space:nowrap }
td.wrap { white-space:normal; min-width:200px; overflow-wrap:anywhere }
td.reason { white-space:normal; max-width:220px; overflow-wrap:anywhere }
tr:last-child td { border-bottom:0 }
th { color:var(--dim); font-weight:500; font-size:12px; position:sticky; top:0; background:var(--surface) }
td.num { text-align:right; font-variant-numeric:tabular-nums }
.w1 { color:var(--ok) } .w0 { color:var(--dim) }
.summary { display:flex; flex-wrap:wrap; gap:8px 24px; margin-bottom:12px; color:var(--dim); font-size:13px } .summary b { color:var(--fg); font-variant-numeric:tabular-nums }
.empty { color:var(--muted); padding:28px; text-align:center } .err { color:var(--bad); padding:12px }
pre { background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:12px; overflow:auto; font-size:12.5px; margin:0 }

/* 统计页 */
.hero { padding:8px 0 20px }
.hero .num { font-size:48px; font-weight:600; line-height:1.1; letter-spacing:-.02em; font-variant-numeric:tabular-nums }
.hero .label { color:var(--dim); margin-top:4px } .hero .sub { color:var(--dim); font-size:13px; margin-top:4px }
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-bottom:16px }
.card h2 { font-size:14px; font-weight:600; margin:0 0 4px } .card .note { color:var(--muted); font-size:12.5px; margin:0 0 12px }
.grid2 { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; margin-bottom:16px; align-items:start } .grid2 .card { margin:0 }
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; margin-bottom:16px }
.tile { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 14px }
.tile .k { font-size:12px; color:var(--dim) } .tile .v { font-size:22px; font-weight:600; font-variant-numeric:tabular-nums; margin:2px 0 } .tile .s { font-size:12px; color:var(--muted) }
.insights { list-style:none; margin:0; padding:0 }
.insights li { padding:8px 0 8px 22px; position:relative; border-bottom:1px solid var(--line) } .insights li:last-child { border-bottom:0 }
.insights li::before { content:""; position:absolute; left:4px; top:15px; width:8px; height:8px; border-radius:50%; background:var(--muted) }
.insights li.warn::before { background:var(--warn) } .insights li.ok::before { background:var(--ok) } .insights li.bad::before { background:var(--bad) }
.hb { display:grid; grid-template-columns:minmax(90px, 32%) 1fr max-content; align-items:center; gap:10px; padding:4px 0; font-size:13px }
.hb .l { overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .hb .sub { grid-column:1 / -1; color:var(--muted); font-size:11.5px; line-height:1.3; margin:-2px 0 4px }
.hb .track { height:10px; background:var(--bg); border-radius:0 4px 4px 0; overflow:hidden } .hb .fill { height:100%; background:var(--acc); border-radius:0 4px 4px 0 }
.hb.bad .fill { background:var(--bad) } .hb.ok .fill { background:var(--ok) } .hb.warn .fill { background:var(--warn) }
.hb .v { color:var(--dim); font-variant-numeric:tabular-nums; white-space:nowrap } .hb .v b { color:var(--fg) } .hb .v .x { color:var(--muted); font-size:12px; margin-left:8px }
.more { margin-top:6px; font-size:12.5px } .more summary { cursor:pointer; color:var(--acc); padding:2px 0 } .more[open] summary { margin-bottom:4px }
.cols { display:flex; align-items:flex-end; gap:4px; height:120px; border-bottom:1px solid var(--line) }
.col { flex:1; height:100%; display:flex; align-items:flex-end; justify-content:center }
.col .bar { width:100%; max-width:24px; background:var(--acc); border-radius:4px 4px 0 0; min-height:0 } .col:hover .bar { background:#1c5cab }
.col .bar.today { background:#86b6ef }
.axis { display:flex; justify-content:space-between; color:var(--muted); font-size:11.5px; margin-top:4px }
.kv { width:100%; font-size:13px } .kv td { padding:6px 8px 6px 0; white-space:normal } .kv td:first-child { font-family:var(--mono); font-size:12.5px; white-space:nowrap } .kv td:nth-child(2) { font-variant-numeric:tabular-nums; white-space:nowrap } .kv td:last-child { color:var(--dim) }

dialog { background:var(--surface); color:var(--fg); border:1px solid var(--line); border-radius:12px; width:min(900px, 92vw); max-height:85vh; padding:0 }
dialog::backdrop { background:rgba(0,0,0,.35) }
.dlg-head { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); font-weight:500 }
.dlg-head button { border:0; font-size:18px; padding:0 6px }
#dlgBody { padding:14px 16px; max-height:70vh; overflow:auto }
#dlgBody pre { white-space:pre-wrap; word-break:break-word; border:0; background:var(--bg) }
#dlgBody details { margin-top:12px } #dlgBody summary { cursor:pointer; color:var(--acc) }
@media (max-width:640px) { .hb .v { white-space:normal } .hb .v .x { display:block; margin:0 } main { padding:16px } header { padding:10px 16px } .tok { margin-left:0 } .hero .num { font-size:36px } }
