/* ============================================================
   cf2dns 控制台样式 —— 无框架、无外部资源
   设计令牌 → 基础 → 布局 → 组件 → 页面 → 深色 → 响应式
   ============================================================ */

/* ---------------- 设计令牌 ---------------- */
:root {
  --bg: #eef1f7;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --border: #e3e8f0;
  --border-strong: #cbd5e1;
  --text: #17203a;
  --muted: #64748b;
  --topbar-bg: rgba(255, 255, 255, .86);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-soft-2: #e0e7ff;

  --ok: #16a34a;        --ok-soft: #dcfce7;
  --danger: #dc2626;    --danger-soft: #fee2e2;
  --warn: #b45309;      --warn-soft: #fef3c7;
  --info: #0284c7;      --info-soft: #e0f2fe;
  --gray-soft: #f1f5f9;

  --term-bg: #0b1220;
  --term-text: #d3e0f4;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 14px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 44px -12px rgba(16, 24, 40, .25);

  --sk-hi: #eef2f8;
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1322;
    --panel: #131c2f;
    --panel-2: #0f1728;
    --border: #233050;
    --border-strong: #33436b;
    --text: #e4eaf6;
    --muted: #8fa1bd;
    --topbar-bg: rgba(12, 19, 34, .82);

    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-soft: rgba(99, 102, 241, .16);
    --primary-soft-2: rgba(99, 102, 241, .28);

    --ok: #4ade80;        --ok-soft: rgba(34, 197, 94, .16);
    --danger: #f87171;    --danger-soft: rgba(239, 68, 68, .16);
    --warn: #fbbf24;      --warn-soft: rgba(245, 158, 11, .16);
    --info: #38bdf8;      --info-soft: rgba(14, 165, 233, .16);
    --gray-soft: rgba(148, 163, 184, .14);

    --term-bg: #080d18;
    --term-text: #c9d8ef;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 14px -4px rgba(0, 0, 0, .5), 0 2px 4px -2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, .65);

    --sk-hi: #1a2540;
    --ring: 0 0 0 3px rgba(129, 140, 248, .22);
  }
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .chip input:focus-visible + span,
.switch input:focus-visible + .knob, .seg button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ta-r { text-align: right; }

.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 26px; height: 26px; }
.spin { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------- 布局 ---------------- */
.app { min-height: 100vh; }

.topbar {
  height: 56px;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 28px; height: 28px; flex: none; display: inline-flex; }
.logo svg { width: 100%; height: 100%; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.brand-name b { color: var(--primary); font-weight: 800; }
.brand-ver {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 999px;
}
.topbar-right { display: flex; gap: 8px; align-items: center; }

.user-chip { display: flex; align-items: center; gap: 9px; padding-right: 6px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 13px; font-weight: 650; }
.user-meta i { font-style: normal; font-size: 11px; color: var(--muted); }

.layout { display: flex; align-items: stretch; }

.sidebar {
  width: 214px; flex: none;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  display: flex; flex-direction: column;
  padding: 14px 0 10px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar .nav { flex: 1; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 10px; padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted); font-weight: 550; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.sidebar a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.sidebar a.active .ic { color: var(--primary); }
.sidebar .sep { height: 1px; background: var(--border); margin: 10px 20px; }
.side-foot { padding: 12px 22px 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.content {
  flex: 1; min-width: 0;
  width: 100%; max-width: 1060px;
  margin: 0 auto;
  padding: 26px 28px 64px;
}
.content > * { animation: fadeUp .25s ease both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }

.page-head { margin: 2px 2px 20px; }
.page-head h1 { font-size: 20px; font-weight: 750; letter-spacing: -.2px; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h2 {
  font-size: 15px; font-weight: 680;
  display: flex; align-items: center; gap: 8px;
}
.card-head h2 .ic { color: var(--primary); }
.card-head .count {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 999px;
}
.card-head .more { font-size: 12.5px; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 0 15px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--panel); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn.solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.solid-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn.sm { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.lg { min-height: 42px; padding: 0 22px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }

/* 忙碌状态:文字隐藏、中心转圈 */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy .ic { visibility: hidden; }
.btn.busy::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(100, 116, 139, .35); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
.btn.primary.busy::after, .btn.solid-danger.busy::after {
  border-color: rgba(255, 255, 255, .4); border-top-color: #fff;
}

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: 16px; }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field > label { display: block; font-size: 13px; font-weight: 620; margin-bottom: 6px; }
.field .hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.field .hint a { word-break: break-all; }

.field input[type=text], .field input[type=password], .field input[type=number], .field select {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text);
  font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field input:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.field input::placeholder { color: var(--muted); opacity: .7; }

.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer;
}

.input-suffix { display: flex; align-items: center; gap: 9px; }
.input-suffix input { flex: 1; }
.input-suffix .sfx { font-size: 13px; color: var(--muted); flex: none; }

.form-foot { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 开关 */
.switch-field > label { margin-bottom: 8px; }
.switch-row { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .knob {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--border-strong); transition: background .2s;
  pointer-events: none;
}
.switch .knob::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.switch input:checked + .knob { background: var(--primary); }
.switch input:checked + .knob::before { transform: translateX(18px); }
.switch-text { font-size: 13px; color: var(--muted); }

/* 线路多选 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel);
  font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
  transition: all .15s;
}
.chip span::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: 0; transform: scale(.4);
  transition: all .15s;
}
.chip span:hover { border-color: var(--primary); }
.chip input:checked + span {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary); font-weight: 650;
}
.chip input:checked + span::before { opacity: 1; transform: scale(1); }

/* 提示框 */
.tips {
  margin-top: 18px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex; flex-direction: column; gap: 7px;
}
.tips > div { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.tips .ic { color: var(--primary); margin-top: 2px; }

/* ---------------- 状态徽章 ---------------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1.6;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.ok      { background: var(--ok-soft); color: var(--ok); }
.status.error   { background: var(--danger-soft); color: var(--danger); }
.status.timeout { background: var(--warn-soft); color: var(--warn); }
.status.never   { background: var(--gray-soft); color: var(--muted); }
.status.running { background: var(--info-soft); color: var(--info); }
.status.running::before { animation: pulse 1.1s ease infinite; }
.status.xl { font-size: 14px; padding: 6px 16px; gap: 8px; }
.status.xl::before { width: 8px; height: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650;
}
.badge.admin { background: var(--primary-soft); color: var(--primary); }
.badge.user  { background: var(--gray-soft); color: var(--muted); }
.badge .ic { width: 12px; height: 12px; }

.tag {
  display: inline-block; padding: 2px 8px; margin: 1px 3px 1px 0;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--gray-soft); color: var(--muted);
}
.tag.t-cm { background: var(--info-soft); color: var(--info); }
.tag.t-cu { background: var(--warn-soft); color: var(--warn); }
.tag.t-ct { background: var(--ok-soft); color: var(--ok); }

/* ---------------- 概览 ---------------- */
.ov-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.ov-status { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ov-msg { font-size: 13.5px; color: var(--text); word-break: break-all; }
.ov-msg:empty { display: none; }
.ov-times { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--muted); }
.ov-times span { display: inline-flex; align-items: center; gap: 6px; }
.ov-times b { color: var(--text); font-weight: 600; }
.ov-actions { flex: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 15px 16px;
  display: flex; gap: 13px; align-items: flex-start; min-width: 0;
}
.stat-ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat-ic.green { background: var(--ok-soft); color: var(--ok); }
.stat-ic.amber { background: var(--warn-soft); color: var(--warn); }
.stat-body { min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 16px; font-weight: 700; margin-top: 1px; word-break: break-all; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------- 日志终端 ---------------- */
.log-wrap { position: relative; }
pre.log {
  margin: 0; padding: 14px 16px;
  background: var(--term-bg); color: var(--term-text);
  border-radius: var(--r);
  font: 12.5px/1.7 ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  max-height: 62vh; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
  tab-size: 4;
}
pre.log.short { max-height: 300px; }
pre.log .log-empty { color: #5b6b8c; }
.log-tools { display: flex; gap: 8px; align-items: center; }
.log-tools select {
  height: 30px; padding: 0 26px 0 10px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--panel); color: var(--text); font-size: 12px; font-family: inherit;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

/* ---------------- 表格 ---------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 650; color: var(--muted);
  background: var(--panel-2); padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr.self { background: var(--primary-soft); }
.tbl tbody tr.self:hover { background: var(--primary-soft-2); }
.tbl .cell-user { display: flex; align-items: center; gap: 10px; }
.tbl .cell-user .avatar { width: 28px; height: 28px; font-size: 12px; }
.tbl .cell-ops { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tbl .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------- 空状态 ---------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 42px 16px; text-align: center;
}
.empty .e-ic {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 8px;
}
.empty b { font-size: 14px; color: var(--text); }
.empty span { font-size: 12.5px; color: var(--muted); max-width: 320px; }

/* ---------------- 登录页 ---------------- */
#app.is-guest .topbar { display: none; }
#app.is-guest .layout { display: block; }
#app.is-guest .sidebar { display: none; }
#app.is-guest .content {
  max-width: none; padding: 40px 16px;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(52% 42% at 18% 6%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(44% 38% at 88% 96%, rgba(14, 165, 233, .13), transparent 60%);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 30px 28px 26px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-brand .logo { width: 40px; height: 40px; }
.auth-brand b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.auth-brand b i { font-style: normal; color: var(--primary); }
.auth-brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.auth-sub { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.seg {
  display: flex; gap: 3px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; margin: 18px 0 16px;
}
.seg button {
  flex: 1; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }

.auth-card .field { margin-bottom: 14px; }
.auth-note {
  display: flex; gap: 8px; margin-top: 16px;
  padding: 10px 12px; border-radius: var(--r);
  background: var(--info-soft); color: var(--info);
  font-size: 12.5px; line-height: 1.55;
}
.auth-note .ic { flex: none; margin-top: 2px; }
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------- 备份 ---------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 .card { margin-bottom: 0; }
.bk-ic {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 12px;
}
.bk-desc { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; }
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.file-hidden { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.file-name { font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* ---------------- 积分展示 ---------------- */
.integral-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.integral-box {
  flex: 1; min-width: 160px;
  display: flex; align-items: baseline; gap: 8px;
  background: var(--panel-2); border: 1px dashed var(--border-strong);
  border-radius: var(--r); padding: 10px 14px;
}
.integral-box .num { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.integral-box .unit { font-size: 12px; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; top: 16px; left: 50%; z-index: 100;
  transform: translate(-50%, -10px);
  display: flex; align-items: center; gap: 9px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 11px;
  background: rgba(17, 24, 39, .92); color: #f1f5f9;
  font-size: 13px; font-weight: 550; line-height: 1.5;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s, transform .22s, visibility .22s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .ic { flex: none; }
.toast.ok .ic { color: #4ade80; }
.toast.error .ic { color: #f87171; }
.toast.info .ic { color: #7dd3fc; }
.toast.error { background: rgba(127, 29, 29, .94); }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(11, 18, 32, .48);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s, visibility .18s;
}
.modal.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box {
  width: min(430px, 100%);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 22px;
  transform: translateY(8px) scale(.985);
  transition: transform .18s;
}
.modal.show .modal-box { transform: none; }
.modal-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.modal-box .field { margin-bottom: 13px; }
.modal-box .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.confirm { display: flex; gap: 14px; }
.c-icon {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger);
}
.c-icon.info { background: var(--info-soft); color: var(--info); }
.confirm .c-body { min-width: 0; }
.confirm .c-title { font-size: 15px; font-weight: 700; }
.confirm .c-desc { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.55; word-break: break-all; }

/* ---------------- 骨架屏 ---------------- */
.sk-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; }
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--sk-hi) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: sk 1.15s linear infinite;
}

/* ---------------- 错误块 ---------------- */
.error-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; }
.error-box .e-ic {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--danger-soft); color: var(--danger);
  display: grid; place-items: center; margin-bottom: 8px;
}
.error-box b { font-size: 14.5px; }
.error-box p { margin: 0 0 12px; font-size: 13px; color: var(--muted); word-break: break-all; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: static;
    flex-direction: row; align-items: center;
    padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar .nav { display: flex; gap: 2px; }
  .sidebar a { margin: 0; padding: 8px 12px; white-space: nowrap; }
  .sidebar .sep, .sidebar .side-foot { display: none; }
  .content { padding: 20px 16px 56px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .page-head h1 { font-size: 18px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .brand-ver { display: none; }
  .user-meta { display: none; }
  .topbar-right .btn span.bt { display: none; }
  .topbar-right .btn { padding: 0 9px; }

  .card { padding: 16px; }

  /* 表格 → 卡片堆叠 */
  .tbl.resp thead { display: none; }
  .tbl.resp, .tbl.resp tbody { display: block; width: 100%; }
  .tbl.resp tr {
    display: block; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: var(--r);
    background: var(--panel); padding: 4px 14px;
  }
  .tbl.resp tbody tr:hover { background: var(--panel); }
  .tbl.resp tbody tr.self { background: var(--panel); }
  .tbl.resp td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    border: 0; border-bottom: 1px dashed var(--border);
    padding: 9px 0; text-align: right;
  }
  .tbl.resp td:last-child { border-bottom: 0; }
  .tbl.resp td::before {
    content: attr(data-label);
    flex: none; font-size: 12px; font-weight: 600; color: var(--muted);
    text-align: left;
  }
  .tbl .cell-ops { justify-content: flex-end; }

  .ov-hero { flex-direction: column; align-items: stretch; }
  .ov-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
