﻿/* ============================================================
   AIOps · 主机监控运维平台
   设计语言：克制、扁平、专业的深色后台（参考 TDesign 暗色 / Linear）
   —— 单层中性色阶 · 统一 4px 间距栅格 · 克制的状态反馈 · 零外链
   ============================================================ */
/* 统一品牌 Token（与营销站 aiops-design-tokens.css 内容保持一致）
   此处内联而非 @import：面板经 Go embed 嵌入，静态路由仅精确匹配 /style.css，
   无 /aiops-design-tokens.css 路由，@import 会 404 导致全局 token 缺失。 */
:root{
  /* 品牌主色（统一蓝色家族 + 紫色辅色，消除割裂） */
  --accent:#4c8dff; --accent-hover:#6aa1ff; --accent-soft:rgba(76,141,255,.13);
  --accent2:#7c6bff; --accent2-soft:rgba(124,107,255,.13);
  /* 语义状态色 */
  --ok:#31c46b; --ok-soft:rgba(49,196,107,.12);
  --warn:#e8a13c; --warn-soft:rgba(232,161,60,.12);
  --crit:#ef4d5a; --crit-soft:rgba(239,77,90,.12);
  --info:#3fb5ef; --info-soft:rgba(63,181,239,.12);
  --purple:#8b5cf6; --purple-soft:rgba(139,92,246,.12);
  /* 圆角 / 阴影 / 过渡 / 间距 / 字体 / 渐变（统一） */
  --r-xs:6px; --r-sm:8px; --r:12px; --r-lg:16px; --r-xl:24px; --r-2xl:28px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow:0 4px 14px rgba(0,0,0,.30);
  --shadow-lg:0 12px 32px rgba(0,0,0,.42);
  --transition-fast:120ms cubic-bezier(.4,0,.2,1);
  --transition:200ms cubic-bezier(.4,0,.2,1);
  --transition-slow:320ms cubic-bezier(.4,0,.2,1);
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px;
  --sp-6:24px; --sp-8:32px; --sp-10:40px; --sp-12:48px; --sp-16:64px;
  --font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  --gradient:linear-gradient(135deg,var(--accent),var(--accent2));
  --gradient-soft:linear-gradient(135deg,var(--accent-soft),var(--accent2-soft));
  --max-w:1200px;
}
:root{
  /* 中性色阶（由深到浅：底 → 面 → 输入/悬停 → 轨道/激活） */
  --bg:#0a0d13; --bg2:#0d1119; --bg3:#111722;
  --side:#0b0e15;
  --panel:#111621; --panel2:#171d29; --panel3:#212836;
  --line:#212734; --line2:#2c3442;
  /* 悬停边框色（统一各处散乱的 #39424f） */
  --hover-border:#3d4654;
  /* 离线/未知灰（统一 #49525f / #556 / #8a93a3） */
  --gray-off:#4a5360; --gray-txt:#8a93a3;

  /* 文本 —— muted2 提亮至 #808a9c：在 --bg/--panel/--panel2 上均达 WCAG AA 4.5:1
     （旧值 #6b7588 仅 3.2–4.2:1 不达标），同时仍明显暗于 --muted 以保留层级。 */
  --txt:#e7ebf2; --txt2:#b3bccb; --muted:#8492a6; --muted2:#808a9c;

  /* 品牌主色（--accent 等）已在上方内联块引用共享 token（与营销站 aiops-design-tokens.css 一致）。
     此处仅保留面板专属辅助色（紫）与面板调校的语义色，确保面板视觉不被改变 */
  --accent2:#7c6bff; --accent2-soft:rgba(124,107,255,.13);
  --ok:#31c46b; --ok-soft:rgba(49,196,107,.12);
  --warn:#e8a13c; --warn-soft:rgba(232,161,60,.12);
  --crit:#ef4d5a; --crit-soft:rgba(239,77,90,.12);
  --info:#3fb5ef; --info-soft:rgba(63,181,239,.12);

  /* 语义文本色：在对应 soft/深底上可读的浅变体，统一各处散乱硬编码，保证同类色一致 */
  --accent-txt:#9bc0ff; --accent2-txt:#c1b2ff;
  --ok-txt:#7fe0a0; --warn-txt:#f2c078; --crit-txt:#ff9ba2; --info-txt:#9bd8f6;

  /* 功能色边框（统一各处散乱的 rgba 边框值） */
  --accent-border:rgba(76,141,255,.35);
  --accent2-border:rgba(124,107,255,.3);
  --ok-border:rgba(49,196,107,.3);
  --warn-border:rgba(232,161,60,.3);
  --crit-border:rgba(239,77,90,.3);
  --info-border:rgba(63,181,239,.3);

  /* 代码/终端专用色（统一散乱硬编码） */
  --cmd-bg:#080b11; --cmd-text:#7fe0a0; --cmd-warn-text:#f2c078;
  --term-bg:#05070b; --term-text:#d6dde8;

  /* 阴影（克制、层次分明，避免大面积重投影） */
  --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow:0 4px 14px rgba(0,0,0,.30);
  --shadow-lg:0 12px 32px rgba(0,0,0,.42);
  --shadow-xl:0 20px 56px rgba(0,0,0,.55);

  /* 过渡 */
  --transition-fast:120ms cubic-bezier(.4,0,.2,1);
  --transition:180ms cubic-bezier(.4,0,.2,1);
  --transition-slow:320ms cubic-bezier(.4,0,.2,1);

  /* 圆角（收紧，去掉"气泡感"） */
  --r-xs:6px; --r-sm:8px; --r:10px; --r-lg:14px; --r-xl:18px; --r-2xl:24px;

  /* 模糊 */
  --blur-sm:blur(6px); --blur:blur(10px); --blur-lg:blur(18px);

  /* 布局 —— .app 网格依赖此变量 */
  --sidew:236px;
  /* 触摸目标最小尺寸（Apple HIG 推荐 44px） */
  --touch-min:44px;
  /* 顶部导航栏背景（半透明 + 模糊） */
  --topbar-bg:rgba(10,13,19,.85);

  /* ---- 概览页专属设计 tokens（ov- 前缀，避免与全局变量冲突） ---- */
  --ov-card-shadow:0 1px 2px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.03);
  --ov-card-shadow-hover:0 6px 20px rgba(0,0,0,.32), 0 0 0 1px rgba(255,255,255,.06);
  --ov-card-lift:-3px;
  --ov-section-gap:24px;

  /* 语义化别名（v5.5.0 新增，增量美化） ---- */
  --surface:var(--panel);
  --surface-hover:var(--panel2);
  --border-subtle:var(--line);
  --border-strong:var(--line2);
  --text-primary:var(--txt);
  --text-secondary:var(--txt2);
  --text-tertiary:var(--muted);
  --elevation-1:var(--shadow-sm);
  --elevation-2:var(--shadow);
  --elevation-3:var(--shadow-lg);
  --elevation-4:var(--shadow-xl);

  /* ============================================================
     v6.35 设计系统增强 Token（专业运维视觉 · 纯增量，不覆盖上方既有值）
     ============================================================ */
  /* —— 字体 —— 展示/正文/等宽三分离，数字统一等宽对齐 —— */
  --font-mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  --fs-2xs:10px; --fs-xs:11px; --fs-sm:12px; --fs-base:13px; --fs-md:14px;
  --fs-lg:16px; --fs-xl:20px; --fs-2xl:24px; --fs-3xl:30px;
  --lh-tight:1.25; --lh-base:1.55; --lh-relaxed:1.72;
  /* 数字/指标专用：等宽数字避免跳动 */
  --num:tabular-nums;

  /* —— 焦点环（键盘可达性 · 统一 3px 软光环） —— */
  --ring-w:3px;
  --ring-color:var(--accent-soft);
  --ring:0 0 0 var(--ring-w) var(--ring-color);
  --ring-strong:0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* —— 层级（z-index 统一语义，避免魔法数字） —— */
  --z-base:1; --z-sticky:20; --z-topbar:40; --z-sidebar:60;
  --z-dropdown:200; --z-modal:400; --z-toast:500; --z-ai-panel:1100; --z-ai-mask:1200;

  /* —— 滚动条（细窄、低干扰、悬停提亮） —— */
  --sb-w:8px; --sb-h:8px;
  --sb-thumb:var(--panel3); --sb-thumb-hover:var(--gray-off);
  --sb-track:transparent; --sb-radius:99px;

  /* —— 发丝线 / 分隔（1px 物理像素线，克制分隔） —— */
  --hairline:1px solid var(--line);
  --hairline-strong:1px solid var(--line2);

  /* —— 状态色·调和（antd 暗色哲学：色相稳定、饱和度收敛、明度对齐）
        仅在既有四元组基础上微调，保证 ok/warn/crit/info 视觉权重一致 —— */
  --ok:#33c46f; --ok-soft:rgba(51,196,111,.12);
  --warn:#e8a13c; --warn-soft:rgba(232,161,60,.12);
  --crit:#ef5560; --crit-soft:rgba(239,85,96,.12);
  --info:#41b6ef; --info-soft:rgba(65,182,239,.12);

  /* —— 状态色·悬停加深（供按钮/徽章 hover 统一取用） —— */
  --ok-strong:#3ed47c; --warn-strong:#f0b055; --crit-strong:#f46b74; --info-strong:#5cc3f4;

  /* —— 表面抬升（悬停时轻微提亮的叠加层，替代各处散乱 rgba(255,255,255,.0x)） —— */
  --lift:rgba(255,255,255,.035);
  --lift-strong:rgba(255,255,255,.06);
  --press:rgba(0,0,0,.18);

  /* —— 顶栏/侧栏之外的全局内容底色微渐变（营造纵深，极克制） —— */
  --bg-grad:radial-gradient(1200px 500px at 78% -8%, rgba(76,141,255,.05), transparent 60%),
            radial-gradient(900px 420px at -6% 108%, rgba(124,107,255,.04), transparent 55%);
}

/* ---------- 浅色主题 ---------- */
[data-theme="light"]{
  --bg:#f5f7fa; --bg2:#ffffff; --bg3:#eef1f6;
  --side:#ffffff;
  --panel:#ffffff; --panel2:#f5f7fa; --panel3:#e8edf3;
  --line:#e0e4eb; --line2:#d1d7e0;
  --hover-border:#b8c0cc;
  --gray-off:#b0b8c4; --gray-txt:#8a93a3;

  /* muted2 加深至 #767f8e：旧值 #9ca5b5 在浅底上仅 2.1–2.5:1 严重不达标；
     受该浅色阶所限（--muted 自身在白底也仅 4.64:1），此值已尽量贴近 AA
     且仍浅于 --muted 以保留层级。 */
  --txt:#1a2332; --txt2:#4a5568; --muted:#6b7588; --muted2:#767f8e;

  /* 主色对齐 Ant Design 蓝 #1677ff（较原 #2563eb 更清亮、少靛蓝），hover 用 antd active 深蓝 */
  --accent:#1677ff; --accent-hover:#0958d9; --accent-soft:rgba(22,119,255,.10);
  --accent2:#7c3aed; --accent2-soft:rgba(124,58,237,.10);
  --ok:#16a34a; --ok-soft:rgba(22,163,74,.10);
  --warn:#d97706; --warn-soft:rgba(217,119,6,.10);
  --crit:#dc2626; --crit-soft:rgba(220,38,38,.10);
  --info:#0284c7; --info-soft:rgba(2,132,199,.10);

  --accent-txt:#0958d9; --accent2-txt:#6d28d9;
  --ok-txt:#15803d; --warn-txt:#b45309; --crit-txt:#b91c1c; --info-txt:#0369a1;

  --accent-border:rgba(22,119,255,.28);
  --accent2-border:rgba(124,58,237,.25);
  --ok-border:rgba(22,163,74,.25);
  --warn-border:rgba(217,119,6,.25);
  --crit-border:rgba(220,38,38,.25);
  --info-border:rgba(2,132,199,.25);

  --cmd-bg:#f0f2f5; --cmd-text:#15803d; --cmd-warn-text:#b45309;
  --term-bg:#1a1b1e; --term-text:#e4e7eb;

  --shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --shadow:0 4px 14px rgba(0,0,0,.08);
  --shadow-lg:0 12px 32px rgba(0,0,0,.10);
  --shadow-xl:0 20px 56px rgba(0,0,0,.12);
  /* 顶部导航栏背景（浅色模式：白色半透明 + 模糊） */
  --topbar-bg:rgba(255,255,255,.88);

  /* 概览页浅色主题覆盖 */
  --ov-card-shadow:0 1px 3px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  --ov-card-shadow-hover:0 6px 20px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.06);

  /* 语义化别名（浅色） */
  --surface:var(--panel);
  --surface-hover:var(--panel2);
  --border-subtle:var(--line);
  --border-strong:var(--line2);
  --text-primary:var(--txt);
  --text-secondary:var(--txt2);
  --text-tertiary:var(--muted);
  --elevation-1:var(--shadow-sm);
  --elevation-2:var(--shadow);
  --elevation-3:var(--shadow-lg);
  --elevation-4:var(--shadow-xl);

  /* ---- v6.35 设计系统增强 Token（浅色覆盖） ---- */
  --ring-color:rgba(22,119,255,.14);
  --ring:0 0 0 var(--ring-w) var(--ring-color);
  --ring-strong:0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --sb-thumb:#c6cdd8; --sb-thumb-hover:#a8b1bf;
  /* 状态色·浅色主题（antd 浅色标准，白底上均达 AA） */
  --ok:#18a058; --ok-soft:rgba(24,160,88,.10);
  --warn:#d98206; --warn-soft:rgba(217,130,6,.10);
  --crit:#dc3545; --crit-soft:rgba(220,53,69,.10);
  --info:#0b8fd9; --info-soft:rgba(11,143,217,.10);
  --ok-strong:#12814a; --warn-strong:#b56b04; --crit-strong:#b52a37; --info-strong:#0873b0;
  /* 表面抬升（浅色下用加深叠加） */
  --lift:rgba(15,30,60,.03);
  --lift-strong:rgba(15,30,60,.055);
  --press:rgba(15,30,60,.08);
  --bg-grad:radial-gradient(1200px 500px at 78% -8%, rgba(22,119,255,.045), transparent 60%),
            radial-gradient(900px 420px at -6% 108%, rgba(124,58,237,.035), transparent 55%);
}
*{box-sizing:border-box}
/* 全局表单元素重置：移除 iOS Safari / Android Chrome 默认的橙色/红色 outline、
   box-shadow 和 -webkit-appearance，防止 :focus / :invalid 状态出现“红框” */
/* 全局表单重置：checkbox/radio 保留原生渲染（依赖 accent-color），
   其余 input / select / textarea 移除默认外观以自定义 */
input:not([type="checkbox"]):not([type="radio"]),button,select,textarea{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  outline:none !important;
  box-shadow:none !important;
}
/* 恢复项目自定义 focus 样式（覆盖上面的全局重置） */
.field input:focus{box-shadow:0 0 0 3px var(--accent-soft) !important}
select:focus{box-shadow:0 0 0 3px var(--accent-soft) !important}
.search:focus{box-shadow:0 0 0 3px var(--accent-soft) !important}
/* 按钮保留 焦点环用于键盘导航 */
.btn:focus-visible{outline:2px solid var(--accent) !important; outline-offset:2px; box-shadow:none !important}

/* ===== 全局复选框 / 单选按钮（v5.3.1 可见性修复）===== */
input[type="checkbox"], input[type="radio"]{
  accent-color:var(--accent);
  width:16px; height:16px; cursor:pointer; flex:none; vertical-align:middle;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;
}
/* 复选框 hover 微反馈 */
input[type="checkbox"]:hover, input[type="radio"]:hover{
  filter:brightness(1.15);
}
/* 复选框选中态：增强勾选标记对比度 */
input[type="checkbox"]:checked{
  accent-color:var(--accent);
}
/* 禁用态 */
input[type="checkbox"]:disabled, input[type="radio"]:disabled{
  opacity:.45; cursor:not-allowed; filter:none;
}

/* ===== 全局 select 下拉选择框 =====
 * 关闭态由下方 .select-wrap / select 规则美化；打开态走操作系统原生弹出层。
 * 切勿给 option/optgroup 设置 background/color（尤其是 CSS 变量）——
 * Windows Chromium 下会导致弹出层 1–2 秒空白灰底（添加面板「单位」、数据源「类型」等均会触发）。
 * 主题色由 :root / [data-theme] 的 color-scheme 交给 OS 处理。 */
select option,
select optgroup{
  /* intentionally unstyled — native OS popup */
}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--txt); min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; font-size:13px; line-height:1.5;
}
.mono{font-variant-numeric:tabular-nums; font-feature-settings:"tnum"}

::-webkit-scrollbar{width:var(--sb-w);height:var(--sb-h)}
::-webkit-scrollbar-thumb{background:var(--sb-thumb);border-radius:var(--sb-radius);border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background:var(--sb-thumb-hover)}
::-webkit-scrollbar-track{background:var(--sb-track)}
*{scrollbar-width:thin;scrollbar-color:var(--sb-thumb) transparent}
/* 选中文本：品牌色软光晕，深浅底均可读 */
::selection{background:color-mix(in srgb, var(--accent) 32%, transparent);color:var(--txt)}

/* ---------- 应用骨架 ---------- */
.app{display:grid; grid-template-columns:var(--sidew) 1fr; min-height:100vh}

/* ---------- 侧边栏 ---------- */
.sidebar{
  position:sticky; top:0; height:100vh; display:flex; flex-direction:column;
  background:var(--side); border-right:1px solid var(--line); padding:18px 12px; z-index:60;
  transition:transform var(--transition), width var(--transition);
}
.brand{display:flex; align-items:center; gap:11px; padding:6px 8px 18px}
.logo{
  width:34px; height:34px; border-radius:9px; flex:none;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:14px; color:#fff; letter-spacing:.3px;
  /* 覆盖父级 .brand 的 background-clip:text 透明填充（否则会继承导致 “AI” 字消失，只剩图标底色），强制白色 */
  -webkit-text-fill-color:#fff;
}
.brand-txt h1{font-size:15px; margin:0; font-weight:650; letter-spacing:.2px}
.brand-txt .sub{font-size:11px; color:var(--muted); margin-top:2px}

.nav{display:flex; flex-direction:column; gap:2px; margin-top:2px}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:9px 12px;
  border-radius:var(--r-sm); color:var(--muted); text-decoration:none; cursor:pointer;
  transition:background var(--transition-fast), color var(--transition-fast);
  position:relative; font-weight:500; font-size:13px;
}
.nav-item:hover{ background:var(--panel2); color:var(--txt); }
.nav-item.active{ background:var(--accent-soft); color:var(--accent); font-weight:600; }
.nav-item.active::before{
  content:''; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:3px; height:18px; background:var(--accent); border-radius:0 3px 3px 0;
}
.nav-item svg{ width:18px; height:18px; flex:none; }
.nav-count{
  margin-left:8px; background:var(--panel3); color:var(--muted);
  font-size:11px; padding:1px 7px; border-radius:999px;
  font-weight:600; min-width:20px; text-align:center;
  display:none;
}
.nav-item.active .nav-count{ background:var(--accent); color:#fff; }

/* Grouped navigation: category headers + collapsible sections */
.nav-group{margin-top:11px; display:flex; flex-direction:column; gap:2px}
.nav-group-label{
  display:flex; align-items:center; gap:6px; width:100%; text-align:left;
  padding:6px 12px 5px; background:none; border:none; cursor:pointer;
  color:var(--muted2); font-size:10.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  transition:color var(--transition-fast); user-select:none;
}
.nav-group-label:hover{color:var(--muted)}
.nav-group-label .nav-caret{width:13px; height:13px; margin-left:auto; opacity:.65; transition:transform .2s}
.nav-group.collapsed .nav-caret{transform:rotate(-90deg)}
.nav-group-items{display:flex; flex-direction:column; gap:2px}
.nav-group.collapsed .nav-group-items{display:none}
/* Icon-only sidebar mode: drop category labels, keep item icons with a divider */
.app.collapsed .nav-group-label{display:none}
.app.collapsed .nav-group{margin-top:6px; padding-top:6px; border-top:1px solid var(--line)}
.app.collapsed .nav-group.collapsed .nav-group-items{display:flex} /* never hide items when only the label is hidden */

.side-actions{margin-top:auto; display:flex; flex-direction:column; gap:8px; padding-top:14px}
.btn.block{width:100%; justify-content:center}
.side-status{display:flex; flex-direction:column; align-items:center; gap:8px; padding-top:12px; border-top:1px solid var(--line); margin-top:6px}

/* 侧栏实时时钟 */
.side-clock{font-size:10px; color:var(--muted2); font-variant-numeric:tabular-nums; letter-spacing:.03em; font-family:ui-monospace,Menlo,Consolas,monospace; white-space:nowrap; line-height:1.4; text-align:center}
.app.collapsed .side-clock{font-size:8px; writing-mode:vertical-rl; text-orientation:mixed; letter-spacing:.06em}

/* ---------- 通用按钮 ---------- */
.btn{
  font-family:inherit; font-size:13px; color:var(--txt2);
  background:var(--panel2); border:1px solid var(--line2); border-radius:var(--r-sm);
  padding:8px 15px; cursor:pointer;
  transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  display:inline-flex; align-items:center; gap:7px; font-weight:500;
}
.btn:hover{border-color:var(--hover-border); background:var(--panel3); color:var(--txt)}
.btn:active{background:var(--line)}
.btn svg{width:16px; height:16px}

.btn.primary{ background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600 }
.btn.primary:hover{ background:var(--accent-hover); border-color:var(--accent-hover) }
.btn.primary:active{ background:#3f79e6 }

.btn.danger{ background:var(--crit-soft); border-color:var(--crit-border); color:var(--crit-txt); font-weight:600 }
.btn.danger:hover{ background:rgba(239,77,90,.2); border-color:var(--crit); color:var(--crit-txt) }
.btn.warn{ background:var(--warn-soft); border-color:var(--warn-border); color:var(--warn-txt); font-weight:600 }
.btn.warn:hover{ filter:brightness(1.05); border-color:var(--warn-txt) }
.btn:disabled, .btn.disabled{opacity:.4; cursor:not-allowed; pointer-events:none}

.btn.ghost{ background:transparent; border-color:transparent; color:var(--muted); font-size:15px; padding:6px 9px }
.btn.ghost:hover{ background:var(--panel2); color:var(--txt); border-color:transparent }

.pulse{width:10px; height:10px; border-radius:50%; background:var(--ok);
  box-shadow:0 0 6px 2px var(--ok-soft); animation:pulseBreath 2s ease-in-out infinite}
.pulse.off{background:var(--crit); box-shadow:0 0 6px 2px var(--crit-soft); animation:pulseBreathOff 2s ease-in-out infinite}
.pulse.paused{background:var(--warn); box-shadow:0 0 6px 2px var(--warn-soft); animation:pulseBreath 2s ease-in-out infinite}
@keyframes pulseBreath{0%,100%{opacity:1; transform:scale(1)}50%{opacity:.35; transform:scale(1.5)}}
@keyframes pulseBreathOff{0%,100%{opacity:1; transform:scale(1)}50%{opacity:.5; transform:scale(1.3)}}

/* ---------- 主内容 ---------- */
.main{min-width:0; display:flex; flex-direction:column}
.topbar{
  position:sticky; top:0; z-index:40; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 20px; min-height:52px; border-bottom:1px solid var(--line);
  background:var(--topbar-bg,rgba(10,13,19,.85)); backdrop-filter:var(--blur);
}
/* 顶栏图标按钮 — 32×32 紧凑无边框，悬停浅底 */
.tb-icon{
  display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; flex:none;
  background:transparent; border:none; border-radius:var(--r-sm);
  cursor:pointer; color:var(--muted); padding:0;
  transition:background .15s ease, color .15s ease;
}
.tb-icon:hover{background:var(--panel2); color:var(--txt)}
.tb-icon:active{background:var(--panel3)}
.tb-icon.active{background:var(--warn-soft); color:var(--warn)}
.tb-icon svg{width:18px; height:18px}
/* 顶栏 AI 对话入口：accent 色微突出（全局可达的智能助手入口） */
.tb-ai{color:var(--accent)}
.tb-ai:hover{background:var(--panel2); color:var(--accent)}
/* 顶栏语言切换 — 分段按钮组（简 / 繁 / EN） */
.tb-lang{
  display:inline-flex; align-items:center; flex:none;
  background:var(--panel2); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:2px; gap:2px;
}
.tb-lang-opt{
  min-width:30px; height:26px; padding:0 8px;
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; border:none; border-radius:calc(var(--r-sm) - 2px);
  color:var(--muted); cursor:pointer;
  font-size:12px; font-weight:600; font-family:inherit; line-height:1; white-space:nowrap;
  transition:background .15s ease, color .15s ease;
}
.tb-lang-opt:hover{background:var(--panel3); color:var(--txt)}
.tb-lang-opt.active{background:var(--accent); color:#fff}
.tb-lang-opt:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
@media (max-width:640px){ .tb-lang{display:none} }
/* 顶栏操作按钮 — 图标+文字紧凑样式 */
.tb-action{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--accent); border:none; border-radius:var(--r-sm);
  color:#fff; padding:6px 14px; cursor:pointer;
  font-size:13px; font-weight:500; font-family:inherit; white-space:nowrap;
  transition:background .15s ease;
}
.tb-action:hover{background:var(--accent-hover)}
.tb-action:active{background:#3f79e6}
.tb-action svg{width:15px; height:15px}
/* 顶栏头像按钮 */
.tb-avatar{
  display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; cursor:pointer; padding:0; flex:none;
}
.tb-avatar .avatar{
  width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; font-weight:700; font-size:12px; text-transform:uppercase;
  transition:box-shadow .15s ease;
}
.tb-avatar:hover .avatar{box-shadow:0 0 0 2px var(--accent-soft)}
/* 顶栏右侧工具组 */
.tb-right{display:flex; align-items:center; gap:8px; flex:none}
/* 安装 Agent 按钮左侧分隔线 */
#installBtn{margin-left:4px; position:relative}
#installBtn::before{content:""; position:absolute; left:-6px; top:50%; transform:translateY(-50%); width:1px; height:18px; background:var(--line); border-radius:1px}
/* 窄屏时隐藏安装按钮文字，仅保留图标 */
@media(max-width:900px){
  #installBtn span{display:none}
  #installBtn{padding:6px 10px; margin-left:0}
  #installBtn::before{display:none}
}
/* 页面头 */
.page-head{display:flex; flex-direction:column; gap:1px; min-width:0; margin-right:4px}
.page-title{font-size:15px; font-weight:600; letter-spacing:.2px; line-height:1.25}
.page-sub{font-size:11px; color:var(--muted); line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.spacer{flex:1}
.select-wrap{position:relative}
select{
  font-family:inherit; font-size:13px; color:var(--txt); background:var(--panel2);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 28px 8px 12px;
  cursor:pointer; appearance:none; transition:border-color var(--transition-fast);
}
select:hover{border-color:var(--hover-border); background:var(--panel3)}
select:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.select-wrap::after{content:"▾"; position:absolute; right:11px; top:50%; transform:translateY(-50%);
  color:var(--muted); pointer-events:none; font-size:10px}

/* 默认「标准」宽度：居中限宽；用户可切换到「宽屏」。 */
.content{padding:22px 24px 48px; max-width:1440px; width:100%; margin:0 auto;
  transition:max-width var(--transition)}
.app.wide .content{max-width:1720px}
section{scroll-margin-top:80px; margin-bottom:24px}

/* ---------- KPI 卡片 ---------- */
.cards{display:grid; grid-template-columns:repeat(6,1fr); gap:14px;
  margin-bottom:var(--ov-section-gap)}
.card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:16px 18px; display:flex; align-items:center; gap:14px; cursor:pointer;
  box-shadow:var(--ov-card-shadow);
  transition:transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.card:hover{
  border-color:var(--accent-border); background:var(--panel2);
  transform:translateY(var(--ov-card-lift));
  box-shadow:var(--ov-card-shadow-hover);
}
.card .ic{
  width:38px; height:38px; border-radius:9px; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--accent-soft); color:var(--accent);
}
.card .ic svg{width:19px; height:19px}
.card.ok .ic{background:var(--ok-soft); color:var(--ok)}
.card.warn .ic{background:var(--warn-soft); color:var(--warn)}
.card.crit .ic{background:var(--crit-soft); color:var(--crit)}
.card.info .ic{background:var(--info-soft); color:var(--info)}
.card .txt{min-width:0}
.card .v{font-size:23px; font-weight:700; line-height:1.1; letter-spacing:-.5px}
.card .k{font-size:12px; color:var(--muted); margin-top:2px}
/* KPI 卡片脉冲动画（告警数量增加时触发） */
.card.card-pulse{animation:cardPulse .6s ease-out}
@keyframes cardPulse{0%{box-shadow:0 0 0 0 var(--crit-soft), var(--ov-card-shadow)}50%{box-shadow:0 0 0 8px var(--crit-soft), 0 0 16px 2px var(--crit-soft)}100%{box-shadow:var(--ov-card-shadow)}}
.card.card-pulse-ok{animation:cardPulseOk .6s ease-out}
@keyframes cardPulseOk{0%{box-shadow:0 0 0 0 var(--ok-soft), var(--ov-card-shadow)}50%{box-shadow:0 0 0 8px var(--ok-soft), 0 0 16px 2px var(--ok-soft)}100%{box-shadow:var(--ov-card-shadow)}}
.v.ok{color:var(--ok)} .v.warn{color:var(--warn)} .v.crit{color:var(--crit)} .v.info{color:var(--info)}

/* ---------- 概览页区块标题 ---------- */
.section-title{
  font-size:13px; color:var(--txt); letter-spacing:.01em;
  margin:0 0 12px; font-weight:600; display:flex; align-items:center; gap:9px;
  flex-wrap:wrap; row-gap:10px;
}
.section-title .tag{font-weight:500; font-size:11px;
  color:var(--muted); background:var(--panel2); border:1px solid var(--line); border-radius:5px; padding:1px 7px}
.count-pill{background:var(--panel2); color:var(--muted); border:1px solid var(--line);
  border-radius:999px; font-size:11px; padding:1px 9px; font-weight:600; margin-left:0}
.stack{display:flex; flex-direction:column; gap:7px; contain:content}
.row-item{
  display:flex; align-items:center; gap:11px; padding:12px 14px; border-radius:var(--r-sm);
  border:1px solid var(--line); border-left:3px solid var(--line2); background:var(--panel);
  font-size:13px; min-height:42px; transition:border-color var(--transition-fast), background var(--transition-fast);
}
/* 新行入场动画（差量更新插入时触发） */
.row-item.row-enter{animation:rowEnter .35s ease-out}
@keyframes rowEnter{from{opacity:0; transform:translateY(-6px)}to{opacity:1; transform:translateY(0)}}
/* 行延迟移除淡出动画（宽限期内数据恢复则取消） */
.row-item.row-leaving{opacity:0; pointer-events:none; transition:opacity .3s ease-out}
.row-item:hover{ border-color:var(--line2); background:var(--panel2) }
.row-item.critical{ border-left-color:var(--crit) }
.row-item.warning{ border-left-color:var(--warn) }
.row-item.info{ border-left-color:var(--info) }
.row-item strong{flex:none; font-weight:600}
.row-item .msg{color:var(--txt2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1 1 auto; min-width:0}
.row-item.log-row .log-user{
  flex:0 0 112px; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  color:var(--txt2); font-weight:600; font-size:12px;
}
.row-item.log-row .src.log-ip{
  margin-left:0; flex:0 0 128px; max-width:160px; overflow:hidden; text-overflow:ellipsis;
  color:var(--muted2); font-size:12px; white-space:nowrap;
}
.row-item.log-row .log-time{flex:none; color:var(--muted2); font-size:11px}
.badge{ font-size:11px; padding:2px 9px; border-radius:5px; font-weight:600; flex:none }
.badge.critical{ background:var(--crit-soft); color:var(--crit-txt); border:1px solid var(--crit-border) }
.badge.warning{ background:var(--warn-soft); color:var(--warn-txt); border:1px solid var(--warn-border) }
.badge.info{ background:var(--info-soft); color:var(--info-txt); border:1px solid var(--info-border) }
/* Execution status variants (used by playbook exec results + history rows). */
.badge.ok{ background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border) }
.badge.crit{ background:var(--crit-soft); color:var(--crit-txt); border:1px solid var(--crit-border) }
.badge.warn{ background:var(--warn-soft); color:var(--warn-txt); border:1px solid var(--warn-border) }
.badge.high{ background:rgba(255,140,66,.14); color:#e07030; border:1px solid rgba(255,140,66,.35) }
/* 告警状态标签与操作按钮 */
.badge.status-badge{font-size:10px; padding:1px 7px; border-radius:4px; margin-left:-2px}
.badge.status-ack{background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border)}
.badge.status-silence{background:rgba(132,146,166,.12); color:var(--muted); border:1px solid rgba(132,146,166,.25)}
.alert-actions{display:flex; gap:4px; margin-left:auto; flex:none}
.alert-action{background:none; border:1px solid var(--line); border-radius:4px; padding:2px 6px;
  font-size:12px; cursor:pointer; color:var(--muted); line-height:1; transition:all var(--transition-fast)}
.alert-action:hover{color:var(--txt); border-color:var(--line2); background:var(--panel2)}
.alert-action[data-action="clear"]:hover{color:var(--ok)}
.alert-action[data-action="silence"]:hover{color:var(--warn)}
.row-item.status-acknowledged{opacity:.55}
.row-item.status-silenced{opacity:.45}
.src{font-size:11px; color:var(--muted2); margin-left:auto; flex:none; white-space:nowrap}
.log-time{font-size:11px; color:var(--muted2); flex:none; white-space:nowrap; margin-left:8px; font-variant-numeric:tabular-nums}
.empty-line{color:var(--muted2); font-size:13px; padding:16px; text-align:center;
  border:1px dashed var(--line2); border-radius:var(--r-sm)}

/* ---------- 主机分组 ---------- */
.group{margin-bottom:6px}
.group-head{display:flex; align-items:center; gap:10px; margin:20px 0 12px}
.group-head:first-child{margin-top:0}
.group-head .dot-cat{width:7px; height:7px; border-radius:2px; background:var(--accent)}
.group-head .cat{font-size:13px; font-weight:650}
.group-head .line{flex:1; height:1px; background:var(--line)}

/* 响应式网格：auto-fill + minmax 自适应，卡片自然流动 */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px}
.host{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:14px 16px; transition:border-color var(--transition-fast), background var(--transition-fast);
  position:relative; cursor:pointer; display:flex; flex-direction:column;
  min-height:240px;
}
.host:hover{ border-color:var(--accent); background:var(--panel2) }
.host-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; min-width:0}
/* 标题优先：名字先拿到宽度，标签行只在剩余空间里收缩（分组徽标自己会省略号）。
   两侧都写 flex:1 的时候，标签行会把标题压到 0——主机名会整个消失。 */
.host-name{display:flex; align-items:center; gap:8px; min-width:6.5em; flex:1 1 auto; overflow:hidden}
.dot{width:8px; height:8px; border-radius:50%; flex:none; transition:all .3s}
.dot.on{background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft); animation:dotPulse 2s ease-in-out infinite}
.dot.off{background:var(--crit); box-shadow:0 0 0 3px var(--crit-soft); animation:dotPulseRed 2s ease-in-out infinite}
@keyframes dotPulse{
  0%,100%{box-shadow:0 0 0 3px var(--ok-soft)}
  50%{box-shadow:0 0 0 5px var(--ok-soft), 0 0 8px var(--ok)}
}
@keyframes dotPulseRed{
  0%,100%{box-shadow:0 0 0 3px var(--crit-soft)}
  50%{box-shadow:0 0 0 5px var(--crit-soft), 0 0 8px var(--crit)}
}
.hn{font-weight:650; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer}
.hn:hover{color:var(--accent)}
.host-tags{display:flex; align-items:center; gap:5px; flex:0 1 auto; min-width:0; justify-content:flex-end; overflow:hidden}
.os-badge{font-size:9.5px; padding:2px 6px; border-radius:4px; background:var(--panel3); color:var(--muted); font-weight:600; letter-spacing:.02em; flex:none; white-space:nowrap}
.agent-ver{font-size:9.5px; padding:2px 6px; border-radius:4px; font-weight:600; letter-spacing:.02em; font-variant-numeric:tabular-nums; background:var(--panel3); color:var(--muted)}
.agent-ver.ok{background:var(--ok-soft, var(--accent-soft)); color:var(--ok-txt, var(--accent-txt))}
.agent-ver.outdated{background:var(--warn-soft); color:var(--warn-txt)}
.agent-ver.unknown{background:var(--panel3); color:var(--muted)}
.agent-sel{display:inline-flex; align-items:center; margin-right:4px; cursor:pointer; flex:none}
.agent-sel input{margin:0; cursor:pointer; width:14px; height:14px}
.agent-sel.spacer{width:14px; pointer-events:none}
.agent-update-bar{display:flex; flex-direction:column; gap:8px; background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--txt);
  border-radius:var(--r-sm); padding:8px 12px; margin:0 0 var(--sp-3); font-size:12px}
.agent-update-inner{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px}
.agent-update-actions{display:flex; flex-wrap:wrap; gap:6px; margin-left:auto}
.agent-job{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding-top:8px; border-top:1px solid var(--line2); color:var(--txt2)}
.agent-job .mono{font-size:11px}
.host.outdated-agent, .host.hrow.outdated-agent{box-shadow:inset 0 0 0 1px var(--warn-border)}
/* Category/folder paths are often long — ellipsis keeps OS/Agent/actions visible. */
.cat-badge{font-size:9.5px; padding:2px 7px; border-radius:4px; background:var(--accent-soft); color:var(--accent-txt);
  font-weight:600; cursor:pointer; border:1px solid transparent;
  max-width:7.5em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  flex:0 1 auto; min-width:0; display:inline-block; vertical-align:middle; line-height:1.35}
.cat-badge:hover{border-color:var(--accent-border)}
.agent-ver,.term-btn,.desktop-btn,.x-btn{flex:none}
.x-btn{width:22px; height:22px; border-radius:5px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center;
  padding:0; flex:none; opacity:0; transition:opacity var(--transition-fast), background var(--transition-fast); font-size:11px}
.host:hover .x-btn{opacity:1}
.x-btn:hover{background:var(--crit-soft); color:var(--crit-txt); border-color:var(--crit-border)}

/* 指标：紧凑行，4px 进度条 */
.metric{ margin:6px 0 }
.metric .row{display:flex; justify-content:space-between; align-items:baseline; font-size:11.5px; margin-bottom:3px; gap:8px}
.metric .row .label{color:var(--muted); font-weight:500; flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.metric .row .val{color:var(--txt2); font-weight:600; font-variant-numeric:tabular-nums; text-align:right;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-shrink:1; min-width:0}
.bar{ height:4px; background:var(--panel3); border-radius:2px; overflow:hidden; position:relative }
.fill{ height:100%; border-radius:2px; transition:width var(--transition-slow), background var(--transition) }

.loadline{display:flex; gap:6px; margin:8px 0 4px; padding-top:8px; border-top:1px solid var(--line)}
.load-cell{flex:1; background:var(--bg2); border:1px solid var(--line); border-radius:var(--r-xs); padding:5px 6px; text-align:center}
.load-cell .lv{font-size:13px; font-weight:650; font-variant-numeric:tabular-nums}
.load-cell .lk{font-size:9px; color:var(--muted2); margin-top:1px}

/* Custom (plugin) metrics: a clearly separated, labeled section of subtle pills
   consistent with the card pill language — keeps the info but reduces clutter. */
.chips{display:flex; flex-wrap:wrap; gap:5px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line)}
.chip{font-size:10px; padding:2px 8px; border-radius:999px; background:var(--panel3); color:var(--txt2); border:1px solid var(--line)}
.chip b{color:var(--info-txt); font-weight:700}
.chip.crit b{color:var(--crit-txt)}
.chip.crit{border-color:var(--crit-border)}
.chip-label{font-size:9px; color:var(--muted2); width:100%; order:-1; letter-spacing:.05em; text-transform:uppercase}

.foot{display:flex; justify-content:space-between; gap:8px; font-size:10px; color:var(--muted);
  margin-top:auto; padding-top:8px; border-top:1px solid var(--line); flex-wrap:wrap}
.foot .g{display:flex; align-items:center; gap:4px}

.empty{text-align:center; padding:56px 20px; color:var(--muted); border:1px dashed var(--line2); border-radius:var(--r)}
.empty code{background:var(--panel2); padding:3px 9px; border-radius:6px; color:var(--txt);
  font-family:ui-monospace,Menlo,Consolas,monospace}
.empty b{color:var(--txt)}

/* ---------- 弹窗 ---------- */
.mask{
  position:fixed; inset:0; background:rgba(4,6,10,.72);
  /* 不用 backdrop-filter：与原生 <select> 弹出层叠加时，Windows 上会出现空白灰底闪烁 */
  display:none; align-items:flex-start; justify-content:center;
  z-index:400; padding:44px 16px; overflow:auto; animation:fadeIn .16s ease;
}
.mask.show{display:flex}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal{
  background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-lg);
  width:100%; max-width:600px; box-shadow:var(--shadow-xl); animation:modalIn .18s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn{from{transform:translateY(8px); opacity:0}to{transform:none; opacity:1}}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--line)}
.modal-head h3{margin:0; font-size:15px; font-weight:650}
.modal-body{padding:18px 20px; max-height:74vh; overflow:auto}
.modal-foot{display:flex; gap:10px; justify-content:flex-end; padding:14px 20px; border-top:1px solid var(--line)}
.field{margin-bottom:14px}
.field > label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px; font-weight:500}
/* 所有文本类输入统一样式（含 number/email/search/tel/url 等；排除 checkbox/radio）。
   此前仅 text/password 被样式化，导致端口转发等 number 输入框沿用浏览器默认外观而显丑。 */
.field input:not([type=checkbox]):not([type=radio]){width:100%; font-family:inherit; font-size:13px; color:var(--txt);
  background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:9px 11px;
  transition:border-color var(--transition-fast), box-shadow var(--transition-fast)}
/* 去除 number 输入的原生上下箭头（Chrome/Safari/Firefox），与其它输入保持一致简洁外观 */
.field input[type=number]{-moz-appearance:textfield}
.field input[type=number]::-webkit-outer-spin-button,
.field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none; margin:0}
.field input::placeholder{color:var(--muted2)}
.field input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.switch{display:flex; align-items:center; gap:9px; cursor:pointer; font-size:13px; user-select:none; color:var(--txt2)}
.switch.mb{margin-bottom:12px}
.switch input{width:16px; height:16px; accent-color:var(--accent)}
.subhead{font-size:12px; color:var(--muted); letter-spacing:.02em;
  font-weight:600; margin:18px 0 12px; padding-top:16px; border-top:1px solid var(--line)}
/* Leading section header (no divider above — the modal head already bounds it). */
.subhead.subhead-first{margin-top:0; padding-top:0; border-top:none}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.hint{font-size:11px; color:var(--muted2); margin-top:6px; line-height:1.55}
/* 历史降级警告：曲线来自内存缓存、重启即丢，必须比普通 hint 更显眼。 */
.hint.history-src-warn{color:var(--warn-txt,#f2c078); background:var(--warn-soft); border:1px solid var(--warn);
  border-radius:var(--r-sm,6px); padding:7px 10px; margin:8px 0 0; font-size:12px}
.spark{margin-top:6px}
svg.sparkline{width:100%; height:46px; display:block}

/* 安装弹窗 */
.token-row{display:flex; gap:6px; align-items:stretch}
.token-row input{flex:1; min-width:0}
/* Token 行操作按钮：眼睛(显示/隐藏) + 重置，统一图标风格 */
.token-action-btn{
  flex:none; width:36px; display:flex; align-items:center; justify-content:center;
  background:var(--panel2); border:1px solid var(--line2); border-radius:var(--r-sm);
  color:var(--muted); cursor:pointer; padding:0;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast)
}
.token-action-btn:hover{color:var(--txt); border-color:var(--hover-border); background:var(--panel3)}
.token-action-btn:active{transform:translateY(1px)}
.token-action-btn svg{width:16px; height:16px}
.token-action-btn:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.tabs{display:flex; gap:2px; margin:4px 0 16px; border-bottom:1px solid var(--line)}
.tab{background:none; border:none; color:var(--muted); font-family:inherit; font-size:13px;
  padding:9px 14px; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;
  transition:color var(--transition-fast)}
.tab:hover{color:var(--txt)}
.tab.active{color:var(--accent); border-bottom-color:var(--accent); font-weight:600}
.tab-panel{display:none}
.tab-panel.active{display:block}
/* Forward modal mode tabs */
.fwd-wl-details{margin:10px 0 12px;border:1px solid var(--line2);border-radius:var(--r-sm);padding:0 12px;background:var(--bg2)}
.fwd-wl-details>summary{cursor:pointer;padding:10px 0;color:var(--txt);font-size:13px;font-weight:500;list-style:none}
.fwd-wl-details>summary::-webkit-details-marker{display:none}
.fwd-wl-details>summary::before{content:"▸ ";color:var(--muted)}
.fwd-wl-details[open]>summary::before{content:"▾ "}
.fwd-wl-body{padding:0 0 12px}
.fwd-mode-tabs{display:flex; gap:0; margin:0 0 18px; border:1px solid var(--line2); border-radius:var(--r-sm); overflow:hidden}
.fwd-mode-tab{flex:1; background:var(--bg2); border:none; color:var(--muted); font-family:inherit; font-size:13px;
  padding:10px 16px; cursor:pointer; text-align:center; transition:all var(--transition-fast);
  border-right:1px solid var(--line2)}
.fwd-mode-tab:last-child{border-right:none}
.fwd-mode-tab:hover{color:var(--txt); background:var(--panel)}
.fwd-mode-tab.active{color:#fff; background:var(--accent); font-weight:600}
.cmd-row{display:flex; gap:8px; align-items:stretch}
.cmd-row .btn{flex:none}
.cmd{flex:1; margin:0; background:var(--cmd-bg); border:1px solid var(--line2); border-radius:var(--r-sm);
  padding:11px 13px; color:var(--cmd-text); font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:12.5px; line-height:1.5; white-space:pre-wrap; word-break:break-all; overflow-x:auto;
  cursor:pointer; user-select:all; -webkit-user-select:all}
.cmd.cmd-warn{color:var(--cmd-warn-text)}
.relay-toggle{display:flex !important; align-items:center; gap:8px; cursor:pointer}
.relay-toggle input[type=checkbox]{width:auto; accent-color:var(--accent)}
.relay-toggle span{font-size:13px; color:var(--txt)}

/* Install mode radio-button row */
.install-mode-row{display:flex; gap:8px; flex-wrap:wrap}
.install-mode-opt{
  display:flex; align-items:flex-start; gap:8px; cursor:pointer; font-size:13px; color:var(--txt);
  flex:1; min-width:148px; padding:10px 12px; border:1px solid var(--line2); border-radius:var(--r-sm);
  background:var(--panel2); transition:border-color .15s ease, background .15s ease, box-shadow .15s ease}
.install-mode-opt:hover{border-color:var(--hover-border); background:var(--panel)}
.install-mode-opt:has(input:checked){
  border-color:var(--accent-border); background:var(--accent-soft);
  box-shadow:inset 0 0 0 1px var(--accent-border)}
.install-mode-opt input[type=radio]{width:auto; accent-color:var(--accent); margin:2px 0 0; flex:none}
.install-mode-opt .imo-text{display:flex; flex-direction:column; gap:2px; min-width:0}
.install-mode-opt .imo-title{font-weight:600; line-height:1.3}
.install-mode-opt .imo-desc{font-size:11.5px; color:var(--muted); font-weight:400; line-height:1.35}
.relay-info{font-size:12px; color:var(--muted); background:var(--panel2); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:12px 14px; margin-bottom:14px; line-height:1.65}
#installMask .modal{max-width:760px}
#installMask .modal-body{display:flex; flex-direction:column; gap:2px}
#installMask .log-collect{margin-top:4px}
#installMask .lc-meta{display:inline-flex; align-items:center; gap:8px}
#installMask .lc-badge{
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px;
  background:var(--ok-soft); color:var(--ok-txt); border:1px solid rgba(49,196,107,.35)}
#installMask .lc-badge.off{background:var(--panel3); color:var(--muted); border-color:var(--line2)}
#installMask .warn-hint{color:var(--warn-txt); margin-top:6px}
#installMask .cmd-row{margin-top:4px}
#installMask #osTabs{margin:10px 0 4px}

/* ---------- Toast ---------- */
.toast{position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(8px); z-index:500;
  background:var(--panel3); border:1px solid var(--line2); color:var(--txt); font-size:13px;
  padding:10px 16px; border-radius:var(--r-sm); box-shadow:var(--shadow-lg); opacity:0;
  transition:opacity var(--transition), transform var(--transition); pointer-events:none; max-width:calc(100% - 32px)}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0)}
.toast.ok{border-color:rgba(49,196,107,.5)}
.toast.err{border-color:rgba(239,77,90,.5)}

/* ---------- 视图切换 ---------- */
.view{display:none}
.view.active{display:block; animation:fade .16s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}

/* ---------- 日志 ---------- */
.log-filter{display:flex; gap:7px; margin-bottom:14px; flex-wrap:wrap}
.chip-btn{background:var(--panel2); border:1px solid var(--line2); color:var(--muted);
  font-family:inherit; font-size:12.5px; padding:6px 13px; border-radius:var(--r-sm); cursor:pointer;
  transition:color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast)}
.chip-btn:hover{color:var(--txt); border-color:var(--hover-border)}
.chip-btn.active{background:var(--accent-soft); color:var(--accent-txt); border-color:var(--accent-border)}
.kind{font-size:11px; font-weight:600; padding:2px 8px; border-radius:5px; flex:none}
.kind.op{background:var(--accent2-soft); color:var(--accent2-txt)}
.kind.sys{background:var(--info-soft); color:var(--info-txt)}
.kind.plg{background:var(--ok-soft); color:#7fe0a0}

/* ---------- 侧栏收起（桌面） ---------- */
.app.collapsed{grid-template-columns:64px 1fr}
.app.collapsed .brand-txt,
.app.collapsed .nav-item span,
.app.collapsed .nav-count,
.app.collapsed .btn.block span{display:none}
.app.collapsed .sidebar{padding:18px 10px}
.app.collapsed .brand{justify-content:center; padding:6px 0 18px}
.app.collapsed .nav-item{justify-content:center; padding:10px 0}
.app.collapsed .nav-item.active::before{left:-10px}
.app.collapsed .btn.block{justify-content:center; padding:10px 0}
.app.collapsed .side-status{justify-content:center}

/* ---------- 顶栏用户菜单 ---------- */
.topbar-user-wrap{position:relative; flex:none}

/* 下拉面板 */
.user-dropdown{
  position:absolute; top:calc(100% + 6px); right:0; z-index:200;
  width:260px; background:var(--panel); border:1px solid var(--line2);
  border-radius:var(--r); box-shadow:0 8px 32px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.10);
  opacity:0; visibility:hidden; transform:translateY(-8px) scale(.97);
  transition:opacity .18s ease, transform .18s ease, visibility .18s ease;
  padding:6px;
}
.topbar-user-wrap.open .user-dropdown{opacity:1; visibility:visible; transform:translateY(0) scale(1)}

.user-dropdown-header{display:flex; align-items:center; gap:10px; padding:10px 8px; border-bottom:1px solid var(--line); margin-bottom:4px}
.user-dropdown-info{display:flex; flex-direction:column; gap:1px; min-width:0}
.user-dropdown-name{font-size:14px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.user-dropdown-role{font-size:11px; color:var(--muted)}

.user-dropdown-item{
  display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px;
  background:none; border:none; border-radius:var(--r-sm); cursor:pointer;
  color:var(--txt); font-family:inherit; font-size:13px; text-align:left;
  transition:background var(--transition-fast), color var(--transition-fast);
}
.user-dropdown-item:hover{background:var(--panel2); color:var(--txt)}
.user-dropdown-item svg{width:16px; height:16px; color:var(--muted); flex:none}
.user-dropdown-item.danger{color:var(--crit-txt)}
.user-dropdown-item.danger svg{color:var(--crit-txt)}
.user-dropdown-item.danger:hover{background:var(--crit-soft)}
.user-dropdown-sep{height:1px; background:var(--line); margin:4px 0}

@media(max-width:600px){
  .user-dropdown{width:220px}
}

/* ---------- 搜索 / 分页 ---------- */
.search{margin-left:auto; font-family:inherit; font-size:13px; color:var(--txt); background:var(--panel2);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 14px; width:280px; max-width:45vw;
  transition:border-color var(--transition-fast)}
.search::placeholder{color:var(--muted2)}
.search:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.pager{display:flex; align-items:center; justify-content:center; gap:6px; margin-top:20px; flex-wrap:wrap}
.pager button{background:var(--panel2); border:1px solid var(--line2); color:var(--txt2); font-family:inherit;
  font-size:13px; min-width:32px; height:32px; padding:0 10px; border-radius:var(--r-sm); cursor:pointer;
  transition:border-color var(--transition-fast), background var(--transition-fast)}
.pager button:hover:not(:disabled){border-color:var(--hover-border); background:var(--panel3); color:var(--txt)}
.pager button.active{background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600}
.pager button:disabled{opacity:.4; cursor:default}
.pager .pinfo{color:var(--muted); font-size:12px; margin:0 6px}

/* ---------- 自定义监控 ---------- */
.checks-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:14px}
.check-card{background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:14px 16px;
  transition:border-color var(--transition-fast), background var(--transition-fast)}
.check-card:hover{border-color:var(--line2); background:var(--panel2)}
/* 状态色左强调条（一眼扫描健康），叠加顶部高光；悬停只变边框/底色，强调条保持 */
.check-card.st-up{box-shadow:inset 3px 0 0 var(--ok), inset 0 1px 0 rgba(255,255,255,.04)}
.check-card.st-down{box-shadow:inset 3px 0 0 var(--crit), inset 0 1px 0 rgba(255,255,255,.04)}
.check-card.st-unknown{box-shadow:inset 3px 0 0 var(--line2), inset 0 1px 0 rgba(255,255,255,.04)}
.check-card.st-down{background:linear-gradient(90deg,var(--crit-soft),transparent 60%)}
.check-card .ch-head{display:flex; align-items:center; gap:9px; margin-bottom:8px}
.check-card .ch-name{font-weight:650; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.check-card .ch-actions{margin-left:auto; display:flex; gap:6px; flex:none}
.st-dot{width:8px; height:8px; border-radius:50%; flex:none}
.st-dot.up{background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft); animation:dotPulse 2s ease-in-out infinite}
.st-dot.down{background:var(--crit); box-shadow:0 0 0 3px var(--crit-soft); animation:dotPulseRed 2s ease-in-out infinite}
.st-dot.unknown{background:var(--gray-off)}
.check-card .ch-target{font-size:12px; color:var(--muted); font-family:ui-monospace,Menlo,Consolas,monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.check-card .ch-meta{font-size:11px; color:var(--muted2); margin-top:10px; display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.type-badge{font-size:10px; font-weight:600; padding:2px 7px; border-radius:5px; background:var(--panel3); color:var(--muted); flex:none; letter-spacing:.02em}
/* 类型微着色，便于快速区分探测类型 */
.type-badge.t-http{color:var(--accent-txt)} .type-badge.t-tcp{color:var(--accent2-txt)} .type-badge.t-ping{color:var(--info-txt)} .type-badge.t-process{color:var(--ok-txt)}
.mini-btn{width:26px; height:26px; border-radius:6px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; font-size:12px;
  transition:background var(--transition-fast), color var(--transition-fast)}
.mini-btn:hover{background:var(--panel3); color:var(--txt)}
.mini-btn svg{width:14px; height:14px}
.mini-btn.del:hover{background:var(--crit-soft); color:var(--crit-txt); border-color:var(--crit-border)}

/* 监控：视图切换按钮 */
.view-toggle{display:inline-flex; background:var(--panel2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:2px; gap:2px}
.vt-btn{width:32px; height:28px; border:none; background:none; color:var(--muted); border-radius:6px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color var(--transition-fast), background var(--transition-fast)}
.vt-btn svg{width:16px; height:16px}
.vt-btn:hover{color:var(--txt)}
.vt-btn.active{background:var(--accent-soft); color:var(--accent); border:1px solid var(--accent-border); font-weight:600}

/* 监控：列表视图（默认） */
.checks-list{display:flex; flex-direction:column; gap:10px}
.check-row-top{display:flex; align-items:center; gap:10px}
.check-row-top .ch-name{font-weight:650; font-size:14px; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:240px}
.check-row-top .ch-target{color:var(--muted); font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0}
.check-row-top .ch-actions{margin-left:auto; display:flex; gap:6px; flex:none}
.st-pill{font-size:11px; font-weight:600; padding:2px 10px; border-radius:999px; flex:none}
.st-pill.up{background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border)}
.st-pill.down{background:var(--crit-soft); color:var(--crit-txt); border:1px solid var(--crit-border)}
.st-pill.unknown{background:var(--panel3); color:var(--muted); border:1px solid var(--line2)}
.check-detail{display:flex; flex-wrap:wrap; gap:10px 22px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line)}
.cd-item{display:flex; flex-direction:column; gap:3px; min-width:62px}
.cd-k{font-size:10px; color:var(--muted2); letter-spacing:.02em}
.cd-v{font-size:13px; font-weight:600; color:var(--txt2); font-variant-numeric:tabular-nums;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:300px}
.cd-v.ok{color:var(--ok-txt)} .cd-v.warn{color:var(--warn)} .cd-v.crit{color:var(--crit-txt)} .cd-v.muted{color:var(--muted)}
.check-err{font-size:11.5px; color:var(--crit-txt); margin-top:10px; background:var(--crit-soft);
  border:1px solid var(--crit-border); border-radius:var(--r-sm); padding:7px 10px}

/* 监控：卡片视图（默认） */
.checks-list.pill{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; align-items:start}
.checks-list.pill .check-card{position:relative; padding:14px 16px 15px}
.checks-list.pill .check-row-top{flex-wrap:nowrap; gap:8px}
.checks-list.pill .check-row-top .ch-name{flex:1 1 auto; min-width:0; max-width:none}
.checks-list.pill .check-row-top .st-pill{margin-left:auto}
.checks-list.pill .ch-actions{position:absolute; right:12px; bottom:11px; gap:5px; padding:4px 6px; border-radius:8px;
  background:var(--panel2); border:1px solid var(--line); box-shadow:var(--shadow); opacity:0; transition:opacity var(--transition-fast)}
.checks-list.pill .check-card:hover .ch-actions{opacity:1}
.checks-list.pill .check-detail{gap:9px 16px}

/* ---------- 端口转发：列表 / 卡片双视图 ---------- */
/* 列表视图（默认） */
.fwd-list{display:flex; flex-direction:column; gap:10px}
.fwd-list.fwd-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; align-items:start}
.fwd-row{display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--panel);
  border:1px solid var(--line); border-radius:var(--r); transition:border-color var(--transition-fast), background var(--transition-fast)}
.fwd-row:hover{border-color:var(--hover-border); background:var(--panel2)}
.fwd-off{opacity:.55}
.fwd-off:hover{opacity:.8}
.fwd-main{flex:1; min-width:0}
.fwd-title{font-weight:650; font-size:14px; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.fwd-sub{color:var(--muted); font-size:12.5px; font-family:ui-monospace,Menlo,Consolas,monospace;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px}
.fwd-actions{display:flex; gap:6px; flex:none; margin-left:auto}
/* 卡片视图 */
.fwd-card{position:relative; padding:14px 16px 15px; background:var(--panel);
  border:1px solid var(--line); border-radius:var(--r); transition:border-color var(--transition-fast), background var(--transition-fast)}
.fwd-card:hover{border-color:var(--hover-border); background:var(--panel2)}
.fwd-card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.fwd-status{font-size:11px; font-weight:600; padding:2px 10px; border-radius:999px; flex:none}
.fwd-status.on{background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border)}
.fwd-status.off{background:var(--panel3); color:var(--muted); border:1px solid var(--line2)}
.fwd-card .fwd-title{margin-top:2px}
.fwd-card .fwd-actions{margin-top:12px; padding-top:12px}
/* 操作图标按钮（统一描边 SVG，跟随文字色） */
.icon-btn{width:30px; height:30px; border-radius:7px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--muted); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; padding:0;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast)}
.icon-btn svg{width:15px; height:15px}
.icon-btn:hover{background:var(--panel3); color:var(--txt); border-color:var(--hover-border)}
.icon-btn.danger:hover{background:var(--crit-soft); color:var(--crit-txt); border-color:var(--crit-border)}
.icon-btn:disabled{opacity:.4; cursor:not-allowed}

/* ---------- 数据源接入 ---------- */
/* 卡片容器 */
.ds-card{display:flex; align-items:center; gap:14px; padding:14px 16px;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--r);
  transition:border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast)}
.ds-card:hover{border-color:var(--hover-border); background:var(--panel2); box-shadow:var(--shadow-sm)}
.ds-card.ds-off{opacity:.55}
.ds-card.ds-off:hover{opacity:.8}

/* 左侧类型图标（PROM / LOKI） */
.ds-type-icon{width:38px; height:38px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; letter-spacing:.5px; flex:none;
  color:var(--txt); border:1px solid transparent}
.ds-type-icon.prom{background:var(--accent2-soft); color:var(--accent2-txt); border-color:rgba(124,107,255,.25)}
.ds-type-icon.loki{background:var(--info-soft); color:var(--info-txt); border-color:rgba(63,181,239,.25)}

/* 中间信息区 */
.ds-info{flex:1; min-width:0; display:flex; flex-direction:column; gap:4px}
.ds-name{font-weight:650; font-size:14px; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ds-url{font-size:12px; font-family:ui-monospace,Menlo,Consolas,monospace; color:var(--muted2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:flex; align-items:center; gap:8px}
.ds-url .ds-auth{font-family:var(--font-sans); font-size:11px; color:var(--muted);
  padding:1px 7px; background:var(--panel3); border-radius:999px; flex:none}

/* 状态指示 */
.ds-status{display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:500; flex:none; padding:3px 10px;
  border-radius:999px; border:1px solid transparent}
.ds-status.on{background:var(--ok-soft); color:var(--ok-txt); border-color:var(--ok-border)}
.ds-status.off{background:var(--panel3); color:var(--muted); border-color:var(--line2)}
.ds-status-dot{width:7px; height:7px; border-radius:50%; flex:none}
.ds-status.on .ds-status-dot{background:var(--ok)}
.ds-status.off .ds-status-dot{background:var(--gray-off)}

/* 右侧操作按钮 */
.ds-actions{display:flex; gap:6px; flex:none}

/* 每行内部左侧颜色条（按类型） */
.ds-card.prom{border-left:3px solid var(--accent2)}
.ds-card.loki{border-left:3px solid var(--info)}

/* 空状态增强 */
.ds-empty{text-align:center; padding:64px 24px; color:var(--muted);
  border:1px dashed var(--line2); border-radius:var(--r);
  background:var(--panel); transition:border-color var(--transition-fast)}
.ds-empty:hover{border-color:var(--hover-border)}
.ds-empty-icon{display:block; font-size:40px; margin-bottom:14px; opacity:.5}
.ds-empty b{color:var(--txt)}
.ds-empty code{background:var(--panel2); padding:3px 9px; border-radius:6px; color:var(--txt);
  font-family:ui-monospace,Menlo,Consolas,monospace}

/* 即时查询面板 */
.ds-query-panel{margin-top:24px; padding:20px; background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); transition:border-color var(--transition-fast)}
.ds-query-panel:hover{border-color:var(--hover-border)}
.ds-query-panel .section-title{margin-top:0; margin-bottom:14px}

/* ---------- SQL 工具 ---------- */
.sql-workbench{margin-top:8px}
.sql-toolbar{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:12px; align-items:flex-end}
.sql-toolbar-cluster{
  display:flex; flex-wrap:nowrap; gap:10px; align-items:flex-end;
  flex:0 1 auto; max-width:100%;
}
.sql-toolbar .field{margin:0; min-width:0}
.sql-field-dialect{flex:0 0 auto; width:118px}
.sql-field-conn{flex:1 1 auto; min-width:200px; max-width:480px}
.sql-field-db{flex:0 0 auto; width:160px; min-width:140px}
@media (max-width:720px){
  .sql-toolbar-cluster{flex-wrap:wrap}
  .sql-field-dialect,.sql-field-conn,.sql-field-db{flex:1 1 140px; max-width:none; width:auto}
}
.sql-toolbar .select-wrap{width:100%}
.sql-toolbar .select-wrap select{width:100%; max-width:100%}
.sql-prepare-notes{margin:0 0 8px; color:var(--muted); font-size:12px; line-height:1.4}
.mcp-clients-list{display:flex; flex-direction:column; gap:8px}
.mcp-client-row{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between;
  padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
.mcp-client-main{display:flex; flex-wrap:wrap; gap:8px; align-items:center; min-width:0; flex:1}
.mcp-client-main code{font-size:12px; word-break:break-all}
.mcp-client-acts{display:flex; gap:6px; flex:none}
.sql-split{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; align-items:start}
.sql-split > *{min-width:0; max-width:100%}
@media (max-width:960px){.sql-split{grid-template-columns:1fr}}
.sql-editor{width:100%; min-height:280px; resize:vertical; font-size:13px; line-height:1.45;
  background:var(--panel2); border:1px solid var(--line); border-radius:var(--r); padding:12px; color:var(--txt)}
.sql-trunc-actions{display:flex; align-items:center}
.sql-trunc-actions[hidden]{display:none !important}
.sql-ps-limits{
  margin:0 0 12px; padding:10px 12px; border:1px solid var(--line2); border-radius:8px;
  background:var(--bg2); font-size:12.5px; line-height:1.45; color:var(--txt2);
}
.sql-ps-limits .sql-ps-limits-acts{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.sql-slow-filters{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  margin:0 0 12px; padding:10px 12px;
  border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
.sql-slow-filters .search{ height:32px; min-width:180px; }
.sql-slow-filters .log-filter{ gap:6px; }
.sql-slow-filters .chip-btn{ font-size:12px; padding:4px 10px; }
.sql-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; align-items:center}
/* 运行参数条：行数上限 / 超时 / 运行中的实时进度。放在按钮上方，跑之前就看得见。 */
.sql-run-opts{display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:10px; font-size:12px; color:var(--muted)}
.sql-run-opt{display:inline-flex; align-items:center; gap:6px}
.sql-run-opt .sql-select{background:var(--panel2); border:1px solid var(--line2); color:var(--txt);
  border-radius:var(--r-sm); padding:3px 8px; font:inherit; font-size:12px}
.sql-run-progress{color:var(--accent-txt); font-variant-numeric:tabular-nums}
/* 结果区动作条：翻页 / 复制 / 导出。结果是重画出来的，所以走事件委托。 */
.sql-result-actions{display:flex; flex-wrap:wrap; gap:8px; margin:8px 0}
/* 工具栏动作菜单：主路径只留高频按钮，AI/次要操作点开展开 */
.act-menu{position:relative;display:inline-flex;align-items:center}
.act-menu-trigger{display:inline-flex;align-items:center;gap:5px}
.act-menu-trigger .act-menu-caret{font-size:10px;opacity:.7;margin-left:1px;line-height:1}
.act-menu-panel{
  position:absolute;top:calc(100% + 6px);left:0;z-index:40;
  min-width:168px;padding:4px;border-radius:10px;
  background:var(--panel);border:1px solid var(--line2);box-shadow:var(--shadow-lg,0 12px 32px rgba(0,0,0,.28));
  display:flex;flex-direction:column;gap:2px;
}
.act-menu-panel[hidden]{display:none!important}
.act-menu.drop-up .act-menu-panel{top:auto;bottom:calc(100% + 6px)}
.act-menu-panel button,.act-menu-panel [role="menuitem"]{
  display:flex;align-items:center;gap:8px;width:100%;
  border:none;background:transparent;color:var(--txt);
  border-radius:8px;padding:8px 10px;font:inherit;font-size:12.5px;cursor:pointer;text-align:left;
}
.act-menu-panel button:hover,.act-menu-panel [role="menuitem"]:hover{background:var(--panel3);color:var(--accent)}
.act-menu-panel .act-menu-sep{height:1px;margin:3px 6px;background:var(--line);pointer-events:none}
.act-menu-panel .act-menu-hint{padding:4px 10px 6px;font-size:11px;color:var(--muted);line-height:1.35}
.act-menu-ai .act-menu-trigger{
  background:var(--accent-soft,rgba(76,141,255,.12));
  border-color:color-mix(in srgb, var(--accent) 35%, var(--line));
  color:var(--accent);
}
.act-menu-ai .act-menu-trigger:hover{filter:brightness(1.05)}
.sql-actions .act-menu{margin-left:2px}
.sql-actions .act-menu-ai{margin-left:auto}
.sql-actions .act-menu .act-menu-panel{top:auto;bottom:calc(100% + 6px);left:auto;right:0}
.sre-toolbar .act-menu-ai{margin-left:0}
#incidentDetailFoot{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#incidentDetailFoot .act-menu.drop-up .act-menu-panel{top:auto;bottom:calc(100% + 6px)}
#incidentDetailFoot .inc-comment-bar{flex:1 1 220px;min-width:200px}
.sql-result-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--r);
  padding:14px 16px; min-height:280px; max-height:640px; overflow:auto;
  min-width:0; max-width:100%; box-sizing:border-box}
.sql-query-meta{
  display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center;
  margin:0 0 10px; padding:8px 10px; border-radius:8px;
  background:var(--panel2); border:1px solid var(--line); font-size:12px; color:var(--txt2);
}
.sql-query-meta b{color:var(--txt); font-variant-numeric:tabular-nums}
/* 结果表：容器限宽 + 双向滚动，字段多时左右滑，行多时上下滑 */
.sql-query-wrap{
  width:100%; max-width:100%;
  max-height:min(52vh,480px);
  overflow:auto;
  border:1px solid var(--line); border-radius:8px; background:var(--bg2);
  -webkit-overflow-scrolling:touch;
}
.sql-query-table{
  width:max-content; min-width:100%;
  border-collapse:separate; border-spacing:0;
  font-size:12px; table-layout:auto;
}
.sql-query-table th{
  position:sticky; top:0; z-index:2; background:var(--panel2); color:var(--muted);
  text-align:left; padding:7px 10px; border-bottom:1px solid var(--line);
  white-space:nowrap; min-width:88px; max-width:240px;
  overflow:hidden; text-overflow:ellipsis;
}
.sql-query-table td{
  padding:6px 10px; border-bottom:1px solid var(--line2);
  min-width:88px; max-width:240px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:top;
}
.sql-query-table td.num{font-variant-numeric:tabular-nums; font-family:var(--mono, monospace)}
.sql-query-table td.sql-null{color:var(--muted); font-style:italic}
.sql-query-hint{margin:6px 0 0; font-size:11px; color:var(--muted)}
.sql-score{margin-bottom:12px; font-size:14px}
.sql-finding{border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-bottom:8px; background:var(--panel2)}
.sql-finding.crit{border-left:3px solid var(--danger, #ef4444)}
.sql-finding.warn{border-left:3px solid var(--warn, #f59e0b)}
.sql-finding.info{border-left:3px solid var(--info, #3b82f6)}
.sql-finding-head{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:4px}
.sql-lv{font-size:11px; text-transform:uppercase; opacity:.8}
.sql-finding-detail{color:var(--muted); font-size:13px}
.sql-finding-suggest{margin-top:6px; font-size:13px; color:var(--txt)}
.sql-opt-block{margin-bottom:14px}
.sql-opt-head{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; font-weight:600}
.sql-rewritten,.sql-snippet{white-space:pre-wrap; word-break:break-word; background:var(--panel2);
  border:1px solid var(--line); border-radius:8px; padding:10px; max-height:240px; overflow:auto; font-size:12px}
.sql-ul{margin:0; padding-left:18px; color:var(--muted); font-size:13px}
.sql-ul li{margin-bottom:6px}
.sql-explain-summary{margin-bottom:10px; font-size:13px; line-height:1.5}
.sql-explain-summary .badge{margin-left:8px; vertical-align:middle}
.sql-explain-table{width:100%; font-size:12px}
.sql-explain-detail{margin-top:14px}
.sql-explain-overview{
  white-space:pre-wrap; font-size:13px; line-height:1.55; color:var(--txt2);
  margin:0 0 12px; padding:10px 12px; border-radius:8px;
  background:var(--panel2); border:1px solid var(--line);
}
.sql-explain-steps{display:flex; flex-direction:column; gap:10px}
.sql-explain-step{
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--panel2);
  border-left:3px solid var(--info, #3b82f6);
}
.sql-explain-step.warn{border-left-color:var(--warn, #f59e0b)}
.sql-explain-step.crit{border-left-color:var(--danger, #ef4444)}
.sql-explain-step.ok{border-left-color:var(--ok, #22c55e)}
.sql-explain-step.info{border-left-color:var(--info, #3b82f6)}
.sql-explain-step-head{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:6px}
.sql-explain-step-n{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%; font-size:12px; font-weight:600;
  background:var(--panel3, var(--bg2)); color:var(--txt);
}
.sql-explain-step-body{font-size:13px; line-height:1.55; color:var(--txt)}
.sql-explain-step-cond{margin-top:6px; font-size:12px}
.sql-explain-step-cond .muted{color:var(--muted); margin-right:6px}
.sql-index-card{
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; background:var(--panel2);
}
.sql-index-card-head{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:4px}
.sql-index-card-acts{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.sql-raw{margin-top:12px}
.sql-raw pre{max-height:220px; overflow:auto; font-size:11px; white-space:pre-wrap}
.sql-schema-history{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px}
@media (max-width:960px){.sql-schema-history{grid-template-columns:1fr}}
.sql-schema-panel,.sql-history-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:8px 10px; max-height:180px; overflow:auto}
.sql-schema-list button,.sql-history-item{display:block; width:100%; text-align:left; border:0; background:transparent; padding:4px 6px; border-radius:6px; cursor:pointer; font-size:12px; color:var(--txt)}
.sql-schema-list button:hover,.sql-history-item:hover{background:rgba(127,127,127,.12)}
.sql-schema-list button.active{background:color-mix(in srgb, var(--accent) 15%, transparent)}
.sql-schema-cols{font-size:11px; margin-top:6px; color:var(--muted)}
.sql-history-item .mono{font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.sql-explain-diff{margin-top:10px; border:1px dashed var(--line); border-radius:8px; padding:8px}

/* ---------- 概览：统计与健康小结 ---------- */
.stats-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:4px}
.stat-card{background:var(--panel); border:1px solid var(--line); border-radius:var(--r);
  padding:14px 16px; text-align:center; transition:border-color var(--transition), box-shadow var(--transition)}
.stat-card:hover{border-color:var(--hover-border)}
.stat-card .sv{font-size:22px; font-weight:700; letter-spacing:-.5px; color:var(--txt)}
.stat-card .sv.ok{color:var(--ok)}
.stat-card .sv.warn{color:var(--warn)}
.stat-card .sv.crit{color:var(--crit)}
.stat-card .sk{font-size:11px; color:var(--muted); margin-top:4px}
.stat-card .sh{font-size:10px; color:var(--muted2); margin-top:2px}

/* ---------- 概览：资源 TOP10 排行榜（多面板横向条形图） ---------- */
/* 3 列网格布局，每行最多 3 个面板 */
.top-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:4px}

/* 单个面板 = 指标卡片 */
.top-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--r);
  padding:12px 14px; box-shadow:0 1px 2px rgba(0,0,0,.08);
  transition:border-color var(--transition), box-shadow var(--transition)}
.top-panel:hover{border-color:var(--hover-border)}

/* 面板标题 */
.top-title{font-size:11.5px; font-weight:650; color:var(--muted); letter-spacing:.02em;
  margin-bottom:10px; display:flex; align-items:center; gap:6px}
.top-title .top-unit{font-size:10px; font-weight:400; color:var(--muted2)}

/* 排行条目行 */
.top-item{display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px;
  cursor:pointer; transition:background var(--transition-fast);
  border-left:3px solid transparent}
.top-item:hover{background:var(--panel2); border-left-color:var(--accent)}
.top-item:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}

/* 主机名 */
.top-name{flex:none; width:86px; font-size:12px; font-weight:500; color:var(--txt);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.top-name:hover{color:var(--accent); text-decoration:underline}

/* 进度条 */
.top-bar{flex:1; min-width:30px; height:7px; background:var(--panel3);
  border-radius:4px; overflow:hidden}
.top-bar-fill{height:100%; border-radius:4px; min-width:3px;
  transition:width .4s ease, background .4s ease}

/* 数值 */
.top-val{width:54px; flex:none; text-align:right; font-size:12px; font-weight:600;
  font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--txt)}

/* 空状态 */
.top-empty{display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 20px; color:var(--muted2); text-align:center;
  border:1px dashed var(--line2); border-radius:var(--r); background:var(--bg2);
  grid-column:1/-1}
.top-empty svg{width:48px; height:48px; opacity:.3; margin-bottom:10px; color:var(--muted2)}
.top-empty span{font-size:13px; line-height:1.5}

/* 监控探针面板 */
.top-checks-panel{margin-top:16px; grid-column:1/-1}
.top-checks-title{font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.02em; margin-bottom:10px}
/* 监控探针独立面板 */
.checks-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px;
  box-shadow:0 1px 2px rgba(0,0,0,.08); transition:border-color var(--transition), box-shadow var(--transition)}
.checks-item{display:flex; align-items:center; gap:10px; padding:5px 6px; border-radius:6px;
  cursor:pointer; transition:background var(--transition-fast); border-left:3px solid transparent}
.checks-item:hover{background:var(--panel2); border-left-color:var(--accent)}
.checks-item:focus-visible,.top-item:focus-visible{outline:2px solid var(--accent); outline-offset:-2px; border-radius:var(--r-xs)}
.checks-name{flex:none; width:86px; font-size:12px; font-weight:500; color:var(--txt);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.checks-bar{flex:1; min-width:30px; height:7px; background:var(--panel3);
  border-radius:4px; overflow:hidden}
.checks-bar-fill{height:100%; border-radius:4px; min-width:3px;
  transition:width .4s ease, background .4s ease}
.checks-val{width:54px; flex:none; text-align:right; font-size:12px; font-weight:600;
  font-variant-numeric:tabular-nums; white-space:nowrap}
.checks-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:16px}

/* ---------- Group collapse (disabled — rules retained for future restore) ---------- */
.group-head{cursor:default; user-select:none}
.group-head .cat-toggle{display:none; font-size:10px; color:var(--muted); flex:none; width:14px; text-align:center; transition:transform var(--transition-fast)}
.group-head.collapsed .cat-toggle{transform:none}
.group-head.collapsed{opacity:.7}
.group-collapsed{display:none}

/* ---------- Multi-select category dropdown ---------- */
.cat-dropdown{position:relative; min-width:130px}
.cat-dd-btn{
  font-family:inherit; font-size:13px; color:var(--txt2); background:var(--panel2);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 28px 8px 12px;
  cursor:pointer; transition:border-color var(--transition-fast); display:flex; align-items:center; gap:6px;
  width:100%; text-align:left; position:relative;
}
.cat-dd-btn:hover{border-color:var(--hover-border)}
.cat-dd-btn .dd-arrow{position:absolute; right:11px; color:var(--muted); font-size:10px}
/* P1-#4: Filtered badge on category button */
.cat-dd-btn.filtered{border-color:var(--accent); background:var(--accent-soft); color:var(--accent-txt)}
.cat-dd-btn.filtered::after{content:""; position:absolute; top:4px; right:26px; width:6px; height:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 2px var(--panel2)}
.cat-dd-menu{
  display:none; position:absolute; top:100%; left:0; right:0; z-index:50;
  background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm);
  box-shadow:var(--shadow-lg); margin-top:4px; max-height:260px; overflow:auto;
  padding:4px 0;
}
.cat-dd-menu.show{display:block}
.cat-dd-opt{
  display:flex; align-items:center; gap:8px; padding:7px 12px; cursor:pointer;
  font-size:13px; color:var(--txt2); transition:background var(--transition-fast);
}
.cat-dd-opt:hover{background:var(--panel2)}
.cat-dd-opt input{width:14px; height:14px; accent-color:var(--accent); cursor:pointer; flex:none}

/* ---------- Alert IP/time styles ---------- */
.alert-ip{font-size:11px; color:var(--muted); margin-left:4px; flex:none}
.alert-time{font-size:11px; color:var(--muted2); flex:none; white-space:nowrap; margin-left:8px; font-variant-numeric:tabular-nums}

/* ---------- 空态引导 ---------- */
.onboard{background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-lg); padding:20px 22px; margin-bottom:18px}
.ob-title{font-size:15px; font-weight:650; margin-bottom:16px}
.ob-steps{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-bottom:16px}
.ob-step{display:flex; gap:12px; align-items:flex-start; background:var(--bg2);
  border:1px solid var(--line); border-radius:var(--r-sm); padding:13px 15px}
.ob-num{width:24px; height:24px; flex:none; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--accent); color:#fff; font-weight:700; font-size:12px}
.ob-step b{font-size:13px}

/* ---------- 离线 / 状态标记 ---------- */
.host.offline{opacity:.66}
.host.offline:hover{opacity:1}
/* 卡片视图在线/离线状态色条 */
.host:not(.hrow).online{border-left:3px solid var(--ok)}
.host:not(.hrow).offline{border-left:3px solid var(--crit)}
.offline-tag{color:var(--crit-txt); font-weight:600}
.stale-tag{color:var(--warn); font-weight:600}
.tb-icon.active{background:var(--warn-soft); color:var(--warn)}

/* P1-#8: Keyboard focus-visible */
.host:focus-visible, .row-item:focus-visible, .check-card:focus-visible, .checks-item:focus-visible, .top-item:focus-visible {
  outline:2px solid var(--accent); outline-offset:-2px;
}
.host:focus-visible{border-color:var(--accent)}

/* ---------- 版本标签 ---------- */

/* 主机元信息：IP · OS 占满卡片全宽，避免挤在左侧窄栏截断 */
.host-meta{display:flex;align-items:baseline;gap:6px;margin:0;min-width:0;font-size:11.5px;line-height:1.35;color:var(--txt2)}
/* 系统类型 + Agent 版本 + 内核版本：从卡片头挪下来，跟在 IP 行后面单独一行（分隔线随之下移）。 */
.host-sys{display:flex;align-items:center;flex-wrap:nowrap;gap:5px;margin:4px 0 10px;padding-bottom:8px;border-bottom:1px solid var(--line);min-width:0}
/* 内核串没有长度上限（"6.12.100+deb13-amd64" 起步，云厂商镜像还能更长），所以它吃掉这行
   剩下的宽度并在放不下时省略——不换行、不把卡片撑宽。全文挂在 title 上，悬停可见。
   min-width:0 是关键：flex 项默认 min-width:auto，会以 min-content 为下限拒绝收缩，
   于是 text-overflow 永远不触发，改成撑破容器。 */
.kern-badge{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:9.5px;padding:2px 6px;border-radius:4px;background:var(--panel3);color:var(--muted);
  font-weight:600;letter-spacing:.02em}
.host-meta .hm-ip{flex:none;font-variant-numeric:tabular-nums;letter-spacing:.01em}
.host-meta .hm-sep{flex:none;color:var(--muted2)}
.host-meta .hm-os{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 主机信息（旧两列表格，保留兼容） */
.host-info{display:flex; flex-direction:column; gap:2px; margin-top:4px; min-width:0}
.host-info .hi-row{display:flex; align-items:baseline; gap:6px; font-size:10.5px; line-height:1.4}
.host-info .hi-k{color:var(--muted2); flex:none; width:48px}
.host-info .hi-v{color:var(--txt2); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.4}
.host-info .hi-v.hi-ip{white-space:normal; overflow:visible; text-overflow:clip; word-break:break-all}
.host-info .hi-v.mono, .host-info .hi-v .mono{font-variant-numeric:tabular-nums}
.hi-sep{color:var(--muted2); margin:0 1px}
.metric.gpu .row .label{color:var(--accent2-txt)}

/* ---------- 主机分组树：JumpServer 风格左树 + 右工具栏/卡片 ---------- */
.htx-wrap{display:flex;gap:0;align-items:stretch;margin-top:0;min-height:min(560px, calc(100vh - 140px));background:var(--panel);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.htx-tree{flex:0 0 240px;max-width:280px;min-width:200px;background:var(--bg2);border-right:1px solid var(--line);border-radius:0;display:flex;flex-direction:column;align-items:stretch;max-height:none;overflow:hidden;text-align:left}
.htx-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;background:var(--panel)}
/* overflow-x:hidden is a guard rail — the host list sizes its columns to this
   box, so a stray wide child must never introduce a horizontal scrollbar. */
.htx-content{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:10px 12px 8px}
.htx-flat{margin:0}
.htx-flat .group-head{display:none}
@media(max-width:960px){.htx-wrap{flex-direction:column;min-height:0}.htx-tree{flex:none;max-width:none;width:100%;max-height:200px;border-right:none;border-bottom:1px solid var(--line)}}

.htx-tabs{display:flex;align-items:center;justify-content:flex-start;gap:0;padding:0 2px 0 4px;border-bottom:1px solid var(--line);flex:none;min-height:26px;text-align:left}
.htx-tab{appearance:none;border:none;background:transparent;color:var(--muted);font:inherit;font-size:12px;font-weight:500;padding:4px 8px 3px;cursor:pointer;position:relative;border-radius:0;line-height:1.2;text-align:left;flex:none}
.htx-tab:hover{color:var(--txt)}
.htx-tab.active{color:var(--accent);font-weight:600}
.htx-tab.active::after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:2px;background:var(--accent);border-radius:2px 2px 0 0}
.htx-tab-tools{margin-left:auto;display:inline-flex;align-items:center;gap:1px;padding-right:2px;flex:none}
.htx-tree-search{padding:3px 5px;flex:none;text-align:left}
.htx-tree-q{width:100%;box-sizing:border-box;height:24px;padding:0 7px;border:1px solid var(--line2);border-radius:var(--r-xs);background:var(--panel);color:var(--txt);font:inherit;font-size:12px;line-height:24px}
.htx-tree-q:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.htx-tool-btn{width:22px;height:22px;border:none;border-radius:var(--r-xs);background:transparent;color:var(--muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}
.htx-tool-btn:hover{background:var(--panel2);color:var(--txt)}
.htx-tool-btn.active{background:var(--accent-soft);color:var(--accent)}
.htx-tool-btn svg{width:13px;height:13px}
.htx-add-root{font-size:16px;font-weight:600;color:var(--accent);line-height:1}

.htx-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--line);flex:none;background:var(--panel)}
.htx-tb-left,.htx-tb-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.htx-tb-right{margin-left:auto}
.htx-create{height:32px;padding:0 12px;font-size:13px}
.htx-create svg{width:14px;height:14px}
.htx-crumb{font-size:12.5px;color:var(--txt2);font-weight:550;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.htx-search{width:200px;max-width:28vw;margin:0}
.htx-more{position:relative}
.htx-more-menu{position:absolute;top:calc(100% + 4px);left:0;min-width:140px;background:var(--panel);border:1px solid var(--line2);border-radius:var(--r-sm);box-shadow:0 8px 24px rgba(0,0,0,.18);padding:4px;z-index:40}
.htx-more-item{display:block;width:100%;text-align:left;border:none;background:transparent;padding:8px 10px;border-radius:var(--r-xs);font:inherit;font-size:13px;color:var(--txt);cursor:pointer}
.htx-more-item:hover{background:var(--accent-soft);color:var(--accent-txt)}

.htx-head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:8px 8px 6px;border-bottom:1px solid var(--line);flex:none}
.htx-title{font-size:11px;font-weight:650;color:var(--muted);letter-spacing:.04em}
.htx-scroll{flex:1 1 auto;overflow:auto;padding:4px 6px 8px 4px;min-height:0;align-self:stretch;width:100%;box-sizing:border-box}
.htx-sep{height:1px;background:var(--line);margin:2px 6px}
.htx-hint{padding:2px 6px;font-size:10px;color:var(--muted2);line-height:1.3}
.htx-empty{padding:10px 8px;font-size:11px;color:var(--muted2);line-height:1.4}
.htx-branch-sep{height:1px;margin:4px 4px 4px 28px;background:var(--line);opacity:.85}

/* ---- 树节点：固定 展开列(14) + 图标列(14) + 名称 + 计数 + 操作 ---- */
.htx-node{
  display:flex;align-items:center;justify-content:flex-start;gap:5px;
  height:26px;min-height:26px;max-height:26px;
  padding:0 6px 0 2px;margin:1px 0;border-radius:5px;
  cursor:pointer;font-size:12.5px;color:var(--txt2);line-height:26px;
  position:relative;box-sizing:border-box;width:100%;user-select:none;
}
.htx-node:hover{background:var(--panel2);color:var(--txt)}
.htx-node.selected{background:var(--accent-soft);color:var(--accent);font-weight:600}
.htx-node.selected::before{
  content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;
  background:var(--accent);border-radius:0 2px 2px 0;
}
.htx-node.selected .htx-count{background:var(--accent);color:#fff;border-color:transparent}
.htx-root-node{font-weight:600;color:var(--txt)}
.htx-root-node .htx-name{font-weight:650}
.htx-ungrouped{color:var(--muted)}
.htx-ungrouped .htx-name{font-weight:500}
.htx-ungrouped.selected{color:var(--accent)}

/* 展开列：叶子也占位，保证图标纵列对齐 */
.htx-caret{
  flex:0 0 14px;width:14px;height:18px;margin:0;padding:0;border:0;
  background:transparent;color:var(--muted);font:inherit;font-size:10px;
  line-height:18px;text-align:center;cursor:pointer;border-radius:3px;
  display:inline-flex;align-items:center;justify-content:center;
}
.htx-caret:hover{background:rgba(127,127,127,.12);color:var(--txt)}
.htx-caret-gap{pointer-events:none;visibility:hidden}

/* 图标列 */
.htx-ico{
  flex:0 0 14px;width:14px;height:12px;position:relative;box-sizing:border-box;
  border:1.5px solid var(--muted2);border-radius:1px 2px 2px 2px;opacity:.75;
}
.htx-ico::before{
  content:"";position:absolute;left:-1px;top:-3px;width:6px;height:3px;
  border:1.5px solid var(--muted2);border-bottom:none;border-radius:1px 1px 0 0;box-sizing:border-box;
}
.htx-ico-folder{opacity:.8}
.htx-ico-all{
  border-radius:3px;height:12px;border-color:var(--accent);opacity:.9;
  background:linear-gradient(180deg, rgba(59,130,246,.12), transparent);
}
.htx-ico-all::before{display:none}
.htx-ico-all::after{
  content:"";position:absolute;left:2px;right:2px;top:3px;bottom:3px;
  border-top:1.5px solid var(--accent);border-bottom:1.5px solid var(--accent);opacity:.85;
}
.htx-ico-ungrouped{
  border-style:solid;border-color:var(--muted2);border-radius:3px;height:12px;opacity:.55;
  background:repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(127,127,127,.18) 2px, rgba(127,127,127,.18) 3px);
}
.htx-ico-ungrouped::before{display:none}
.htx-ico-type{
  border-radius:3px;height:12px;width:14px;opacity:.7;
  background:var(--panel3);
}
.htx-ico-type::before{display:none}
.htx-ico-type::after{
  content:"";position:absolute;left:3px;right:3px;top:50%;
  border-top:1.5px solid var(--muted2);transform:translateY(-50%);
}

.htx-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:26px;text-align:left}
.htx-count{
  flex:0 0 auto;min-width:18px;height:16px;padding:0 5px;margin-left:2px;
  font-size:10px;line-height:14px;color:var(--muted);font-variant-numeric:tabular-nums;
  text-align:center;border-radius:999px;background:var(--panel3);border:1px solid var(--line);
  box-sizing:border-box;
}
/* 操作列固定占位，计数徽章纵向对齐；无按钮时仍保留宽度（星标/新建/改名/删除四粒各 18px） */
.htx-acts{
  flex:0 0 72px;width:72px;display:inline-flex;justify-content:flex-end;gap:0;
  opacity:0;pointer-events:none;transition:opacity .12s;height:26px;align-items:center;
}
.htx-node:hover .htx-acts,.htx-node.selected .htx-acts,.htx-node.has-fav .htx-acts{opacity:1;pointer-events:auto}
.htx-acts:empty{opacity:0!important;pointer-events:none!important}
.htx-act{border:none;background:transparent;color:var(--muted);cursor:pointer;width:18px;height:18px;border-radius:4px;line-height:1;padding:0;font-size:12px;display:inline-flex;align-items:center;justify-content:center;flex:none}
.htx-act:hover{background:var(--panel3);color:var(--txt)}
.htx-act.htx-add{color:var(--accent);font-weight:700;font-size:14px}
.htx-act.htx-add:hover{background:var(--accent-soft)}
.htx-act.danger:hover{color:var(--crit,#ef4d5a)}
/* 收藏星标：金色与新控制台一致；未收藏的☆随操作组悬停才出现，已收藏的★常驻 */
.htx-act.htx-fav{font-size:13px}
.htx-act.htx-fav.on{color:var(--warn,#e8a13c)}
.htx-act.htx-fav.on:hover{background:var(--warn-soft,rgba(232,161,60,.12));color:var(--warn,#e8a13c)}

/* ---- 收藏固定区：钉在树顶，行高/选中态与树节点一致，点击即跳转 ---- */
.htx-favs{flex:none;padding:4px 0 6px;border-bottom:1px dashed var(--line)}
.htx-favs-head{display:flex;align-items:center;gap:4px;padding:2px 8px;font-size:11px;font-weight:650;color:var(--muted);letter-spacing:.04em}
.htx-favs-star{color:var(--warn,#e8a13c)}
.htx-fav-row{display:flex;align-items:center;gap:5px;height:26px;margin:1px 0;padding:0 6px 0 20px;border-radius:5px;font-size:12.5px;line-height:26px;color:var(--txt2);cursor:pointer;position:relative;user-select:none}
.htx-fav-row:hover{background:var(--panel2);color:var(--txt)}
.htx-fav-row.selected{background:var(--accent-soft);color:var(--accent);font-weight:600}
.htx-fav-row.selected::before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;background:var(--accent);border-radius:0 2px 2px 0}
.htx-fav-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.htx-fav-row .htx-count{margin-left:0}
.htx-fav-del{flex:none;opacity:0}
.htx-fav-row:hover .htx-fav-del,.htx-fav-row:focus-within .htx-fav-del{opacity:1}

/* 子树：每级 14px + 轻量竖向引导线，层级一眼可读 */
.htx-children{
  position:relative;margin:0;padding:0 0 0 14px;box-sizing:border-box;
}
.htx-children::before{
  content:"";position:absolute;top:0;bottom:3px;left:8px;width:1px;
  background:var(--line);opacity:.7;pointer-events:none;
}
.htx-folder{margin:0;padding:0;width:100%}
.htx-root{width:100%;padding:0;margin:0}
.htx-head .htx-act{opacity:1;pointer-events:auto;width:22px;height:22px;border:1px solid var(--line2);background:var(--panel2);border-radius:var(--r-xs)}

.htx-ctx{position:fixed;z-index:1600;min-width:168px;padding:4px;background:var(--panel);border:1px solid var(--line2);border-radius:8px;box-shadow:0 10px 28px rgba(0,0,0,.2)}
.htx-ctx-item{display:block;width:100%;text-align:left;border:none;background:transparent;padding:8px 12px;border-radius:6px;font:inherit;font-size:12.5px;color:var(--txt);cursor:pointer}
.htx-ctx-item:hover{background:var(--accent-soft);color:var(--accent-txt)}
.htx-ctx-item.danger:hover{background:rgba(239,77,90,.12);color:var(--crit)}

#view-hosts .tree-toggle-btn{border-radius:0;border-top:none;border-bottom:none;min-height:auto;align-self:stretch;background:var(--bg2)}
#view-hosts.view{padding-bottom:8px}
/* 主机页取消内容区居中限宽，让左侧主机树/类型树贴齐工作区 */
.app:has(#view-hosts.active) .content{
  max-width:none;
  margin:0;
  padding-left:12px;
  padding-right:12px;
}

/* ---------- 主机分组命名弹窗（紧凑、无 AI 反馈样式） ---------- */
.htx-dlg-mask{z-index:1520;align-items:center;justify-content:center;background:rgba(8,10,16,.45);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
.htx-dlg{width:min(380px,92vw);background:var(--panel);border:1px solid var(--line2);border-radius:10px;box-shadow:0 16px 48px rgba(0,0,0,.28);overflow:hidden}
.htx-dlg-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
.htx-dlg-head h3{margin:0;font-size:14px;font-weight:650;color:var(--txt);letter-spacing:.01em}
.htx-dlg-x{width:28px;height:28px;border:none;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer;font-size:14px;line-height:1}
.htx-dlg-x:hover{background:var(--panel2);color:var(--txt)}
.htx-dlg-body{padding:14px 14px 6px;display:flex;flex-direction:column;gap:6px}
.htx-dlg-path{display:flex;align-items:baseline;gap:8px;padding:7px 9px;background:var(--bg2);border:1px solid var(--line);border-radius:7px;font-size:12px;min-width:0}
.htx-dlg-path-k{flex:none;color:var(--muted);font-size:11px}
.htx-dlg-path-v{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--txt2);font-weight:550}
.htx-dlg-label{font-size:12px;font-weight:600;color:var(--txt);margin-top:2px}
.htx-dlg-input{width:100%;box-sizing:border-box;height:36px;padding:0 11px;border:1px solid var(--line2);border-radius:7px;background:var(--bg2);color:var(--txt);font:inherit;font-size:13px}
.htx-dlg-input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.htx-dlg-input::placeholder{color:var(--muted2)}
.htx-dlg-select{appearance:auto;cursor:pointer}
.htx-dlg-hint{font-size:11px;color:var(--muted2);line-height:1.4;margin-top:1px}
/* 手动复制兜底框：等宽、可滚动、高度固定——里面装的是终端输出，不能撑破弹窗。 */
.manual-copy-text{height:auto;min-height:150px;max-height:46vh;padding:8px 10px;line-height:1.45;
  font-family:ui-monospace,"SF Mono",Menlo,Consolas,"DejaVu Sans Mono",monospace;font-size:12.5px;
  white-space:pre;overflow:auto;resize:vertical;margin-top:8px}
.htx-dlg-err{font-size:11.5px;color:var(--crit);min-height:16px;margin-top:2px}
.htx-dlg-foot{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px 14px}

/* ---------- 共享左树（资源硬件/Hyper-V、仪表盘）：复用主机树视觉规范 ---------- */
.rtx-wrap{display:flex;gap:0;align-items:stretch;margin-top:0;min-height:min(560px, calc(100vh - 160px));background:var(--panel);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.rtx-tree{flex:0 0 260px;max-width:300px;min-width:200px;background:var(--bg2);border-right:1px solid var(--line);display:flex;flex-direction:column;overflow:hidden;text-align:left}
.rtx-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;background:var(--panel);overflow:hidden}
.rtx-main-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding:10px 12px 12px}
.rtx-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--line);flex:none;background:var(--panel)}
.rtx-toolbar .hw-search,.rtx-toolbar .search{width:200px;max-width:32vw;margin:0;flex:1 1 160px}
.rtx-toolbar .hw-sel{max-width:150px}
.rtx-count{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;margin-left:auto}
.rtx-tree-search{padding:3px 5px;flex:none}
.rtx-tree-q{width:100%;box-sizing:border-box;height:24px;padding:0 7px;border:1px solid var(--line2);border-radius:var(--r-xs);background:var(--panel);color:var(--txt);font:inherit;font-size:12px;line-height:24px}
.rtx-tree-q:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.rtx-scroll{flex:1 1 auto;overflow:auto;padding:4px 6px 8px 4px;min-height:0}
.rtx-empty{padding:10px 8px;font-size:11px;color:var(--muted2);line-height:1.4}
.rtx-summary{font-size:12px;color:var(--muted);padding:0 2px 6px}
@media(max-width:960px){.rtx-wrap{flex-direction:column;min-height:0}.rtx-tree{flex:none;max-width:none;width:100%;max-height:220px;border-right:none;border-bottom:1px solid var(--line)}}

/* 节点：与 .htx-node 同规范（展开列 + 图标列 + 名称 + 计数） */
.rtx-node{
  display:flex;align-items:center;justify-content:flex-start;gap:5px;
  height:26px;min-height:26px;max-height:26px;
  padding:0 6px 0 2px;margin:1px 0;border-radius:5px;
  cursor:pointer;font-size:12.5px;color:var(--txt2);line-height:26px;
  position:relative;box-sizing:border-box;width:100%;user-select:none;
}
.rtx-node:hover{background:var(--panel2);color:var(--txt)}
.rtx-node.selected{background:var(--accent-soft);color:var(--accent);font-weight:600}
.rtx-node.selected::before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;background:var(--accent);border-radius:0 2px 2px 0}
.rtx-node.selected .rtx-count{background:var(--accent);color:#fff;border-color:transparent}
.rtx-node.bad .rtx-name{color:var(--warn-txt)}
.rtx-root-node{font-weight:600;color:var(--txt)}
.rtx-root-node .rtx-name{font-weight:650}
.rtx-caret{
  flex:0 0 14px;width:14px;height:18px;margin:0;padding:0;border:0;
  background:transparent;color:var(--muted);font:inherit;font-size:10px;
  line-height:18px;text-align:center;cursor:pointer;border-radius:3px;
  display:inline-flex;align-items:center;justify-content:center;
}
.rtx-caret:hover{background:rgba(127,127,127,.12);color:var(--txt)}
.rtx-caret-gap{pointer-events:none;visibility:hidden}
.rtx-ico{
  flex:0 0 14px;width:14px;height:12px;position:relative;box-sizing:border-box;
  border:1.5px solid var(--muted2);border-radius:1px 2px 2px 2px;opacity:.75;
}
.rtx-ico::before{
  content:"";position:absolute;left:-1px;top:-3px;width:6px;height:3px;
  border:1.5px solid var(--muted2);border-bottom:none;border-radius:1px 1px 0 0;box-sizing:border-box;
}
.rtx-ico-all{
  border-radius:3px;height:12px;border-color:var(--accent);opacity:.9;
  background:linear-gradient(180deg, rgba(59,130,246,.12), transparent);
}
.rtx-ico-all::before{display:none}
.rtx-ico-all::after{
  content:"";position:absolute;left:2px;right:2px;top:3px;bottom:3px;
  border-top:1.5px solid var(--accent);border-bottom:1.5px solid var(--accent);opacity:.85;
}
.rtx-ico-host{border-radius:3px;opacity:.8}
.rtx-ico-host::before{display:none}
.rtx-ico-host::after{content:"";position:absolute;left:2px;right:2px;top:2px;bottom:2px;border:1px solid var(--muted2);border-radius:1px}
.rtx-ico-leaf{border-radius:3px;height:12px;opacity:.65;background:var(--panel3)}
.rtx-ico-leaf::before{display:none}
.rtx-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%}
.rtx-dot.ok{background:var(--ok)}.rtx-dot.warn{background:var(--warn)}.rtx-dot.crit{background:var(--crit)}.rtx-dot.na,.rtx-dot.off{background:var(--muted)}
.rtx-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:26px;text-align:left}
.rtx-sub{flex:0 1 auto;max-width:42%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--muted);line-height:26px}
.rtx-count{
  flex:0 0 auto;min-width:18px;height:16px;padding:0 5px;margin-left:2px;
  font-size:10px;line-height:14px;color:var(--muted);font-variant-numeric:tabular-nums;
  text-align:center;border-radius:999px;background:var(--panel3);border:1px solid var(--line);box-sizing:border-box;
  display:inline-flex;align-items:center;gap:3px;
}
.rtx-count.bad{color:var(--warn-txt);font-weight:600}
.rtx-count .hc-bad{color:var(--warn-txt);font-weight:600}
.rtx-count .hc-bad::before{content:"⚠ "}
.rtx-children{position:relative;margin:0;padding:0 0 0 14px;box-sizing:border-box}
.rtx-children::before{content:"";position:absolute;top:0;bottom:3px;left:8px;width:1px;background:var(--line);opacity:.7;pointer-events:none}
.rtx-folder{margin:0;padding:0;width:100%}
.rtx-detailbox{padding:12px 4px;min-height:200px}
.rtx-dhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:12px;margin-bottom:14px;border-bottom:1px solid var(--line)}
.app:has(#view-containers.active) .content,
.app:has(#view-k8s.active) .content,
.app:has(#view-hardware.active) .content,
.app:has(#view-hyperv.active) .content,
.app:has(#view-containers.active) .content,
.app:has(#view-k8s.active) .content,
.app:has(#view-dashboards.active) .content{
  max-width:none;margin:0;padding-left:12px;padding-right:12px;
}
#view-hardware .tree-toggle-btn,#view-hyperv .tree-toggle-btn,#view-dashboards .tree-toggle-btn{
  border-radius:0;border-top:none;border-bottom:none;min-height:auto;align-self:stretch;background:var(--bg2);
}

/* ---------- 远程桌面（Web 推流） ---------- */
#desktopMask.mask{align-items:center;padding:16px}
.desk-modal{
  /* Prefer nearly full viewport; "fullscreen" also targets this element. */
  width:min(96vw,1600px); max-width:none; height:min(92vh,1080px);
  display:flex; flex-direction:column; overflow:hidden;
  /* Avoid leftover transform from .modal animation — it blocks Fullscreen API. */
  animation:deskModalIn .18s cubic-bezier(.4,0,.2,1);
  transform:none;
}
@keyframes deskModalIn{from{opacity:0}to{opacity:1}}
.desk-modal .modal-head{flex:none; padding:12px 16px}
.desk-modal-body{
  padding:0!important; overflow:hidden!important; flex:1 1 auto; min-height:0;
  max-height:none!important; display:flex; flex-direction:column;
}
.desk-layout{display:flex; flex:1; min-height:0; height:100%}
.desk-main{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; background:#0b0e14}
/* Browser fullscreen: fill the display; keep toolbar usable. */
.desk-modal:fullscreen,
.desk-modal:-webkit-full-screen{
  width:100vw; height:100vh; max-width:none; max-height:none; border-radius:0; border:0;
}
.desk-stage:fullscreen,
.desk-stage:-webkit-full-screen{
  width:100vw; height:100vh; background:#000;
}
.desk-stage.is-fullscreen-fallback{
  position:fixed!important; inset:0!important; z-index:100000!important;
  width:100vw!important; height:100vh!important; background:#000;
}
.desk-modal.is-max{
  width:96vw!important; height:92vh!important; max-width:none!important;
}
.desk-toolbar{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px 16px;
  padding:8px 12px; border-bottom:1px solid var(--line); background:var(--panel);
  flex:none; flex-wrap:wrap; position:relative; z-index:5;
}
.desk-tools{display:flex; align-items:center; gap:8px; flex:1 1 auto; flex-wrap:wrap; justify-content:flex-end; position:relative; z-index:6; pointer-events:auto}
.desk-tools .desk-select,.desk-tools button,.desk-tools label{pointer-events:auto; position:relative; z-index:6}
.desk-status-wrap{display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 180px}
.desk-dot{width:8px; height:8px; border-radius:50%; background:var(--muted2); flex:none}
.desk-dot.connecting,.desk-dot.waiting{background:var(--warn,#c9891a); box-shadow:0 0 0 3px rgba(201,137,26,.18); animation:deskPulse 1.2s ease-in-out infinite}
.desk-dot.on{background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft)}
.desk-dot.error{background:var(--crit); box-shadow:0 0 0 3px var(--crit-soft)}
.desk-dot.warn{background:var(--warn,#c9891a); box-shadow:0 0 0 3px rgba(201,137,26,.18)}
@keyframes deskPulse{0%,100%{opacity:1}50%{opacity:.45}}
.desk-status{font-size:12px; color:var(--muted); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.desk-status.err{color:var(--crit-txt)}
.desk-lock-tools{display:flex; align-items:center; gap:4px; flex-wrap:wrap}
.desk-lock-hint{font-size:11px; color:var(--muted); padding:4px 12px 0; line-height:1.4}
.desk-lock-hint.secure{
  color:var(--warn, #c9a227); background:rgba(201,162,39,.08);
  border-bottom:1px solid rgba(201,162,39,.25); padding:6px 12px;
}
.desk-unlock-panel{
  margin:6px 12px 0; padding:10px 12px; border:1px solid var(--border);
  border-radius:8px; background:var(--panel-2, var(--bg)); max-width:420px;
}
.desk-unlock-title{font-weight:600; font-size:13px; margin-bottom:4px}
.desk-unlock-warn{margin:0 0 8px; font-size:11px}
.desk-q-label{font-size:12px; color:var(--muted); display:inline-flex; align-items:center; gap:6px; white-space:nowrap}
.desk-q-label > span{flex:none}
.desk-select,.desk-q-label select.desk-select{
  height:30px; min-width:96px; max-width:180px; box-sizing:border-box;
  font:inherit; font-size:12px; padding:0 28px 0 10px;
  border:1px solid var(--line2); border-radius:6px; background:var(--bg2); color:var(--txt);
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa3b2'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}
#deskMonitor.desk-select{min-width:140px; max-width:220px}
.desk-stage{
  position:relative; flex:1 1 auto; min-height:0; overflow:hidden;
  display:flex; align-items:center; justify-content:center; padding:0; background:#05070c;
}
/* Fill the stage for pointer hit-testing; object-fit:contain letterboxes the
   bitmap inside. (width:auto left most of the stage unclickable — mouse looked
   "dead" even when the WS was connected.) */
#deskCanvas,#deskVideo{
  position:absolute; inset:0; display:block;
  width:100%; height:100%; max-width:none; max-height:none;
  background:#000; cursor:default; outline:none; touch-action:none;
  object-fit:contain; box-shadow:none;
}
.desk-placeholder{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; padding:24px; text-align:center; z-index:2; pointer-events:none;
  background:radial-gradient(ellipse at center, rgba(20,28,44,.92), rgba(5,7,12,.98));
}
.desk-spinner{
  width:28px; height:28px; border-radius:50%;
  border:2px solid rgba(255,255,255,.15); border-top-color:var(--accent);
  animation:spin .8s linear infinite;
}
.desk-ph-title{font-size:14px; font-weight:600; color:var(--txt)}
.desk-ph-sub{font-size:12px; color:var(--muted); max-width:420px; line-height:1.5}
.desk-side{
  flex:0 0 260px; border-left:1px solid var(--line); background:var(--panel);
  padding:14px; display:flex; flex-direction:column; gap:8px; overflow:auto; min-height:0;
}
.desk-side-toggle{
  display:none; width:100%; height:34px; border:1px solid var(--line2); border-radius:6px;
  background:var(--bg2); color:var(--txt); font:inherit; font-size:12px; cursor:pointer;
}
.desk-side-body{display:flex; flex-direction:column; gap:8px; min-height:0}
.desk-side-title{font-size:13px; font-weight:650; color:var(--txt)}
.desk-side-hint{font-size:11px; color:var(--muted2); line-height:1.4}
.desk-field{display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--txt2)}
.desk-input{height:32px; padding:0 8px; border:1px solid var(--line2); border-radius:6px; background:var(--bg2); color:var(--txt); font:inherit; font-size:12px; box-sizing:border-box; width:100%}
.desk-row{display:flex; gap:6px}
.desk-clip{width:100%; box-sizing:border-box; resize:vertical; padding:8px; border:1px solid var(--line2); border-radius:6px; background:var(--bg2); color:var(--txt); font:inherit; font-size:12px}
.desk-xfer{font-size:11px; color:var(--muted); min-height:16px}
.desk-drop-hint{position:absolute; inset:auto 12px 12px 12px; font-size:11px; color:rgba(255,255,255,.35); pointer-events:none; text-align:center; z-index:1}
.desk-stage.drag{outline:2px dashed var(--accent); outline-offset:-4px}
.desk-stage.drag .desk-drop-hint{color:var(--accent-txt)}
.desk-replay{border-top:1px solid var(--line); padding:10px 12px; background:var(--panel2); flex:none; max-height:40%}
.desk-replay-bar{display:flex; justify-content:space-between; align-items:center; margin-bottom:8px}
.desk-sessions-list{display:flex; flex-direction:column; gap:6px; max-height:180px; overflow:auto; margin-bottom:8px}
.desk-sess-row{display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px; border:1px solid var(--line); border-radius:6px; font-size:12px}
@media(max-width:900px){
  .desk-modal{height:min(96vh,100%); width:96vw}
  .desk-layout{flex-direction:column}
  .desk-side{flex:0 0 auto; border-left:none; border-top:1px solid var(--line); max-height:none; padding-top:10px}
  .desk-side-toggle{display:block}
  .desk-side.is-collapsed .desk-side-body{display:none}
  .desk-side:not(.is-collapsed){max-height:40vh}
  .desk-tools{justify-content:flex-start}
  .desk-q-label{font-size:11px}
  .desk-select,.desk-q-label select.desk-select{min-width:72px; max-width:140px}
}

.desktop-btn svg{width:14px;height:14px}

/* ---------- 趋势图交互 ---------- */
.chart-controls{display:flex; gap:8px; margin-bottom:18px; padding:4px 2px 10px; flex-wrap:wrap; align-items:center;
  position:sticky; top:0; z-index:6; background:var(--panel)}
/* 趋势工具栏右端的远程动作（终端/桌面）：图标按钮，与主机卡片上的那两个同形。
   margin-left:auto 把它们推到右端；换行时整组一起走，不会拆散。 */
.chart-actions{display:inline-flex; align-items:center; gap:6px; margin-left:auto}
.chip-icon-btn{display:inline-flex; align-items:center; justify-content:center; padding:5px 9px}
.chip-icon-btn svg{width:15px; height:15px; display:block}
.chip-select,.fc-model-sel{
  appearance:none; -webkit-appearance:none;
  background:var(--panel2); border:1px solid var(--line2); color:var(--muted);
  border-radius:999px; padding:4px 28px 4px 10px; font-size:12px; line-height:1.4;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 12px) 55%,calc(100% - 7px) 55%;
  background-size:5px 5px,5px 5px; background-repeat:no-repeat;
  cursor:pointer; max-width:200px;
}
.chip-select:hover,.fc-model-sel:hover{color:var(--txt); border-color:var(--hover-border)}
.chip-select:disabled,.fc-model-sel:disabled{opacity:.45; cursor:not-allowed}
.chip-select:focus-visible,.fc-model-sel:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
/* 自定义查询周期：datetime-local 起止 + 应用按钮，克制扁平·深色适配 */
.chart-custom-range{display:inline-flex; align-items:center; gap:6px}
.chart-custom-range[hidden]{display:none}
.chart-custom-range .dt-input{font-family:inherit; font-size:12px; color:var(--txt); background:var(--bg2);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:5px 8px; line-height:1.2}
.chart-custom-range .dt-input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.chart-custom-range .dt-sep{color:var(--muted); font-size:12px; user-select:none}
.chart-custom-range .dt-input{cursor:pointer}
/* Body-level datetime popover — sits above .mask (400) so hour/minute clicks register. */
.dt-pop{
  position:fixed; z-index:520; width:292px; padding:10px;
  background:var(--panel); color:var(--txt); border:1px solid var(--line2);
  border-radius:var(--r); box-shadow:var(--shadow-xl);
  font-family:inherit; font-size:12px;
}
.dt-pop-head{display:flex; align-items:center; gap:6px; margin-bottom:8px}
.dt-pop-title{flex:1; text-align:center; font-weight:650; font-variant-numeric:tabular-nums}
.dt-pop-nav{width:28px; height:28px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--txt); border-radius:var(--r-sm); cursor:pointer; font-size:16px; line-height:1}
.dt-pop-nav:hover{border-color:var(--hover-border); color:var(--txt)}
.dt-pop-week,.dt-pop-grid{display:grid; grid-template-columns:repeat(7, 1fr); gap:2px}
.dt-pop-week{margin-bottom:4px; color:var(--muted); font-size:10px; text-align:center}
.dt-pop-day{height:28px; border:0; background:transparent; color:var(--txt); border-radius:6px;
  cursor:pointer; font:inherit; font-variant-numeric:tabular-nums}
.dt-pop-day.is-pad{visibility:hidden; pointer-events:none}
.dt-pop-day:hover{background:var(--accent-soft)}
.dt-pop-day.is-today{box-shadow:inset 0 0 0 1px var(--accent-border)}
.dt-pop-day.is-sel{background:var(--accent); color:#fff}
.dt-pop-time{display:flex; align-items:center; gap:8px; margin:10px 0 8px; padding-top:8px; border-top:1px solid var(--line)}
.dt-pop-time label{display:flex; align-items:center; gap:6px; color:var(--muted); font-size:11px}
.dt-pop-sel{font:inherit; font-variant-numeric:tabular-nums; color:var(--txt); background:var(--bg2);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:4px 6px; min-width:56px}
.dt-pop-act{display:flex; justify-content:flex-end; gap:6px}
.chip-btn.primary{background:var(--accent); color:#fff; border-color:var(--accent)}
.chip-btn.primary:hover{filter:brightness(1.06); color:#fff}
/* Two-up responsive grid on the wide detail modal; collapses to one column on
   narrow screens (min() guard prevents horizontal overflow). Canvas height is
   pinned by JS (HiDPI sizing), so no height:auto here. */
.chart-container{display:grid; grid-template-columns:repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap:16px}
.chart-container canvas{width:100%; display:block; background:var(--bg2); border-radius:var(--r); border:1px solid var(--line); transition:border-color .2s; overflow:hidden}
.chart-container.ai-usage-chart{display:block; min-height:0}
.chart-container.ai-usage-chart canvas{min-height:240px}
/* 窗口概览：曲线之上的一排数字（当前/均值/P95/峰值 + 告警线）。峰值越过告警线的格子
   直接染色——"刚才炸过一次"和"一直很稳"必须一眼分得开。 */
.trend-stats{display:grid; grid-template-columns:repeat(auto-fit, minmax(min(180px,100%), 1fr)); gap:10px; margin:12px 0 4px}
.tstat{background:var(--bg2); border:1px solid var(--line); border-radius:var(--r); padding:8px 10px; min-width:0}
.tstat-k{font-size:11.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tstat-v{font-size:19px; font-weight:600; line-height:1.25; margin-top:2px; font-variant-numeric:tabular-nums}
.tstat-sub{font-size:11px; color:var(--muted); margin-top:2px; font-variant-numeric:tabular-nums}
.tstat-lim{font-size:10.5px; color:var(--muted); opacity:.8; margin-top:1px}
.tstat.is-warn{border-color:#f7b23b; box-shadow:inset 3px 0 0 #f7b23b}
.tstat.is-warn .tstat-v{color:#f7b23b}
.tstat.is-crit{border-color:#f2545b; box-shadow:inset 3px 0 0 #f2545b}
.tstat.is-crit .tstat-v{color:#f2545b}
/* 近期变化（最后 1/4 窗口 vs 最前 1/4）：GPU 概览格用，升高标琥珀、回落标蓝，持平灰色。 */
.tstat-delta{font-size:11px; color:var(--muted); margin-top:1px; font-variant-numeric:tabular-nums}
.tstat-delta.up{color:#f7b23b}
.tstat-delta.down{color:#43b6f0}
/* 当前 GPU 状态与进程占用：挂在 GPU 图组末尾，独占一整行。窄屏横向滚动，不撑破弹窗。 */
.gpu-status{grid-column:1/-1; min-width:0}
.gpu-status .chart-group-sub{font-size:12px; font-weight:600; color:var(--muted); margin:2px 0 6px}
.gpu-status .table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--r)}
.gpu-status-tbl{width:100%; border-collapse:collapse}
.gpu-status-tbl th, .gpu-status-tbl td{padding:6px 10px; font-size:12px; white-space:nowrap; vertical-align:top}
.gpu-status-tbl td:last-child{white-space:normal; min-width:180px}
.gpu-status-tbl .muted{color:var(--muted); font-size:11px; margin-left:2px}
/* 分组标题：主机趋势一屏二十多张图，没有分组只能靠滚动碰运气。占满整行（grid-column
   1/-1），否则它会被当成一张图挤进网格的一格里。 */
.chart-group-title{grid-column:1/-1; display:flex; align-items:center; gap:10px; margin:10px 0 -4px; font-weight:600; font-size:13px; color:var(--muted); letter-spacing:.02em}
.chart-group-title::after{content:""; flex:1; height:1px; background:var(--line2, var(--line))}
.chart-wrap{position:relative; border-radius:var(--r); overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.03)}
.chart-wrap canvas{cursor:crosshair; border:none; border-radius:0; max-width:100%; min-height:200px}
.chart-enlarge{position:absolute; top:10px; right:12px; z-index:3; width:28px; height:28px; border-radius:var(--r-sm);
  border:1px solid var(--line2); background:var(--panel2); color:var(--muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity var(--transition-fast), color var(--transition-fast), transform .12s}
.chart-wrap:hover .chart-enlarge{opacity:1}
.chart-enlarge:hover{color:var(--txt); border-color:var(--accent); background:var(--panel3); transform:scale(1.08)}
.chart-enlarge svg{width:15px; height:15px}
/* z-index MUST sit above .mask (400) / #mfaMask (410): the charts live inside the
   detail modal, and the tip is appended to <body> — at 210 it rendered BEHIND the
   modal, so hovering showed no values (and network values, shown only here, looked
   "missing"). 460 keeps it above every modal but below toasts (500). */
.chart-tip{position:fixed; z-index:460; pointer-events:none; background:var(--panel);
  border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 10px; font-size:11.5px; color:var(--txt);
  box-shadow:var(--shadow-lg); display:none; min-width:132px; max-width:min(320px, calc(100vw - 16px));
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); background:rgba(17,22,33,.8)}
[data-theme="light"] .chart-tip{background:rgba(255,255,255,.85)}
.chart-tip .tip-t{color:var(--muted); font-size:10.5px; margin-bottom:5px; letter-spacing:.02em}
.chart-tip .tip-r{display:flex; align-items:center; gap:6px; margin-top:3px; min-width:0}
.chart-tip .tip-r > span:nth-child(2){overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:140px}
.chart-tip .tip-dot{width:8px; height:8px; border-radius:3px; flex:none}
.chart-tip .tip-v{margin-left:auto; font-weight:700; font-variant-numeric:tabular-nums; flex:none; white-space:nowrap}

/* ---------- 概览页分区标题 ---------- */
.ov-section{margin-bottom:var(--ov-section-gap)}
.ov-section-header{display:flex; align-items:center; gap:10px; margin-bottom:14px}
.ov-section-header h3{font-size:14px; font-weight:650; margin:0; letter-spacing:.01em; color:var(--txt)}
.ov-section-badge{font-size:10px; padding:2px 8px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent-txt);
  font-weight:600; letter-spacing:.02em; border:1px solid var(--accent-border)}

/* ---------- 图表空状态 ---------- */
.chart-empty{display:flex; flex-direction:column; align-items:center; justify-content:center;
  width:100%; padding:40px 20px; color:var(--muted2); text-align:center;
  border:1px dashed var(--line2); border-radius:var(--r); background:var(--bg2)}
.chart-empty svg{width:48px; height:48px; opacity:.35; margin-bottom:10px; color:var(--muted2)}
.chart-empty span{font-size:13px; line-height:1.5}

/* ---------- 告警条目呼吸闪烁（严重级别） ---------- */
@keyframes alertBorderGlow{0%,100%{border-color:var(--line)}50%{border-color:var(--crit-border); box-shadow:0 0 8px 0 var(--crit-soft)}}
.ov-alerts .row-item.critical{animation:alertBorderGlow 2.5s ease-in-out infinite}

.modal.modal-wide{max-width:1120px}
.zoom-hint{font-size:11px; color:var(--muted2); margin-bottom:12px}
#chartZoomCanvas{width:100%; height:auto; background:var(--bg2); border:1px solid var(--line); border-radius:var(--r)}

/* ---------- 远程终端 ---------- */
.term-status{margin-left:auto; font-size:11px; color:var(--muted); display:flex; align-items:center; gap:6px}
.term-status::before{content:""; width:7px; height:7px; border-radius:50%; background:var(--muted2)}
.term-status.on{color:var(--ok-txt)}
.term-status.on::before{background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft)}
.term-status.off{color:var(--crit-txt)}
.term-status.off::before{background:var(--crit)}
.term-modal .modal-head{gap:12px}
.term-body{padding:0 !important}
/* The terminal owns its own scrolling. Left as a plain .modal-body it also
   inherited max-height:74vh + overflow:auto, so on short windows — or narrow
   ones, where .term-hint wraps to two lines — the body grew a SECOND scrollbar
   and pushed the prompt row plus the hint bar below the fold. Bound the modal
   instead and let the screen flex into whatever is left. */
.term-modal{display:flex; flex-direction:column; height:min(78vh, calc(100vh - 88px)); min-height:min(340px, calc(100vh - 88px))}
.term-modal .modal-head{flex:0 0 auto}
.term-modal .modal-body{flex:1 1 auto; min-height:0; max-height:none; overflow:hidden; display:flex; flex-direction:column}
.term-modal .term-tabbar,.term-modal .term-hint,.term-modal .replay-controls{flex:0 0 auto}
.term-modal .term-screens{flex:1 1 auto; min-height:0; display:flex; flex-direction:column}
.term-modal .term-screens > .term-screen,
.term-modal .modal-body > .term-screen{height:100%; flex:1 1 auto; min-height:0; align-self:stretch; width:100%}
.term-screen{position:relative; margin:0; background:var(--term-bg); color:var(--term-text); border:none; border-radius:0 0 var(--r-lg) var(--r-lg);
  font-family:ui-monospace,"SF Mono",Menlo,Consolas,"DejaVu Sans Mono",monospace; font-size:12.5px; line-height:1.25;
  padding:12px 14px; height:62vh; white-space:normal; outline:none; cursor:text;
  /* The cols/rows grid is measured against this box, so the box must not resize
     once output starts. overflow-y:scroll + a stable gutter keep the vertical
     scrollbar outside the content area instead of letting it show up later and
     steal a column; overflow-x:hidden stops a horizontal bar from ever claiming
     the bottom strip where the prompt and newest output live. */
  overflow-x:hidden; overflow-y:scroll; scrollbar-gutter:stable; overscroll-behavior:contain;
  /* Terminal scrollback inserts rows above the live grid; browser scroll
     anchoring would yank the viewport upward and hide the prompt. */
  overflow-anchor:none;
  scroll-padding-bottom:6px;
  font-variant-ligatures:none; font-feature-settings:"liga" 0;
  /* 允许文本选中（复制到剪贴板），移动端长按选中也依赖此属性 */
  user-select:text; -webkit-user-select:text;
  transition:box-shadow var(--transition-fast);}
.term-screen:focus, .term-screen:focus-within, .term-screen.term-focused{
  box-shadow:inset 0 0 0 1px var(--accent-soft), inset 0 0 20px rgba(76,141,255,.04);
}
/* Fixed line box so overlay cursor Y = row.offsetTop stays stable (no 忽高忽低). */
.term-row,.term-sb .term-row{
  white-space:pre; margin:0; padding:0; border:0;
  height:1.25em; line-height:1.25; min-height:0; max-height:1.25em;
  overflow:hidden; box-sizing:border-box;
  user-select:text; -webkit-user-select:text;
}
.term-sb,.term-lv{overflow-anchor:none}
.term-lv{position:relative; contain:layout paint style; will-change:contents}
.term-cursor{
  position:absolute; display:block; box-sizing:border-box;
  background:var(--term-text); color:var(--term-bg); border-radius:1px;
  padding:0; margin:0; line-height:inherit; overflow:hidden;
  text-align:center; white-space:pre;
  pointer-events:none; z-index:2;
}
/* focus-within 规则已移至 .term-input 定义之后统一处理 */
@keyframes termCursorBlink{0%,59%{opacity:1}60%,100%{opacity:.35}}
/* Hidden textarea = IME / virtual-keyboard capture. Pin to the visible bottom of
   the screen box (not content top) so focus never yanks scrollTop to the
   scrollback head when the buffer is long. */
.term-input{
  position:absolute; left:0; top:auto; bottom:0; width:1px; height:1px;
  opacity:0.01; border:none; outline:none; padding:0; margin:0;
  background:transparent; color:transparent; caret-color:transparent;
  resize:none; font-size:16px; z-index:0; overflow:hidden;
  white-space:nowrap; -webkit-appearance:none;
  /* clip-path 确保完全不可见但保持可聚焦（iOS 兼容） */
  clip-path:inset(50%); -webkit-clip-path:inset(50%);
}
/* JS fallback：当 :focus-within 不可靠时，通过 JS 添加 .term-focused 类 */
.term-screen.term-focused .term-cursor,
.term-screen:focus-within .term-cursor{animation:termCursorBlink 1.5s ease-in-out infinite}
.term-screen:not(.term-focused):not(:focus-within) .term-cursor{background:transparent; color:inherit; box-shadow:inset 0 0 0 1px var(--term-text); animation:none}
.term-hint{font-size:11px; color:var(--muted2); padding:9px 16px; border-top:1px solid var(--line);
  background:var(--panel); border-radius:0 0 var(--r-lg) var(--r-lg); letter-spacing:.01em}
#termMask.maximized .term-hint{border-radius:0}
/* 终端右键菜单 */
/* 图标按钮统一的按压反馈，提升一致的触感 */
.tb-icon:active, .tb-action:active, .term-ctl:active, .vt-btn:active, .mini-btn:active, .chart-enlarge:active{transform:translateY(1px)}
/* 主机卡片·终端按钮 */
.term-btn{width:24px; height:24px; border-radius:6px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; flex:none;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast)}
.term-btn svg{width:14px; height:14px}
.term-btn:hover{background:var(--accent-soft); color:var(--accent-txt); border-color:var(--accent-border)}
/* 终端窗口控制条：放大/还原、关闭 */
.term-ctls{display:flex; gap:5px; margin-left:8px}
.term-ctl{width:32px; height:30px; border-radius:8px; border:1px solid var(--line2); background:var(--panel2);
  color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform .08s}
.term-ctl svg{width:15px; height:15px}
.term-ctl:hover{background:var(--panel3); color:var(--txt); border-color:var(--hover-border)}
.term-ctl:active{transform:scale(.92)}
.term-ctl.close:hover{background:var(--crit-soft); color:var(--crit-txt); border-color:var(--crit-border)}
/* 放大态：终端近全屏，头部/提示固定，屏幕区弹性填充 */
#termMask.maximized{padding:14px; align-items:center}
#termMask.maximized .term-modal{max-width:none; width:100%; height:calc(100vh - 28px); display:flex; flex-direction:column}
/* 覆盖基础 .modal-body 的 max-height:74vh 和 overflow:auto，
   否则 flex:1 被 max-height 截断，高度无法填满整个窗口 */
#termMask.maximized .term-modal .modal-body{flex:1; display:flex; flex-direction:column; min-height:0; max-height:none; overflow:hidden}
/* .term-screens 必须是 flex 容器才能将高度传递给 .term-screen。
   基础规则仅 position:relative，子元素 flex:1 无效，回退为内容高度。 */
#termMask.maximized .term-screens{flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden}
#termMask.maximized .term-modal .term-screen{height:100%; flex:1; min-height:0; border-radius:0}

/* ---------- 终端多标签 ---------- */
.term-tabbar{
  display:flex; gap:4px; padding:6px 8px 0;
  background:var(--bg2); border-bottom:1px solid var(--line);
  overflow-x:auto; flex-wrap:nowrap;
  scrollbar-width:thin; scrollbar-color:var(--line2) transparent;
}
/* 隐藏 tabbar 滚动条但保持可滚动 */
.term-tabbar::-webkit-scrollbar{height:3px}
.term-tabbar::-webkit-scrollbar-track{background:transparent}
.term-tabbar::-webkit-scrollbar-thumb{background:var(--line2); border-radius:3px}
.term-tab{
  display:flex; align-items:center; gap:6px;
  max-width:180px; padding:5px 10px 5px 12px;
  border-radius:7px 7px 0 0;
  border:1px solid transparent; border-bottom:none;
  background:transparent; color:var(--muted);
  cursor:pointer; font-size:12px; font-weight:500;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  position:relative;
}
.term-tab span:first-child{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:120px;
}
.term-tab:hover{background:var(--panel2); color:var(--txt)}
.term-tab.active{
  background:var(--panel); color:var(--txt);
  border-color:var(--line); border-bottom-color:var(--panel);
  font-weight:600;
}
.term-tab.active::after{
  content:''; position:absolute; bottom:-1px; left:0; right:0;
  height:1px; background:var(--panel);
}
.term-tab-close{
  display:flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:4px;
  font-size:12px; line-height:1; opacity:.4;
  border:none; background:none; color:inherit;
  cursor:pointer; padding:0; flex:none;
  transition:opacity var(--transition-fast), background var(--transition-fast);
}
.term-tab-close:hover{opacity:1; background:var(--crit-soft); color:var(--crit-txt)}
.term-screens{position:relative}
.term-screens .term-screen{display:none}
.term-screens .term-screen.active{display:block; height:100%; animation:termScreenIn .15s ease both}
@keyframes termScreenIn{from{opacity:.6}to{opacity:1}}

/* ---------- 终端收起悬浮卡片 ---------- */
.term-dock{
  position:fixed; bottom:max(16px, env(safe-area-inset-bottom)); right:max(16px, env(safe-area-inset-right));
  z-index:200; display:flex; flex-direction:row; flex-wrap:wrap-reverse; gap:8px;
  justify-content:flex-end; align-items:flex-end;
  max-width:calc(100vw - 32px); pointer-events:none;
}
.term-dock-item{
  pointer-events:auto;
  display:flex; align-items:center; gap:8px;
  min-width:160px; max-width:260px; height:40px;
  padding:0 6px 0 12px;
  border:1px solid var(--line2); border-radius:10px;
  background:var(--panel);
  box-shadow:0 4px 16px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.08);
  cursor:pointer; user-select:none;
  transition:transform .22s cubic-bezier(.4,0,.2,1), opacity .22s ease,
             box-shadow .22s ease, border-color .22s ease;
  animation:termDockIn .28s cubic-bezier(.34,1.56,.64,1) both;
  -webkit-tap-highlight-color:transparent;
}
.term-dock-item:hover{
  box-shadow:0 8px 28px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.10);
  transform:translateY(-2px);
  border-color:var(--hover-border);
}
.term-dock-item:active{
  transform:translateY(0) scale(.98);
  transition-duration:.08s;
}
.term-dock-item .dock-dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--muted2); flex:none;
  transition:background var(--transition-fast), box-shadow var(--transition-fast);
}
.term-dock-item .dock-dot.on{
  background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft);
  animation:dockPulse 2s ease-in-out infinite;
}
.term-dock-item .dock-dot.off{background:var(--crit); box-shadow:0 0 0 3px var(--crit-soft)}
@keyframes dockPulse{0%,100%{box-shadow:0 0 0 3px var(--ok-soft)}50%{box-shadow:0 0 0 5px var(--ok-soft)}}
.term-dock-item .dock-name{
  font-size:12.5px; font-weight:600; color:var(--txt);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  flex:1; min-width:0; letter-spacing:.01em;
}
.term-dock-item .dock-btn{
  width:28px; height:28px; border-radius:7px; border:none;
  background:transparent; color:var(--muted);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  padding:0; flex:none;
  transition:background var(--transition-fast), color var(--transition-fast);
}
.term-dock-item .dock-btn:hover{background:var(--panel3); color:var(--txt)}
.term-dock-item .dock-btn.close:hover{background:var(--crit-soft); color:var(--crit-txt)}
.term-dock-item .dock-btn svg{width:15px; height:15px}
@keyframes termDockIn{
  from{transform:translateY(24px) scale(.92); opacity:0}
  to{transform:translateY(0) scale(1); opacity:1}
}
.term-dock-item.removing{
  transform:translateY(20px) scale(.9); opacity:0; pointer-events:none;
  transition:transform .2s ease, opacity .2s ease;
}
/* 多个 dock 卡片时添加分隔阴影 */
.term-dock-item + .term-dock-item{box-shadow:0 2px 10px rgba(0,0,0,.12)}

/* ---------- 终端会话列表 ---------- */
.term-session-item{display:flex; align-items:center; gap:10px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel); margin-bottom:8px; transition:border-color var(--transition-fast)}
.term-session-item:hover{border-color:var(--line2)}
.term-session-info{flex:1; min-width:0}
.term-session-host{font-weight:600; font-size:13px}
.term-session-meta{font-size:11px; color:var(--muted2); margin-top:2px}
.term-session-actions{display:flex; gap:6px; flex:none}
.term-session-badge{display:inline-flex; align-items:center; gap:4px; font-size:10px; padding:2px 7px; border-radius:10px; background:var(--ok-soft); color:var(--ok-txt); font-weight:600}
.term-session-badge.observers{background:var(--accent-soft); color:var(--accent-txt)}

/* ---------- 回放控件 ---------- */
.replay-controls{display:flex; align-items:center; gap:10px; padding:10px 14px; border-top:1px solid var(--line); background:var(--panel)}
.replay-progress-wrap{flex:1; min-width:0}
.replay-progress-bg{height:6px; background:var(--bg2); border-radius:3px; cursor:pointer; position:relative; overflow:hidden}
.replay-progress-fill{height:100%; background:var(--accent); border-radius:3px; width:0; transition:width .1s linear}
.replay-time{font-size:11px; color:var(--muted2); white-space:nowrap; font-variant-numeric:tabular-nums}
.replay-speeds{display:flex; gap:3px}
.replay-speed-btn{font-size:11px; padding:3px 7px; border-radius:5px; border:1px solid var(--line); background:var(--panel2); color:var(--muted); cursor:pointer; transition:all var(--transition-fast)}
.replay-speed-btn:hover{color:var(--txt)}
.replay-speed-btn.active{background:var(--accent-soft); color:var(--accent-txt); border-color:var(--accent-border)}

/* ---------- 登录页 ---------- */
.login-mask{position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center; padding:20px; background:var(--bg)}
.login-mask.show{display:flex}
.login-card{background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-lg); width:100%; max-width:372px;
  padding:28px 26px; box-shadow:var(--shadow-lg); animation:modalIn .2s ease}
.login-brand{display:flex; align-items:center; gap:12px; margin-bottom:22px}
.login-brand h1{margin:0; font-size:18px; font-weight:650}
.login-brand .sub{font-size:12px; color:var(--muted); margin-top:2px}
.login-err{display:none; color:var(--crit-txt); font-size:12.5px; margin:0 0 14px; padding:8px 11px; background:var(--crit-soft); border-radius:var(--r-sm); border:1px solid var(--crit-border); line-height:1.45}
.login-err:not(:empty){display:block}
.login-mode-hint{margin:-4px 0 12px; font-size:11.5px; color:var(--muted); line-height:1.4}
.login-demo{margin:0 0 14px; padding:10px 12px; border:1px dashed var(--accent); border-radius:8px; font-size:13px}
.login-demo-title{font-weight:600; margin-bottom:6px; color:var(--accent)}
.login-demo-row{display:flex; justify-content:space-between; align-items:center; gap:8px; padding:2px 0}
.login-demo-row span{color:var(--muted)}
.login-demo-row code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; user-select:all}
.login-demo .btn{margin-top:8px}
.login-divider{display:flex; align-items:center; gap:10px; margin:14px 0 10px; color:var(--muted); font-size:11.5px}
.login-divider::before,.login-divider::after{content:""; flex:1; height:1px; background:var(--line)}
.login-divider[hidden],.sso-login-btns[hidden]{display:none!important}
.sso-login-btns{display:flex; flex-direction:column; gap:8px; width:100%}
.sso-login-btn{display:flex!important; align-items:center; justify-content:center; gap:8px; text-align:center; background:var(--panel2); border:1px solid var(--line2); color:var(--txt); font-weight:550}
.sso-login-btn:hover{border-color:var(--accent-border); background:var(--accent-soft)}
.sso-login-btn .sso-ic{width:18px; height:18px; border-radius:4px; flex:none; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff}
.sso-login-btn[data-sso="oidc"] .sso-ic{background:#4f6bed}
.sso-login-btn[data-sso="feishu"] .sso-ic{background:#3370ff}
.sso-login-btn[data-sso="dingtalk"] .sso-ic{background:#0089ff}
.sso-login-btn[data-sso="wechat"] .sso-ic{background:#07c160}
.sso-setup-checklist{margin:0 0 12px; padding:10px 10px 10px 28px; border:1px dashed var(--line); border-radius:8px; background:var(--panel2); color:var(--txt2); font-size:12px; line-height:1.55}
.sso-preview-bar{margin-bottom:12px}
.sso-provider-card{border:1px solid var(--line); border-radius:8px; background:var(--panel2); margin-bottom:10px; overflow:hidden}
.sso-provider-card[open]{border-color:var(--line2)}
.sso-provider-sum{display:flex; align-items:center; gap:10px; padding:10px 12px; cursor:pointer; list-style:none; font-weight:600; font-size:13px; user-select:none}
.sso-provider-sum::-webkit-details-marker{display:none}
.sso-sum-switch{margin-left:auto}
.sso-provider-body{padding:0 12px 14px; border-top:1px solid var(--line)}
.sso-provider-mark{width:10px; height:10px; border-radius:50%; flex:none}
.sso-provider-mark.feishu{background:#3370ff}
.sso-provider-mark.dingtalk{background:#0089ff}
.sso-provider-mark.wechat{background:#07c160}
.sso-provider-mark.wecom{background:#2b5aed}
.k8s-panel{margin-top:8px}
.k8s-kpi-row{margin:4px 0 12px}
.k8s-kpi-den{font-size:13px;font-weight:500;color:var(--muted);margin-left:2px}
.k8s-log-body{max-height:60vh;overflow:auto;white-space:pre-wrap;word-break:break-word;background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:12px;font-size:12px;line-height:1.45}
.k8s-toolbar{ margin:0 0 12px; gap:10px; flex-wrap:wrap }
.k8s-table-wrap{ width:100%; overflow-x:auto }
.k8s-table{ width:100%; table-layout:auto; border-collapse:collapse }
.k8s-table th, .k8s-table td{ padding:10px 12px; vertical-align:top; text-align:left }
.k8s-actions{ display:flex; flex-wrap:wrap; gap:6px }
.k8s-msg{ max-width:420px; font-size:12px; line-height:1.45; color:var(--muted); word-break:break-word }
.k8s-empty{ padding:28px 16px; text-align:center }
.k8s-cfg .cfg-panel-desc{ margin:4px 0 0; font-size:12px; color:var(--muted); line-height:1.45; max-width:720px }
.k8s-cfg-form-head{ margin:0 0 12px; padding-bottom:10px; border-bottom:1px solid var(--line) }
.k8s-cfg-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; align-items:center }
.k8s-cfg-editing{
  border:1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius:12px; padding:14px 16px;
  background:color-mix(in srgb, var(--accent-soft, var(--panel2)) 40%, var(--panel));
  scroll-margin-top:16px;
}
#k8sPanel tr[data-k8s-row].active-row{ background:var(--accent-soft, var(--panel2)) }
.k8s-unreachable{
  margin:8px 0 0; padding:28px 20px; border:1px solid color-mix(in srgb, var(--crit-border, #e8a0a0) 55%, var(--line));
  border-radius:12px; background:color-mix(in srgb, var(--crit-soft, #fff2f2) 55%, var(--panel));
}
.k8s-unreachable h4{ margin:0 0 8px; color:var(--txt) }
.k8s-err-msg{
  margin:0 auto 14px; max-width:640px; font-size:13px; line-height:1.55; color:var(--crit-txt, #b42318);
  word-break:break-word;
}
.k8s-tip-list{
  list-style:disc; text-align:left; margin:0 auto 16px; padding-left:20px; max-width:560px;
  font-size:12.5px; line-height:1.55; color:var(--muted);
}
.k8s-tip-list li{ margin:4px 0 }
.k8s-unreachable-actions{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center }

/* 容器资源台账 */
#containersPanel .ct-shell{ display:flex; flex-direction:column; gap:12px }
#containersPanel .ct-toolbar{ gap:10px; flex-wrap:wrap; align-items:center }
#containersPanel .ct-layout{
  display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.75fr); gap:12px; align-items:start;
}
@media (max-width:1100px){ #containersPanel .ct-layout{ grid-template-columns:1fr } }
#containersPanel .ct-card{ margin:0 !important }
#containersPanel .ct-detail{
  position:sticky; top:12px; min-height:240px; max-height:calc(100vh - 96px); overflow:auto;
}
#containersPanel .ct-detail-empty{ padding:28px 16px; text-align:center; color:var(--muted) }
#containersPanel .ct-detail-empty h4{ margin:0 0 8px; color:var(--txt) }
#containersPanel .ct-table-wrap{ width:100%; overflow-x:auto }
#containersPanel .ct-table{ width:100%; min-width:720px; table-layout:fixed; border-collapse:collapse }
#containersPanel .ct-table th, #containersPanel .ct-table td{
  padding:10px 12px; vertical-align:top; text-align:left;
}
#containersPanel .ct-row{ cursor:pointer }
#containersPanel .ct-row:hover{ background:var(--panel2) }
#containersPanel .ct-row.active-row{ background:var(--accent-soft) }
#containersPanel .ct-host{ font-weight:600 }
#containersPanel .ct-runtime{ font-size:11px; margin-top:2px }
#containersPanel .ct-name{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#containersPanel .ct-image{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:var(--muted);
}
#containersPanel .ct-port-chips{ display:flex; flex-wrap:wrap; gap:4px }
#containersPanel .ct-port-chip{
  display:inline-flex; padding:2px 8px; border-radius:999px; border:1px solid var(--line);
  background:var(--panel2); font-size:11px; font-variant-numeric:tabular-nums; color:var(--txt);
}
#containersPanel .ct-port-chip.more{
  color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, var(--line));
  background:var(--accent-soft); font-weight:600;
}
#containersPanel .ct-actions{ display:flex; flex-wrap:wrap; gap:6px }
#containersPanel .ct-kv{ display:flex; flex-direction:column; gap:10px; margin-top:8px }
#containersPanel .ct-kv > div{ display:flex; flex-direction:column; gap:4px; font-size:12px }
#containersPanel .ct-kv > div > span{ color:var(--muted2); font-size:11px }
#containersPanel .ct-ports-full{ white-space:pre-wrap; word-break:break-word; line-height:1.45 }
.sso-tab-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;padding:0}
.sso-tab-head .field-hint,.sso-tab-head .cfg-panel-desc{margin:0;flex:1}
.pf-sso-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.pf-sso-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel2)}
.pf-sso-row .pf-sso-meta{display:flex;flex-direction:column;gap:2px;min-width:0}
.pf-sso-row .pf-sso-name{font-weight:600;font-size:13px}
.pf-sso-row .pf-sso-sub{font-size:12px;color:var(--muted);word-break:break-all}
.sso-callback-row{display:flex; align-items:center; gap:8px; margin:8px 0 12px; padding:8px 10px; border-radius:6px; background:var(--panel3,var(--panel)); border:1px solid var(--line); font-size:11.5px}
.sso-callback-row .mono{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--txt2)}
.secret-chip{display:inline-block; margin-left:6px; padding:1px 6px; border-radius:999px; font-size:10px; font-weight:600; color:var(--ok-txt); background:var(--ok-soft); border:1px solid var(--ok-border); vertical-align:middle}
.secret-chip[hidden]{display:none!important}
.field-hint.warn-deny{color:var(--warn-txt)}
.login-links{display:flex; align-items:center; justify-content:center; gap:8px; margin:12px 0 4px; font-size:13px}
.login-links a{color:var(--accent); text-decoration:none; cursor:pointer}
.login-links a:hover{text-decoration:underline}
.login-links .sep{color:var(--muted)}
.mfa-foot{display:flex; justify-content:flex-end; margin-top:12px; gap:8px}

/* ---------- 主机列表视图 ---------- */
/* Columns are sized against the LIST's own width, not the viewport: the folder
   tree eats ~240px, so viewport media queries kept the row wider than its
   container and forced a horizontal scrollbar that clipped the host name. */
.host-list{display:flex; flex-direction:column; gap:4px; container-type:inline-size; container-name:hostlist}
.host.hrow{
  flex-direction:row; align-items:center; gap:10px; padding:8px 12px; cursor:default;
  border-left:3px solid var(--line2); border-radius:var(--r-xs);
  min-height:unset; min-width:0;
}

/* Column header — makes the dense row scannable and stays put while scrolling. */
.hrow-head{
  display:flex; align-items:center; gap:10px; padding:5px 12px; min-width:0;
  position:sticky; top:0; z-index:3;
  /* The scroll pane has 10px of top padding; the spread-only shadow paints an
     opaque band there so rows don't peek above the stuck header. */
  background:var(--panel); box-shadow:0 -10px 0 var(--panel); border-bottom:1px solid var(--line);
  border-left:3px solid transparent; border-radius:var(--r-xs) var(--r-xs) 0 0;
  font-size:10px; font-weight:650; letter-spacing:.04em; color:var(--muted2);
  text-transform:uppercase; user-select:none;
}
.hrow-head .hrow-dot{background:transparent; box-shadow:none}
.hrow-head .hrow-id, .hrow-head .hrow-metrics{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.hrow-head .hrow-actions{opacity:1; justify-content:flex-end}
.hh-os{flex:none; width:44px; text-align:center}
.hh-cat{flex:0 1 7.5em; min-width:3.5em; max-width:7.5em; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.host.hrow.online{border-left-color:var(--ok)}
.host.hrow.offline{border-left-color:var(--crit); opacity:.65}
.host.hrow.stale{border-left-color:var(--warn)}
.host.hrow:hover{background:var(--panel2); border-color:var(--accent)}
.host.hrow.online:hover{border-left-color:var(--ok)}

.hrow-dot{width:7px; height:7px; border-radius:50%; flex:none}
.hrow-dot.on{background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft)}
.hrow-dot.off{background:var(--gray-off)}

/* Flexible columns: they share the available width instead of forcing the row
   past its container. min-width:0 lets the ellipsis do its job. */
.hrow-id{min-width:0; flex:1 1 190px; display:flex; flex-direction:column; gap:1px; overflow:hidden}
.hrow-sub{font-size:10px; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:4px}
.hrow-name{font-weight:650; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer}
.hrow-name:hover{color:var(--accent)}
.hrow-sub{font-size:10px; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:4px}
.hrow-sep{color:var(--muted2); margin:0 2px}

.host.hrow .os-badge{flex:none; width:44px; text-align:center; justify-content:center; display:inline-flex}
.host.hrow .cat-badge{flex:0 1 7.5em; min-width:3.5em; max-width:7.5em; text-align:center; justify-content:center; display:inline-block}

/* Mini metric bars: bounded range keeps 3-bar and 4-bar rows visually aligned
   while still compressing on narrow layouts instead of overflowing. */
.hrow-metrics{display:flex; gap:10px; flex:1 1 290px; min-width:0; max-width:340px; align-items:center; overflow:hidden}
.hrow-mbar{display:flex; align-items:center; gap:5px; font-size:11px; flex:1; min-width:0}
.hrow-mbar .hm-k{color:var(--muted2); font-size:9px; flex:none; width:24px}
.hrow-mbar .hm-track{flex:1; min-width:20px; height:3px; background:var(--panel3); border-radius:2px; overflow:hidden}
.hrow-mbar .hm-fill{height:100%; border-radius:2px; transition:width var(--transition)}
.hrow-mbar .hm-v{font-weight:650; min-width:24px; text-align:right; font-size:10px; flex:none}

.hrow-net{font-size:10px; color:var(--muted); flex:0 1 132px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:3px}
.hrow-load{font-size:10px; color:var(--muted2); flex:0 1 118px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hrow-last{font-size:10px; flex:0 0 112px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right}
.hrow-status{display:inline-flex; align-items:center; gap:3px; border-radius:4px; padding:1px 7px; font-size:10px; font-weight:600}
.hrow-status.online{color:var(--ok-txt); background:var(--ok-soft)}
.hrow-status.offline{color:var(--crit-txt); background:var(--crit-soft)}
.hrow-status.stale{color:var(--warn-txt); background:var(--warn-soft)}

/* The width is reserved even while hidden so rows don't reflow on hover. */
.hrow-actions{opacity:0; transition:opacity var(--transition-fast); display:flex; gap:4px; flex:0 0 78px; justify-content:flex-end}
.host.hrow:hover .hrow-actions, .host.hrow:focus-within .hrow-actions{opacity:1}
.host.hrow .term-btn{opacity:1}

/* Progressive disclosure: drop the least decision-relevant column first. */
@container hostlist (max-width:1150px){ .hrow-load{display:none} }
@container hostlist (max-width:1000px){ .hrow-net{display:none} }
@container hostlist (max-width:860px){ .host.hrow .cat-badge, .hh-cat{display:none} }
@container hostlist (max-width:720px){
  .hrow-metrics{flex-basis:170px; gap:7px}
  .hrow-mbar .hm-k{display:none}
  .hrow-last{flex-basis:92px}
}
@container hostlist (max-width:560px){
  .hrow-head{display:none}
  .host.hrow{flex-wrap:wrap; gap:8px; padding:10px 12px}
  .hrow-id{flex:1 1 100%}
  .hrow-metrics{flex:1 1 100%; max-width:none}
  .hrow-mbar .hm-k{display:inline}
  .hrow-last{flex:1 1 auto; text-align:left}
  .hrow-actions{opacity:1; margin-left:auto}
}

/* Browsers without container queries fall back to the viewport heuristic. */
@supports not (container-type:inline-size){
  @media(max-width:1100px){ .hrow-net, .hrow-load{display:none} }
  @media(max-width:820px){ .host.hrow{flex-wrap:wrap} .hrow-metrics{flex-basis:170px} .hrow-id{flex:1 1 120px} }
}

/* ---------- 表面细节：极细顶部高光（"上方光源"质感，克制非炫光） ---------- */
.card, .check-card, .host:not(.hrow){ box-shadow:inset 0 1px 0 rgba(255,255,255,.04) }

/* ---------- 监控探针行（独立面板，保留给 checkTopPanels 使用） ---------- */
.checks-panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px;
  box-shadow:0 1px 2px rgba(0,0,0,.08); transition:border-color var(--transition), box-shadow var(--transition)}
.checks-panel:hover{border-color:var(--line2)}
.checks-title{font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.02em; margin-bottom:6px}
.checks-item{display:flex; align-items:center; gap:10px; padding:5px 6px; border-radius:6px;
  cursor:pointer; transition:background var(--transition-fast); border-left:3px solid transparent}
.checks-item:hover{background:var(--panel2); border-left-color:var(--accent)}
.checks-name{width:92px; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:var(--txt2)}
.checks-bar{flex:1; height:7px; background:var(--panel3); border-radius:4px; overflow:hidden; min-width:30px}
.checks-bar-fill{height:100%; border-radius:4px; transition:width var(--transition), background var(--transition)}
.checks-val{width:60px; flex:none; text-align:right; font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--txt)}
.checks-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:16px}

/* ---------- 响应式 ---------- */
.backdrop{display:none}

/* 平板横屏 / 小桌面 (≤1200px) */
@media(max-width:1200px){
  .grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
  .top-grid{grid-template-columns:repeat(2,1fr)}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .cards{grid-template-columns:repeat(3,1fr)} /* 6卡→2行×3列，每行撑满全宽 */
}
/* 平板竖屏 (≤900px)：侧栏变抽屉 */
@media(max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{position:fixed; left:0; top:0; width:var(--sidew); transform:translateX(-100%); transition:transform .22s ease}
  .app.nav-open .sidebar{transform:none; box-shadow:var(--shadow-xl)}
  .app.nav-open .backdrop{display:block; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:55; backdrop-filter:var(--blur-sm)}
  .tb-icon{display:flex}
  .content{padding:16px 16px 40px}
  .topbar{padding:10px 16px}
  .search{width:200px; max-width:40vw}
}
/* 手机横屏 / 大手机 (≤700px) */
@media(max-width:700px){
  .grid{grid-template-columns:1fr}
  .top-grid{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr}
  .topbar{flex-wrap:wrap; gap:8px}
  .page-head{flex:1 1 100%; order:-1}
  .search{width:100%; max-width:none; margin-left:0}
  /* topbar 工具栏折叠 */
  #widthBtn{display:none}
  .select-wrap{min-width:0}
}
/* 手机竖屏 (≤480px) */
@media(max-width:480px){
  :root{--sidew:260px}
  body{font-size:14px}
  .cards{grid-template-columns:1fr 1fr; gap:8px}
  .card{padding:12px; gap:10px}
  .card .ic{width:32px; height:32px; border-radius:7px}
  .card .ic svg{width:16px; height:16px}
  .card .v{font-size:19px}
  .card .k{font-size:11px}
  .grid{grid-template-columns:1fr; gap:10px}
  .host{padding:14px; min-height:unset}
  .host-head{flex-wrap:wrap; gap:8px}
  .host-tags{flex-wrap:wrap}
  .modal{max-width:100vw; border-radius:0}
  .modal-wide{max-width:100vw !important}
  .modal-body{padding:14px 16px; max-height:80vh}
  .grid2{grid-template-columns:1fr}
  .search{width:100%; max-width:none; margin-left:0; padding:10px 14px}
  .page-sub{display:none}
  /* 列表视图：窄屏换行布局 */
  .hrow-head{display:none}
  .host.hrow{flex-wrap:wrap; gap:8px; padding:10px 14px}
  .hrow-id{flex:1 1 100%}
  .hrow-metrics{flex:1 1 100%; max-width:none; gap:8px}
  .hrow-net, .hrow-load{display:none}
  .hrow-last{flex:1 1 auto; text-align:left}
  .hrow-actions{opacity:1; margin-left:auto}
  /* 触摸优化：最小 44px（Apple HIG） */
  .btn, .tb-icon, .tb-action, .chip-btn{min-height:var(--touch-min); padding:10px 16px}
  .vt-btn{width:40px; height:40px}
  .mini-btn{width:var(--touch-min); height:var(--touch-min)}
  .term-btn{width:var(--touch-min); height:var(--touch-min)}
  .x-btn{width:var(--touch-min); height:var(--touch-min)}
  .token-action-btn{width:var(--touch-min); height:var(--touch-min)}
  /* 列表项触摸增大 */
  .row-item{padding:14px 16px; flex-wrap:wrap; row-gap:4px}
  .row-item .msg{min-width:0; flex:1 1 100%; order:99}
  .row-item.log-row .log-user{flex:0 0 auto; max-width:40%; font-size:12px}
  .alert-ip{display:none}
  .alert-time{font-size:10px; margin-left:auto}
  .src{display:none}
  .log-time{font-size:10px}
  .host{padding:14px}
  /* 终端手机端默认全屏 */
  #termMask{padding:0; align-items:stretch}
  #termMask .term-modal{max-width:none; width:100%; height:100vh; height:100dvh}
  #termMask .term-screen{height:100%; flex:1; font-size:11px}
  /* 移动端键盘弹出时使用 dvh 适配可视区域 */
  #termMask .term-modal{height:100dvh}
  /* 确保 textarea 在移动端可聚焦（最小触控区域） */
  .term-input{font-size:16px !important; min-width:1px; min-height:1px}
  /* 收起悬浮卡片：移动端底部全宽条形 */
  .term-dock{left:0; right:0; bottom:0; gap:4px; max-width:none; flex-direction:row; justify-content:center}
  .term-dock-item{min-width:0; max-width:none; flex:1; border-radius:8px 8px 0 0}
  /* section-title 工具栏换行 */
  .section-title{row-gap:8px}
  .section-title .search{margin-left:0}
  .section-title > div{flex-wrap:wrap; gap:6px}
  /* 资源热力图响应式 */
  .rh-hdr-cell{padding:6px 5px 8px; font-size:10px}
  .rh-host{padding:0 6px; font-size:11px; max-width:100px}
  .rh-cell{padding:4px 5px}
  .rh-bar{max-width:60px}
  .rh-val{width:42px; font-size:11px}
  /* 监控探针面板紧凑 */
  .checks-name{width:70px; font-size:11px}
  .checks-val{width:48px; font-size:11px}
  /* 日志筛选控件换行 */
  .log-filter{gap:5px}
  /* 空态引导 */
  .ob-steps{grid-template-columns:1fr}
  .onboard{padding:16px}
  /* 登录页移动端适配：增大触控区域、防止 iOS 自动缩放 */
  .login-mask{padding:16px}
  .login-card{max-width:100%; padding:24px 20px}
  .login-card .field input{
    font-size:16px !important; /* 防止 iOS 自动放大 */
    padding:12px 14px; /* 增大输入高度 */
    min-height:var(--touch-min);
  }
  .login-card .btn{
    min-height:var(--touch-min); /* 登录按钮触控区域 */
    font-size:16px;
    padding:12px 20px;
  }
  .login-err{
    word-wrap:break-word; /* 错误文本换行 */
    white-space:normal;
    font-size:13px;
    padding:8px 12px;
  }
  .login-brand h1{font-size:16px}
  .login-brand .sub{font-size:11px}
  .login-links{font-size:14px}
  .login-links a{min-height:var(--touch-min); display:inline-flex; align-items:center}
}
/* 安全区域适配（iPhone 刘海/底部横条） */
@supports(padding:env(safe-area-inset-top)){
  .topbar{padding-top:max(12px, env(safe-area-inset-top)); padding-left:max(24px, env(safe-area-inset-left)); padding-right:max(24px, env(safe-area-inset-right))}
  .content{padding-bottom:max(48px, env(safe-area-inset-bottom))}
  .sidebar{padding-top:max(18px, env(safe-area-inset-top)); padding-bottom:max(12px, env(safe-area-inset-bottom))}
  .modal-body{padding-bottom:max(20px, env(safe-area-inset-bottom))}
  .term-hint{padding-bottom:max(9px, env(safe-area-inset-bottom))}
  .modal-foot{padding-bottom:max(14px, env(safe-area-inset-bottom))}
  .replay-controls{padding-bottom:max(10px, env(safe-area-inset-bottom))}
  .term-dock{right:max(8px, env(safe-area-inset-right)); bottom:max(8px, env(safe-area-inset-bottom))}
  .toast{bottom:max(24px, env(safe-area-inset-bottom))}
  .term-ctls{margin-right:max(4px, env(safe-area-inset-right))}
  /* 登录页安全区域适配 */
  .login-mask{padding-top:max(20px, env(safe-area-inset-top)); padding-bottom:max(20px, env(safe-area-inset-bottom))}
}
/* 触摸设备：悬停效果改为常显 */
@media(hover:none){
  .x-btn{opacity:1}
  .hrow-actions{opacity:1}
  .ch-actions{opacity:1 !important}
  .chart-enlarge{opacity:1}
  /* 触摸设备上移除 hover-only 的过渡，避免"粘性悬停" */
  .host:hover, .card:hover, .row-item:hover, .check-card:hover, .nav-item:hover{background:var(--panel); border-color:var(--line)}
}
/* 性能优化：动画元素启用 GPU 加速。
 * 不给 .modal 常驻 will-change——会把弹窗提升为独立合成层，加重 Windows 原生 select 弹出层灰闪。 */
.toast, .pulse, .mfa-thumb, .fill, .term-cursor{will-change:transform, opacity}
.chart-wrap canvas{will-change:transform}
/* 全局 focus-visible 可达性（排除表单元素，它们使用项目自定义样式） */
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible, .chip-btn:focus-visible,
.pager button:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; border-radius:var(--r-sm)
}
/* 表单元素 focus-visible 不显示浏览器默认 outline */
select:focus-visible, input:focus-visible{outline:none !important}
/* 敏感操作确认强化 */
.btn.danger.confirm-pulse{animation:dangerPulse 1.5s ease-in-out infinite}
@keyframes dangerPulse{0%,100%{box-shadow:0 0 0 0 var(--crit-soft)}50%{box-shadow:0 0 0 4px var(--crit-soft)}}

/* ===== 两步验证（TOTP / MFA） ===== */
/* 应用内确认对话框：叠在普通 mask / MFA 之上 */
#uiConfirmMask{z-index:480; align-items:center; padding:24px 16px}
#uiConfirmMask .ui-confirm-modal{max-width:440px}
#uiConfirmMask .ui-confirm-msg{margin:0; font-size:14px; line-height:1.55; color:var(--txt); white-space:pre-wrap}
#uiConfirmMask .ui-confirm-detail{margin:10px 0 0}
#uiConfirmMask .ui-confirm-warn .modal-head h3{color:var(--warn-txt, #b45309)}
#uiConfirmMask .ui-confirm-danger .modal-head h3{color:var(--danger, #c00)}
#installTokenPolicySection .lc-badge.off{opacity:.75; background:var(--danger-soft, rgba(200,0,0,.12)); color:var(--danger, #c00)}

.mfa-row{display:flex; align-items:center; gap:14px; justify-content:space-between}
.mfa-info{min-width:0}
.mfa-state{font-size:13px; font-weight:600; padding:2px 10px; border-radius:999px; display:inline-block}
.mfa-state.on{color:var(--ok-txt); background:var(--ok-soft); border:1px solid var(--ok-border)}
.mfa-state.off{color:var(--warn-txt); background:var(--warn-soft); border:1px solid var(--warn-border)}
.mfa-desc{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.5}
.mfa-steps{margin:0 0 14px; padding-left:20px; font-size:13px; color:var(--txt); line-height:1.75}
.mfa-steps b{color:var(--accent-txt)}
.mfa-qr{display:flex; justify-content:center; margin:6px 0 14px; min-height:40px}
.qr-img{border-radius:10px; box-shadow:0 2px 12px rgba(0,0,0,.18), 0 0 0 8px #fff; background:#fff; width:240px; height:240px; display:block}
.mfa-secret{display:flex; align-items:center; gap:10px; justify-content:center; font-size:13px; color:var(--muted); margin-bottom:14px; flex-wrap:wrap}
.mfa-secret code{font-size:14px; letter-spacing:1px; color:var(--txt); background:var(--panel3); padding:4px 10px; border-radius:var(--r-sm)}

/* MFA toggle switch */
.mfa-switch{position:relative; display:inline-flex; cursor:pointer; flex-shrink:0}
.mfa-switch input{position:absolute; opacity:0; width:0; height:0}
.mfa-track{width:46px; height:26px; border-radius:999px; background:var(--panel3); border:1px solid var(--line2); transition:background .25s, border-color .25s; display:flex; align-items:center; padding:0 3px}
.mfa-thumb{width:18px; height:18px; border-radius:50%; background:var(--gray-txt); transition:transform .25s, background .25s; flex-shrink:0}
.mfa-switch input:checked + .mfa-track{background:rgba(49,196,107,.25); border-color:var(--ok-border)}
.mfa-switch input:checked + .mfa-track .mfa-thumb{transform:translateX(20px); background:var(--ok-txt)}
.mfa-switch input:not(:checked) + .mfa-track .mfa-thumb{transform:translateX(0)}
.mfa-switch input:focus-visible + .mfa-track{box-shadow:0 0 0 3px var(--accent-soft)}

.btn.sm{padding:5px 12px; font-size:13px}

/* ============================================================
   P1-1: 主题切换全局过渡（颜色平滑变化，避免闪屏）
   ============================================================ */
:root{
  color-scheme:dark;
}
[data-theme="light"]{
  color-scheme:light;
}
/* Theme transition: only on container-level elements, NOT * (performance) */
.app, .sidebar, .topbar, .btn, .card, .nav-item, .modal, .toast, .term-screen{
  transition-property:background-color, border-color, color;
  transition-duration:.2s;
  transition-timing-function:ease;
}
/* 排除不应过渡的元素（终端、图表等需要即时响应） */
.term-screen, .term-screen *, canvas, .skeleton, .skeleton *{
  transition-property:none;
}

/* ============================================================
   P0-3: 骨架屏（Skeleton Loading）
   ============================================================ */
.skeleton{
  background:linear-gradient(90deg, var(--panel2) 25%, var(--panel3) 50%, var(--panel2) 75%);
  background-size:200% 100%;
  animation:shimmer 1.4s ease-in-out infinite;
  border-radius:var(--r-sm);
}
@keyframes shimmer{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}
.skeleton-card{
  height:80px; border-radius:var(--r); margin-bottom:12px;
  display:flex; align-items:center; gap:14px; padding:16px;
}
.skeleton-card .sk-icon{width:36px; height:36px; border-radius:var(--r-sm); flex-shrink:0}
.skeleton-card .sk-lines{flex:1}
.skeleton-card .sk-line{height:14px; border-radius:4px; margin-bottom:8px}
.skeleton-card .sk-line.w60{width:60%}
.skeleton-card .sk-line.w40{width:40%}
.skeleton-host{
  height:120px; border-radius:var(--r);
  border:1px solid var(--line);
}
.skeleton-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px}

/* ============================================================
   P2-4: 空状态设计
   ============================================================ */
.empty-state{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 24px; text-align:center;
}
.empty-state .empty-icon{
  width:64px; height:64px; margin-bottom:16px;
  opacity:.4; color:var(--muted);
}
.empty-state .empty-icon svg{width:100%; height:100%}
.empty-state h4{font-size:15px; font-weight:600; color:var(--txt2); margin-bottom:6px}
.empty-state p{font-size:13px; color:var(--muted); margin-bottom:16px}
.empty-state .btn{margin-top:4px}

/* ============================================================
   P2-2: 增强模态弹窗动画
   ============================================================ */
.mask{
  opacity:0;
  transition:opacity var(--transition);
}
.mask.show{
  opacity:1;
}
.modal{
  transform:scale(.96) translateY(8px);
  opacity:0;
  transition:transform var(--transition), opacity var(--transition);
}
.mask.show .modal{
  transform:scale(1) translateY(0);
  opacity:1;
}

/* ============================================================
   P0-4: Toast 堆叠管理
   ============================================================ */
#toast{
  transition:opacity var(--transition), transform var(--transition);
}

/* ============================================================
   P2-3: 图表网格线/图例增强（浅色主题适配）
   ============================================================ */
[data-theme="light"] .mask{background:rgba(0,0,0,.30)}
[data-theme="light"] ::-webkit-scrollbar-thumb{background:#cdd4de}

@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
.spin{display:inline-block; vertical-align:middle}
/* 按钮提交中状态 */
.btn[disabled], .tb-icon[disabled], .tb-action[disabled]{opacity:.55; pointer-events:none; cursor:wait}
.btn[disabled] .spin{margin-right:4px}

/* ============================================================
   P2-1: 前端模块化拆分后的兼容样式
   ============================================================ */
/* 分页器响应式 */
@media(max-width:480px){
  .pager{flex-wrap:wrap; gap:4px}
  .pager button{min-width:32px; padding:4px 6px}
}
.btn.ghost.sm{padding:3px 10px; font-size:12px}

/* ===== 多用户 / RBAC ===== */
.admin-only{display:none !important}
body[data-role="admin"] .admin-only{display:inline-flex !important}
body[data-role="admin"] .user-dropdown-item.admin-only{display:flex !important}
body[data-role="admin"] .tab.admin-only{display:inline-flex !important}
/* 只读角色：隐藏最明显的写操作入口（后端 routeAllowed 才是真正的安全边界）*/
body[data-role="viewer"] .x-btn,
body[data-role="viewer"] .term-btn,
body[data-role="viewer"] #installBtn{display:none !important}
.modal.wide{max-width:640px; width:92%}
.users-toolbar{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap}
.global-mfa-row{display:flex; align-items:center; gap:14px; justify-content:space-between; padding:12px 14px; border:1px solid var(--accent-border); border-radius:var(--r-sm); margin-bottom:14px; background:var(--accent-soft)}
.global-mfa-info{min-width:0}
.global-mfa-title{font-size:14px; font-weight:600; color:var(--txt); display:block; margin-bottom:4px}
.global-mfa-info .mfa-desc{margin-top:0}
.user-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--r-sm); margin-bottom:8px; background:var(--panel2)}
.user-info{min-width:0}
.user-main{display:flex; align-items:center; gap:8px}
.user-name{font-weight:600; font-size:14px; color:var(--txt)}
.role-badge{font-size:11px; font-weight:600; padding:1px 8px; border-radius:999px; border:1px solid transparent; letter-spacing:.02em}
.role-badge.role-admin{color:var(--crit-txt); background:var(--crit-soft); border-color:var(--crit-border)}
.role-badge.role-operator{color:var(--accent-txt); background:var(--accent-soft); border-color:var(--accent-border)}
.role-badge.role-viewer{color:var(--muted); background:rgba(132,146,166,.1); border-color:rgba(132,146,166,.2)}
.user-mfa{font-size:10px; font-weight:700; color:var(--ok-txt); background:var(--ok-soft); padding:1px 6px; border-radius:4px; letter-spacing:.03em; border:1px solid var(--ok-border)}
.user-sub{font-size:12px; color:var(--muted); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.user-acts{display:flex; gap:4px; flex:none; flex-wrap:wrap; justify-content:flex-end}
.ubtn-del{color:var(--crit-txt)}

/* ---------- 自动化运维 ---------- */
/* Playbook cards laid out as a responsive grid (matches the forward-grid pattern)
   for a cleaner, more scannable automation view than a full-width stack. */
#playbookList{display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; align-items:stretch}
/* 编排剧本·列表视图：复用 .pb-card 结构，仅重排为紧凑单行（保持 data-pbact 对 .pb-card[data-id] 的依赖不变） */
#playbookList.pb-listmode{grid-template-columns:1fr; gap:8px}
#playbookList.pb-listmode .pb-card{display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:16px; padding:10px 16px}
#playbookList.pb-listmode .pb-card-top{flex:1 1 auto; min-width:0; align-items:center}
#playbookList.pb-listmode .pb-desc{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:520px}
#playbookList.pb-listmode .pb-card-foot{flex:0 0 auto; width:auto; margin-top:0; border-top:none; padding-top:0; gap:14px}

/* 主机巡检 Tab */
.insp-hero{display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; align-items:flex-end;
  margin:0 0 14px; padding:16px 18px; border:1px solid var(--line); border-radius:12px;
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 55%, var(--panel)), var(--panel))}
.insp-kicker{font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent-txt); margin-bottom:4px}
.insp-hero-desc{margin:0; max-width:640px; font-size:13px; line-height:1.55; color:var(--muted)}
.insp-hero-actions{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.insp-layout{display:grid; grid-template-columns:280px 1fr; gap:14px; min-height:480px}
@media (max-width:1100px){.insp-layout{grid-template-columns:1fr}}
.insp-hosts-pane,.insp-main-pane{background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px 14px}
.insp-pane-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; font-weight:600}
.insp-check-all{font-size:12px; color:var(--muted); font-weight:500; display:flex; gap:6px; align-items:center}
.insp-host-search{width:100%; margin-bottom:8px; padding:7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--panel2); color:var(--txt); font-size:12px}
.insp-host-list{max-height:620px; overflow:auto; display:flex; flex-direction:column; gap:4px}
.insp-empty-mini{padding:16px 8px; color:var(--muted); font-size:12px; text-align:center}
.insp-host-row{display:grid; grid-template-columns:18px 1fr; gap:2px 8px; padding:8px; border-radius:8px; border:1px solid transparent; cursor:pointer}
.insp-host-row:hover{background:var(--panel2)}
.insp-host-row.off{opacity:.55; cursor:not-allowed}
.insp-host-row input{grid-row:span 2; margin-top:3px}
.insp-host-name{font-size:13px; font-weight:600}
.insp-host-meta{font-size:11px; color:var(--muted); grid-column:2}
.insp-stats{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px}
.insp-stat-card{min-width:88px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel2); display:flex; flex-direction:column; gap:2px}
.insp-stat-card b{font-size:18px}
.insp-stat-card span{font-size:11px; color:var(--muted)}
.insp-stat-card.ok b{color:var(--ok-txt)}
.insp-stat-card.warn b{color:var(--warn-txt,#c9891a)}
.insp-stat-card.crit b,.insp-stat-card.err b{color:var(--crit-txt)}
.insp-split{display:grid; grid-template-columns:minmax(260px,.9fr) minmax(320px,1.4fr); gap:12px; align-items:start}
@media (max-width:1200px){.insp-split{grid-template-columns:1fr}}
.insp-batch-col{min-width:0}
.insp-batch{border:1px solid var(--line); border-radius:10px; margin-bottom:10px; overflow:hidden; background:var(--panel2)}
.insp-batch.active-batch{border-color:var(--accent-border); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent-border) 40%, transparent)}
.insp-batch-head{display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--line)}
.insp-fleet-btn{display:flex; flex-wrap:wrap; gap:8px; align-items:center; border:0; background:transparent; color:inherit; cursor:pointer; padding:0; text-align:left}
.insp-fleet-btn.active strong{color:var(--accent-txt)}
.insp-batch-actions{display:flex; gap:6px; flex-wrap:wrap}
.insp-items{display:flex; flex-wrap:wrap; gap:8px; padding:10px}
.insp-item{display:flex; flex-wrap:wrap; gap:6px; align-items:center; border:1px solid var(--line); background:var(--panel); border-radius:8px; padding:8px 10px; cursor:pointer; text-align:left}
.insp-item:hover,.insp-item.active{border-color:var(--accent-border); background:var(--accent-soft)}
.insp-item-name{font-weight:600; font-size:13px}
.insp-item-meta{font-size:11px; color:var(--muted)}
.insp-badge{font-size:11px; font-weight:700; padding:2px 7px; border-radius:999px; border:1px solid var(--line); color:var(--muted)}
.insp-badge.ok,.insp-badge.done{color:var(--ok-txt); background:var(--ok-soft); border-color:var(--ok-border)}
.insp-badge.warn{color:var(--warn-txt,#c9891a); background:rgba(201,137,26,.12); border-color:rgba(201,137,26,.3)}
.insp-badge.crit,.insp-badge.error{color:var(--crit-txt); background:var(--crit-soft); border-color:var(--crit-border)}
.insp-badge.running,.insp-badge.pending{color:var(--accent-txt); background:var(--accent-soft); border-color:var(--accent-border)}
.insp-report{border:1px solid var(--line); border-radius:12px; padding:14px 16px; background:linear-gradient(180deg,var(--panel2),var(--panel));
  min-height:360px; position:sticky; top:8px; min-width:0; overflow:auto; max-height:calc(100vh - 120px)}
.insp-report-head{display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px}
.insp-report-head h3{margin:6px 0 4px; font-size:18px}
.insp-report-result{display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px}
.insp-export-wrap{display:inline-flex; gap:4px; align-items:center}
.insp-export-wrap select{font-size:12px; padding:4px 6px; border-radius:6px; border:1px solid var(--line); background:var(--panel)}
.insp-metrics{display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:8px; margin-bottom:14px}
.insp-metrics > div{padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--panel); display:flex; flex-direction:column; gap:2px}
.insp-metrics b{font-size:16px}
.insp-metrics span{font-size:11px; color:var(--muted)}
.insp-advice{margin:0 0 14px; padding:12px 14px; border-radius:10px; border:1px solid color-mix(in srgb, var(--accent-border) 50%, var(--line));
  background:color-mix(in srgb, var(--accent-soft) 40%, var(--panel))}
.insp-advice h4,.insp-findings h4{margin:0 0 8px; font-size:14px}
.insp-advice ul{margin:0; padding-left:18px; line-height:1.55; font-size:13px}
.insp-rec-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-bottom:14px}
.insp-rec-block{border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--panel)}
.insp-rec-block h5{margin:0 0 6px; font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em}
.insp-rec-block ul{margin:0; padding-left:16px; font-size:12px; line-height:1.5}
.insp-findings ul{margin:6px 0 14px; padding-left:18px}
.insp-finding.warn{color:var(--warn-txt,#c9891a)}
.insp-finding.crit{color:var(--crit-txt)}
.insp-agg-table{font-size:12px; width:100%; table-layout:fixed; border-collapse:collapse}
.insp-agg-table td,.insp-agg-table th{padding:6px 8px; border-bottom:1px solid var(--line); vertical-align:top;
  word-break:break-word; overflow-wrap:anywhere; white-space:normal}
.insp-agg-table td.insp-host-chips{color:var(--muted)}
.insp-toc{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px}
.insp-toc-a{font-size:11px; padding:3px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); text-decoration:none;
  max-width:100%; overflow-wrap:anywhere}
.insp-toc-a.warn{border-color:rgba(201,137,26,.35); color:var(--warn-txt,#c9891a)}
.insp-toc-a.crit{border-color:var(--crit-border); color:var(--crit-txt)}
/* minmax + min-width:0：防止网格子项把长文本顶破卡片 */
.insp-sections{display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr)); gap:10px; align-items:start}
.insp-sec{border:1px solid var(--line); border-radius:8px; padding:10px 12px; background:var(--panel); min-width:0; overflow:hidden}
.insp-sec-wide{grid-column:1 / -1}
.insp-sec.warn{border-color:rgba(201,137,26,.35)}
.insp-sec.crit{border-color:var(--crit-border)}
.insp-sec-head{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; min-width:0}
.insp-sec-head h4{margin:0; font-size:14px; min-width:0; overflow-wrap:anywhere}
.insp-sec-head .hint{min-width:0; overflow-wrap:anywhere}
.insp-table{width:100%; border-collapse:collapse; font-size:12px; table-layout:fixed}
.insp-table td{padding:5px 0; border-bottom:1px solid var(--line); vertical-align:top;
  word-break:break-word; overflow-wrap:anywhere; white-space:normal; line-height:1.45}
.insp-table td:first-child{color:var(--muted); width:40%; padding-right:10px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:11px}
.insp-table td:last-child{width:60%}
.insp-table tr.warn td:last-child,.insp-table tr.crit td:last-child{font-weight:600}
.insp-table tr.crit td:last-child{color:var(--crit-txt)}
.insp-table tr.warn td:last-child{color:var(--warn-txt,#c9891a)}
/* 内核参数等长键值：上下堆叠，彻底避免两列挤爆 */
.insp-kv{display:flex; flex-direction:column; gap:0; min-width:0}
.insp-kv-row{display:flex; flex-direction:column; gap:2px; padding:7px 0; border-bottom:1px solid var(--line); min-width:0}
.insp-kv-row:last-child{border-bottom:0}
.insp-kv-k{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:11px; color:var(--muted);
  overflow-wrap:anywhere; word-break:break-all; line-height:1.35}
.insp-kv-v{font-size:12.5px; line-height:1.45; overflow-wrap:anywhere; word-break:break-word}
.insp-kv-row.warn .insp-kv-v{color:var(--warn-txt,#c9891a); font-weight:600}
.insp-kv-row.crit .insp-kv-v{color:var(--crit-txt); font-weight:600}
.insp-findings li,.insp-advice li{overflow-wrap:anywhere; word-break:break-word}
.insp-main-pane,.insp-split,.insp-batch-col,#inspReportView{min-width:0}
button.linkish{border:0; background:none; color:var(--accent-txt); cursor:pointer; padding:0; font:inherit; text-decoration:underline}

.pb-card{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-sm); padding:14px 16px;
  display:flex; flex-direction:column; gap:11px; transition:border-color var(--transition-fast), background var(--transition-fast)}
.pb-card:hover{border-color:var(--hover-border); background:var(--panel2)}
.pb-card-top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px}
.pb-card-title{min-width:0; display:flex; flex-direction:column; gap:3px}
.pb-card-title strong{font-size:14.5px; font-weight:600; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pb-desc{font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pb-desc-empty{color:var(--muted2); font-style:italic}
.pb-sched-badge{flex:none; font-size:11px; font-weight:500; color:var(--accent-txt); background:var(--accent-soft);
  padding:2px 9px; border-radius:999px; white-space:nowrap; line-height:1.7}
.pb-card-foot{display:flex; align-items:center; justify-content:space-between; gap:10px;
  border-top:1px solid var(--line); padding-top:11px; margin-top:auto; flex-wrap:wrap}
.pb-pills{display:flex; gap:6px; align-items:center; flex-wrap:wrap; min-width:0}
.pb-pill{font-size:11px; color:var(--muted); background:var(--panel3); border:1px solid var(--line); padding:2px 8px; border-radius:999px; white-space:nowrap}
.pb-pill-id{color:var(--muted2); background:transparent; border-color:transparent; padding-left:0}
.pb-actions{display:flex; gap:6px; flex:none}
.pb-step{background:var(--panel2); border:1px solid var(--line); border-radius:var(--r-xs); padding:10px 12px; display:flex; flex-direction:column; gap:8px}
.pb-step .grid2{gap:10px}
.pb-mod-hint{font-size:12px;color:var(--muted2);margin:2px 0 8px;line-height:1.6}
/* Multi-line command editor (replaces the old single-line input so long / multi-line
   commands are fully visible and editable). */
.pb-step textarea.pb-step-cmd{width:100%; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12.5px; color:var(--txt);
  background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:9px 11px; line-height:1.5;
  resize:vertical; min-height:54px; transition:border-color var(--transition-fast)}
.pb-step textarea.pb-step-cmd::placeholder{color:var(--muted2)}
/* Wider playbook editor gives multi-line commands and the schedule fields room. */
.modal.modal-lg{max-width:880px}
/* Playbook empty-state placeholder. */
.pb-empty{display:flex; flex-direction:column; align-items:center; gap:6px}
.pb-empty-icon{font-size:32px; line-height:1; color:var(--muted2); opacity:.7; margin-bottom:4px}
.pb-empty-title{font-size:15px; font-weight:600; color:var(--txt2)}
.pb-empty-sub{font-size:13px; color:var(--muted); max-width:440px; line-height:1.6}

/* ---------- 执行结果 ---------- */
.exec-meta{font-size:12px; color:var(--muted2); margin-bottom:12px; display:flex; gap:16px; flex-wrap:wrap}
.exec-row{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-xs); padding:10px 14px; margin-bottom:8px}
.exec-row-head{display:flex; align-items:center; gap:8px; margin-bottom:6px}
.exec-row-head strong{font-size:13px}
.exec-steps{display:flex; flex-direction:column; gap:6px}
.exec-step{background:var(--panel2); border-left:3px solid var(--line2); padding:6px 10px; border-radius:0 var(--r-xs) var(--r-xs) 0}
.exec-step.success{border-left-color:var(--ok)}
.exec-step.failed{border-left-color:var(--crit)}
.exec-step.running{border-left-color:var(--accent)}
.exec-step-name{font-weight:600; font-size:12px}
.exec-step-status{font-size:11px; color:var(--muted2); margin-left:8px}
.exec-step-out{font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11.5px; color:var(--txt2); white-space:pre-wrap; word-break:break-all; max-height:360px; overflow:auto; margin-top:4px}

/* ---------- 执行历史 ---------- */
.exec-hist-row{display:flex; align-items:center; gap:12px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--r-xs); margin-bottom:6px; cursor:pointer; font-size:13px}
.exec-hist-row:hover{background:var(--panel2)}
.exec-hist-row strong{flex:1}

/* ---------- 空行占位 ---------- */
.empty-line{text-align:center; color:var(--muted2); padding:24px; font-size:13px}

/* ---------- 端口转发 ---------- */
code{font-family:var(--mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace); font-size:12px; background:var(--panel2); padding:1px 5px; border-radius:3px}

/* 转发列表容器 */
.fwd-list{display:flex; flex-direction:column; gap:6px}
/* 卡片网格视图 — 与自动化剧本卡片网格一致（同 minmax/gap/对齐）。 */
.fwd-list.fwd-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; align-items:stretch}

/* 转发行（列表视图） */
.fwd-row{
  display:flex; align-items:center; gap:12px;
  padding:11px 14px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--panel);
  transition:border-color var(--transition-fast), background var(--transition-fast);
}
.fwd-row:hover{border-color:var(--line2); background:var(--panel2)}
.fwd-row.fwd-off{opacity:.55; filter:grayscale(.35)}
.fwd-row.fwd-off:hover{opacity:.8}

/* 转发卡片复用自动化 .pb-card 结构（见"自动化运维"段）；此处仅保留禁用态
   与转发专有的状态徽标、列表视图元素。 */
.pb-card.pb-off{opacity:.55; filter:grayscale(.35)}
.pb-card.pb-off:hover{opacity:.85}

/* 状态徽标（启用/停用） */
.fwd-status{font-size:10px; font-weight:600; padding:2px 8px; border-radius:999px; flex:none}
.fwd-status.on{background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border)}
.fwd-status.off{background:var(--panel3); color:var(--muted); border:1px solid var(--line2)}

/* 转发标题/副标题（列表视图 fwd-row 仍在用） */
.fwd-title{font-size:13px; font-weight:650; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.fwd-sub{font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.4}
.fwd-sub code{font-size:11px; padding:1px 4px}
.fwd-main{flex:1; min-width:0; display:flex; flex-direction:column; gap:3px}

/* 转发操作按钮组 */
.fwd-actions{display:flex; gap:4px; flex:none; margin-left:auto}

/* ============================================================
   SRE 中枢：事件 / 自动修复 / SLO / 工单
   ============================================================ */
.sre-panel{display:none}
.sre-panel.active{display:block}
.sre-toolbar{display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap}
.sre-toolbar .hint{flex:1; min-width:200px; margin-top:0}
.sre-list{display:flex; flex-direction:column; gap:6px}
.sre-row{display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--panel); cursor:pointer;
  transition:border-color var(--transition-fast), background var(--transition-fast)}
.sre-row:hover{border-color:var(--line2); background:var(--panel2)}
.sre-row-main{flex:1; min-width:0}
.sre-row-title{font-size:13px; font-weight:600; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sre-row-sub{font-size:11px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sre-kpi-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; margin:8px 0 12px}
.sre-kpi{padding:12px 14px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel2)}
.sre-kpi-v{font-size:15px; font-weight:700; color:var(--txt); line-height:1.3}
.sre-kpi-t{font-size:11px; color:var(--muted); margin-top:4px}
.sre-meta{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px}
#srePanel-remediation .subhead:first-of-type{margin-top:4px}
/* 事件时间线 */
.timeline{display:flex; flex-direction:column; padding-left:2px}
.tl-item{display:flex; gap:10px; padding:0 0 12px 0; position:relative}
.tl-item:not(:last-child)::before{content:""; position:absolute; left:4px; top:12px; bottom:0; width:1px; background:var(--line2)}
.tl-dot{width:9px; height:9px; border-radius:50%; background:var(--accent); flex:none; margin-top:3px; z-index:1; box-shadow:0 0 0 3px var(--bg)}
.tl-dot.crit{background:var(--crit)} .tl-dot.warn{background:var(--warn)} .tl-dot.info{background:var(--info)}
.tl-body{flex:1; min-width:0}
.tl-head{font-size:12px; color:var(--txt2)}
.tl-time{color:var(--muted2); font-size:10.5px}
.tl-actor{color:var(--muted)}
.tl-text{font-size:12px; color:var(--muted); margin-top:2px; word-break:break-word}
/* SLO 错误预算条 */
.slo-budget{margin:2px 0 4px}
.slo-budget-bar{height:6px; border-radius:3px; background:var(--panel3); overflow:hidden}
.slo-budget-fill{height:100%; border-radius:3px; transition:width .3s}
.slo-budget-fill.ok{background:var(--ok)} .slo-budget-fill.warn{background:var(--warn)} .slo-budget-fill.crit{background:var(--crit)}
.slo-budget-txt{font-size:11px; color:var(--muted); margin-top:5px}
/* 告警类型多选 chip */
.chip-multi{display:flex; flex-wrap:wrap; gap:6px}
.chip-check{display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--txt2);
  background:var(--panel2); border:1px solid var(--line2); border-radius:999px; padding:3px 10px; cursor:pointer}
.chip-check input{width:14px; height:14px; accent-color:var(--accent)}
/* 工单评论 */
.tk-comment{background:var(--panel2); border:1px solid var(--line); border-radius:var(--r-xs); padding:8px 10px; margin-bottom:6px; font-size:12px}
.tk-c-author{font-weight:600; color:var(--txt2)}
.tk-c-time{color:var(--muted2); font-size:10.5px; margin-left:6px}
.badge.info{background:var(--info-soft); color:var(--info-txt)}
.tl-text{white-space:pre-wrap}
/* 日志检索 */
.log-results{display:flex; flex-direction:column; gap:1px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px}
.log-line{display:flex; align-items:baseline; gap:10px; padding:4px 9px; border-radius:var(--r-xs); background:var(--panel); border-left:2px solid var(--line2)}
.log-line:hover{background:var(--panel2)}
.log-line.crit{border-left-color:var(--crit)}
.log-line.warn{border-left-color:var(--warn)}
.log-ts{color:var(--muted2); flex:none; font-size:11px}
.log-lvl{flex:none; width:44px; font-size:10px; text-transform:uppercase; font-weight:600}
.log-lvl.crit{color:var(--crit-txt)} .log-lvl.warn{color:var(--warn-txt)} .log-lvl.info{color:var(--muted)}
.log-host{flex:none; color:var(--accent-txt); font-size:11px}
.log-msg{flex:1; min-width:0; color:var(--txt2); word-break:break-all; white-space:pre-wrap}
/* 日志统计面板 */
.log-stats{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-sm); padding:10px 14px; margin-bottom:10px; font-size:12px; display:none}
.log-stats-bar{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px}
.log-stats-left{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.log-stat-total{color:var(--muted); font-size:12px}
.log-stat-total strong{color:var(--txt); font-size:14px}
.log-stat-chip{display:inline-flex; align-items:center; gap:3px; padding:2px 8px; border-radius:999px; font-size:11px; background:var(--bg2); border:1px solid var(--line2); color:var(--txt2)}
.log-stat-chip.crit{border-color:var(--crit);color:var(--crit-txt)}
.log-stat-chip.warn{border-color:var(--warn);color:var(--warn-txt)}
.log-stat-chip.info{color:var(--muted)}
.log-stat-chip.host{cursor:pointer; transition:var(--transition-fast)}
.log-stat-chip.host:hover{border-color:var(--accent);color:var(--accent-txt);background:var(--accent-soft)}
.log-stat-chip.time{color:var(--muted); font-size:11px}
.log-stat-chip strong{font-weight:600; font-size:12px}
.log-stat-row{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:4px}
.log-stat-label{color:var(--muted2); font-size:11px; flex:none}
/* Top 主机横向柱状图 */
.log-top-host-bars{flex:1; min-width:200px; display:flex; flex-direction:column; gap:5px}
.log-top-host-item{display:flex; align-items:center; gap:8px; cursor:pointer; padding:3px 6px; border-radius:var(--r-xs); transition:background var(--transition-fast)}
.log-top-host-item:hover{background:var(--bg2)}
.log-top-host-name{flex:none; width:100px; font-size:11px; color:var(--txt2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right}
.log-top-host-track{flex:1; height:18px; background:var(--bg2); border-radius:999px; overflow:hidden; position:relative}
.log-top-host-fill{height:100%; border-radius:999px; transition:width .4s ease; min-width:4px; position:relative}
.log-top-host-fill::after{content:''; position:absolute; top:0; left:0; right:0; height:50%; background:linear-gradient(180deg, rgba(255,255,255,.25) 0%, transparent 100%); border-radius:999px 999px 0 0}
.log-top-host-count{flex:none; width:40px; font-size:12px; font-weight:700; text-align:right; tabular-nums:tabular-nums}
/* 日志行诊断按钮 */
.log-line{position:relative}
.log-diag-btn{flex:none; width:22px; height:22px; padding:0; border:none; border-radius:var(--r-xs); background:transparent; color:var(--muted); cursor:pointer; font-size:12px; transition:var(--transition-fast); opacity:0}
.log-line:hover .log-diag-btn{opacity:1}
.log-diag-btn:hover{background:var(--accent-soft); color:var(--accent)}
/* 诊断结果卡片 */
.log-diag-card{background:var(--panel); border:1px solid var(--warn); border-radius:var(--r-sm); padding:12px 14px; margin-top:12px}
.log-diag-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; font-weight:600; color:var(--txt); font-size:13px}
.log-diag-close{background:none; border:none; color:var(--muted); cursor:pointer; font-size:14px; padding:2px 6px}
.log-diag-close:hover{color:var(--txt)}
.log-diag-summary{font-size:12px; color:var(--txt2); line-height:1.6; margin-bottom:8px; white-space:pre-wrap}
.log-diag-ctx{font-size:11px; color:var(--muted); margin-top:6px; padding-top:6px; border-top:1px solid var(--line)}
/* 诊断按钮 */
#logDiagBtn{animation:pulse-border 2s infinite}
@keyframes pulse-border{0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.4)}50%{box-shadow:0 0 0 4px rgba(245,158,11,0)}}
/* 移动端适配 */
@media(max-width:768px){
  .log-stats-bar{flex-direction:column; align-items:flex-start}
  .log-stat-row{flex-direction:column; align-items:flex-start}
  .log-top-host-name{width:70px; font-size:10px}
  .log-top-host-track{height:14px}
  .log-top-host-count{width:32px; font-size:11px}
  .log-diag-btn{opacity:1; width:28px; height:28px}
}
/* AI 巡检报告 */
.ai-report{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-sm); padding:12px 14px; margin-bottom:8px}
/* 巡检「巡检了什么」上下文行 */
.ai-report-ctx{font-size:11.5px; color:var(--muted); background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:5px 9px; margin-bottom:8px; line-height:1.5}
/* ========== AI 设置台（侧栏分区） ========== */
.ai-settings-modal{
  max-width:960px; width:min(960px,96vw);
  display:flex; flex-direction:column; max-height:min(88vh,900px);
}
.ai-settings-modal .modal-body{display:none} /* 改用 shell，避免双滚动 */
.ai-settings-head{gap:12px; align-items:flex-start}
.ai-settings-title-block{min-width:0}
.ai-settings-title-block h3{margin:0}
.ai-settings-sub{margin:4px 0 0; font-size:12px; color:var(--muted); font-weight:500; letter-spacing:.01em}
.ai-settings-head-actions{display:flex; align-items:center; gap:12px; flex-shrink:0; margin-left:auto}
.ai-enable-switch{font-size:12.5px; color:var(--txt2); white-space:nowrap}
.ai-settings-shell{
  display:grid; grid-template-columns:200px minmax(0,1fr);
  flex:1; min-height:0; border-bottom:1px solid var(--line);
}
.ai-settings-nav{
  display:flex; flex-direction:column; gap:2px;
  padding:12px 10px; background:var(--bg2); border-right:1px solid var(--line);
  overflow-y:auto;
}
.ai-nav-item{
  display:grid; grid-template-columns:28px 1fr; grid-template-rows:auto auto;
  column-gap:8px; row-gap:0; align-items:center;
  width:100%; text-align:left; cursor:pointer;
  padding:9px 10px; border:1px solid transparent; border-radius:8px;
  background:transparent; color:var(--txt2); font-family:inherit;
  transition:background .14s ease, border-color .14s ease, color .14s ease;
}
.ai-nav-item:hover{background:var(--panel3); color:var(--txt)}
.ai-nav-item.active{
  background:var(--panel); border-color:var(--line2); color:var(--txt);
  box-shadow:0 1px 0 rgba(0,0,0,.04);
}
.ai-nav-k{
  grid-row:1 / span 2; font-size:11px; font-weight:650; color:var(--muted);
  font-variant-numeric:tabular-nums; letter-spacing:.04em;
}
.ai-nav-item.active .ai-nav-k{color:var(--accent)}
.ai-nav-main{display:flex; align-items:center; gap:6px; min-width:0}
.ai-nav-t{font-size:13px; font-weight:600; line-height:1.25}
.ai-nav-d{font-size:11px; color:var(--muted); line-height:1.3}
.ai-nav-dot{
  width:7px; height:7px; border-radius:50%; flex-shrink:0;
  background:var(--ok-txt,#3fb950); box-shadow:0 0 0 2px color-mix(in srgb, var(--ok-txt,#3fb950) 22%, transparent);
}
.ai-nav-dot[hidden]{display:none !important}
.ai-settings-main{min-width:0; min-height:0; overflow:auto; background:var(--panel)}
.ai-panel{display:none; padding:18px 22px 22px; animation:fadeIn .14s ease}
.ai-panel.active{display:block}
.ai-panel-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
  margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--line);
}
.ai-panel-head h4{margin:0; font-size:15px; font-weight:650; color:var(--txt)}
.ai-panel-head p{margin:5px 0 0; font-size:12.5px; color:var(--muted); line-height:1.5; max-width:52ch}
.ai-panel-tools{display:flex; align-items:center; gap:8px; flex-shrink:0}
.ai-panel-body .ai-card{margin-bottom:12px}
.ai-panel-body .ai-card:last-child{margin-bottom:0}
.ai-panel-body .ai-card-header{background:transparent; border-bottom:1px solid var(--line2); padding:10px 14px}
.ai-preset-row{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px;
  margin:0 0 14px; padding:10px 12px;
  background:var(--bg2); border:1px solid var(--line2); border-radius:8px;
}
.ai-preset-label{font-size:11px; font-weight:600; color:var(--muted); letter-spacing:.02em; text-transform:none}
.ai-preset-btns{display:flex; flex-wrap:wrap; gap:4px}
.ai-preset-btn.active{
  border-color:var(--accent); color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, transparent);
  font-weight:600;
}
.ai-model-wrap{display:flex; gap:8px; position:relative; align-items:center}
.ai-model-wrap input{flex:1; min-width:0}
.ai-inline-meta{font-size:11px; color:var(--muted); font-weight:400}
.ai-footnote{margin:8px 0 0; font-size:12px; color:var(--muted); line-height:1.55}
.ai-footnote code{font-size:11px}
.ai-more{margin-top:10px; border-top:1px dashed var(--line2); padding-top:8px}
.ai-more > summary{
  cursor:pointer; font-size:12px; color:var(--muted); user-select:none; list-style:none;
}
.ai-more > summary::-webkit-details-marker{display:none}
.ai-more > summary::before{content:"▸ "; color:var(--muted2)}
.ai-more[open] > summary::before{content:"▾ "}
.ai-more .ai-footnote{margin-top:6px}
.btn.link{background:transparent; border:none; color:var(--accent); padding:0 2px; height:auto; box-shadow:none}
.btn.link:hover{text-decoration:underline; background:transparent}
.ai-section-block{
  margin-bottom:16px; padding:14px 16px;
  border:1px solid var(--line2); border-radius:10px; background:var(--bg2);
}
.ai-section-block:last-child{margin-bottom:0}
.ai-section-label{
  font-size:11px; font-weight:650; color:var(--muted);
  letter-spacing:.06em; text-transform:uppercase; margin-bottom:10px;
}
.grid3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px}
.ai-settings-foot{align-items:center; justify-content:space-between; gap:12px}
.ai-settings-foot-hint{
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  font-size:12px; color:var(--muted); margin-right:auto; min-width:0;
}
.ai-foot-chip{
  display:inline-flex; align-items:center; padding:3px 8px; border-radius:999px;
  background:var(--bg2); border:1px solid var(--line2); color:var(--txt2); font-size:11.5px; line-height:1.3;
}
.ai-foot-chip.muted{color:var(--muted); font-weight:400}
.ai-settings-foot-acts{display:flex; gap:8px; flex-shrink:0; align-items:center}
.ai-settings-foot.is-dirty .ai-foot-chip:first-child{
  border-color:color-mix(in srgb, var(--accent) 45%, var(--line2));
  color:var(--accent);
}
.ai-metric-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr));
  gap:10px; margin-bottom:14px;
}
.ai-metric{
  padding:10px 12px; border:1px solid var(--line2); border-radius:8px; background:var(--bg2);
}
.ai-metric .hint{margin:0 0 4px; font-size:11px}
.ai-metric b{font-size:16px; font-weight:650; font-variant-numeric:tabular-nums; color:var(--txt)}
.ai-settings-modal .ai-term-access{
  margin-top:0; border-color:var(--line2);
  background:linear-gradient(180deg, var(--bg2), var(--panel));
}
@media(max-width:820px){
  .ai-settings-shell{grid-template-columns:1fr}
  .ai-settings-nav{
    flex-direction:row; flex-wrap:nowrap; overflow-x:auto;
    border-right:none; border-bottom:1px solid var(--line);
    padding:8px;
  }
  .ai-nav-item{min-width:128px; grid-template-columns:22px 1fr}
  .grid3{grid-template-columns:1fr}
  .ai-settings-head-actions{flex-wrap:wrap; justify-content:flex-end}
  .ai-settings-foot{flex-wrap:wrap; gap:8px}
  .ai-settings-foot-hint{width:100%; margin-right:0}
  .ai-settings-foot-acts{width:100%; justify-content:flex-end}
}

/* AI 设置弹窗的测试结果 */
.ai-test-result{font-size:12px; margin-right:auto; align-self:center; max-width:54%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ai-test-result.ok{color:var(--ok-txt,#3fb950)}
.ai-test-result.err{color:var(--danger-txt,#f2545b)}
.ai-test-result.testing{color:var(--muted)}

/* AI 设置卡片分组 */
.ai-card{border:1px solid var(--line); border-radius:10px; background:var(--panel); margin-bottom:12px; overflow:hidden}
.ai-card-header{display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--bg2); border-bottom:1px solid var(--line2)}
.ai-card-header-clickable{cursor:pointer; user-select:none; transition:background var(--transition-fast)}
.ai-card-header-clickable:hover{background:var(--panel3)}
.ai-card-icon{font-size:15px; flex-shrink:0; width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; background:var(--bg3); border-radius:8px}
.ai-card-header-text{flex:1; min-width:0}
.ai-card-title{font-size:13px; font-weight:600; color:var(--txt); display:block}
.ai-card-desc{font-size:11px; color:var(--muted); display:block; margin-top:1px}
.ai-card-summary{color:var(--accent); margin-left:4px}
.ai-card-arrow{font-size:12px; color:var(--muted); flex-shrink:0; transition:transform .2s; width:14px; text-align:center}
.ai-card-arrow.open{transform:rotate(90deg)}
.ai-card-body{padding:12px 14px}
.ai-card-test{display:flex; align-items:center; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line2)}
.ai-card-test .ai-test-result{flex:1; min-width:0; max-width:none}
/* MCP 令牌：输入框 + 生成按钮同行 */
.token-gen-row{display:flex; gap:6px; align-items:center}
.token-gen-row input{flex:1; min-width:0}
.token-gen-row .btn{flex-shrink:0; white-space:nowrap}
/* 折叠摘要：已启用态用成功色更醒目 */
.ai-card-summary.on{color:var(--ok-txt,#3fb950); font-weight:600}
/* 折叠卡悬浮反馈 + 箭头随悬停提亮，未展开也有层次 */
.ai-card-collapsible:hover{border-color:var(--line2)}
.ai-card-header-clickable:hover .ai-card-arrow{color:var(--txt)}
.ai-card-collapsible.is-collapsed .ai-card-header{border-bottom:none}

/* 移动端：卡片内 grid2 自适应 */
@media(max-width:640px){
  .ai-card-body .grid2{grid-template-columns:1fr}
}
/* AI 对话弹窗 */
.ai-chat-log{display:flex; flex-direction:column; gap:8px; height:min(50vh,380px); overflow-y:auto; padding:6px 2px; margin-bottom:10px}
.ai-chat-msg{max-width:86%; padding:8px 11px; border-radius:10px; font-size:13px; line-height:1.55; white-space:pre-wrap; word-break:break-word}
.ai-chat-msg.me{align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:3px}
.ai-chat-msg.ai{align-self:flex-start; background:var(--bg2); border:1px solid var(--line2); color:var(--txt); border-bottom-left-radius:3px}
.ai-chat-msg.sys{align-self:center; background:transparent; color:var(--muted); font-size:12px; text-align:center}
.ai-chat-msg.err{color:var(--danger-txt,#f2545b)}
.ai-chat-input{display:flex; gap:8px; align-items:flex-end}
.ai-chat-input textarea{flex:1; resize:vertical; min-height:40px; max-height:120px; font-family:inherit; font-size:13px; color:var(--txt); background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 10px}
.ai-chat-input textarea:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
/* AI 诊断对话面板（事件详情内嵌） */
.ai-diagnosis-chat{display:flex; flex-direction:column; gap:6px; height:min(40vh,280px); overflow-y:auto; padding:8px; margin-bottom:8px; background:var(--bg2); border-radius:var(--r-sm); border:1px solid var(--line2)}
.ai-diagnosis-chat .ai-chat-msg{max-width:90%}
/* AI 对话弹窗：支持右下角拖拽缩放；消息区随窗口伸缩 */
/* AI 对话「右侧悬浮面板」——关键修复：遮罩本身只占据右侧面板这一块区域（不再全屏铺满），
   且 pointer-events:none，因此面板之外（左侧导航 / 顶栏 / 主内容区）完全不被覆盖，
   打开对话时可照常点击并使用其它一切功能。面板可「放大」铺满整个右侧交互区或「还原」。 */
#aiChatMask{
  position:fixed; top:53px; right:0; bottom:0; left:auto;
  width:min(440px, calc(100vw - var(--sidew) - 16px));
  background:transparent !important; padding:0; margin:0;
  pointer-events:none;              /* 容器不吃点击 */
  display:none; transition:width .18s ease;
}
#aiChatMask.show{ display:block; }
/* 放大：铺满右侧交互区（仍不盖左侧栏）。用 left 锚定到侧栏右缘（=--sidew），而非
   width:calc(100vw-…)——后者 100vw 含滚动条、right:0 却按内容宽计，两者差一个滚动条宽度
   导致面板左缘压住侧栏约 10px；left 锚定则精确对齐，收起侧栏(--sidew 同步为 64)时也自适应。 */
#aiChatMask.ai-expanded{ left:var(--sidew); right:0; width:auto; }
#aiChatModal{
  position:absolute; inset:0;       /* 填满遮罩容器（右侧停靠区） */
  width:auto; height:auto; margin:0; min-width:0; max-width:none; min-height:0; max-height:none;
  overflow:hidden;
  border:1px solid var(--line); border-right:none; border-radius:12px 0 0 12px;
  box-shadow:-10px 0 34px rgba(0,0,0,.34);
  display:flex; flex-direction:column; pointer-events:auto;   /* 仅面板可交互 */
}
#aiChatModal .modal-body{flex:1 1 auto; display:flex; flex-direction:column; min-height:0; max-height:none}
#aiChatModal .ai-chat-log{flex:1 1 auto; height:auto; min-height:0}
.ai-head-ctl{display:flex; align-items:center; gap:8px}
.ai-sess-select{
  max-width:190px; height:30px; padding:0 8px;
  background:var(--bg2); color:var(--txt);
  border:1px solid var(--line2); border-radius:var(--r-sm);
  font-family:inherit; font-size:12px; cursor:pointer;
}
.ai-sess-select:focus{outline:none; border-color:var(--accent)}
/* AI 回复的 Markdown 渲染样式（加粗/斜体/列表/段落） */
.ai-chat-msg.ai{white-space:normal}
.ai-chat-msg.ai>div{margin:2px 0}
.ai-chat-msg.ai ul,.ai-chat-msg.ai ol{margin:4px 0; padding-left:20px}
.ai-chat-msg.ai li{margin:2px 0}
.ai-chat-msg.ai strong{font-weight:650}
.ai-chat-msg.ai em{font-style:italic}
.ai-chat-msg.ai code{background:var(--bg2); border:1px solid var(--line2); border-radius:4px; padding:1px 5px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.9em}
.ai-chat-msg.ai pre.ai-code{background:var(--bg2); border:1px solid var(--line2); border-radius:8px; padding:10px 12px; margin:6px 0; overflow-x:auto}
.ai-chat-msg.ai pre.ai-code code{background:none; border:none; padding:0; display:block; white-space:pre; font-size:.88em; line-height:1.5}
/* AI 终端只读巡检权限区块 */
.ai-term-access{margin-top:12px; padding:12px; border:1px solid var(--line2); border-radius:8px; background:var(--bg2)}
.ai-term-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.ai-term-state{font-size:12px; padding:1px 8px; border-radius:10px}
.ai-term-state.on{color:#3fb950; background:rgba(63,185,80,.14)}
.ai-term-state.off{color:var(--muted); background:var(--panel3)}
.ai-term-warn{margin-top:8px; color:var(--warn,#d29922); line-height:1.6}
.ai-term-pw{display:flex; gap:6px; margin-top:8px}
.ai-term-pw input{flex:1; min-width:0; font-family:inherit; font-size:13px; color:var(--txt); background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 10px}
.ai-term-msg{margin-top:6px; font-size:12px}
.ai-term-msg.ok{color:#3fb950}
.ai-term-msg.err{color:var(--danger-txt,#f2545b)}
/* AI 对话附件（图片/文件）上传 */
.ai-chat-attach{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px}
.ai-attach-chip{display:inline-flex; align-items:center; gap:4px; max-width:220px; font-size:12px; padding:3px 8px; border-radius:12px; background:var(--panel3); color:var(--txt); border:1px solid var(--line2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ai-attach-chip.parsing{opacity:.72}
.ai-attach-chip.ai-attach-image{max-width:260px; padding:4px 8px 4px 4px}
.ai-attach-chip img{width:36px; height:36px; object-fit:cover; border-radius:8px; cursor:pointer; flex:none; background:var(--bg2)}
.ai-attach-chip .ai-attach-name,.ai-attach-chip .ai-attach-open{background:none; border:none; color:inherit; cursor:pointer; font:inherit; padding:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left}
.ai-attach-chip .ai-attach-open:hover,.ai-attach-chip .ai-attach-name:hover{color:var(--accent)}
.ai-attach-chip button{background:none; border:none; color:var(--muted); cursor:pointer; font-size:11px; padding:0 2px; flex:none}
.ai-attach-chip button:hover{color:var(--danger-txt,#f2545b)}
.ai-attach-lightbox{display:block; max-width:100%; max-height:62vh; margin:0 auto; border-radius:8px}
.ai-attach-pdf{width:100%; height:52vh; border:1px solid var(--line2); border-radius:8px; background:var(--bg2)}
.ai-attach-text{white-space:pre-wrap; word-break:break-word; font:12.5px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; background:var(--bg2); border:1px solid var(--line2); border-radius:8px; padding:12px; max-height:48vh; overflow:auto}
.ai-chat-msg.ai a.ai-dash-link{color:var(--accent); text-decoration:underline; text-underline-offset:2px; cursor:pointer; font-weight:600}
.ai-chat-msg.ai a.ai-ext-link{color:var(--accent); text-decoration:underline; text-underline-offset:2px}
.ai-attach-btn{flex:none; width:38px; height:40px; align-self:flex-end; background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); cursor:pointer; font-size:16px; color:var(--muted); transition:background .15s ease,color .15s ease}
.ai-attach-btn:hover{background:var(--panel3); color:var(--txt)}
.ai-att-note{font-size:11px; color:rgba(255,255,255,.8)}
/* 安装弹窗「日志采集」折叠区块 */
.log-collect{border:1px solid var(--line2); border-radius:8px; padding:10px 12px; background:var(--bg2)}
.log-collect-head{display:flex; align-items:center; justify-content:space-between; cursor:pointer; font-size:13px; font-weight:600; user-select:none}
.log-collect-head:hover{color:var(--accent)}
.log-collect-head .lc-caret{color:var(--muted); font-size:12px; transition:color .15s ease}
.log-collect #logCollectBody{margin-top:8px}
.log-collect textarea{width:100%; color:var(--txt); background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 10px}
/* AI 设置：自定义模型下拉（替代原生 datalist，始终显示全部可选模型） */
.ai-model-dropdown{position:absolute; top:calc(100% + 3px); left:0; right:0; z-index:60; max-height:240px; overflow-y:auto; background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm); box-shadow:0 8px 24px rgba(0,0,0,.32)}
.ai-model-opt{padding:7px 10px; font-size:13px; color:var(--txt); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.ai-model-opt:hover{background:var(--accent-soft); color:var(--accent)}
.ai-model-empty{padding:8px 10px; font-size:12px; color:var(--muted)}
#aiModelCaretBtn{min-width:30px; padding:0 8px}
/* AI 回复 Markdown 深化：标题 / 引用 / 分割线 */
.ai-chat-msg.ai .ai-h{font-weight:650; margin:6px 0 2px; line-height:1.4}
.ai-chat-msg.ai .ai-h1{font-size:1.13em}
.ai-chat-msg.ai .ai-h2{font-size:1.07em}
.ai-chat-msg.ai .ai-h3,.ai-chat-msg.ai .ai-h4{font-size:1em}
.ai-chat-msg.ai .ai-bq{margin:4px 0; padding:3px 10px; border-left:3px solid var(--line2); color:var(--muted); background:var(--panel3); border-radius:0 4px 4px 0}
.ai-chat-msg.ai .ai-hr{border:none; border-top:1px solid var(--line2); margin:8px 0}

/* AI 流式输出：思考动画 + 打字光标 + 流式纯文本 */
.ai-thinking{display:inline-flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; padding:4px 0}
.ai-thinking-dots{display:inline-flex; gap:3px}
.ai-thinking-dots span{width:6px; height:6px; border-radius:50%; background:var(--accent); opacity:.4; animation:aiDotPulse 1.4s ease-in-out infinite}
.ai-thinking-dots span:nth-child(2){animation-delay:.2s}
.ai-thinking-dots span:nth-child(3){animation-delay:.4s}
@keyframes aiDotPulse{0%,80%,100%{opacity:.4; transform:scale(.8)} 40%{opacity:1; transform:scale(1)}}
.ai-thinking-text{animation:aiThinkFade 2s ease-in-out infinite alternate}
@keyframes aiThinkFade{0%{opacity:.5} 100%{opacity:1}}
/* 流式打字光标：闪烁的竖线 */
.ai-stream-cursor{color:var(--accent); font-weight:300; animation:aiCursorBlink .8s step-end infinite; margin-left:1px; user-select:none}
@keyframes aiCursorBlink{0%,100%{opacity:1} 50%{opacity:0}}
/* 流式正文：纯文本展示（避免未完成 Markdown 导致渲染抖动） */
.ai-stream-body{white-space:pre-wrap; word-break:break-word; line-height:1.6; font-size:13px}
.ai-stream-text{color:var(--txt)}
/* 推理模型思维链「思考过程」折叠区：暗色弱化、左侧强调线，与正文答案视觉分离 */
.ai-reasoning{margin:0 0 8px; border-left:2px solid var(--line2); background:var(--panel2,var(--panel)); border-radius:0 6px 6px 0; overflow:hidden}
.ai-reasoning-sum{cursor:pointer; user-select:none; list-style:none; padding:5px 10px; font-size:12px; color:var(--muted); font-weight:500; outline:none}
.ai-reasoning-sum::-webkit-details-marker{display:none}
.ai-reasoning-sum::before{content:"▸ "; color:var(--muted); font-size:10px}
.ai-reasoning[open] .ai-reasoning-sum::before{content:"▾ "}
.ai-reasoning-sum:hover{color:var(--txt)}
.ai-reasoning-body{padding:2px 12px 9px; font-size:12px; line-height:1.55; color:var(--muted); white-space:pre-wrap; word-break:break-word; opacity:.85}
/* P3 诊断置信度徽章：高=绿 / 中=琥珀 / 低=红，克制描边风格 */
.ai-confidence{margin:6px 0}
.ai-conf-badge{display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; padding:3px 10px; border-radius:12px; border:1px solid currentColor; line-height:1.2}
.ai-confidence.high .ai-conf-badge{color:#4a9e5c; background:rgba(74,158,92,.10)}
.ai-confidence.mid .ai-conf-badge{color:#c08a2d; background:rgba(192,138,45,.10)}
.ai-confidence.low .ai-conf-badge{color:#ef4d5a; background:rgba(239,77,90,.10)}
/* ===== 全站统一「AI 辅助」按钮 + 悬浮面板 ===== */
.ai-assist-btn{display:inline-flex;align-items:center;gap:5px}
.ai-assist-btn-ic{font-size:13px;line-height:1}
.ai-assist-mask{display:none;position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.45);backdrop-filter:blur(2px);align-items:flex-start;justify-content:center}
.ai-assist-mask.show{display:flex}
.ai-assist-panel{background:var(--panel);border:1px solid var(--line2);border-radius:12px;width:min(680px,94vw);max-height:82vh;margin-top:8vh;display:flex;flex-direction:column;box-shadow:0 18px 50px rgba(0,0,0,.45);overflow:hidden}
.ai-assist-head{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--line2)}
.ai-assist-icon{font-size:16px}
.ai-assist-title{font-weight:600;font-size:14px;flex:1}
.ai-assist-close{background:none;border:none;color:var(--muted);font-size:22px;line-height:1;cursor:pointer;padding:0 4px}
.ai-assist-close:hover{color:var(--txt)}
.ai-assist-input-row{display:flex;gap:8px;padding:12px 16px;border-bottom:1px solid var(--line2)}
.ai-assist-input{flex:1;background:var(--panel3);border:1px solid var(--line2);border-radius:8px;color:var(--txt);padding:8px 10px;font-size:13px;font-family:inherit;resize:vertical;min-height:38px}
.ai-assist-input:focus{outline:none;border-color:var(--accent)}
.ai-assist-body{padding:14px 16px;overflow-y:auto;flex:1;font-size:13px;line-height:1.6;min-height:120px}
.ai-assist-hint{color:var(--muted);font-size:12.5px}
.ai-assist-err{color:#ef4d5a;font-size:13px;white-space:pre-wrap;word-break:break-word}
.ai-assist-verify{font-size:12px;margin:0 0 8px;padding:6px 10px;border-radius:6px;line-height:1.4}
.ai-assist-verify.ok{color:#1a7f4b;background:rgba(26,127,75,.1)}
.ai-assist-verify.err{color:#b42318;background:rgba(180,35,24,.1)}
.ai-assist-verify.warn{color:#8a6d1b;background:rgba(138,109,27,.1)}
.ai-rag-hint{font-size:11px;color:var(--muted2,#889);margin:0 0 8px;padding:6px 10px;border-radius:6px;background:rgba(127,127,127,.08);line-height:1.4}
.ai-assist-actions{display:flex;gap:8px;justify-content:flex-end;padding:10px 16px;border-top:1px solid var(--line2)}
.ai-assist-actions:empty{display:none}
/* ===== AI 技能库 ===== */
.skill-list{display:flex;flex-direction:column;gap:10px}
.skill-card{background:var(--panel3);border:1px solid var(--line2);border-radius:9px;padding:10px 12px}
.skill-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.skill-head b{font-size:13.5px}
.skill-meta{font-size:11.5px;color:var(--muted);font-family:var(--mono,monospace)}
.skill-head .btn.danger{margin-left:auto}
.skill-trigger{font-size:12.5px;color:var(--accent);margin:5px 0 3px}
.skill-steps{font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--txt);background:var(--panel);border:1px solid var(--line2);border-radius:6px;padding:7px 9px;margin:0;max-height:200px;overflow:auto}
.skill-tags{font-size:11.5px;color:var(--muted);margin-top:5px}
/* 每条 AI 回复的操作栏（复制），hover 显示 */
.ai-msg-tools{display:none; justify-content:flex-start; gap:6px; margin-top:8px; flex-wrap:wrap}
.ai-chat-msg.ai:hover .ai-msg-tools,.ai-chat-modal .ai-msg-tools{display:flex}
.ai-msg-tools button{background:var(--panel); border:1px solid var(--line2); border-radius:5px; color:var(--muted); cursor:pointer; font-size:11px; padding:2px 8px; font-family:inherit}
.ai-msg-tools button:hover{color:var(--txt); background:var(--panel3)}
.ai-msg-tools button.ai-speak-btn.speaking{color:var(--accent); border-color:var(--accent); background:var(--accent-soft)}
/* 终止按钮 + 排队提示 */
.ai-stop-btn{flex:none; align-self:flex-end; height:40px; padding:0 14px; background:rgba(242,84,91,.14); color:var(--danger-txt,#f2545b); border:1px solid var(--danger-txt,#f2545b); border-radius:var(--r-sm); cursor:pointer; font-size:13px; font-family:inherit}
.ai-stop-btn:hover{background:var(--danger-txt,#f2545b); color:#fff}
.ai-queue-hint{font-size:11px; color:var(--warn,#d29922); margin-top:4px; min-height:14px}
/* AI 终端只读巡检权限区块 */
.ai-term-access{margin-top:14px; padding:12px 14px; border:1px solid var(--line2); border-radius:8px; background:var(--bg2)}
.ai-term-head{display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; font-weight:600}
.ai-term-state{font-size:12px; font-weight:600; padding:1px 8px; border-radius:10px; margin-left:4px}
.ai-term-state.on{color:#3fb950; background:rgba(63,185,80,.14)}
.ai-term-state.off{color:var(--muted); background:var(--panel3)}
.ai-term-warn{margin-top:8px; color:var(--warn,#d29922); line-height:1.6}
.ai-term-pw{display:flex; gap:6px; margin-top:10px; flex-wrap:wrap}
.ai-term-pw input{flex:1; min-width:160px; font-family:inherit; font-size:13px; color:var(--txt); background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm); padding:8px 10px}
.ai-term-pw input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.ai-term-msg{margin-top:8px; font-size:12px; min-height:16px}
.ai-term-msg.ok{color:#3fb950}
.ai-term-msg.err{color:var(--danger-txt,#f2545b)}
@media(max-width:560px){
  /* 窄屏无侧栏空间：面板全屏（移动端标准） */
  #aiChatMask, #aiChatMask.ai-expanded{top:0; right:0; left:0; width:100vw}
  #aiChatModal{border-radius:0; border:none}
  .ai-sess-select{max-width:120px}
  /* 头部省空间：标题省略号、隐藏"新建"按钮（下拉首项即新会话） */
  #aiChatModal .modal-head h3{font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
  #aiNewChatBtn{display:none}
}
.ai-diagnosis-input{display:flex; gap:6px; align-items:flex-end}
.ai-diagnosis-input textarea{flex:1; resize:vertical; min-height:36px; max-height:100px; font-family:inherit; font-size:13px; color:var(--txt); background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r-sm); padding:6px 8px}
.ai-diagnosis-input textarea:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.ai-report-head{display:flex; align-items:center; gap:8px; margin-bottom:8px}
.ai-report-trigger{font-size:11px; color:var(--muted)}
.ai-summary{font-size:13px; color:var(--txt); line-height:1.65; white-space:pre-wrap; margin-bottom:8px}
.ai-findings{display:flex; flex-direction:column}
.ai-finding{display:flex; gap:8px; align-items:baseline; padding:6px 0; border-top:1px solid var(--line)}
.ai-f-body{flex:1; min-width:0}
.ai-f-title{font-size:12px; color:var(--txt2)}
.ai-f-detail{font-size:11px; color:var(--muted); margin-top:2px}

/* 图标按钮（转发操作栏专用） */
.icon-btn{
  display:flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0; flex:none;
  background:transparent; border:1px solid transparent; border-radius:var(--r-xs);
  color:var(--muted); cursor:pointer;
  transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.icon-btn svg{width:15px; height:15px}
.icon-btn:hover{background:var(--panel3); color:var(--txt); border-color:var(--line2)}
.icon-btn:active{transform:translateY(1px)}
.icon-btn.danger:hover{background:var(--crit-soft); color:var(--crit-txt); border-color:var(--crit-border)}

/* TCP/HTTP 类型徽章配色（复用 .badge 基类） */
.badge.op{background:var(--accent2-soft); color:var(--accent2-txt)}
.badge.sys{background:var(--info-soft); color:var(--info-txt)}

/* 转发模块响应式 */
@media(max-width:700px){
  .fwd-list.fwd-grid{grid-template-columns:1fr}
  .fwd-row{flex-wrap:wrap; gap:8px; padding:12px 14px}
  .fwd-main{flex:1 1 100%; order:2}
  .fwd-actions{flex:1 1 100%; order:3; justify-content:flex-start}
  .fwd-row .badge{order:1}
}

/* ============================================================
   v5.3.0: 终端二次认证弹窗
   ============================================================ */
/* 协议弹窗 */
.term-protocol-section{margin-bottom:16px}
.term-protocol-heading{font-size:14px;font-weight:650;color:var(--txt);margin:0 0 8px;letter-spacing:.01em}
.term-protocol-text{font-size:13px;color:var(--txt2);line-height:1.7;margin:0;white-space:pre-line}
.term-protocol-agree{margin-top:8px;padding-top:14px;border-top:1px solid var(--line);display:flex;align-items:center;gap:8px;cursor:pointer}
.term-protocol-agree span{font-size:13px;color:var(--txt);font-weight:500}
/* 协议勾选框：加大尺寸，确保选中标记清晰可见 */
.term-protocol-agree input[type="checkbox"]{width:18px;height:18px;accent-color:var(--accent);cursor:pointer;flex:none}

/* 密码设置/验证描述 */
.term-setpwd-desc{font-size:13px;color:var(--txt2);line-height:1.6;margin:0 0 10px}
.term-setpwd-req{font-size:12px;color:var(--warn-txt);background:var(--warn-soft);border:1px solid var(--warn-border);border-radius:var(--r-sm);padding:8px 12px;margin:0 0 14px;line-height:1.5}
/* 首次登录·安全初始化：说明面板（柔和告警色，契合深色主题） */
.init-desc{font-size:13px;color:var(--txt2);line-height:1.65;margin:0 0 16px;padding:10px 12px;background:var(--warn-soft);border:1px solid var(--warn-border);border-radius:var(--r-sm)}
/* 消息中心：顶栏铃铛 + 未读徽标 + 下拉面板 */
.notif-wrap{position:relative}
.notif-badge{position:absolute;top:-3px;right:-3px;min-width:16px;height:16px;padding:0 4px;border-radius:9px;background:var(--crit,#e5484d);color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center;box-shadow:0 0 0 2px var(--panel)}
.notif-panel{position:absolute;top:calc(100% + 8px);right:0;width:344px;max-width:92vw;max-height:72vh;display:none;flex-direction:column;background:var(--panel);border:1px solid var(--line2);border-radius:10px;box-shadow:var(--shadow-xl);z-index:420;overflow:hidden}
.notif-panel.show{display:flex}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--line);font-size:13px;font-weight:650}
.notif-readall{background:none;border:none;color:var(--accent);font-size:12px;cursor:pointer;font-family:inherit;padding:0}
.notif-list{overflow-y:auto;flex:1}
.notif-item{display:flex;gap:10px;padding:11px 14px;border-bottom:1px solid var(--line);cursor:pointer;transition:background var(--transition-fast)}
.notif-item:hover{background:var(--bg2)}
.notif-item.unread{background:var(--accent-soft)}
.notif-dot{flex:none;width:8px;height:8px;border-radius:50%;margin-top:5px;background:var(--muted2)}
.notif-dot.critical{background:var(--crit,#e5484d)}
.notif-dot.warning{background:var(--warn-txt,#d97706)}
.notif-dot.success{background:var(--ok,#30a46c)}
.notif-dot.info,.notif-dot.ai,.notif-dot.incident{background:var(--accent)}
.notif-body{min-width:0;flex:1}
.notif-title{font-size:13px;font-weight:600;color:var(--txt);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notif-sub{font-size:11.5px;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notif-time{font-size:10.5px;color:var(--muted2);margin-top:3px}
.notif-empty{padding:30px 14px;text-align:center;color:var(--muted2);font-size:12.5px}

/* 密码可见性切换按钮 */
.term-pwd-toggle{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  width:30px;height:30px;border:none;background:transparent;color:var(--muted);
  cursor:pointer;border-radius:var(--r-xs);padding:0;display:flex;align-items:center;justify-content:center;
  transition:color var(--transition-fast),background var(--transition-fast);
}
.term-pwd-toggle:hover{color:var(--txt);background:var(--panel2)}
.term-pwd-toggle svg{width:16px;height:16px}

/* 错误提示 */
.term-pwd-err{display:none;color:var(--crit-txt);font-size:12.5px;padding:8px 12px;background:var(--crit-soft);border:1px solid var(--crit-border);border-radius:var(--r-sm);margin-top:8px;line-height:1.4}
.term-pwd-err:not(:empty){display:block}

/* 剩余尝试次数 */
.term-attempts{font-size:12px;color:var(--warn-txt);margin-top:8px;font-weight:500}

/* 个人信息 - 终端密码状态 */
.term-pwd-status{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--panel2);margin-top:8px}
.term-pwd-status-label{font-size:12px;color:var(--muted);flex:none}
.term-pwd-status-val{font-size:12px;font-weight:600;padding:2px 8px;border-radius:4px}
.term-pwd-status-val.set{background:var(--ok-soft);color:var(--ok-txt);border:1px solid var(--ok-border)}
.term-pwd-status-val.unset{background:var(--warn-soft);color:var(--warn-txt);border:1px solid var(--warn-border)}

/* ============================================================
   UI/UX 审查修复合集（对应 UI_UX_REVIEW.md 优先级汇总表 · 面板侧）
   ============================================================ */

/* 3.4 概览页区块标题与 section-title 风格统一 */
.ov-section-header h3{font-size:15px;font-weight:600;letter-spacing:.01em}

/* 5.4 textarea 焦点环（全局已 outline:none!important，此处用 box-shadow 恢复可见焦点，避免键盘用户无指示） */
.field textarea:focus, textarea:focus{
  outline:none;
  box-shadow:0 0 0 3px var(--accent-soft);
  border-color:var(--accent);
}

/* 4.2 窄屏：筛选工具栏 sticky 吸顶，避免换行长工具栏挤压内容；覆盖内联 margin/width 使搜索框占满一行 */
@media (max-width:768px){
  .section-title{position:sticky;top:0;z-index:6;background:var(--bg);
    padding-top:10px;padding-bottom:12px;margin-bottom:10px;box-shadow:0 1px 0 var(--line)}
  .section-title .search{width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important}
  .section-title .select-wrap{margin-left:0!important}
  .section-title > div{margin-left:0!important;width:100%}
}

/* 6.4 全局请求加载指示条（顶部细进度条，任何 fetch 进行中显示） */
.loadbar{position:fixed;top:0;left:0;height:2px;width:100%;
  background:var(--accent);transform:scaleX(0);transform-origin:left center;
  opacity:0;transition:opacity .2s;z-index:99999;pointer-events:none}
.loadbar.active{opacity:1;animation:loadbar-slide 1.1s ease-in-out infinite}
@keyframes loadbar-slide{0%{transform:scaleX(.08)}50%{transform:scaleX(.55)}100%{transform:scaleX(.08)}}

/* ============================================================
   v5.5.0 增量美化 — 卡片与容器（Task 10）
   ============================================================ */

/* 主机卡片：hover 阴影增强 + 状态指示器优化 */
.host{
  transition:transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.host:hover{
  transform:translateY(-1px);
  box-shadow:var(--elevation-2);
  border-color:var(--hover-border);
}
.host.online{ border-left:3px solid var(--ok) }
.host.offline{ border-left:3px solid var(--gray-off) }

/* 监控检测卡片：统一风格 */
.check-card{
  transition:transform var(--transition), box-shadow var(--transition);
}
.check-card:hover{
  transform:translateY(-1px);
  box-shadow:var(--elevation-2);
}

/* SRE 事件卡片：层次感增强 */
.sre-event{
  transition:transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.sre-event:hover{
  border-color:var(--hover-border);
  box-shadow:var(--elevation-1);
}

/* ============================================================
   v5.5.0 增量美化 — 按钮与输入（Task 11）
   ============================================================ */

/* 主按钮：渐变背景 + hover 提亮 */
.btn.primary{
  background:linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow:0 1px 3px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn.primary:hover{
  background:linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow:0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12);
}

/* 次要按钮：边框式 */
.btn.secondary{
  background:transparent;
  border-color:var(--accent-border);
  color:var(--accent-txt);
}
.btn.secondary:hover{
  background:var(--accent-soft);
  border-color:var(--accent);
}

/* 下拉菜单：阴影增强、圆角统一 */
.cat-dd-menu, .dropdown-menu{
  box-shadow:var(--elevation-3);
  border:1px solid var(--border-strong);
  border-radius:var(--r);
}

/* 标签（badge）：统一 pill 形状 */
.badge{
  border-radius:999px;
  padding:2px 10px;
  font-size:11px;
  font-weight:600;
  letter-spacing:.01em;
}

/* ============================================================
   v5.5.0 增量美化 — 弹窗与遮罩（Task 12）
   ============================================================ */

/* 遮罩层：模糊背景增强 */
.mask{
  backdrop-filter:var(--blur);
  -webkit-backdrop-filter:var(--blur);
}

/* 弹窗关闭按钮：统一 hover 效果 */
.modal-close, .mask-close{
  width:32px; height:32px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--r-sm);
  border:none; background:transparent;
  color:var(--muted); cursor:pointer;
  font-size:18px; transition:background var(--transition-fast), color var(--transition-fast);
}
.modal-close:hover, .mask-close:hover{
  background:var(--panel3);
  color:var(--txt);
}

/* AI/Hermes 聊天面板：消息气泡美化 */
.hermes-msg{
  padding:10px 14px;
  border-radius:var(--r-lg);
  margin-bottom:8px;
  max-width:88%;
  line-height:1.5;
  font-size:13px;
}
.hermes-msg.user{
  background:var(--accent-soft);
  color:var(--accent-txt);
  margin-left:auto;
  border-bottom-right-radius:4px;
}
.hermes-msg.assistant{
  background:var(--panel2);
  color:var(--txt);
  border-bottom-left-radius:4px;
}

/* ============================================================
   v5.5.0 增量美化 — 导航与侧边栏（Task 13）
   ============================================================ */

/* 品牌标识区域：渐变文字 */
.brand{
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  font-weight:700;
}

/* 导航分组折叠：动画优化 */
.nav-group-items{
  overflow:hidden;
  transition:max-height var(--transition-slow), opacity var(--transition);
}
.nav-group.collapsed .nav-group-items{
  max-height:0;
  opacity:0;
}

/* ============================================================
   v5.5.0 增量美化 — 表格与列表（Task 14）
   ============================================================ */

/* 表头 sticky 效果 + antd 浅底表头（与卡片底色拉开细微对比） */
table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:var(--panel2);
}

/* 行 hover 高亮 */
table tbody tr{
  transition:background var(--transition-fast);
}
table tbody tr:hover{
  background:var(--surface-hover);
}

/* 空态提示美化 */
.empty-line{
  color:var(--text-tertiary);
  font-size:13px;
  padding:24px;
  text-align:center;
}

/* ============================================================
   v5.5.0 增量美化 — 移动端适配（Task 15）
   ============================================================ */

/* 卡片网格自适应 */
@media (max-width:1200px){
  .cards{ grid-template-columns:repeat(3,1fr) }
}
@media (max-width:768px){
  .cards{ grid-template-columns:repeat(2,1fr); gap:10px }

  /* 侧边栏自动折叠 */
  .app{ grid-template-columns:0 1fr }
  .app .side{ transform:translateX(-100%); transition:transform var(--transition) }
  .app.side-open .side{ transform:translateX(0); z-index:50 }

  /* 弹窗全屏模式 */
  .modal{
    max-width:100% !important;
    border-radius:var(--r-lg) var(--r-lg) 0 0;
    margin:auto 0 0 0;
  }
  .mask{ align-items:flex-end; padding:0 }

  /* 触摸目标最小 44px */
  .btn, .nav-item, .tb-icon, .tab{
    min-height:var(--touch-min);
  }

  /* 表格横向滚动 */

  /* 告警阈值卡片移动端适配 */
  .threshold-grid{grid-template-columns:1fr}
  .threshold-card{padding:12px 14px}
  .table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}
@media (max-width:480px){
  .cards{ grid-template-columns:1fr; gap:8px }
  .card{ padding:12px 14px }
  .card .v{ font-size:20px }
}

/* 尊重 prefers-reduced-motion（前庭敏感 / 无障碍合规） */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}

/* ===== API 性能监控 ===== */
.empty-box{padding:40px 24px; text-align:center; color:var(--muted); background:var(--bg2); border:1px dashed var(--line2); border-radius:12px; line-height:1.7}
.api-sys-card{background:var(--bg2); border:1px solid var(--line); border-radius:12px; margin-bottom:14px; overflow:hidden}
.api-sys-head{display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; row-gap:8px}
.api-sys-title{font-weight:600; font-size:14px; color:var(--txt); display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1; min-width:0}
.api-sys-actions{margin-left:auto; display:flex; gap:6px; flex-shrink:0}
.api-table-wrap{overflow-x:auto}
.api-table{width:100%; border-collapse:collapse; font-size:13px}
.api-table th{text-align:left; padding:8px 12px; font-weight:500; color:var(--muted); font-size:12px; white-space:nowrap; border-bottom:1px solid var(--line)}
.api-table td{padding:9px 12px; border-bottom:1px solid var(--line); color:var(--txt2); white-space:nowrap; vertical-align:middle}
.api-table tbody tr:last-child td{border-bottom:none}
.api-table tbody tr:hover{background:var(--bg3)}
.api-table td.ok{color:var(--ok); font-variant-numeric:tabular-nums}
.api-table td.warn{color:var(--warn); font-variant-numeric:tabular-nums}
.api-table td.crit{color:var(--crit); font-variant-numeric:tabular-nums}
.api-table tr.row-down{background:var(--crit-soft)}
.api-ep-name{color:var(--txt); font-weight:500}
.api-ep-url{color:var(--muted); font-size:11px; font-family:monospace; max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.api-table .muted{color:var(--muted)}
.sdot{display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle}
.sdot.ok{background:var(--ok)} .sdot.crit{background:var(--crit)} .sdot.idle{background:var(--muted2)}
.tag.crit{background:var(--crit-soft); color:var(--crit); border-color:transparent}
/* 环境标签徽章：生产/预发/测试分色 */
.tag.env-prod{background:var(--crit-soft); color:var(--crit); border-color:transparent}
.tag.env-staging{background:rgba(210,153,34,.15); color:var(--warn); border-color:transparent}
.tag.env-dev{background:rgba(76,141,255,.15); color:var(--accent); border-color:transparent}
/* 可靠性保障卡片的操作按钮复用全局 .mini-btn（26x26 图标按钮，见 style.css 上方定义），
   与拨测监控保持统一图标元素；图标在 apimon.js 里以 ▶/✎/✕ + SVG 呈现。此前用文字按钮
   (padding 版)会污染全局 .mini-btn 并在 26x26 里竖排逐字，故移除。 */
/* 业务系统编辑弹窗·接口行 */
.api-ep-row{position:relative; border:1px solid var(--line2); border-radius:8px; padding:12px; background:var(--bg2)}
.api-ep-del{position:absolute; top:8px; right:8px; width:22px; height:22px; border:none; background:transparent; color:var(--muted); cursor:pointer; font-size:14px; border-radius:5px}
.api-ep-del:hover{background:var(--crit-soft); color:var(--crit)}
.api-ep-grid{display:grid; grid-template-columns:1.3fr .7fr 2.2fr; gap:8px; margin-bottom:8px; padding-right:26px}
.api-ep-grid2{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:8px}
.api-ep-grid3{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.api-ep-row input,.api-ep-row select,.api-ep-row textarea{width:100%; padding:6px 9px; font-size:12px; background:var(--bg3); border:1px solid var(--line2); border-radius:6px; color:var(--txt); box-sizing:border-box}
.api-ep-row textarea{font-family:monospace; resize:vertical}
/* 接口高级选项折叠 */
.api-ep-advanced{margin-top:4px}
.api-ep-advanced summary{font-size:11px; color:var(--muted); cursor:pointer; padding:2px 0; user-select:none}
.api-ep-advanced summary:hover{color:var(--txt2)}
.api-ep-advanced summary .hint{font-size:10px; color:var(--accent-txt); font-weight:400}
.api-ep-advanced .api-ep-grid3{margin-top:6px}
.api-import-advanced{
  margin:0 0 12px; padding:10px 12px;
  border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
.api-import-advanced > summary{
  font-size:13px; color:var(--txt2); cursor:pointer; user-select:none; font-weight:500;
}
.api-import-advanced > summary:hover{color:var(--txt)}
.api-import-advanced[open] > summary{margin-bottom:4px}
@media (max-width:720px){
  .api-ep-grid,.api-ep-grid2,.api-ep-grid3{grid-template-columns:1fr}
}
/* API 监控·总览汇总条（业务系统 / 接口 / 异常 / 平均可用率） */
.api-summary{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px}
.api-summary .card-stat{flex:1; min-width:120px; padding:12px 16px; background:var(--bg2); border:1px solid var(--line); border-radius:12px}
.api-summary .card-stat .n{font-size:22px; font-weight:600; color:var(--txt); font-variant-numeric:tabular-nums; line-height:1.15}
.api-summary .card-stat .n.ok{color:var(--ok)} .api-summary .card-stat .n.warn{color:var(--warn)} .api-summary .card-stat .n.crit{color:var(--crit)}
.api-summary .card-stat .l{font-size:12px; color:var(--muted); margin-top:3px}
/* API 接口历史·组合曲线弹窗 */
.chart-sub-title{font-size:12px; font-weight:600; color:var(--txt2); margin:2px 2px 6px}
.api-hist-stat{display:flex; gap:10px; flex-wrap:wrap; margin:12px 0 4px}
.api-hist-stat .ahs{display:flex; flex-direction:column; gap:2px; padding:8px 14px; background:var(--bg2); border:1px solid var(--line2); border-radius:10px; min-width:96px}
.api-hist-stat .ahs b{font-size:17px; font-weight:600; color:var(--txt); font-variant-numeric:tabular-nums}
.api-hist-stat .ahs b.ok{color:var(--ok)} .api-hist-stat .ahs b.warn{color:var(--warn)} .api-hist-stat .ahs b.crit{color:var(--crit)}
.api-hist-stat .ahs i{font-size:11px; color:var(--muted); font-style:normal}
/* 延迟分布直方图（客户端分桶，CSS 柱状） */
.lat-hist{display:flex; flex-direction:column; gap:5px; padding:6px 2px}
.lat-hist-row{display:flex; align-items:center; gap:10px; font-size:12px}
.lat-hist-label{width:72px; color:var(--muted); text-align:right; flex-shrink:0; font-variant-numeric:tabular-nums}
.lat-hist-bar-wrap{flex:1; height:16px; background:var(--bg3); border-radius:4px; overflow:hidden}
.lat-hist-bar{display:block; height:100%; min-width:2px; border-radius:4px; transition:width .4s}
.lat-hist-bar.ok{background:var(--ok,#3fb950)}
.lat-hist-bar.warn{background:var(--warn,#d29922)}
.lat-hist-bar.crit{background:var(--crit,#f2545b)}
.lat-hist-val{width:96px; color:var(--txt2); flex-shrink:0; font-variant-numeric:tabular-nums}
/* 承载主机：编辑弹窗多选 + 下钻卡片 */
.host-multi{display:flex; flex-wrap:wrap; gap:6px; max-height:120px; overflow-y:auto; padding:8px; background:var(--bg3); border:1px solid var(--line2); border-radius:8px}
.host-multi .muted{font-size:12px; color:var(--muted)}
.host-chk{display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--txt2); cursor:pointer; padding:3px 8px; background:var(--bg2); border:1px solid var(--line2); border-radius:6px}
.host-chk:hover{border-color:var(--accent)}
.host-drill{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px}
.host-drill-card{border:1px solid var(--line2); border-radius:10px; padding:12px 14px; background:var(--bg2)}
.host-drill-card.off{opacity:.6}
.hd-head{display:flex; align-items:center; gap:6px; font-size:13px; margin-bottom:10px; flex-wrap:wrap}
.hd-metric{margin-bottom:8px}
.hd-m-top{display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-bottom:3px}
.hd-m-top b{font-variant-numeric:tabular-nums; color:var(--txt)}
.hd-m-top b.warn{color:var(--warn)} .hd-m-top b.crit{color:var(--crit)}
.hd-bar{height:6px; background:var(--bg3); border-radius:3px; overflow:hidden}
.hd-bar-fill{height:100%; border-radius:3px; transition:width .4s}
.hd-bar-fill.ok{background:var(--ok,#3fb950)} .hd-bar-fill.warn{background:var(--warn,#d29922)} .hd-bar-fill.crit{background:var(--crit,#f2545b)}
.hd-net{display:flex; gap:12px; font-size:11px; color:var(--muted); margin-top:8px; font-variant-numeric:tabular-nums; flex-wrap:wrap}

/* ===== 告警治理 ===== */
.gov-section{margin-bottom:18px}
.gov-section-head{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px}
.gov-section-title{font-weight:600; font-size:14px; color:var(--txt)}
.gov-section-desc{color:var(--muted); font-size:12px; flex:1; min-width:180px}
.gov-section-head .btn{white-space:nowrap}
.gov-empty{padding:20px; text-align:center; color:var(--muted); background:var(--bg2); border:1px dashed var(--line2); border-radius:10px; font-size:13px}
.gov-rule{position:relative; border:1px solid var(--line2); border-radius:10px; padding:12px 14px; background:var(--bg2); margin-bottom:10px}
.gov-rule-top{display:flex; align-items:center; gap:12px; margin-bottom:8px; padding-right:26px}
.gov-name{flex:1; padding:7px 10px; font-size:13px; font-weight:600; background:var(--bg3); border:1px solid var(--line2); border-radius:6px; color:var(--txt)}
.gov-en{white-space:nowrap; margin:0}
.gov-match{background:var(--bg3); border:1px solid var(--line); border-radius:8px; padding:9px 10px; margin-bottom:8px; display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.gov-match-label{width:100%; font-size:12px; color:var(--txt2); margin-bottom:2px}
.gov-match input[type=text],.gov-match input:not([type]){flex:1; min-width:150px}
.gov-match input{padding:6px 9px; font-size:12px; background:var(--bg2); border:1px solid var(--line2); border-radius:6px; color:var(--txt)}
.gm-m-host,.gm-src-host,.gm-tgt-host,.gm-m-types,.gm-src-types,.gm-tgt-types{flex:1; min-width:150px}
.gov-lv-group{display:inline-flex; gap:10px; white-space:nowrap}
.gov-lv,.gov-wd,.gov-ch{display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--txt2); cursor:pointer}
.gov-window,.gov-weekdays,.gov-channels{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; font-size:12px}
.gov-win-label{color:var(--muted); min-width:56px}
.gov-window input[type=time]{padding:5px 8px; background:var(--bg3); border:1px solid var(--line2); border-radius:6px; color:var(--txt); font-size:12px}
.gov-hint-inline{color:var(--muted); font-size:11px}
.gov-weekdays,.gov-channels{gap:12px}
.gov-samehost,.gov-continue{margin:0; font-size:12px}
.gov-rule .switch span{font-size:12px}

/* ===== 安全中心 / 配置面板（切勿复用 KPI .card：.card 是横向 flex） ===== */
.cfg-stack{display:flex; flex-direction:column; gap:var(--sp-4); max-width:920px}
.cfg-panel{
  display:flex; flex-direction:column; gap:var(--sp-4);
  background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:var(--sp-5) var(--sp-6); box-shadow:var(--shadow-sm);
}
.cfg-panel-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:var(--sp-4);
  padding-bottom:var(--sp-4); border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.cfg-panel-title{font-size:15px; font-weight:600; color:var(--txt); margin:0 0 6px; line-height:1.3}
.cfg-panel-desc{margin:0; font-size:12px; color:var(--muted); line-height:1.55; max-width:640px}
.cfg-enable{flex:none; margin:0; padding:8px 12px; border:1px solid var(--line2); border-radius:var(--r); background:var(--bg2)}
.cfg-form{display:flex; flex-direction:column; gap:4px}
.cfg-form-row{display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-3) var(--sp-4)}
.cfg-form .field{margin-bottom:10px; min-width:0}
.cfg-form .field > label{display:block}
.cfg-form .field input:not([type=checkbox]):not([type=radio]),
.cfg-form .field textarea,
.cfg-form .field .select-wrap{width:100%; max-width:100%; box-sizing:border-box}
.cfg-form .field textarea{min-height:110px; resize:vertical; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; line-height:1.5; padding:10px 12px; background:var(--bg3); border:1px solid var(--line2); border-radius:var(--r-sm); color:var(--txt)}
.cfg-form .field-hint,.field-hint{margin-top:5px; font-size:11px; color:var(--muted2); line-height:1.45}
.cfg-field-switch{display:flex; align-items:center; min-height:64px; padding-top:18px}
.cfg-actions{display:flex; align-items:center; flex-wrap:wrap; gap:var(--sp-3); margin-top:6px; padding-top:var(--sp-3); border-top:1px solid var(--line)}
.cfg-status{font-size:12px; color:var(--muted); min-height:1.2em}
.cfg-status.ok{color:var(--ok-txt)}
.cfg-status.err{color:var(--crit-txt)}
@media (max-width:720px){
  .cfg-form-row{grid-template-columns:1fr}
  .cfg-panel{padding:var(--sp-4)}
  .cfg-field-switch{padding-top:0; min-height:0}
}

/* ===== 告警阈值卡片布局 ===== */
.threshold-card{background:var(--bg2); border:1px solid var(--line2); border-radius:12px; padding:16px 18px; margin-bottom:14px; transition:box-shadow .2s}
.threshold-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.06)}
.threshold-card-header{display:flex; align-items:center; gap:8px; margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--line2)}
.threshold-card-header::before{content:''; width:4px; height:18px; border-radius:2px; flex-shrink:0}
.threshold-card-header.tc-system::before{background:var(--accent, #4c8dff)}
.threshold-card-header.tc-probe::before{background:#06b6d4}
.threshold-card-header.tc-api::before{background:#8b5cf6}
.threshold-card-header.tc-task::before{background:#f59e0b}
.threshold-card-header.tc-forward::before{background:#22c55e}
.threshold-card-header.tc-snmp::before{background:#0ea5e9}
.threshold-card-header.tc-netflow::before{background:#64748b}
.threshold-card-header .th-label{font-weight:600; font-size:14px; color:var(--txt)}
.threshold-preset-bar{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg); padding:var(--sp-4) var(--sp-5); margin-bottom:var(--sp-4); box-shadow:var(--shadow-sm)}
.threshold-preset-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--sp-2) var(--sp-4); margin-bottom:var(--sp-3)}
.threshold-preset-head .th-label{font-weight:600; font-size:14px; color:var(--txt)}
.threshold-preset-head .hint{font-size:12px; color:var(--muted); line-height:1.45}
.threshold-preset-cards{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--sp-3)}
.threshold-preset-card{position:relative; text-align:left; cursor:pointer; background:var(--bg2); border:1px solid var(--line2); border-radius:var(--r); padding:14px 16px; color:var(--txt); transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast); min-height:88px}
.threshold-preset-card:hover:not(:disabled){border-color:var(--accent-border); box-shadow:var(--shadow-sm); transform:translateY(-1px)}
.threshold-preset-card:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.threshold-preset-card:disabled{opacity:.55; cursor:not-allowed; transform:none}
.threshold-preset-card.recommended{border-color:var(--accent-border); background:var(--accent-soft)}
.threshold-preset-card.active{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent), var(--shadow-sm); background:var(--accent-soft)}
.threshold-preset-card.applying{opacity:.72; pointer-events:none}
.threshold-preset-card .tpc-badge{position:absolute; top:10px; right:12px; font-size:11px; color:var(--accent-txt); font-weight:600; letter-spacing:.02em}
.threshold-preset-card .tpc-title{font-weight:600; font-size:14px; margin-bottom:6px; padding-right:42px}
.threshold-preset-card .tpc-desc{font-size:12px; color:var(--muted); line-height:1.5}
[data-theme="light"] .threshold-preset-card{background:var(--bg2)}
[data-theme="light"] .threshold-preset-card.recommended,
[data-theme="light"] .threshold-preset-card.active{background:rgba(22,119,255,.06)}
@media (max-width:860px){.threshold-preset-cards{grid-template-columns:1fr}}
/* 阈值输入：聚焦环与主按钮区一致 */
#view-thresholds .th-input-row input:focus{box-shadow:0 0 0 3px var(--accent-soft) !important; border-color:var(--accent)}
#view-thresholds .section-title .tag{max-width:min(720px,58vw); white-space:normal; line-height:1.4}
.threshold-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px}
.threshold-field{display:flex; flex-direction:column; gap:4px}
.threshold-field>label{font-size:12px; color:var(--txt2); font-weight:500}
.threshold-field .th-input-row{display:flex; align-items:center; gap:8px}
.threshold-field .th-input-row input{flex:1; width:0; padding:7px 10px; font-size:13px; background:var(--bg3); border:1px solid var(--line2); border-radius:6px; color:var(--txt); font-family:var(--mono)}

/* 可读性/无障碍：弹窗内长代码/JSON 块横向滚动，避免截断隐藏内容或撑破弹窗。
   终端除外：它的网格按容器宽度排版，横向滚动条只会占掉底部提示符那一行。 */
.modal pre:not(.term-screen),.modal code,.modal .mono{max-width:100%; overflow-x:auto}
/* 键盘可达：非按钮的可点区域获得焦点时也给出清晰轮廓 */
.nav-item:focus-visible,.mini-btn:focus-visible,[data-act]:focus-visible{outline:2px solid var(--accent); outline-offset:2px}

/* ============================================================
   全局表单控件统一打磨（输入 / 选择 / 文本域 / 下拉 / 按钮 / 开关）
   —— 克制专业深色：三类控件统一"输入井"外观（同背景/边框/圆角/高度/
   过渡/hover/focus），修掉此前 input(--bg2) 与 select(--panel2) 背景不一致、
   textarea 无统一基样、下拉箭头字形粗糙等问题。
   ============================================================ */

/* 统一外观：同背景(--bg2)、同边框、同圆角、同字号、同过渡 */
.field input:not([type=checkbox]):not([type=radio]),
.field select,
.field textarea,
textarea,
select {
  background-color: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

/* 统一内距/高度：三类控件同 36px 视觉高度；select 右侧留出箭头位 */
.field input:not([type=checkbox]):not([type=radio]),
.field textarea,
textarea { padding: 9px 12px; }
select { padding: 9px 30px 9px 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.field textarea, textarea { width: 100%; min-height: 66px; resize: both; box-sizing: border-box; }

/* 统一 hover：边框微亮（此前只有 select 有 hover，且会切换背景造成"跳色"） */
.field input:not([type=checkbox]):not([type=radio]):hover:not(:focus),
.field textarea:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
  border-color: var(--hover-border);
  background-color: var(--bg2);
}

/* 统一 focus：accent 边框 + 柔和聚焦环（键盘/鼠标一致，无红框） */
.field input:not([type=checkbox]):not([type=radio]):focus,
.field textarea:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  background-color: var(--bg2);
}

/* 统一 placeholder / 禁用态 */
.field input::placeholder, .field textarea::placeholder, textarea::placeholder, input::placeholder { color: var(--muted2); }
.field input:disabled, .field select:disabled, .field textarea:disabled, textarea:disabled, select:disabled {
  opacity: .55; cursor: not-allowed; background: var(--bg3); border-color: var(--line);
}

/* 下拉箭头统一为 select 自身背景 chevron（对齐每个 select 右缘，杜绝 .select-wrap 错位）；停用伪元素箭头避免双箭头/错位 */
.select-wrap::after { content: none; }

/* 全局搜索框：与输入井统一 + 内嵌放大镜图标（克制精致），focus 环一致 */
.search {
  background-color: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.search:hover:not(:focus) { border-color: var(--hover-border); }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ===== AI 对话·快捷问题 / 推荐 Prompt ===== */
.ai-suggest { margin: 12px 2px 4px; }
.ai-suggest-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.ai-suggest-refresh { margin-left: auto; font-size: 11px; color: var(--muted); background: transparent; border: 1px solid var(--line2); border-radius: 6px; padding: 3px 9px; cursor: pointer; transition: all var(--transition-fast); }
.ai-suggest-refresh:hover { border-color: var(--accent); color: var(--accent); }
.ai-suggest-chips { display: flex; flex-direction: column; gap: 8px; }
.ai-suggest-chip { text-align: left; font-size: 13px; color: var(--txt2); background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 13px; cursor: pointer; line-height: 1.45; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.ai-suggest-chip:hover { border-color: var(--accent); color: var(--txt); background: var(--accent-soft); transform: translateX(2px); }
.ai-suggest-chip:active { transform: translateX(0); }
.log-stat-empty { color: var(--muted); font-size: 12px; margin-left: 10px; }
.kind.term { background: var(--accent-soft); color: var(--accent); } /* 终端审计日志徽标 */

/* IA 视图内 Tab 栏（监控 ⊃ 拨测/API、告警 ⊃ 当前/治理） */
.view-tabs { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-end; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.view-tab-section { padding: 9px 10px 9px 4px; font-size: 11px; font-weight: 600; color: var(--muted2); letter-spacing: .02em; user-select: none; }
.view-tab-section:not(:first-child) { margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.view-tab { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; transition: color var(--transition-fast), border-color var(--transition-fast); }
.view-tab:hover { color: var(--txt2); }
.view-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.resource-search-bar { position: relative; z-index: 20; max-width: 620px; margin: -6px 0 18px; }
.resource-search-box { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.resource-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.resource-search-box svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.resource-search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--txt); font: inherit; font-size: 13px; }
.resource-search-spinner { display: none; width: 13px; height: 13px; flex: none; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.resource-search-bar.loading .resource-search-spinner { display: block; }
.resource-search-results { display: none; position: absolute; top: 43px; left: 0; right: 0; max-height: 360px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-lg); }
.resource-search-results.show { display: block; }
.resource-search-result { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--txt); text-align: left; cursor: pointer; }
.resource-search-result:hover, .resource-search-result:focus { outline: 0; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.resource-search-type { padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; }
.resource-search-main { min-width: 0; }
.resource-search-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.resource-search-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; color: var(--muted); font-size: 11px; }
.resource-search-host { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.resource-search-empty { padding: 18px; color: var(--muted); font-size: 13px; text-align: center; }

/* AI 工具调用状态 chip：与回答正文分离的一排状态徽标，实时 执行中→✓/✗ */
.ai-tool-trace{display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 10px}
.ai-tool-chip{display:inline-flex; align-items:center; gap:5px; font-size:12px; line-height:1;
  padding:4px 9px; border-radius:999px; border:1px solid var(--line2); background:var(--panel2); color:var(--muted)}
.ai-tool-chip.run{color:var(--accent); border-color:var(--accent-soft,var(--accent))}
.ai-tool-chip.ok{color:#4a9e5c; border-color:#2f5d3a}
.ai-tool-chip.err{color:#ef4d5a; border-color:#5d2f34}
.ai-tool-spin{width:12px; height:12px; animation:spin .6s linear infinite}

/* AI 对话·回到底部悬浮按钮 */
.ai-chat-modal .modal-body { position: relative; }
.ai-chat-modal .ai-scroll-btn { position: absolute; right: 20px; bottom: 104px; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); color: var(--txt2); cursor: pointer; align-items: center; justify-content: center; font-size: 16px; box-shadow: var(--shadow); z-index: 3; transition: border-color var(--transition-fast), color var(--transition-fast); }
.ai-chat-modal .ai-scroll-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 代码块：语言标签 + 独立复制按钮（Claude 观感） */
.ai-chat-modal .ai-code-wrap { margin: 8px 0; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--bg); }
.ai-chat-modal .ai-code-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; background: var(--panel2); border-bottom: 1px solid var(--line2); }
.ai-chat-modal .ai-code-lang { font-size: 11px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .04em; }
.ai-chat-modal .ai-code-copy { font-size: 11px; color: var(--muted); background: transparent; border: 1px solid var(--line2); border-radius: 5px; padding: 2px 9px; cursor: pointer; transition: border-color var(--transition-fast), color var(--transition-fast); }
.ai-chat-modal .ai-code-copy:hover { border-color: var(--accent); color: var(--accent); }
.ai-chat-modal .ai-code-wrap pre.ai-code { margin: 0; border: none; border-radius: 0; background: transparent; }
/* 语法高亮 token（在深/浅底都可读的中性配色） */
.ai-chat-modal .ai-code .tok-kw { color: #a66bd4; }
.ai-chat-modal .ai-code .tok-str { color: #4a9e5c; }
.ai-chat-modal .ai-code .tok-num { color: #c07a2e; }
.ai-chat-modal .ai-code .tok-com { color: var(--muted); font-style: italic; }

/* 空态居中欢迎语 */
.ai-chat-modal .ai-welcome { text-align: center; padding: 26px 16px 10px; }
.ai-chat-modal .ai-welcome-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.ai-chat-modal .ai-welcome-title { font-size: 16px; font-weight: 600; color: var(--txt); margin-bottom: 6px; }
.ai-chat-modal .ai-welcome-sub { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 440px; margin: 0 auto; }
.ai-cap-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; max-width: 480px; margin-left: auto; margin-right: auto; }
.ai-cap-chip { font-size: 11px; color: var(--txt2); background: var(--bg2); border: 1px solid var(--line2); border-radius: 999px; padding: 3px 10px; line-height: 1.4; }
.ai-action-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ai-action-card { font-size: 12.5px; color: var(--accent); background: var(--accent-soft, rgba(59,130,246,.08)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line2)); border-radius: 8px; padding: 7px 12px; cursor: pointer; line-height: 1.35; transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast); }
.ai-action-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.ai-action-card:active { transform: none; }
.ai-chart-pending { margin-top: 10px; font-size: 12px; color: var(--muted); }
.ai-chart-card { margin-top: 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); overflow: hidden; }
.ai-chart-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding: 8px 12px; border-bottom: 1px solid var(--line2); }
.ai-chart-title { font-size:13px; font-weight:600; color:var(--txt); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-chart-tools { display:flex; align-items:center; gap:6px; flex:none; }
.ai-chart-tools .chip-btn { font-size:11px; padding:2px 8px; }
.ai-chart-tools .chart-enlarge {
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line2); border-radius:6px; background:var(--bg); color:var(--muted); cursor:pointer;
}
.ai-chart-tools .chart-enlarge:hover { color:var(--accent); border-color:var(--accent); }
.ai-chart-tools .chart-enlarge svg { width:14px; height:14px; }
.ai-chart-fc-hint {
  padding: 4px 12px 6px; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--line2);
}
.ai-chart-fc-hint.warn { color: var(--warn, #f59e0b); }
#chartZoomMask .modal-head { display:flex; align-items:center; gap:10px; }
#chartZoomMask .modal-head h3 { flex:1; min-width:0; }
.chart-zoom-tools { display:flex; align-items:center; gap:6px; flex:none; }
.chart-zoom-tools .chip-btn { font-size:12px; }
.chart-zoom-ranges {
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  margin: 0 0 8px;
}
.chart-zoom-ranges .chip-btn { font-size:12px; padding:3px 9px; }
#chartZoomCustomPanel { margin: 0 0 8px; }
.ai-chart-title { font-size: 12.5px; font-weight: 600; color: var(--txt); }
.ai-chart-wrap { padding: 6px 8px 10px; }
.ai-chart-wrap canvas { width: 100% !important; display:block; }
.ai-stat-card { margin-top: 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); padding: 12px 14px; position: relative; overflow: hidden; max-width: 280px; }
.ai-stat-card.warn { border-color: color-mix(in srgb, #f59e0b 50%, var(--line2)); }
.ai-stat-card.crit { border-color: color-mix(in srgb, #ef4d5a 50%, var(--line2)); }
.ai-stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ai-stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--txt); }
.ai-stat-card.warn .ai-stat-value { color: #f59e0b; }
.ai-stat-card.crit .ai-stat-value { color: #ef4d5a; }
.ai-stat-unit { font-size: 13px; font-weight: 500; margin-left: 4px; color: var(--muted); }
.ai-stat-spark { position: absolute; right: 0; bottom: 0; left: 40%; height: 36px; opacity: .9; }
.ai-stat-spark .spark-svg { width: 100%; height: 100%; display:block; }
.ai-table-card, .ai-logs-card { margin-top: 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); overflow: hidden; }
.ai-table-wrap { overflow: auto; max-height: 260px; }
.ai-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-table-wrap th, .ai-table-wrap td { padding: 6px 10px; border-bottom: 1px solid var(--line2); text-align: left; white-space: nowrap; }
.ai-table-wrap th { color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--bg) 70%, var(--bg2)); position: sticky; top: 0; }
.ai-logs-wrap { max-height: 240px; overflow: auto; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.ai-log-line { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line2) 70%, transparent); }
.ai-log-ts { flex: 0 0 auto; color: var(--muted); }
.ai-log-text { flex: 1 1 auto; color: var(--txt2); word-break: break-all; white-space: pre-wrap; }
.ai-chat-modal .ai-welcome + .ai-suggest { max-width: 560px; margin-left: auto; margin-right: auto; }

/* 诊断(SRE) 内部子 Tab：统一为下划线 Tab 观感（与 IA 视图 Tab 栏一致） */
#sreTabs.sre-tabs { gap: 2px; }
#sreTabs .chip-btn { border: none; background: transparent; border-radius: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 14px; font-weight: 500; transition: color var(--transition-fast), border-color var(--transition-fast); }
#sreTabs .chip-btn:hover { color: var(--txt2); background: transparent; }
#sreTabs .chip-btn.active { color: var(--accent); background: transparent; border-bottom-color: var(--accent); }

/* ============================================================
   AI 对话 · Claude 会话风格重构（纯 CSS 呈现层）
   仅作用于主对话 #aiChatModal(.ai-chat-modal)；不改任何 JS——流式/会话/工具/
   附件/Markdown 渲染逻辑完全不动。诊断内联对话(.ai-diagnosis-chat)不受影响。
   ============================================================ */
.ai-chat-modal { max-width: 760px; }
.ai-chat-modal .modal-body > .hint { font-size: 11.5px; opacity: .72; }

/* 消息区：整行阅读列 + 充裕留白，取代窄气泡 */
.ai-chat-modal .ai-chat-log { gap: 2px; padding: 6px 2px; }
.ai-chat-modal .ai-chat-msg {
  max-width: none; align-self: stretch; position: relative;
  padding: 14px 14px 14px 48px; margin: 0; border-radius: 12px;
  font-size: 14px; line-height: 1.72; background: transparent; border: none; white-space: normal;
}
/* 左侧头像：绝对定位，不干扰多块 Markdown 排版 */
.ai-chat-modal .ai-chat-msg::before {
  position: absolute; left: 10px; top: 13px; width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
}
/* 助手：留白正文（无边框气泡）+ 机器人头像 */
.ai-chat-modal .ai-chat-msg.ai { color: var(--txt); background: transparent; }
.ai-chat-modal .ai-chat-msg.ai::before { content: "🤖"; background: var(--accent-soft); }
/* 用户：淡底容器 + 用户头像（取代刺眼蓝气泡），保留纯文本换行 */
.ai-chat-modal .ai-chat-msg.me {
  color: var(--txt); background: var(--bg3); border: 1px solid var(--line);
  border-radius: 12px; white-space: pre-wrap; word-break: break-word;
}
.ai-chat-modal .ai-chat-msg.me::before { content: "🧑"; background: var(--panel3); }
/* 系统/引导：静音、无头像、左对齐 */
.ai-chat-modal .ai-chat-msg.sys { padding-left: 14px; color: var(--muted); background: transparent; text-align: left; }
.ai-chat-modal .ai-chat-msg.sys::before { content: none; }

/* 组合输入区：统一圆角容器 + focus 光晕，内部控件无边框（Claude composer 观感） */
.ai-chat-modal .ai-chat-input {
  align-items: flex-end; gap: 6px; background: var(--bg2); border: 1px solid var(--line2);
  border-radius: 14px; padding: 6px 8px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.ai-chat-modal .ai-chat-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-chat-modal .ai-composer-tools { display: inline-flex; align-items: center; gap: 0; flex: none; align-self: flex-end; }
.ai-chat-modal .ai-composer-more { position: relative; display: inline-flex; }
.ai-chat-modal .ai-composer-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30;
  min-width: 148px; padding: 4px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.ai-chat-modal .ai-composer-menu[hidden] { display: none !important; }
.ai-chat-modal .ai-composer-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: var(--txt);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12px; cursor: pointer; text-align: left;
}
.ai-chat-modal .ai-composer-menu button:hover { background: var(--panel3); color: var(--accent); }
.ai-chat-modal .ai-chat-input textarea {
  border: none !important; background: transparent !important; box-shadow: none !important;
  min-height: 30px; max-height: 168px; padding: 6px 4px; resize: none; line-height: 1.55;
}
.ai-chat-modal .ai-attach-btn {
  width: 28px; height: 28px; border: none; background: transparent; border-radius: 8px;
  color: var(--muted); align-self: center; font-size: 14px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-chat-modal .ai-attach-btn:hover { background: var(--panel3); color: var(--accent); }
.ai-chat-modal .ai-attach-btn.active { background: var(--crit-soft); color: var(--crit-txt); }
.ai-chat-modal .ai-chart-empty {
  padding: 18px 14px; color: var(--muted); font-size: 12px; text-align: center;
  border-top: 1px dashed var(--line);
}
/* 发送 / 停止：小一号圆形，避免喧宾夺主 */
.ai-chat-modal #aiChatSendBtn {
  width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-end;
  box-shadow: none;
}
.ai-chat-modal #aiChatSendBtn:hover:not(:disabled) { transform: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-chat-modal #aiChatSendBtn svg { width: 14px; height: 14px; }
.ai-chat-modal .ai-stop-btn {
  width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 50%;
  align-self: flex-end; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.ai-chat-modal .ai-msg-tools { display: flex; justify-content: flex-start; gap: 2px; margin-top: 8px; flex-wrap: wrap; }
.ai-chat-modal .ai-chat-msg.ai .ai-msg-tools { opacity: .72; }
.ai-chat-modal .ai-chat-msg.ai:hover .ai-msg-tools { opacity: 1; }
.ai-chat-modal .ai-msg-tools button {
  width: 28px; height: 28px; min-width: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 12px; font-family: inherit;
}
.ai-chat-modal .ai-msg-tools button:hover { color: var(--txt); background: var(--panel3); border-color: var(--line2); }
.ai-chat-modal .ai-msg-tools button.ok { color: var(--ok); }
.ai-chat-modal .ai-msg-tools button.ai-speak-btn.speaking { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) {
  .ai-chat-modal .ai-composer-menu { min-width: 132px; }
  .ai-chat-modal .ai-composer-menu button span { font-size: 11px; }
  .ai-chat-modal .ai-msg-tools button { width: 26px; height: 26px; min-width: 26px; }
}
/* 流式打字光标：生成中在最后一条助手消息末尾闪烁 */
.ai-chat-modal .ai-chat-log.ai-streaming .ai-chat-msg.ai:last-child::after { content: "▋"; color: var(--accent); margin-left: 1px; animation: aiTypeBlink 1s steps(2, start) infinite; }
@keyframes aiTypeBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ai-chat-modal .ai-chat-log.ai-streaming .ai-chat-msg.ai:last-child::after { animation: none; } }
@media (prefers-reduced-motion: reduce) { .ai-suggest-chip:hover, .ai-suggest-chip:active { transform: none; } }

/* 按钮交互细节：主/次按钮 hover 轻微上浮、active 回落，主按钮加极淡光晕（克制） */
.btn { transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); }
.btn:hover:not(:disabled):not(.ghost) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 3px 12px -2px var(--accent-soft); }

/* 开关(switch)标签 hover 时文字提亮，增强可点击暗示 */
.switch:hover { color: var(--txt); }

/* 自定义下拉菜单(分类/AI 模型/告警治理)与原生控件统一圆角与投影层级 */
.cat-dd-menu, .ai-model-dropdown { border-radius: var(--r-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--line2); }

@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(:disabled):not(.ghost), .btn:active:not(:disabled) { transform: none; }
}

/* ============================================================================
   硬件监控面板 (Hardware Health Panel)
   ============================================================================ */
/* 状态色一律走 --ok/--warn/--crit token：此前这里硬编码了一整套浅色系
   (#dcfce7 / #fee2e2 / #16a34a …)，在深色主题下是刺眼的糖果色色块。
   同理 background 曾用 var(--card) —— 该变量全项目从未定义，等于没有背景色。 */
/* ── 硬件：工具栏（搜索 / 状态 / 更新时间筛选）── */
.hw-toolbar{display:flex; gap:var(--sp-2); align-items:center; flex-wrap:wrap; padding-top:var(--sp-3)}
/* 资源视图（硬件 + 虚拟机）工具栏搜索：与全局 .search 同一视觉标准 —— 内嵌放大镜图标、
   同一 border/focus token；仅宽度策略不同（此处 flex 撑满工具栏，全局 .search 为定宽右对齐）。 */
.hw-search{flex:1; min-width:200px; max-width:380px; background:var(--panel2); border:1px solid var(--line2);
  border-radius:var(--r-sm); padding:7px 11px 7px 34px; font-size:13px; color:var(--txt); font-family:inherit;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:11px center}
.hw-search::placeholder{color:var(--muted2)}
.hw-search:hover{border-color:var(--hover-border)}
.hw-search:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.hw-sel{background:var(--panel2); border:1px solid var(--line2); border-radius:var(--r-sm);
  padding:7px 10px; font-size:13px; color:var(--txt); cursor:pointer}
.hw-count{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; margin-left:auto}
/* 主机在线状态点：硬件数据来自带外 BMC，主机离线不代表数据无效，
   所以只做一个小标识，不弱化整张卡片 */
.hw-dot{display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:5px; flex:none; vertical-align:middle}
.hw-dot.on{background:var(--ok); box-shadow:0 0 0 2px var(--ok-soft)}
.hw-dot.off{background:var(--gray-off); box-shadow:0 0 0 2px rgba(132,146,166,.12)}
/* 重复主机提示条 */
.hw-dup-bar{display:flex; align-items:center; gap:var(--sp-2); flex-wrap:wrap;
  background:var(--warn-soft); border:1px solid var(--warn-border); color:var(--warn-txt);
  border-radius:var(--r-sm); padding:8px 12px; margin-top:var(--sp-3); font-size:12px}
.hw-dup-bar button{margin-left:auto}
.hw-dup-bar button + button{margin-left:0}

.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-3); padding: var(--sp-4) 0; }
.hw-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--sp-4); cursor: pointer; display: flex; flex-direction: column; gap: var(--sp-3);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.hw-card:hover { border-color: var(--hover-border); box-shadow: var(--shadow-sm); }
.hw-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 左侧 3px 状态色条：异常机器在一屏卡片里一眼可辨，不必逐张读文字 */
.hw-card.hw-edge-warn { border-left: 3px solid var(--warn); }
.hw-card.hw-edge-crit { border-left: 3px solid var(--crit); }

.hw-card-header { display: flex; align-items: flex-start; gap: var(--sp-3); }
.hw-health-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; border: 1px solid transparent; }
.hw-health-dot.hw-ok { background: var(--ok-soft); color: var(--ok-txt); border-color: var(--ok-border); }
.hw-health-dot.hw-warn { background: var(--warn-soft); color: var(--warn-txt); border-color: var(--warn-border); }
.hw-health-dot.hw-crit { background: var(--crit-soft); color: var(--crit-txt); border-color: var(--crit-border); }
.hw-health-dot.hw-unknown { background: rgba(132,146,166,.12); color: var(--gray-txt); border-color: rgba(132,146,166,.25); }
.hw-card-info { flex: 1; min-width: 0; }
.hw-card-name { font-weight: 600; font-size: 14px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-card-sub { font-size: 12px; color: var(--muted2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 机型（PowerEdge R740 / TaiShan 200…）——运维定位问题时第一眼要看的东西 */
.hw-card-model { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hw-quick-stats { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.hw-stat { background: var(--bg2); border: 1px solid var(--line); padding: 3px 8px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 500; color: var(--txt2); display: inline-flex; align-items: baseline; gap: 4px; }
.hw-stat-k { color: var(--muted); font-weight: 400; }
.hw-stat.hw-stat-warn { border-color: var(--warn-border); background: var(--warn-soft); color: var(--warn-txt); }
.hw-stat.hw-stat-crit { border-color: var(--crit-border); background: var(--crit-soft); color: var(--crit-txt); }

.hw-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hw-table th, .hw-table td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.hw-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.hw-table td { color: var(--txt2); }
.hw-table tr:last-child td { border-bottom: none; }
.hw-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg2); }
/* ── Hyper-V 虚拟机页：按物理机分组 ── */
.hv-host{ border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel); margin-top:var(--sp-3); overflow-x:auto; }
.hv-host-head{ display:flex; align-items:center; gap:var(--sp-3); flex-wrap:wrap; padding:var(--sp-2) var(--sp-3); border-bottom:1px solid var(--line); background:var(--bg2); }
.hv-host-name{ font-weight:600; font-size:13px; }
.hv-host-stat{ font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.hv-host-upd{ margin-left:auto; font-size:11px; }
.hv-table{ margin:0; }
.hv-table th, .hv-table td{ white-space:nowrap; }
.hv-row-bad td{ background:var(--crit-soft); }
.hv-bad{ color:var(--crit-txt); font-weight:500; }
.hv-link{ color:var(--accent); cursor:pointer; text-decoration:none; }
.hv-link:hover{ text-decoration:underline; }
.hw-warn-text td, .hw-warn-text { color: var(--warn-txt); }
.hw-crit-text td, .hw-crit-text { color: var(--crit-txt); }
.hw-expand-hint { font-size: 11px; color: var(--muted); text-align: center; padding-top: var(--sp-1);
  border-top: 1px solid var(--line); margin-top: auto; transition: color var(--transition-fast); }
.hw-card:hover .hw-expand-hint { color: var(--accent); }

/* ── 硬件：列表视图（与卡片视图自由切换）── */
.hw-list{display:flex; flex-direction:column; gap:4px; padding:var(--sp-3) 0}
.hw-row{display:grid; grid-template-columns:28px minmax(150px,1.6fr) 76px 72px 62px 62px 120px 1fr 36px;
  gap:10px; align-items:center; background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:8px 12px; cursor:pointer;
  transition:border-color var(--transition-fast), background var(--transition-fast)}
.hw-row:hover{border-color:var(--hover-border); background:var(--panel2)}
.hw-row:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.hw-row .hw-health-dot{width:22px; height:22px; font-size:12px}
.hw-row-id{min-width:0}
.hw-row-name{font-weight:600; font-size:13px; color:var(--txt); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hw-row-sub{font-size:11px; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hw-row-cell{font-size:12px; color:var(--txt2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* ── 硬件详情：整机身份卡 ── */
.hw-ident{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:var(--sp-2) var(--sp-4);
  background:var(--bg2); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:var(--sp-3) var(--sp-4); margin-bottom:var(--sp-3)}
.hw-ident-item{min-width:0}
.hw-ident-k{font-size:11px; color:var(--muted); margin-bottom:2px}
.hw-ident-v{font-size:12px; color:var(--txt); font-weight:500; word-break:break-all}

/* ── 硬件详情：KPI 摘要条（重点突出）── */
.hw-kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(108px,1fr)); gap:var(--sp-2); margin-bottom:var(--sp-3)}
.hw-kpi{background:var(--bg2); border:1px solid var(--line); border-radius:var(--r-sm); padding:var(--sp-2) var(--sp-3); text-align:center}
.hw-kpi-v{font-size:15px; font-weight:700; color:var(--txt); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hw-kpi-k{font-size:11px; color:var(--muted); margin-top:2px}
.hw-kpi.hw-ok{border-color:var(--ok-border)} .hw-kpi.hw-ok .hw-kpi-v{color:var(--ok-txt)}
.hw-kpi.hw-warn{border-color:var(--warn-border)} .hw-kpi.hw-warn .hw-kpi-v{color:var(--warn-txt)}
.hw-kpi.hw-crit{border-color:var(--crit-border)} .hw-kpi.hw-crit .hw-kpi-v{color:var(--crit-txt)}

/* ── 硬件详情：异常项置顶框 ── */
.hw-bad-box{border:1px solid var(--crit-border); background:var(--crit-soft);
  border-radius:var(--r-sm); padding:var(--sp-3); margin-bottom:var(--sp-3)}
.hw-bad-box h4{margin:0 0 var(--sp-2); font-size:13px; color:var(--crit-txt)}
.hw-bad-box .hw-table td{color:var(--txt2)}
.hw-bad-box .hw-table th{color:var(--muted)}
.hw-ok-box{border:1px solid var(--ok-border); background:var(--ok-soft); color:var(--ok-txt);
  border-radius:var(--r-sm); padding:var(--sp-2) var(--sp-3); margin-bottom:var(--sp-3); font-size:12px}

/* ── 硬件详情：部件区块 ── */
.hw-sec{margin-top:var(--sp-4)}
.hw-sec-head{display:flex; align-items:center; gap:var(--sp-2); margin-bottom:var(--sp-2)}
.hw-sec-head h4{margin:0 !important; font-size:13px; color:var(--txt) !important; font-weight:600}
.hw-sec-count{font-size:11px; color:var(--muted); background:var(--bg2); border:1px solid var(--line);
  border-radius:var(--r-xs); padding:1px 6px}
.hw-sec-empty{font-size:12px; color:var(--muted); padding:var(--sp-2) 0}
.hw-sev{font-size:10px; font-weight:600; padding:1px 6px; border-radius:var(--r-xs); white-space:nowrap}
.hw-sev.hw-ok{background:var(--ok-soft); color:var(--ok-txt); border:1px solid var(--ok-border)}
.hw-sev.hw-warn{background:var(--warn-soft); color:var(--warn-txt); border:1px solid var(--warn-border)}
.hw-sev.hw-crit{background:var(--crit-soft); color:var(--crit-txt); border:1px solid var(--crit-border)}
.hw-sev.hw-unknown{background:rgba(132,146,166,.12); color:var(--gray-txt); border:1px solid rgba(132,146,166,.25)}
/* 事件表里的"触发部件"是本次改版的重点，给它一点视觉权重 */
.hw-comp{font-family:var(--font-mono,ui-monospace,monospace); font-size:11px; color:var(--accent-txt);
  background:var(--accent-soft); border-radius:var(--r-xs); padding:1px 6px; white-space:nowrap}
.hw-events-wrap{max-height:280px; overflow-y:auto}

/* ── 导出下拉（沿用 .cat-dd-menu 的视觉语言）── */
.modal-head-actions{display:flex; align-items:center; gap:var(--sp-2)}
.exp-dd{position:relative}
.exp-dd-menu{
  display:none; position:absolute; top:100%; right:0; z-index:60; min-width:190px;
  background:var(--panel); border:1px solid var(--line2); border-radius:var(--r-sm);
  box-shadow:var(--shadow-lg); margin-top:4px; padding:4px 0;
}
.exp-dd-menu.show{display:block}
.exp-dd-opt{
  display:flex; align-items:center; justify-content:space-between; gap:var(--sp-3);
  width:100%; padding:7px 12px; cursor:pointer; font-size:13px; color:var(--txt2);
  background:none; border:none; text-align:left;
  transition:background var(--transition-fast), color var(--transition-fast);
}
.exp-dd-opt:hover{background:var(--panel2); color:var(--txt)}
.exp-dd-opt:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
.exp-dd-ext{font-size:11px; color:var(--muted); font-family:var(--font-mono,ui-monospace,monospace)}

/* 硬件详情弹窗：比默认 .modal.wide(640) 宽，容纳 4 张历史曲线 */
#hwDetailMask .modal{max-width:1080px; width:94%}
#hwDetailBody h4{margin:14px 0 6px; font-size:13px; color:var(--txt2)}
.hw-meta-row { font-size: 12px; color: var(--txt2); margin-bottom: 8px; }
.hw-meta-label { font-weight: 500; margin-right: 4px; }
.hw-error-row { background: var(--crit-soft); border: 1px solid var(--crit-border); color: var(--crit-txt);
  padding: 6px 10px; border-radius: var(--r-xs); margin-bottom: 10px; font-size: 12px; }
.hw-power-info { font-size: 12px; color: var(--txt2); margin-bottom: 8px; }

@media (max-width: 720px) {
  .hw-grid{grid-template-columns:1fr}
  /* 8 列栅格在窄屏会把每格挤成 1 个字符宽，退化成两行更可读 */
  .hw-row{grid-template-columns:22px 1fr auto 36px; grid-auto-rows:min-content; row-gap:4px}
  .hw-row .hw-row-cell{display:none}
}

/* =============================================================================
   网络流量面板 (NetFlow Panel)
   ============================================================================ */
.nf-toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 0; flex-wrap: wrap; }
/* 与硬件卡片同一个 bug：var(--card) 全项目从未定义，这些控件等于没有背景色，
   在深色底上就是一圈边框浮在那儿。对齐基础组件用的 token（select/.btn = --panel2）。 */
.nf-select, .nf-input { background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; color: var(--txt); }
.nf-select:hover, .nf-input:hover { border-color: var(--hover-border); }
.nf-select:focus, .nf-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nf-btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 6px 14px; font-size: 13px; color: var(--txt2); cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast); }
.nf-btn:hover { background: var(--panel3); border-color: var(--hover-border); color: var(--txt); }
.nf-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt2); cursor: pointer; white-space: nowrap; }
.nf-chk input { width: 14px; height: 14px; }
.nf-btn:hover { background: var(--bg2); }
.nf-content { padding: 0; }
.nf-section { margin-bottom: 24px; }
.nf-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
/* 旧摘要表（SNMP 面板仍复用），netflow 排行已改用 .nf-rank */
.nf-summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nf-summary-table th { text-align: left; padding: 6px 8px; color: var(--txt2); font-weight: 500; font-size: 12px; }
.nf-summary-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.nf-label { font-weight: 500; white-space: nowrap; }
.nf-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-bar-cell { width: 40%; }
.nf-bar { height: 16px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width .35s ease; }

/* 流量排行：序号 + Key/域名 + 流量 + 占比条（干净、商用） */
.nf-rank { display: flex; flex-direction: column; }
.nf-rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.nf-rank-row:hover { background: var(--panel2); }
.nf-rank-clickable { cursor: pointer; border-radius: var(--r-sm); }
.nf-rank-clickable:hover .nf-rank-key { color: var(--accent); text-decoration: underline; }
.nf-rank-no { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg3); }
.nf-rank-row:nth-child(1) .nf-rank-no { background: var(--accent-soft); color: var(--accent); }
.nf-rank-main { flex: 1; min-width: 0; }
.nf-rank-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.nf-rank-key { font-size: 13px; font-weight: 600; color: var(--txt); font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-ip-link { border: 0; padding: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; font-family: ui-monospace, monospace; }
.nf-ip-link:hover { text-decoration: underline; }
.nf-ip-kpis { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin: 12px 0 18px; }
.nf-ip-kpis > span { min-width: 120px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel2); color: var(--muted); font-size: 12px; }
.nf-ip-kpis b { display: block; color: var(--txt); font-size: 18px; margin-bottom: 3px; }
.nf-drill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.nf-drill-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--panel2); }
.nf-drill-card h4 { margin: 0 0 8px; font-size: 13px; color: var(--txt); }
.nf-drill-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; background: transparent; color: var(--txt); text-align: left; font: inherit; }
.nf-drill-row[data-nf-peer] { cursor: pointer; }
.nf-drill-row[data-nf-peer]:hover { color: var(--accent); }
.nf-drill-row span { position: relative; z-index: 1; min-width: 0; font-size: 12px; }
.nf-drill-row span:first-child { overflow: hidden; text-overflow: ellipsis; }
.nf-drill-row small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-drill-row i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); opacity: .55; }
@media (max-width: 780px) { .nf-drill-grid { grid-template-columns: 1fr; } }
.nf-rank-dom { font-size: 12px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.nf-rank-bytes { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--txt2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-rank-bar { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.nf-rank-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width .35s ease; }

/* Flow 明细表 */
.nf-flows-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.nf-flows-toolbar .nf-input { flex: 1; min-width: 220px; max-width: 420px; }
.nf-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.nf-flow-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nf-flow-table th, .nf-flow-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.nf-flow-table tbody tr:last-child td { border-bottom: none; }
.nf-flow-table tbody tr:hover td { background: var(--panel2); }
.nf-flow-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--bg3); z-index: 1; }
.nf-mono { font-family: ui-monospace, monospace; color: var(--txt2); }
.nf-num { text-align: right; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--txt); }
.nf-ipcell { font-family: ui-monospace, monospace; }
/* 协议徽标：TCP/UDP/ICMP 语义配色 */
.nf-proto { padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.nf-proto-tcp { background: var(--accent-soft); color: var(--accent); }
.nf-proto-udp { background: rgba(168,85,247,.14); color: #a855f7; }
.nf-proto-icmp { background: var(--warn-soft); color: var(--warn); }
.nf-badge { padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.nf-badge-netflow { background: var(--accent-soft); color: var(--accent-txt); border: 1px solid var(--accent-border); }
.nf-badge-packet { background: var(--accent2-soft); color: var(--accent2-txt); border: 1px solid var(--accent2-border); }
/* 内容审计：列表行可点进详情弹窗；单元格仅预览截断。 */
.ca-row { cursor: pointer; }
.ca-row:hover { background: var(--panel2); }
.ca-body-cell { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, monospace; font-size: 12px; }
.ca-detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ca-detail-kv { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.ca-detail-kv .k { color: var(--muted); flex: 0 0 auto; white-space: nowrap; }
.ca-detail-kv .v { color: var(--txt); word-break: break-all; min-width: 0; }
.ca-detail-sec { margin-bottom: 14px; }
.ca-detail-sec-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.ca-detail-trunc { color: #e0a300; font-weight: 500; }
.ca-detail-pre {
  margin: 0; padding: 12px; max-height: 320px; overflow: auto;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.ca-detail-empty { color: var(--muted); font-size: 12px; padding: 8px 0; }
.ca-sens-pill { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #e04d5a; color: #fff; font-size: 11px; }
.nf-flow-table td { vertical-align: top; }

/* 明细表通用分页控件 */
.tbl-pager { display: flex; align-items: center; gap: 10px; padding: 10px 2px 2px; flex-wrap: wrap; }
.tbl-pager-info { font-size: 12px; color: var(--muted); }
.tbl-pager-spacer { flex: 1; min-width: 8px; }
.tbl-pager-size { padding: 4px 22px 4px 8px; font-size: 12px; height: 28px; }
.tbl-pager-cur { font-size: 12px; color: var(--txt2); font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.tbl-pager-btn { width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--txt2); cursor: pointer; font-size: 15px; line-height: 1; transition: border-color .15s, color .15s; }
.tbl-pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tbl-pager-btn:disabled { opacity: .4; cursor: default; }
.empty-state { padding: 40px; text-align: center; color: var(--txt2); font-size: 14px; }
.loading-dots { padding: 40px; text-align: center; color: var(--txt2); }

/* SNMP 网络设备面板：复用 nf-* 结构，仅补状态徽标与异常行高亮（语义 token，深浅主题自适应）。 */
.sn-tabs { display: inline-flex; gap: 4px; }
.nf-btn.sn-active { background: var(--accent-soft); color: var(--accent-txt); border-color: var(--accent-border); }
.sn-toolbar-row { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.sn-if-filter { display: inline-flex; gap: 4px; align-items: center; }
.sn-dim { color: var(--muted); font-weight: 400; font-size: 12px; }
.sn-meta { font-size: 12px; color: var(--txt2); margin: 4px 0 10px; }
.sn-badge { padding: 1px 7px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; margin-left: 6px; }
.sn-up { background: var(--ok-soft); color: var(--ok-txt); }
.sn-down { background: var(--crit-soft); color: var(--crit-txt); }
.sn-warn { background: var(--warn-soft); color: var(--warn); }
.sn-row-crit td { background: var(--crit-soft); }
.sn-row-warn td { background: var(--warn-soft); }
.sn-oid { font-family: ui-monospace, monospace; font-size: 11px; color: var(--txt2); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* SNMP 设备卡片 + 统计 + 利用率条（网络设备页重构） */
.sn-dev { margin-bottom: 22px; }
.sn-dev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sn-dev-title { font-size: 16px; font-weight: 650; color: var(--txt); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-dev-sub { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sn-pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; }
.sn-pill.ok { background: var(--ok-soft); color: var(--ok); }
.sn-pill.bad { background: var(--crit-soft); color: var(--crit); }
.sn-stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 12px; }
.sn-stats .sn-stat[data-snifilter] { cursor: pointer; }
.sn-stats .sn-stat[data-snifilter]:hover { opacity: .85; text-decoration: underline; }
.sn-stat { font-size: 12px; color: var(--muted); display: inline-flex; align-items: baseline; gap: 5px; }
.sn-stat b { font-size: 15px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }
.sn-stat.ok b { color: var(--ok); }
.sn-stat.bad b { color: var(--crit); }
.sn-util { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.sn-util-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.sn-util-fill { height: 100%; border-radius: 3px; transition: width .35s ease; }
.sn-util-v { font-size: 12px; font-family: ui-monospace, monospace; color: var(--txt2); width: 34px; text-align: right; }

/* ===== 仪表盘（clean 风：干净卡片 · 克制边框 · 充分留白 · 明暗自适应） ===== */
/* 列表：卡片网格 */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dash-card { cursor: pointer; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.dash-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.dash-card-hd { display: flex; align-items: center; gap: 10px; }
.dash-card-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 15px; background: var(--accent-soft); color: var(--accent); }
.dash-card-ic.ai { background: rgba(168, 85, 247, .14); color: #a855f7; }
.dash-card-logo { width: 30px; height: 30px; flex: none; border-radius: 7px; object-fit: contain; background: var(--bg3); border: 1px solid var(--line); }
.dash-card-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card-ops { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.dash-card:hover .dash-card-ops { opacity: 1; }
.dash-card-desc { font-size: 12px; color: var(--txt2); line-height: 1.6; min-height: 19px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-card-desc.muted { color: var(--muted2); }
.dash-card-ft { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.dash-card-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--bg3); color: var(--muted); }
.dash-card-badge.ai { background: rgba(168, 85, 247, .12); color: #a855f7; }
.dash-card-badge.gf { background: var(--accent-soft); color: var(--accent); }
.dash-card-tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line2); color: var(--muted); }

/* 详情工具栏（两行：标题+操作 / 时间范围+数据源+变量） */
.dash-bar { margin-bottom: 14px; }
.dash-bar-main { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.dash-icon-btn { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--txt2); cursor: pointer; font-size: 16px; transition: border-color .15s, color .15s; }
.dash-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.dash-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-brand-logo {
  height: 28px; width: auto; max-width: 120px; flex: none;
  object-fit: contain; border-radius: 4px;
}
.dash-title { font-size: 17px; font-weight: 650; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.dash-badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.dash-badge.ai { background: rgba(168, 85, 247, .14); color: #a855f7; }
.dash-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-sep { width: 1px; height: 18px; background: var(--line2); margin: 0 2px; }
.dash-bar-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.dash-range { display: inline-flex; align-items: center; gap: 4px; }
.dash-refresh { font-size: 14px; }
.dash-spacer { flex: 1; min-width: 8px; }
.dash-picker, .dash-var { display: inline-flex; align-items: center; gap: 6px; }
.dash-picker-lbl, .dash-var label { font-size: 12px; color: var(--muted); white-space: nowrap; margin: 0; }
.dash-vars { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.select-wrap.sm select { padding: 5px 26px 5px 9px; font-size: 12px; height: 30px; }

/* 24 栏网格 + 面板卡片 + 编辑态 BI 幕布 */
.dash-canvas-shell { position: relative; min-width: 0; }
/* 看板自定义外观：背景色/图作用在画布壳；面板半透明保证可读 */
#dashDetail.dash-has-custom-bg {
  --dash-panel-alpha: 0.92;
}
#dashDetail.dash-has-custom-bg .dash-canvas-shell {
  border-radius: 10px;
  padding: 10px;
  background-color: var(--dash-bg-color, transparent);
  background-image: var(--dash-bg-image, none);
  background-size: var(--dash-bg-fit, cover);
  background-repeat: var(--dash-bg-repeat, no-repeat);
  background-position: center;
  min-height: 240px;
}
#dashDetail.dash-has-custom-bg .dash-panel {
  background: color-mix(in srgb, var(--bg2) calc(var(--dash-panel-alpha) * 100%), transparent);
  backdrop-filter: blur(6px);
}
body.dash-fullscreen #dashDetail.dash-has-custom-bg {
  background-color: var(--dash-bg-color, var(--bg));
  background-image: var(--dash-bg-image, none);
  background-size: var(--dash-bg-fit, cover);
  background-repeat: var(--dash-bg-repeat, no-repeat);
  background-position: center;
}
body.dash-fullscreen #dashDetail.dash-has-custom-bg .dash-bar {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.dash-canvas-shell.editing {
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 6%, transparent), transparent 55%),
    var(--bg3);
}
.dash-grid { display: grid; grid-template-columns: repeat(24, 1fr); grid-auto-rows: 24px; grid-auto-flow: row; gap: 8px; align-items: stretch; position: relative; }
.dash-grid.editing { min-height: calc(var(--dash-canvas-rows, 32) * 32px); }
.dash-grid-canvas {
  display: grid; grid-template-columns: repeat(24, 1fr); grid-auto-rows: 24px; gap: 8px;
  pointer-events: none; z-index: 0; position: relative;
}
.dash-cell {
  display: block; box-sizing: border-box; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--line2, var(--line)) 85%, transparent);
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  min-height: 24px;
}
.dash-cell.hot {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.dash-align-guides {
  position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden;
}
.dash-guide-v, .dash-guide-h {
  position: absolute; background: color-mix(in srgb, #f59e0b 85%, white);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .25);
}
.dash-guide-v { top: 0; bottom: 0; width: 1px; }
.dash-guide-h { left: 0; right: 0; height: 1px; }
.dash-layout-hud {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  font-size: 11px; font-family: ui-monospace, Menlo, monospace;
  padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg2) 92%, transparent); color: var(--txt2);
  backdrop-filter: blur(6px); pointer-events: none;
}
.dash-layout-hud.conflict { color: var(--warn); border-color: var(--warn-border, var(--warn)); }
.dash-panel { grid-column: span 24; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: box-shadow .15s, border-color .15s; position: relative; z-index: 1; }
.dash-panel:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, .07); }
.dash-panel-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.dash-panel-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.1px; }
.dash-panel-ds { font-size: 10px; padding: 1px 7px; border-radius: 9px; background: var(--bg3); color: var(--muted); white-space: nowrap; }
.panel-edit-actions { display: flex; gap: 3px; opacity: .35; transition: opacity .15s; }
.dash-panel:hover .panel-edit-actions { opacity: 1; }
.dash-grid.editing .panel-edit-actions { opacity: 1; }
@media (hover: none) {
  .panel-edit-actions { opacity: 1; }
  .dash-card-ops { opacity: 1; }
}
.dash-grid.editing .dash-panel { border-style: solid; box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent); }
.dash-panel-body { flex: 1; min-height: 0; padding: 8px 12px; overflow: hidden; position: relative; }
.dash-panel-body .chart-wrap { box-shadow: none; border-radius: 6px; height: 100%; width: 100%; }
/* 关键：仪表盘图表在 .chart-wrap 内（非 .chart-container），需自己给 canvas 撑满宽度，
   否则 canvas 用固有 ~300px 宽 → 右侧大片空白。曲线类图表宽度靠这条。 */
.dash-panel-body .chart-wrap canvas { width: 100%; display: block; }
.dash-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 8px; }
.dash-empty-hint { margin-top: 6px; font-size: 11px; line-height: 1.45; opacity: .85; max-width: 28em; margin-left: auto; margin-right: auto; }

/* Gauge（圆环径向仪表，多序列自适应铺满） */
.dp-gauge .dash-panel-body { display: flex; align-items: center; justify-content: center; padding: 4px 8px; }
.dash-gauges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; width: 100%; height: 100%; }
.dash-gauge-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; flex: 1 1 40%; max-width: 100%; max-height: 100%; }
/* 单个仪表尽量占满面板高度；多个时按可用空间等比缩小 */
.dp-gauge .gauge-svg { width: min(100%, 220px); max-width: 100%; height: auto; max-height: calc(100% - 18px); aspect-ratio: 1 / 1; }
.gauge-svg { width: 100%; max-width: 180px; height: auto; max-height: 100%; aspect-ratio: 1 / 1; }
.dp-gauge .dash-gauges:has(.dash-gauge-item:only-child) .gauge-svg { width: min(100%, 260px); max-height: calc(100% - 14px); }
.gauge-txt { font-size: clamp(13px, 2.2vw, 18px); font-weight: 650; font-family: ui-monospace, monospace; }
.dash-gauge-lbl { font-size: 11px; color: var(--muted); text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stat（大数值 + 阈值配色 + 迷你趋势）：紧凑 h=3~4，避免大块空白 */
.dp-stat .dash-panel-body { display: flex; align-items: center; justify-content: center; padding: 4px 10px 6px; overflow: hidden; }
.dash-stat2 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; min-height: 0; position: relative; }
.dash-stat-num { font-size: clamp(20px, 3.6vw, 32px); font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.05; flex: none; }
.dash-stat-cap { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; flex: none; }
.dash-stat-spark { width: 100%; height: 18px; min-height: 14px; max-height: 22px; margin-top: 1px; flex: 0 1 18px; }
.dp-gauge .dash-gauges-echart { width: 100%; height: 100%; display: flex; align-items: stretch; justify-content: center; gap: 4px; }
.dp-gauge .dash-gauges-echart .dash-gauge-item { flex: 1 1 0; min-width: 0; height: 100%; }
.dp-gauge .dash-echart-gauge { width: 100%; height: 100%; min-height: 0; }
.dash-stat-spark .spark-svg { width: 100%; height: 100%; display: block; }
.dash-stat-delta { font-size: 12px; font-weight: 650; letter-spacing: .2px; }
.dash-stat-delta.up { color: var(--crit, #ef4444); }
.dash-stat-delta.down { color: var(--ok, #22c55e); }
.dash-trend-tools { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; }
.dash-trend-btn.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.dash-horizon-sel { max-width: 88px; font-size: 11px; padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt); }
.dash-fc-meta { font-size: 11px; color: var(--muted); padding: 4px 10px 0; }
.dash-tip-fc { color: var(--accent); font-size: 11px; }
.dash-tip-cmp { color: var(--muted); font-size: 11px; }

/* BarGauge（横向条） */
.dash-bars-h { display: flex; flex-direction: column; justify-content: center; gap: 8px; width: 100%; height: 100%; }
.dash-bar-item { display: flex; align-items: center; gap: 10px; }
.dash-bar-lbl { width: 130px; font-size: 12px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { flex: 1; height: 8px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.dash-bar-val { width: 90px; text-align: right; font-size: 12px; font-family: ui-monospace, monospace; color: var(--txt); font-variant-numeric: tabular-nums; }

/* Pie / Donut（环形图 + 侧栏图例）—— 同时匹配 dp-piechart 与导入的 dp-pie */
.dp-piechart .dash-panel-body, .dp-pie .dash-panel-body { display: flex; align-items: center; }
.dash-pie { display: flex; align-items: center; gap: 14px; width: 100%; height: 100%; }
.dash-pie-chart { flex: 1 1 55%; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
/* 环图充满图表列（正方形，取宽高较小者），不再被硬性限制在 46% 宽而留白 */
.pie-svg { height: 100%; max-height: 100%; width: 100%; max-width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.donut-center { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-pie-legend { flex: 1 1 45%; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: 100%; }
.dash-pie-li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.dash-pie-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.dash-pie-name { flex: 1; min-width: 0; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-pie-val { font-family: ui-monospace, monospace; color: var(--txt); font-variant-numeric: tabular-nums; }
.dash-pie-pct { font-family: ui-monospace, monospace; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
/* 窄面板（单列栅格或手机）改为上下布局，环图在上、图例在下，避免挤压 */
@media (max-width: 720px) { .dash-pie { flex-direction: column; } .dash-pie-chart, .dash-pie-legend { flex: 1 1 auto; width: 100%; } .dash-pie-chart { max-height: 60%; } }

/* Bar chart（纵向柱状，top-N） */
.dash-bars { display: flex; align-items: flex-end; gap: 8px; width: 100%; height: 100%; padding-top: 6px; }
.dash-barcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 3px; }
.dash-barcol-v { font-size: 11px; color: var(--txt2); font-family: ui-monospace, monospace; white-space: nowrap; }
.dash-barcol-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.dash-barcol-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .4s ease; }
.dash-barcol-lbl { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* State timeline（状态色带：每序列一条，按值/阈值上色） */
.dash-states { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 100%; height: 100%; }
.dash-state-row { display: flex; align-items: center; gap: 10px; }
.dash-state-lbl { width: 130px; font-size: 12px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-state-track { flex: 1; display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--bg3); }
.dash-state-seg { flex: 1 1 0; min-width: 0; }
.dash-state-seg:hover { filter: brightness(1.15); }

/* Heatmap（时间×序列 密度色块） */
.dash-heatmap { display: flex; flex-direction: column; gap: 3px; width: 100%; height: 100%; overflow: auto; justify-content: center; }
.dash-heat-row { display: flex; align-items: center; gap: 10px; }
.dash-heat-lbl { width: 120px; font-size: 11px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-heat-cells { flex: 1; display: flex; height: 15px; border-radius: 3px; overflow: hidden; gap: 1px; }
.dash-heat-cell { flex: 1 1 0; min-width: 0; }
.dash-heat-cell:hover { outline: 1px solid var(--txt); outline-offset: -1px; }

/* Alert list（平台告警列表） */
.dash-alerts { display: flex; flex-direction: column; gap: 2px; width: 100%; height: 100%; overflow: auto; }
.dash-alerts-ok { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--ok); font-size: 14px; font-weight: 600; }
.dash-alert-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.dash-alert-row:hover { background: var(--panel2); }
.dash-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dash-alert-row.crit .dash-alert-dot { background: var(--crit); }
.dash-alert-row.warn .dash-alert-dot { background: var(--warn); }
.dash-alert-row.info .dash-alert-dot { background: var(--accent); }
.dash-alert-msg { flex: 1; min-width: 0; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-alert-host { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; white-space: nowrap; }

/* Table（细边框 · 表头底色 · 行悬浮） */
.dash-table-wrap { overflow: auto; max-height: 100%; height: 100%; border-radius: 6px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th, .dash-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.dash-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--bg3); z-index: 1; }
.dash-table tbody tr:hover td { background: var(--panel2); }
.dash-table td.num, .dash-table th.num { text-align: right; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* Logs */
.dash-logs { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; height: 100%; max-height: 100%; overflow: auto; line-height: 1.65; }
.dash-log-row { display: flex; gap: 10px; padding: 1px 0; align-items: flex-start; }
.dash-log-row:hover { background: var(--panel2); }
.dash-log-lvl { flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; background: var(--muted2); }
.dash-log-row.crit .dash-log-lvl { background: var(--crit); }
.dash-log-row.warn .dash-log-lvl { background: var(--warn); }
.dash-log-row.info .dash-log-lvl { background: var(--accent); }
.dash-log-row.debug .dash-log-lvl { background: var(--muted); }
.dash-log-row.crit .dash-log-line { color: var(--crit); }
.dash-log-row.warn .dash-log-line { color: var(--warn); }
.dash-log-ts { flex: none; color: var(--muted2); white-space: nowrap; }
.dash-log-line { color: var(--txt2); word-break: break-all; white-space: pre-wrap; }

/* ECharts mount + panel editor BI tabs */
.dash-echart { width: 100%; height: 100%; min-height: 80px; }
.dash-panel-body > .dash-echart { position: absolute; inset: 6px 8px 8px; min-height: 0; }
.dash-panel-body.dash-loading { display:flex; align-items:center; justify-content:center; }
.dash-panel-skeleton {
  width: 100%; height: 100%; min-height: 64px; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel2) 25%, color-mix(in srgb, var(--panel2) 60%, var(--line)) 50%, var(--panel2) 75%);
  background-size: 200% 100%; animation: dash-skel 1.2s ease-in-out infinite;
}
@keyframes dash-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.panel-type-badge {
  display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:600;
  padding:2px 7px; border-radius:999px; background:color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); margin-left: 6px; vertical-align: middle;
}
.panel-type-badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.dash-th-sort { cursor: pointer; user-select: none; }
.dash-th-sort:hover { color: var(--txt); }
.dash-th-sort.active { color: var(--accent); }
.modal-panel-edit { max-width: 820px; }
.panel-edit-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.panel-edit-tab { appearance: none; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.panel-edit-tab:hover { color: var(--txt); background: var(--panel2); }
.panel-edit-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel-edit-pane { display: none; }
.panel-edit-pane.active { display: block; }
.panel-check-col { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; padding-bottom: 4px; }
.panel-swatch-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.panel-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.panel-threshold-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.panel-threshold-row { display: flex; align-items: center; gap: 8px; }
.panel-threshold-row input[type="color"] { width: 36px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg3); cursor: pointer; }
.panel-threshold-preview { display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin-top: 10px; border: 1px solid var(--line); }
.panel-threshold-preview span { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); min-width: 0; }

/* Text / Unsupported / Coming soon */
.dash-text { font-size: 13px; color: var(--txt2); line-height: 1.7; }
.dash-unsupported { font-size: 12px; color: var(--warn); padding: 8px 4px; }
.dash-unsupported-q { margin-top: 6px; font-family: ui-monospace, monospace; color: var(--muted); font-size: 11px; word-break: break-all; }
.dash-coming-soon {
  height: 100%; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; padding: 12px; background:
    linear-gradient(160deg, color-mix(in srgb, var(--panel2) 80%, transparent), transparent);
  border: 1px dashed color-mix(in srgb, var(--line) 90%, var(--accent));
  border-radius: 8px;
}
.dash-coming-icon { font-size: 28px; line-height: 1; opacity: .9; }
.dash-coming-title { font-size: 14px; font-weight: 700; color: var(--txt); }
.dash-coming-type { font-size: 11px; font-family: ui-monospace, monospace; color: var(--accent); letter-spacing: .02em; }
.dash-coming-desc { font-size: 12px; color: var(--muted); max-width: 280px; line-height: 1.45; }
.dash-clock { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dash-clock-time { font-size: clamp(22px, 4vw, 36px); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--txt); letter-spacing: .04em; }
.dash-clock-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 编辑器：分区标题 + 查询/变量行 */
.editor-sec { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.editor-sec:first-child { margin-top: 0; }
.panel-target-row, .var-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mini-check { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* 行内裸 input 会被全局 reset 剥成无边框，显式补齐为与全局 .field input 一致的干净外观 */
.panel-target-row input, .var-row input {
  width: 100%; min-width: 0; font-family: inherit; font-size: 12px; color: var(--txt);
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 7px 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.panel-target-row input:focus, .var-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.panel-target-row input::placeholder, .var-row input::placeholder { color: var(--muted2); }
/* 编辑器行内的 select 与输入同高，视觉统一 */
.var-row .select-wrap.sm select { height: 32px; }

@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(12, 1fr); } }
@media (max-width: 720px) { .dash-grid { grid-template-columns: 1fr; } .dash-panel { grid-column: 1 / -1 !important; } .dash-bar-actions { width: 100%; margin-left: 0; } }

/* ===== 仪表盘专家工作台：AI 闭环、人工编排、审阅与导出 ===== */
.dash-ai-actions { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.dash-ai-actions .btn { border-color: transparent; }
.dash-ai-actions .btn:hover { border-color: rgba(168, 85, 247, .3); background: rgba(168, 85, 247, .09); color: #a855f7; }
.dash-edit-state { flex: none; font-size: 10px; line-height: 1; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); }
.dash-edit-state.dirty { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border, var(--warn)); }
.dash-grid.editing .dash-panel { box-shadow: inset 0 0 0 1px transparent; }
.dash-grid.editing .dash-panel:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(0, 0, 0, .1); }
.dash-panel.dragging, .dash-panel.resizing { opacity: .42; border-color: var(--accent); z-index: 4; }
.dash-drag-handle, [data-drag-surface] { cursor: grab; touch-action: none; }
.dash-drag-handle:active, body.dash-layout-dragging { cursor: grabbing; }
.dash-panel-editable { position: relative; }
.dash-panel-coord {
  position: absolute; left: 8px; bottom: 6px; z-index: 3;
  font-size: 10px; font-family: ui-monospace, Menlo, monospace;
  color: var(--muted); background: color-mix(in srgb, var(--bg2) 88%, transparent);
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.dash-panel-editable:hover .dash-panel-coord, .dash-panel.dragging .dash-panel-coord { opacity: 1; }
.dash-resize {
  position: absolute; z-index: 4; background: transparent;
}
.dash-resize-e { top: 28px; right: 0; width: 8px; bottom: 12px; cursor: ew-resize; }
.dash-resize-s { left: 8px; right: 12px; bottom: 0; height: 8px; cursor: ns-resize; }
.dash-resize-se {
  right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
  border-radius: 0 0 6px 0; opacity: .55;
}
.dash-panel-editable:hover .dash-resize-se { opacity: 1; }
.dash-layout-ghost {
  display: none; border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  pointer-events: none; z-index: 3; position: relative;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.dash-layout-ghost.visible { display: flex; align-items: flex-start; justify-content: flex-end; }
.dash-layout-ghost.snap-preview {
  border-style: solid; border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 16%, transparent);
}
.dash-layout-ghost-label {
  margin: 6px 8px; font-size: 11px; font-family: ui-monospace, Menlo, monospace;
  color: var(--txt); background: color-mix(in srgb, var(--bg2) 90%, transparent);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}
.btn.sm.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
body.dash-layout-dragging { user-select: none; }
body.dash-layout-dragging .dash-panel-body { pointer-events: none; }
.panel-template-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.panel-template-palette button { min-width: 0; padding: 9px 10px; text-align: left; color: var(--txt2); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.panel-template-palette button:hover, .panel-template-palette button.active { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.panel-template-palette b, .panel-template-palette span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-template-palette b { color: var(--txt); font-size: 12px; }
.panel-template-palette span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.dash-ai-presets { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.dash-ai-presets button { flex: none; padding: 5px 9px; color: var(--txt2); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 11px; }
.dash-ai-presets button:hover { color: #a855f7; border-color: rgba(168,85,247,.4); background: rgba(168,85,247,.08); }
.dash-ai-progress { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(168,85,247,.28); border-radius: 9px; background: rgba(168,85,247,.06); }
.dash-ai-progress-head { display: flex; justify-content: space-between; gap: 12px; color: var(--txt2); font-size: 12px; }
.dash-ai-progress-head b { color: #a855f7; font-variant-numeric: tabular-nums; }
.dash-ai-progress-track { height: 5px; margin: 8px 0; overflow: hidden; border-radius: 999px; background: var(--bg3); }
.dash-ai-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#7c3aed,#a855f7,#4c8dff); transition: width .3s ease; }
.panel-query-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-query-test-result { min-height: 18px; font-size: 11px; color: var(--muted); }
.panel-query-test-result.ok { color: var(--ok); }
.panel-query-test-result.warn { color: var(--warn); }
.panel-query-test-result.err { color: var(--crit); }
.dash-ai-review-mask { z-index: 1305; }
.dash-review-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.dash-review-kpis > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.dash-review-kpis b, .dash-review-kpis span { display: block; }
.dash-review-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--txt); }
.dash-review-kpis span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.dash-review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dash-review-grid section { min-width: 0; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); }
.dash-review-grid h4 { margin: 0 0 8px; font-size: 12px; }
.dash-review-grid h4.add { color: var(--ok); }
.dash-review-grid h4.change { color: var(--warn); }
.dash-review-grid h4.remove { color: var(--crit); }
.dash-review-grid ul { margin: 0; padding-left: 18px; color: var(--txt2); font-size: 12px; line-height: 1.65; }
.dash-review-warnings { margin-top: 12px; padding: 9px 11px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.dash-review-warnings.ok { color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-border, var(--ok)); }
.dash-review-warnings.warn { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-border, var(--warn)); }

/* AI 辅助是可交付报告工作台：明确状态、依据、反馈与格式化导出。 */
.ai-assist-panel { width: min(820px, 96vw); max-height: 88vh; margin-top: 5vh; }
.ai-assist-head { background: linear-gradient(90deg, rgba(168,85,247,.10), transparent 48%); }
.ai-assist-status { padding: 6px 16px; min-height: 27px; border-bottom: 1px solid var(--line); background: var(--panel2); color: var(--muted); font-size: 11px; }
.ai-assist-body { min-height: 220px; font-size: 13px; line-height: 1.7; }
.ai-stream-body > div, .ai-stream-body > ul, .ai-stream-body > ol { animation: aiStreamIn .12s ease-out; }
@keyframes aiStreamIn { from { opacity: .72; } to { opacity: 1; } }
.ai-evidence { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line2); }
.ai-evidence summary { cursor: pointer; color: var(--muted); font-size: 11px; user-select: none; }
.ai-evidence-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-evidence-item { display: inline-flex; gap: 5px; align-items: center; max-width: 100%; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); color: var(--txt2); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-evidence-item b { color: var(--accent); font-weight: 600; }
.ai-evidence-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ai-evidence-card { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.ai-evidence-kind { align-self: flex-start; font-size: 10px; font-weight: 600; color: var(--accent); letter-spacing: .02em; text-transform: none; }
.ai-evidence-title, .ai-evidence-link { font-size: 12px; font-weight: 600; color: var(--txt); line-height: 1.35; }
.ai-evidence-link { text-decoration: none; }
.ai-evidence-link:hover { color: var(--accent); text-decoration: underline; }
.ai-evidence-sum { font-size: 11px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inc-loop-strip { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.inc-loop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--txt2); }
.inc-loop-row b { color: var(--txt); font-weight: 600; }
.inc-loop-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.badge.freeze { background: rgba(220, 120, 40, .15); color: #c46a12; border: 1px solid rgba(220, 120, 40, .35); }
.skill-draft { border-left: 3px solid var(--warn, #c46a12); }
.desk-gate-chip { display: inline-flex; gap: 6px; margin-left: 8px; align-items: center; }
.ai-write-approval-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel2); }
.ai-composer-tools .btn.sm.ghost { min-height: 28px; } /* legacy; 写审批已收入更多菜单 */
.ai-assist-feedback { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--crit-soft); }
.ai-assist-feedback label { display: block; margin-bottom: 5px; color: var(--crit-txt, var(--crit)); font-size: 11px; font-weight: 600; }
.ai-assist-feedback textarea { width: 100%; resize: vertical; min-height: 54px; padding: 8px 9px; color: var(--txt); background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; font-family: inherit; font-size: 12px; }
.ai-assist-feedback-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 7px; }
.ai-assist-actions { align-items: center; flex-wrap: wrap; }
.ai-assist-export { display: inline-flex; align-items: center; gap: 4px; }
.ai-assist-export select { height: 29px; max-width: 112px; padding: 3px 22px 3px 7px; color: var(--txt2); background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; font-size: 11px; }
.ai-assist-actions #aiAssistStop { margin-right: auto; }
.ai-feedback-prompt-mask { z-index: 1510; align-items: center; }
.ai-feedback-prompt-panel { width: min(520px, 94vw); overflow: hidden; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 22px 64px rgba(0,0,0,.48); }
.ai-feedback-prompt-body { padding: 15px 17px 4px; }
.ai-feedback-prompt-body p { margin: 0 0 12px; color: var(--txt2); font-size: 12px; line-height: 1.65; }
.ai-feedback-prompt-body label { display: block; margin-bottom: 5px; color: var(--txt); font-size: 11px; font-weight: 600; }
.ai-feedback-prompt-body textarea { width: 100%; min-height: 92px; resize: vertical; padding: 9px 10px; color: var(--txt); background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; font: inherit; font-size: 12px; line-height: 1.55; }
.ai-feedback-prompt-body textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.ai-feedback-prompt-error { min-height: 20px; padding-top: 4px; color: var(--crit); font-size: 11px; }
.ai-feedback-prompt-panel .ai-assist-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 10px 17px 14px; }
.ai-assist-panel :focus-visible, .dash-bar :focus-visible, .dash-panel :focus-visible,
.panel-template-palette button:focus-visible, .dash-review-grid :focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 800px) {
  .panel-template-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-review-grid { grid-template-columns: 1fr; }
  .dash-review-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-ai-actions { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .dash-ai-actions .btn { white-space: nowrap; }
  .ai-assist-panel { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-card, .dash-panel, .panel-template-palette button, .dash-bar .btn, .ai-stream-body > * { transition: none !important; animation: none !important; }
}

/* 看板组件放大预览：大舞台铺满，图表真正可「看清」 */
.modal.modal-xl, .modal.dash-panel-zoom-modal { max-width: min(1200px, 96vw); width: min(1200px, 96vw); }
.dash-panel-zoom-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.dash-panel-zoom-stage {
  position: relative;
  width: 100%;
  height: min(72vh, 640px);
  min-height: 360px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.dash-panel-zoom-stage .dash-echart,
.dash-panel-zoom-stage .dash-panel-skeleton,
.dash-panel-zoom-stage .chart-wrap { width: 100%; height: 100%; min-height: 0; }
.dash-panel-zoom-stage .dash-echart { position: absolute; inset: 8px; }
.dash-panel-zoom-stage .dash-stat2,
.dash-panel-zoom-stage .dash-gauges,
.dash-panel-zoom-stage .dash-pie { height: 100%; }
.dash-panel-zoom-stage .dash-fc-meta { padding: 8px 12px 0; }

/* 看板视觉导出：隐藏编辑控件，截图接近只读展示态 */
body.dash-exporting .panel-edit-actions,
body.dash-exporting .dash-resize,
body.dash-exporting .dash-panel-coord,
body.dash-exporting .dash-grid-canvas,
body.dash-exporting .dash-align-guides,
body.dash-exporting .dash-layout-ghost,
body.dash-exporting .dash-layout-hud { display: none !important; }
body.dash-exporting .dash-panel { box-shadow: none !important; }

/* 看板全屏预览：沉浸式演示态 */
body.dash-fullscreen .sidebar,
body.dash-fullscreen .topbar { display: none !important; }
body.dash-fullscreen .app { display: block; }
body.dash-fullscreen #view-dashboards {
  position: fixed; inset: 0; z-index: 9200;
  background: var(--bg); overflow: auto; padding: 0;
  display: block !important;
}
body.dash-fullscreen #dashHome { display: none !important; }
body.dash-fullscreen #dashDetail {
  display: block !important; min-height: 100vh; padding: 10px 14px 24px;
}
body.dash-fullscreen .dash-bar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin: -10px -14px 12px; padding: 10px 14px;
}
body.dash-fullscreen .dash-ai-actions { display: none; }
body.dash-fullscreen #dashEditBtn,
body.dash-fullscreen #dashAddPanel,
body.dash-fullscreen #dashEditVars,
body.dash-fullscreen #dashEditMeta,
body.dash-fullscreen #dashCancelEdit,
body.dash-fullscreen #dashSaveBtn,
body.dash-fullscreen #dashUndoBtn,
body.dash-fullscreen #dashRedoBtn,
body.dash-fullscreen #dashAutoFillBtn,
body.dash-fullscreen #dashCompactBtn,
body.dash-fullscreen #dashTidyBtn { display: none !important; }
body.dash-fullscreen #dashFullscreenBtn { display: inline-flex !important; }

/* 主机巡检报告 TOC */
.insp-toc{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 14px}
.insp-toc-a{font-size:12px;padding:4px 9px;border-radius:6px;border:1px solid var(--line);color:var(--txt2);text-decoration:none;background:var(--bg2)}
.insp-toc-a:hover{border-color:var(--accent);color:var(--accent)}
.insp-toc-a.warn{border-color:var(--warn-border);color:var(--warn)}
.insp-toc-a.crit{border-color:var(--crit-border);color:var(--crit)}
.insp-toc-a.skip{opacity:.55}
.insp-metrics{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px}

/* ---- 统一附件条 / 评论条 / 语音态 ---- */
.attach-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.attach-chip{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;font-size:12px;background:var(--panel2);border:1px solid var(--line2);color:var(--txt2);text-decoration:none;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attach-chip.img{border-color:var(--accent-border);background:var(--accent-soft);color:var(--accent-txt)}
.attach-chip.file{border-color:var(--accent2-border);background:var(--accent2-soft);color:var(--accent2-txt)}
.attach-chip button{border:0;background:transparent;color:inherit;cursor:pointer;padding:0 2px;opacity:.7;font-size:12px;line-height:1}
.attach-chip button:hover{opacity:1}
.attach-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.inc-comment-bar{display:flex;flex:1;align-items:center;gap:6px;flex-wrap:wrap;min-width:220px;margin-left:auto}
.inc-comment-bar input[type=text]{flex:1;min-width:140px}
.inc-comment-bar .attach-chips{width:100%;order:-1}
.ai-attach-btn.active{background:var(--crit-soft);color:var(--crit-txt);border-color:var(--crit-border);box-shadow:0 0 0 2px var(--crit-soft)}
.tk-comment{padding:8px 10px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--panel2);margin-bottom:8px}
.tk-comment .tk-c-author{font-weight:600;color:var(--accent-txt);font-size:12px}
.tk-comment .tk-c-time{color:var(--muted);font-size:11px;margin-left:6px}
.modal .field label{font-size:12px;color:var(--muted);margin-bottom:4px;display:block}
.modal .grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:640px){.modal .grid2{grid-template-columns:1fr}.inc-comment-bar{margin-left:0;width:100%}}

/* 仪表盘外观编辑 */
.dash-appear-preview{
  border:1px solid var(--line); border-radius:8px; overflow:hidden; margin-bottom:12px;
  background:var(--bg3);
}
.dash-appear-preview-bar{
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  border-bottom:1px solid var(--line); background:var(--bg2); font-size:13px; font-weight:600;
}
.dash-appear-preview-bar img{height:22px; width:auto; max-width:80px; object-fit:contain}
.dash-appear-preview-canvas{height:72px; background-position:center}
.dash-appear-upload{display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap}
.dash-appear-thumb{
  width:64px; height:64px; border-radius:8px; border:1px dashed var(--line2);
  display:grid; place-items:center; overflow:hidden; background:var(--bg3); flex:none;
}
.dash-appear-thumb.wide{width:140px; height:72px}
.dash-appear-thumb.has-img{border-style:solid}
.dash-appear-thumb img{width:100%; height:100%; object-fit:contain}
.dash-appear-upload-actions{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.dash-appear-color-row{display:flex; gap:8px; align-items:center}
.dash-appear-color-row input[type=color]{
  width:36px; height:32px; padding:0; border:1px solid var(--line2); border-radius:6px;
  background:transparent; cursor:pointer;
}
.dash-appear-color-row input[type=text]{flex:1; min-width:0}
#dashAppearOpacity{width:100%; accent-color:var(--accent)}


/* —— 安全中心：主机安全 / Web 扫描 —— */
.sec-shell{ display:flex; flex-direction:column; gap:14px }
.sec-notice{
  margin:0; padding:9px 14px;
  border:1px solid color-mix(in srgb, #b8860b 22%, var(--line));
  border-left:3px solid #b8860b;
  border-radius:10px;
  background:color-mix(in srgb, #b8860b 7%, var(--panel));
  font-size:12px; color:var(--muted); line-height:1.55;
}
.sec-notice-slim{ padding:8px 12px }
.sec-metrics{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(100px,1fr));
  gap:10px; margin:0;
}
.sec-metrics.compact{ gap:8px }
.sec-overview-shell{ display:flex; flex-direction:column; gap:14px }
.sec-overview-kpis{ margin-top:4px }
.sec-overview-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px;
}
.sec-overview-card{ margin:0 }
.sec-overview-list{
  margin:8px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:8px;
  font-size:13px; color:var(--muted);
}
.sec-overview-list li{
  display:flex; justify-content:space-between; gap:12px; align-items:baseline;
}
.sec-overview-list strong{ color:var(--txt); font-variant-numeric:tabular-nums }
.sec-overview-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px }
.sec-metric.ok b{ color:var(--ok-txt, var(--ok)) }
.sec-metric.warn b{ color:var(--warn-txt) }
.sec-metric{
  display:flex; flex-direction:column; gap:4px;
  padding:12px 14px; min-width:0;
  border:1px solid var(--line); border-radius:12px;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--panel2) 88%, transparent), var(--panel));
  box-shadow:0 1px 0 color-mix(in srgb, #fff 4%, transparent) inset;
  transition:border-color .15s ease, transform .15s ease;
}
.sec-metric:hover{ border-color:color-mix(in srgb, var(--accent) 28%, var(--line)) }
.sec-metric b{
  font-size:22px; font-weight:700; letter-spacing:-.04em; line-height:1.1;
  font-variant-numeric:tabular-nums; color:var(--txt);
}
.sec-metric span{ font-size:11px; color:var(--muted2); letter-spacing:.02em; font-weight:500 }
.sec-metric.crit{
  border-color:color-mix(in srgb, var(--crit-txt) 28%, var(--line));
  background:linear-gradient(165deg, color-mix(in srgb, var(--crit-txt) 8%, var(--panel2)), var(--panel));
}
.sec-metric.high{
  border-color:color-mix(in srgb, #d96a28 28%, var(--line));
  background:linear-gradient(165deg, color-mix(in srgb, #d96a28 8%, var(--panel2)), var(--panel));
}
.sec-metric.crit b{ color:var(--crit-txt) }
.sec-metric.high b{ color:#d96a28 }
.sec-metric.med b{ color:var(--warn-txt) }
.sec-metric.ok b{ color:var(--ok-txt, var(--ok)) }
button.sec-metric.sec-kpi-btn{
  appearance:none; -webkit-appearance:none; font:inherit; text-align:left; cursor:pointer;
  color:inherit; width:auto;
}
button.sec-metric.sec-kpi-btn:hover{ border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--line)); }

/* 命令区：选择器 + 主操作（主机 / Web 共用） */
.sec-command{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(220px,.72fr);
  gap:14px; align-items:stretch;
  padding:14px;
  border:1px solid var(--line); border-radius:14px;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%),
    var(--panel);
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
@media (max-width:980px){ .sec-command{ grid-template-columns:1fr } }
.sec-command-pick{ display:flex; flex-direction:column; gap:8px; min-width:0 }
.sec-command-label{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap }
.sec-command-title{ font-size:12px; font-weight:700; color:var(--txt); letter-spacing:.01em }
.sec-command-hint{ font-size:11px; color:var(--muted2); font-weight:400 }
.sec-command-side{
  display:flex; flex-direction:column; justify-content:center; gap:12px;
  padding:4px 2px 4px 4px; min-width:0;
}
.sec-command-cta{ display:flex; flex-wrap:wrap; align-items:center; gap:10px }
.sec-scan-btn{
  min-width:118px; height:36px; padding:0 16px; font-size:13px;
  box-shadow:0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.sec-sel-chip{
  display:inline-flex; align-items:center; gap:4px;
  height:28px; padding:0 10px; border-radius:999px;
  font-size:11px; font-weight:650; font-variant-numeric:tabular-nums;
  color:var(--accent-txt, var(--accent));
  background:var(--accent-soft);
  border:1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
}
.sec-command-tools{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.sec-command-tools .btn.ghost{ color:var(--muted) }
.sec-command .act-menu-panel{ min-width:220px }
.sec-command .act-menu-panel button,
.sec-command .act-menu-panel [role="menuitem"]{
  flex-direction:column; align-items:flex-start; gap:2px; padding:9px 11px;
}
.act-menu-sub{
  display:block; font-size:11px; font-weight:400; color:var(--muted); line-height:1.35;
}
.sec-command .act-menu-panel button:hover .act-menu-sub,
.sec-command .act-menu-panel [role="menuitem"]:hover .act-menu-sub{ color:var(--muted2) }

.sec-toolbar{
  display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; margin:0;
}
.sec-toolbar-actions{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.sec-panel{ margin:0 !important }
.sec-panel-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px;
}
.sec-panel-head .cfg-panel-title{ margin:0; font-size:14px; font-weight:700 }
.sec-panel-meta{
  min-width:22px; height:22px; padding:0 8px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:650; font-variant-numeric:tabular-nums;
  color:var(--muted); background:var(--panel2); border:1px solid var(--line);
}
.sec-empty{
  padding:32px 20px; text-align:center; color:var(--muted);
  border:1px dashed color-mix(in srgb, var(--line) 80%, transparent); border-radius:12px;
  background:color-mix(in srgb, var(--panel2) 70%, transparent);
}
.sec-empty.slim{ padding:16px 12px }
.sec-empty h4{ margin:0 0 6px; color:var(--txt); font-size:14px; font-weight:650 }
.sec-empty p{ margin:0; font-size:12px; line-height:1.55; max-width:36em; margin-inline:auto }
.sec-empty-ico{
  width:40px; height:40px; margin:0 auto 12px; border-radius:50%;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 32%, transparent) 0 28%, transparent 30%),
    var(--panel);
  box-shadow:inset 0 0 0 7px color-mix(in srgb, var(--accent) 7%, transparent);
}
.sec-cfg-panel{ margin-bottom:4px }
.sec-row{ cursor:pointer; transition:background .12s ease }
.sec-row:hover{ background:var(--panel2) }
.sec-row.active-row{
  background:color-mix(in srgb, var(--accent) 12%, var(--panel2));
  box-shadow:inset 3px 0 0 var(--accent);
}
.sec-score{ font-variant-numeric:tabular-nums }
.sec-remediation{ margin:8px 0 14px }
.sec-remediation ul{ margin:6px 0 0; padding-left:18px }
.sec-remediation li{ margin:4px 0; font-size:12px }
.sec-remediation code{
  font-size:12px; padding:1px 6px; border-radius:4px;
  background:var(--bg3); border:1px solid var(--line);
}
.sec-actions{ display:flex; gap:6px; flex-wrap:wrap }
.sec-url{
  max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  display:inline-block; vertical-align:bottom; font-size:12px;
}
.sec-batch{ font-weight:600; font-size:13px; line-height:1.35; color:var(--txt) }
.sec-batch-id{ font-size:11px; margin-top:2px }
.sec-error-box{
  margin:0 0 12px; padding:10px 12px; border-radius:8px;
  border:1px solid color-mix(in srgb, var(--crit-txt) 35%, var(--line));
  background:color-mix(in srgb, var(--crit-txt) 10%, var(--panel));
  color:var(--crit-txt); font-size:12px; line-height:1.55; white-space:pre-wrap;
}
/* legacy aliases kept for any remaining callers */
.sec-stat-row{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
  gap:8px; margin:0 0 10px;
}
.sec-stat-row.compact{ margin-bottom:10px }
.sec-stat{
  border:1px solid var(--line); border-radius:10px; background:var(--panel2);
  padding:10px 12px; min-width:0;
}
.sec-stat-n{ font-size:20px; font-weight:700; color:var(--txt); letter-spacing:-.02em; line-height:1.1 }
.sec-stat-n.crit{ color:var(--crit-txt) }
.sec-stat-n.high{ color:#d96a28 }
.sec-stat-l{ margin-top:2px; font-size:11px; color:var(--muted2) }

#hostSecurityPanel .cfg-panel,
#webSecurityPanel .cfg-panel{
  margin-top:0; margin-bottom:0;
  border-radius:14px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
#hostSecurityPanel .hs-toolbar,
#webSecurityPanel .hs-toolbar{
  align-items:flex-start; flex-wrap:wrap; gap:12px;
}
#hostSecurityPanel .hs-host-pick,
#webSecurityPanel .hs-host-pick{
  display:flex; flex-direction:column; gap:6px;
  flex:1 1 360px; min-width:min(320px,100%); max-width:560px;
}
#hostSecurityPanel .hs-host-pick > label,
#webSecurityPanel .hs-host-pick > label{
  font-size:11px; color:var(--muted2); font-weight:600;
}
/* Shared host tree picker (playbook / inspect / API / security …) */
.hs-pick-tree-wrap{
  border:1px solid var(--line); border-radius:12px; background:var(--panel2);
  overflow:hidden;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.hs-pick-tree-wrap:focus-within{
  border-color:color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow:0 0 0 3px var(--accent-soft);
}
.hs-pick-tools{
  display:flex; flex-direction:column; gap:8px; padding:10px 12px;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb, var(--panel) 88%, var(--panel2));
}
.hs-pick-search{
  width:100%; padding:8px 12px; border:1px solid var(--line); border-radius:9px;
  background:var(--panel); color:var(--txt); font-size:12.5px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.hs-pick-search:focus{
  outline:none;
  border-color:color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow:0 0 0 3px var(--accent-soft);
}
.hs-pick-quick{
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
}
.hs-pick-quick .btn{
  height:26px; padding:0 10px; font-size:11px; border-radius:7px;
}
.hs-pick-meta{
  margin-left:auto; font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums;
  padding:2px 8px; border-radius:999px; background:var(--panel3);
}
.hs-pick-tree{
  max-height:240px; overflow:auto; padding:4px 0 8px;
  scrollbar-width:thin;
}
.host-picker.is-compact .hs-pick-tree{ max-height:200px }
#hostSecurityPanel .sec-cfg-panel .hs-pick-tree{ max-height:260px }
.insp-hosts-pane .hs-pick-tree{ max-height:min(420px, 55vh) }
.pb-target-field{ grid-column:1 / -1 }
.pb-step-target-picker{ margin-top:4px }
.hs-pick-folder{
  display:flex; align-items:center; gap:4px; padding:5px 12px 5px 8px;
}
.hs-pick-caret{
  width:24px; height:24px; border:none; background:transparent; color:var(--muted);
  cursor:pointer; border-radius:7px; font-size:12px; line-height:1; padding:0;
  transition:background .12s ease, color .12s ease;
}
.hs-pick-caret:hover{ background:var(--panel3); color:var(--txt) }
.hs-pick-folder-lab{
  display:flex; align-items:center; gap:8px; flex:1; min-width:0; cursor:pointer; font-size:12.5px;
}
.hs-pick-folder-lab.is-on,
.hs-pick-folder-target.is-on{
  color:var(--accent);
}
.hs-pick-folder-name{ font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hs-pick-count{
  margin-left:auto; font-size:10px; color:var(--muted); background:var(--panel3);
  border-radius:999px; padding:2px 8px; font-variant-numeric:tabular-nums;
}
.hs-pick-row{
  display:grid; grid-template-columns:18px minmax(0,1.15fr) minmax(0,1fr) auto;
  gap:6px 10px; align-items:center; padding:7px 14px; cursor:pointer; font-size:12.5px;
  border-left:3px solid transparent;
  transition:background .12s ease, border-color .12s ease;
}
.hs-pick-row:hover{ background:color-mix(in srgb, var(--accent) 6%, var(--panel)) }
.hs-pick-row.is-on{
  background:color-mix(in srgb, var(--accent) 10%, transparent);
  border-left-color:var(--accent);
}
.hs-pick-row.off{ opacity:.5; cursor:not-allowed }
.hs-pick-name{ font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hs-pick-ip{ color:var(--muted); font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hs-pick-st{
  display:inline-flex; align-items:center; gap:5px;
  font-size:10.5px; color:var(--muted2); white-space:nowrap; font-weight:500;
}
.hs-pick-st.ok{ color:var(--ok-txt, var(--ok)) }
.hs-pick-dot{
  width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.75;
  box-shadow:0 0 0 2px color-mix(in srgb, currentColor 22%, transparent);
}
.hs-pick-empty{ padding:20px 16px; color:var(--muted); font-size:12px; text-align:center }
.hs-pick-chip{
  display:inline-flex; align-items:center; gap:5px; cursor:pointer;
  font-size:11px; padding:3px 10px; border-radius:999px;
  border:1px solid var(--line); background:var(--panel); color:var(--muted2);
}
.hs-pick-chip input{ position:absolute; opacity:0; pointer-events:none; width:0; height:0 }
.hs-pick-chip.is-on{
  border-color:color-mix(in srgb, var(--accent) 55%, var(--line));
  background:color-mix(in srgb, var(--accent) 12%, var(--panel));
  color:var(--accent); font-weight:600;
}
.hs-pick-target-quick .hs-pick-meta{ margin-left:0; flex:1 1 100% }
#apiSysHosts.host-multi .hs-pick-tree{ max-height:220px }
#hostSecurityPanel .sec-toolbar-actions,
#webSecurityPanel .sec-toolbar-actions{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding-top:18px;
}
#hostSecurityPanel .hs-layout{
  display:grid; grid-template-columns:minmax(0,1.25fr) minmax(320px,.9fr); gap:14px; align-items:start;
}
@media (max-width:1180px){ #hostSecurityPanel .hs-layout{ grid-template-columns:1fr } }
#hostSecurityPanel .hs-col-main,
#hostSecurityPanel .hs-col-side{ display:flex; flex-direction:column; gap:14px; min-width:0 }
#hostSecurityPanel .hs-detail{
  position:sticky; top:12px; min-height:280px; max-height:calc(100vh - 96px); overflow:auto;
  padding:16px !important;
}
#hostSecurityPanel .hs-detail-empty{ border:0; background:transparent; padding:36px 16px }
#hostSecurityPanel .hs-detail-head{ align-items:flex-start; gap:10px }
#hostSecurityPanel .hs-detail-actions{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
#hostSecurityPanel .hs-detail-kpis{ margin:4px 0 12px }
#hostSecurityPanel .hs-fw-panel{
  margin:0 0 14px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#hostSecurityPanel .hs-fw-head{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:6px;
}
#hostSecurityPanel .hs-fw-head .cfg-panel-title{ margin:0; font-size:13px }
#hostSecurityPanel .hs-progress{
  height:6px; border-radius:999px; background:var(--panel2); overflow:hidden; margin:12px 0;
}
#hostSecurityPanel .hs-progress-bar{
  height:100%; width:40%; border-radius:999px; background:var(--accent);
  animation:hs-progress 1.2s ease-in-out infinite;
}
@keyframes hs-progress{
  0%{ transform:translateX(-40%) } 100%{ transform:translateX(240%) }
}
#hostSecurityPanel .hs-panel{ width:100%; box-sizing:border-box }
#hostSecurityPanel .hs-table-wrap{ width:100%; overflow-x:auto }
#hostSecurityPanel .hs-table,
#webSecurityPanel .hs-table-compact{
  width:100%; table-layout:auto; border-collapse:collapse;
}
#hostSecurityPanel .hs-table th,
#hostSecurityPanel .hs-table td,
#webSecurityPanel .hs-table-compact th,
#webSecurityPanel .hs-table-compact td{
  padding:9px 10px; vertical-align:middle; text-align:left;
}
#hostSecurityPanel .hs-table-compact th,
#hostSecurityPanel .hs-table-compact td{ padding:8px 10px }
#hostSecurityPanel .hs-table th.col-score,
#hostSecurityPanel .hs-table td.col-score,
#hostSecurityPanel .hs-table th.col-num,
#hostSecurityPanel .hs-table td.col-num{ width:56px; text-align:center }
#hostSecurityPanel .hs-table th.col-risk,
#hostSecurityPanel .hs-table td.col-risk{ width:72px }
#hostSecurityPanel .hs-table th.col-time,
#hostSecurityPanel .hs-table td.col-time{ width:132px; white-space:nowrap }
#hostSecurityPanel .hs-host-name{ font-weight:650; line-height:1.3 }
#hostSecurityPanel .hs-host-sub{ font-size:11px; margin-top:2px; line-height:1.35 }
#hostSecurityPanel .hs-score-cell{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:40px; height:32px; padding:0 8px; border-radius:8px;
  border:1px solid var(--line); background:var(--panel2);
}
#hostSecurityPanel .hs-score-cell strong{
  font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:-.02em;
}
#hostSecurityPanel .hs-score-cell.ok strong{ color:var(--ok-txt, var(--ok)) }
#hostSecurityPanel .hs-score-cell.med strong{ color:var(--warn-txt) }
#hostSecurityPanel .hs-score-cell.high strong{ color:#d96a28 }
#hostSecurityPanel .hs-score-cell.crit strong{ color:var(--crit-txt) }
#hostSecurityPanel .hs-ports-cell{
  display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px;
  min-width:0; max-width:220px; text-align:left;
}
#hostSecurityPanel button.hs-ports-link{
  margin:0; padding:2px 4px; border:0; border-radius:8px; background:transparent;
  cursor:pointer; font:inherit; color:inherit;
}
#hostSecurityPanel button.hs-ports-link:hover{
  background:color-mix(in srgb, var(--accent) 10%, transparent);
}
#hostSecurityPanel .hs-ports-meta{
  display:inline-flex; align-items:center; gap:4px; font-size:12px; white-space:nowrap;
}
#hostSecurityPanel .hs-ports-meta strong{ font-variant-numeric:tabular-nums }
#hostSecurityPanel .hs-port-risk{
  font-style:normal; font-size:10px; font-weight:700; min-width:16px; height:16px;
  padding:0 5px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line); color:var(--muted2); background:var(--panel2);
}
#hostSecurityPanel .hs-port-risk.ok{ color:var(--ok-txt, var(--ok)); border-color:color-mix(in srgb, var(--ok) 35%, var(--line)) }
#hostSecurityPanel .hs-port-risk.high{ color:#d96a28; border-color:rgba(217,106,40,.4); background:rgba(217,106,40,.1) }
#hostSecurityPanel .hs-port-risk.crit{ color:var(--crit-txt); border-color:color-mix(in srgb, var(--crit-txt) 40%, var(--line)); background:var(--crit-soft) }
#hostSecurityPanel .hs-port-chips{ display:inline-flex; flex-wrap:wrap; gap:3px; pointer-events:none }
#hostSecurityPanel .hs-port-chip{
  display:inline-flex; align-items:center; padding:1px 6px; border-radius:999px;
  border:1px solid var(--line); background:var(--panel2); font-size:10px;
  font-variant-numeric:tabular-nums; color:var(--txt);
}
#hostSecurityPanel .hs-port-chip.more{
  color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, var(--line));
  background:var(--accent-soft); font-weight:600;
}
#hostSecurityPanel .hs-port-panel-focus{
  outline:2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset:2px; border-radius:10px;
  animation:hs-port-flash 1.4s ease;
}
@keyframes hs-port-flash{
  0%{ background:color-mix(in srgb, var(--accent) 14%, var(--panel)) }
  100%{ background:transparent }
}
#hostSecurityPanel .hs-port-chip.crit{
  border-color:color-mix(in srgb, var(--crit-txt) 45%, var(--line));
  background:var(--crit-soft); color:var(--crit-txt); font-weight:600;
}
#hostSecurityPanel .hs-port-chip.high{
  border-color:rgba(255,140,66,.45); background:rgba(255,140,66,.12); color:#d96a28; font-weight:600;
}
#hostSecurityPanel .hs-port-chip.warn{
  border-color:color-mix(in srgb, var(--warn-txt) 40%, var(--line));
  background:var(--warn-soft); color:var(--warn-txt);
}
#hostSecurityPanel .hs-fw-eng{ font-size:11px; margin-top:3px }
#hostSecurityPanel .hs-port-panel{ margin:0 0 14px }
#hostSecurityPanel .hs-fim-panel{
  margin:0 0 14px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#hostSecurityPanel .hs-fim-panel .hs-fw-head{ margin-bottom:8px }
#hostSecurityPanel .hs-fim-panel .ws-help{ margin:0 0 10px }
#hostSecurityPanel .hs-fim-diff{
  margin:0; padding:10px 12px; max-height:280px; overflow:auto;
  font-size:11px; line-height:1.45; white-space:pre-wrap; word-break:break-all;
  background:var(--panel); border:1px solid var(--line); border-radius:8px;
}
#hostSecurityPanel .hs-fim-diff-row td{ padding-top:0; border-top:none }
#hostSecurityPanel .hs-fim-cfg{
  margin:4px 0 10px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#hostSecurityPanel .hs-fim-cfg > summary{
  cursor:pointer; font-size:13px; font-weight:600; list-style:none; user-select:none;
}
#hostSecurityPanel .hs-fim-cfg > summary::-webkit-details-marker{ display:none }
#hostSecurityPanel .hs-fim-cfg > summary::before{ content:"▸ "; color:var(--muted) }
#hostSecurityPanel .hs-fim-cfg[open] > summary::before{ content:"▾ " }
#hostSecurityPanel .hs-fim-cfg textarea{
  width:100%; min-height:52px; font-family:var(--mono, monospace); font-size:12px; line-height:1.5;
}
#hostSecurityPanel .hs-compliance-panel{
  margin:0 0 14px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#hostSecurityPanel .hs-compliance-panel .ws-help{ margin:0 0 8px }
#hostSecurityPanel .hs-comp-chips{ display:flex; flex-wrap:wrap; gap:8px }
#hostSecurityPanel .hs-comp-chip{
  display:inline-flex; align-items:baseline; gap:5px; padding:4px 10px; font-size:12px;
  border:1px solid var(--line); border-radius:999px; background:var(--panel);
}
#hostSecurityPanel .hs-comp-chip b{ font-size:14px }
#hostSecurityPanel .hs-compliance{ display:flex; flex-wrap:wrap; gap:4px; margin-top:5px }
#hostSecurityPanel .hs-comp-tag{ font-size:10px; opacity:.85 }
#hostSecurityPanel .sec-remediation{ margin:0 0 14px }
#hostSecurityPanel .sec-remediation ul{ margin:6px 0 0; padding-left:18px; font-size:13px; line-height:1.55 }

/* Web 扫描 */
#webSecurityPanel .ws-shell{ display:flex; flex-direction:column; gap:14px }
#webSecurityPanel .ws-engine{
  border:1px solid var(--line); border-radius:14px; background:var(--panel);
  padding:14px 16px; display:flex; flex-direction:column; gap:12px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
#webSecurityPanel .ws-engine.ready{ border-color:color-mix(in srgb, var(--ok) 32%, var(--line)) }
#webSecurityPanel .ws-engine.warn{ border-color:color-mix(in srgb, #b8860b 40%, var(--line)) }
#webSecurityPanel .ws-engine-main{
  display:flex; flex-wrap:wrap; gap:12px 16px; align-items:center; justify-content:space-between;
}
#webSecurityPanel .ws-engine-status{ display:flex; gap:10px; align-items:flex-start; min-width:200px }
#webSecurityPanel .ws-dot{
  width:9px; height:9px; border-radius:50%; margin-top:5px; flex:0 0 auto;
  background:#b8860b; box-shadow:0 0 0 3px rgba(184,134,11,.16);
}
#webSecurityPanel .ws-engine.ready .ws-dot{
  background:var(--ok); box-shadow:0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}
#webSecurityPanel .ws-engine-title{ font-weight:700; font-size:13.5px; color:var(--txt) }
#webSecurityPanel .ws-engine-sub{ font-size:11.5px; color:var(--muted); margin-top:3px; line-height:1.45 }
#webSecurityPanel .ws-engine-kpis{ display:flex; flex-wrap:wrap; gap:16px }
#webSecurityPanel .ws-engine-kpis strong{ display:block; font-size:16px; font-variant-numeric:tabular-nums; letter-spacing:-.02em }
#webSecurityPanel .ws-engine-kpis span{ font-size:10px; color:var(--muted2) }
#webSecurityPanel .ws-engine-actions{ display:flex; gap:6px; flex-wrap:wrap }
#webSecurityPanel .ws-packs{ display:flex; flex-wrap:wrap; gap:6px; padding-top:4px; border-top:1px dashed var(--line) }
#webSecurityPanel .ws-pack{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px;
  border:1px solid var(--line); background:var(--panel2); font-size:11px;
}
#webSecurityPanel .ws-pack.empty{ opacity:.5 }
#webSecurityPanel .ws-pack b{ font-weight:600 }
#webSecurityPanel .ws-pack em{ font-style:normal; color:var(--muted2); font-variant-numeric:tabular-nums }
#webSecurityPanel .ws-layout{
  display:grid; grid-template-columns:minmax(0,1.2fr) minmax(320px,.9fr); gap:14px; align-items:start;
}
@media (max-width:1100px){ #webSecurityPanel .ws-layout{ grid-template-columns:1fr } }
#webSecurityPanel .ws-col-main,
#webSecurityPanel .ws-col-side{ display:flex; flex-direction:column; gap:14px; min-width:0 }
#webSecurityPanel .ws-card{ margin:0 !important }
#webSecurityPanel .ws-detail{
  position:sticky; top:12px; min-height:280px; max-height:calc(100vh - 96px); overflow:auto;
  padding:16px !important;
}
#webSecurityPanel .ws-detail-empty{ border:0; background:transparent; padding:40px 16px }
#webSecurityPanel .ws-detail-head{ align-items:flex-start; gap:12px; margin-bottom:4px }
#webSecurityPanel .ws-detail-actions{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
#webSecurityPanel .ws-cfg-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; margin-bottom:12px;
}
#webSecurityPanel .ws-cfg-card{
  border:1px solid var(--line); border-radius:10px; background:var(--panel2); padding:12px 14px;
}
#webSecurityPanel .ws-cfg-card h4{ margin:0 0 6px; font-size:13px }
#webSecurityPanel .ws-help{ margin:0 0 10px; font-size:12px; color:var(--muted); line-height:1.5 }
#webSecurityPanel .ws-chips{ display:flex; flex-wrap:wrap; gap:8px }
#webSecurityPanel .ws-chip{
  border:1px solid var(--line); background:var(--panel); color:var(--txt);
  border-radius:999px; padding:5px 12px; font-size:12px; cursor:pointer;
}
#webSecurityPanel .ws-chip.on{
  border-color:color-mix(in srgb, var(--accent) 55%, var(--line));
  background:var(--accent-soft); color:var(--accent);
  font-weight:600;
}
/* ---------- 安全情报源 / 模板库面板 ---------- */
#webSecurityPanel .sf-panel{ margin-bottom:14px; scroll-margin-top:12px }
#webSecurityPanel .sf-load-err{ color:var(--crit-txt) }
#webSecurityPanel .ws-engine-actions .btn.on,
#webSecurityPanel .ws-engine-actions .btn.primary{
  border-color:color-mix(in srgb, var(--accent) 55%, var(--line));
  background:var(--accent-soft); color:var(--accent); font-weight:600;
}
#webSecurityPanel .sf-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:12px; margin-bottom:14px }
#webSecurityPanel .sf-env code{ font-size:11px; background:var(--panel3); padding:1px 5px; border-radius:4px }
#webSecurityPanel .sf-test-row{ display:flex; align-items:center; gap:10px; margin-top:10px; flex-wrap:wrap }
#webSecurityPanel .sf-test{ font-size:12px }
#webSecurityPanel .sf-test.ok{ color:var(--ok-txt) }
#webSecurityPanel .sf-test.err{ color:var(--crit-txt) }
#webSecurityPanel .sf-test.testing{ color:var(--muted) }

#webSecurityPanel .sf-sources-head{ display:flex; flex-direction:column; gap:4px; margin-bottom:10px }
#webSecurityPanel .sf-sources-head h4{ margin:0; font-size:13px }
#webSecurityPanel .sf-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px }
#webSecurityPanel .sf-item{
  display:flex; align-items:flex-start; gap:12px; padding:11px 14px;
  border:1px solid var(--line); border-left:3px solid var(--line2);
  border-radius:10px; background:var(--panel2);
}
#webSecurityPanel .sf-item.on{ border-left-color:var(--accent) }
#webSecurityPanel .sf-item.stale{ border-left-color:var(--warn) }
#webSecurityPanel .sf-item-pick{ padding-top:2px; flex:none }
#webSecurityPanel .sf-item-main{ flex:1 1 auto; min-width:0 }
#webSecurityPanel .sf-item-title{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:13px }
#webSecurityPanel .sf-kind{ font-size:10px; font-weight:600; padding:1px 7px; border-radius:4px; background:var(--panel3); color:var(--muted) }
#webSecurityPanel .sf-kind-nuclei{ background:var(--accent-soft); color:var(--accent-txt) }
#webSecurityPanel .sf-kind-signature{ background:var(--ok-soft); color:var(--ok-txt) }
#webSecurityPanel .sf-repo{ font-size:11px; color:var(--muted2) }
#webSecurityPanel .sf-license{ font-size:10px; color:var(--muted2); border:1px solid var(--line); border-radius:4px; padding:0 5px }
#webSecurityPanel .sf-item-desc{ margin:5px 0 6px; font-size:12px; color:var(--muted); line-height:1.55 }
#webSecurityPanel .sf-state{ font-size:11px; color:var(--muted2); display:block; overflow:hidden; text-overflow:ellipsis }
#webSecurityPanel .sf-state.ok{ color:var(--ok-txt) }
#webSecurityPanel .sf-state.err{ color:var(--crit-txt) }

#webSecurityPanel .sf-job{
  border:1px solid var(--line); border-radius:10px; background:var(--panel2);
  padding:11px 14px; margin-bottom:14px;
}
#webSecurityPanel .sf-job.running{ border-color:color-mix(in srgb, var(--accent) 45%, var(--line)) }
#webSecurityPanel .sf-job-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px }
#webSecurityPanel .sf-job-title{ font-size:13px; font-weight:650 }
#webSecurityPanel .sf-job-meta{ font-size:11px; color:var(--muted) }
#webSecurityPanel .sf-job-meta .err{ color:var(--crit-txt) }
#webSecurityPanel .sf-job-head .btn{ margin-left:auto }
#webSecurityPanel .sf-bar{ height:4px; border-radius:2px; background:var(--panel3); overflow:hidden }
#webSecurityPanel .sf-bar-fill{ height:100%; background:var(--accent); border-radius:2px; transition:width var(--transition) }
#webSecurityPanel .sf-job-err{ margin-top:8px; font-size:12px; color:var(--crit-txt) }
#webSecurityPanel .sf-log{
  margin:8px 0 0; padding:8px 10px; max-height:132px; overflow:auto;
  background:var(--panel3); border-radius:6px; font-size:11px; line-height:1.6;
  color:var(--muted); white-space:pre-wrap; word-break:break-all;
}

#webSecurityPanel .ws-profile-row{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px }
#webSecurityPanel .ws-profile-btn{ min-width:96px }
#webSecurityPanel .ws-profile-btn.on,
#webSecurityPanel .ws-profile-btn.primary{
  border-color:color-mix(in srgb, var(--accent) 55%, var(--line));
  background:var(--accent-soft); color:var(--accent); font-weight:600;
}
#webSecurityPanel .ws-form-mask{
  position:fixed; inset:0; z-index:1400;
  background:rgba(15,23,42,.48);
  display:flex; align-items:flex-start; justify-content:center;
  padding:40px 16px 28px; overflow:auto;
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
}
#webSecurityPanel .ws-form-modal{
  width:min(840px,100%); max-height:calc(100vh - 68px);
  overflow:auto; margin:0; padding:16px 18px 18px;
  border-radius:14px; box-shadow:0 24px 64px rgba(0,0,0,.28);
  border:1px solid var(--line); background:var(--panel);
}
#webSecurityPanel .ws-form-head{
  position:sticky; top:0; z-index:2; background:var(--panel);
  padding-bottom:10px; margin-bottom:8px; border-bottom:1px solid var(--line);
  display:flex; justify-content:space-between; gap:12px; align-items:flex-start;
}
#webSecurityPanel .ws-form-actions{
  position:sticky; bottom:0; background:linear-gradient(transparent, var(--panel) 28%);
  padding-top:12px; margin-top:8px;
}
#webSecurityPanel .ws-form-body .ws-chips{ max-height:none; overflow:visible }
#webSecurityPanel .ws-target-list{ display:flex; flex-direction:column; gap:10px }
#webSecurityPanel .ws-target-card{
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center;
  padding:14px 14px; border:1px solid var(--line); border-radius:12px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 40%, var(--panel2)), var(--panel2));
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#webSecurityPanel .ws-target-card:hover{
  border-color:color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}
#webSecurityPanel .ws-target-main{ min-width:0; display:flex; flex-direction:column; gap:7px }
#webSecurityPanel .ws-target-top{
  display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center;
}
#webSecurityPanel .ws-target-name{
  font-weight:700; margin:0; line-height:1.3; font-size:13.5px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%;
}
#webSecurityPanel .ws-target-foot{
  display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center;
}
#webSecurityPanel .ws-meta-badges{
  display:flex; flex-wrap:wrap; gap:5px; align-items:center;
}
#webSecurityPanel .ws-url{
  display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; font-size:12px; line-height:1.4; color:var(--muted);
}
#webSecurityPanel .ws-tag-chips{
  display:flex; flex-wrap:wrap; gap:4px; align-content:flex-start;
}
#webSecurityPanel .ws-tag-chip{
  display:inline-flex; align-items:center; max-width:100%;
  padding:2px 8px; border-radius:999px; border:1px solid var(--line);
  background:var(--panel); color:var(--muted); font-size:10px; line-height:1.35;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#webSecurityPanel .ws-tag-chip.more{
  color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, var(--line));
  background:var(--accent-soft); font-weight:600;
}
#webSecurityPanel .ws-actions{
  display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-end;
  gap:6px; width:auto; min-width:0;
}
#webSecurityPanel .ws-actions .btn{
  width:auto; justify-content:center; white-space:nowrap;
  box-sizing:border-box; margin:0; flex:0 0 auto; min-width:64px;
}
@media (max-width:720px){
  #webSecurityPanel .ws-target-card{ grid-template-columns:1fr }
  #webSecurityPanel .ws-actions{ width:100%; justify-content:stretch }
  #webSecurityPanel .ws-actions .btn{ flex:1 }
}
#webSecurityPanel .btn.ghost,
#hostSecurityPanel .btn.ghost{
  background:transparent; border-color:transparent; color:var(--muted);
}
#webSecurityPanel .btn.ghost:hover,
#hostSecurityPanel .btn.ghost:hover{
  color:var(--txt); background:var(--panel2); border-color:var(--line);
}
#webSecurityPanel .btn.danger.ghost{ color:var(--crit-txt) }
#webSecurityPanel .btn.danger.ghost:hover{
  background:var(--crit-soft); border-color:color-mix(in srgb, var(--crit-txt) 30%, var(--line));
}
#webSecurityPanel .ws-sched-box{
  margin:12px 0; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#webSecurityPanel .ws-last-scan{ font-size:11px }
#webSecurityPanel .ws-history-table{ width:100%; table-layout:fixed; border-collapse:collapse }
#webSecurityPanel .ws-history-table th,
#webSecurityPanel .ws-history-table td{
  vertical-align:middle; padding:8px 10px; box-sizing:border-box;
}
#webSecurityPanel .ws-history-table .col-risk{ width:88px }
#webSecurityPanel .ws-history-table .col-num{ width:88px }
#webSecurityPanel .ws-history-table .col-time{ width:132px; white-space:nowrap }
#webSecurityPanel .ws-progress{
  height:6px; border-radius:999px; background:var(--bg3); overflow:hidden; margin:14px 0 10px;
}
#webSecurityPanel .ws-progress-bar{
  height:100%; width:40%; border-radius:inherit; background:var(--accent);
  animation:ws-indeterminate 1.2s ease-in-out infinite;
}
@keyframes ws-indeterminate{
  0%{ transform:translateX(-120%) } 100%{ transform:translateX(280%) }
}
#webSecurityPanel .ws-exec{
  margin:0 0 12px; padding:10px 12px; border-radius:8px; background:var(--panel2);
  border:1px solid var(--line); font-size:12px; line-height:1.55; color:var(--txt);
}
#webSecurityPanel .ws-owasp-panel{
  margin:0 0 12px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel2);
}
#webSecurityPanel .ws-owasp-chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:6px }
#webSecurityPanel .ws-owasp-chip{
  display:inline-flex; align-items:baseline; gap:5px; padding:4px 10px; font-size:12px;
  border:1px solid var(--line); border-radius:999px; background:var(--panel);
}
#webSecurityPanel .ws-owasp-chip b{ font-size:14px }
#webSecurityPanel .ws-finding-tags{ display:flex; flex-wrap:wrap; gap:4px; margin-top:6px }
#webSecurityPanel .ws-finding-tags .tag{ font-size:10px; opacity:.85 }
#webSecurityPanel .ws-findings{ display:flex; flex-direction:column; gap:10px; max-height:62vh; overflow:auto }
#webSecurityPanel .ws-finding{
  border:1px solid var(--line); border-radius:10px; background:var(--panel2); padding:10px 12px;
}
#webSecurityPanel .ws-finding header{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:6px;
}
#webSecurityPanel .ws-finding header strong{ font-size:13px }
#webSecurityPanel .ws-finding p{ margin:6px 0 0; font-size:12px; color:var(--muted); line-height:1.5 }
#webSecurityPanel .ws-fix{
  margin-top:8px; padding:8px 10px; border-radius:8px; background:var(--panel);
  border:1px dashed var(--line); font-size:12px; line-height:1.5;
}
#webSecurityPanel .ws-fix span{
  display:inline-block; margin-right:6px; font-weight:600; color:var(--accent);
}
#webSecurityPanel .ws-empty-findings{
  padding:18px 14px; border-radius:10px; border:1px dashed var(--line); background:var(--panel2);
}
#webSecurityPanel .ws-empty-findings h4{ margin:0 0 6px; font-size:13px }
#webSecurityPanel .ws-empty-findings p{ margin:0; font-size:12px; color:var(--muted); line-height:1.55 }
#hostSecurityPanel .data-table td.muted,
#webSecurityPanel .data-table td.muted{ color:var(--muted2); font-size:12px }

/* ============================================================
   v6.35 设计系统增强层 · 专业运维视觉
   ------------------------------------------------------------
   本层位于文件末尾，依赖 CSS 级联以同/更高特异性收敛前文默认值，
   达成全局一致的配色/间距/动效/组件观感。仅纯 CSS，不触 HTML 结构与 JS 逻辑。
   设计原则：信息密度高但不杂乱 · 状态色一眼可辨 · 动效克制服务于效率。
   ============================================================ */

/* ---------- 01 · 全局基底：纵深背景 + 数字等宽 ---------- */
/* 主内容区微渐变：极克制的品牌色晕染，让底层“活”起来而非死板纯色 */
.main{ background:var(--bg-grad), var(--bg); }
/* 指标/数值一律等宽数字，避免刷新时宽度拖动 */
.card .v, .sre-kpi-v, .ai-stat-value, .dash-panel .stat-v, .kpi-num{ font-variant-numeric:var(--num); }

/* ---------- 02 · 侧边导航：层级与选中态 ---------- */
/* 导航项：更细腻的 hover/active 过渡，图标随状态变色 */
.nav-item{ transition:background var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast); }
.nav-item svg{ color:inherit; opacity:.75; transition:opacity var(--transition-fast), transform var(--transition-fast); }
.nav-item:hover svg{ opacity:1; }
.nav-item.active{ background:linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, transparent)); }
.nav-item.active svg{ opacity:1; }
/* 选中左侧指示条：加高亮发光，成为视觉锚点 */
.nav-item.active::before{ box-shadow:0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); width:3px; height:20px; }
/* 分组标签：更清晰的分区感 */
.nav-group-label{ font-size:var(--fs-2xs); letter-spacing:.1em; }
/* 计数徐章：选中态与未选中态对比更分明 */
.nav-count{ transition:background var(--transition-fast), color var(--transition-fast); font-variant-numeric:var(--num); }

/* ---------- 03 · 仪表盘面板：标题栏/内容区/操作区三层 ---------- */
.dash-panel{ border-radius:var(--r); transition:box-shadow var(--transition), border-color var(--transition), transform var(--transition); }
.dash-panel:hover{ border-color:var(--line2); box-shadow:var(--elevation-2); }
.dash-panel-head{ padding:10px 14px; background:color-mix(in srgb, var(--panel) 55%, transparent); }
.dash-panel-title{ font-size:var(--fs-base); font-weight:600; letter-spacing:.01em; }
.dash-panel-ds{ font-size:var(--fs-2xs); border:1px solid var(--line); padding:1px 7px; }

/* ---------- 04 · 统一动效曲线：hover / focus / active ---------- */
/* 交互件统一过渡时长与缓动（运维工具以效率为先，均≤1 2 0ms） */
.chip-btn, .pager button, .search, select, .tb-icon, .icon-btn, .alert-action,
.ai-suggest-chip, .ai-cap-chip, .ai-nav-item, .user-dropdown-item{
  transition-duration:140ms; transition-timing-function:cubic-bezier(.4,0,.2,1);
}
/* 按钮按压微反馈：上浮-1px，回落 0，避免夸张位移 */
.btn:active:not(:disabled){ transform:translateY(0) scale(.985); }
/* 开关/复选 hover 亮度反馈收敛，避免刺眼 */
input[type="checkbox"]:hover, input[type="radio"]:hover{ filter:brightness(1.1); }

/* ---------- 05 · AI 对话弹窗：消息气泡/间距/字体排版（Claude/ChatGPT 级体验） ---------- */
/* 消息列：拉开呼吸感，阅读节奏更从容 */
.ai-chat-modal .ai-chat-log{ gap:6px; padding:10px 4px 6px; scroll-behavior:smooth; }
.ai-chat-modal .ai-chat-msg{ font-size:var(--fs-md); line-height:var(--lh-relaxed); letter-spacing:.005em; }
/* 头像：品牌渐变底 + 柔和投影，成为对话错落的错错锚点 */
.ai-chat-modal .ai-chat-msg.ai::before{
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 2px 8px -2px color-mix(in srgb, var(--accent) 55%, transparent);
}
.ai-chat-modal .ai-chat-msg.me::before{ background:var(--panel3); border:1px solid var(--line2); }
/* 用户消息：淡底容器圆角更圆润，右下角保留对话指向 */
.ai-chat-modal .ai-chat-msg.me{ border-radius:14px 14px 4px 14px; background:var(--bg3); }
/* AI 消息：正文段落间距更舒展 */
.ai-chat-modal .ai-chat-msg.ai>div{ margin:3px 0; }
.ai-chat-modal .ai-chat-msg.ai ul, .ai-chat-modal .ai-chat-msg.ai ol{ margin:6px 0; }
/* 错误消息：左侧警示色强调条 + 柔和错底，一眼定位失败轮次 */
.ai-chat-modal .ai-chat-msg.err{
  background:var(--crit-soft); border:1px solid var(--crit-border);
  border-left:3px solid var(--crit); color:var(--crit-txt); border-radius:8px;
}
/* 系统提示：更弱化的居中引导 */
.ai-chat-modal .ai-chat-msg.sys{ font-size:var(--fs-sm); color:var(--muted2); }

/* 代码块：头部工具栏 + 语言标签，向 Claude 看齐 */
.ai-chat-modal .ai-code-wrap{ border-radius:10px; background:var(--cmd-bg); }
.ai-chat-modal .ai-code-head{ padding:6px 12px; }
.ai-chat-modal .ai-code-lang{ font-size:var(--fs-2xs); }
.ai-chat-modal .ai-code pre.ai-code{ padding:12px 14px; }

/* 工具调用 chip：运行中/成功/失败 三态语义色一眼可辨 */
.ai-tool-chip{ font-size:var(--fs-sm); padding:4px 10px; transition:all var(--transition-fast); }
.ai-tool-chip.run{ background:var(--accent-soft); border-color:var(--accent-border); }
.ai-tool-chip.ok{ color:var(--ok-txt); border-color:var(--ok-border); background:var(--ok-soft); }
.ai-tool-chip.err{ color:var(--crit-txt); border-color:var(--crit-border); background:var(--crit-soft); }

/* 流式打字光标：品牌色闪烁，节奏更从容 */
.ai-stream-cursor{ color:var(--accent); }

/* 欢迎屏：标题/副标/能力芯片 三级层次 */
.ai-chat-modal .ai-welcome{ padding:32px 16px 12px; }
.ai-chat-modal .ai-welcome-icon{ font-size:38px; margin-bottom:12px; filter:drop-shadow(0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent)); }
.ai-chat-modal .ai-welcome-title{ font-size:var(--fs-lg); font-weight:700; letter-spacing:.01em; }
.ai-chat-modal .ai-welcome-sub{ font-size:var(--fs-base); line-height:var(--lh-relaxed); }
.ai-cap-chip{ transition:all var(--transition-fast); cursor:default; }
.ai-cap-chip:hover{ border-color:var(--accent-border); color:var(--accent-txt); background:var(--accent-soft); transform:translateY(-1px); }

/* ---------- 06 · AI 快捷问题推荐：芯片样式与交互反馈 ---------- */
.ai-suggest-chips{ gap:8px; }
.ai-suggest-chip{
  font-size:var(--fs-base); border-radius:var(--r); padding:10px 14px;
  background:var(--panel); position:relative; overflow:hidden;
}
/* 左侧品牌色微条：提示“可点击”，悬停时展开 */
.ai-suggest-chip::before{
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--accent); opacity:0; transition:opacity var(--transition-fast);
}
.ai-suggest-chip:hover{ transform:translateX(3px); box-shadow:var(--elevation-1); }
.ai-suggest-chip:hover::before{ opacity:1; }
.ai-suggest-chip:active{ transform:translateX(3px) scale(.99); }
.ai-suggest-refresh{ border-radius:var(--r-xs); }
.ai-suggest-refresh:hover{ background:var(--accent-soft); }

/* ---------- 07 · AI 诊断内联对话：用户/AI/工具 三层视觉分离 ---------- */
.ai-diagnosis-chat{
  background:color-mix(in srgb, var(--bg2) 80%, var(--bg));
  border-radius:var(--r); padding:10px; gap:8px;
}
.ai-diagnosis-chat .ai-chat-msg{ font-size:var(--fs-base); line-height:var(--lh-base); border-radius:10px; }
.ai-diagnosis-chat .ai-chat-msg.me{ background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--txt); align-self:flex-end; }
.ai-diagnosis-chat .ai-chat-msg.ai{ background:var(--panel); border:1px solid var(--line); }
.ai-diagnosis-chat .ai-chat-msg.err{ background:var(--crit-soft); border:1px solid var(--crit-border); color:var(--crit-txt); }

/* ---------- 08 · AI 设置面板：卡片分组 + 导航交互 + 表单控件 ---------- */
.ai-settings-modal{ border-radius:var(--r-xl); }
.ai-nav-item{ border-radius:var(--r-sm); transition:all var(--transition-fast); }
.ai-nav-item.active{ box-shadow:inset 3px 0 0 var(--accent), var(--elevation-1); border-color:var(--accent-border); background:var(--accent-soft); }
.ai-nav-item.active .ai-nav-t{ color:var(--accent-txt); }
.ai-card{ border-radius:var(--r); transition:border-color var(--transition-fast), box-shadow var(--transition-fast); }
.ai-card:hover{ box-shadow:var(--elevation-1); }
.ai-card-header{ padding:11px 14px; }
.ai-card-icon{ background:var(--accent-soft); border-radius:var(--r-sm); }
.ai-section-block{ border-radius:var(--r); }
.ai-section-label{ font-size:var(--fs-2xs); letter-spacing:.08em; }
/* 预设行：芯片组更紧凑 */
.ai-preset-row{ border-radius:var(--r-sm); }

/* ---------- 09 · 表格：行高/斑马纹/表头/排序 统一 ---------- */
/* 表头：浅底 + 小号字 + 字距，与数据行拉开层次 */
table thead th{
  font-size:var(--fs-sm); font-weight:600; color:var(--muted); letter-spacing:.03em;
  padding:9px 12px; border-bottom:var(--hairline-strong); white-space:nowrap;
}
/* 数据行：统一行高与内边距，数字列等宽（行分隔线沿用各表格既有 td/tr 边框，避免双重描边） */
table tbody td{ padding:9px 12px; font-size:var(--fs-base); color:var(--txt2); vertical-align:middle; }
/* 斑马纹：极淡的奇偶行差异，高密度下仍可扫读 */
table tbody tr:nth-child(even){ background:color-mix(in srgb, var(--panel2) 40%, transparent); }
table tbody tr:hover{ background:var(--surface-hover); }
/* 排序图标占位：可排序表头悬停提示 */
th[data-sort], th.sortable{ cursor:pointer; user-select:none; transition:color var(--transition-fast); }
th[data-sort]:hover, th.sortable:hover{ color:var(--txt); }

/* ---------- 10 · 标签/徽章：形状/大小/配色 统一 ---------- */
.badge{
  display:inline-flex; align-items:center; gap:4px;
  font-size:var(--fs-xs); line-height:1.4; padding:2px 9px;
  border-radius:var(--r-xs); font-weight:600; letter-spacing:.01em;
  font-variant-numeric:var(--num); white-space:nowrap;
}
/* 状态点徽章：前置圆点强化语义（供带 .dot 子元的徽章使用） */
.badge .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }

/* ---------- 11 · 搜索/筛选/分页 公共控件 ---------- */
.search{ border-radius:var(--r-sm); transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast); }
.search:hover{ border-color:var(--hover-border); }
.pager button{ border-radius:var(--r-sm); font-variant-numeric:var(--num); }
.pager button.active{ box-shadow:0 2px 8px -2px color-mix(in srgb, var(--accent) 50%, transparent); }
.chip-btn{ border-radius:var(--r-sm); }
.chip-btn.active{ font-weight:600; }

/* ---------- 12 · 空状态 / 加载骨架 / 错误态 统一 ---------- */
.empty-line, .empty-box{
  border-radius:var(--r); color:var(--muted);
  background:color-mix(in srgb, var(--bg2) 60%, transparent);
}
.empty-state{ padding:36px 20px; }
.empty-state .empty-icon{ opacity:.55; margin-bottom:4px; }
.empty-state h4{ letter-spacing:.01em; }
/* 骨架屏：更柔和的呼吸波光，避免生硬闪烁 */
.skeleton, .skeleton *{ border-radius:var(--r-xs); }
@keyframes shimmer{ 0%{ background-position:-400px 0 } 100%{ background-position:400px 0 } }
.skeleton-card, .skeleton-host{
  background:linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%);
  background-size:800px 100%; animation:shimmer 1.4s ease-in-out infinite;
}

/* ---------- 13 · Toast / 页面切换 / 列表加载 动效 ---------- */
/* Toast：上滑入场 + 软投影，状态色左侧强调条 */
.toast{ border-radius:var(--r); box-shadow:var(--elevation-3); border-left-width:3px; }
.toast.ok{ border-left-color:var(--ok); }
.toast.err{ border-left-color:var(--crit); }
/* 视图切换：淡入 + 轻微上移，感知更顺滑（尊重 reduced-motion） */
.view.active{ animation:viewIn .22s cubic-bezier(.4,0,.2,1); }
@keyframes viewIn{ from{ opacity:0; transform:translateY(4px) } to{ opacity:1; transform:none } }
@media (prefers-reduced-motion: reduce){ .view.active{ animation:none } }


/* ========== 新版壳 iframe 内嵌模式：隐藏侧栏/顶栏，内容铺满 ========== */
html.embed-mode .sidebar,
html.embed-mode .topbar,
html.embed-mode .conn-status,
html.embed-mode .sidebar-collapse-btn {
  display: none !important;
}
html.embed-mode .app {
  display: block !important;
  grid-template-columns: none !important;
  min-height: 100vh;
  height: 100%;
}
html.embed-mode .main {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh;
  height: 100%;
  overflow: auto;
}
html.embed-mode .content {
  padding: 12px 14px 20px !important;
  max-width: none !important;
}
html.embed-mode body {
  overflow: auto;
  background: var(--bg);
}

/* ===== CI/CD 流水线页 ===== */
.cicd-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin-bottom:12px}
.cicd-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.cicd-toolbar .select-wrap{min-width:170px}
.cicd-run{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r);background:var(--panel);margin-bottom:8px}
.cicd-run:hover{border-color:var(--hover-border)}
.cicd-run-main{flex:1;min-width:0}
.cicd-run-line1{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px}
.cicd-run-line2{display:flex;gap:12px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:4px}
.cicd-run-proj{word-break:break-all}
.cicd-run-name{color:var(--muted);font-size:12px}
.cicd-run-acts{display:flex;gap:6px;flex-wrap:wrap;flex:none}
.cicd-job{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:7px 10px;border:1px solid var(--line);border-radius:var(--r);background:var(--panel2);margin-bottom:6px;font-size:12.5px}
.cicd-job-note{color:var(--crit-txt,var(--crit));font-size:11.5px}
.cicd-conn-panel{margin-top:16px;padding-top:14px;border-top:1px dashed var(--line)}
.cicd-conn{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r);background:var(--panel);margin-bottom:8px}
.cicd-conn-main{flex:1;min-width:0}

/* ===== Agent 自动升级运行情况面板（安装弹窗内） ===== */
.agent-auto-status{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line)}
.agent-auto-status-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.agent-auto-status-title{font-weight:600;font-size:13px}
.agent-auto-status-meta{display:flex;gap:20px;flex-wrap:wrap;font-size:12.5px;color:var(--muted);margin:8px 0}
.agent-auto-status-meta b{color:var(--txt);font-weight:600}
.agent-auto-status-warn{color:var(--warn-txt,var(--warn))}
.agent-auto-skips-title{font-size:12.5px;font-weight:600;margin:10px 0 6px}
.agent-auto-skips-tbl{width:100%;border-collapse:collapse;font-size:12px}
.agent-auto-skips-tbl th,.agent-auto-skips-tbl td{text-align:left;padding:5px 8px;border-bottom:1px solid var(--line);vertical-align:top}
.agent-auto-skips-tbl th{color:var(--muted);font-weight:600;white-space:nowrap}

/* AI 操作审计的「详情」列：这段文字是这条动作到底做了什么的**唯一**记录。
   此前它被 slice(0,120) 截断，而表格里没有任何下钻可以看到剩下的部分——
   与「Windows 升级失败详情被截到 160 字」是同一个缺陷：证据在最后一步被切掉。 */
.sec-detail{ white-space:pre-wrap; word-break:break-word; max-width:520px; }

/* ===== 关于我们弹窗 =====
   文案与 Android 端「设置 → 关于我们」同源（产品简介 + 官网入口），
   版本号由 openAbout() 从 /api/v1/summary 填入。 */
.about-hero{display:flex; align-items:center; gap:12px; margin-bottom:14px}
.about-logo{
  width:44px; height:44px; border-radius:12px; flex:none;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:16px; color:#fff; letter-spacing:.3px;
}
.about-hero-txt{display:flex; flex-direction:column; gap:3px; min-width:0}
.about-name{font-size:15px; font-weight:650; color:var(--txt)}
.about-meta{font-size:12px; color:var(--muted); display:flex; gap:6px; align-items:baseline}
.about-meta .mono{font-family:var(--mono, ui-monospace, Menlo, Consolas, monospace); color:var(--txt2)}
.about-intro{margin:0; font-size:13px; line-height:1.75; color:var(--txt2)}
.about-caps{display:flex; flex-wrap:wrap; gap:6px; margin-top:12px}
.about-caps .tag{
  font-size:11px; font-weight:500; color:var(--muted);
  background:var(--panel2); border:1px solid var(--line); border-radius:5px; padding:2px 8px;
}
.about-links{display:flex; flex-direction:column; gap:2px}
.about-link{
  display:flex; align-items:center; gap:8px; padding:7px 8px; margin:0 -8px;
  border-radius:7px; font-size:13px; color:var(--accent); text-decoration:none;
}
.about-link:hover{background:var(--accent-soft)}
.about-link svg{width:15px; height:15px; flex:none}
.about-copy{margin-top:14px; padding-top:12px; border-top:1px solid var(--line)}

/* ---- 主机批量选择（批量变更分组）---- */
.host-batch-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0;padding:8px 12px;
  border:1px solid var(--border,#2a3244);border-radius:8px;background:var(--panel-2,rgba(127,127,127,.06))}
.host-batch-bar .hbb-count{margin-right:4px;color:var(--muted,#8b96a8)}
.host-batch-bar .hbb-count b{color:var(--text,#e6ebf2);font-size:15px}
.host-pick{display:inline-flex;align-items:center;margin-right:6px;cursor:pointer}
.host-pick input{width:15px;height:15px;cursor:pointer;accent-color:var(--accent,#3b82f6)}
.host.picked{outline:2px solid var(--accent,#3b82f6);outline-offset:-2px}
#hostBatchToggle.active{border-color:var(--accent,#3b82f6);color:var(--accent,#3b82f6)}
.alert-group{margin-left:6px;padding:1px 6px;border-radius:4px;font-size:12px;
  color:var(--muted,#8b96a8);background:var(--panel-2,rgba(127,127,127,.10));white-space:nowrap;
  max-width:220px;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:middle}

/* ---------- 授权状态横幅 ----------
   过期/超限会改变平台行为（拦新主机注册、写操作降级为只读），所以它跟"提示"不是
   一回事：常驻在内容区顶部、切页也不消失，严重态用危险色。 */
.lic-banner{
  margin:0 0 12px; padding:11px 14px; border-radius:var(--r-sm, 8px);
  border:1px solid var(--warn-border, rgba(232,161,60,.3));
  background:var(--warn-soft); color:var(--warn-txt, var(--warn));
  font-size:13px; line-height:1.5;
}
.lic-banner.crit{
  border-color:var(--crit-border, rgba(239,77,90,.3));
  background:var(--crit-soft); color:var(--crit-txt, var(--crit));
}
