/* 运维平台原型共享样式 */

:root {
  --c-green: #10b981;
  --c-green-bg: #d1fae5;
  --c-yellow: #f59e0b;
  --c-yellow-bg: #fef3c7;
  --c-red: #ef4444;
  --c-red-bg: #fee2e2;
  --c-gray: #9ca3af;
  --c-gray-bg: #f3f4f6;

  --c-primary: #4f46e5;
  --c-primary-hover: #4338ca;
  --c-primary-bg: #eef2ff;

  --c-bg: #f8fafc;
  --c-card: #ffffff;
  --c-border: #e5e7eb;
  --c-text: #111827;
  --c-text-2: #4b5563;
  --c-text-3: #9ca3af;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.55;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* 顶栏 */
.topbar {
  grid-column: 1 / 3;
  background: #ffffff;
  color: var(--c-text);
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.topbar .brand {
  font-weight: 600;
  font-size: 15px;
  margin-right: 16px;
}
.topbar .site-info { color: var(--c-text-3); font-size: 12px; }
.topbar .right { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.topbar .time-cursor {
  background: #f3f4f6;
  color: var(--c-text-2);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.topbar .user {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.topbar .user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
/* 原型批注全局开关（评审用，非产品功能） */
.cmt-toggle {
  padding: 4px 10px;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.cmt-toggle:hover { background: #fef3c7; }
.cmt-toggle.off { border-color: var(--c-border); background: #f3f4f6; color: var(--c-text-3); }

/* 原型控制：一键显示 / 隐藏本期不做的菜单与图表（评审用，非产品功能，范围固定） */
.proto-btn { border-color: var(--c-border); background: #f3f4f6; color: var(--c-text-2); }
.proto-btn:hover { background: #e5e7eb; }
.proto-btn.off { border-color: var(--c-border); background: #f3f4f6; color: var(--c-text-3); }
.proto-hidden { display: none !important; }

/* 批注卡：黄色便签观感，明显区别于产品内容；开关关闭时整块不占位 */
.pm-comment {
  border: 1px dashed #fbbf24;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  padding: 12px 14px;
  margin-top: 16px;
}
.pm-comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pm-comment-tag {
  padding: 1px 7px; border-radius: 3px;
  background: #f59e0b; color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
}
.pm-comment-title { font-size: 13px; font-weight: 600; color: #92400e; }
.pm-comment-body { font-size: 12.5px; line-height: 1.7; color: #7c2d12; }
.pm-comment-body b { color: #9a3412; }
.pm-comment-list { margin: 0; padding-left: 18px; }
.pm-comment-list li { margin: 2px 0; }
body.comments-off .pm-comment { display: none; }

/* 侧栏 v2 — 分组可折叠 */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
  padding: 6px 0;
}
.sidebar .nav-group {
  border-bottom: 1px solid #f3f4f6;
}
.sidebar .nav-group .group-header {
  display: flex; align-items: center;
  padding: 9px 14px 9px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
}
.sidebar .nav-group .group-icon { font-size: 14px; margin-right: 8px; opacity: 0.85; }
.sidebar .nav-group .group-label { flex: 1; }
.sidebar .nav-group .group-caret {
  font-size: 10px; color: var(--c-text-3);
  transition: transform 0.15s;
}
.sidebar .nav-group:not(.open) .group-caret { transform: rotate(-90deg); }
.sidebar .nav-group .group-items {
  display: none;
  padding: 2px 0 6px 0;
}
.sidebar .nav-group.open .group-items { display: block; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px 7px 36px;
  color: var(--c-text-2);
  text-decoration: none;
  font-size: 12.5px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.1s;
}
.sidebar .nav-item .nav-bullet { color: var(--c-text-3); margin-right: -2px; }
.sidebar .nav-item .nav-label { flex: 1; }
.sidebar .nav-item:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}
.sidebar .nav-item.active {
  background: var(--c-primary-bg);
  color: var(--c-primary);
  border-left-color: var(--c-primary);
  font-weight: 600;
}
.sidebar .nav-item.dim { color: var(--c-text-3); }
.sidebar .nav-item.dim:hover { color: var(--c-text-2); background: #f9fafb; }
.sidebar .nav-item-root {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  border-bottom: 1px solid #f3f4f6;
}
.sidebar .nav-item-root.active {
  color: var(--c-primary);
}
.sidebar .nav-item-root .group-icon { margin-right: 8px; }
.sidebar .nav-tag {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 14px;
  vertical-align: middle;
}
.sidebar .nav-tag.new    { background: var(--c-green-bg); color: var(--c-green); }
.sidebar .nav-tag.change { background: var(--c-yellow-bg); color: #b45309; }
.sidebar .nav-note {
  font-size: 10px; color: var(--c-text-3);
}
.sidebar .nav-badge {
  margin-left: auto;
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
}
.sidebar .nav-badge.warn { background: var(--c-yellow); }

/* 主内容 */
.main {
  overflow-y: auto;
  padding: 20px 24px;
}
.page-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 老版 <details>-based 时间选择器已废弃。
   新版按 Grafana 风格在文件下方 .crumb-row + .time-picker .tp-trigger/.tp-panel 实现。 */
.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
}
.page-subtitle {
  font-size: 13px;
  color: var(--c-text-3);
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--c-text-3);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--c-primary); text-decoration: none; }
.breadcrumb .sep { color: var(--c-text-3); }

/* 卡片 */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .more {
  margin-left: auto;
  color: var(--c-primary);
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
  text-decoration: none;
}
.card-subtitle {
  font-size: 12px;
  color: var(--c-text-3);
  margin: -8px 0 12px 0;
}

/* KPI 卡片 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px 16px;
}
.kpi-label {
  font-size: 12px;
  color: var(--c-text-3);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}
.kpi-value .unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-3);
  margin-left: 2px;
}
.kpi-delta {
  font-size: 12px;
  margin-top: 4px;
}
.kpi-delta.up   { color: var(--c-green); }
.kpi-delta.down { color: var(--c-red); }
.kpi-delta.flat { color: var(--c-text-3); }
.kpi-spark {
  height: 30px;
  margin-top: 4px;
}

/* 业务能力卡片 — v3 降噪：按状态显示左侧颜色 */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cap-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-left: 4px solid #d1d5db;
  border-radius: 6px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
.cap-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.cap-card.cap-ok   { border-left-color: var(--c-green); }
.cap-card.cap-warn { border-left-color: var(--c-yellow); }
.cap-card.cap-crit { border-left-color: var(--c-red); }
.cap-card.cap-off  { border-left-color: var(--c-gray); opacity: 0.55; }
.cap-card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.cap-card-name {
  font-size: 14px;
  font-weight: 600;
}
.cap-card-status {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.cap-card-status.ok   { background: var(--c-green-bg); color: var(--c-green); }
.cap-card-status.warn { background: var(--c-yellow-bg); color: var(--c-yellow); }
.cap-card-status.crit { background: var(--c-red-bg); color: var(--c-red); }
.cap-card-status.off  { background: var(--c-gray-bg); color: var(--c-text-3); }
.cap-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.cap-metric-label {
  font-size: 10px;
  color: var(--c-text-3);
  margin-bottom: 2px;
}
.cap-metric-value {
  font-size: 13px;
  font-weight: 600;
}
.cap-metric-value.up   { color: var(--c-green); }
.cap-metric-value.down { color: var(--c-red); }

/* 状态点 — v3: 正常项用浅灰，仅异常上色 */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-gray);
  margin-right: 4px;
}
.dot.ok   { background: #d1d5db; }
.dot.warn { background: var(--c-yellow); }
.dot.crit { background: var(--c-red); }
.dot.off  { background: var(--c-gray); }

/* 严重度徽章 — v3: 正常项中性灰 */
.sev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.sev.crit { background: var(--c-red-bg); color: var(--c-red); }
.sev.warn { background: var(--c-yellow-bg); color: #b45309; }
.sev.info { background: var(--c-primary-bg); color: var(--c-primary); }
.sev.ok   { background: #f3f4f6; color: #6b7280; }  /* 正常项用中性灰 */
.sev.off  { background: var(--c-gray-bg); color: var(--c-text-2); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s;
}
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn.primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.btn.primary:hover {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
  color: #fff;
}
.btn.danger {
  background: var(--c-red);
  color: #fff;
  border-color: var(--c-red);
}
.btn.sm { padding: 4px 8px; font-size: 11px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: #f9fafb;
  border-bottom: 1px solid var(--c-border);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--c-text-2);
  font-size: 12px;
}
.table td {
  border-bottom: 1px solid var(--c-border);
  padding: 10px 12px;
  vertical-align: middle;
}
.table tr:hover td { background: #fafafa; }
.table a { color: var(--c-primary); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table-link { cursor: pointer; }

/* 容量进度条 */
.progress {
  background: var(--c-gray-bg);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  display: block; /* v12：修复 span 用法下行内元素忽略宽高导致填充条不可见（中间件-全部实例饱和度条） */
  height: 100%;
  background: var(--c-primary);
  transition: width 0.3s;
}
.progress-fill.warn { background: var(--c-yellow); }
.progress-fill.crit { background: var(--c-red); }
.progress-label {
  font-size: 11px;
  color: var(--c-text-2);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

/* 事件 / 告警卡片 */
.event-card {
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-red);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}
.event-card.sev-warn { border-left-color: var(--c-yellow); }
.event-card.sev-info { border-left-color: var(--c-primary); }
.event-card.sev-ok   { border-left-color: var(--c-green); }
.event-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.event-title { font-size: 14px; font-weight: 600; }
.event-id { color: var(--c-text-3); font-size: 11px; }
.event-meta {
  font-size: 11px; color: var(--c-text-3);
  margin-bottom: 8px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.event-meta span { display: inline-flex; align-items: center; gap: 4px; }
.event-content { font-size: 12px; color: var(--c-text-2); margin-bottom: 8px; }
.event-actions {
  display: flex; gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--c-border);
}

/* 根因路径 */
.rca-tree {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  background: #f9fafb;
  border-radius: 6px;
  padding: 10px 12px;
  line-height: 1.7;
  margin: 8px 0;
}
.rca-tree .root { color: var(--c-red); font-weight: 600; }
.rca-tree .child { color: var(--c-text-2); padding-left: 16px; position: relative; }
.rca-tree .child::before {
  content: "↳"; position: absolute; left: 4px; color: var(--c-text-3);
}

/* 处理建议列表 */
.action-list {
  margin: 8px 0;
  padding: 0;
  list-style: none;
}
.action-list li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text);
}
.action-list .tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--c-red-bg);
  color: var(--c-red);
  font-weight: 500;
}
.action-list .tag.now { background: var(--c-red-bg); color: var(--c-red); }
.action-list .tag.soon { background: var(--c-yellow-bg); color: #b45309; }
.action-list .tag.later { background: var(--c-gray-bg); color: var(--c-text-2); }

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--c-border);
}
.timeline-item {
  position: relative;
  padding: 8px 0 12px 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px; top: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--c-primary);
}
.timeline-item.crit::before { background: var(--c-red); box-shadow: 0 0 0 1px var(--c-red); }
.timeline-item.warn::before { background: var(--c-yellow); box-shadow: 0 0 0 1px var(--c-yellow); }
.timeline-item.ok::before { background: var(--c-green); box-shadow: 0 0 0 1px var(--c-green); }
.timeline-item.info::before { background: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }

/* 横向时间轴（告警详情：一条时间线 + 时间刻度轴 + 颜色区分等级） */
.htl2 { position: relative; padding: 8px 52px 0; }
.htl2-plot { position: relative; height: 96px; }
.htl2-grid { position: absolute; top: 66px; bottom: 0; width: 1px; background: var(--c-border); opacity: .45; }
.htl2-track { position: absolute; left: 0; right: 0; top: 72px; height: 6px; border-radius: 3px; background: #eef0f3; }
.htl2-seg { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.htl2-seg.crit { background: var(--c-red); }
.htl2-seg.warn { background: var(--c-yellow); }
.htl2-seg.info { background: var(--c-primary); }
.htl2-seg.ok   { background: var(--c-green); }
.htl2-node { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; border: 2px solid #fff; z-index: 3; }
.htl2-node.crit { background: var(--c-red);     box-shadow: 0 0 0 2px var(--c-red),     0 1px 3px rgba(0,0,0,.28); }
.htl2-node.warn { background: var(--c-yellow);  box-shadow: 0 0 0 2px var(--c-yellow),  0 1px 3px rgba(0,0,0,.28); }
.htl2-node.info { background: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary), 0 1px 3px rgba(0,0,0,.28); }
.htl2-node.ok   { background: var(--c-green);   box-shadow: 0 0 0 2px var(--c-green),   0 1px 3px rgba(0,0,0,.28); }
.htl2-label { position: absolute; top: 0; width: 160px; transform: translateX(-50%); text-align: center; }
.htl2-label.edge-start { transform: translateX(-10px); text-align: left; }
.htl2-label.edge-end { transform: translateX(calc(-100% + 10px)); text-align: right; }
.htl2-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; letter-spacing: .3px; }
.htl2-badge.crit { background: var(--c-red-bg); color: var(--c-red); }
.htl2-badge.warn { background: var(--c-yellow-bg); color: #b45309; }
.htl2-badge.info { background: var(--c-primary-bg); color: var(--c-primary); }
.htl2-badge.ok   { background: #f3f4f6; color: #6b7280; }
.htl2-ltitle { font-size: 12px; font-weight: 600; margin-top: 4px; }
.htl2-ltime { font-size: 11px; color: var(--c-text-3); font-family: ui-monospace, "SF Mono", monospace; margin-top: 1px; }
.htl2-axis { position: relative; height: 20px; border-top: 1px solid var(--c-border); }
.htl2-tick { position: absolute; top: 5px; transform: translateX(-50%); font-size: 11px; color: var(--c-text-3); font-family: ui-monospace, "SF Mono", monospace; white-space: nowrap; }
.htl2-tick.edge-start { transform: translateX(0); }
.htl2-tick.edge-end { transform: translateX(-100%); }
.htl-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--c-text-2); }
.htl-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.htl-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.timeline-time { font-size: 11px; color: var(--c-text-3); }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-desc { font-size: 12px; color: var(--c-text-2); }

/* Grid 布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grid-aside-right { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-aside-left { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* 工具类 */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-2 { color: var(--c-text-2); }
.text-3 { color: var(--c-text-3); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-red { color: var(--c-red); }
.text-yellow { color: var(--c-yellow); }
.text-green { color: var(--c-green); }
.text-primary { color: var(--c-primary); }
.bg-card { background: var(--c-card); }
.text-right { text-align: right; }
.text-center { text-align: center; }
/* 数值列表头：覆盖 .table th 的左对齐（同特异度、靠后生效），使表头与右对齐内容对齐 */
th.text-right { text-align: right; }
td.text-center, th.text-center { text-align: center; }

/* 面包屑行：左路径 + 右时间选择 */
.crumb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}
.crumb-row .breadcrumb { margin-bottom: 0; }

/* Grafana 风格时间选择器 */
.time-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.time-picker .tp-icon,
.time-picker .tp-live,
.time-picker .tp-trigger {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.time-picker .tp-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  color: var(--c-text-2);
  font-weight: 600;
}
.time-picker .tp-icon:hover {
  background: var(--c-gray-bg);
  color: var(--c-text);
}
.time-picker .tp-live .tp-live-dot { color: var(--c-text-2); font-size: 11px; }
.time-picker .tp-live.active { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.time-picker .tp-live.active .tp-live-dot { color: #ef4444; }
.time-picker .tp-trigger {
  font-weight: 500;
  min-width: 180px;
  justify-content: flex-start;
}
.time-picker .tp-trigger:hover { border-color: var(--c-text-3); }
.time-picker .tp-trigger.open { border-color: var(--c-primary); background: var(--c-primary-bg); }
.time-picker .tp-cal-icon { font-size: 14px; }

/* 下拉面板 */
.tp-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.04);
  min-width: 640px;
  padding: 18px 20px 12px;
}
.tp-panel[hidden] { display: none; }
.tp-panel-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

/* 日历 */
.tp-calendar { font-size: 13px; }
.tp-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tp-cal-title { font-size: 14px; font-weight: 600; color: var(--c-text); }
.tp-cal-nav { display: flex; gap: 4px; }
.tp-cal-nav button {
  width: 28px; height: 28px;
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: 6px;
  font-size: 14px;
  color: var(--c-text-2);
  cursor: pointer;
}
.tp-cal-nav button:hover { background: var(--c-gray-bg); }
.tp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--c-text-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.tp-cal-weekdays span { padding: 6px 0; }
.tp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.tp-day {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.1s;
}
.tp-day:hover:not(.dim):not(.selected) { background: var(--c-gray-bg); }
.tp-day.dim { color: var(--c-text-3); opacity: 0.45; cursor: default; }
.tp-day.today {
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 600;
}
.tp-day.selected {
  background: #111827;
  color: #fff;
  font-weight: 600;
}

/* 快速范围列表 */
.tp-quickranges {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-quick-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}
.tp-quick-item:hover { background: var(--c-gray-bg); }
.tp-quick-item.active { background: #e5e7eb; font-weight: 500; }

/* 起止时间 */
.tp-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.tp-range-field label {
  display: block;
  font-size: 12px;
  color: var(--c-text-2);
  margin-bottom: 4px;
}
.tp-range-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
}
.tp-range-input span { font-size: 14px; color: var(--c-text-2); }
.tp-range-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--c-text);
  font-family: inherit;
  background: transparent;
}

.tp-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}

/* 可排序表头 */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.1s;
  white-space: nowrap;
}
.table th.sortable:hover { color: var(--c-primary); }
.table th.sortable.sorted { color: var(--c-primary); }
.table th.sortable .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: var(--c-text-3);
  vertical-align: 1px;
}
.table th.sortable .sort-icon.active { color: var(--c-primary); }

/* 页面级 Tab（概览 / 接口列表） */
.page-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 16px;
}
.page-tab {
  position: relative;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--c-text-2);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.page-tab:hover { color: var(--c-primary); }
.page-tab.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: 600;
}
.page-tab-pane { display: none; }
.page-tab-pane.active { display: block; }

/* Metric Row — 左图表 + 右 Top5 */
.metric-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.metric-row .card { margin-bottom: 0; }
.metric-top5 .card-title { margin-bottom: 12px; }

/* Top 5 水平条形图（参考用户截图） */
.top5-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.top5-item {
  font-size: 12px;
}
.top5-path {
  display: block;
  color: var(--c-text);
  text-decoration: none;
  font-size: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top5-path:hover { color: var(--c-primary); text-decoration: underline; }
.top5-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.top5-bar {
  height: 8px;
  background: var(--c-gray-bg);
  border-radius: 4px;
  overflow: hidden;
}
.top5-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), #818cf8);
  border-radius: 4px;
}
.top5-val {
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  min-width: 50px;
}

/* 图表卡 Tab 切换标题（参考截图："平均耗时 | 耗时百分位 | 耗时分布"） */
.chart-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chart-tabs .tab {
  color: var(--c-text-3);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 2px 4px;
}
.chart-tabs .tab:hover { color: var(--c-primary); }
.chart-tabs .tab.active { color: var(--c-text); font-weight: 600; }
.chart-tabs .sep-pipe {
  color: var(--c-border);
  font-weight: 400;
}

/* 标签 */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--c-gray-bg);
  color: var(--c-text-2);
  margin-right: 4px;
}
.tag.primary { background: var(--c-primary-bg); color: var(--c-primary); }
.tag.green { background: var(--c-green-bg); color: var(--c-green); }
.tag.yellow { background: var(--c-yellow-bg); color: #b45309; }
.tag.red { background: var(--c-red-bg); color: var(--c-red); }
.tag.purple { background: #ede9fe; color: #6d28d9; }
.tag.gray { background: #f3f4f6; color: #4b5563; }

/* 筛选条 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--c-card);
  border-radius: 6px;
  border: 1px solid var(--c-border);
  font-size: 12px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input {
  padding: 4px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}
.filter-bar .seg {
  display: inline-flex;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}
.filter-bar .seg[hidden] { display: none; }  /* 覆盖上面的 inline-flex，否则 hidden 属性不生效 */
.filter-bar .seg button {
  padding: 4px 10px;
  background: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
}
.filter-bar .seg button.active {
  background: var(--c-primary);
  color: #fff;
}

/* ===== v2 新增组件 ===== */

/* 业务能力卡片 - 双状态徽章 */
.cap-card-status-row {
  display: flex; gap: 6px;
  margin-bottom: 8px;
  font-size: 10px;
}
.lic-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}
.lic-badge.ok      { background: var(--c-green-bg); color: var(--c-green); }
.lic-badge.warn    { background: var(--c-yellow-bg); color: #b45309; }
.lic-badge.crit    { background: var(--c-red-bg); color: var(--c-red); }
.lic-badge.off     { background: var(--c-gray-bg); color: var(--c-text-3); }

/* 实体关系 5 块流式视图 - 参考博睿 */
.entity-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fafbfc;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}
.flow-block {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-block:hover {
  border-color: var(--c-primary);
  box-shadow: 0 2px 6px rgba(79,70,229,0.12);
}
.flow-block.current {
  background: var(--c-primary-bg);
  border-color: var(--c-primary);
}
.flow-arrow {
  display: flex; align-items: center;
  padding: 0 8px;
  color: var(--c-text-3);
  font-size: 18px;
  font-weight: 300;
}
.flow-label {
  font-size: 11px; color: var(--c-text-3);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.flow-main {
  font-size: 16px; font-weight: 700;
  color: var(--c-text);
}
.flow-sub {
  font-size: 11px; color: var(--c-text-2);
  display: flex; gap: 8px;
}
.flow-sub .crit  { color: var(--c-red); font-weight: 500; }
.flow-sub .warn  { color: #b45309; font-weight: 500; }
.flow-sub .ok    { color: var(--c-green); font-weight: 500; }

/* KPI 紧凑型（横排） */
.kpi-compact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 4px 0;
}
.kpi-compact {
  flex: 1;
  min-width: 130px;
  padding: 10px 14px;
  border-right: 1px solid var(--c-border);
}
.kpi-compact:last-child { border-right: none; }
.kpi-compact .lbl { font-size: 11px; color: var(--c-text-3); }
.kpi-compact .val { font-size: 18px; font-weight: 700; color: var(--c-text); margin-top: 2px; }
.kpi-compact .val .unit { font-size: 11px; font-weight: 500; color: var(--c-text-3); margin-left: 1px; }
.kpi-compact .dlt { font-size: 11px; margin-top: 2px; }
.kpi-compact .dlt.up { color: var(--c-green); }
.kpi-compact .dlt.down { color: var(--c-red); }
.kpi-compact .dlt.flat { color: var(--c-text-3); }


/* ===== v3 新增组件 ===== */

/* 综合健康判定（首屏顶部用） */
.health-verdict {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 18px 22px;
  align-items: center;
  margin-bottom: 14px;
}
.health-verdict.crit { border-left: 6px solid var(--c-red); }
.health-verdict.warn { border-left: 6px solid var(--c-yellow); }
.health-verdict.ok   { border-left: 6px solid #d1d5db; }
.verdict-label { font-size: 13px; color: var(--c-text-3); margin-bottom: 4px; }
.verdict-headline { font-size: 22px; font-weight: 700; color: var(--c-text); }
.verdict-headline.crit { color: var(--c-red); }
.verdict-headline.warn { color: #b45309; }
.verdict-sub { font-size: 13px; color: var(--c-text-2); margin-top: 4px; }
.verdict-actions { display: flex; gap: 8px; flex-direction: column; }

/* Tab 组件 */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 16px;
  gap: 0;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  user-select: none;
}
.tab:hover { color: var(--c-primary); }
.tab.active {
  color: var(--c-primary);
  font-weight: 600;
  border-bottom-color: var(--c-primary);
}
.tab-badge {
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  font-weight: 500;
}
.tab-badge.gray { background: var(--c-gray); }

/* 横向时间线（swim lane） */
.swim-lane {
  position: relative;
  height: 120px;
  background: #fafbfc;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 12px 0;
}
.swim-lane-axis {
  position: absolute;
  left: 30px; right: 30px;
  top: 50%;
  height: 2px;
  background: #e5e7eb;
  transform: translateY(-50%);
}
.swim-lane-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--c-text-3);
  padding-top: 18px;
}
.swim-lane-tick::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 1px; height: 8px;
  background: #d1d5db;
  transform: translateX(-50%);
}
.swim-event {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156,163,175,0.18);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.swim-event.crit    { background: var(--c-red); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.swim-event.warn    { background: var(--c-yellow); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.swim-event.ok      { background: #9ca3af; }
.swim-event.success { background: var(--c-green); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.swim-event:hover,
.swim-event:focus { transform: translate(-50%, -50%) scale(1.4); z-index: 100; outline: none; }
.swim-event-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  color: var(--c-text-2);
  margin-top: 6px;
  background: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--c-border);
  pointer-events: none;
}

/* 近 24h 事件流增强：沿用原单轴样式，仅补充聚合、tip 避让与 hover 详情 */
.swim-event.cluster {
  width: 20px;
  height: 20px;
  font-size: 9px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.swim-event-label { transition: opacity 0.1s; }
.swim-event-label.tip-hidden { visibility: hidden; opacity: 0; }
.swim-event:hover .swim-event-label,
.swim-event:focus .swim-event-label {
  visibility: visible;
  opacity: 1;
  z-index: 101;
}
.swim-event.tip-left .swim-event-label {
  left: 0;
  transform: none;
}
.swim-event.tip-right .swim-event-label {
  right: 0;
  left: auto;
  transform: none;
}
.swim-event-tooltip {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 410px;
  max-width: calc(100vw - 80px);
  padding: 10px 12px;
  transform: translateX(-50%) scale(0.7143);
  transform-origin: bottom center;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  color: var(--c-text-2);
  box-shadow: 0 8px 24px rgba(15,23,42,0.14);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
  z-index: 102;
}
.swim-event:hover .swim-event-tooltip,
.swim-event:focus .swim-event-tooltip { display: block; }
.swim-event.tip-left .swim-event-tooltip {
  left: 0;
  transform: scale(0.7143);
  transform-origin: bottom left;
}
.swim-event.tip-right .swim-event-tooltip {
  right: 0;
  left: auto;
  transform: scale(0.7143);
  transform-origin: bottom right;
}
.swim-tooltip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text);
  font-weight: 600;
}
.swim-alert-status {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  vertical-align: 1px;
}
.swim-alert-status.active { background: var(--c-red-bg); color: #b91c1c; }
.swim-alert-status.recovered { background: var(--c-gray-bg); color: #6b7280; }
.swim-trigger-value,
.swim-risk-high { color: var(--c-red); font-weight: 600; }
.swim-risk-medium { color: #b45309; font-weight: 600; }
.swim-tooltip-title { margin-top: 5px; color: var(--c-text); font-size: 12px; font-weight: 600; }
.swim-tooltip-meta { margin-top: 2px; color: var(--c-text-3); font-size: 10px; }
.swim-tooltip-desc { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--c-border); }
.swim-tooltip-list { margin-top: 6px; }
.swim-tooltip-row {
  display: grid;
  grid-template-columns: 7px 34px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid #f1f3f6;
}
.swim-tooltip-row b { color: var(--c-text); font-weight: 600; }
.swim-tooltip-row small { display: block; margin-top: 1px; color: var(--c-text-3); font-size: 9px; }
.swim-tooltip-time { color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.swim-tooltip-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: #9ca3af;
}
.swim-tooltip-dot.crit { background: var(--c-red); }
.swim-tooltip-dot.warn { background: var(--c-yellow); }
.swim-tooltip-dot.success { background: var(--c-green); }

/* 操作菜单（替代多链接挤一起） */
.action-menu {
  position: relative;
  display: inline-block;
}
.action-trigger {
  cursor: pointer;
  font-size: 12px;
  color: var(--c-primary);
  padding: 2px 6px;
}

/* 危险按钮 */
.btn.danger-action {
  background: #fff;
  border-color: var(--c-red);
  color: var(--c-red);
}
.btn.danger-action::before {
  content: "⚠ ";
}
.btn.danger-action:hover {
  background: var(--c-red-bg);
}

/* 自指 banner — 当前页提示用浅蓝色不可点 */
.banner.self {
  background: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
}

/* 卡片去重叠 - 正常项 dim 化 */
.cap-card.cap-ok .cap-card-status { display: none; }
.cap-card.cap-ok .cap-card-status-row { opacity: 0.7; }

/* 紧凑 KPI 行 - 字号修正 */
.kpi-compact .lbl { font-size: 12px; }
.kpi-compact .val { font-size: 20px; }
.kpi-compact .dlt { font-size: 11px; }

/* 业务能力卡 metric 字号 */
.cap-metric-label { font-size: 11px; }
.cap-metric-value { font-size: 14px; }

/* 实体流式视图 - "当前页"块的明确高亮 */
.flow-block.current {
  background: linear-gradient(135deg, var(--c-primary) 0%, #6366f1 100%);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.flow-block.current .flow-label { color: rgba(255,255,255,0.85); }
.flow-block.current .flow-main { color: #fff; }
.flow-block.current .flow-sub { color: rgba(255,255,255,0.9); }
.flow-block.current::before {
  content: "当前位置";
  position: absolute;
  top: -10px; right: 8px;
  background: #fff;
  color: var(--c-primary);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid var(--c-primary);
}
.flow-block { position: relative; }

/* 空状态 / 提示横幅 */
.banner {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner.info { background: var(--c-primary-bg); color: var(--c-primary); border: 1px solid #c7d2fe; }
.banner.warn { background: var(--c-yellow-bg); color: #b45309; border: 1px solid #fcd34d; }
.banner.crit { background: var(--c-red-bg); color: var(--c-red); border: 1px solid #fca5a5; }

/* === v3+ 触发模型 chip（按 告警规则清单-v2.tsv） === */
.trigger-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", monospace;
  background: var(--c-primary-bg);
  color: var(--c-primary);
}
.trigger-chip.D0 { background: #e0f2fe; color: #075985; }
.trigger-chip.W1 { background: var(--c-primary-bg); color: var(--c-primary); }
.trigger-chip.C1 { background: #fef3c7; color: #b45309; }
.trigger-chip.E1 { background: var(--c-red-bg); color: var(--c-red); }
.trigger-chip.S1 { background: var(--c-green-bg); color: #047857; }

/* === 开关（告警规则"启用"列用） === */
.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.switch input { display: none; }
.switch .track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: var(--c-gray);
  transition: background .15s;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--c-green); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* === 排查建议浮层（Runbook Modal，md 渲染） === */
.rb-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: flex-start; justify-content: center; z-index: 1000; padding: 48px 16px; overflow: auto; }
.rb-overlay.show { display: flex; }
.rb-modal { background: #fff; width: 720px; max-width: 100%; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.rb-modal-head { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--c-border); }
.rb-modal-title { font-weight: 600; font-size: 15px; }
.rb-close { margin-left: auto; border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--c-text-3); }
.rb-close:hover { color: var(--c-text); }
.rb-modal-body { padding: 8px 24px 24px; overflow: auto; }
.rb-loading { padding: 24px; color: var(--c-text-3); }

/* markdown 渲染样式 */
.markdown-body { font-size: 13px; line-height: 1.7; color: var(--c-text); }
.markdown-body h1 { font-size: 19px; margin: 18px 0 10px; }
.markdown-body h2 { font-size: 15px; margin: 18px 0 8px; padding-top: 8px; border-top: 1px solid var(--c-border); }
.markdown-body h3 { font-size: 14px; margin: 14px 0 6px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 22px; }
.markdown-body li { margin: 4px 0; }
.markdown-body code { background: var(--c-gray-bg); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, "SF Mono", monospace; font-size: 12px; }
.markdown-body pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 6px; overflow: auto; margin: 10px 0; }
.markdown-body pre code { background: none; color: inherit; padding: 0; font-size: 12px; }
.markdown-body blockquote { margin: 10px 0; padding: 8px 14px; background: var(--c-primary-bg); border-left: 3px solid var(--c-primary); border-radius: 0 6px 6px 0; color: #3730a3; }
.markdown-body table.md-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.markdown-body table.md-table th, .markdown-body table.md-table td { border: 1px solid var(--c-border); padding: 6px 10px; text-align: left; }
.markdown-body table.md-table th { background: var(--c-gray-bg); font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid var(--c-border); margin: 14px 0; }

/* === 配置表单（告警通知 / 屏蔽规则）=== */
.form-card { max-width: 880px; }
.form-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.form-row > label.form-label { width: 132px; flex: none; text-align: right; padding-top: 7px; font-size: 13px; color: var(--c-text-2); }
.form-row > label.form-label .req { color: var(--c-red); margin-right: 2px; }
.form-control { flex: 1; min-width: 0; }
.form-control input[type=text], .form-control input[type=password], .form-control input[type=number], .form-control select, .form-control textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--c-border); border-radius: 6px; font-size: 13px; background: #fff; box-sizing: border-box;
}
.form-control input:focus, .form-control select:focus, .form-control textarea:focus { outline: none; border-color: var(--c-primary); }
.form-control textarea { min-height: 68px; resize: vertical; font-family: inherit; }
.form-hint { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; padding-left: 148px; }
.input-eye { position: relative; }
.input-eye button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; color: var(--c-text-3); font-size: 14px; }
/* 多选标签框（告警级别 / 生效集群） */
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 8px; border: 1px solid var(--c-border); border-radius: 6px; min-height: 34px; background: #fff; }
.tag-input .tag-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--c-gray-bg); border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.tag-input .tag-chip .x { cursor: pointer; color: var(--c-text-3); }
.tag-input .tag-chip .x:hover { color: var(--c-red); }
.tag-input .tag-ph { color: var(--c-text-3); font-size: 13px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 4px 4px; font-size: 12px; color: var(--c-text-3); }
.pager .pg-btn { min-width: 28px; height: 28px; border: 1px solid var(--c-border); border-radius: 4px; background: #fff; cursor: pointer; }
.pager .pg-btn.active { border-color: var(--c-primary); color: var(--c-primary); }

/* === 关系图（服务/接口详情"关系"tab 用） — 三列实体图，参考博睿数据 === */
.relation-graph {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 12px;
  background: #fafbfc;
  border-radius: 6px;
  border: 1px solid var(--c-border);
}
.relation-col { display: flex; flex-direction: column; gap: 6px; }
.relation-col.center { gap: 6px; }
.relation-col-title {
  font-size: 11px;
  color: var(--c-text-3);
  text-align: center;
  margin-bottom: 4px;
}
.relation-node {
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
}
.relation-node:hover { border-color: var(--c-primary); box-shadow: 0 2px 6px rgba(79,70,229,0.15); }
.relation-node.active {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 600;
}
.relation-node .rel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.relation-node .kind { font-weight: 500; }
.relation-node .val { color: var(--c-text-2); font-size: 11px; }
.relation-node.active .val { color: var(--c-primary); }
.relation-node .call-pct-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--c-text-3);
  font-weight: normal;
}
.relation-node.active .call-pct-row { color: var(--c-primary); }
.relation-node .call-pct-label { white-space: nowrap; }
.relation-node .call-pct-bar {
  flex: 1;
  min-width: 36px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.relation-node .call-pct-bar-fill {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
}
.relation-node .call-pct-val { font-weight: 600; min-width: 38px; text-align: right; color: var(--c-text-2); }
.relation-node.active .call-pct-val { color: var(--c-primary); }
.relation-arrow { text-align: center; font-size: 18px; color: var(--c-text-3); }
.relation-center {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(79,70,229,0.03);
  border: 2px solid var(--c-primary);
  border-radius: 8px;
  padding: 8px;
  min-width: 140px;
}

/* 微型指标块 */
.mini {
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
}
.mini-label { font-size: 11px; color: var(--c-text-3); }
.mini-value { font-size: 18px; font-weight: 700; margin-top: 2px; }
.mini-sub   { font-size: 10px; color: var(--c-text-3); margin-top: 2px; }

/* grid 补充 */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.mono { font-family: ui-monospace, "SF Mono", monospace; }

/* 右侧详情抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  justify-content: flex-end;
}
.drawer-backdrop[hidden] { display: none; }
.drawer-panel {
  width: 560px;
  max-width: calc(100vw - 48px);
  height: 100%;
  background: #fff;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-close {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--c-text-3);
  cursor: pointer;
}
.drawer-body {
  padding: 16px 20px;
  overflow: auto;
}
.trace-tree {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.8;
  background: #fafbfc;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
}

/* === 平台总览 - 活跃告警分级卡片 === */
.alert-sev-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.alert-sev-card {
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-text-3);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.alert-sev-card .lbl {
  font-size: 12px; color: var(--c-text-2); font-weight: 600;
  margin-bottom: 4px;
}
.alert-sev-card .val {
  font-size: 28px; font-weight: 700; line-height: 1.1;
  color: var(--c-text);
}
.alert-sev-card .hint {
  font-size: 11px; color: var(--c-text-3); margin-top: 4px;
}
.alert-sev-card.all { border-left-color: var(--c-text-2); }
.alert-sev-card.p1  { border-left-color: var(--c-red); }
.alert-sev-card.p1 .val { color: var(--c-red); }
.alert-sev-card.p2  { border-left-color: var(--c-yellow); }
.alert-sev-card.p2 .val { color: #b45309; }
.alert-sev-card.p3  { border-left-color: var(--c-primary); }
.alert-sev-card.p3 .val { color: var(--c-primary); }

/* === 业务监控 - 站点筛选面板与指标图表布局 ===
   业务模块用页签切换；站点面板仅 svc/avc/webrtc 有，其余模块单栏 */
.biz-layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.biz-layout.no-side { grid-template-columns: minmax(0, 1fr); }
.cap-side {
  position: sticky;
  top: 16px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
  flex-direction: column;
}
.cap-side-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
}
.cap-side-sub { font-size: 11px; font-weight: normal; color: var(--c-text-3); margin-left: auto; }
.cap-side-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.cap-site {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  color: var(--c-text-2);
  cursor: pointer;
  text-align: left;
}
.cap-site:hover { background: var(--c-gray-bg); }
.cap-site.active { background: var(--c-primary-bg); color: var(--c-primary); font-weight: 600; }
.cap-site.all { border-bottom: 1px solid var(--c-border); border-radius: 5px 5px 0 0; margin-bottom: 4px; padding-bottom: 8px; }
.cap-site-caret {
  width: 10px;
  font-size: 9px;
  color: var(--c-text-3);
  transition: transform .15s;
}
.cap-site-caret.open { transform: rotate(90deg); color: var(--c-primary); }
.cap-site-caret.ghost { visibility: hidden; }
.cap-site-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-site-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.cap-site.active .cap-site-count { color: var(--c-primary); }
.cap-site-count.zero { color: var(--c-text-3); }
.cap-site-count .u { font-size: 10px; font-weight: normal; color: var(--c-text-3); margin-left: 2px; }
.cap-site-devs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--c-border);
}
.cap-dev {
  padding: 4px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  color: var(--c-text-2);
  cursor: pointer;
  text-align: left;
}
.cap-dev:hover { background: var(--c-gray-bg); }
.cap-dev.active { background: var(--c-primary-bg); color: var(--c-primary); font-weight: 600; }
.cap-side-note {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--c-text-3);
}
/* 未部署 / 未授权的业务模块页签：置灰不可点 */
.tab.dim { color: var(--c-text-3); cursor: not-allowed; }
.tab.dim:hover { color: var(--c-text-3); }
/* 指标区标题上的站点范围徽标（✕ 一键清除） */
.scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 4px 1px 7px;
  border-radius: 10px;
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-size: 11px;
  font-weight: 500;
}
.scope-chip-x {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 10px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
}
@media (max-width: 1100px) {
  .biz-layout, .biz-layout.no-side { grid-template-columns: minmax(0, 1fr); }
  .cap-side { position: static; height: auto !important; overflow: visible; }
  .cap-side-list { overflow-y: visible; }
}

/* === 详情页 - TOP5 合并卡（单卡 + 右上角指标 tab） === */
.top5-card .card-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.top5-view-all {
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--c-primary);
  font-size: 12px;
  cursor: pointer;
}
.top5-view-all:hover { text-decoration: underline; }
.top5-note { font-size: 11px; font-weight: normal; color: var(--c-text-3); }
.top5-entity-select {
  padding: 1px 4px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-primary);
  cursor: pointer;
}
.top5-card .top5-list,
.top5-modal .top5-list { gap: 8px; }
.top5-card .top5-item,
.top5-modal .top5-item {
  display: grid;
  grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.top5-card .top5-path,
.top5-modal .top5-path {
  margin-bottom: 0;
}
.top5-card .top5-bar-row,
.top5-modal .top5-bar-row {
  min-width: 0;
}
.top5-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.top5-table-grid.one-col { grid-template-columns: minmax(0, 1fr); }
.top5-table-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
}
.top5-table-head {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--c-text);
  font-size: 12px;
  font-weight: 600;
}
.top5-table-head .top5-note { margin-left: auto; }
.top5-table-head .top5-card-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 1250px) {
  .top5-table-grid { grid-template-columns: minmax(0, 1fr); }
}
.top5-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top5-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .35);
}
.top5-modal {
  position: relative;
  width: 760px;
  max-width: 94vw;
  max-height: 84vh;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .2);
}
.top5-modal-head {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: 15px;
  font-weight: 600;
}
.top5-modal-close {
  margin-left: auto;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--c-text-3);
  font-size: 16px;
  cursor: pointer;
}
.top5-modal-body {
  max-height: calc(84vh - 52px);
  overflow: auto;
  padding: 0 12px 16px;
}
.top5-modal-tabs {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.top5-modal-tabs .tab {
  position: relative;
  flex: none;
  padding: 12px 2px 10px;
  color: var(--c-text-2);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.top5-modal-tabs .tab.active {
  color: var(--c-primary);
  font-weight: 600;
}
.top5-modal-tabs .tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--c-primary);
  content: '';
}
.top5-data-table-wrap { padding-top: 8px; }
.top5-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--c-text-2);
  font-size: 12px;
}
.top5-data-table th {
  padding: 10px 12px;
  background: #f1f3f6;
  color: var(--c-text-2);
  font-weight: 600;
  text-align: left;
}
.top5-data-table th:first-child { width: 46%; }
.top5-data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--c-border);
}
.top5-data-value { color: var(--c-text); font-weight: 500; }
.top5-data-name { color: var(--c-text); }
.top5-data-sub { margin-left: 8px; color: var(--c-text-3); font-size: 11px; }
.top5-rank {
  display: inline-block;
  min-width: 16px;
  margin-right: 6px;
  color: var(--c-text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.top5-sub { margin-left: 8px; font-size: 11px; color: var(--c-text-3); }
.top5-card-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
}
.top5-card-tabs .tab {
  color: var(--c-text-3);
  cursor: pointer;
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 3px;
}
.top5-card-tabs .tab:hover { color: var(--c-primary); }
.top5-card-tabs .tab.active {
  color: var(--c-primary);
  background: var(--c-primary-bg);
  font-weight: 600;
}
.top5-card-tabs .sep-pipe { color: var(--c-text-3); }
/* 指标页签较多（服务 10 个、主机 7 个）：宽屏靠右一行，窄屏在卡片标题内整体换行，
   而不是把每个页签压成一列竖字。v17 起对所有 .top5-card 生效（原 .capacity-svc-top5 专项已通用化）。 */
.top5-card .card-title { align-items: flex-start; flex-wrap: wrap; }
.top5-card .card-title .top5-card-tabs {
  flex: 1 1 680px;
  justify-content: flex-end;
  flex-wrap: wrap;
  row-gap: 4px;
}
.top5-card-tabs .tab { white-space: nowrap; }
.top5-bar-fill.warn { background: var(--c-yellow); }
.top5-bar-fill.crit { background: var(--c-red); }
.top5-val.warn { color: #b45309; }
.top5-val.crit { color: var(--c-red); }
/* === 业务监控 · 区间统计（累计量 + 峰值） === */
.interval-stats-card .card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.interval-range {
  font-size: 11px;
  font-weight: 400;
  color: var(--c-text-3);
}
.interval-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.interval-stat-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fafbff;
}
.interval-stat-name {
  overflow: hidden;
  margin-bottom: 3px;
  color: var(--c-text-2);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.interval-stat-value {
  color: var(--c-text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.interval-stat-value span {
  margin-left: 4px;
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 500;
}
@media (max-width: 1100px) {
  .interval-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* === 业务监控 · 指标小图网格 === */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
/* 左侧站点面板占位后主区变窄，中等屏降为 2 列避免小图被压扁 */
@media (max-width: 1400px) {
  .biz-layout:not(.no-side) .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
.metric-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 10px 12px;
}
/* 指标值区：列式布局，列内上为指标名、下为数值，左对齐；
   单指标 1 列（即图表标识），双指标 2 列（第 1 列主轴=数量，第 2 列副轴=比率） */
.metric-card-val { display: flex; align-items: flex-start; gap: 36px; }
.metric-card-val .mcv-col { display: flex; flex-direction: column; align-items: flex-start; }
.metric-card-val .mcv-col-name { font-size: 12px; font-weight: 500; color: var(--c-text-2); margin-bottom: 1px; }
.metric-card-val .mcv-col-val { font-size: 20px; font-weight: 700; color: var(--c-text); display: flex; align-items: baseline; gap: 3px; }
.metric-card-val .mcv-col-val .unit { font-size: 12px; font-weight: 500; color: var(--c-text-3); }
.metric-card-chart {
  height: 140px;
  margin-top: 6px;
}
/* === 异常下钻抽屉 === */
.drill-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.18);
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s, visibility 0s linear 0.18s;
}
.drill-backdrop.open {
  opacity: 1; visibility: visible;
  transition: opacity 0.18s, visibility 0s;
}
.drill-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 640px; max-width: 90vw;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--c-border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
}
.drill-drawer.open { transform: translateX(0); }
.drill-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}
.drill-head-title { flex: 1; min-width: 0; }
.drill-head-label {
  font-size: 12px; color: var(--c-text-3);
  display: block; margin-bottom: 2px;
}
.drill-head-content {
  font-size: 15px; font-weight: 600;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.drill-time {
  font-size: 13px; color: var(--c-text-2); font-weight: 400;
  background: #f3f4f6; padding: 1px 6px; border-radius: 3px;
}
.drill-val.crit {
  color: var(--c-red); font-weight: 700;
}
.drill-target {
  font-size: 12px; color: var(--c-text-3); font-weight: 400;
}
.drill-close {
  background: none; border: none;
  font-size: 18px; color: var(--c-text-3);
  cursor: pointer; padding: 4px 8px;
  border-radius: 4px;
}
.drill-close:hover { background: var(--c-gray-bg); color: var(--c-text); }
.drill-summary { padding: 12px 18px 8px; }
.drill-summary-text {
  font-size: 13px; color: var(--c-text-2);
  line-height: 1.6;
  background: var(--c-red-bg);
  padding: 10px 12px;
  border-radius: 5px;
  border-left: 3px solid var(--c-red);
}
.drill-filter {
  padding: 8px 18px 12px;
  border-bottom: 1px solid #eef2f7;
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-size: 11px;
  color: var(--c-text-3);
  align-items: center;
}
.drill-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-2);
  flex-shrink: 0;
}
.drill-filter-group {
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.drill-filter-key {
  color: var(--c-text-3);
  font-size: 11px;
}
.drill-chip {
  display: inline-block;
  padding: 1px 7px;
  background: var(--c-primary-bg);
  color: var(--c-primary);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}
.drill-chip.mono {
  font-family: ui-monospace, "SF Mono", monospace;
  background: #f3f4f6;
  color: var(--c-text-2);
}
.drill-tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  padding: 0 12px;
  gap: 4px;
}
.drill-tab {
  background: none; border: none;
  padding: 10px 14px;
  font-size: 13px; color: var(--c-text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}
.drill-tab:hover { color: var(--c-primary); }
.drill-tab.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: 600;
}
.drill-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.drill-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.drill-table th {
  text-align: left; font-weight: 600; color: var(--c-text-3);
  padding: 6px 8px; border-bottom: 1px solid var(--c-border);
}
.drill-table td {
  padding: 8px 8px; border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.drill-table tr:hover td { background: #fafbfc; }
.drill-table .mono {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
}
.drill-table .crit { color: var(--c-red); font-weight: 600; }
.drill-link {
  font-size: 11px;
  color: var(--c-primary);
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  background: #fff;
}
.drill-link:hover { background: var(--c-primary-bg); border-color: var(--c-primary); }
.drill-empty {
  padding: 24px;
  text-align: center;
  color: var(--c-green);
  font-size: 13px;
}
/* ===== v4：双数值 KPI / 告警徽标 popover / 暂停刷新 / 样本不足（07 规范） ===== */
/* KPI 卡副行：当前(近5min) 值 + 徽标；红色只出现在这里（颜色=现在） */
.kpi-sub {
  margin-top: 8px; padding-top: 7px;
  border-top: 1px dashed var(--c-border);
  font-size: 11px; color: var(--c-text-3);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.kpi-sub b { color: var(--c-text); font-weight: 600; }
.kpi-sub.crit b { color: var(--c-red); }
.kpi-sub.warn b { color: #b45309; }

/* 告警徽标（KPI 副行 / 页头）与 🔔 徽标（无状态列的列表行） */
.al-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--c-red-bg); color: var(--c-red);
}
.al-badge.warn { background: #fef3c7; color: #b45309; }
.al-bell {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  background: var(--c-red-bg); color: var(--c-red);
}
.al-bell.warn { background: #fef3c7; color: #b45309; }

/* 徽标 hover popover：活跃告警列表，点击条目 → 事件详情 */
.al-popover {
  position: absolute; z-index: 1200; width: 380px;
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 8px; display: none;
}
.al-popover.show { display: block; }
.al-pop-title { font-size: 11px; color: var(--c-text-3); padding: 2px 6px 8px; }
.al-pop-row {
  display: grid; grid-template-columns: auto 1fr; grid-column-gap: 8px;
  padding: 7px 8px; border-radius: 6px; text-decoration: none; color: inherit;
  align-items: baseline;
}
.al-pop-row:hover { background: #f8fafc; }
.al-pop-name { font-size: 12px; font-weight: 600; color: var(--c-text); }
.al-pop-meta { grid-column: 2; font-size: 11px; color: var(--c-text-3); margin-top: 2px; }

/* 绝对区间 → 暂停自动刷新 */
.tp-paused {
  margin-left: 6px; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  background: #fef3c7; color: #b45309; white-space: nowrap;
}

/* 样本不足（比率/分位窗口内样本 <20，不得显示为正常绿色） */
.insufficient-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; background: #f3f4f6; color: #9ca3af; white-space: nowrap;
}

/* 时间锚点横幅 */
.anchor-banner { margin: 8px 0 12px; }

/* 页头状态徽标可点击 */
.sev.clickable { cursor: pointer; }
.sev.clickable:hover { filter: brightness(0.95); text-decoration: underline; }

/* ===================================================================
   中间件监控 v5（数据库监控 → 中间件监控）
   引擎健康为主（USE，按类型分化）+ 调用 RED 为辅
   =================================================================== */

/* 概览：按类型的健康分布磁贴 */
.mw-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1200px) { .mw-tiles { grid-template-columns: repeat(3, 1fr); } }
.mw-tile {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.12s;
  display: block;
}
.mw-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); border-color: var(--c-primary); }
.mw-tile.crit { border-left-color: var(--c-red); }
.mw-tile.warn { border-left-color: var(--c-yellow); }
.mw-tile.ok   { border-left-color: var(--c-green); }
.mw-tile.active { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-bg); }
.mw-tile-head { display: flex; align-items: center; gap: 6px; }
.mw-tile-name { font-size: 13px; font-weight: 600; }
.mw-tile-count { margin-left: auto; font-size: 11px; color: var(--c-text-3); }
.mw-tile-metric { font-size: 20px; font-weight: 700; margin-top: 10px; line-height: 1.1; }
.mw-tile-metric .unit { font-size: 12px; font-weight: 500; color: var(--c-text-3); margin-left: 1px; }
.mw-tile-metric.crit { color: var(--c-red); }
.mw-tile-metric.warn { color: #b45309; }
.mw-tile-sub { font-size: 11px; color: var(--c-text-3); margin-top: 3px; }

/* 关键饱和度：列表/表格内联水位条（USE·Saturation 统一列） */
.sat-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; width: 100%; }
.sat-cell .progress { width: 78px; height: 6px; flex-shrink: 0; }
.sat-cell .sat-val { min-width: 40px; text-align: right; font-weight: 600; }
.sat-cell .sat-val.crit { color: var(--c-red); }
.sat-cell .sat-val.warn { color: #b45309; }

/* 引擎健康：指标块（详情页 USE 面板） */
.health-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .health-metrics { grid-template-columns: repeat(2, 1fr); } }
/* v13：中间件状态卡数量按引擎特性变化（4–5 张），自适应排布，不强制补齐 */
#pane-monitor > .health-metrics { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (max-width: 1100px) { #pane-monitor > .health-metrics { grid-template-columns: repeat(2, 1fr); } }
.hm {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}
.hm.crit { border-left: 3px solid var(--c-red); }
.hm.warn { border-left: 3px solid var(--c-yellow); }
.hm-label { font-size: 12px; color: var(--c-text-3); display: flex; align-items: center; gap: 6px; }
.hm-label .hm-tip { color: var(--c-text-3); cursor: help; font-size: 11px; }
.hm-value { font-size: 22px; font-weight: 700; color: var(--c-text); margin-top: 4px; line-height: 1.15; }
.hm-value .unit { font-size: 12px; font-weight: 500; color: var(--c-text-3); margin-left: 2px; }
.hm-value.crit { color: var(--c-red); }
.hm-value.warn { color: #b45309; }
.hm-value.ok   { color: var(--c-text); } /* v12：正常值保持中性，绿色只表达状态语义（chip/lamp），不装饰数据 */
.hm-sub { font-size: 11px; color: var(--c-text-3); margin-top: 4px; }
.hm-sub b { color: var(--c-text-2); }
.hm-bar { margin-top: 8px; }

/* 引擎健康：集群状态灯（OpenSearch green/yellow/red、ZK mode 等） */
.status-lamp {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px;
}
.status-lamp::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-gray); display: inline-block;
}
.status-lamp.green::before  { background: var(--c-green); }
.status-lamp.yellow::before { background: var(--c-yellow); }
.status-lamp.red::before    { background: var(--c-red); }
.status-lamp.green  { color: #047857; }
.status-lamp.yellow { color: #b45309; }
.status-lamp.red    { color: var(--c-red); }

/* 中间件详情：对象摘要 + 类型化基本信息 */
.mw-head-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.mw-head-tags .text-3 { font-size: 12px; }
.mw-basic { padding: 0; margin-bottom: 12px; overflow: hidden; }
.mw-basic-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--c-border);
  font-size: 13px; font-weight: 600;
}
.mw-object-level {
  margin-left: auto; padding: 2px 8px; border-radius: 10px;
  background: var(--c-gray-bg); color: var(--c-text-3);
  font-size: 11px; font-weight: 500;
}
.mw-basic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 13px 16px 15px; gap: 14px 20px;
}
.mw-basic-item { min-width: 0; }
.mw-basic-label { margin-bottom: 4px; color: var(--c-text-3); font-size: 11px; }
.mw-basic-value { overflow: hidden; color: var(--c-text); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .mw-basic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mw-object-level { display: none; }
}

/* 数据空间：左侧库导航 */
.dbspace-list { display: flex; flex-direction: column; gap: 2px; }
.dbspace-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--c-text-2);
}
.dbspace-item:hover { background: var(--c-gray-bg); }
.dbspace-item.active { background: var(--c-primary-bg); color: var(--c-primary); font-weight: 600; }
.dbspace-item .sz { color: var(--c-text-3); font-size: 11px; white-space: nowrap; }
.dbspace-item.active .sz { color: var(--c-primary); }

/* ===== v10 公共件（10-结构统一与UX简化方案） ===== */
/* 统一告警级别 chip：全站唯一样式 */
.sev-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sev-chip.p1 { background: var(--c-red-bg); color: var(--c-red); }
.sev-chip.p2 { background: var(--c-yellow-bg); color: #b45309; }
.sev-chip.p3 { background: var(--c-primary-bg); color: var(--c-primary); }

/* 统一空态 */
.empty-state { padding: 40px 16px; text-align: center; color: var(--c-text-3); }
.empty-state .empty-icon { font-size: 28px; margin-bottom: 8px; }
.empty-state .empty-text { font-size: 13px; }

/* === v11 指标浏览器（左侧分组勾选 + 右侧按组渲染） =============== */
.mx-layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.mx-side {
  position: sticky;
  top: 16px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.mx-side-head {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--c-text);
  margin-bottom: 8px;
}
.mx-side-count { margin-left: auto; font-size: 11px; font-weight: normal; color: var(--c-text-3); }
.mx-entity-block { flex: 0 0 auto; min-height: 0; }
.mx-entity-search,
.mx-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  font-size: 12px;
  color: var(--c-text);
  margin-bottom: 8px;
}
.mx-entity-search:focus,
.mx-search:focus { outline: none; border-color: var(--c-primary); }
.mx-entity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.mx-entity-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--c-text-2);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.mx-entity-item[hidden] { display: none; }
.mx-entity-item:hover { background: var(--c-gray-bg); }
.mx-entity-item.active { background: var(--c-primary-bg); color: var(--c-primary); font-weight: 600; }
.mx-entity-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-entity-sub { flex: 0 0 auto; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--c-text-3); }
.mx-side-divider { flex: 0 0 auto; height: 1px; margin: 10px 0; background: var(--c-border); }
.mx-groups { overflow-y: auto; flex: 1; min-height: 120px; margin: 0 -4px; padding: 0 4px; }
.mx-group { margin-bottom: 8px; }
.mx-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  font-size: 11px; font-weight: 600;
  color: var(--c-text-3);
  text-transform: none;
  cursor: pointer;
  border-radius: 4px;
}
.mx-group-head:hover { background: var(--c-gray-bg); color: var(--c-text-2); }
.mx-group-count { margin-left: auto; font-weight: normal; font-variant-numeric: tabular-nums; }
.mx-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  color: var(--c-text-2);
  border-radius: 4px;
  cursor: pointer;
}
.mx-item:hover { background: var(--c-gray-bg); }
.mx-item.on { color: var(--c-text); }
.mx-item input { accent-color: var(--c-primary); margin: 0; }
.mx-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-star {
  font-size: 10px; padding: 0 4px; border-radius: 3px;
  background: var(--c-primary-bg); color: var(--c-primary); font-weight: 600;
}
.mx-side-foot {
  display: flex; gap: 10px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--c-border);
  font-size: 11px;
}
.mx-side-foot a { color: var(--c-primary); text-decoration: none; }
.mx-side-foot a:hover { text-decoration: underline; }
.mx-empty { font-size: 11px; color: var(--c-text-3); padding: 8px 6px; }

.mx-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: #fafbfc;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--c-text-2);
  margin-bottom: 12px;
}
.mx-sec { margin-bottom: 16px; }
.mx-sec-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--c-text-2);
  padding-bottom: 6px; margin-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}
.mx-sec-count { font-size: 11px; font-weight: normal; color: var(--c-text-3); }
.mx-grid { display: grid; gap: 12px; }
.mx-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mx-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mx-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 10px 12px 6px;
}
.mx-card-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; flex-wrap: nowrap; }
.mx-card-title { font-size: 13px; font-weight: 600; color: var(--c-text); white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.mx-card-hint { font-size: 11px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mx-card-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--c-text-3); font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 3px;
  opacity: 0; transition: opacity .12s;
}
.mx-card:hover .mx-card-close { opacity: 1; }
.mx-card-close:hover { background: var(--c-gray-bg); color: var(--c-red); }
.mx-card.wide { grid-column: 1 / -1; }
.mx-card.tall .mx-chart { height: 248px; }
.mx-card-detail {
  flex: none; margin-left: auto; padding: 0; border: none; background: none;
  color: var(--c-primary); font-size: 11px; cursor: pointer;
}
.mx-card-detail:hover { text-decoration: underline; }
.mx-card-detail + .mx-card-close { margin-left: 0; }
.mx-chart { height: 168px; }
.mx-table-widget { height: 100%; display: grid; grid-template-rows: 30px minmax(0, 1fr) 25px; color: var(--c-text-2); font-size: 11px; }
.mx-table-widget.no-toolbar { grid-template-rows: minmax(0, 1fr) 25px; }
.mx-table-widget.no-pager { grid-template-rows: 30px minmax(0, 1fr); }
.mx-table-widget.no-toolbar.no-pager { grid-template-rows: minmax(0, 1fr); }
.mx-table-toolbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mx-table-search { width: min(180px, 45%); height: 24px; padding: 0 8px; border: 1px solid var(--c-border); border-radius: 4px; outline: none; font-size: 11px; }
.mx-table-search:focus { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, .08); }
.mx-table-filter { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--c-text-2); cursor: pointer; }
.mx-table-filter input { margin: 0; accent-color: var(--c-primary); }
.mx-table-count { margin-left: auto; white-space: nowrap; color: var(--c-text-3); }
.mx-table-scroll { min-height: 0; overflow: auto; border: 1px solid var(--c-border); border-radius: 4px; }
.mx-data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mx-data-table th { position: sticky; top: 0; z-index: 1; height: 25px; padding: 0 7px; border-bottom: 1px solid var(--c-border); background: #f9fafb; color: var(--c-text-3); font-weight: 500; text-align: left; }
.mx-data-table th:last-child { width: 72px; }
.mx-data-table th button { width: 100%; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: none; background: none; color: inherit; font: inherit; cursor: pointer; }
.mx-data-table th.text-right button { justify-content: flex-end; }
.mx-sort-mark { color: #b6bdc9; font-size: 10px; }
.mx-data-table td { height: 23px; padding: 2px 7px; border-bottom: 1px solid #f1f3f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-data-table td.is-hot { color: var(--c-red); font-weight: 600; }
.mx-table-empty { height: 68px !important; text-align: center; color: var(--c-text-3); }
.mx-table-pager { display: flex; align-items: center; color: var(--c-text-3); }
.mx-table-pager > div { display: flex; align-items: center; gap: 7px; margin: 0 42px 0 auto; }
.mx-table-pager button { width: 22px; height: 20px; padding: 0; border: 1px solid var(--c-border); border-radius: 3px; background: #fff; color: var(--c-text-2); cursor: pointer; }
.mx-table-pager button:disabled { color: #c9ced8; background: #f9fafb; cursor: default; }
.mx-table-widget.no-toolbar.no-pager .mx-table-scroll { border: none; border-radius: 0; }
.mx-table-widget.no-toolbar.no-pager .mx-data-table { font-size: 12px; }
.mx-table-widget.no-toolbar.no-pager .mx-data-table th {
  height: 34px; padding: 0 12px; background: #f7f8fa;
  color: #596170; font-weight: 600;
}
.mx-table-widget.no-toolbar.no-pager .mx-data-table td { height: 31px; padding: 5px 12px; border-bottom-color: #e5e7eb; }
.mx-state-summary { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mx-state-total { font-size: 34px; line-height: 1; font-weight: 700; }
.mx-state-total.ok { color: var(--c-green); }
.mx-state-total.warn { color: var(--c-red); }
.mx-state-label { margin-top: 7px; color: var(--c-text-3); font-size: 11px; }
.mx-state-empty { margin-top: 18px; color: var(--c-green); font-size: 12px; }
.mx-state-list { width: min(420px, 92%); margin-top: 14px; border-top: 1px solid var(--c-border); }
.mx-state-list > div { display: flex; padding: 7px 2px; border-bottom: 1px solid var(--c-border); font-size: 11px; }
.mx-state-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text-2); }
.mx-state-list b { margin-left: auto; color: var(--c-red); }
.mx-chart-modal {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  display: flex; flex-direction: column; border-radius: 0;
}
.mx-chart-modal .top5-modal-body { flex: 1; min-height: 0; max-height: none; display: flex; flex-direction: column; padding: 0 18px 12px; }
.mx-detail-note { flex: none; padding: 8px 4px 4px; }
.mx-detail-legend {
  flex: none; display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 4px 16px; max-height: 62px; overflow-y: auto; padding: 4px;
  color: var(--c-text-2); font-size: 11px; line-height: 16px;
}
.mx-detail-legend-item { display: inline-flex; align-items: center; min-width: 0; white-space: nowrap; }
.mx-detail-legend-item i { width: 9px; height: 6px; margin-right: 4px; border-radius: 2px; }
.mx-detail-chart { flex: 1; min-height: 420px; }
.mx-blank {
  padding: 40px; text-align: center;
  font-size: 12px; color: var(--c-text-3);
  border: 1px dashed var(--c-border); border-radius: 8px;
}
@media (max-width: 1400px) { .mx-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .mx-layout { grid-template-columns: minmax(0, 1fr); }
  .mx-side { position: static; max-height: none; }
  .mx-grid.cols-3, .mx-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ===================================================================
   v14 · AI 智能运维（11 号方案）
   四个控件：分析卡 ai-card / 抽屉 ai-drawer / 行内入口 ai-inline / 悬浮助手 ai-fab
   卡片与抽屉同构：共用 ai-meta / ai-row / ai-sug / ai-ev / ai-foot
   =================================================================== */
.ai-card {
  background: linear-gradient(180deg, #f7f5ff 0%, #fdfdff 46%, #fff 100%);
  border: 1px solid #ddd6fe; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 14px;
}
.ai-card.running { background: #fbfaff; }
.ai-card-head { display: flex; align-items: center; gap: 10px; }
.ai-mark { font-weight: 600; font-size: 13px; color: #6d28d9; white-space: nowrap; }
.ai-hint { font-size: 11px; color: var(--c-text-3); }
.ai-card-head .btn { margin-left: auto; }

.ai-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 8px; }
.ai-conf { font-size: 11px; padding: 1px 7px; border-radius: 3px; font-weight: 600; }
.ai-conf.ok { background: var(--c-green-bg); color: #047857; }
.ai-conf.warn { background: var(--c-yellow-bg); color: #b45309; }
.ai-conf.off { background: var(--c-gray-bg); color: var(--c-text-2); }
.ai-skill { font-size: 11px; color: #6d28d9; background: #ede9fe; padding: 1px 7px; border-radius: 3px; }
.ai-skill.miss { color: var(--c-text-2); background: var(--c-gray-bg); }
.ai-by { font-size: 11px; color: var(--c-text-3); margin-left: auto; }

.ai-row { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; line-height: 1.65; }
.ai-row .ai-k { flex: 0 0 62px; color: var(--c-text-3); font-size: 12px; padding-top: 1px; }
.ai-row .ai-v { flex: 1; min-width: 0; color: var(--c-text); }
.ai-sug { margin: 0; padding-left: 18px; }
.ai-sug li { margin: 2px 0; }
.ai-diff { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 3px; margin-right: 6px; }
.ai-diff.add { background: var(--c-red-bg); color: var(--c-red); }
.ai-diff.keep { background: var(--c-yellow-bg); color: #b45309; }
.ai-diff.gone { background: var(--c-green-bg); color: #047857; }

.ai-steps { margin: 10px 0 2px; }
.ai-step { display: flex; align-items: baseline; gap: 8px; font-size: 12px; padding: 3px 0; color: var(--c-text-3); }
.ai-step.done { color: var(--c-text-2); }
.ai-step.doing { color: var(--c-text); }
.ai-step-ico { width: 12px; text-align: center; color: var(--c-text-3); }
.ai-step.done .ai-step-ico { color: var(--c-green); }
.ai-step.doing .ai-step-ico { color: #6d28d9; animation: ai-blink 1s infinite; }
.ai-step-label { font-weight: 500; }
.ai-step-detail { font-size: 11px; color: var(--c-text-3); }
@keyframes ai-blink { 50% { opacity: .3; } }

.ai-ev { margin-top: 8px; border-top: 1px dashed #e9e5fb; padding-top: 8px; }
.ai-ev summary { cursor: pointer; font-size: 12px; color: #6d28d9; }
.ai-ev-list { margin: 8px 0 0; padding-left: 18px; }
.ai-ev-list li { font-size: 12px; line-height: 1.7; color: var(--c-text-2); margin-bottom: 4px; }
.ai-ev-label { font-weight: 600; color: var(--c-text); margin-right: 6px; }
.ai-ev-link { margin-left: 6px; font-size: 11px; }

.ai-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e9e5fb; font-size: 12px; }
.ai-fb { margin-left: auto; display: flex; gap: 6px; }
.ai-fb button { border: 1px solid var(--c-border); background: #fff; border-radius: 4px; padding: 2px 8px; font-size: 11px; cursor: pointer; color: var(--c-text-2); }
.ai-fb button:hover { border-color: #a78bfa; color: #6d28d9; }
.ai-fb-done { font-size: 11px; color: var(--c-green); margin-left: auto; }

/* 行内入口 */
.ai-inline { color: #6d28d9; }
.ai-inline::before { content: '✦ '; }

/* 抽屉 */
.ai-drawer { position: fixed; inset: 0; z-index: 1200; display: none; }
.ai-drawer.show { display: block; }
.ai-dr-mask { position: absolute; inset: 0; background: rgba(15,23,42,.28); }
.ai-dr-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 520px; max-width: 96vw;
  background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.14);
  display: flex; flex-direction: column; overflow: auto;
}
.ai-drawer.wide .ai-dr-panel { width: 96vw; }
.ai-dr-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; background: #fff; z-index: 1; }
.ai-dr-head button { margin-left: 0; border: none; background: none; cursor: pointer; color: var(--c-text-3); font-size: 14px; }
.ai-dr-wide { margin-left: auto !important; }
.ai-dr-head button:hover { color: var(--c-text); }
.ai-dr-ctx { padding: 10px 16px; background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.ai-dr-ctx > div { display: flex; gap: 10px; font-size: 12px; line-height: 1.9; }
.ai-dr-ctx .ai-k { flex: 0 0 52px; color: var(--c-text-3); }
.ai-dr-body { padding: 12px 16px 24px; }

/* PromQL 魔法棒 */
.ai-magic-wrap { position: relative; display: block; flex: 1 1 auto; min-width: 0; }
.ai-magic-wrap > textarea, .ai-magic-wrap > input { width: 100%; box-sizing: border-box; padding-right: 34px !important; }
.ai-magic {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border: 1px solid #ddd6fe; background: #f5f3ff; color: #6d28d9;
  border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1;
}
.ai-magic:hover { background: #ede9fe; }
.ai-magic:disabled { opacity: .6; cursor: default; }
.ai-magic-tip { display: none; font-size: 11px; margin-top: 4px; color: var(--c-text-3); }
.ai-magic-tip.show { display: block; }
.ai-magic-tip.ok { color: #047857; }
.ai-magic-tip.warn { color: #b45309; }


/* —— 人工修改分析结果 —— */
.ai-edit { padding: 4px 0 2px; }
.ai-edit-t { font-size: 11px; color: var(--c-text-3); margin-bottom: 8px; }
.ai-edit label { display: block; font-size: 11px; color: var(--c-text-3); margin: 8px 0 3px; }
.ai-edit textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 7px 9px; font: inherit; font-size: 12px; line-height: 1.7; resize: vertical; min-height: 52px;
}
.ai-edit textarea:focus { border-color: #a78bfa; outline: none; }
.ai-edit-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* —— 欢迎区：问候 + 四张能力卡（一屏展示全）—— */
.ai-welcome { max-width: 880px; margin: 0 auto; padding: 4px 0; }
.ai-hello { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 26px 0 24px; }
.ai-hello-dot {
  display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border-radius: 12px; background: linear-gradient(135deg, #a78bfa, #4f46e5); color: #fff; font-size: 19px;
  box-shadow: 0 4px 12px rgba(79,70,229,.28);
}
.ai-hello-t { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.ai-hello-t b { color: #6d28d9; }
.ai-hello-s { font-size: 12px; color: var(--c-text-3); margin-top: 3px; }

.ai-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-cap {
  border: 1px solid var(--c-border); border-radius: 10px; padding: 12px 14px 10px; background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.ai-cap:hover { border-color: #ddd6fe; box-shadow: 0 2px 10px rgba(109,40,217,.06); }
.ai-cap-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.ai-cap-ico { font-size: 14px; }
.ai-cap-desc { font-size: 11px; color: var(--c-text-3); line-height: 1.6; margin: 5px 0 8px; }
.ai-srow {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin-top: 4px;
  background: var(--c-bg); border-radius: 6px; text-decoration: none; color: var(--c-text-2);
  font-size: 12px; line-height: 1.5;
}
.ai-srow:hover { background: #f5f3ff; color: #4c1d95; }
.ai-srow-t { flex: 1; min-width: 0; }
.ai-srow-go { color: transparent; font-size: 11px; }
.ai-srow:hover .ai-srow-go { color: #a78bfa; }
.ai-var { color: #7c3aed; }
.ai-welcome-tip { text-align: center; font-size: 11px; color: var(--c-text-3); margin-top: 14px; }

/* 小窗紧凑版：单列 */
.ai-welcome.compact { max-width: none; }
.ai-welcome.compact .ai-hello { margin: 6px 0 12px; gap: 10px; }
.ai-welcome.compact .ai-hello-dot { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
.ai-welcome.compact .ai-hello-t { font-size: 16px; }
.ai-welcome.compact .ai-caps { grid-template-columns: 1fr; gap: 8px; }
.ai-welcome.compact .ai-cap { padding: 9px 11px 8px; }
.ai-fab-box.max .ai-welcome .ai-caps { grid-template-columns: 1fr 1fr; }

/* —— 输入区（快捷添加 → 输入框内上下文卡片）—— */
.ai-composer { padding: 8px 0 0; }
.ctx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 2px 8px; }
.ctx-lead { font-size: 12px; color: var(--c-text-3); }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 300px;
  border: none; background: none; cursor: pointer; padding: 2px 0;
  font-size: 12px; color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx-chip:hover { color: var(--c-primary); }
.ctx-ico { color: var(--c-primary); }
.ctx-sub { color: var(--c-text); }
.ai-inputbox {
  border: 1px solid var(--c-border); border-radius: 10px; background: #fff; padding: 8px;
  transition: border-color .12s, box-shadow .12s;
}
.ai-inputbox:focus-within { border-color: #c4b5fd; box-shadow: 0 0 0 3px rgba(167,139,250,.14); }
.ctx-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ctx-card {
  display: flex; align-items: center; gap: 8px; max-width: 250px;
  background: var(--c-bg); border-radius: 8px; padding: 6px 8px; position: relative;
}
.ctx-card-ico { font-size: 14px; }
.ctx-card-txt { min-width: 0; }
.ctx-card-t { font-size: 11px; color: var(--c-text-3); line-height: 1.4; }
.ctx-card-s { font-size: 12px; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-card-x {
  position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-3);
  font-size: 9px; line-height: 1; cursor: pointer; display: none;
}
.ctx-card:hover .ctx-card-x { display: block; }
.ai-input {
  width: 100%; box-sizing: border-box; border: none; outline: none; font: inherit; font-size: 13px;
  line-height: 1.9; padding: 4px 4px 2px; background: none;
  min-height: 40px; max-height: 200px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.ai-input:empty::before { content: attr(data-ph); color: var(--c-text-3); }
/* 模板变量＝可直接输入的方框槽位（点示例后光标就落在第一个槽位里） */
.ai-slot {
  display: inline-block; min-width: 62px; padding: 1px 8px; margin: 0 2px;
  border: 1px solid var(--c-primary); border-radius: 5px; background: var(--c-primary-bg);
  color: var(--c-primary); outline: none; text-align: center;
}
.ai-slot:empty::before { content: attr(data-ph); color: #a5b4fc; }
.ai-slot:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.ai-input-foot { display: flex; align-items: center; padding-top: 4px; }
.ai-attach-wrap { position: relative; }
.ai-attach {
  width: 28px; height: 28px; border: none; border-radius: 7px; background: none; cursor: pointer;
  color: var(--c-text-3); font-size: 20px; line-height: 1; padding: 0 0 2px;
}
.ai-attach:hover, .ai-attach[aria-expanded="true"] { color: var(--c-primary); background: var(--c-primary-bg); }
.ai-attach-menu {
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 20; width: 238px; padding: 5px;
  border: 1px solid var(--c-border); border-radius: 9px; background: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.16);
}
.ai-attach-menu[hidden] { display: none; }
.ai-attach-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none;
  border-radius: 6px; background: none; color: var(--c-text); text-align: left; cursor: pointer;
}
.ai-attach-menu button:hover { background: var(--c-bg); }
.ai-attach-menu-ico {
  display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 7px;
  background: var(--c-primary-bg); color: var(--c-primary); font-size: 16px;
}
.ai-attach-menu b { display: block; font-size: 12px; font-weight: 500; line-height: 1.5; }
.ai-attach-menu small { display: block; margin-top: 1px; color: var(--c-text-3); font-size: 10px; white-space: nowrap; }
.ai-attachment-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 4px 6px; }
.ai-attachment-card {
  position: relative; display: flex; align-items: center; gap: 7px; min-width: 145px; max-width: 235px;
  padding: 5px 24px 5px 6px; border: 1px solid var(--c-border); border-radius: 7px; background: var(--c-bg);
}
.ai-attachment-card > img { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; background: #fff; }
.ai-attachment-file-ico { display: grid; place-items: center; width: 34px; height: 34px; color: var(--c-primary); font-size: 19px; }
.ai-attachment-meta { min-width: 0; }
.ai-attachment-meta b, .ai-attachment-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-attachment-meta b { color: var(--c-text); font-size: 11px; font-weight: 500; }
.ai-attachment-meta small { margin-top: 2px; color: var(--c-text-3); font-size: 9px; }
.ai-attachment-card > button {
  position: absolute; top: 4px; right: 4px; border: none; background: none; color: var(--c-text-3);
  font-size: 9px; cursor: pointer;
}
.ai-attachment-card > button:hover { color: var(--c-red); }
.ai-attachment-notice { margin: 0 4px 5px; color: var(--c-text-3); font-size: 10px; }
.ai-attachment-notice.loading { color: var(--c-primary); }
.ai-attachment-notice.error { color: var(--c-red); }

/* 当前页面区域截图：拖拽框选，确认后附加到输入框 */
.ai-screen-selecting { user-select: none !important; }
.ai-screen-selecting .ai-fab-box { visibility: hidden; }
.ai-screen-crop {
  position: fixed; inset: 0; z-index: 10000; overflow: hidden; cursor: crosshair;
  touch-action: none; background: transparent;
}
.ai-screen-crop.empty { background: rgba(15,23,42,.48); }
.ai-screen-crop.capturing { visibility: hidden; }
.ai-screen-crop-selection {
  position: fixed; z-index: 1; box-sizing: border-box; border: 2px solid #6366f1; cursor: move;
  background: transparent; box-shadow: 0 0 0 9999px rgba(15,23,42,.48);
}
.ai-screen-crop-selection [data-crop-handle] {
  position: absolute; z-index: 2; width: 10px; height: 10px; box-sizing: border-box;
  border: 1px solid #4f46e5; background: #fff;
}
.ai-screen-crop-selection .nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ai-screen-crop-selection .ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ai-screen-crop-selection .sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ai-screen-crop-selection .se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ai-screen-crop-size {
  position: absolute; right: 5px; bottom: 5px; padding: 2px 6px; border-radius: 3px;
  background: rgba(15,23,42,.86); color: #fff; font-size: 10px; white-space: nowrap; pointer-events: none;
}
.ai-screen-crop-actions {
  position: fixed; z-index: 3; display: flex; gap: 8px;
  padding: 7px; border-radius: 9px; background: #fff;
  box-shadow: 0 8px 26px rgba(15,23,42,.3); cursor: default;
}
.ai-screen-crop-actions[hidden] { display: none; }
.ai-screen-crop-actions button {
  min-width: 68px; padding: 7px 12px; border: 1px solid var(--c-border); border-radius: 6px;
  background: #fff; color: var(--c-text-2); font-size: 12px; cursor: pointer;
}
.ai-screen-crop-actions button:hover { border-color: #a5b4fc; color: var(--c-primary); }
.ai-screen-crop-actions button.primary { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }
.ai-screen-crop-actions button.primary:hover { background: var(--c-primary-hover); color: #fff; }
.ai-screen-crop-actions button:disabled { opacity: .65; cursor: wait; }

.ai-send {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--c-primary); color: #fff; font-size: 15px; line-height: 1;
}
.ai-send:hover { background: var(--c-primary-hover); }

/* —— 消息 —— */
.ai-msg, .asst-msg { font-size: 13px; line-height: 1.75; padding: 9px 12px; border-radius: 8px; margin-bottom: 10px; }
.ai-msg.me, .asst-msg.me { background: var(--c-primary-bg); color: #3730a3; margin-left: auto; width: fit-content; max-width: 80%; }
.ai-msg.bot, .asst-msg.bot { background: var(--c-bg); border: 1px solid var(--c-border); max-width: 820px; }
.ai-msg.pending, .asst-msg.pending { color: var(--c-text-3); }
.ai-msg-ctx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-msg-ctx span { font-size: 10px; background: #fff; border: 1px solid #c7d2fe; color: #4f46e5; border-radius: 3px; padding: 0 5px; }
.ai-msg-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.ai-msg-file {
  display: flex; align-items: center; gap: 5px; max-width: 190px; padding: 5px 7px;
  border: 1px solid #c7d2fe; border-radius: 6px; background: rgba(255,255,255,.75);
}
.ai-msg-file.image { display: block; padding: 4px; }
.ai-msg-file img { display: block; width: 120px; height: 72px; border-radius: 4px; object-fit: cover; }
.ai-msg-file small { display: block; overflow: hidden; color: #4f46e5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ai-msg-file.image small { max-width: 120px; padding: 3px 2px 0; }
.ai-src { margin-top: 6px; font-size: 11px; color: var(--c-text-3); }
.ai-actbar { display: flex; gap: 8px; margin-top: 10px; }
.asst-fork-t { font-size: 11px; color: var(--c-text-3); margin-bottom: 6px; }

/* —— 悬浮助手 —— */
.ai-fab-box { position: fixed; right: 22px; bottom: 22px; z-index: 1100; }
.ai-fab {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; font-size: 19px;
  box-shadow: 0 6px 18px rgba(79,70,229,.4);
}
.ai-mini[hidden] { display: none; }
.ai-mini {
  position: absolute; right: 0; bottom: 58px; width: 380px; height: 500px;
  background: #fff; border: 1px solid var(--c-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16); display: flex; flex-direction: column; overflow: hidden;
}
.ai-fab-box.max .ai-mini { width: 78vw; max-width: 900px; height: 82vh; }
.ai-mini-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-border); }
.ai-mini-max { margin-left: auto; }
.ai-mini-max, .ai-mini-close { border: none; background: none; cursor: pointer; color: var(--c-text-3); font-size: 13px; }
.ai-mini-max:hover, .ai-mini-close:hover { color: var(--c-text); }
.ai-mini-body { flex: 1; overflow: auto; padding: 10px 14px; }
.ai-mini .ai-composer { padding: 0 12px 12px; }
.ai-mini .ai-hello { font-size: 18px; margin: 8px 0 14px; }
.ai-mini .ai-hello-dot { width: 26px; height: 26px; font-size: 13px; vertical-align: -4px; }
.ai-mini .ai-srow { padding: 8px 10px; font-size: 12px; }
.ai-fab-box.max .ai-mini .ai-hello { font-size: 24px; }

/* —— 助手页 —— */
.asst-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 14px; align-items: start; }
.asst-side { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 8px; padding: 10px; position: sticky; top: 12px; }
.asst-side-head { display: flex; align-items: center; font-size: 12px; color: var(--c-text-3); margin-bottom: 8px; }
.asst-new { margin-left: auto; font-size: 11px; border: 1px solid var(--c-border); background: #fff; border-radius: 4px; padding: 2px 7px; cursor: pointer; }
.asst-sess {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 6px;
  font-size: 12px; color: var(--c-text-2); margin-bottom: 3px; cursor: pointer;
}
.asst-sess:hover { background: var(--c-bg); }
.asst-sess.active { background: var(--c-primary-bg); color: var(--c-primary); }
.asst-sess-section { margin-bottom: 12px; }
.asst-sess-section-t { display: flex; align-items: center; padding: 2px 5px 6px; font-size: 11px; color: var(--c-text-3); }
.asst-sess-section-t span { margin-left: auto; font-size: 10px; color: #9ca3af; }
.asst-sess-main { min-width: 0; flex: 1; }
.asst-sess-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-sess-clock { display: inline-block; margin-right: 5px; color: #047857; font-size: 13px; vertical-align: -1px; }
.asst-sess-platform { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; background: #ede9fe; color: #6d28d9; font-size: 9px; vertical-align: 1px; }
.asst-sess-time { display: block; font-size: 10px; color: var(--c-text-3); margin-top: 2px; }
.asst-sess-ops { display: none; gap: 2px; }
.asst-sess:hover .asst-sess-ops { display: flex; }
.asst-sess-ops button {
  border: none; background: none; cursor: pointer; color: var(--c-text-3);
  font-size: 11px; line-height: 1; padding: 3px 4px; border-radius: 3px;
}
.asst-sess-ops button:hover { background: #fff; color: var(--c-primary); }
.asst-sess-ops button[data-sop="del"]:hover { color: var(--c-red); }
.asst-sess-empty { font-size: 11px; color: var(--c-text-3); padding: 10px 4px; }
.sess-del-modal { width: 460px; }
.sess-del-modal .ai-modal-body { padding-top: 16px; padding-bottom: 16px; }
.sess-del-copy { color: var(--c-text-2); font-size: 13px; line-height: 1.7; }
.ai-modal-body .sess-del-option { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; color: var(--c-text); font-size: 12px; cursor: pointer; }
.sess-del-option input { width: auto !important; margin: 0; }
.asst-main { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 8px; display: flex; flex-direction: column; height: calc(100vh - 76px); min-height: 520px; }
.asst-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--c-border); overflow: visible; }
#asst-title { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; }
.asst-body { flex: 1; overflow: auto; padding: 16px 20px; }
.asst-foot { padding: 0 20px 14px; }
.asst-foot .ai-composer { max-width: 860px; margin: 0 auto; }
@media (max-width: 1100px) { .asst-layout { grid-template-columns: minmax(0, 1fr); } .asst-side { position: static; } }

/* fork 到悬浮窗继续讨论时带入的分析结果 */
.ai-fork { border: 1px solid #ddd6fe; background: #fbfaff; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.ai-fork-t { font-size: 11px; color: var(--c-text-3); margin-bottom: 6px; }

/* 悬浮助手最大化＝铺满浏览器窗口 */
.ai-fab-box.max .ai-fab { display: none; }
.ai-fab-box.max .ai-mini {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none;
  border-radius: 0; border: none;
}
.ai-fab-box.max .ai-mini-body { max-width: 900px; margin: 0 auto; width: 100%; padding: 16px 20px; }
.ai-fab-box.max .ai-composer { max-width: 900px; margin: 0 auto; width: 100%; }

/* fork 带入的分析对象身份信息 */
.ai-fork-meta { display: grid; gap: 2px; margin-bottom: 8px; font-size: 12px; }
.ai-fork-meta > div { display: flex; gap: 8px; color: var(--c-text-2); }
.ai-fork-meta span { flex: 0 0 60px; color: var(--c-text-3); }

/* 悬浮助手内的历史对话面板 */
.ai-mini-wrap { flex: 1; position: relative; overflow: hidden; display: flex; }
.ai-mini-wrap .ai-mini-body { flex: 1; }
.ai-mini-hist-panel {
  position: absolute; inset: 0; background: #fff; overflow: auto; padding: 10px 12px;
  border-top: 1px solid var(--c-border);
}
.ai-mini-hist-head { display: flex; align-items: center; font-size: 12px; color: var(--c-text-3); margin-bottom: 8px; }
.ai-mini-hist-new { margin-left: auto; font-size: 11px; border: 1px solid var(--c-border); background: #fff; border-radius: 4px; padding: 2px 7px; cursor: pointer; }
.ai-mini-hist { border: none; background: none; cursor: pointer; color: var(--c-text-3); font-size: 13px; margin-left: auto; }
.ai-mini-max { margin-left: 0 !important; }

/* 动态基线（v14，业务能力指标卡） */
.mc-baseline { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 4px; }
.bl-chip {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; white-space: nowrap;
  background: #ede9fe; color: #6d28d9;
}
.bl-chip.bad { background: var(--c-red-bg); color: var(--c-red); }
.bl-note { font-size: 11px; color: var(--c-text-3); line-height: 1.5; }

/* 分析结果过期提醒：告警有更新 / 距上次生成太久 */
.ai-stale {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 2px;
  padding: 7px 10px; border-radius: 6px; font-size: 12px; line-height: 1.5;
}
.ai-stale.warn { background: var(--c-yellow-bg); color: #92400e; border: 1px solid #fcd34d; }
.ai-stale.crit { background: var(--c-red-bg); color: #991b1b; border: 1px solid #fca5a5; }
.ai-stale-t { flex: 1; min-width: 0; }
.ai-stale .btn { flex: none; }

/* 助手：视图切换 + 定时任务 */
.asst-nav { display: grid; gap: 3px; margin-bottom: 10px; }
.asst-nav-item {
  text-align: left; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--c-text-2); padding: 7px 9px; border-radius: 6px;
}
.asst-nav-item:hover { background: var(--c-bg); }
.asst-nav-item.active { background: var(--c-primary-bg); color: var(--c-primary); font-weight: 500; }
.asst-tasks { flex: 1; overflow: auto; padding: 14px 20px 20px; }
.asst-tasks[hidden] { display: none; }
.ai-task-head { display: flex; align-items: center; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.ai-task-head .btn { margin-left: auto; }

/* 任务表单弹层 */
.ai-modal-wrap { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; }
.ai-modal-mask { position: absolute; inset: 0; background: rgba(15,23,42,.35); }
.ai-modal { position: relative; width: 520px; max-width: 94vw; background: #fff; border-radius: 10px; box-shadow: 0 16px 44px rgba(0,0,0,.2); }
.ai-modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--c-border); font-weight: 600; font-size: 14px; }
.ai-modal-x { margin-left: auto; border: none; background: none; cursor: pointer; color: var(--c-text-3); font-size: 14px; }
.ai-modal-body { padding: 14px 18px; max-height: 62vh; overflow: auto; }
.ai-modal-body label { display: block; font-size: 12px; color: var(--c-text-2); margin: 10px 0 4px; }
.ai-modal-body input[type=text], .ai-modal-body input:not([type]), .ai-modal-body input[type=number],
.ai-modal-body input[type=time], .ai-modal-body select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 7px 9px; font: inherit; font-size: 13px; background: #fff;
}
.ai-modal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-modal-inline { display: flex !important; align-items: center; gap: 6px; margin-top: 14px !important; }
.ai-modal-inline input { width: auto !important; }
.ai-modal-note { font-size: 11px; color: var(--c-text-3); margin-top: 12px; }
.ai-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--c-border); }

/* 指标卡上的 AI 入口 */
.metric-card { position: relative; }
.mc-ai {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; z-index: 2;
  border: 1px solid #ddd6fe; background: #f5f3ff; color: #6d28d9;
  border-radius: 5px; cursor: pointer; font-size: 12px; line-height: 1;
  opacity: 0; transition: opacity .12s;
}
.metric-card:hover .mc-ai { opacity: 1; }
.mc-ai:hover { background: #ede9fe; }
.ai-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chip2 {
  font-size: 11px; border: 1px solid var(--c-border); background: #fff; border-radius: 12px;
  padding: 3px 10px; color: var(--c-text-2); text-decoration: none;
}
.ai-chip2:hover { border-color: #a78bfa; color: #6d28d9; }

/* 定时任务：单选触发、动态周期、规则多选与历史对话 */
.tk-prompt { font-size: 11px; color: var(--c-text-3); line-height: 1.5; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hk-chip { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 3px; margin: 1px 2px 1px 0;
  background: var(--c-primary-bg); color: var(--c-primary); }
.hk-chip.alert { background: var(--c-red-bg); color: var(--c-red); }
.hk-chip.cron { background: var(--c-green-bg); color: #047857; }
.lb-hint { font-weight: normal; color: var(--c-text-3); font-size: 11px; margin-left: 8px; }
.ai-modal-body textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 7px 9px; font: inherit; font-size: 12px; line-height: 1.7; resize: vertical;
}
.ai-modal-body textarea:disabled {
  background: var(--c-bg); color: var(--c-text-2); cursor: not-allowed; resize: none; opacity: 1;
}
.tk-form-modal { width: 680px; }
.tk-form-modal .ai-modal-body { max-height: 70vh; padding: 4px 20px 16px; }
.tk-form-sec { padding: 12px 0 14px; border-bottom: 1px solid var(--c-border); }
.tk-form-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.tk-sec-t { font-size: 12px; font-weight: 600; margin: 0 0 9px; color: var(--c-text); }
.tk-trigger-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tk-trigger-card { display: flex !important; align-items: flex-start; gap: 8px; margin: 0 !important; padding: 10px;
  border: 1px solid var(--c-border); border-radius: 7px; cursor: pointer; background: #fff; }
.tk-trigger-card:hover { border-color: #a78bfa; }
.tk-trigger-card.active { border-color: var(--c-primary); background: var(--c-primary-bg); box-shadow: 0 0 0 1px rgba(99,102,241,.08); }
.tk-trigger-card input { width: auto !important; margin-top: 2px; }
.tk-trigger-card span { display: grid; gap: 3px; }
.tk-trigger-card b { font-size: 12px; color: var(--c-text); font-weight: 600; }
.tk-trigger-card small { font-size: 10px; line-height: 1.4; color: var(--c-text-3); }
.tk-trigger-panel { margin-top: 10px; padding: 10px 12px 12px; border-radius: 7px; background: var(--c-bg); }
.tk-trigger-panel[hidden], [data-cycle][hidden], [data-alert-levels][hidden], .tk-rule-scope[hidden], [data-rule-label][hidden] { display: none; }
.tk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tk-inline { display: inline-flex !important; align-items: center; gap: 5px; font-size: 12px; margin: 7px 0 0 !important; color: var(--c-text-2) !important; cursor: pointer; }
.tk-inline input { width: auto !important; }
.tk-alert-mode { margin-top: 7px; padding: 8px 9px; border: 1px solid var(--c-border); border-radius: 6px; background: #fff; }
.tk-alert-mode-h { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; color: var(--c-text) !important; cursor: pointer; }
.tk-alert-mode-h input { width: auto !important; }
.tk-alert-target-row { display: flex; align-items: center; gap: 24px; }
.tk-alert-target-row label { display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; color: var(--c-text); cursor: pointer; }
.tk-alert-target-row input { width: 14px !important; height: 14px; margin: 0; accent-color: var(--c-primary); }
.tk-alert-choice { margin-top: 10px; }
.tk-alert-choice .tk-picker { margin-top: 0; }
.tk-alert-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tk-alert-levels label { margin: 0 !important; cursor: pointer; }
.tk-alert-levels input { position: absolute; opacity: 0; pointer-events: none; }
.tk-alert-levels span { display: inline-flex; padding: 5px 9px; border: 1px solid var(--c-border); border-radius: 5px; background: #fff; color: var(--c-text-2); font-size: 11px; }
.tk-alert-levels input:checked + span { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-bg); }
.tk-alert-mode .tk-rule-scope { margin: 7px 0 0 21px; }
.tk-update-option { margin-top: 11px !important; }
.tk-field-help { font-size: 11px; color: var(--c-text-3); margin-top: 5px; line-height: 1.5; }
.tk-schedule-row { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.tk-schedule-field { min-width: 0; }
.tk-schedule-field > label { margin: 0 0 4px; }
.tk-schedule-mode { flex: 0 0 132px; }
.tk-cycle-fields { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.tk-cycle-fields.weekly { flex: 1; }
.tk-cycle-fields.monthly .tk-unit-input { width: 112px; }
.tk-schedule-weekdays { flex: 1; }
.tk-schedule-time { flex: 0 0 112px; }
.tk-schedule-row select, .tk-schedule-row input[type="number"], .tk-schedule-row input[type="time"] { height: 34px; }
.tk-unit-input { display: flex; align-items: stretch; width: 180px; height: 34px; }
.tk-unit-input input { min-width: 0; height: 34px; border-radius: 6px 0 0 6px !important; }
.tk-unit-input span { display: flex; flex: none; align-items: center; min-width: 44px; box-sizing: border-box; padding: 0 10px; white-space: nowrap; font-size: 12px; color: var(--c-text-2);
  background: #f8fafc; border: 1px solid var(--c-border); border-left: 0; border-radius: 0 6px 6px 0; }
.tk-weekdays { display: flex; gap: 6px; }
.tk-weekdays label { margin: 0 !important; cursor: pointer; }
.tk-weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.tk-weekdays span { display: grid; place-items: center; box-sizing: border-box; width: 30px; height: 34px; border: 1px solid var(--c-border); border-radius: 5px; background: #fff; }
.tk-weekdays input:checked + span { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-bg); }
.tk-picker { margin-top: 8px; border: 1px solid var(--c-border); border-radius: 6px; background: #fff; }
.tk-picker summary { display: flex; align-items: center; padding: 8px 10px; cursor: pointer; font-size: 12px; color: var(--c-text-2); list-style: none; }
.tk-picker summary::-webkit-details-marker { display: none; }
.tk-picker summary::after { content: '⌄'; margin-left: 8px; color: var(--c-text-3); }
.tk-picker summary span { margin-left: auto; padding: 1px 6px; border-radius: 3px; background: var(--c-primary-bg); color: var(--c-primary); font-size: 10px; }
.tk-picker-pop { padding: 8px; border-top: 1px solid var(--c-border); }
.tk-picker-pop > input { margin-bottom: 7px; }
.tk-rule-list { display: grid; grid-template-columns: 1fr; gap: 3px; max-height: 190px; overflow: auto; }
.tk-rule-list label { display: flex !important; align-items: flex-start; gap: 7px; margin: 0 !important; padding: 6px 7px; border-radius: 5px; cursor: pointer; }
.tk-rule-list label:hover { background: var(--c-bg); }
.tk-rule-list input { width: auto !important; margin-top: 2px; }
.tk-rule-list span { font-size: 11px; color: var(--c-text); }
.tk-channel-row { display: flex; align-items: center; gap: 22px; }
.tk-channel-row label { display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; color: var(--c-text-2); cursor: pointer; }
.tk-channel-row input { width: 14px !important; height: 14px; margin: 0; accent-color: var(--c-primary); }
.tk-channel-row span { font-size: 12px; }
.tk-ops { white-space: nowrap; }
.tk-runs-drawer .drawer-panel { width: 680px; }
.tk-runs-sub { margin-top: 3px; color: var(--c-text-3); font-size: 11px; font-weight: normal; }
.tk-run-record-list { display: grid; gap: 12px; }
.tk-run-record { padding: 13px 14px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
.tk-run-record-head { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-size: 12px; }
.tk-run-record-view { margin-left: auto; color: var(--c-primary); }
.tk-run-record-action { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--c-text-2); font-size: 12px; }
.tk-run-record-action .sev { flex: none; }
.tk-run-record-action .sev.ok { background: var(--c-green-bg); color: var(--c-green); }
.tk-run-record-action a { color: var(--c-primary); }
.tk-task-session { max-width: 860px; min-height: 100%; margin: 0 auto; }
.tk-run-main { min-width: 0; }
.tk-title-history { position: relative; display: flex; align-items: center; margin-left: auto; }
.tk-title-history > button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--c-text-2); cursor: pointer; font-size: 15px; }
.tk-title-history > button:hover { background: var(--c-bg); color: var(--c-primary); }
.tk-title-history-pop { display: none; position: absolute; z-index: 50; top: 24px; right: 0; width: 240px; padding: 7px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(15,23,42,.14); }
.tk-title-history:hover .tk-title-history-pop, .tk-title-history:focus-within .tk-title-history-pop { display: block; }
.tk-title-history-head { display: flex; justify-content: space-between; padding: 5px 6px 7px; font-size: 11px; color: var(--c-text); }
.tk-title-history-head span { color: var(--c-text-3); font-weight: normal; }
.tk-title-history-pop > button { display: grid; width: 100%; gap: 2px; padding: 7px 8px; border: 0; border-radius: 5px; background: none; text-align: left; color: var(--c-text-2); cursor: pointer; }
.tk-title-history-pop > button:hover { background: var(--c-bg); }
.tk-title-history-pop > button.active { color: var(--c-primary); background: var(--c-primary-bg); }
.tk-title-history-pop > button span { font-size: 11px; }
.tk-title-history-pop > button small { font-size: 10px; color: var(--c-text-3); }
.tk-chat-run { margin: 0 0 14px; }
.tk-tool-call {
  display: flex; align-items: center; gap: 8px; max-width: 100%; margin: 0 0 14px;
  padding: 7px 9px; border: 1px solid var(--c-border); border-radius: 6px;
  background: #f8fafc; color: var(--c-text-2); font: inherit; text-align: left; cursor: pointer;
}
.tk-tool-call:hover { border-color: #c4b5fd; background: var(--c-primary-bg); }
.tk-tool-call-ico {
  display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 4px;
  background: #ede9fe; color: #6d28d9; font-size: 10px; font-weight: 700;
}
.tk-tool-call-title { flex: none; color: var(--c-text); font-size: 11px; font-weight: 500; }
.tk-tool-call small { overflow: hidden; color: var(--c-text-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tk-tool-call-arrow { flex: none; margin-left: 2px; color: var(--c-text-3); font-size: 15px; }
.tk-tool-call:hover .tk-tool-call-arrow { color: var(--c-primary); }
.tk-task-reply { margin-bottom: 10px !important; }
.tk-task-reply small { display: block; margin-top: 7px; padding-top: 5px; border-top: 1px dashed var(--c-border); color: var(--c-text-3); font-size: 10px; }
.tk-send-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #bbf7d0; border-radius: 6px; background: #f0fdf4; color: #047857; font-size: 11px; }
.tk-send-result b { white-space: nowrap; }
.tk-send-result.failed { color: #991b1b; border-color: #fca5a5; background: var(--c-red-bg); }
.tk-runs-modal { width: 720px; }
.tk-run-summary { margin-bottom: 12px; color: var(--c-text-2); font-size: 12px; }
.tk-run-table { table-layout: fixed; }
.tk-run-table th:nth-child(1) { width: 160px; }
.tk-run-table th:nth-child(2) { width: 90px; }
.tk-run-table th:nth-child(4) { width: 90px; }
.tk-run-table .sev { white-space: nowrap; }
.tk-empty { padding: 42px; text-align: center; color: var(--c-text-3); }
@media (max-width: 760px) {
  .tk-trigger-grid, .tk-rule-list { grid-template-columns: 1fr; }
  .tk-form-modal, .tk-runs-modal { width: 94vw; }
  .tk-schedule-row, .tk-cycle-fields { flex-wrap: wrap; }
}

/* 定时任务详情 */
.tk-detail-head .page-title { display: flex; align-items: center; gap: 8px; }
.tk-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.tk-detail-grid > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--c-border); font-size: 12px; }
.tk-detail-grid span { color: var(--c-text-3); }
.tk-detail-grid b { color: var(--c-text); font-weight: 500; line-height: 1.6; }
.tk-detail-prompt { margin: 0; padding: 13px 15px; border: 1px solid var(--c-border); border-radius: 7px; background: var(--c-bg);
  color: var(--c-text); font: 12px/1.8 ui-monospace, 'SF Mono', Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.tk-detail-runs th:first-child { width: 180px; }
.tk-detail-runs th:nth-child(2) { width: 110px; }
.tk-detail-runs th:nth-child(3) { width: 130px; }
.tk-detail-runs th:last-child { width: 100px; }
@media (max-width: 760px) { .tk-detail-grid { grid-template-columns: 1fr; } }

/* 定时任务：平台/个人分组、写回与只读提示 */
.tk-group-t { display: flex; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.tk-group-t.personal { margin-top: 50px; }
.tk-group-t span { font-weight: normal; font-size: 11px; color: var(--c-text-3); }
.tk-group-t .btn { margin-left: auto; }
.tk-tag { display: inline-block; margin-left: 6px; font-size: 10px; padding: 1px 6px; border-radius: 3px; background: #ede9fe; color: #6d28d9; }
.tk-written { display: flex; gap: 10px; font-size: 12px; margin-top: 8px; color: var(--c-text-2); }
.tk-written b { flex: 0 0 56px; color: var(--c-text-3); font-weight: normal; }
.tk-readonly {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px;
  background: var(--c-bg); border: 1px dashed var(--c-border); border-radius: 6px;
  font-size: 12px; color: var(--c-text-3);
}
.tk-readonly span { flex: 1; }
.ai-origin { font-size: 11px; color: #6d28d9; background: #ede9fe; padding: 1px 7px; border-radius: 3px; }

/* ===== 告警记录 · 按规则聚合（v16）=================================
   一行 = 一条告警规则；级别不参与聚合，同行逐级标条数。
   明细走通用 .drawer-* 抽屉，列表本身不承载展开态。
   =================================================================== */
.agg-row { cursor: pointer; }
.agg-row:hover > td { background: #f5f7ff; }
.agg-row .agg-name { font-weight: 600; color: var(--c-primary); }
.agg-row:hover .agg-name { text-decoration: underline; }

/* 分栏视图：左侧按告警名称导航，右侧保留完整明细操作。 */
.alert-split {
  display: flex;
  height: calc(100vh - 310px);
  min-height: 520px;
  max-height: 720px;
  overflow: hidden;
}
.alert-split-nav {
  flex: 0 0 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
  border-right: 1px solid var(--c-border);
}
.alert-split-nav-title {
  flex: none;
  padding: 13px 16px 10px;
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 600;
}
.alert-split-groups { overflow-y: auto; padding-bottom: 8px; }
.alert-split-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}
.alert-split-item:hover { background: #f2f4ff; }
.alert-split-item.active {
  border-left-color: var(--c-primary);
  background: #e9edff;
  color: var(--c-primary);
  font-weight: 600;
}
.alert-split-name {
  min-width: 0;
  flex: 1;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.alert-split-count {
  flex: none;
  min-width: 32px;
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}
.alert-split-item.active .alert-split-count { color: var(--c-primary); }
.alert-split-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.alert-split-header {
  flex: none;
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
}
.alert-split-title {
  max-width: 100%;
  margin: 0 0 3px;
  overflow-wrap: anywhere;
  color: var(--c-text);
  font-size: 15px;
  line-height: 22px;
}
.alert-split-list { min-height: 0; flex: 1; overflow: auto; }
.alert-split-list .table { min-width: 900px; }
.alert-split-list .table th { position: sticky; top: 0; z-index: 1; background: #fafbfc; }
.alert-split-list .table td { vertical-align: top; }
.split-row-name {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.split-row-ops { white-space: nowrap; }

/* 明细抽屉：比默认 560px 宽，放得下 6 列明细表 */
.alert-detail-drawer .drawer-panel { width: 860px; }
.alert-detail-drawer .drawer-body { padding: 0; }
.alert-detail-drawer .drawer-body .table th { position: sticky; top: 0; z-index: 1; }

/* === v17 中间件监控引擎页签上的实例数：(n) 纯文本，不做角标 === */
.tab-count {
  margin-left: 3px;
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 400;
}
.tab.active .tab-count { color: var(--c-primary); }

/* 分栏排行卡的头：窄栏里标题 + 口径一行、指标页签另起一行，避免互相挤成两行断字 */
.top5-table-head.rd-head { flex-wrap: wrap; }
.top5-table-head.rd-head .top5-card-tabs {
  flex-basis: 100%;
  justify-content: flex-start;
  margin-top: 2px;
}

/* === v17 中间件监控：引擎页签下的实例下拉条 === */
.mw-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 14px;
}
.mw-picker-label { font-size: 12px; color: var(--c-text-3); }
.mw-picker select {
  min-width: 260px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: #fff;
  color: var(--c-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mw-picker select:hover { border-color: var(--c-primary); }
.mw-picker-count { font-size: 11px; color: var(--c-text-3); }
.mw-picker .mw-head-tags { margin: 0; }
.resource-monitor-picker { margin-top: -8px; }
.resource-monitor-picker select { min-width: 360px; }
.resource-monitor-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: -2px;
}

@media (max-width: 800px) {
  .resource-monitor-picker select { min-width: min(280px, 100%); }
  .resource-monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================== v19 资源监控大盘（承接夜莺「平台总览 + 平台监控」）=====================
   面板类型与旧大盘一致：barGauge 排行榜 / timeseries 趋势 / hexbin 概况 / table 表格。
   排行榜一律平铺成网格，不做页签切换。 */
.rd-anchors {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.rd-anchors a {
  padding: 4px 14px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-card);
  color: var(--c-text-2);
  font-size: 12px;
  text-decoration: none;
}
.rd-anchors a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.rd-anchor-note { margin-left: auto; font-size: 11px; color: var(--c-text-3); }

.rd-board { scroll-margin-top: 12px; }
.rd-board-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.rd-board:first-child .rd-board-title { margin-top: 0; }
.rd-board-sub { font-size: 11px; font-weight: 400; color: var(--c-text-3); }

/* 行分组：可折叠，与夜莺的 row 一致 */
.rd-row {
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-card);
  overflow: hidden;
}
.rd-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f9fafb;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.rd-row-caret { color: var(--c-text-3); font-size: 11px; transition: transform .15s; }
.rd-row:not(.open) .rd-row-caret { transform: rotate(-90deg); }
.rd-row:not(.open) .rd-row-body { display: none; }
.rd-row:not(.open) .rd-row-head { border-bottom: none; }
.rd-row-count { font-size: 11px; font-weight: 400; color: var(--c-text-3); }
.rd-row-note { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--c-text-3); }
.rd-row-body {
  display: grid;
  gap: 1px;
  background: var(--c-border);
}

.rd-panel { background: var(--c-card); padding: 10px 12px 12px; min-width: 0; }
.rd-panel.clickable { cursor: pointer; }
.rd-panel.clickable:hover { background: #fafbff; }
.rd-panel-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.rd-panel-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-panel-kind {
  flex: none;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--c-gray-bg);
  color: var(--c-text-3);
  font-size: 10px;
}
.rd-panel-body.is-chart { height: 190px; }

/* barGauge：横条 + 右侧数值，10 条全列，条长按占比 */
.bg-list { display: flex; flex-direction: column; gap: 3px; }
.bg-row {
  display: grid;
  grid-template-columns: minmax(88px, 38%) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.bg-label { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--c-text-2); text-decoration: none; }
a.bg-label:hover .bg-name { color: var(--c-primary); text-decoration: underline; }
.bg-rank {
  flex: none;
  width: 14px;
  color: var(--c-text-3);
  font-size: 10px;
  text-align: right;
}
.bg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-track { height: 12px; border-radius: 2px; background: #f3f4f6; overflow: hidden; }
.bg-fill { height: 100%; border-radius: 2px; background: var(--c-primary); }
.bg-fill.warn { background: var(--c-yellow); }
.bg-fill.crit { background: var(--c-red); }
.bg-val { flex: none; font-weight: 600; color: var(--c-text); font-variant-numeric: tabular-nums; }
.bg-val.warn { color: #b45309; }
.bg-val.crit { color: var(--c-red); }

/* hexbin：一个面板里几个数 */
.hex-wrap { display: flex; gap: 6px; }
.hex-cell {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 6px;
  background: var(--c-gray-bg);
  text-align: center;
}
.hex-cell.ok   { background: var(--c-green-bg); }
.hex-cell.warn { background: var(--c-yellow-bg); }
.hex-cell.crit { background: var(--c-red-bg); }
.hex-val { font-size: 20px; font-weight: 700; color: var(--c-text); line-height: 1.1; }
.hex-unit { font-size: 11px; font-weight: 500; color: var(--c-text-3); margin-left: 1px; }
.hex-lbl { margin-top: 2px; font-size: 11px; color: var(--c-text-2); }
.hex-cell.crit .hex-val { color: var(--c-red); }

@media (max-width: 1280px) {
  .rd-row-body { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 820px) {
  .rd-row-body { grid-template-columns: minmax(0, 1fr) !important; }
  .rd-panel { grid-column: span 1 !important; }
}

/* === v19.1 大盘概况横排卡：对齐平台总览「平台资源与服务概况」===
   一条横排、格子等宽带分隔线，格子可带环形；异常徽标由 JS 在 >0 时才渲染，无异常不占位。 */
.rd-ring {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.rd-ring-in {
  position: absolute;
  inset: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.rd-kpi-row {
  display: grid;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
}
.rd-kpi {
  /* 顶对齐：有的格子没有异常行，居中会让各格标签错位 */
  display: flex;
  align-items: flex-start;
  padding: 10px 14px;
  border-right: 1px solid var(--c-border);
  color: inherit;
  text-decoration: none;
}
.rd-kpi:last-child { border-right: none; }
a.rd-kpi:hover { background: #fafbff; }
.rd-kpi-ring-wrap { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rd-kpi-body { min-width: 0; }
.rd-kpi-lbl { font-size: 11px; color: var(--c-text-3); }
.rd-kpi-val { margin-top: 1px; font-size: 20px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.rd-kpi-val.crit { color: var(--c-red); }
.rd-kpi-unit { font-size: 11px; font-weight: 500; color: var(--c-text-3); margin-left: 1px; }
.rd-kpi-sub { margin-top: 1px; font-size: 11px; color: var(--c-text-2); white-space: nowrap; }
.rd-kpi-alert { margin-top: 1px; font-size: 11px; white-space: nowrap; }
.rd-kpi-alert a { text-decoration: none; }
.rd-kpi-breakdown {
  margin-top: 3px;
  color: var(--c-text-3);
  font-size: 10px;
  line-height: 1.5;
  white-space: normal;
}
.rd-kpi-breakdown b { color: var(--c-red); }

@media (max-width: 1100px) {
  .rd-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .rd-kpi { border-bottom: 1px solid var(--c-border); }
}
@media (max-width: 820px) {
  .rd-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
}

/* === v19.2 大盘信息架构：锚点带面板数 + 一键展开全部趋势 === */
.rd-anchors a { display: inline-flex; align-items: center; gap: 5px; }
.rd-anchor-n {
  padding: 0 5px;
  border-radius: 8px;
  background: var(--c-gray-bg);
  color: var(--c-text-3);
  font-size: 10px;
}
.rd-anchors a:hover .rd-anchor-n { background: var(--c-primary-bg); color: var(--c-primary); }
.rd-expand {
  padding: 4px 12px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-card);
  color: var(--c-text-2);
  font-size: 12px;
  cursor: pointer;
}
.rd-expand:hover { border-color: var(--c-primary); color: var(--c-primary); }
.rd-expand[data-all="1"] { border-color: var(--c-primary); background: var(--c-primary-bg); color: var(--c-primary); }
/* 段落说明：说清这一段回答什么问题 */
.rd-board-sub { font-size: 11px; font-weight: 400; color: var(--c-text-3); }
/* 折叠状态下行头更轻，避免一排灰条喧宾夺主 */
.rd-row:not(.open) .rd-row-head { background: var(--c-card); color: var(--c-text-2); }
.rd-row:not(.open) .rd-row-name { font-weight: 500; }
