:root {
    color-scheme: light;
    --ink: #15243b;
    --muted: #50617a;
    --line: #d9e2ef;
    --canvas: #f3f6fb;
    --surface: #fff;
    --accent: #164caa;
    --accent-hover: #123c87;
    font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    line-height: 1.55;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #2b67c7; outline-offset: 3px; }
.skip { position: absolute; top: -4rem; left: 1rem; padding: .5rem; background: var(--surface); z-index: 3; }
.skip:focus { top: 1rem; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1320px; margin: auto; padding: .65rem clamp(.85rem, 3vw, 2rem); display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.3rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.08rem; font-weight: 750; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; color: #fff; background: var(--accent); }
nav { display: flex; flex-wrap: wrap; flex: 1; gap: .2rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .38rem .65rem; text-decoration: none; font-weight: 600; border-radius: .45rem; color: var(--muted); }
nav a[aria-current="page"], nav a:hover { background: #eaf1fe; color: var(--accent); }
main { max-width: 1320px; margin: auto; padding: clamp(1rem, 4vw, 2rem); }
h1, h2 { line-height: 1.25; margin-top: 0; }
h1 { font-size: clamp(1.55rem, 3vw, 2.05rem); margin-bottom: .5rem; }
h2 { font-size: 1.18rem; margin-bottom: .85rem; }
.muted, small, .empty { color: var(--muted); }
small { display: block; font-size: .85rem; margin-top: .2rem; }
.page-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.page-head { margin-bottom: 1rem; }
.page-head p, .dialog-head h2 { margin: .2rem 0; }
.panel, dialog { padding: clamp(.9rem, 2vw, 1.35rem); background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; }
.panel { margin-bottom: 1rem; }
.login { width: min(100%, 25rem); margin: 3rem auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; }
.stack { display: grid; gap: .85rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; }
.filters label { flex: 1 1 9rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
input, select, textarea { width: 100%; min-width: 0; font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #a3b3c9; border-radius: .4rem; min-height: 44px; padding: .45rem .6rem; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
fieldset { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: .45rem; }
legend { font-weight: 650; }
button, .button { align-self: start; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .45rem .85rem; border-radius: .45rem; border: 1px solid transparent; text-decoration: none; background: var(--accent); color: white; font: inherit; font-weight: 650; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: .65; cursor: wait; }
.secondary { background: var(--surface); color: var(--accent); border-color: var(--line); }
.secondary:hover { background: #edf3fd; }
.danger { color: #a12433; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { background: #edf3fa; font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
.message { white-space: pre-wrap; }
.number { width: 8rem; font-variant-numeric: tabular-nums; }
.truncate { max-width: 24rem; }
.chip { display: inline-block; padding: .15rem .45rem; background: #eaf1fe; color: #254679; border-radius: .35rem; font-size: .82rem; }
.chip.good { background: #e2f6ec; color: #175f3e; }
.chip.bad, .error { background: #feeaec; color: #8d2330; }
.notice, .error { border-radius: .45rem; padding: .7rem .85rem; }
.notice { color: #254679; background: #e6efff; }
.pagination { margin-top: .5rem; }
.setting-item { border-top: 1px solid var(--line); }
summary { padding: .75rem 0; cursor: pointer; }
.setting-item form { margin-bottom: 1rem; }
dialog { width: min(34rem, calc(100% - 1.25rem)); color: var(--ink); max-height: calc(100dvh - 1.25rem); overflow: auto; }
dialog::backdrop { background: #12243c80; }
dialog img { display: block; margin: .75rem auto; max-width: 100%; height: auto; }
@media (max-width: 700px) { nav { order: 3; flex: 1 0 100%; } .top-inner { justify-content: space-between; } }
