/* ==========================================================================
 * 数据中心 CMDB 配置管理平台 · 样式
 * ========================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --line: #e6eaf2;
  --line-strong: #d7dded;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5f6d82;
  --faint: #7d8a9d;
  --primary: #3355d8;
  --primary-dark: #2440b3;
  --primary-soft: #eef2ff;
  --ok: #0f9d6e;
  --ok-soft: #e8f7f1;
  --warn: #c2740b;
  --warn-soft: #fdf3e2;
  --danger: #d92d20;
  --danger-soft: #feedea;
  --info: #0b7ea8;
  --info-soft: #e8f4fa;
  --sidebar: #0b1220;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -18px rgba(16, 24, 40, .28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd7e6; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------- 布局 ------------------------------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; position: sticky; top: 0; height: 100vh;
  transition: width .2s ease, flex-basis .2s ease;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0d1729 0%, #0b1220 46%, #080e1a 100%);
  color: #c3cfe4; z-index: 20;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 16px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { color: #fff; font-size: 15px; letter-spacing: .5px; }
.brand-txt span { font-size: 10.5px; color: #8ea1c1; letter-spacing: .2px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav::-webkit-scrollbar-thumb { background: #263450; border-color: #0b1220; }
.nav-group { margin: 14px 8px 6px; font-size: 10.5px; letter-spacing: 1.2px; color: #7a8cab; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0;
  border-radius: 9px; color: #b6c4dc; font-size: 13px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #e8eefb; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(51, 85, 216, .32), rgba(51, 85, 216, .12));
  color: #fff; border-color: rgba(99, 130, 255, .32);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: #5b7bff;
}
.nav-ext { margin-left: auto; font-size: 10.5px; color: #6f819f; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .09); color: #cdd8ee; font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-ext { margin-left: auto; font-size: 10.5px; color: #6f819f; }
.nav-badge { background: rgba(255, 255, 255, .18); color: #fff; }
.nav-badge.alert { background: rgba(217, 45, 32, .22); color: #ffb4ac; }

.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sync-card {
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px; padding: 10px 11px;
}
.sync-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #d5e0f2; }
.sync-meta { font-size: 10.5px; color: #7d8ea9; margin: 5px 0 7px; }
.sync-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.sync-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3ecf8e, #7ce0b3); }
.side-ver { font-size: 10px; color: #71829f; margin-top: 10px; text-align: center; letter-spacing: .3px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.crumb .sep { color: #c3cbdb; }
.nav-toggle {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer;
  transition: .15s;
}
.nav-toggle:hover { color: var(--primary); border-color: #c3d0fb; background: #f7f9ff; }
.nav-toggle.active { color: var(--primary); border-color: #c3d0fb; background: var(--primary-soft); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  background: #f4f6fb; border: 1px solid var(--line); border-radius: 9px; color: var(--muted);
  width: 290px;
}
.search-box input { border: 0; background: transparent; outline: none; font-size: 12.5px; width: 100%; color: var(--text); }
.search-box kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line-strong); color: var(--faint); background: #fff;
}
.top-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #3355d8, #5b7bff); color: #fff; font-size: 12px; font-weight: 600;
}
.view { flex: 1; padding: 20px 24px 44px; max-width: 1680px; width: 100%; }

/* ------------------------------- 通用 ------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.card-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h .ttl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-h .ttl b { font-size: 13.5px; }
.card-h .ttl span { font-size: 11.5px; color: var(--muted); }
.card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }

.grid { display: grid; gap: 14px; }
.grid > *, .split > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt14 { margin-top: 14px; }
.mt18 { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini { font-size: 11.5px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: 20px; font-size: 11px; line-height: 1; white-space: nowrap; font-weight: 500;
  border: 1px solid transparent;
}
.pill-ok { background: var(--ok-soft); color: #0a7a55; border-color: #cbeadb; }
.pill-warn { background: var(--warn-soft); color: #99590a; border-color: #f3e0c0; }
.pill-danger { background: var(--danger-soft); color: #b8231a; border-color: #f7cfc9; }
.pill-info { background: var(--info-soft); color: #0a6b8f; border-color: #cbe6f2; }
.pill-idle { background: #f2f4f9; color: #5e6b81; border-color: #e4e8f1; }
.pill-primary { background: var(--primary-soft); color: var(--primary); border-color: #d8e0fd; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 6px; background: #94a3b8; }
.dot-ok { background: #12b981; box-shadow: 0 0 0 3px rgba(18, 185, 129, .13); }
.dot-warn { background: #e49a20; box-shadow: 0 0 0 3px rgba(228, 154, 32, .14); }
.dot-danger { background: #e5483b; box-shadow: 0 0 0 3px rgba(229, 72, 59, .14); }
.dot-info { background: #3a8fd0; box-shadow: 0 0 0 3px rgba(58, 143, 208, .14); }
.dot-idle { background: #a8b4c6; }

.type-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.type-chip i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.btn {
  height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #b9c4d9; background: #fafbfe; color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--primary)); opacity: .85;
}
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi-top svg { width: 15px; height: 15px; color: var(--accent, var(--primary)); }
.kpi-v { display: flex; align-items: baseline; gap: 5px; margin: 8px 0 2px; }
.kpi-v b { font-size: 26px; font-weight: 660; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.kpi-v span { font-size: 12px; color: var(--muted); }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.kpi-delta { font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }
.kpi-hero { background: linear-gradient(135deg, #12225a 0%, #1b3179 55%, #23408f 100%); border: 0; color: #e8eefc; }
.kpi-hero .kpi-top, .kpi-hero .kpi-v span, .kpi-hero .mini { color: #a9bbe4; }
.kpi-hero .kpi-v b { color: #fff; }
.kpi-hero .kpi-top svg { color: #9db4ff; }

/* 表格 */
.tbl-wrap { overflow: auto; border-radius: 10px; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 2; background: #f8f9fd; color: #5b6982;
  font-weight: 600; font-size: 11.5px; text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .1px;
}
.tbl tbody td { padding: 9px 12px; border-bottom: 1px solid #f1f4fa; color: var(--text-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { background: #fff; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl tbody tr.sel-row { background: #f2f6ff; }
.tbl tbody tr.sel-row td { border-bottom-color: #e2e9fa; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { color: var(--text); font-weight: 550; }
.tbl-empty { padding: 30px; text-align: center; color: var(--faint); font-size: 12.5px; }
.tbl .name-link { color: var(--text); font-weight: 550; }
.tbl .name-link:hover { color: var(--primary); }

/* 过滤栏 */
.filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.filterbar .input {
  height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  font-size: 12.5px; outline: none; background: #fff; color: var(--text); min-width: 190px;
}
.filterbar .input:focus { border-color: #9db1ee; box-shadow: 0 0 0 3px rgba(51, 85, 216, .1); }
.filterbar select.input { min-width: 110px; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 26px; padding: 0 10px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; }
.chip:hover { border-color: #b9c4d9; }
.chip.on { background: var(--primary-soft); border-color: #c3d0fb; color: var(--primary); font-weight: 550; }
.filterbar .spacer { flex: 1; }
.result-count { font-size: 12px; color: var(--muted); }
.result-count b { color: var(--text); font-size: 13px; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 2px 0; }
.pager button {
  min-width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer;
}
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button[disabled] { opacity: .45; cursor: default; }
.pager .pg-info { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* 进度 / 分数 */
.meter { height: 6px; border-radius: 6px; background: #eef1f7; overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.meter.ok i { background: linear-gradient(90deg, #17b183, #59d3ab); }
.meter.warn i { background: linear-gradient(90deg, #e09b1f, #f2c15c); }
.meter.danger i { background: linear-gradient(90deg, #d9372a, #f08a7e); }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 图表 */
.spark { display: block; overflow: visible; }
.linechart { width: 100%; height: auto; }
.ax { font-size: 9.5px; fill: #6f7c90; }
.donut-v { font-size: 22px; font-weight: 660; fill: var(--text); }
.donut-l { font-size: 10px; fill: var(--muted); }
.ring-v { font-size: 17px; font-weight: 660; }
.gauge-v { font-size: 21px; font-weight: 660; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.legend-item i { width: 8px; height: 8px; border-radius: 2px; }
.legend-item b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.legend-item span.pctv { color: var(--muted); font-size: 11px; width: 40px; text-align: right; }
.chart-legend-row { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); }
.chart-legend-row i { width: 9px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* 进度条列表 */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 62px; align-items: center; gap: 10px; font-size: 12px; }
.bar-row .lbl { color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.bar-row .lbl i { width: 7px; height: 7px; border-radius: 2px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.bar-row .val small { color: var(--muted); }

/* 列表 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px;
  border-bottom: 1px solid #f1f4fa; cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #f9fbff; }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item .li-title { font-size: 12.5px; color: var(--text); font-weight: 550; }
.list-item .li-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.list-item .li-right { flex: 0 0 auto; text-align: right; }

/* 页头 */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; letter-spacing: -.3px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; max-width: 820px; line-height: 1.55; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 20px 0 10px; }
.section-title b { font-size: 13.5px; }
.section-title span { font-size: 11.5px; color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 属性表 */
.attr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid #f1f4fa; }
.attr-item { display: flex; gap: 14px; padding: 9px 12px; border-bottom: 1px solid #f1f4fa; font-size: 12.5px; }
.attr-item:nth-child(odd) { border-right: 1px solid #f1f4fa; }
.attr-k { flex: 0 0 118px; color: var(--muted); }
.attr-k em { color: var(--danger); font-style: normal; margin-left: 3px; }
.attr-v { color: var(--text); min-width: 0; word-break: break-all; }
.miss { color: #d97706; background: #fdf6e9; border: 1px dashed #f0d9a8; border-radius: 5px; padding: 0 6px; font-size: 11.5px; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #e9eef7; }
.tl-item { position: relative; padding: 0 0 16px 8px; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary);
}
.tl-item.done::before { background: var(--primary); }
.tl-item:last-child { padding-bottom: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); font-weight: 550; }
.tl-date { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.tl-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* 拓扑画布 */
.graph-wrap {
  position: relative; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(51, 85, 216, .32), transparent 70%),
    radial-gradient(600px 300px at 90% 110%, rgba(14, 165, 233, .16), transparent 70%),
    #0a1020;
  border: 1px solid #16233d;
}
.graph-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at 50% 45%, #000 40%, transparent 88%);
}
.graph-canvas { position: absolute; inset: 0; }
.graph-svg { display: block; width: 100%; height: 100%; touch-action: none; }
.gv-edge { stroke: #3d4d6c; stroke-width: 1.2; opacity: .75; }
.gv-edge-context { stroke-dasharray: 4 4; opacity: .42; }
.gv-edge-impact { stroke: #b5651d; stroke-width: 1.6; opacity: .85; }
.gv-edge.dim { opacity: .07; }
.gv-edge.hl { stroke: #ff9f43; opacity: .95; stroke-width: 1.9; }
.gv-node { cursor: pointer; }
.gv-halo { fill: transparent; stroke: transparent; stroke-width: 2; }
.gv-dot { stroke: rgba(255, 255, 255, .38); stroke-width: 1.1; }
.gv-node:hover .gv-dot { stroke: #fff; }
.gv-node.hl .gv-halo { fill: rgba(255, 159, 67, .14); stroke: rgba(255, 159, 67, .55); }
.gv-node.sel .gv-halo { fill: rgba(96, 165, 250, .16); stroke: #60a5fa; stroke-width: 2.4; }
.gv-node.dim { opacity: .18; }
.gv-label {
  font-size: 10px; fill: #c9d6ee; paint-order: stroke; stroke: #0a1020; stroke-width: 3px;
  stroke-linejoin: round; pointer-events: none; font-family: var(--font);
}
.gv-node.dim .gv-label { fill: #8fa0bf; }
.gv-node.no-label .gv-label { display: none; }
.gv-node.no-label:hover .gv-label, .gv-node.no-label.sel .gv-label { display: block; }
.graph-legend {
  position: absolute; left: 12px; bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 10.5px; color: #9fb0cd; background: rgba(8, 14, 28, .62); padding: 6px 10px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .07); max-width: calc(100% - 24px);
}
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.graph-legend i { width: 7px; height: 7px; border-radius: 50%; }
.graph-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.graph-tools button {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 18, 34, .78); color: #c8d5ec; cursor: pointer; font-size: 14px; line-height: 1;
}
.graph-tools button:hover { background: rgba(51, 85, 216, .55); color: #fff; }
.graph-hint {
  position: absolute; left: 12px; top: 12px; font-size: 10.5px; color: #8ea1c2;
  background: rgba(8, 14, 28, .6); padding: 5px 9px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .07);
}

/* 自动发现 */
.diff { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.diff-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-family: var(--mono); }
.diff-k { color: var(--muted); min-width: 84px; font-family: var(--font); }
.diff-old { color: #b23a30; background: #fdeeec; padding: 1px 6px; border-radius: 4px; text-decoration: line-through; }
.diff-new { color: #0d7a55; background: #e9f8f1; padding: 1px 6px; border-radius: 4px; }
.diff-arrow { color: var(--faint); }
.finding { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.finding + .finding { margin-top: 10px; }
.finding.new { border-left: 3px solid #12b981; }
.finding.changed { border-left: 3px solid #3355d8; }
.finding.offline { border-left: 3px solid #d97706; }
.finding.dup { border-left: 3px solid #d92d20; }
.finding-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.finding-head b { font-size: 13px; }
.finding-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.progress { height: 5px; border-radius: 5px; background: #eef1f7; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #3355d8, #6b8bff); border-radius: 5px; transition: width .5s; }
.task-method { font-size: 10.5px; padding: 1px 7px; border-radius: 4px; background: #eef2ff; color: var(--primary); font-family: var(--mono); }

/* 影响分析 */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.side-list { display: flex; flex-direction: column; gap: 2px; max-height: 720px; overflow-y: auto; }
.side-item {
  padding: 10px 12px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
}
.side-item:hover { background: #f7f9fe; }
.side-item.on { background: var(--primary-soft); border-color: #ccd8fb; }
.side-item .si-title { font-size: 12.5px; color: var(--text); font-weight: 550; display: flex; gap: 7px; align-items: flex-start; }
.side-item .si-sub { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.risk-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; color: #fff;
}
.impact-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.impact-num { font-size: 30px; font-weight: 680; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-mini { display: flex; flex-direction: column; gap: 2px; min-width: 84px; }
.stat-mini b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-mini span { font-size: 11px; color: var(--muted); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.impact-node { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 20px; background: #f5f7fc; border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
.impact-node i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.impact-node b { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.callout {
  border-radius: 10px; padding: 11px 13px; font-size: 12px; line-height: 1.6;
  background: #f7f9fe; border: 1px solid #e8edf9; color: var(--text-2);
}
.callout b { color: var(--text); }
.callout.warn { background: #fffaf0; border-color: #f5e3bd; }
.callout.danger { background: #fff5f4; border-color: #f8d3ce; }
.callout ul { margin: 5px 0 0; padding-left: 16px; }
.callout li { margin: 2px 0; }

/* 维保 */
.warranty-bar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.warranty-bar .progress { flex: 1; }
.warranty-bar span { color: var(--muted); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

/* 弹层 / 提示 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 16, 30, .45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.modal {
  width: 520px; max-width: 100%; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(8, 14, 28, .35);
}
.modal-head { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 14px; }
.modal-x { margin-left: auto; border: 0; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 16px 18px; max-height: 66vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 12px; color: var(--text-2); }
.form-row .input {
  height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  font-size: 12.5px; outline: none; width: 100%;
}
.form-row .input:focus { border-color: #9db1ee; box-shadow: 0 0 0 3px rgba(51, 85, 216, .1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

#toast { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; font-size: 12.5px; box-shadow: 0 12px 34px rgba(10, 16, 30, .16);
  animation: toast-in .22s ease-out; color: var(--text-2); max-width: 360px;
}
.toast.out { animation: toast-out .3s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* 详情页 */
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-title h1 { font-size: 21px; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--muted); }
.detail-meta b { color: var(--text-2); font-weight: 550; }
.detail-side { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.q-summary { display: flex; align-items: center; gap: 8px; }
.anchor-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.anchor-nav a { font-size: 12px; color: var(--muted); }
.anchor-nav a:hover { color: var(--primary); }

/* 网格化小卡 */
.mini-stat {
  display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border-radius: 10px;
  background: #f8fafd; border: 1px solid var(--line);
}
.mini-stat b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 11px; color: var(--muted); }
.mini-stat .meter { margin-top: 3px; }

.hero-band {
  background: linear-gradient(115deg, #0e1c3f 0%, #16295c 52%, #1c3673 100%);
  border-radius: 14px; padding: 18px 20px; color: #e9eefc; position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -26px rgba(14, 28, 63, .8);
}
.hero-band::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 88% 20%, rgba(99, 130, 255, .35), transparent 42%),
    radial-gradient(circle at 12% 120%, rgba(56, 189, 248, .22), transparent 45%);
  pointer-events: none;
}
.hero-band .hb-inner { position: relative; display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.hero-band .hb-title { font-size: 13px; color: #a8bce8; }
.hero-band .hb-v { font-size: 34px; font-weight: 680; letter-spacing: -1.2px; }
.hero-band .hb-sub { font-size: 11.5px; color: #9fb3dd; margin-top: 2px; }
.hero-band .hb-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 24px; margin-left: auto; }
.hero-band .hb-cell { min-width: 92px; }
.hero-band .hb-cell b { display: block; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hero-band .hb-cell span { font-size: 11px; color: #9fb3dd; }
.hero-band .hb-cell .mini-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); margin-top: 6px; overflow: hidden; }
.hero-band .hb-cell .mini-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7ce0b3, #3ecf8e); }

/* 空状态 */
.empty { padding: 44px 20px; text-align: center; color: var(--faint); font-size: 12.5px; }
.empty b { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 6px; }

/* 响应式 */
@media (max-width: 1420px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1240px) {
  .sidebar { width: 208px; flex-basis: 208px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 290px minmax(0, 1fr); }
  .search-box { width: 220px; }
}
@media (max-width: 1080px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .attr-grid { grid-template-columns: minmax(0, 1fr); }
  .attr-item:nth-child(odd) { border-right: 0; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .hero-band .hb-grid { grid-template-columns: repeat(2, auto); margin-left: 0; }
}
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; flex: 0 0 auto; height: auto;
    flex-direction: row; align-items: center; overflow-x: auto;
  }
  .brand { padding: 10px 12px; flex: 0 0 auto; }
  .brand-txt { display: none; }
  .nav { display: flex; flex: 1; overflow-x: auto; padding: 6px 8px; gap: 2px; }
  .nav-group { display: none; }
  .nav-item { padding: 6px 10px; white-space: nowrap; flex: 0 0 auto; }
  .nav-item .nav-ext { margin-left: auto; font-size: 10.5px; color: #6f819f; }
.nav-badge { display: none; }
  .nav-item.active::before { left: 50%; top: auto; bottom: -6px; transform: translateX(-50%); width: 16px; height: 2px; border-radius: 2px; }
  .side-foot { display: none; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .search-box { width: 100%; order: 3; }
  .view { padding: 14px 14px 40px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr) !important; }
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .attr-grid { grid-template-columns: minmax(0, 1fr); }
  .attr-item:nth-child(odd) { border-right: 0; }
  .hero-band .hb-grid { grid-template-columns: repeat(2, auto); margin-left: 0; }
  .page-head .head-actions { margin-left: 0; }
}

/* --------------------------- 架构视图 --------------------------- */
.arch-wrap {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; overflow: hidden;
}
.arch-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.arch-svg:active { cursor: grabbing; }
.arch-node { cursor: pointer; }
.arch-node .an-box { transition: stroke-opacity .15s, filter .15s; }
.arch-node:hover .an-box { stroke-opacity: .95; filter: drop-shadow(0 2px 6px rgba(16, 24, 40, .12)); }
.arch-node.sel .an-box { stroke: #3355d8 !important; stroke-opacity: 1 !important; stroke-width: 1.8; }
.arch-node.sel .an-halo { stroke: #3355d8; stroke-opacity: .32; stroke-width: 2; }
.arch-node.related .an-halo { stroke: #e0a64a; stroke-opacity: .5; stroke-width: 1.5; }
.arch-node.dim { opacity: .38; }
.arch-node.sel text { font-weight: 650; }
.arch-edge { transition: stroke .15s; }
.arch-legend {
  position: absolute; right: 10px; bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 10px; color: #7a8899; background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; max-width: calc(100% - 20px);
  pointer-events: none;
}
.arch-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.arch-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .arch-wrap { height: 460px !important; }
}
.arch-legend-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px;
  font-size: 10.5px; color: #6b7a90;
}
.arch-legend-row span { display: inline-flex; align-items: center; gap: 5px; }
.arch-legend-row i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

/* --------------------------- 研发接入台 --------------------------- */
.code-box {
  background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  color: #2b3a55; white-space: pre; overflow: auto; max-height: 330px;
}
.check-list { display: flex; flex-direction: column; }
.check-row {
  display: flex; gap: 9px; align-items: flex-start; padding: 8px 2px;
  border-bottom: 1px solid #f1f4fa; font-size: 12px;
}
.check-row:last-child { border-bottom: 0; }
.check-ic {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px; margin-top: 2px;
  display: grid; place-items: center; font-size: 10px; color: #fff; font-weight: 700;
}
.check-ic.ok { background: #12b981; }
.check-ic.bad { background: #d92d20; }
.side-item .pill { flex: 0 0 auto; }


/* --------------------------- 导航收起态 --------------------------- */
.sidebar.collapsed { width: 64px; flex-basis: 64px; }
.sidebar.collapsed .brand { justify-content: center; padding: 16px 0 14px; }
.sidebar.collapsed .brand-txt,
.sidebar.collapsed .nav-group,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-ext,
.sidebar.collapsed .side-foot { display: none; }
.sidebar.collapsed .nav { padding: 6px 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar.collapsed .nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.sidebar.collapsed .nav-item.active::before { left: 0; height: 16px; }
.sidebar.collapsed .nav-badge {
  position: absolute; top: 3px; right: 6px; margin: 0; padding: 0 3px;
  min-width: 13px; height: 13px; line-height: 13px; font-size: 9px; text-align: center;
}
@media (max-width: 900px) {
  .nav-toggle { display: none; }
  .sidebar.collapsed { width: 100%; flex-basis: auto; flex-direction: row; }
  .sidebar.collapsed .nav { display: flex; }
  .sidebar.collapsed .nav-label { display: inline; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 6px 10px; gap: 10px; }
  .sidebar.collapsed .nav-badge { position: static; margin-left: auto; }
}
