:root {
  color-scheme: light;
  background: #f4f6fa;
  color: #172235;
  font: 14px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --primary: #244bc1;
  --border: #dce3ed;
  --muted: #4d5e75;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(24px, 3vw, 34px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { text-wrap: pretty; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 24px; padding: 24px 18px; background: #182438; color: #fff; }
.wordmark { display: flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 700; }
.brand { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: white; background: var(--primary); font-weight: 750; }
.nav { display: grid; gap: 5px; }
.nav button { text-align: left; border: 0; padding: 10px 12px; border-radius: 8px; background: transparent; color: #e2eaf7; }
.nav button:hover, .nav [aria-current="page"] { color: #fff; background: #31425d; }
.account { margin-top: auto; display: grid; gap: 8px; overflow-wrap: anywhere; }
.account .secondary { justify-self: start; }
main { align-self: start; min-width: 0; width: min(100%, 1400px); margin: 0 auto; padding: 32px; }
.title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.stack { display: grid; gap: 16px; }
.panel, .metric, .login-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.panel { min-width: 0; padding: 16px; display: grid; gap: 12px; }
.toolbar, .actions, .badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar { justify-content: space-between; }
.filters { justify-content: flex-start; align-items: end; }
.field { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 13px; }
.field input, .field select { width: 100%; background: #fff; color: #172235; border: 1px solid #afbdd1; border-radius: 7px; min-height: 38px; padding: 6px 10px; }
.field:has(input[type="checkbox"]) { display: flex; align-items: center; }
.field input[type="checkbox"] { width: 16px; min-height: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 5px 12px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; }
.primary { color: white; background: var(--primary); }
.secondary { color: #263951; background: #fff; border-color: #bac6d8; }
.danger { color: #a12223; background: #fff; border-color: #e8a5a5; }
.button:hover { filter: brightness(.95); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.muted, caption { color: var(--muted); }
.number, td, time { font-variant-numeric: tabular-nums; }
.banner { padding: 9px 12px; border-radius: 7px; background: #e9efff; color: #16367d; }
.error { background: #fee8e8; color: #821b24; }
.warning { background: #fff0ce; color: #684500; }
.badge { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 20px; background: #e9efff; color: #16367d; }
.badge.neutral { background: #edf0f5; color: #384961; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 14px; }
.metric .number { font-size: clamp(19px, 2.4vw, 29px); font-weight: 700; word-break: break-word; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 650; background: #f4f6fa; white-space: nowrap; }
td { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
fieldset { margin: 0; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
legend { font-weight: 650; padding: 0 5px; }
.editor-row { background: #f8f9fc; }
.preview-item { display: flex; align-items: start; gap: 10px; overflow-wrap: anywhere; }
.preview-item img { flex: none; border-radius: 6px; object-fit: contain; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 410px); padding: 28px; }
dialog { width: min(550px, calc(100vw - 28px)); padding: 20px; border: 1px solid var(--border); border-radius: 12px; color: inherit; }
dialog::backdrop { background: #18243891; }
.rank-filters .field { min-width: 130px; }
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { padding: 14px; gap: 12px; }
  .nav { display: flex; flex-wrap: wrap; }
  .account { display: flex; align-items: center; }
  main { padding: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
