﻿/* ============================================================
   聚合监控 - 亮色运维控制台设计系统
   单文件设计系统：所有颜色/间距/圆角走 CSS 变量，禁止硬编码
   （换主题只改 :root 与本文件少量语义别名，JS 不含颜色）
   ============================================================ */

:root {
  color-scheme: light;

  /* 背景层级 */
  --bg-0: #ffffff;            /* 顶栏 */
  --bg-1: #f5f7fa;            /* 页面背景 */
  --bg-2: #ffffff;            /* 卡片 */
  --bg-3: #f1f5f9;            /* 卡片内浮起/表头 */
  --bg-4: #e9eef4;            /* 悬停 */
  --bg-inset: #e9eef5;        /* 内嵌区域/进度轨道 */

  /* 边框 */
  --border: #dbe2ea;
  --border-soft: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-accent: rgba(5, 150, 105, 0.45);

  /* 文字 */
  --text-1: #1e293b;
  --text-2: #475569;
  --text-3: #64748b;

  /* 语义色 */
  --accent: #059669;           /* 主色 深绿（白底可读） */
  --accent-strong: #047857;    /* 强调文字用更深一档 */
  --accent-bright: #10b981;    /* 渐变亮端 */
  --accent-dim: rgba(5, 150, 105, 0.10);
  --blue: #2563eb;
  --blue-dim: rgba(37, 99, 235, 0.08);
  --orange: #d97706;
  --orange-dim: rgba(217, 119, 6, 0.10);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.08);
  --gold: #ca8a04;

  /* 等级色（进度条/仪表） */
  --lv-ok: var(--accent);
  --lv-warn: var(--orange);
  --lv-crit: var(--red);

  /* 交互 */
  --on-accent: #ffffff;                       /* 主色按钮上的文字 */
  --focus-ring: 0 0 0 3px rgba(5, 150, 105, 0.15);
  --accent-border: rgba(5, 150, 105, 0.4);   /* 主色系边框 */
  --red-border: rgba(220, 38, 38, 0.4);       /* 危险系边框 */
  --row-hover: #f8fafc;                       /* 表格行悬停 */

  /* 间距（4px 网格） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* 圆角 */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;

  /* 阴影（极轻，替代深色描边营造层次） */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 1px rgba(5, 150, 105, 0.18), 0 4px 14px rgba(5, 150, 105, 0.10);

  /* 过渡 */
  --tr-fast: 140ms ease;
  --tr-mid: 300ms cubic-bezier(0.25, 0.8, 0.35, 1);
  --tr-slow: 650ms cubic-bezier(0.25, 0.8, 0.35, 1);

  /* 字体 */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;

  /* 布局 */
  --topbar-h: 52px;
  --content-max: 1680px;
}

/* ---------------- 基础 ---------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

::selection { background: rgba(5, 150, 105, 0.22); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: #b6c2d2; }

/* 通用数字等宽（监控数字跳动必需） */
.num, .stat-value, .sv-metric b, .gauge-val, .rank-value, .tbl-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------------- 布局壳：顶栏 + 内容 ---------------- */

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--sp-5);
  height: var(--topbar-h);
  padding: 0 var(--sp-5);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-1); white-space: nowrap; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, var(--accent), #0284c7 130%);
  box-shadow: 0 1px 4px var(--accent-border);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 2px;
  background: var(--bg-0);
}

.nav { display: flex; align-items: center; gap: var(--sp-1); height: 100%; flex: 1; min-width: 0; overflow-x: auto; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; height: 100%;
  padding: 0 14px; color: var(--text-2); font-size: 14px; white-space: nowrap;
  transition: color var(--tr-fast); cursor: pointer; border: none; background: none;
}
.nav-link:hover { color: var(--text-1); }
.nav-link.active { color: var(--accent-strong); font-weight: 600; }
.nav-link.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-border);
}

.topbar-right { display: flex; align-items: center; gap: var(--sp-3); white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.topbar-user .avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent-strong);
  font-size: 12px; font-weight: 700;
}

.main {
  flex: 1; width: 100%; max-width: var(--content-max);
  margin: 0 auto; padding: var(--sp-5);
}

.page { animation: page-in 260ms ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px var(--accent-border); }
.page-sub { color: var(--text-3); font-size: 12.5px; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--bg-0); color: var(--text-1); font-size: 13.5px; cursor: pointer;
  transition: background var(--tr-fast), border-color var(--tr-fast), transform var(--tr-fast), box-shadow var(--tr-fast);
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border-color: var(--accent-border); color: var(--on-accent); font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(180deg, #34d399, var(--accent)); border-color: var(--accent-strong); box-shadow: 0 2px 10px var(--accent-border); }

.btn-danger { background: transparent; border-color: var(--red-border); color: var(--red); }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-1); border-color: var(--border); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--r-sm); }

.btn-loading { pointer-events: none; opacity: 0.6; }
.btn-loading::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 输入 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-2); }
.input, .select {
  width: 100%; padding: 9px 12px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-1); font-size: 14px; font-family: inherit;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  outline: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { border-color: var(--border-accent); box-shadow: var(--focus-ring); }
.select { cursor: pointer; }

.form-error { color: var(--red); font-size: 12.5px; min-height: 18px; }
.form-ok { color: var(--accent-strong); font-size: 12.5px; }

/* 分段控件（排序/时间窗） */
.seg { display: inline-flex; background: var(--bg-3); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg-btn {
  border: none; background: transparent; color: var(--text-2);
  padding: 5px 12px; font-size: 12.5px; border-radius: 5px; cursor: pointer;
  transition: all var(--tr-fast); white-space: nowrap;
}
.seg-btn:hover { color: var(--text-1); }
.seg-btn.active { background: var(--bg-0); color: var(--accent-strong); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-border), var(--shadow-1); }

/* 指标选择 chip */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--bg-0); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12.5px; transition: all var(--tr-fast); user-select: none;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.chip.active { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent-strong); font-weight: 600; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.chip.disabled { opacity: 0.4; cursor: not-allowed; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
  background: var(--bg-4); color: var(--text-2); white-space: nowrap;
}
.badge-green { background: var(--accent-dim); color: var(--accent-strong); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-gray { background: var(--bg-3); color: var(--text-3); }

/* 国别徽章 */
.cc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 18px; padding: 0 5px;
  border-radius: 4px; border: 1px solid rgba(37, 99, 235, 0.3);
  background: var(--blue-dim); color: var(--blue);
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px; flex: none;
}

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--bg-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--sp-5); }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: var(--sp-4); display: flex; align-items: center; gap: 8px; }

/* ---------------- Toast ---------------- */

#toasts {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 14px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: min(360px, calc(100vw - 28px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.98); border: 1px solid var(--border);
  box-shadow: var(--shadow-2); color: var(--text-1); font-size: 13px;
  animation: toast-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
  border-left: 3px solid var(--text-3);
}
.toast-out { animation: toast-out 200ms ease forwards; }
.toast-error { border-left-color: var(--red); }
.toast-success { border-left-color: var(--accent); }
.toast-info { border-left-color: var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------------- 模态框 ---------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in 160ms ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 420px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  padding: var(--sp-5); animation: modal-in 200ms cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: var(--sp-3); }
.modal-body { color: var(--text-2); font-size: 13.5px; margin-bottom: var(--sp-5); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.modal .field { margin-bottom: var(--sp-4); }

/* ---------------- 登录页 ---------------- */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 720px 480px at 18% 8%, rgba(5, 150, 105, 0.07), transparent 60%),
    radial-gradient(ellipse 640px 520px at 85% 90%, rgba(37, 99, 235, 0.06), transparent 60%),
    var(--bg-1);
}
.login-card {
  width: 100%; max-width: 380px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  box-shadow: var(--shadow-2);
  animation: modal-in 320ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.login-brand .brand-mark::after { inset: 12px; border-radius: 4px; }
.login-brand h1 { font-size: 22px; letter-spacing: 2px; }
.login-brand .page-sub { letter-spacing: 3px; }
.login-card .field { margin-bottom: var(--sp-4); }
.captcha-row { display: flex; gap: var(--sp-2); }
.captcha-row .input { flex: 1; min-width: 0; }
.captcha-img {
  height: 40px; width: 118px; flex: none; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-0);
  cursor: pointer; display: block;
}
.login-hint { text-align: center; margin-top: var(--sp-4); color: var(--text-3); font-size: 12px; }
.login-hint b { color: var(--text-2); font-weight: 600; }

/* ---------------- 总览：统计条 ---------------- */

.stat-bar {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.stat-cell {
  position: relative; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-1);
}
.stat-cell::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cell-c, var(--accent)); opacity: 0.85;
}
.stat-label { font-size: 12px; color: var(--text-3); letter-spacing: 1px; }
.stat-value {
  font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--text-1);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--text-3); }
.stat-value .sub { font-size: 14px; color: var(--text-2); font-weight: 600; }
.stat-value.c-accent { color: var(--accent-strong); }
.stat-value.c-blue { color: var(--blue); }
.stat-value.c-orange { color: var(--orange); }
.stat-value.c-red { color: var(--red); }

/* 面板健康胶囊 */
.panel-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.panel-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-2); cursor: default;
  transition: border-color var(--tr-fast);
}
.panel-pill .pname { color: var(--text-1); font-weight: 600; }
.panel-pill .lat { font-variant-numeric: tabular-nums; }
.panel-pill.ok:hover { border-color: var(--border); }
.panel-pill.bad { border-color: var(--red-border); background: var(--red-dim); color: var(--red); }
.panel-pill.bad .pname { color: var(--red); }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }
.pulse-dot.gray { background: var(--text-3); }
.pulse-dot.red { background: var(--red); }
.pulse-dot.breath { animation: breath 2.2s ease-out infinite; }
@keyframes breath {
  0% { box-shadow: 0 0 0 0 var(--accent-border); }
  70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* ---------------- 总览：分组卡片墙 ---------------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.toolbar .label { font-size: 12.5px; color: var(--text-3); }

.panel-section { margin-bottom: var(--sp-6); }
.panel-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4);
  font-size: 15px; font-weight: 700; color: var(--text-1);
  padding-left: 12px; position: relative;
}
.panel-head::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
  border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px var(--accent-border);
}
.panel-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--red-dim); border: 1px solid var(--red-border); border-radius: var(--r-md);
  padding: 10px 16px; margin-bottom: var(--sp-4); color: var(--red); font-size: 13px;
}
.panel-banner b { font-weight: 700; }

.group-block { margin-bottom: var(--sp-5); }
.group-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.group-head::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.group-count {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--bg-3); border: 1px solid var(--border-soft);
  padding: 1px 8px; border-radius: var(--r-pill); font-variant-numeric: tabular-nums;
}

.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: var(--sp-3); }

/* 服务器卡片 */
.sv-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: transform var(--tr-mid), border-color var(--tr-fast), box-shadow var(--tr-fast), opacity var(--tr-mid);
}
.sv-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.sv-card.offline { opacity: 0.55; filter: saturate(0.4); }
.sv-card.offline:hover { opacity: 0.8; }

.sv-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sv-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 600;
}
.sv-platform { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-offline-tag { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.sv-bars { display: flex; flex-direction: column; gap: 7px; }
.mini-bar { display: grid; grid-template-columns: 34px 1fr 52px; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); }
.mini-bar .k { letter-spacing: 0.5px; }
.mini-bar .track { height: 5px; background: var(--bg-inset); border-radius: 3px; overflow: hidden; }
.mini-bar .fill {
  height: 100%; border-radius: 3px; width: 0%;
  background: var(--lv-ok); transition: width var(--tr-slow), background var(--tr-slow);
}
.mini-bar .fill.lv-warn { background: var(--lv-warn); }
.mini-bar .fill.lv-crit { background: var(--lv-crit); }
.mini-bar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

.sv-net {
  display: flex; gap: var(--sp-4); padding-top: 9px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.sv-net span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.sv-net .arr { font-weight: 700; font-size: 12px; }
.sv-net .in .arr { color: var(--blue); }
.sv-net .out .arr { color: var(--accent-strong); }

/* ---------------- 详情页 ---------------- */

.detail-head { display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; margin-bottom: var(--sp-5); }
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-name { font-size: 19px; font-weight: 700; }
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 22px;
  margin-top: var(--sp-3); width: 100%;
}
.info-item { min-width: 0; }
.info-item .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 1px; }
.info-item .v { font-size: 13px; color: var(--text-1); word-break: break-all; font-variant-numeric: tabular-nums; }
.info-item .v.mono { font-family: var(--mono); font-size: 12.5px; }

.gauge-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.gauge-cell {
  flex: 1 1 130px; min-width: 130px; max-width: 220px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3);
}
.gauge { position: relative; width: 118px; height: 118px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--bg-inset); stroke-width: 9; }
.gauge .bar {
  fill: none; stroke: var(--lv-ok); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset var(--tr-slow), stroke var(--tr-slow);
}
.gauge .bar.lv-warn { stroke: var(--lv-warn); }
.gauge .bar.lv-crit { stroke: var(--lv-crit); }
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.gauge-val { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge-val .u { font-size: 11px; font-weight: 500; color: var(--text-3); }
.gauge-sub { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gauge-label { font-size: 12px; color: var(--text-2); }

.quick-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.quick-num {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.quick-num .k { font-size: 12px; color: var(--text-3); }
.quick-num .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.quick-num .v.in { color: var(--blue); }
.quick-num .v.out { color: var(--accent-strong); }

/* 负载三段 */
.load-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.load-row .k { width: 52px; color: var(--text-3); flex: none; }
.load-row .track { flex: 1; height: 7px; background: var(--bg-inset); border-radius: 4px; overflow: hidden; }
.load-row .fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent)); border-radius: 4px; width: 0; transition: width var(--tr-slow); }
.load-row .v { width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); flex: none; }

/* 图表区 */
.chart-section { margin-bottom: var(--sp-5); }
.chart-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.chart-box { position: relative; height: 320px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: var(--sp-4); }
.chart-box canvas, .chart-box svg.svg-chart { width: 100%; height: 100%; display: block; }

.chart-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; background: rgba(255, 255, 255, 0.6); border-radius: var(--r-md); }
.chart-loading::before {
  content: ""; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%;
  border: 2.5px solid var(--text-3); border-top-color: transparent; animation: spin 0.8s linear infinite;
}

.empty-state {
  padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 13.5px;
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: var(--r-md);
}

/* ---------------- 排行榜 ---------------- */

.rank-tabs { margin-bottom: var(--sp-4); }
.rank-list { display: flex; flex-direction: column; gap: 7px; }
.rank-row {
  display: grid; grid-template-columns: 44px 1fr minmax(180px, 320px) 90px;
  align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--border-soft);
  transition: border-color var(--tr-fast), transform var(--tr-fast);
  cursor: pointer;
}
.rank-row:hover { border-color: var(--border-accent); transform: translateX(2px); }
.rank-row.offline { opacity: 0.5; }
.rank-no { font-size: 15px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: center; }
.rank-no.top1 { color: var(--gold); }
.rank-no.top2 { color: #94a3b8; }
.rank-no.top3 { color: var(--orange); }
.rank-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar-wrap { height: 8px; background: var(--bg-inset); border-radius: 4px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); width: 0; transition: width var(--tr-slow); }
.rank-bar.lv-warn { background: linear-gradient(90deg, var(--orange-dim), var(--orange)); }
.rank-bar.lv-crit { background: linear-gradient(90deg, var(--red-dim), var(--red)); }
.rank-value { text-align: right; font-size: 13px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }

/* ---------------- 服务监控 ---------------- */

.svc-stats { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.svc-stat {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: 10px 18px;
}
.svc-stat .num { font-size: 20px; font-weight: 700; }

.svc-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.svc-card {
  display: grid; grid-template-columns: minmax(200px, 1.3fr) 2fr auto; gap: var(--sp-4);
  align-items: center;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5); cursor: pointer;
  transition: border-color var(--tr-fast), transform var(--tr-fast);
}
.svc-card:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.svc-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-target { font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }

/* 30 格条纹图 */
.stripes { display: flex; gap: 2.5px; align-items: flex-end; justify-content: flex-end; }
.stripe { width: 6px; height: 24px; border-radius: 2px; background: var(--bg-4); transition: transform var(--tr-fast); position: relative; cursor: default; }
.stripe.up { background: var(--accent); opacity: 0.9; }
.stripe.down { background: var(--red); }
.stripe.mixed { background: linear-gradient(180deg, var(--red) 0 45%, var(--accent) 45% 100%); }
.stripe:hover { transform: scaleY(1.12); }

.stripe-tip {
  position: fixed; z-index: 220; pointer-events: none;
  background: rgba(255, 255, 255, 0.98); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 6px 10px; font-size: 12px; color: var(--text-1); white-space: nowrap;
  box-shadow: var(--shadow-2); font-variant-numeric: tabular-nums;
}
.stripe-tip .t-sub { color: var(--text-3); font-size: 11px; }

/* 服务详情 */
.svc-detail-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
.svbars { display: flex; flex-direction: column; gap: 8px; }
.svbar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 76px; gap: 12px; align-items: center; font-size: 12.5px; }
.svbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.svbar-track { height: 10px; background: var(--bg-inset); border-radius: 5px; overflow: hidden; }
.svbar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent-border), var(--accent)); transition: width var(--tr-slow); }
.svbar-fill.bad { background: linear-gradient(90deg, var(--red-border), var(--red)); }
.svbar-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 9px 12px; color: var(--text-2); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border); background: var(--bg-3); white-space: nowrap;
}
.tbl th:first-child { border-radius: var(--r-sm) 0 0 0; }
.tbl th:last-child { border-radius: 0 var(--r-sm) 0 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-1); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--row-hover); }
.tbl .tbl-num { font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--r-md); }

/* ---------------- 面板管理 ---------------- */

.panels-layout { display: grid; grid-template-columns: 380px 1fr; gap: var(--sp-5); align-items: start; }
.panel-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  transition: border-color var(--tr-fast);
}
.panel-item:hover { border-color: var(--border); }
.panel-item .p-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-item .p-url { font-size: 12px; color: var(--text-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.panel-item .p-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.panels-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.test-result { border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px; margin-top: 10px; display: none; }
.test-result.ok { display: block; background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent-strong); }
.test-result.bad { display: block; background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red); }

/* ---------------- 工具类 ---------------- */

.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.mono { font-family: var(--mono); }
.loading-block { padding: 50px; text-align: center; color: var(--text-3); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1280px) {
  .stat-bar { grid-template-columns: repeat(3, 1fr); }
  .panels-layout { grid-template-columns: 1fr; }
  .sv-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 768px) {
  .main { padding: var(--sp-3); }
  .topbar { padding: 0 var(--sp-3); gap: var(--sp-3); }
  .topbar-user .uname { display: none; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 21px; }
  .sv-grid { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 34px 1fr 100px; }
  .rank-row .rank-bar-wrap { display: none; }
  .svc-card { grid-template-columns: 1fr; gap: 10px; }
  .stripes { justify-content: flex-start; }
  .chart-box { height: 240px; }
  .gauge-cell { flex: 1 1 45%; max-width: none; }
  .login-card { padding: var(--sp-6) var(--sp-5); }
  .page-title { font-size: 16px; }
}

/* 动效弱化 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
