:root {
  --bg: #f5f6f8; --panel: #fff; --line: #dde1e6; --text: #1d2329; --muted: #67707a;
  --brand: #1f5fa8; --brand-weak: #e8f0fa; --ok: #1d7a46; --ok-weak: #e6f4ec;
  --warn: #9a5b00; --warn-weak: #fff4e0; --bad: #b42318; --bad-weak: #fdecea;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { background: #17324f; color: #cfe0f2; padding: 16px 0; }
.side .brand { color: #fff; font-weight: 600; padding: 0 18px 16px; line-height: 1.4; }
.side a { display: block; color: #cfe0f2; padding: 9px 18px; }
.side a.on, .side a:hover { background: #224a74; color: #fff; text-decoration: none; }
.main { padding: 18px 24px 40px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.top .grow { flex: 1; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--bg); border-radius: 6px; padding: 10px 14px; min-width: 110px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }

button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 6px 14px; border-radius: 6px; cursor: pointer; }
button:hover { border-color: #b8c0c8; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.danger { color: var(--bad); border-color: #f0c2bd; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.small { padding: 3px 10px; font-size: 13px; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: #fff; }
textarea { width: 100%; min-height: 120px; }
input[type=number] { width: 90px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f input, label.f select, label.f textarea { color: var(--text); font-size: 15px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 500; background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag.collecting, .tag.present, .tag.ok { background: var(--ok-weak); color: var(--ok); }
.tag.paused, .tag.claimed, .tag.awaiting_review, .tag.warn { background: var(--warn-weak); color: var(--warn); }
.tag.terminated, .tag.bad, .tag.left { background: var(--bad-weak); color: var(--bad); }
.tag.reviewed, .tag.sealed { background: var(--brand-weak); color: var(--brand); }

.notice { padding: 10px 12px; border-radius: 6px; margin: 8px 0; }
.notice.warn { background: var(--warn-weak); color: var(--warn); }
.notice.bad { background: var(--bad-weak); color: var(--bad); }
.notice.ok { background: var(--ok-weak); color: var(--ok); }
.notice.info { background: var(--brand-weak); color: var(--brand); }
ul.plain { margin: 4px 0; padding-left: 18px; }

.toasts { position: fixed; right: 20px; top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 99; max-width: 420px; }
.toast { padding: 10px 14px; border-radius: 6px; background: #223; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }

.login { max-width: 360px; margin: 12vh auto; }
.login .panel { padding: 28px; }
.login label.f { margin-bottom: 14px; }
.login input { width: 100%; }

/* 投屏 */
.display { min-height: 100vh; background: #0f2236; color: #fff; padding: 5vh 6vw; display: flex; flex-direction: column; gap: 4vh; }
.display h1 { font-size: 4.2vw; margin: 0; line-height: 1.3; }
.display .st { font-size: 2.6vw; color: #9fc2e8; }
.display .big { display: flex; gap: 4vw; flex-wrap: wrap; }
.display .big div { background: #183352; border-radius: 12px; padding: 2.5vh 3vw; min-width: 18vw; }
.display .big b { display: block; font-size: 6vw; font-variant-numeric: tabular-nums; }
.display .big span { font-size: 1.8vw; color: #9fc2e8; }
.display .verdict { font-size: 4vw; font-weight: 700; }
.display .verdict.pass { color: #7be0a4; }
.display .verdict.fail { color: #ffb4a8; }

@media print {
  .side, .top, .noprint, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .panel { border: none; padding: 0; }
}
