/* ============================================================
   Baidu Runner 授权后台 · 设计系统
   参考 shadcn/ui 与 Ant Design Pro 的令牌化思路：
   浅色为主、跟随系统切换暗色；纯 CSS 实现，兼容 CSP style-src 'self'。
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --line: #e7eaf0;
  --line-strong: #d7dce4;
  --line-faint: #f1f3f7;
  --text: #111827;
  --text-2: #3f4756;
  --muted: #6b7280;
  --muted-2: #9aa1ad;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-line: #d6dbff;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --ok-line: #c4f0d5;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --warn-line: #f6e3b4;
  --danger: #b42318;
  --danger-solid: #d92d20;
  --danger-soft: #fef3f2;
  --danger-line: #f9d3cf;
  --info: #026aa2;
  --info-soft: #f0f9ff;
  --info-line: #c4e6f7;
  --violet: #6941c6;
  --violet-soft: #f4f3ff;
  --violet-line: #ddd6fe;
  --chart-top: #6366f1;
  --chart-bottom: #4f46e5;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .1), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 56px -16px rgba(16, 24, 40, .24);
  --ring: 0 0 0 3px rgba(79, 70, 229, .15);
  --topbar-bg: rgba(243, 244, 246, .85);
  --scrim: rgba(16, 24, 40, .4);
  --login-glow-1: rgba(79, 70, 229, .1);
  --login-glow-2: rgba(14, 165, 233, .1);
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.22, .68, .32, 1);
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0d12;
    --surface: #11141b;
    --surface-2: #161a23;
    --surface-3: #1c212c;
    --line: #222836;
    --line-strong: #2c3444;
    --line-faint: #191e27;
    --text: #f1f3f7;
    --text-2: #c3c9d4;
    --muted: #8f98a8;
    --muted-2: #5d6675;
    --primary: #5d5fef;
    --primary-hover: #6d6ef5;
    --accent: #a5b4fc;
    --accent-soft: rgba(99, 102, 241, .16);
    --accent-line: rgba(129, 140, 248, .32);
    --ok: #5cd99d;
    --ok-soft: rgba(16, 185, 129, .13);
    --ok-line: rgba(92, 217, 157, .28);
    --warn: #f5b95a;
    --warn-soft: rgba(245, 158, 11, .13);
    --warn-line: rgba(245, 185, 90, .28);
    --danger: #fb8b84;
    --danger-solid: #e5484d;
    --danger-soft: rgba(239, 68, 68, .13);
    --danger-line: rgba(251, 139, 132, .28);
    --info: #7cc8f0;
    --info-soft: rgba(14, 165, 233, .13);
    --info-line: rgba(124, 200, 240, .28);
    --violet: #c4b5fd;
    --violet-soft: rgba(139, 92, 246, .14);
    --violet-line: rgba(196, 181, 253, .28);
    --chart-top: #818cf8;
    --chart-bottom: #6366f1;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 28px 64px -20px rgba(0, 0, 0, .65);
    --ring: 0 0 0 3px rgba(129, 140, 248, .22);
    --topbar-bg: rgba(11, 13, 18, .82);
    --scrim: rgba(0, 0, 0, .6);
    --login-glow-1: rgba(99, 102, 241, .16);
    --login-glow-2: rgba(14, 165, 233, .12);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100vh;
  font: 14px/1.6 "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
::selection { background: rgba(99, 102, 241, .28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- 图标（内联 SVG sprite） ---- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- 整体框架 ---- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand .dot {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 15px; font-weight: 800; line-height: 1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.brand-text small { display: block; margin-top: 1px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

.nav-links { flex: 1; overflow-y: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 0; padding: 6px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.nav-links button {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  width: 100%; height: 36px; padding: 0 10px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-2); font-size: 13px; font-weight: 500; box-shadow: none;
}
.nav-links button .icon { width: 17px; height: 17px; color: var(--muted); transition: color .15s var(--ease); }
.nav-links button:hover { background: var(--surface-2); color: var(--text); transform: none; box-shadow: none; }
.nav-links button:hover .icon { color: var(--text-2); }
.nav-links button:active { transform: none; }
.nav-links button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-links button.active .icon { color: var(--accent); }
.sidebar-foot { padding: 13px 18px; border-top: 1px solid var(--line); }
.sidebar-foot .hint { margin: 0; font-size: 11.5px; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 24px;
  background: var(--topbar-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.page-head { min-width: 0; }
.page-head h1 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head p { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-actions button { height: 34px; }
.admin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.admin-chip::before { content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #6366f1, #a855f7); }
.admin-chip:empty { display: none; }
.icon-btn { display: none; width: 34px; height: 34px; padding: 0; justify-content: center; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-2); box-shadow: var(--shadow-xs); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
#refresh.is-loading { pointer-events: none; opacity: .75; }
#refresh.is-loading .icon { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 内容区 ---- */
.content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 24px; }
.view { display: none; }
.view.active { display: flex; flex-direction: column; gap: 16px; animation: viewIn .3s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ---- 指标卡片 ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px 15px; box-shadow: var(--shadow-xs);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card .label { padding-right: 46px; font-size: 12px; font-weight: 550; line-height: 1.4; color: var(--muted); }
.card .value { margin-top: 6px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.card-icon {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.card-icon .icon { width: 17px; height: 17px; }
.card-icon.info { background: var(--info-soft); color: var(--info); }
.card-icon.violet { background: var(--violet-soft); color: var(--violet); }
.card-icon.warn { background: var(--warn-soft); color: var(--warn); }
.card-icon.ok { background: var(--ok-soft); color: var(--ok); }
.card-icon.danger { background: var(--danger-soft); color: var(--danger); }
.panel > .cards { margin-bottom: 16px; }

/* ---- 面板 ---- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow-xs);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.005em; }
.panel-title { min-width: 0; }
.panel-title .hint { margin: 3px 0 0; font-size: 12px; line-height: 1.55; }
.panel > .hint { margin: 0 0 14px; line-height: 1.7; }
.hint { color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }

/* ---- 按钮 ---- */
button {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .12s var(--ease), color .16s var(--ease);
}
button:hover { background: var(--primary-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
button.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text-2); }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.danger { background: var(--danger-solid); }
button.danger:hover { filter: brightness(.94); }
button.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
button .icon { width: 15px; height: 15px; }

/* ---- 表单控件 ---- */
input, select, textarea { font: inherit; color: var(--text); }
input:not([type="checkbox"]):not([type="radio"]), select {
  height: 34px; min-width: 120px; padding: 0 11px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 13px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder { color: var(--muted-2); }
input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s ease-out 0s; }
input.narrow { width: 76px; min-width: 76px; }
select { cursor: pointer; }
select option { background: var(--surface); color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
@media (prefers-color-scheme: dark) {
  input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); opacity: .8; }
}

/* ---- 表格 ---- */
.table-wrap { overflow: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-faint); white-space: nowrap; }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
td { color: var(--text-2); }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12.5px; }

/* ---- 用量柱状图 ---- */
.chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 214px; padding: 6px 4px 0; border-radius: 10px;
  background: repeating-linear-gradient(to top, var(--line-faint) 0 1px, transparent 1px 42px);
}
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar-stack { width: 100%; max-width: 46px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.bar {
  width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--chart-top), var(--chart-bottom));
  transform-origin: bottom; animation: grow .5s var(--ease) backwards;
  transition: filter .15s var(--ease);
}
.bar-col:hover .bar { filter: brightness(1.1); }
.bar.zero { background: var(--surface-3); }
.bar-label { font-size: 10px; color: var(--muted-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleY(0); } }

/* ---- 徽章与状态 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border: 1px solid transparent; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge.active { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.suspended { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.banned, .badge.high { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.medium { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.low { background: var(--surface-3); color: var(--muted); }
.res-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.table-wrap .actions { flex-wrap: nowrap; }

/* ---- 详情与键值 ---- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.kv { min-width: 0; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; overflow-wrap: anywhere; }
.kv .k { margin-bottom: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.edit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-faint); }
.edit-row .hint { line-height: 1.6; }
.mono { font-family: var(--mono); font-size: 12px; }
.link-code { display: block; margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); word-break: break-all; }
.cell-clip { display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- Toast ---- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 430px; padding: 12px 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 13px;
  animation: toastIn .25s var(--ease);
}
.toast::before {
  content: ""; margin-top: 4px; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft);
}
.toast.error::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---- 弹窗与表单 ---- */
dialog {
  width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 64px); overflow: auto;
  padding: 22px 24px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: dialogIn .22s var(--ease); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
dialog .panel-head { align-items: center; margin-bottom: 10px; }
dialog .panel-head h2 { font-size: 15px; }
dialog .panel-head button { font-size: 15px; line-height: 1; }
#batch-result-dialog { width: min(760px, calc(100% - 32px)); }
#batch-result-dialog .table-wrap { margin: 8px 0; max-height: 340px; border: 1px solid var(--line); border-radius: 10px; }
#batch-result-dialog .table-wrap table { border-radius: 10px; }
#task-link-dialog { width: min(640px, calc(100% - 32px)); }
.form-label { display: grid; gap: 6px; margin: 14px 0; font-size: 13px; }
.form-label > span { font-size: 12.5px; font-weight: 550; color: var(--text-2); letter-spacing: .01em; }
.form-label input:not([type="checkbox"]):not([type="radio"]), .form-label select, .form-label textarea { width: 100%; min-width: 0; }
.form-label textarea {
  padding: 9px 11px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; resize: vertical;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.form-check { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 14px 0; font-size: 13px; }
.form-check input { width: 16px; height: 16px; min-width: 16px; margin: 0; }
.form-check small { flex-basis: 100%; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-error { min-height: 20px; margin: 8px 0; color: var(--danger); font-size: 13px; }
#diagnostic-summary { margin: 0; overflow-wrap: anywhere; line-height: 1.7; }

/* ---- 账号协助 ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.tabs button { height: 28px; padding: 0 12px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 550; box-shadow: none; }
.tabs button:hover { background: var(--surface); color: var(--text); }
.tabs button:active { transform: none; }
.tabs button.active { background: var(--surface); border-color: var(--line); color: var(--accent); box-shadow: var(--shadow-xs); }
.assist-tabs { flex: 0 1 auto; max-width: 100%; }
.status-banner { margin: 0 0 16px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; line-height: 1.6; }
.status-banner.is-down { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.status-banner:empty { display: none; }
.assist-actions { justify-content: flex-start; margin-bottom: 14px; min-height: 0; }
.assist-note { margin: 0 0 12px; line-height: 1.7; max-width: 1080px; }
.assist-receipt { margin-bottom: 12px; padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; font-size: 13px; overflow-wrap: anywhere; }
.assist-receipt p { margin: 6px 0 0; }
.assist-batch { justify-content: flex-start; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 4px 0 16px; }
.policy-grid .form-label { margin: 0; }
#assist-body .panel { margin: 12px 0; background: var(--surface-2); box-shadow: none; }
#assist-body .panel .panel { background: var(--surface); }
#assist-maintenance:empty { display: none; }

/* ---- 登录页 ---- */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 620px at 12% -12%, var(--login-glow-1), transparent 60%),
    radial-gradient(900px 560px at 108% 108%, var(--login-glow-2), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%); padding: 30px 28px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand { padding: 0; margin-bottom: 10px; font-size: 16px; }
.login-card .brand .dot { width: 34px; height: 34px; border-radius: 10px; }
.login-card > .hint { margin: 0 0 20px; font-size: 12.5px; line-height: 1.65; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.field input { width: 100%; height: 40px; }
.login-card button[type="submit"] { width: 100%; height: 40px; margin-top: 6px; font-size: 14px; }
.login-error { margin: 0 0 12px; padding: 9px 12px; background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: 8px; color: var(--danger); font-size: 12.5px; }
.login-foot { margin: 18px 0 0; font-size: 11.5px; line-height: 1.7; }

/* ---- 窄屏抽屉导航 ---- */
.nav-scrim { display: none; }
@media (max-width: 1200px) {
  :root { --sidebar-w: 224px; }
  .content { padding: 20px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  #nav-toggle { display: inline-flex; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
}

/* ---- 响应式 ---- */
@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .page-head p { display: none; }
  .admin-chip { display: none; }
  .btn-label { display: none; }
  .topbar-actions button { width: 34px; padding: 0; justify-content: center; }
  .content { padding: 14px; }
  .view.active { gap: 12px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .card { padding: 14px; }
  .card .label { padding-right: 0; }
  .card-icon { position: static; margin-bottom: 8px; }
  .card .value { font-size: 21px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .filters { width: 100%; justify-content: flex-start; }
  .filters input, .filters select { flex: 1 1 130px; min-width: 0; width: auto; }
  .panel { padding: 16px; }
  .chart { height: 180px; gap: 5px; overflow-x: auto; }
  .bar-col { flex: 1 0 30px; }
  .bar-label { font-size: 9.5px; }
  dialog { padding: 18px; }
}

/* 尊重系统减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}