/* ==========================================================================
   pool-radar 看板样式 · 清爽现代风 (Clean & Modern Dashboard)
   - 高质感微光边框与毛玻璃层次
   - 全局进度条驱动（KPI存活率、并发占用率、耗尽管线、双轨用量条、行内对比条）
   - 深浅双主题，对比度符合 WCAG AA
   ========================================================================== */

/* ------------------------------ 设计令牌 ------------------------------ */
:root {
  /* 字体阶梯 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 15px;
  --fs-xl: 18px;
  --fs-num: 26px;
  --fs-hero: 42px;

  /* 间距阶梯 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* 圆角阶梯 */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;

  /* 动效 */
  --t-fast: .15s;
  --t-med: .28s;
  --t-smooth: .45s;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* 内容宽度 */
  --page-max: 1680px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "Segoe UI Variable Display", "SF Pro Display", Inter, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
}

/* ------------------------------ 深色模式（极客深邃科技风） ------------------------------ */
:root[data-theme="dark"] {
  --bg: #090d16;
  --bg-soft: #0e1524;
  --panel: #111a2d;
  --panel-2: #152238;
  --panel-3: #1a2a46;
  --panel-hover: #1b2d4c;
  --line: #223452;
  --line-soft: #18263e;
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --muted: #8496b0;

  /* 语义色 */
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --accent-soft: rgba(59, 130, 246, .14);
  --accent-glow: rgba(59, 130, 246, .35);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, .14);
  --ok-glow: rgba(16, 185, 129, .32);

  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .14);
  --warn-glow: rgba(245, 158, 11, .32);

  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, .14);
  --danger-glow: rgba(244, 63, 94, .32);

  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, .14);
  --purple-glow: rgba(139, 92, 246, .32);

  --cyan: #06b6d4;
  --cyan-soft: rgba(6, 182, 212, .14);

  /* 阴影 */
  --shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 4px 16px rgba(0, 0, 0, .35), 0 14px 36px rgba(0, 0, 0, .45);
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, .6);

  --grid: rgba(255, 255, 255, .05);
  --mask: rgba(4, 7, 14, .7);
  --skeleton: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%);
  --hero-grad: linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(139, 92, 246, .05) 60%, transparent);
  --eta-grad: linear-gradient(120deg, #93c5fd 0%, #3b82f6 50%, #a855f7 100%);

  /* 顶部警示条 */
  --ab-bg: rgba(245, 158, 11, .12);
  --ab-border: rgba(245, 158, 11, .25);
  --ab-1: #fbbf24; --ab-2: #f59e0b; --ab-3: #d97706;
  --ab-glow: rgba(245, 158, 11, .45);
  --ab-on-badge: #451a03;

  color-scheme: dark;
}

/* ------------------------------ 浅色模式（清新透气现代风） ------------------------------ */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #f1f5f9;
  --panel-hover: #edf2f7;
  --line: #e2e8f0;
  --line-soft: #edf2f7;
  --text: #0f172a;
  --text-dim: #334155;
  --muted: #64748b;

  /* 语义色 */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .08);
  --accent-glow: rgba(37, 99, 235, .22);

  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, .09);
  --ok-glow: rgba(5, 150, 105, .25);

  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .09);
  --warn-glow: rgba(217, 119, 6, .25);

  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, .09);
  --danger-glow: rgba(225, 29, 72, .25);

  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, .09);
  --purple-glow: rgba(124, 58, 237, .25);

  --cyan: #0891b2;
  --cyan-soft: rgba(8, 145, 178, .09);

  /* 阴影 */
  --shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .03);
  --shadow-lift: 0 6px 20px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .03);
  --shadow-pop: 0 20px 48px rgba(15, 23, 42, .15);

  --grid: rgba(0, 0, 0, .05);
  --mask: rgba(15, 23, 42, .45);
  --skeleton: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  --hero-grad: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(124, 58, 237, .03) 60%, transparent);
  --eta-grad: linear-gradient(120deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);

  /* 顶部警示条 */
  --ab-bg: #fffbeb;
  --ab-border: #fde68a;
  --ab-1: #b45309; --ab-2: #92400e; --ab-3: #78350f;
  --ab-glow: rgba(180, 83, 9, .22);
  --ab-on-badge: #ffffff;

  color-scheme: light;
}

/* ------------------------------ 基础样式 ------------------------------ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease); }

a { color: var(--accent); text-decoration: none; border-radius: var(--r-xs); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; }

code {
  background: var(--panel-3); padding: 2px 7px; border-radius: 6px;
  font-size: var(--fs-sm); font-family: var(--font-mono); border: 1px solid var(--line-soft);
}

.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-ok { color: var(--ok); }

.ic { width: 15px; height: 15px; flex: none; }

a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, .chip:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--accent-soft); }

body.readonly .admin-only { display: none !important; }
.badge.readonly-mode { color: var(--muted); background: var(--panel-3); }
.badge.admin-mode { color: var(--ok); background: var(--ok-soft); }

/* ------------------------ 顶部警示横条 ------------------------ */
.alert-bar {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  min-height: 46px; padding: 7px var(--sp-5);
  background: var(--ab-bg);
  border-bottom: 1px solid var(--ab-border);
  text-align: center;
}
.alert-bar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(45deg, currentColor 0 6px, transparent 6px 16px);
  opacity: .05;
  color: var(--ab-2);
}
.alert-bar .ab-badge {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--ab-on-badge);
  background: linear-gradient(135deg, var(--ab-1) 0%, var(--ab-3) 100%);
  box-shadow: 0 0 10px var(--ab-glow);
}
.alert-bar .ab-badge svg { width: 15px; height: 15px; }
.alert-bar .ab-text {
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 700; letter-spacing: .08em; line-height: 1.35;
  color: var(--ab-2);
}

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  padding: 10px var(--sp-6);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.logo {
  width: 36px; height: 36px; flex: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  box-shadow: 0 3px 12px var(--accent-glow);
}
.logo svg { width: 20px; height: 20px; }
.brand h1 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-text .sub {
  margin: 1px 0 0; font-size: var(--fs-xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-mid {
  display: flex; align-items: center; gap: var(--sp-2); margin-left: auto;
  font-size: var(--fs-sm); min-width: 0;
}
.sync-text { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.live { box-shadow: 0 0 0 2px var(--ok-soft); animation: pulse 2s infinite; }
.dot.stale { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
.dot.err { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; white-space: nowrap; flex: none;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
}
.badge.mock { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); background: var(--warn-soft); }
.badge.http { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); background: var(--ok-soft); }

/* 访客与在线人数统计徽章 */
.visitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  cursor: default;
}
.visitor-pill:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--panel-hover);
}
.visitor-pill b {
  color: var(--text-dim);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.visitor-pill .v-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--ok-soft);
  animation: pulse 2s infinite;
  display: inline-block;
  flex: none;
}
.visitor-pill .v-sep {
  opacity: .35;
  font-size: 10px;
  margin: 0 1px;
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 13px; border-radius: 9px; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 550; font-family: inherit; line-height: 1.4;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-dim);
  transition: all var(--t-fast) var(--ease);
  user-select: none; text-decoration: none;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent); background: var(--accent-soft);
  text-decoration: none; box-shadow: 0 2px 8px var(--accent-glow);
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.is-loading { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-strong));
  color: #fff; box-shadow: 0 4px 14px var(--accent-glow);
}
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: transparent; box-shadow: none; }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.icon-only { padding: 6px 8px; }

#btn-theme .ic-sun { display: none; }
#btn-theme .ic-moon { display: block; }
:root[data-theme="light"] #btn-theme .ic-sun { display: block; }
:root[data-theme="light"] #btn-theme .ic-moon { display: none; }

.inline-field { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------ 表单控件 ------------------------------ */
select, input, textarea {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; font-size: var(--fs-sm); font-family: inherit; outline: none;
  transition: all var(--t-fast) var(--ease);
}
select:hover, input:hover, textarea:hover { border-color: var(--muted); }
select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--panel);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input[type="number"] { width: 80px; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 25px;
}
.inline-field select { background-color: var(--panel); font-size: var(--fs-xs); }

/* ------------------------------ 布局 ------------------------------ */
main { padding: var(--sp-5) var(--sp-6) var(--sp-8); max-width: var(--page-max); margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-4); }
.grid2x { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

.grid2 > *, .grid2x > *, .kpis > *, .type-grid > *, .stats > *, .windows > *,
.fc-hero > *, .fc-hero-side > *, .src-etas > *, .bars > *, .chips > * { min-width: 0; }
.card, .type-card, .kpi, .win, .mini, .stat, .table-scroll { min-width: 0; }
.table-scroll { max-width: 100%; overflow: auto; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: var(--sp-5);
  margin-bottom: var(--sp-4); box-shadow: var(--shadow);
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.card:hover { box-shadow: var(--shadow-lift); }
.card-head {
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2 {
  font-size: var(--fs-lg); letter-spacing: -.01em;
  display: flex; align-items: center; gap: var(--sp-2);
}
.card-head .hint { font-size: var(--fs-xs); color: var(--muted); margin-left: auto; font-weight: 400; }

.sub-block { margin-top: var(--sp-5); min-width: 0; }
.sub-block h3 {
  font-size: var(--fs-md); color: var(--text); margin-bottom: var(--sp-3);
  font-weight: 650; display: flex; align-items: baseline; gap: var(--sp-2);
}
.sub-block h3::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--purple)); align-self: center;
}
.sub-block h3 .h-note { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.sub-block > .table-scroll { max-width: 100%; }

.note { font-size: var(--fs-xs); color: var(--muted); margin: 8px 0 0; line-height: 1.65; }
.note b { color: var(--text-dim); }
.note .s-ok   { color: var(--ok); }
.note .s-warn { color: var(--warn); }
.note .s-err  { color: var(--danger); }

/* ------------------------------ KPI 视觉卡片 ------------------------------ */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-5);
}
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: all var(--t-fast) var(--ease);
}
.kpi:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 60%, transparent), transparent);
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.kpi:hover::after { opacity: 1; }

.kpi .k-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.kpi .k-icon {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.kpi .k-icon svg { width: 17px; height: 17px; }
.kpi .k-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 550; }
.kpi .k-value {
  font-size: var(--fs-num); font-weight: 750; font-variant-numeric: tabular-nums;
  font-family: var(--font-num); line-height: 1.18; letter-spacing: -.02em;
}
.kpi .k-value small { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi .k-foot { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* KPI 进度条组件 */
.k-prog-wrap { margin: 10px 0 6px; display: flex; flex-direction: column; gap: 4px; }
.k-prog {
  height: 6px; background: var(--panel-3); border-radius: var(--r-pill);
  overflow: hidden; position: relative; border: 1px solid var(--line-soft);
}
.k-prog-fill {
  height: 100%; border-radius: var(--r-pill);
  transition: width var(--t-smooth) var(--ease);
}
.k-prog-fill.ok { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 8px rgba(16,185,129,.35); }
.k-prog-fill.accent { background: linear-gradient(90deg, #2563eb, #38bdf8); box-shadow: 0 0 8px rgba(56,189,248,.35); }
.k-prog-fill.warn { background: linear-gradient(90deg, #d97706, #fbbf24); box-shadow: 0 0 8px rgba(245,158,11,.35); }
.k-prog-fill.danger { background: linear-gradient(90deg, #dc2626, #f43f5e); box-shadow: 0 0 8px rgba(244,63,94,.35); }
.k-prog-fill.purple { background: linear-gradient(90deg, #7c3aed, #a78bfa); box-shadow: 0 0 8px rgba(139,92,246,.35); }
.k-prog-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.k-prog-meta b { color: var(--text-dim); font-weight: 600; }

.k-line-item { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.k-line-item:last-child { border-bottom: none; }
.k-line-main {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-xs); color: var(--text-dim);
}
.k-line-main b { font-size: var(--fs-lg); font-weight: 700; font-family: var(--font-num); color: var(--text); }
.k-line-main i { font-style: normal; font-size: var(--fs-xs); color: var(--muted); margin-left: 2px; }

.k-gtable { margin-top: 8px; display: grid; align-items: baseline; gap: 4px 8px; }
.k-gtable .h { font-size: var(--fs-xs); color: var(--muted); text-align: right; font-weight: 550; }
.k-gtable .h.first { text-align: left; }
.k-gtable .g { font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-gtable .n {
  font-size: var(--fs-md); font-family: var(--font-num); font-weight: 700;
  color: var(--text); text-align: right; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.k-gtable .n.zero { color: var(--muted); font-weight: 400; }

/* 骨架屏 */
.skeleton {
  background: var(--skeleton); background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-sm); color: transparent !important;
  pointer-events: none; user-select: none;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------ 重点监测 / 跑完预测 Hero ------------------------------ */
.focus-card {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow);
  position: relative; overflow: hidden;
}
.focus-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple), transparent 85%);
  opacity: .9;
}
.focus-badge {
  display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .04em; padding: 2px 9px; margin-right: var(--sp-1);
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.fc-hero { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: stretch; margin-bottom: var(--sp-2); }
.fc-hero-main {
  flex: 1 1 500px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5);
  background: var(--hero-grad), var(--panel-2);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.fc-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

.src-etas { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-1) 0; }
.src-eta {
  flex: 1 1 210px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
  transition: all var(--t-fast) var(--ease);
}
.src-eta:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.src-eta.is-primary { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.src-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--text-dim); font-weight: 600;
}
.src-badge {
  font-size: 10px; font-weight: 500; color: var(--muted);
  background: var(--panel-3); border-radius: var(--r-pill); padding: 1px 7px;
}
.src-time {
  font-size: 26px; font-weight: 800; margin: 4px 0 2px; line-height: 1.2;
  font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  background: var(--eta-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
}
.fc-risk { font-size: var(--fs-xs); line-height: 1.6; color: var(--muted); }
.fc-risk.danger { color: var(--danger); font-weight: 550; }
.fc-risk.warn { color: var(--warn); font-weight: 550; }
.fc-risk.safe { color: var(--ok); font-weight: 550; }

/* 重点监测：满额账号消耗进度模拟管线 */
.fc-pipeline-wrap {
  margin-top: 4px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.fc-pipeline-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px;
}
.fc-pipeline-title small { font-weight: 400; color: var(--muted); }
.fc-pipe-track {
  height: 8px; background: var(--panel-3); border-radius: var(--r-pill);
  position: relative; overflow: visible; margin-bottom: 20px;
  border: 1px solid var(--line-soft);
}
.fc-pipe-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 50%, #f59e0b 80%, #ef4444 100%);
  width: 100%; opacity: .85;
}
.fc-pipe-nodes {
  position: relative; display: flex; justify-content: space-between; margin-top: -18px;
}
.fc-pipe-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transform: translateX(-50%); font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fc-pipe-node:first-child { transform: none; align-items: flex-start; }
.fc-pipe-node:last-child { transform: none; align-items: flex-end; }
.fc-pipe-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--panel);
  border: 2px solid var(--accent); box-shadow: 0 0 6px var(--accent-glow);
}
.fc-pipe-node.danger .fc-pipe-dot { border-color: var(--danger); box-shadow: 0 0 6px var(--danger-glow); }
.fc-pipe-node.ok .fc-pipe-dot { border-color: var(--ok); box-shadow: 0 0 6px var(--ok-glow); }

/* ------------------------------ 按来源对比卡片 ------------------------------ */
.cmp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--sp-4);
}
.cmp-block {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-4); box-shadow: var(--shadow);
  transition: border-color var(--t-fast) var(--ease);
}
.cmp-block:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.cmp-title {
  font-size: var(--fs-sm); font-weight: 650; color: var(--text);
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline;
}
.cmp-title em { font-style: normal; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.cmp-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
  padding: 4px 0; border-bottom: 1px solid var(--line-soft);
}
.cmp-row:last-child { border-bottom: none; margin-bottom: 0; }
.cmp-name {
  flex: none; width: 88px; font-size: var(--fs-xs); color: var(--text-dim); font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmp-row .mbar { flex: 1; min-width: 0; }
.cmp-sub { flex: none; font-size: 10px; color: var(--muted); }

/* 统一高级进度条组件 (.mbar) */
.mbar { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; }
.mbar-track {
  position: relative; flex: 1; height: 8px; border-radius: var(--r-pill);
  background: var(--panel-3); overflow: hidden; border: 1px solid var(--line-soft);
}
.mbar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width var(--t-smooth) var(--ease);
}
.mbar-fill.lv-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px rgba(245,158,11,.3); }
.mbar-fill.lv-danger { background: linear-gradient(90deg, #e11d48, #f43f5e); box-shadow: 0 0 8px rgba(244,63,94,.35); }
.mbar-fill.lv-ok { background: linear-gradient(90deg, #059669, #10b981); box-shadow: 0 0 8px rgba(16,185,129,.3); }
.mbar-fill.c0 { background: linear-gradient(90deg, #d97706, #f59e0b); }
.mbar-fill.c1 { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.mbar-fill.c2 { background: linear-gradient(90deg, #059669, #34d399); }
.mbar-fill.c3 { background: linear-gradient(90deg, #7c3aed, #a855f7); }

.mbar-val {
  flex: none; min-width: 44px; text-align: right; font-size: var(--fs-xs);
  color: var(--text); font-weight: 600; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.cmp-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-dim);
}
.cmp-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.lg-dot.c0 { background: #f59e0b; }
.lg-dot.c1 { background: #3b82f6; }
.lg-dot.c2 { background: #10b981; }
.lg-dot.c3 { background: #8b5cf6; }
.cmp-legend .lg-note { font-size: 11px; color: var(--muted); margin-left: auto; }

/* ------------------------------ 表格 & 逐号明细 ------------------------------ */
.table-scroll {
  max-height: 600px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel);
}
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tbl thead th {
  font-size: var(--fs-xs); color: var(--muted); font-weight: 650;
  letter-spacing: .02em; background: var(--panel-2); position: sticky; top: 0; z-index: 2;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
}
.tbl thead th:hover { color: var(--accent); }
.tbl thead th[data-sort]::after {
  content: "⇅"; margin-left: 5px; font-size: 10px; opacity: .35;
}
.tbl thead th[aria-sort="ascending"]::after { content: "▲"; opacity: 1; color: var(--accent); }
.tbl thead th[aria-sort="descending"]::after { content: "▼"; opacity: 1; color: var(--accent); }

.tbl tbody tr { transition: background var(--t-fast) var(--ease); }
.tbl tbody tr:hover { background: var(--panel-hover); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .mono { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; }
.tbl td b { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.cell-sub { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }

/* 用量窗口双进度条 */
.uw { display: inline-flex; flex-direction: column; gap: 4px; min-width: 155px; }
.uw-row { display: flex; align-items: center; gap: 7px; }
.uw-tag {
  flex: none; width: 22px; text-align: center; font-size: 10px; line-height: 1;
  padding: 3px 0; border-radius: 4px; font-weight: 700;
}
.uw-tag.h5 { background: var(--cyan-soft); color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent); }
.uw-tag.d7 { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* ETA 胶囊徽章 */
.badge-eta {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.badge-eta.fast { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.badge-eta.mid { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.badge-eta.slow { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.badge-eta.muted { background: var(--panel-3); color: var(--muted); border: 1px solid var(--line); }

/* 并发列微型进度条 */
.conc-mbar { min-width: 130px; }
.conc-mbar .mbar-track { height: 7px; }
.conc-mbar .mbar-val small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* 并发构成表格行内进度条 */
.mbar.tbl-bar { min-width: 120px; }

/* --------------------- 我的账号（本机登记） --------------------- */
.mine-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 12px; }
.mine-bar .btn.sm { padding: 4px 10px; font-size: var(--fs-xs); gap: 5px; }
.mine-bar #mine-count {
  font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 10px;
  padding: 1px 6px; border-radius: var(--r-pill); background: var(--panel-3); color: var(--text-dim);
}
.mine-bar .btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: transparent; }
.mine-bar .btn[aria-pressed="true"] #mine-count { background: rgba(255,255,255,.3); color: #fff; }
.mine-hint { font-size: var(--fs-xs); color: var(--muted); margin-left: auto; }
.mine-hint b { color: var(--text-dim); }
.tbl th.mine-col, .tbl td.mine-col { width: 44px; text-align: center; padding: 4px 6px; }
.star {
  background: none; border: none; padding: 3px; line-height: 0; cursor: pointer;
  color: var(--muted); border-radius: 6px; transition: all var(--t-fast) var(--ease);
}
.star:hover { color: var(--warn); background: var(--warn-soft); }
.star.on { color: var(--warn); }
.star svg { width: 16px; height: 16px; }
.tbl tr.is-mine { background: var(--accent-soft); }
.tbl tr.is-mine td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ------------------------------ 分号种概况卡片 ------------------------------ */
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--sp-4); }
.type-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow);
  transition: all var(--t-fast) var(--ease);
}
.type-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-lift); transform: translateY(-2px);
}
.type-card h4 {
  margin: 0 0 12px; font-size: var(--fs-md); display: flex; align-items: center; gap: var(--sp-2);
  padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.type-card h4 .tc-count {
  margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 400;
  background: var(--panel-3); border-radius: var(--r-pill); padding: 2px 9px;
}
.type-card .kv {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); padding: 5px 0; color: var(--muted);
}
.type-card .kv b {
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600;
  font-family: var(--font-num); text-align: right;
}
.type-card .progress { min-width: 100px; }

/* 进度条通用 */
.progress { display: flex; align-items: center; gap: var(--sp-2); min-width: 120px; }
.progress .track { flex: 1; height: 7px; background: var(--panel-3); border-radius: var(--r-pill); overflow: hidden; border: 1px solid var(--line-soft); }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple)); border-radius: var(--r-pill); transition: width var(--t-smooth) var(--ease); }
.progress .fill.ok { background: linear-gradient(90deg, #10b981, #34d399); }
.progress .fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress .fill.danger { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.progress span { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ------------------------------ 标签 ------------------------------ */
.tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--r-pill); font-size: var(--fs-xs); line-height: 1.4;
  border: 1px solid var(--line); font-weight: 600; white-space: nowrap;
}
.tag.plus { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.tag.pro { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 40%, transparent); background: var(--purple-soft); }
.tag.team { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.tag.business_premium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.tag.other { color: var(--muted); }
.tag.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.tag.muted { color: var(--muted); }

/* ------------------------------ 抽屉 & 模态窗 ------------------------------ */
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh;
  width: 500px; max-width: 94vw;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  transform: translateX(103%);
  transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  visibility: hidden;
  z-index: 60; display: flex; flex-direction: column;
}
.drawer.open { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); flex: none;
  background: var(--panel-2);
}
.drawer-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.drawer-body { flex: 1; overflow: auto; padding: var(--sp-4) var(--sp-5); overscroll-behavior: contain; }
.drawer-foot {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line);
  display: flex; gap: 10px; flex: none; background: var(--panel-2);
}
.drawer-mask {
  position: fixed; inset: 0; background: var(--mask); z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

.cfg-sec { border-bottom: 1px solid var(--line-soft); padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); }
.cfg-sec:last-child { border-bottom: none; }
.cfg-sec h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cfg-sec h3::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--purple)); }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-2); }
.row > span { width: 110px; flex: none; font-size: var(--fs-sm); color: var(--text-dim); }
.row > input, .row > select, .row > textarea { flex: 1; min-width: 0; }
.row em { font-style: normal; font-size: var(--fs-xs); color: var(--muted); }
.btn-row { display: flex; gap: var(--sp-2); margin-top: 12px; flex-wrap: wrap; }

.map-grid { display: flex; flex-direction: column; gap: 7px; }
.map-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.map-row > span { width: 94px; flex: none; color: var(--text-dim); font-size: var(--fs-xs); }
.map-row input { flex: 1; min-width: 0; }

.probe-out { margin-top: var(--sp-3); font-size: var(--fs-xs); }
.probe-out pre {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px; max-height: 220px; overflow: auto; font-size: var(--fs-xs); line-height: 1.5;
  font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all;
}
.probe-out .ok { color: var(--ok); }
.probe-out .err { color: var(--danger); }
.probe-out .warn { color: var(--warn); }

.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip {
  padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  cursor: pointer; font-size: var(--fs-sm); background: var(--panel-2); user-select: none;
  color: var(--text-dim); transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.on {
  border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff; font-weight: 600; box-shadow: 0 2px 8px var(--accent-glow);
}

.foot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--muted); padding: 10px 2px;
}
.foot .sep { opacity: .4; }

.toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translate(-50%, 16px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 20px; font-size: var(--fs-sm); opacity: 0; z-index: 90;
  box-shadow: var(--shadow-pop); pointer-events: none;
  transition: all var(--t-med) var(--ease); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: var(--ok); }

.empty { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.empty::before { content: "◌"; display: block; font-size: 24px; margin-bottom: var(--sp-2); opacity: .5; }

/* 账号详情弹窗 */
.modal {
  position: fixed; z-index: 71; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 700px; max-width: 94vw; max-height: 86vh;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden;
  animation: modal-in var(--t-med) var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.modal .drawer-body { padding: var(--sp-4) var(--sp-5); }
.chart-wrap { position: relative; }
.chart-wrap canvas { width: 100%; display: block; }
.chart-wrap.large canvas { min-height: 180px; }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* 响应式 */
@media (max-width: 1180px) {
  .grid2, .grid2x { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar { gap: var(--sp-3); }
  .brand-text .sub { display: none; }
  .topbar-mid { order: 3; width: 100%; margin-left: 0; }
}
@media (max-width: 640px) {
  main { padding: var(--sp-3) var(--sp-3) var(--sp-7); }
  .topbar { padding: 10px var(--sp-3); gap: 10px; }
  .topbar-actions .btn span { display: none; }
  .card { padding: var(--sp-4) var(--sp-3); border-radius: var(--r-lg); }
  .grid2, .grid2x, .type-grid, .stats { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .src-time { font-size: 21px; }
  .drawer { width: 100vw; max-width: 100vw; }
}

/* ------------------------------ 管理员登录弹窗 ------------------------------ */
.auth-modal-wrap {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
}
.auth-modal-wrap[hidden] { display: none !important; }
.auth-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  animation: fadeIn var(--t-fast) var(--ease);
}
.auth-modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lift), 0 20px 50px rgba(0,0,0,0.5);
  padding: var(--sp-5) var(--sp-6);
  animation: popIn var(--t-med) var(--ease);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.auth-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-3);
}
.auth-modal-title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-lg); font-weight: 700; color: var(--text);
}
.auth-modal-desc {
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; margin-bottom: var(--sp-4);
}
.auth-field {
  display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4);
}
.auth-field label {
  font-size: var(--fs-xs); color: var(--text-dim); font-weight: 600;
}
.auth-field input {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-md); color: var(--text); font-size: var(--fs-md);
  outline: none; transition: border-color var(--t-fast) var(--ease);
}
.auth-field input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-error {
  font-size: var(--fs-xs); color: var(--danger); background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: var(--sp-4);
}
.auth-error[hidden] { display: none !important; }
.auth-modal-foot {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
}
