/* proxy-pool-panel · 样式
   间距刻度 4 / 8 / 12 / 16 / 24 / 32；控件高度 32；圆角 6（控件）/ 10（卡片）；线宽 1px */
:root {
  --bg: #f7f5f1;
  --panel: #ffffff;
  --sunken: #faf8f5;
  --text: #24201c;
  --text-2: #5c544c;
  --muted: #8a8178;
  --faint: #b8afa5;
  --line: #ebe6df;
  --line-strong: #dcd5cb;
  --hover: #f5f2ed;
  --accent: #bf5536;
  --accent-hover: #ab4a2e;
  --accent-soft: rgba(191, 85, 54, .08);
  --accent-ring: rgba(191, 85, 54, .22);
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(40, 30, 20, .04);
  --shadow-pop: 0 8px 28px rgba(40, 30, 20, .12), 0 1px 3px rgba(40, 30, 20, .06);
  --r-sm: 6px;
  --r: 10px;
  --h: 32px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #161412;
  --panel: #1d1a17;
  --sunken: #191714;
  --text: #ede7df;
  --text-2: #bdb4aa;
  --muted: #958b81;
  --faint: #645b53;
  --line: #2b2723;
  --line-strong: #3b352f;
  --hover: #24201c;
  --accent: #df7a5c;
  --accent-hover: #e88d71;
  --accent-soft: rgba(223, 122, 92, .11);
  --accent-ring: rgba(223, 122, 92, .28);
  --accent-text: #1a1512;
  --shadow: none;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line-strong);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans); font-size: 14px; line-height: 20px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
code, .mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; line-height: 28px; }
h2 { font-size: 14px; line-height: 20px; }
svg { flex: none; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.accent { color: var(--accent); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- 顶栏 ---------- */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 1440px; margin: 0 auto; padding: 0 32px; height: 56px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand .dot { width: 16px; height: 16px; border: 1.5px solid var(--accent); border-radius: 50%; display: grid; place-items: center; }
.brand .dot::after { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
nav.tabs { display: flex; gap: 4px; height: 100%; }
nav.tabs a {
  position: relative; display: flex; align-items: center; padding: 0 12px; color: var(--muted);
  font-weight: 500; white-space: nowrap; transition: color .15s;
}
nav.tabs a:hover { color: var(--text); }
nav.tabs a.on { color: var(--text); }
nav.tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.top-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }

main { max-width: 1440px; margin: 0 auto; padding: 32px 32px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; min-height: 32px; flex-wrap: wrap; }
.page-head .title { display: flex; align-items: center; gap: 12px; }
.count-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
footer.foot { max-width: 1440px; margin: 0 auto; padding: 0 32px 32px; color: var(--faint); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { height: 52px; padding: 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-h .link { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.card-b { padding: 20px; }
.card.flex { display: flex; flex-direction: column; }
.card.flex > .card-b { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .card:last-child { flex: 1; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.kpi { padding: 16px 20px; min-width: 0; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.kpi .k { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.kpi .v { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; height: 32px; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .s { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 图表 ---------- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; height: 224px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bar .n { font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bar .c { width: 100%; max-width: 48px; background: var(--accent); opacity: .9; border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .15s; }
.bar:hover .c { opacity: 1; }
.bar-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line-strong); padding-top: 8px; }
.bar-labels span { text-align: center; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 4px; }
.hbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 56px; align-items: center; gap: 12px; height: 20px; font-size: 13px; }
.hbar .key { font-weight: 500; font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.fill { height: 100%; background: var(--accent); border-radius: 3px; }
.hbar .num { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; align-items: center; }
.rate .num { text-align: right; color: var(--text-2); font-size: 12px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 24px; margin: 0; font-size: 13px; line-height: 20px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.proto-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; height: 24px; font-size: 13px; }
.proto-row .num { color: var(--text-2); }
.proto-row + .proto-row { margin-top: 8px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { height: 44px; padding: 0 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { height: 36px; font-weight: 500; color: var(--muted); font-size: 12px; background: var(--sunken); position: sticky; top: 0; z-index: 1; }
th.right, td.right { text-align: right; }
th.sort { cursor: pointer; user-select: none; transition: color .15s; }
th.sort:hover, th.sort.on { color: var(--text); }
th.sort .ar { display: inline-block; width: 10px; margin-left: 2px; color: var(--accent); font-size: 11px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }
td.chk, th.chk { width: 44px; padding-right: 0; }
td.addr { font-family: var(--mono); font-size: 12.5px; cursor: copy; transition: color .12s; }
td.addr:hover { color: var(--accent); }
.cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.url-cell:hover { color: var(--text); }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); font-size: 13px; }
td.empty { height: auto; white-space: normal; }
.empty .ico { width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.empty .t { color: var(--text); font-weight: 500; margin-bottom: 4px; }
.empty button { margin-top: 16px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 96px 16px; color: var(--muted); font-size: 13px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.status.ok::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status.ok { color: var(--text); }
.status.dead { color: var(--muted); }
.status.dead::before { background: transparent; border: 1px solid var(--faint); }
.hist { display: inline-flex; gap: 2px; vertical-align: middle; }
.hist i { width: 3px; height: 12px; border-radius: 1px; background: var(--line); }
.hist i.y { background: var(--accent); }
.hist i.n { background: var(--faint); }
.succ { display: inline-flex; align-items: center; gap: 8px; }
.succ .num { width: 36px; text-align: right; color: var(--text-2); font-size: 12px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 11.5px; line-height: 1; color: var(--text-2); white-space: nowrap; font-weight: 500; vertical-align: middle; }
.tag.acc { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.tag.plain { border-color: transparent; background: var(--hover); color: var(--muted); }
.err-text { color: var(--accent); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.plus { color: var(--muted); font-size: 12px; margin-left: 4px; }
.fail { color: var(--accent); font-size: 12px; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- 按钮 / 表单 ---------- */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 500; height: var(--h); padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; line-height: 1;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
button:hover, .btn:hover { border-color: var(--faint); background: var(--hover); color: var(--text); }
button:active { transform: translateY(.5px); }
button:disabled { opacity: .45; cursor: default; pointer-events: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--hover); }
button.danger:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
button.ghost.danger:hover { border-color: transparent; }
button.icon { width: var(--h); padding: 0; }
button.sm { height: 28px; padding: 0 8px; font-size: 12px; }
button.sm.icon { width: 28px; }
.btn-group { display: inline-flex; gap: 4px; }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel); height: var(--h); line-height: 20px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 10px; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 6px 10px; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238a8178' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; padding: 0; flex: none;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); cursor: pointer; vertical-align: middle;
  display: inline-grid; place-items: center;
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after {
  content: ""; width: 8px; height: 5px; border: 1.6px solid var(--accent-text); border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:indeterminate::after { content: ""; width: 8px; height: 1.6px; background: var(--accent-text); border-radius: 1px; }
label.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; color: var(--text-2); white-space: nowrap; height: var(--h); user-select: none; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .lbl { display: flex; align-items: center; gap: 4px; height: 16px; font-size: 12px; line-height: 16px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.field input, .field select, .field textarea { width: 100%; }
.field input[type=checkbox] { width: 16px; }
.info { display: inline-grid; place-items: center; width: 14px; height: 14px; color: var(--faint); cursor: help; position: relative; }
.info:hover { color: var(--muted); }
.info[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 260px; white-space: normal; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 18px; font-weight: 400; z-index: 50; box-shadow: var(--shadow-pop);
}
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.filters .checks { display: flex; align-items: center; gap: 24px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 56px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.toolbar .meta { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toolbar .meta b { color: var(--text); font-weight: 600; }
.toolbar .sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }
.menu { position: relative; display: inline-block; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px; min-width: 200px; z-index: 40; display: none; box-shadow: var(--shadow-pop);
}
.menu.open .menu-list { display: block; animation: pop .12s ease-out; }
.menu-list button { width: 100%; border: none; justify-content: space-between; background: transparent; font-weight: 400; }
.menu-list button span { color: var(--muted); font-size: 12px; }
.menu-list button:hover { background: var(--hover); }
.pager { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 20px; border-top: 1px solid var(--line); gap: 12px; }
.pager .info-text { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager select { width: 92px; }
.pager .pg { display: inline-flex; align-items: center; gap: 8px; }
.pager .pg span { min-width: 64px; text-align: center; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 32px; height: 18px; display: inline-block; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background .18s; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 360px; padding: 32px; box-shadow: var(--shadow-pop); }
.login h1 { margin-top: 24px; }
.login form { margin-top: 24px; display: grid; gap: 12px; }
.login input, .login button { height: 40px; }
.login input { padding: 0 12px; font-size: 14px; }

/* ---------- 弹窗 / 提示 ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--panel); color: var(--text);
  width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-pop);
}
dialog[open] { animation: pop .16s ease-out; }
dialog.sm { width: min(400px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20, 15, 10, .32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dlg-h { height: 56px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-h .title { display: flex; align-items: center; gap: 8px; }
.dlg-b { padding: 20px; display: grid; gap: 16px; max-height: 70vh; overflow: auto; }
.dlg-b p { margin: 0; color: var(--text-2); }
.dlg-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--sunken); border-radius: 0 0 12px 12px; }
.keybox { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sunken); }
.keybox code { flex: 1; min-width: 0; word-break: break-all; line-height: 18px; }
.keybox.hl { border-color: var(--accent); background: var(--accent-soft); }
.ref { display: grid; gap: 16px; }
.ref .item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; }
.ref .item > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
pre.code {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 12px; line-height: 18px; background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 6px 7px 12px; margin: 0; min-height: 34px;
}
pre.code code { font-size: 12px; overflow-x: auto; white-space: nowrap; min-width: 0; scrollbar-width: none; }
pre.code code::-webkit-scrollbar { display: none; }
pre.code button { height: 22px; width: 22px; }
.speed-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.speed-ctl input { width: 72px; }
.speed-ctl .or { color: var(--muted); font-size: 13px; padding: 0 4px; }
.speed-table { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.speed-table th, .speed-table td { height: 36px; }
.speed-table th:first-child, .speed-table td:first-child { padding-left: 12px; }
.speed-table th:last-child, .speed-table td:last-child { padding-right: 12px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--hover); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .3s; border-radius: 2px; }

#toasts { position: fixed; top: 68px; right: 24px; display: grid; gap: 8px; z-index: 100; justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: min(420px, calc(100vw - 32px));
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; line-height: 18px; box-shadow: var(--shadow-pop); animation: tin .2s ease-out; pointer-events: auto;
}
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); flex: none; }
.toast.ok::before { background: var(--accent); }
.toast.err { border-color: var(--accent); }
.toast.err::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toast.out { opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.98); } }
.spin { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; flex: none; }
button .spin { width: 12px; height: 12px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top-inner { gap: 8px; padding: 0 16px; }
  .brand .label { display: none; }
  nav.tabs { overflow-x: auto; scrollbar-width: none; gap: 0; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { padding: 0 10px; }
  nav.tabs a.on::after { left: 10px; right: 10px; }
  main { padding: 24px 16px 40px; }
  footer.foot { padding: 0 16px 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card-h { padding: 0 16px; }
  .card-b { padding: 16px; }
  .toolbar, .pager { padding-left: 16px; padding-right: 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .ref .item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .page-head .row { width: 100%; }
  #toasts { left: 16px; right: 16px; top: 64px; justify-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 720px) {
  .toolbar .meta { flex-basis: 100%; }
  .toolbar .grow, .toolbar .sep { display: none; }
  .rate { grid-template-columns: 40px; justify-content: end; }
  .rate .track { display: none; }
  .pager .info-text { display: none; }
  .pager { justify-content: flex-end; }
}
@media (max-width: 420px) {
  nav.tabs a { padding: 0 8px; font-size: 13px; }
  nav.tabs a.on::after { left: 8px; right: 8px; }
  .top-inner { gap: 4px; }
  .bars, .bar-labels { gap: 4px; }
  .bar-labels span { font-size: 10.5px; letter-spacing: -.02em; }
  .bar .n { font-size: 11px; }
}

/* 代理表格更紧凑，避免在 1280 宽度内横向滚动 */
#tbl th, #tbl td { padding-left: 10px; padding-right: 10px; }
#tbl th:first-child, #tbl td:first-child { padding-left: 20px; }
#tbl th:last-child, #tbl td:last-child { padding-right: 20px; }
