:root {
  --bg: #070d18;
  --bg-soft: #0b1422;
  --panel: #0e1828;
  --panel-2: #111e31;
  --line: #1c2c44;
  --line-soft: #16243a;
  --text: #e8f0fb;
  --muted: #8ea3bf;
  --muted-2: #647a97;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(2, 8, 20, .45);
  --sidebar-w: 168px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* 数字输入：隐藏原生白色上下箭头，避免深色主题下出现突兀控件 */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --------------------------------------------------------------- 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #2a4160 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #24395a;
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #34577f;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: #3f6b9c;
  background-clip: content-box;
}
::-webkit-scrollbar-corner { background: transparent; }
html { scrollbar-gutter: stable; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
svg { display: block; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- 登录 */
.auth-body { overflow-x: hidden; }
.auth-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(34, 211, 238, .12), transparent 60%),
    radial-gradient(800px 600px at 85% 85%, rgba(99, 102, 241, .16), transparent 60%),
    linear-gradient(160deg, #060b14 0%, #08111f 50%, #060a12 100%);
}
.auth-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
}
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 40px;
}
.auth-brand { position: relative; padding-right: 20px; animation: fadeUp .6s ease both; }
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(34, 211, 238, .14);
  border-radius: 50%;
  pointer-events: none;
}
.auth-brand::before { width: 420px; height: 420px; right: -60px; top: -120px; }
.auth-brand::after { width: 300px; height: 300px; right: 0; top: -60px;
  border-color: rgba(99, 102, 241, .16); }
.brand-mark {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(34, 211, 238, .16), rgba(99, 102, 241, .12));
  border: 1px solid rgba(34, 211, 238, .3);
  box-shadow: 0 10px 30px rgba(34, 211, 238, .12);
  margin-bottom: 26px;
}
.brand-mark svg { width: 40px; height: 40px; }
.auth-brand h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: 1px;
  font-weight: 700;
  background: linear-gradient(100deg, #f8fbff 10%, #a5f3fc 55%, #a5b4fc 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  margin: 8px 0 34px;
  color: var(--muted-2);
  letter-spacing: 3.2px;
  font-size: 12px;
  text-transform: uppercase;
}
.brand-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.brand-points li {
  display: flex; align-items: center; gap: 12px;
  color: #b9c9dd; font-size: 14px;
}
.brand-points li span {
  width: 18px; height: 18px; flex: none;
  border-radius: 6px;
  background: rgba(34, 211, 238, .1);
  border: 1px solid rgba(34, 211, 238, .35);
  position: relative;
}
.brand-points li span::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 10px rgba(34, 211, 238, .8);
}
.brand-meta {
  margin-top: 44px;
  display: flex; align-items: center; gap: 10px;
  color: var(--muted-2); font-size: 12px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .55);
  animation: pulse 2.2s infinite;
}
.dot-sep { width: 1px; height: 12px; background: var(--line); }
.auth-panel { position: relative; animation: fadeUp .7s .08s ease both; }
.auth-card {
  background: linear-gradient(170deg, rgba(17, 30, 49, .96), rgba(10, 18, 30, .98));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 38px 30px;
  box-shadow: 0 30px 70px rgba(2, 8, 20, .6), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
}
.auth-card.center { text-align: center; padding: 60px 38px; }
.auth-head { margin-bottom: 26px; }
.auth-head h2 { margin: 0 0 7px; font-size: 23px; letter-spacing: .5px; }
.auth-head p { margin: 0; color: var(--muted); font-size: 13px; }
.link-back {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 0 0 14px; font-size: 12px;
}
.link-back:hover { color: var(--accent); }
.field { display: block; margin-bottom: 18px; }
.field > span {
  display: block; margin-bottom: 8px;
  color: #a9bad0; font-size: 12px; letter-spacing: .4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: #0a1321;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder, .field textarea::placeholder { color: #4f6580; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(34, 211, 238, .65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
  background: #0b1626;
}
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 60px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted-2); cursor: pointer;
  font-size: 12px; padding: 6px 8px;
}
.pwd-toggle:hover { color: var(--accent); }
.form-error {
  min-height: 18px;
  color: #fda4af;
  font-size: 12px;
  margin: 2px 0 10px;
  white-space: pre-line;
}
.form-error.notice { color: #fbbf24; }
.code-input {
  text-align: center;
  letter-spacing: 12px;
  font-size: 24px !important;
  padding: 12px 10px 12px 20px !important;
  font-variant-numeric: tabular-nums;
}
.hint-text { color: var(--muted-2); font-size: 12px; margin: 16px 0 0; }
.policy-list {
  list-style: none; margin: 4px 0 14px; padding: 12px 14px;
  background: rgba(34, 211, 238, .04);
  border: 1px dashed rgba(34, 211, 238, .22);
  border-radius: 10px;
  color: var(--muted); font-size: 12px;
  display: grid; gap: 5px;
}
.policy-list li::before { content: "· "; color: var(--accent); }
.auth-foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 10px;
  color: var(--muted-2); font-size: 11px;
}
.big-ok {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 34px; color: #062d22;
  background: linear-gradient(140deg, #34d399, #22d3ee);
  box-shadow: 0 12px 30px rgba(16, 185, 129, .3);
}

/* --------------------------------------------------------------- 按钮 / 表单 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line);
  background: #142135;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 16px;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}
.btn:hover { border-color: #2a4366; background: #17273f; }
.btn.primary {
  background: linear-gradient(120deg, #0891b2, #4f46e5);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(34, 211, 238, .18);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .35); color: #fda4af; }
.btn.danger:hover { background: rgba(244, 63, 94, .2); }
.btn.block { width: 100%; padding: 12px 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.input, .select {
  background: #0a1321;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 11px;
  outline: none;
  min-height: 36px;
}
.input:focus, .select:focus {
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .1);
}
.input::placeholder { color: #4f6580; }
textarea.input { resize: vertical; min-height: 90px; }
label.check { display: inline-flex; align-items: center; gap: 8px; color: #b9c9dd; cursor: pointer; }
label.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.form-grid > .check.full { margin-bottom: 16px; }

/* --------------------------------------------------------------- 应用框架 */
.app-shell { min-height: 100vh; background:
  radial-gradient(1000px 500px at 88% -10%, rgba(99, 102, 241, .1), transparent 65%),
  var(--bg); }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0a1320, #08101c 65%, #070d17);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  z-index: 40;
  transition: width .2s ease;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  container-type: inline-size;
}
.brand-icon { width: 36px; height: 36px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; min-width: 0; }
.brand-text strong {
  font-size: clamp(11px, 6.8cqi, 13px);
  letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small {
  font-size: clamp(7px, 4.6cqi, 9px);
  color: var(--muted-2); letter-spacing: clamp(.6px, 1.1cqi, 2px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav { flex: 1; overflow-y: auto; padding: 14px 8px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px;
  border-radius: 9px;
  color: #9db0c8;
  font-size: 13.5px;
  position: relative;
  white-space: nowrap; overflow: hidden;
  transition: background .16s, color .16s;
}
.nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.nav a:hover { background: rgba(34, 211, 238, .06); color: #d6e5f7; }
.nav a.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(99, 102, 241, .08));
  color: #eaf6ff;
}
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(34, 211, 238, .7);
}
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: rgba(244, 63, 94, .16);
  border: 1px solid rgba(244, 63, 94, .35);
  color: #fda4af; font-size: 10px; font-style: normal;
  padding: 1px 7px; border-radius: 20px;
}
.nav-sep {
  margin: 14px 12px 6px;
  font-size: 10px; letter-spacing: 2px; color: #4c617c;
  display: flex; align-items: center; gap: 8px;
}
.nav-sep::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.nav-collapse {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 12px 6px;
  padding: 9px 12px;
  background: rgba(34, 211, 238, .04);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-collapse:hover {
  color: #d6e5f7;
  background: rgba(34, 211, 238, .09);
  border-color: rgba(34, 211, 238, .25);
}
.nav-collapse svg { width: 16px; height: 16px; fill: currentColor; flex: none; transition: transform .2s ease; }
.sidebar-foot {
  padding: 14px 12px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted-2);
}
.health-pill { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.dot.ok { background: var(--ok); box-shadow: 0 0 9px rgba(16, 185, 129, .9); }
.dot.warn { background: var(--warn); }

/* 侧边栏收起：仅图标模式 */
.app-shell.sidebar-collapsed { --sidebar-w: 72px; }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding: 18px 10px; }
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav a span,
.app-shell.sidebar-collapsed .nav-sep,
.app-shell.sidebar-collapsed .sidebar-foot .ver,
.app-shell.sidebar-collapsed .health-pill span:not(.dot),
.app-shell.sidebar-collapsed .nav-collapse span { display: none; }
.app-shell.sidebar-collapsed .nav { padding: 14px 10px; }
.app-shell.sidebar-collapsed .nav a { justify-content: center; gap: 0; padding: 11px; }
.app-shell.sidebar-collapsed .nav a.active::before { display: none; }
.app-shell.sidebar-collapsed .nav-badge {
  position: absolute; top: 3px; right: 4px; margin: 0; padding: 0 4px; font-size: 9px;
}
.app-shell.sidebar-collapsed .nav-collapse { justify-content: center; padding: 9px 0; margin: 4px 10px 6px; }
.app-shell.sidebar-collapsed .nav-collapse svg { transform: rotate(180deg); }
.app-shell.sidebar-collapsed .sidebar-foot { justify-content: center; padding: 14px 10px 18px; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .2s ease;
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 30px;
  background: rgba(7, 13, 24, .82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.page-head h1 { margin: 0; font-size: 19px; letter-spacing: .4px; font-weight: 600; }
.page-head p { margin: 2px 0 0; color: var(--muted-2); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; position: relative; }
.dash-refresh {
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px; height: 36px;
  background: #0d1828; border: 1px solid var(--line); border-radius: 9px;
  color: var(--muted-2); font-size: 11.5px; white-space: nowrap;
}
.dash-refresh svg { width: 14px; height: 14px; fill: currentColor; opacity: .7; }
.dash-refresh select {
  background: transparent; border: 0; color: var(--text);
  font-size: 11.5px; cursor: pointer; outline: none; padding: 0;
}
.dash-refresh select option { background: #0d1828; color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: #0d1828; border: 1px solid var(--line); border-radius: 9px;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: rgba(34, 211, 238, .4); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: #0d1828; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px 10px 5px 5px; cursor: pointer; color: var(--text);
}
.user-chip:hover { border-color: #2a4366; }
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #0891b2, #4f46e5);
  font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-meta strong { font-size: 12.5px; }
.user-meta small { color: var(--muted-2); font-size: 10px; }
.chev { width: 14px; height: 14px; fill: var(--muted-2); }
.user-menu {
  position: absolute; right: 0; top: 46px;
  background: #0e1a2b; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 5px; min-width: 190px; z-index: 50;
}
.user-menu button {
  width: 100%; text-align: left; background: none; border: 0;
  color: #c7d6e8; padding: 9px 11px; border-radius: 7px; cursor: pointer;
}
.user-menu button:hover { background: rgba(34, 211, 238, .08); color: #fff; }
.pwd-banner {
  margin: 18px 30px -4px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: 11px;
  padding: 10px 14px;
  color: #fcd34d; font-size: 12.5px;
}
.pwd-banner .warn-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(245, 158, 11, .2);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.pwd-banner .btn { margin-left: auto; color: #fcd34d; border-color: rgba(245, 158, 11, .4); }
.view { padding: 24px 30px 60px; max-width: none; width: 100%; animation: fadeUp .3s ease; }

/* --------------------------------------------------------------- 卡片 / 网格 */
.card {
  background: linear-gradient(170deg, rgba(15, 26, 43, .96), rgba(11, 19, 32, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(2, 8, 20, .25);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .3px; }
.card-head .sub { color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.card-body { padding: 0 18px 18px; }
.card-body.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.55fr 1fr; }
.grid.two-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  position: relative;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, .12), transparent 70%);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 211, 238, .18);
  color: var(--accent);
}
.kpi-icon svg { width: 17px; height: 17px; fill: currentColor; }
.kpi-icon.violet { color: #a5b4fc; background: rgba(99, 102, 241, .1); border-color: rgba(99, 102, 241, .22); }
.kpi-icon.amber { color: #fbbf24; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .22); }
.kpi-icon.rose { color: #fb7185; background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .22); }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-foot { color: var(--muted-2); font-size: 11.5px; display: flex; gap: 8px; align-items: center; }
.kpi-foot b { color: var(--ok); font-weight: 600; }
.kpi-foot b.warn { color: var(--warn); }
.kpi-foot b.danger { color: var(--danger); }
a.kpi {
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
a.kpi:hover {
  border-color: rgba(34, 211, 238, .42);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(2, 8, 20, .45);
}
a.kpi:focus-visible {
  outline: 2px solid rgba(34, 211, 238, .5);
  outline-offset: 2px;
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 0 12px;
}
.section-title h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-title .hint { color: var(--muted-2); font-size: 12px; }

/* --------------------------------------------------------------- 图表 */
.chart-wrap { position: relative; padding: 4px 0 0; }
.chart-wrap svg { width: 100%; height: auto; }
.chart-grid { stroke: rgba(148, 163, 184, .1); stroke-width: 1; }
.chart-axis { fill: var(--muted-2); font-size: 10px; }
.chart-line { fill: none; stroke: url(#lineGrad); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: url(#areaGrad); }
.chart-dot { fill: #0b1422; stroke: var(--accent); stroke-width: 2; }
.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 6px 4px 2px; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 168px; height: 168px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 15; stroke-linecap: round; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.donut-center strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.donut-center span { color: var(--muted-2); font-size: 11px; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #b9c9dd; }
.legend-item i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-item .lg-val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
button.legend-item {
  width: 100%;
  background: none; border: 0; padding: 3px 6px; margin: -3px -6px;
  border-radius: 7px; text-align: left; cursor: pointer; font-family: inherit;
  transition: background .16s ease, color .16s ease;
}
button.legend-item:hover { background: rgba(34, 211, 238, .07); color: #dff4fb; }
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 122px 1fr 52px; gap: 10px; align-items: center; font-size: 12px; }
button.bar-row {
  width: 100%;
  background: none; border: 0; padding: 3px 6px; margin: -3px -6px;
  border-radius: 7px; text-align: left; cursor: pointer; font-family: inherit;
  transition: background .16s ease;
}
button.bar-row:hover { background: rgba(34, 211, 238, .07); }
button.bar-row:hover .name { color: #dff4fb; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b9c9dd; }
.bar-track { height: 7px; border-radius: 6px; background: #0a1422; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0891b2, #6366f1); }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(34, 211, 238, .06); border: 1px solid var(--line);
  color: #a9c6dd; border-radius: 7px; padding: 1px 8px; margin: 2px 4px 2px 0;
  font-size: 11.5px; cursor: pointer; font-family: inherit;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.chip-link:hover { border-color: rgba(34, 211, 238, .45); color: #dff4fb; background: rgba(34, 211, 238, .12); }
.chip-link b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; padding: 10px 14px;
  color: var(--muted-2); font-weight: 500; font-size: 11px; letter-spacing: .5px;
  background: rgba(10, 18, 31, .65);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: #c9d7e8;
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .14s; }
table.data tbody tr:hover { background: rgba(34, 211, 238, .035); }
table.data tbody tr.clickable { cursor: pointer; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11.5px; }
.msg-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aebfd4; }
.time-cell { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.actions { white-space: nowrap; }
.actions .link-btn + .link-btn { margin-left: 10px; }
table.data th.col-status,
table.data td.col-status,
table.data th.col-actions,
table.data td.col-actions,
table.data th.col-select,
table.data td.col-select {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
table.data td.col-status { width: 1%; }
table.data td.col-actions { width: 1%; }
table.data td.col-select { width: 36px; padding-left: 8px; padding-right: 8px; }
table.data td.col-select input { margin: 0; vertical-align: middle; cursor: pointer; }
.link-btn {
  background: none; border: 0; color: #7dd3fc; cursor: pointer;
  font-size: 12px; padding: 2px 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: #55657a; cursor: not-allowed; text-decoration: none; }
.link-btn.danger { color: #fb7185; }
.tag {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 20px;
  background: rgba(148, 163, 184, .1);
  border: 1px solid rgba(148, 163, 184, .16);
  color: #a8b9cc; font-size: 10.5px;
  white-space: nowrap;
}
.tag.cyan { background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .25); color: #67e8f9; }
.tag.violet { background: rgba(99, 102, 241, .12); border-color: rgba(99, 102, 241, .28); color: #a5b4fc; }
.tag.green { background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .25); color: #6ee7b7; }
.tag.red { background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .28); color: #fda4af; }
.tag.amber { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .28); color: #fcd34d; }
.sev {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 20px; font-size: 11px;
  border: 1px solid transparent; white-space: nowrap;
}
.sev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev-0 { color: #fca5a5; background: rgba(220, 38, 38, .14); border-color: rgba(220, 38, 38, .3); }
.sev-1 { color: #fda4af; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .28); }
.sev-2 { color: #fdba74; background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .3); }
.sev-3 { color: #fcd34d; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .28); }
.sev-4 { color: #fde68a; background: rgba(234, 179, 8, .08); border-color: rgba(234, 179, 8, .22); }
.sev-5 { color: #7dd3fc; background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .25); }
.sev-6 { color: #67e8f9; background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .22); }
.sev-7 { color: #94a3b8; background: rgba(100, 116, 139, .12); border-color: rgba(100, 116, 139, .25); }
.status { font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.open { color: #fb7185; }
.status.ack { color: #fbbf24; }
.status.closed { color: #6ee7b7; }
.status.online { color: #6ee7b7; }
.status.offline { color: #7c8ea6; }
.level { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.level.critical { background: rgba(244, 63, 94, .16); color: #fda4af; }
.level.high { background: rgba(249, 115, 22, .16); color: #fdba74; }
.level.medium { background: rgba(245, 158, 11, .13); color: #fcd34d; }
.level.low { background: rgba(56, 189, 248, .12); color: #7dd3fc; }

/* --------------------------------------------------------------- 工具栏 / 分页 */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar .input { min-width: 140px; }
.toolbar .select { max-width: 168px; }
.toolbar .btn { padding: 8px 12px; min-height: 36px; }
.filter-btn { gap: 6px; }
.filter-count {
  display: none; min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 8px; background: rgba(34, 211, 238, .18);
  color: #7dd3fc; font-size: 10px; line-height: 16px; text-align: center;
}
.filter-count.on { display: inline-block; }
.filter-drawer {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 18, 31, .5);
  border-bottom: 1px solid var(--line-soft);
}
.filter-drawer .field { margin-bottom: 0; min-width: 170px; flex: 1; }
.filter-drawer .field > span { margin-bottom: 6px; }
.filter-drawer .drawer-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sev-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.sev-filter {
  border: 1px solid var(--line); background: #0b1625; color: var(--muted);
  border-radius: 7px; padding: 5px 9px; font-size: 11.5px; cursor: pointer;
}
.sev-filter.on { color: #e6f7ff; border-color: rgba(34, 211, 238, .5); background: rgba(34, 211, 238, .12); }
.toolbar-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2); font-size: 12px;
}
.pager { display: flex; gap: 6px; align-items: center; }
.pager button {
  width: 28px; height: 28px; border-radius: 7px;
  background: #0c1726; border: 1px solid var(--line); color: var(--muted);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { color: var(--accent); border-color: rgba(34, 211, 238, .4); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.page-info { padding: 0 6px; }
.page-jump { display: flex; align-items: center; gap: 6px; margin-left: 8px; white-space: nowrap; }
.page-jump input {
  width: 58px; height: 28px; padding: 0 6px; border-radius: 7px;
  border: 1px solid var(--line); background: #0c1726; color: var(--text); font-size: 12px;
}
.pager .page-go { width: auto; padding: 0 10px; }
table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.sortable:hover { color: #cfe9ff; }
table.data th.sortable .sort-ind { margin-left: 4px; font-size: 10px; color: #55657a; }
table.data th.sortable.on { color: #7dd3fc; }
table.data th.sortable.on .sort-ind { color: #7dd3fc; }

/* --------------------------------------------------------------- 弹窗 / 提示 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 7, 14, .72);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: linear-gradient(170deg, #101c2e, #0b1524);
  border: 1px solid #24385a;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: fadeUp .22s ease;
}
.modal.wide { width: min(820px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head p { margin: 3px 0 0; color: var(--muted-2); font-size: 12px; }
.modal-close {
  background: none; border: 0; color: var(--muted-2); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 6px;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line-soft);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-tip { color: var(--muted-2); font-size: 11.5px; margin: -8px 0 14px; }
.pwd-check { margin: 2px 0 14px; }
.pwd-meter { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pwd-meter-bar {
  flex: 1; height: 6px; border-radius: 999px; background: #0a1422;
  border: 1px solid var(--line-soft); overflow: hidden;
}
.pwd-meter-bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  transition: width .2s ease, background .2s ease;
}
.pwd-meter[data-level="mid"] .pwd-meter-bar i { background: linear-gradient(90deg, #f59e0b, #22d3ee); }
.pwd-meter[data-level="high"] .pwd-meter-bar i { background: linear-gradient(90deg, #10b981, #22d3ee); }
.pwd-meter span { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.pwd-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.pwd-rules li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); }
.pwd-rules li::before {
  content: "○"; font-size: 10px; color: #3b5170; line-height: 1;
}
.pwd-rules li.ok { color: #8fd8c4; }
.pwd-rules li.ok::before { content: "✓"; color: var(--ok); }
.code-block {
  background: #060d18;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  color: #9fd6e8;
  overflow-x: auto;
  white-space: pre;
  position: relative;
}
.code-block .copy {
  position: absolute; right: 8px; top: 7px;
  background: #0d1a2b; border: 1px solid var(--line);
  color: var(--muted); border-radius: 6px; font-size: 10.5px;
  padding: 2px 8px; cursor: pointer;
}
.code-block .copy:hover { color: var(--accent); }
.toast-root {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 240px; max-width: 380px;
  background: #0f1d30;
  border: 1px solid #27405f;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 11px 15px;
  box-shadow: var(--shadow);
  font-size: 12.5px; color: #d6e5f7;
  animation: slideIn .2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* --------------------------------------------------------------- 其它 */
.empty {
  padding: 48px 20px; text-align: center; color: var(--muted-2); font-size: 12.5px;
}
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; fill: #2c405c; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #0a1422; border: 1px solid var(--line); border-radius: 10px; width: fit-content; }
.tabs button {
  background: none; border: 0; color: var(--muted); padding: 7px 16px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px;
}
.tabs button.on { background: #16263c; color: #eaf6ff; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .2); }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; background: #22334b;
  transition: .2s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  border-radius: 50%; background: #8ba0ba; transition: .2s;
}
.switch input:checked + span { background: rgba(34, 211, 238, .35); }
.switch input:checked + span::after { transform: translateX(17px); background: var(--accent); box-shadow: 0 0 8px rgba(34, 211, 238, .8); }
.info-list { display: grid; gap: 10px; }
.info-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-soft); }
.info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.info-row span:first-child { color: var(--muted); }
.info-row span:last-child { color: #d6e5f7; text-align: right; word-break: break-all; }
.stat-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  background: #0a1524; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.stat-pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.qr-box { background: #fff; padding: 10px; border-radius: 10px; width: 190px; }
.qr-box svg { width: 100%; height: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help-text { color: var(--muted-2); font-size: 12px; margin: 6px 0 0; }
.settings-section { display: grid; gap: 18px; }
.settings-card { padding: 20px; }
.settings-card h4 { margin: 0 0 16px; font-size: 13.5px; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.right { margin-left: auto; }
.w-100 { width: 100%; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@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); }
}

@media (max-width: 1180px) {
  .grid.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; max-width: 520px; gap: 26px; }
  .auth-brand { display: none; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 72px; }
  .brand-text, .nav a span, .nav-sep, .sidebar-foot .ver { display: none; }
  .brand { justify-content: center; padding: 18px 10px; }
  .nav a { justify-content: center; padding: 12px; }
  .nav-badge { position: absolute; top: 4px; right: 6px; margin: 0; }
  .nav a.active::before { display: none; }
  .nav-collapse { display: none; }
  .sidebar-foot { justify-content: center; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .pwd-banner { margin-left: 16px; margin-right: 16px; }
  .grid.two-even { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.kpi-grid { grid-template-columns: 1fr; }
  .user-meta, .chev { display: none; }
  .topbar { padding: 12px 14px; }
  .view { padding: 16px 14px 40px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .modal-mask { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .input { min-width: 100%; }
}
