/* ==========================================================================
   SDN 校园网管理平台 · 设计系统
   参考：华为 iMaster NCE 新 GUI / 锐捷 INC / H3C 网管 的视觉规范
   结构：深色侧边栏 + 浅色工作区 + 高密度数据表 + 4~6px 小圆角
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 品牌 */
  --accent:        #1668dc;
  --accent-hover:  #0f57c4;
  --accent-soft:   rgba(22, 104, 220, .08);
  --accent-ring:   rgba(22, 104, 220, .18);
  --accent-grad:   linear-gradient(135deg, #2a7bef 0%, #1668dc 100%);

  /* 语义色 */
  --success:      #12a150;
  --success-soft: rgba(18, 161, 80, .1);
  --warning:      #e8830c;
  --warning-soft: rgba(232, 131, 12, .1);
  --danger:       #e53e3e;
  --danger-soft:  rgba(229, 62, 62, .1);
  --purple:       #722ed1;
  --purple-soft:  rgba(114, 46, 209, .1);
  --cyan:         #0d9aa8;
  --cyan-soft:    rgba(13, 154, 168, .1);

  /* 中性色（浅色工作区） */
  --bg:            #eff2f7;
  --panel:         #ffffff;
  --panel-2:       #f7f9fc;
  --panel-3:       #f2f5fa;
  --border:        #e3e8f0;
  --border-strong: #cfd7e3;
  --text:          #161d2b;
  --text-2:        #4a5568;
  --text-dim:      #8592a5;

  /* 侧边栏（深色，两套主题都保持深色） */
  --side-bg:       #1a2332;
  --side-bg-2:     #16202d;
  --side-text:     #94a3b8;
  --side-text-hi:  #ffffff;
  --side-hover:    rgba(255, 255, 255, .05);
  --side-border:   rgba(255, 255, 255, .07);
  --side-active:   #1668dc;

  /* 图表 */
  --chart-text:  #8592a5;
  --chart-axis:  #d8dfea;
  --chart-split: #eef2f8;

  /* 尺寸 */
  --radius:    5px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --side-w:    228px;
  --side-w-min: 60px;
  --top-h:     52px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 2. 深色主题 ---------- */
[data-theme="dark"] {
  --bg:            #0e1319;
  --panel:         #171e28;
  --panel-2:       #1b2430;
  --panel-3:       #202a37;
  --border:        #27323f;
  --border-strong: #35434f;
  --text:          #e6edf3;
  --text-2:        #b0bccb;
  --text-dim:      #7d8b9c;

  --accent:        #3b82f6;
  --accent-hover:  #2f6fe0;
  --accent-soft:   rgba(59, 130, 246, .12);
  --accent-ring:   rgba(59, 130, 246, .22);

  --success:      #2fbf71;
  --success-soft: rgba(47, 191, 113, .13);
  --warning:      #e0a916;
  --warning-soft: rgba(224, 169, 22, .13);
  --danger:       #ef4444;
  --danger-soft:  rgba(239, 68, 68, .13);
  --purple:       #a855f7;
  --purple-soft:  rgba(168, 85, 247, .13);
  --cyan:         #22c1d6;
  --cyan-soft:    rgba(34, 193, 214, .13);

  --side-bg:      #0c1118;
  --side-bg-2:    #0a0f15;
  --side-border:  rgba(255, 255, 255, .06);

  --chart-text:  #7d8b9c;
  --chart-axis:  #2c3746;
  --chart-split: #222b37;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
}

/* ---------- 3. 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
svg.ico { width: 16px; height: 16px; stroke: currentColor; fill: none;
          stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
          flex-shrink: 0; display: block; }
svg.ico.lg { width: 20px; height: 20px; }
svg.ico.sm { width: 13px; height: 13px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 4. 布局骨架 ---------- */
.app { min-height: 100vh; }

/* 4.1 侧边栏 */
.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0;
  z-index: 60;
  transition: width .18s ease;
  border-right: 1px solid rgba(0, 0, 0, .25);
}
.brand {
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--side-border);
  overflow: hidden; white-space: nowrap;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(22, 104, 220, .45);
}
.brand-mark svg.ico { width: 15px; height: 15px; stroke: #fff; stroke-width: 2; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.brand-txt small { color: #64748b; font-size: 10.5px; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 16px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-group { padding: 0 10px; margin-bottom: 4px; }
.nav-group-label {
  color: #566272; font-size: 10.5px; font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase;
  padding: 12px 10px 6px; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--side-text); font-size: 13px;
  transition: background .14s, color .14s;
  position: relative; white-space: nowrap;
}
.nav-item:hover { background: var(--side-hover); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(22,104,220,.95), rgba(22,104,220,.72));
  color: var(--side-text-hi); font-weight: 500;
  box-shadow: 0 2px 10px rgba(22, 104, 220, .3);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: #7fb2ff;
}
.nav-item .ico { opacity: .9; }
.nav-item.active .ico { opacity: 1; }
.nav-item .badge-mini {
  margin-left: auto; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 600; display: none;
  align-items: center; justify-content: center;
}
.nav-item .badge-mini.show { display: flex; }

.sidebar-foot {
  border-top: 1px solid var(--side-border);
  padding: 10px;
  color: #64748b; font-size: 11px;
}
.side-status {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  white-space: nowrap; overflow: hidden;
}
.side-status .txt { font-size: 11px; color: #8fa0b5; }

/* 折叠态 */
.sidebar.collapsed { width: var(--side-w-min); }
.sidebar.collapsed .brand-txt,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span.txt,
.sidebar.collapsed .nav-item .badge-mini,
.sidebar.collapsed .side-status .txt { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .brand { justify-content: center; padding: 0; }
.sidebar.collapsed .side-status { justify-content: center; }
.sidebar.collapsed + .main { margin-left: var(--side-w-min); }

/* 4.2 主区 */
.main {
  min-height: 100vh;
  margin-left: var(--side-w);
  display: flex; flex-direction: column;
  transition: margin-left .18s ease;
}
.main > .topbar { width: auto; }

/* 顶栏 */
.topbar {
  height: var(--top-h); flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px 0 12px;
  position: sticky; top: 0; z-index: 50;
}
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius);
  border: none; background: transparent; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .14s, color .14s;
  position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 500; }
.crumb .sep { color: var(--border-strong); }

.search-wrap { position: relative; margin-left: 8px; width: 260px; }
.search-wrap svg.ico { position: absolute; left: 9px; top: 8px; color: var(--text-dim); width: 14px; height: 14px; }
.search-wrap input {
  width: 100%; height: 30px; padding: 0 10px 0 29px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text); font-size: 12.5px; outline: none;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input:focus { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-pop {
  position: absolute; top: 36px; left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 4px; display: none; z-index: 70;
}
.search-pop.show { display: block; }
.search-pop a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 4px; font-size: 12.5px; color: var(--text-2);
}
.search-pop a:hover { background: var(--accent-soft); color: var(--accent); }
.search-pop .none { padding: 10px; text-align: center; color: var(--text-dim); font-size: 12px; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 11.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; white-space: nowrap;
}
.mode-chip.mock { background: var(--warning-soft); color: var(--warning); }
.mode-chip .dot { width: 6px; height: 6px; }
.clock { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.dot-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 1.5px solid var(--panel);
}
.dot-badge.show { display: flex; }
.v-split { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }

.user-chip {
  display: flex; align-items: center; gap: 8px; height: 32px;
  padding: 0 8px 0 4px; border-radius: 16px; cursor: pointer;
  transition: background .14s; position: relative;
}
.user-chip:hover { background: var(--panel-3); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.user-chip .name { font-size: 12.5px; color: var(--text-2); }
.user-menu {
  position: absolute; right: 0; top: 38px; min-width: 190px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 5px; display: none; z-index: 70;
}
.user-menu.show { display: block; }
.user-menu .hd { padding: 9px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu .hd b { display: block; font-size: 13px; }
.user-menu .hd small { color: var(--text-dim); font-size: 11.5px; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; cursor: pointer;
  border-radius: 4px; font-size: 12.5px; color: var(--text-2); text-align: left;
}
.user-menu a:hover, .user-menu button:hover { background: var(--panel-3); color: var(--text); }
.user-menu .danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 页面容器 */
.page { padding: 14px 16px 26px; flex: 1; min-width: 0; }
.page-hd { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.page-hd .ttl { min-width: 0; }
.page-hd h1 { font-size: 19px; font-weight: 600; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.page-hd p { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; }
.page-hd .hd-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 底部状态栏 */
.statusbar {
  height: 28px; flex-shrink: 0;
  background: var(--panel); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; font-size: 11.5px; color: var(--text-dim);
  position: sticky; bottom: 0; z-index: 40;
}
.statusbar .sb-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.statusbar .sb-right { margin-left: auto; display: flex; gap: 16px; }

/* ---------- 5. 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 14px; overflow: hidden;
}
.card-hd {
  height: 44px; padding: 0 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.card-hd h3 {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.card-hd h3::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: var(--accent); flex-shrink: 0;
}
.card-hd .sub { font-size: 11.5px; color: var(--text-dim); font-weight: 400; }
.card-hd .hd-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-bd { padding: 14px; }
.card-bd.tight { padding: 0; }
.card-bd.pad-v { padding: 14px 0; }

/* 分栏 */
.row { display: grid; gap: 14px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-2-1 { grid-template-columns: 1.5fr 1fr; }
.row-1-2 { grid-template-columns: 1fr 1.5fr; }

/* ---------- 6. KPI 指标卡 ---------- */
.kpi {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 13px 14px; position: relative; overflow: hidden;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); opacity: .9;
}
.kpi.green::after { background: var(--success); }
.kpi.yellow::after { background: var(--warning); }
.kpi.red::after { background: var(--danger); }
.kpi.purple::after { background: var(--purple); }
.kpi.cyan::after { background: var(--cyan); }
.kpi.gray::after { background: var(--text-dim); }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-ico {
  margin-left: auto; width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); flex-shrink: 0;
}
.kpi.green .kpi-ico { background: var(--success-soft); color: var(--success); }
.kpi.yellow .kpi-ico { background: var(--warning-soft); color: var(--warning); }
.kpi.red .kpi-ico { background: var(--danger-soft); color: var(--danger); }
.kpi.purple .kpi-ico { background: var(--purple-soft); color: var(--purple); }
.kpi.cyan .kpi-ico { background: var(--cyan-soft); color: var(--cyan); }
.kpi.gray .kpi-ico { background: var(--panel-3); color: var(--text-dim); }
.kpi-val {
  font-size: 27px; font-weight: 600; letter-spacing: -.6px;
  line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums;
}
.kpi-val small { font-size: 12px; font-weight: 500; color: var(--text-dim); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.kpi-foot .up { color: var(--danger); }
.kpi-foot .down { color: var(--success); }
.kpi-foot .ok { color: var(--success); }
.kpi-foot .bad { color: var(--danger); }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: all .14s; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(22,104,220,.3); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-default { background: var(--panel); border-color: var(--border-strong); color: var(--text-2); }
.btn-default:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.08); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.btn-sm { height: 24px; padding: 0 9px; font-size: 11.5px; gap: 4px; }
.btn-sm svg.ico { width: 12px; height: 12px; }
.btn-lg { height: 36px; padding: 0 18px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 8. 表单 ---------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block; font-size: 12px; color: var(--text-2);
  font-weight: 500; margin-bottom: 5px;
}
.field .hint { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 30px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--text); font-size: 12.5px;
  outline: none; transition: border-color .14s, box-shadow .14s;
}
select { padding-right: 26px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238592a5' stroke-width='2.4' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled, input[readonly] { background: var(--panel-3); color: var(--text-dim); cursor: not-allowed; }
input::placeholder { color: var(--text-dim); }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .field { margin-bottom: 0; }
.toolbar .field > label { font-size: 11.5px; margin-bottom: 3px; }

/* 开关 */
.switch { position: relative; width: 38px; height: 21px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border-strong);
  border-radius: 11px; cursor: pointer; transition: background .18s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* ---------- 9. 表格 ---------- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  background: var(--panel-2); color: var(--text-2);
  font-size: 11.5px; font-weight: 600; text-align: left;
  padding: 8px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
table.tbl td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
table.tbl tbody tr:hover td { background: var(--panel-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td b, table.tbl td strong { color: var(--text); font-weight: 600; }
table.tbl .nowrap { white-space: nowrap; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .center { text-align: center; }
.tbl-empty { text-align: center; color: var(--text-dim); padding: 28px 12px !important; font-size: 12.5px; }

/* ---------- 10. 标签 / 状态 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: 3px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--panel-3); color: var(--text-2);
}
.tag.green  { background: var(--success-soft); color: var(--success); }
.tag.red    { background: var(--danger-soft);  color: var(--danger); }
.tag.yellow { background: var(--warning-soft); color: var(--warning); }
.tag.blue   { background: var(--accent-soft);  color: var(--accent); }
.tag.purple { background: var(--purple-soft);  color: var(--purple); }
.tag.cyan   { background: var(--cyan-soft);    color: var(--cyan); }
.tag.gray   { background: var(--panel-3);      color: var(--text-dim); }
.tag.line   { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.green  { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.red    { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-soft); animation: pulse 1.6s infinite; }
.dot.yellow { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot.gray   { background: var(--text-dim); }
.dot.blue   { background: var(--accent); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--danger-soft); }
  50%      { box-shadow: 0 0 0 6px rgba(229, 62, 62, .04); }
}
.pill-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* 端口小方块阵列 */
.port-grid { display: flex; gap: 3px; flex-wrap: wrap; }
.port-cell {
  width: 20px; height: 18px; border-radius: 2px; cursor: default;
  background: var(--success); opacity: .85;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff; font-weight: 600;
}
.port-cell.blocked { background: var(--warning); }
.port-cell.storm { background: var(--danger); }
.port-cell.down { background: var(--border-strong); color: var(--text-dim); }

/* ---------- 11. 进度条 / 计量条 ---------- */
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.meter > i.green { background: var(--success); }
.meter > i.yellow { background: var(--warning); }
.meter > i.red { background: var(--danger); }
.meter .mark {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: #fff; opacity: .95; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-row .meter { flex: 1; }

/* ---------- 12. 图例 ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.sw.dash {
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px);
  height: 2px;
}

/* ---------- 13. 图表容器 ---------- */
.chart { width: 100%; }
.chart-280 { height: 280px; }
.chart-300 { height: 300px; }
.chart-340 { height: 340px; }
.chart-520 { height: 520px; }
#topo-canvas, #tree-canvas { border-radius: var(--radius); }
.chart-card-bd { padding: 8px 6px 4px; }

/* ---------- 14. 空状态 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 34px 16px; color: var(--text-dim); font-size: 12.5px;
}
.empty svg.ico { width: 26px; height: 26px; opacity: .45; }

/* ---------- 15. AI 对话 ---------- */
.chat-box {
  height: 430px; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--panel-2);
}
.msg { max-width: 82%; display: flex; gap: 9px; }
.msg .bubble {
  padding: 9px 13px; border-radius: 8px; white-space: pre-wrap;
  line-height: 1.7; font-size: 12.5px; color: var(--text);
  border: 1px solid var(--border); background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.msg .ava {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.msg.bot .ava { background: linear-gradient(135deg, #6d5efc, #1668dc); color: #fff; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg.user .ava { background: var(--panel-3); color: var(--text-2); }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--panel); }
.chat-input input { height: 34px; flex: 1; width: auto; min-width: 0; }
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.chip {
  height: 24px; padding: 0 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text-2); font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px;
  transition: all .14s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 16. 提示 / 通知 ---------- */
.toast-stack { position: fixed; top: 62px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 240px; max-width: 380px; padding: 11px 13px;
  background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--text); animation: toastIn .22s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.error .t-ico { color: var(--danger); }
.toast .t-ico { color: var(--success); margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* 内联提示条 */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text-2);
  font-size: 12px; line-height: 1.6;
}
.notice svg.ico { color: var(--accent); margin-top: 1px; }
.notice.warn { background: var(--warning-soft); }
.notice.warn svg.ico { color: var(--warning); }
.notice.danger { background: var(--danger-soft); }
.notice.danger svg.ico { color: var(--danger); }

/* ---------- 17. 描述列表 ---------- */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 12.5px; }
.dl dt { color: var(--text-dim); white-space: nowrap; }
.dl dd { color: var(--text); word-break: break-all; }
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-dim); }
.kv-row .v { color: var(--text); font-weight: 500; }

/* ---------- 18. 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex;
  background: var(--bg);
}
.login-left {
  flex: 1.05; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0b1a30 0%, #123a6b 55%, #1668dc 100%);
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 60px; color: #fff;
}
.login-left::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(120, 190, 255, .28), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(80, 140, 255, .22), transparent 45%);
}
.login-grid {
  position: absolute; inset: 0; opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 78%);
}
.login-left .inner { position: relative; z-index: 2; max-width: 460px; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 38px; }
.login-brand .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
.login-brand .brand-mark svg.ico { width: 19px; height: 19px; }
.login-brand b { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.login-left h2 { font-size: 30px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.login-left h2 em { font-style: normal; color: #7fb6ff; }
.login-left .lead { margin-top: 14px; color: rgba(255,255,255,.72); font-size: 13.5px; line-height: 1.85; }
.login-feats { margin-top: 34px; display: flex; flex-direction: column; gap: 13px; }
.login-feat { display: flex; align-items: flex-start; gap: 11px; }
.login-feat .fi {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.login-feat .fi svg.ico { width: 14px; height: 14px; }
.login-feat b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.login-feat span { font-size: 12px; color: rgba(255,255,255,.62); line-height: 1.5; }
.login-right {
  width: 460px; flex-shrink: 0; background: var(--panel);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.login-card { width: 100%; max-width: 320px; }
.login-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 5px; }
.login-card .sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 26px; }
.login-card .field > label { font-size: 12px; }
.login-card input { height: 38px; font-size: 13px; }
/* 登录页输入框初始带 readonly（阻止浏览器自动填充），
   这里覆盖全局的“禁用”灰底与 not-allowed 光标，保持可编辑的外观 */
.login-card input[readonly] {
  background: var(--panel); color: var(--text); cursor: text;
}
.login-card .btn { height: 38px; font-size: 13.5px; }
@media (max-width: 980px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
}

/* ---------- 19. 工具类 ---------- */
.muted { color: var(--text-dim); }
.small { font-size: 11.5px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt { margin-top: 12px; }
.mt-sm { margin-top: 8px; }
.mb { margin-bottom: 12px; }
.ml-auto { margin-left: auto; }
.text-right { text-align: right; }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: none; }
.scroll-y { overflow-y: auto; }
.scroll-300 { max-height: 300px; overflow-y: auto; }
.nowrap { white-space: nowrap; }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1220px) {
  .row-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1080px) {
  .sidebar { width: var(--side-w-min); }
  .sidebar .brand-txt, .sidebar .nav-group-label,
  .sidebar .nav-item span.txt, .sidebar .nav-item .badge-mini,
  .sidebar .side-status .txt { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 0; }
  .sidebar .brand { justify-content: center; padding: 0; }
  .main { margin-left: var(--side-w-min); }
  .search-wrap { display: none; }
  .row-2, .row-3, .row-2-1, .row-1-2 { grid-template-columns: 1fr; }
  .clock { display: none; }
}
@media (max-width: 760px) {
  .page { padding: 12px; }
  .row-4 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .page-hd { flex-direction: column; }
  .page-hd .hd-actions { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   12. 网络拓扑视图（分层 SVG 拓扑）
   ========================================================================== */
.topo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.topo-side { display: flex; flex-direction: column; gap: 14px; }

.topo-card .card-hd { flex-wrap: wrap; row-gap: 8px; }
.topo-legend { gap: 14px; font-size: 11.5px; color: var(--text-dim); }
.topo-legend span { display: inline-flex; align-items: center; gap: 5px; }
.topo-legend .lg { width: 22px; height: 14px; flex: none; }

/* 画布 */
.topo-stage {
  position: relative;
  height: 596px;
  margin: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.topo-stage.grabbing { cursor: grabbing; }
#topo-svg { display: block; width: 100%; height: 100%; user-select: none; }

/* 工具条 */
.topo-tools {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.topo-tools button {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-2);
  transition: background .14s, color .14s;
}
.topo-tools button + button { border-top: 1px solid var(--border); }
.topo-tools button:hover { background: var(--accent-soft); color: var(--accent); }
.topo-tools button svg { width: 15px; height: 15px; }

/* 提示条 */
.topo-hint {
  position: absolute; left: 12px; bottom: 12px; z-index: 5;
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 11px; color: var(--text-dim);
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.topo-hint .ico { width: 12px; height: 12px; }

/* 迷你统计 */
.stat-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.stat-mini > div { background: var(--panel-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-mini b { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -.3px; line-height: 1.1; }
.stat-mini span { font-size: 11px; color: var(--text-dim); }

/* 设备详情头 */
.nd-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.nd-badge {
  width: 42px; height: 42px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
}
.nd-badge.core { background: var(--accent); color: #fff; }
.nd-badge.acc { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring); }
.nd-badge.host { background: var(--panel-3); color: var(--text-dim); border: 1px solid var(--border); }
.nd-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.nd-role { font-size: 11.5px; color: var(--text-dim); }

@media (max-width: 1180px) {
  .topo-layout { grid-template-columns: 1fr; }
  .topo-stage { height: 480px; }
}

/* 链路悬停详情浮层 */
.topo-tip {
  position: absolute; display: none; z-index: 8;
  width: 212px; padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 11.5px; color: var(--text-2);
  pointer-events: none;
}
.topo-tip .tt-hd {
  font-size: 12px; font-weight: 600; color: var(--text);
  padding-bottom: 7px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topo-tip .tt-ar { color: var(--text-dim); margin: 0 3px; }
.topo-tip .tt-row { display: flex; justify-content: space-between; padding: 2.5px 0; }
.topo-tip .tt-row b { color: var(--text); font-weight: 600; }

/* ==========================================================================
   二层环路状态条（风暴复现前置条件）
   正常：绿色，说明生成树已断环
   环路：红色，说明冗余链路已放通，可复现真实广播风暴
   ========================================================================== */
.loop-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, background .18s;
}
.loop-bar .loop-ico {
  flex: none;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}
.loop-bar .loop-ico .ico { width: 19px; height: 19px; }
.loop-main { flex: 1; min-width: 0; }
.loop-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  letter-spacing: .2px;
}
.loop-desc {
  margin-top: 3px;
  font-size: 12.5px; line-height: 1.6; color: var(--text-2);
}
.loop-desc b { color: var(--danger); font-weight: 600; }
.loop-act { flex: none; }
.loop-act .btn { white-space: nowrap; }

/* 环路模式：整条变红警示 */
.loop-bar.is-loop {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  animation: loopPulse 2.2s ease-in-out infinite;
}
.loop-bar.is-loop .loop-ico { background: rgba(229, 62, 62, .16); color: var(--danger); }
@keyframes loopPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50%      { box-shadow: 0 0 0 3px rgba(229, 62, 62, .12); }
}
@media (prefers-reduced-motion: reduce) {
  .loop-bar.is-loop { animation: none; }
}

/* ==========================================================================
   AI 回答的轻量 Markdown 排版（common.js 的 md() 生成，仅用于对话气泡与报告）
   ========================================================================== */
.md { white-space: normal; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md h4, .md h5, .md h6 {
  margin: 12px 0 6px;
  font-size: 13px; font-weight: 600; line-height: 1.5;
  color: var(--text); letter-spacing: .2px;
}
.md h4:first-child, .md h5:first-child, .md h6:first-child { margin-top: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin: 3px 0; padding-left: 2px; }
.md li::marker { color: var(--accent); }
.md b { color: var(--text); font-weight: 600; }
.md code {
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 11.5px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
}
.md blockquote {
  margin: 6px 0 10px;
  padding: 6px 0 6px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 4px 4px 0;
  color: var(--text-2);
  font-size: 12px;
}
.md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--border); }

/* 对话气泡里的段落更紧凑 */
.bubble.md p { margin: 0 0 6px; }
.bubble.md ul, .bubble.md ol { margin: 4px 0 6px; }

/* ---------- 20. 流量实验台 ---------- */
.lab-env { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.env-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); font-size: 12.5px; color: var(--text-dim);
}
.env-chip b { color: var(--text); font-weight: 600; }
.env-chip.ok { background: var(--success-soft); border-color: transparent; }
.env-chip.ok b, .env-chip.ok span { color: var(--success); }
.env-chip.bad { background: var(--danger-soft); border-color: transparent; }
.env-chip.bad b, .env-chip.bad span { color: var(--danger); }
.env-chip .dot { width: 6px; height: 6px; }

/* 主机多选网格 */
.host-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 4px; max-height: 172px; overflow: auto;
  padding: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2);
}
.host-item {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 7px; border-radius: 4px; cursor: pointer;
  font-size: 12px; color: var(--text-2);
}
.host-item:hover { background: var(--panel-3); color: var(--text); }
.host-item input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.host-item .ip { color: var(--text-dim); font-size: 10.5px; margin-left: auto; }

/* 终端风格日志 */
.lab-log {
  margin: 0; padding: 12px 14px; min-height: 96px; max-height: 300px; overflow: auto;
  background: #0e1726; color: #c3d2e3; border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-all;
}

/* ==========================================================================
   21. 3D 拓扑舞台（topology3d.html）
   --------------------------------------------------------------------------
   画布本身用深色背景：发光球体、流动粒子在浅色底上会糊成一片，
   深色底才有"立体 + 通电"的观感。侧栏仍跟随主题。
   ========================================================================== */
.v3d-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.v3d-side { display: flex; flex-direction: column; gap: 14px; }

.v3d-card { overflow: hidden; }
.v3d-card .card-hd { flex-wrap: wrap; row-gap: 8px; }

/* 图例 */
.v3d-legend { gap: 12px; font-size: 11.5px; color: var(--text-dim); }
.v3d-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot3d {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 6px currentColor;
}
.ln3d { width: 20px; height: 3px; border-radius: 2px; display: inline-block; }
.ln3d.hot { background: linear-gradient(90deg, #3f6b8f, #4fd6e8, #3f6b8f); box-shadow: 0 0 6px rgba(79,214,232,.7); }
.ln3d.block { background: repeating-linear-gradient(90deg, #5a6577 0 4px, transparent 4px 8px); }
.ln3d.storm { background: #ff5a5a; box-shadow: 0 0 8px rgba(255,90,90,.8); }

/* 舞台 */
.v3d-stage {
  position: relative;
  height: calc(100vh - 232px);
  min-height: 460px;
  background: #070c15;
  border-top: 1px solid var(--border);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
#v3d-canvas { display: block; width: 100%; height: 100%; }

.v3d-hint {
  position: absolute; right: 14px; bottom: 12px;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  background: rgba(10, 18, 32, .72);
  color: #7d8ba3; font-size: 11.5px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.v3d-hint .ico { width: 12px; height: 12px; }

.v3d-fail {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; background: rgba(7, 12, 21, .88);
  color: #ff9a9a; font-size: 13px; text-align: center; padding: 0 24px;
}
/* display:flex 会盖掉 HTML 的 hidden 属性，必须显式补一条，
   否则「读不到拓扑数据」这层永远消不掉（踩过） */
.v3d-fail[hidden] { display: none; }
.v3d-fail b { font-size: 14px; }

/* 设备详情的关联链路 */
.v3d-links { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.v3d-links-hd { font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; }
.v3d-lk {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 4px 0; color: var(--text-2);
}
.v3d-lk .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3d-lk .pp { color: var(--text-dim); font-variant-numeric: tabular-nums; flex: none; margin-left: 8px; }
.v3d-lk.hot .pp { color: var(--cyan); }
.v3d-lk.storm .pp { color: var(--danger); font-weight: 600; }
.v3d-lk.blocked .pp { color: var(--warning); }

/* 流量 TOP 榜 */
.v3d-top { display: flex; flex-direction: column; gap: 10px; }
.v3d-bar-hd {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; gap: 8px;
}
.v3d-bar-hd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3d-bar-hd b { color: var(--text); font-variant-numeric: tabular-nums; flex: none; }
.v3d-bar-track {
  height: 4px; border-radius: 3px; background: var(--panel-3); overflow: hidden;
}
.v3d-bar-track i {
  display: block; height: 100%; border-radius: 3px; transition: width .5s ease;
  background: linear-gradient(90deg, #6aa9e0, #4fd6e8);
}
.v3d-bar.hot .v3d-bar-track i { background: linear-gradient(90deg, #e8830c, #ffb454); }
.v3d-bar.storm .v3d-bar-track i { background: linear-gradient(90deg, #e53e3e, #ff7a7a); }
.v3d-bar.blocked .v3d-bar-track i { background: var(--border-strong); }

/* 读图说明 */
.v3d-note p {
  font-size: 12px; color: var(--text-2); line-height: 1.7; margin: 0 0 8px;
}
.v3d-note p:last-child { margin-bottom: 0; }

@media (max-width: 1180px) {
  .v3d-wrap { grid-template-columns: 1fr; }
  .v3d-stage { height: 520px; }
}

/* ---------- 备案信息 ---------- */
.icp-foot {
  position: fixed; left: 0; right: 0; bottom: 10px;
  text-align: center; font-size: 12px; color: var(--text-dim);
  z-index: 20; pointer-events: none;
}
.icp-foot .icp-note {
  font-size: 11.5px; margin-bottom: 5px; opacity: .82;
}
.icp-foot a {
  color: var(--text-dim); text-decoration: none; pointer-events: auto;
}
.icp-foot a:hover { color: var(--text-2); text-decoration: underline; }

.statusbar .sb-icp a { color: var(--text-dim); text-decoration: none; }
.statusbar .sb-icp a:hover { color: var(--text-2); text-decoration: underline; }
