:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1d2330; --muted: #667085; --line: #d9dee7;
  --pri: #1f5fbf; --ok: #1b7f3b; --gap: #b7791f; --mid: #c2410c; --bad: #b42318; --none: #98a2b3; --back: #6941c6;
  --assume: #fff4d6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #14213d; color: #fff; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; }
.brand .sub { font-weight: 400; font-size: 12px; margin-left: 10px; color: #ffd27a; }
.cur { flex: 1; min-width: 160px; }
.dirty { background: #ffd27a; color: #14213d; border-radius: 4px; padding: 0 6px; font-size: 12px; margin-left: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 6px; padding: 5px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary { background: var(--pri); color: #fff; border-color: var(--pri); }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
button.small { padding: 1px 8px; font-size: 12px; }
button.danger { color: var(--bad); }
.wrap { display: flex; min-height: calc(100vh - 54px); }
aside { width: 240px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 12px; }
aside h3 { margin: 0 0 8px; font-size: 14px; }
#siteList { list-style: none; margin: 0; padding: 0; }
#siteList li { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
#siteList li:hover { background: #eef2f8; }
#siteList li.on { background: #dbe6fb; }
#siteList .tag { font-size: 11px; color: var(--muted); }
.newsite { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.newsite input { width: 100%; margin-bottom: 6px; }
.row2 { display: flex; gap: 6px; }
.row2 button { flex: 1; font-size: 12px; padding: 4px 6px; }
.hint { color: var(--muted); font-size: 12px; }
main { flex: 1; min-width: 0; padding: 12px 16px 40px; }
#tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
#tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 6px 12px; }
#tabs button.on { border-bottom-color: var(--pri); font-weight: 700; }
.tab { display: none; }
.tab.on { display: block; }
.empty { color: var(--muted); }
.status { padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.status.good { background: #e7f6ec; color: var(--ok); }
.status.warn { background: #fff4e5; color: #9a5b00; }
.status.bad { background: #fde8e7; color: var(--bad); }
.status.busy { background: #eef2f8; color: var(--pri); }
fieldset { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin: 0 0 12px; padding: 10px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 14px; }
.f { display: flex; flex-direction: column; gap: 2px; }
.f > label { font-size: 12px; color: var(--muted); }
.f .need { color: var(--bad); }
.q { display: flex; gap: 4px; }
.q input.v { width: 90px; }
.q select { width: 64px; }
.q input.ref { flex: 1; min-width: 60px; }
.q.assumed input.v { background: var(--assume); }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: #fff; }
input.err, select.err, textarea.err { border-color: var(--bad); background: #fff5f5; }
textarea { width: 100%; min-height: 46px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fbfcfe; }
.card h4 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.card h4 .k { font-size: 12px; color: var(--muted); font-weight: 400; }
.problems { background: #fde8e7; border: 1px solid #f3b8b3; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.problems li { margin: 2px 0; }
.problems code { background: #fff; padding: 0 4px; border-radius: 3px; }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
th { background: #eef2f8; font-weight: 600; white-space: nowrap; }
td.num { white-space: nowrap; }
.set { font-weight: 700; font-size: 15px; }
.prim { color: var(--muted); font-size: 12px; }
.uv { color: #9a5b00; font-size: 12px; }
.okv { color: var(--ok); }
.badv { color: var(--bad); font-weight: 700; }
tr.dev-first td { border-top: 2px solid #9aa4b5; }
tr.exp td { background: #f9fafb; font-size: 12px; }
.why li { margin: 1px 0; }
.lv-擋 { color: var(--bad); font-weight: 700; }
.lv-警告 { color: #9a5b00; font-weight: 700; }
.lv-注意 { color: var(--muted); }
.chip { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; margin-right: 6px; }
.chip.擋 { background: #fde8e7; color: var(--bad); }
.chip.警告 { background: #fff4e5; color: #9a5b00; }
.chip.注意 { background: #eef2f8; color: var(--muted); }
.seqbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); margin: 4px 0; }
.seqbar span { display: block; height: 100%; }
.c-✓ { background: var(--ok); } .c-○ { background: var(--gap); } .c-△ { background: var(--mid); } .c-✗ { background: var(--bad); } .c-－ { background: var(--none); } .c-後 { background: var(--back); }
.seqtable td:first-child { white-space: nowrap; font-weight: 700; }
.legend span { margin-right: 12px; font-size: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }
.plotwrap { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.plotctl { width: 260px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.plotctl label { display: block; font-size: 13px; }
.plotctl .sw { display: inline-block; width: 18px; height: 4px; vertical-align: middle; margin-right: 4px; }
svg.plot { background: #fff; border: 1px solid var(--line); border-radius: 8px; flex: 1; min-width: 320px; max-width: 980px; height: auto; }
.tip { position: fixed; pointer-events: none; background: #14213d; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 4px; z-index: 9; }
pre.json { background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 8px; max-height: 70vh; overflow: auto; font-size: 12px; }
@media (max-width: 760px) {
  .wrap { flex-direction: column; }
  aside { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
}

td.chg { background: #fff7e0; font-weight: 600; }
