:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --side: #ededf1;
  --surface: #fff;
  --soft: #f1f2f6;
  --ink: #1d1d1f;
  --muted: #62646d;
  --line: #dedee6;
  --blue: #005fc5;
  --blue-soft: #e8f1ff;
  --good: #116843;
  --good-bg: #eaf5ee;
  --warning: #854a08;
  --warning-bg: #fff1da;
  --bad: #a42229;
  --bad-bg: #fdebed;
  --radius: 17px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19191c; --side: #202025; --surface: #252529; --soft: #2f3037;
    --ink: #f1f1f4; --muted: #b3b3be; --line: #3c3d46;
    --blue: #8fc5ff; --blue-soft: #253b58;
    --good: #95e2b3; --good-bg: #24392e; --warning: #ffcf8d; --warning-bg: #423521;
    --bad: #ffabb0; --bad-bg: #48272d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: wait; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(29px, 3.3vw, 43px); font-weight: 670; letter-spacing: -.04em; line-height: 1.13; }
h2 { font-size: 20px; font-weight: 660; letter-spacing: -.02em; }
h3 { font-size: 15px; }
p { line-height: 1.65; }
svg { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.loading { padding: 38px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { display: grid; min-height: 100dvh; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 25px; padding: 24px 13px 15px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 0 9px; }
.brand:hover { text-decoration: none; }
.brand img { width: 35px; height: 35px; }
.brand b { display: block; font-size: 15px; font-weight: 690; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; gap: 11px; align-items: center; min-height: 42px; padding: 8px 10px; color: var(--ink); border-radius: 9px; font-weight: 530; }
.nav a svg { color: var(--muted); }
.nav a:hover, .icon-button:hover { background: var(--soft); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.nav a.active svg { color: var(--blue); }
.account { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 13px 3px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 32px; height: 32px; flex: none; background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.account div { min-width: 0; flex: 1; }
.account b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { color: var(--muted); }
.icon-button { display: grid; place-items: center; border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--muted); }
.toolbar {
  position: sticky; z-index: 2; top: 0; min-height: 63px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; padding: 12px clamp(18px, 3.2vw, 44px);
  border-bottom: 1px solid var(--line); background: var(--bg);
  background: color-mix(in srgb, var(--bg) 93%, transparent); backdrop-filter: blur(14px);
}
.toolbar > div, .search { display: flex; gap: 11px; align-items: center; }
.toolbar .crumb { color: var(--muted); font-size: 13px; }
.search { background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 9px; min-height: 36px; padding: 0 10px; width: min(265px, 37vw); text-align: left; }
.search span { flex: 1; }
kbd { padding: 2px 4px; font: inherit; border-radius: 4px; background: var(--soft); font-size: 11px; white-space: nowrap; }
.content { max-width: 1420px; margin: auto; padding: 34px clamp(18px, 3.2vw, 44px) 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.page-head p { margin-top: 8px; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 9px; color: var(--blue); font-size: 12px; font-weight: 660; letter-spacing: .035em; }
.tabs { display: flex; gap: 5px; overflow-x: auto; margin: -3px 0 20px; padding: 4px; border-radius: 11px; background: var(--soft); width: fit-content; max-width: 100%; }
.tabs a { white-space: nowrap; color: var(--muted); border-radius: 8px; padding: 8px 13px; }
.tabs a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0001; font-weight: 650; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.welcome { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 4vw, 47px); margin-bottom: 25px; overflow: hidden; }
.welcome p { max-width: 42ch; color: var(--muted); margin-top: 12px; }
.welcome::after { content: ""; position: absolute; pointer-events: none; border: 1px solid color-mix(in srgb, var(--blue) 21%, transparent); border-radius: 50%; width: 250px; height: 250px; right: -35px; top: -70px; box-shadow: 0 0 0 25px color-mix(in srgb, var(--blue) 4%, transparent), 0 0 0 55px color-mix(in srgb, var(--blue) 3%, transparent), 0 0 0 85px color-mix(in srgb, var(--blue) 2%, transparent); }
.welcome > * { position: relative; z-index: 1; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.section-head span { color: var(--muted); font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card, .panel { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card { padding: 17px; color: var(--ink); }
.card:hover { text-decoration: none; border-color: var(--blue); }
.card .card-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: var(--muted); }
.card .card-top svg { color: var(--blue); }
.card b { font-size: 32px; display: block; margin: 13px 0 6px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.card small { color: var(--muted); }
.panel { margin: 0 0 14px; }
.panel-pad { padding: 19px 21px; }
.panel-pad > h2 + p, .panel-pad > h3 + p { margin-top: 7px; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 11px; margin-top: 15px; }
.quick-links a { color: var(--ink); display: flex; gap: 11px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.quick-links a:hover { border-color: var(--blue); text-decoration: none; }
.quick-links a > svg:first-child { color: var(--blue); }
.quick-links a > svg:last-child { margin-left: auto; color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 37px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-weight: 570; padding: 7px 12px; white-space: nowrap; }
.button:hover { background: var(--soft); text-decoration: none; }
.button.primary { color: var(--surface); background: var(--blue); border-color: var(--blue); }
.button.primary:hover { filter: brightness(1.10); }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; background: var(--soft); color: var(--muted); padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.status::before { content: ""; border-radius: 50%; background: currentColor; width: 6px; height: 6px; }
.status.good { background: var(--good-bg); color: var(--good); }
.status.wait { background: var(--warning-bg); color: var(--warning); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.blue { background: var(--blue-soft); color: var(--blue); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: left; }
th, td { padding: 13px 15px; min-width: 90px; white-space: nowrap; }
th { font-size: 12px; font-weight: 640; color: var(--muted); background: var(--soft); }
td { border-top: 1px solid var(--line); }
td.wrap { white-space: normal; }
tbody tr:hover { background: color-mix(in srgb, var(--soft) 48%, transparent); }
.pager { padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.pager div, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 14px; }
.fact small { display: block; margin-bottom: 6px; color: var(--muted); }
.fact b { overflow-wrap: anywhere; }
.notice { color: var(--muted); padding: 29px 21px; text-align: center; }
.notice h2 { color: var(--ink); margin-bottom: 7px; }
.error { color: var(--bad); }
.back { display: inline-block; margin-bottom: 14px; }
.filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
label { display: grid; gap: 6px; font-weight: 570; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; }
textarea { min-height: 90px; resize: vertical; }
.filter select { width: auto; }
form.stack { display: grid; gap: 14px; }
.message { padding: 14px 0; border-bottom: 1px solid var(--line); }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.message:last-child { border-bottom: 0; }
dialog { border: 1px solid var(--line); color: var(--ink); background: var(--surface); width: min(92vw, 540px); max-height: 90dvh; border-radius: 19px; padding: 22px; box-shadow: 0 20px 70px #0003; }
dialog::backdrop { background: #0e142a50; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 9px; }
#toast:empty { display: none; }
#toast { position: fixed; z-index: 5; bottom: 20px; right: 20px; max-width: min(85vw, 350px); padding: 11px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; box-shadow: 0 5px 20px #0002; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 23px; width: min(100%, 420px); padding: clamp(23px, 5vw, 38px); }
.login-card .brand { padding: 0; margin-bottom: 21px; }
.login-card h1 { font-size: 32px; }
.login-card p { margin: 9px 0 23px; color: var(--muted); }
@media (max-width: 820px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell { grid-template-columns: 60px minmax(0, 1fr); }
  .sidebar { padding: 15px 7px; gap: 20px; }
  .brand, .nav a { justify-content: center; padding-inline: 3px; }
  .sidebar .brand span, .nav a span, .account div { display: none; }
  .account { justify-content: center; }
  .account .avatar { display: none; }
  .welcome::after { opacity: .53; right: -135px; }
}
@media (max-width: 560px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 4; height: auto; flex-direction: row; padding: 6px; gap: 5px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand img { width: 25px; height: 25px; }
  .nav { display: flex; flex: 1; overflow-x: auto; gap: 2px; }
  .nav a { min-width: 31px; min-height: 35px; flex: 1; }
  .account { margin: 0; padding: 0; border: 0; }
  .toolbar { top: 48px; min-height: 51px; padding: 7px 13px; }
  .toolbar .crumb, kbd { display: none; }
  .search { width: auto; }
  .content { padding: 22px 13px 50px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .cards { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
