:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1c2840;
  background: #f4f6fa;
  --ink: #1c2840;
  --muted: #596982;
  --line: #dce3ee;
  --blue: #1848c2;
  --red: #a0253a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; font-size: 14px; }
main { min-width: 0; padding: 28px 32px 40px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -.035em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; margin: 18px 0 9px; }
button, select, input, textarea { font: inherit; }
button, select, input, textarea {
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 8px 11px;
}
button { cursor: pointer; white-space: nowrap; }
button:hover { border-color: #879ab8; background: #f4f7fd; }
button:disabled { cursor: default; opacity: .48; }
button.primary, button.danger { color: white; border-color: transparent; }
button.primary { background: var(--blue); }
button.danger { background: var(--red); }
button.plain { color: var(--blue); border: 0; background: transparent; padding: 4px 0; }
button.plain:hover { text-decoration: underline; }
button.link-danger { color: var(--red); border-color: #f0d5d9; }
input, select, textarea { max-width: 100%; }
textarea { display: block; width: 100%; resize: vertical; }
:focus-visible { outline: 3px solid #739bf5; outline-offset: 2px; }
a { color: var(--blue); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 2; background: #fff; top: 6px; left: 6px; padding: 10px; }

.sidebar {
  background: #162641; color: #e5edfc; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 25px 14px 17px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; }
.brand strong { display: block; color: #fff; font-size: 17px; letter-spacing: .01em; }
.brand small, .sidebar-footer small { color: #b9c8e5; }
.mark { width: 36px; height: 36px; background: #315cce; color: white; display: grid; place-items: center; border-radius: 10px; font-size: 20px; font-weight: 750; }
nav { display: grid; gap: 5px; }
nav button { color: #dce6fa; text-align: left; border-color: transparent; background: transparent; padding: 11px 12px; }
nav button span { display: inline-block; width: 24px; color: #aac3fd; }
nav button:hover { background: #243d67; border-color: transparent; }
nav button[aria-current] { background: #2a4575; color: #fff; }
.sidebar-footer { margin-top: auto; padding: 13px 10px 0; border-top: 1px solid #344766; display: grid; gap: 7px; }
.sidebar-footer button { color: #e5edfc; width: fit-content; background: transparent; border: 1px solid #7483a1; }
.sidebar-footer button:hover { background: #293650; }
.ops-login { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.ops-login-card { width: min(100%, 430px); background: #fff; border: 1px solid #dce3ee; border-radius: 14px; padding: 32px; }
.ops-login-card .brand { padding: 0; margin-bottom: 22px; }
.ops-login-card .brand strong { color: var(--ink); }
.ops-login-card .brand small { color: #576783; }
.ops-login-card h1 { font-size: 24px; }
.ops-login-card p { color: #526381; margin: 12px 0 24px; line-height: 1.6; }
.ops-login-card a { display: inline-block; color: #fff; background: #254cb7; padding: 11px 18px; border-radius: 7px; text-decoration: none; }
.ops-login-card a:focus-visible { outline: 3px solid #699bff; outline-offset: 3px; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 21px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .16em; margin-bottom: 4px; }
.eyebrow span { letter-spacing: 0; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#freshness { color: var(--muted); font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric, .card { border: 1px solid var(--line); background: #fff; border-radius: 11px; min-width: 0; }
.metric { padding: 14px 16px; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 27px; line-height: 1.25; margin: 4px 0; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { padding: 15px 17px; margin-bottom: 12px; }
.card > header, dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card header > span, .hint, .panel-note, .empty { color: var(--muted); font-size: 12px; }
.panel-note { margin-bottom: 12px; }
.hint, .empty { margin: 8px 0; line-height: 1.55; }
.empty { background: #f6f8fc; border: 1px dashed var(--line); padding: 12px; border-radius: 7px; }
.notice { border: 1px solid #b7caf8; color: #244588; background: #eef4ff; padding: 9px 12px; margin-bottom: 12px; border-radius: 7px; }
.notice.error { border-color: #edc3c9; color: var(--red); background: #fff2f3; }
.chart { width: 100%; height: 112px; display: block; }
.chart-bar { fill: #3861c5; }
.chart-axis { stroke: #c8d1e1; }
.chart-tick { fill: var(--muted); font-size: 11px; }
.trend-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.data-list { display: grid; grid-template-columns: minmax(8em, 1fr) 1fr; gap: 8px 16px; margin: 0; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; overflow-wrap: anywhere; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 15px; }
.filters label, #action-form label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.filters input[type="search"] { width: min(23em, 75vw); }
.table-wrap { overflow-x: auto; max-height: 420px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 8px 9px; border-bottom: 1px solid #e8edf4; vertical-align: top; }
th { font-size: 12px; white-space: nowrap; position: sticky; top: 0; background: #f5f7fb; color: #40536d; }
td { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
code { font-size: 12px; font-family: Consolas, monospace; }
.cell-muted { color: var(--muted); white-space: nowrap; }
.chip { font-size: 12px; white-space: nowrap; display: inline-block; padding: 2px 7px; border-radius: 15px; color: #465570; background: #eef1f7; }
.chip.good { color: #176047; background: #e7f5ec; }
.chip.warn { color: #79500e; background: #fff3d7; }
.chip.bad { color: #a0253a; background: #fbecef; }
.footer-actions, .pager, .dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 11px; }
.pager { color: var(--muted); font-size: 12px; }
dialog { color: var(--ink); padding: 19px; border: 1px solid var(--line); border-radius: 12px; width: min(820px, calc(100vw - 24px)); max-height: 85vh; }
dialog::backdrop { background: rgb(17 30 51 / 54%); }
#action-dialog { width: min(465px, calc(100vw - 24px)); }
#action-description, #action-result { margin: 10px 0; color: var(--muted); line-height: 1.6; }
#action-result:empty { display: none; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.account-heading { font-size: 18px; margin: 5px 0 12px; }

@media (max-width: 960px) {
  body { grid-template-columns: 170px minmax(0, 1fr); }
  main { padding: 20px; }
  .toolbar { align-items: start; flex-direction: column; }
}
@media (max-width: 710px) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .brand { padding: 0 3px 12px; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav button { text-align: center; padding: 7px 4px; font-size: 12px; }
  nav button span { display: none; }
  .sidebar-footer { display: flex; justify-content: space-between; margin-top: 10px; }
  main { padding: 15px 12px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
