/* ============================================================
   AI 市场情报台 · A+ 深空石墨
   深色化：深空石墨顶栏 + 石墨内容区 + 沉稳赛道色
   → 沉静专业不高对比，色彩作为深底上的信号色
   ============================================================ */
:root {
  /* 导航：深空石墨顶栏 */
  --nav-bg: #0d1117;
  --nav-bg-2: #161b22;
  --nav-text: #e6edf3;
  --nav-text-2: #9aa7b5;
  --nav-line: #252d38;

  /* 内容区：深空石墨底 */
  --bg: #0d1117;
  --bg-grad-1: rgba(79, 155, 217, .06);
  --bg-grad-2: rgba(54, 160, 129, .05);
  --card: #161b22;
  --card-2: #1c232c;
  --card-3: #212a35;
  --line: #252d38;
  --line-2: #333d4a;

  --text: #e6edf3;
  --text-2: #9aa7b5;
  --text-3: #6b7885;
  --text-inv: #ffffff;

  /* 主色：沉静天蓝 */
  --accent: #4f9bd9;
  --accent-2: #4f9bd9;
  /* 六赛道：深色底的沉稳配色 */
  --models: #4787bd;
  --chips: #36a081;
  --idc: #ba8645;
  --embodied: #786fbd;
  --market: #b5617d;
  --policy: #4291a8;

  /* 语义（中国市场：涨红跌绿） */
  --pos: #e5605c;
  --neg: #3fa87d;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
  --shadow-2: 0 2px 10px rgba(0, 0, 0, .35), 0 10px 26px rgba(0, 0, 0, .25);
  --shadow-3: 0 14px 40px rgba(0, 0, 0, .45);

  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 520px at 8% -8%, var(--bg-grad-1), transparent 62%),
    radial-gradient(900px 480px at 94% -4%, var(--bg-grad-2), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: rgba(79, 155, 217, .14); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333d4a; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a5563; }

/* ================= 顶栏 ================= */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 64px;
  background: linear-gradient(180deg, var(--nav-bg-2), var(--nav-bg));
  border-bottom: 1px solid var(--nav-line);
  box-shadow: 0 2px 14px rgba(40, 90, 125, .16);
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #4f9bd9, #4291a8 55%, #36a081);
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 3px 12px rgba(79,155,217,.42);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 9px 9px;
}
.brand-text b { display: block; font-size: 15.5px; font-weight: 750; letter-spacing: .3px; line-height: 1.15; color: #ffffff; }
.brand-text span { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 2.2px; color: var(--nav-text-2); text-transform: uppercase; font-weight: 600; }

.topbar-sep { width: 1px; height: 26px; background: var(--nav-line); }

.nav { display: flex; gap: 2px; background: rgba(255,255,255,.14); padding: 3px; border-radius: 10px; }
.nav button {
  font: inherit; font-size: 13px; font-weight: 550; color: var(--nav-text-2);
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 13px; border-radius: 8px; transition: .16s; white-space: nowrap;
}
.nav button:hover { color: #e6edf3; background: rgba(79,155,217,.14); }
.nav button.active { color: #4f9bd9; background: rgba(79,155,217,.18); box-shadow: 0 1px 5px rgba(20,60,90,.16); font-weight: 700; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.status-pill {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 550; color: #9aa7b5;
  padding: 7px 12px; border-radius: 20px;
  background: rgba(13,17,23,.55); border: 1px solid #333d4a;
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neg); box-shadow: 0 0 0 3px rgba(63,168,125,.20); animation: pulse 2.4s infinite; }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.dot.err { background: var(--pos); box-shadow: 0 0 0 3px rgba(229,96,92,.18); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-wrap input {
  width: 226px; height: 37px; padding: 0 12px 0 33px;
  background: #0d1117; border: 1px solid #333d4a; border-radius: 10px;
  color: #ffffff; font: inherit; font-size: 13px; outline: none; transition: .18s;
}
.search-wrap input::placeholder { color: var(--nav-text-2); }
.search-wrap input:focus { border-color: #4f9bd9; background: #0d1117; box-shadow: 0 0 0 3px rgba(79,155,217,.22); width: 280px; }
.search-wrap svg { color: var(--nav-text-2); }

.btn {
  height: 37px; padding: 0 15px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid #333d4a; color: var(--nav-text);
  font: inherit; font-size: 12.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 7px;
  transition: .16s; white-space: nowrap;
}
.topbar .btn:hover { color: #e6edf3; border-color: #4f9bd9; background: rgba(255,255,255,.10); }
.btn:hover { color: #e6edf3; border-color: #4f9bd9; background: var(--card-2); }
.btn.primary {
  background: linear-gradient(180deg, #4f9bd9, #3f80b3); border-color: #3f80b3; color: #fff;
  box-shadow: 0 2px 11px rgba(79,155,217,.34);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 5px 18px rgba(79,155,217,.38); }
.btn.spin svg { animation: rotate 1s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* ================= 布局 ================= */
.page { max-width: 1760px; margin: 0 auto; padding: 22px 24px 64px; }

/* ================= 快报 Hero ================= */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) auto; gap: 16px; margin-bottom: 18px; }

.hero-main {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, #161b22, #1c232c 46%, #1a2129);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-1);
}
.hero-main::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--chips));
}
.hero-main::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(79,155,217,.10), transparent 70%);
  pointer-events: none;
}

.kicker {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 2.2px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
  display: flex; align-items: center; gap: 9px;
}
.kicker::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(79,155,217,.30), transparent); }

.hero-headline {
  font-size: 19px; font-weight: 720; line-height: 1.5; letter-spacing: .1px;
  color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-headline a { color: inherit; text-decoration: none; }
.hero-headline a:hover { color: var(--accent); }

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.hero-meta b { color: var(--text-2); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(112px, 1fr)); gap: 10px; }

.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-1); transition: .18s;
}
.kpi:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.kpi::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: var(--kc, var(--accent)); opacity: .85;
}
.kpi-label { font-size: 11px; color: var(--text-3); font-weight: 550; letter-spacing: .2px; white-space: nowrap; }
.kpi-value { font-family: var(--mono); font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -1px; color: var(--text); margin-top: 1px; }
.kpi-value small { font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.kpi-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; }
.kpi-sub .up { color: var(--pos); font-weight: 700; }
.kpi-sub .down { color: var(--neg); font-weight: 700; }

/* ================= 图表区 ================= */
.charts {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
/* 首页三栏：任何窗口宽度都横向并排，不堆叠；极窄时仅该区域横向滚动 */
#charts { display: flex; flex-direction: column; }
.charts-scroll { overflow-x: auto; overflow-y: hidden; padding: 10px; margin: -10px; }
.charts-cols { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 14px; min-width: 844px; }
.charts-cols > .chart-card { flex: 1 0 0; min-width: 248px; }
.charts-cols > .chart-card:first-child { flex-grow: 1.55; min-width: 320px; }
/* 第四张图：横跨整行 */
.chart-wide { grid-column: 1 / -1; }

/* 分段切换控件 */
.seg { display: inline-flex; gap: 2px; background: var(--card-3); padding: 2.5px; border-radius: 7px; }
.seg button {
  font: inherit; font-size: 11px; font-weight: 550; color: var(--text-3);
  background: transparent; border: 0; cursor: pointer;
  padding: 3px 9px; border-radius: 5px; transition: .15s; white-space: nowrap;
}
.seg button:hover { color: var(--text-2); }
.seg button.on { color: var(--accent); background: var(--card); box-shadow: var(--shadow-1); font-weight: 650; }

.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column;
}
.chart-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px 10px; }
.chart-head h3 {
  font-size: 12.5px; font-weight: 700; letter-spacing: .3px; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.chart-head h3::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); }
.chart-head .sub { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.chart-head .grow { flex: 1; }
.chart-body { padding: 0 16px 14px; flex: 1; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.legend span { font-size: 10px; color: var(--text-3); font-family: var(--mono); display: flex; align-items: center; gap: 4px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }

.hbars { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: 48px 1fr 48px; gap: 10px; align-items: center; cursor: pointer; }
.hbar:hover .hbar-name { color: var(--accent); }
.hbar:hover .hbar-fill { filter: brightness(1.06); }
.hbar-name {
  font-size: 11.5px; color: var(--text-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-weight: 550;
  transition: color .15s;
}
.hbar-track {
  position: relative; height: 24px; background: var(--card-3);
  border-radius: 7px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .30);
}
.hbar-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 7px;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: #fff;
  transition: width .6s cubic-bezier(.4,0,.2,1), filter .15s;
  min-width: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .30);
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.hbar-pct {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  color: var(--text-2); text-align: right;
}

.policy-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pb-row { display: grid; grid-template-columns: 76px 1fr 46px; gap: 10px; align-items: center; }
.pb-label {
  font-size: 11.5px; color: var(--text-2); font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-track {
  height: 22px; background: var(--card-3); border-radius: 6px;
  overflow: hidden; position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .30);
}
.pb-fill {
  height: 100%; border-radius: 6px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .30);
}
.pb-fill .inbar {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  color: #fff; letter-spacing: -.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.pb-num {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  color: var(--text-2); text-align: right;
}
/* 首页 IDC 投建金额 Top：数值统一置于条形右侧外部，同列左对齐 */
#miniChart .pb-row { grid-template-columns: 76px minmax(0, 1fr) 70px; }
#miniChart .pb-num { text-align: left; white-space: nowrap; }

/* ================= 赛道卡 ================= */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 12px; }
.section-head h2 {
  font-size: 13px; font-weight: 750; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-2); display: flex; align-items: center; gap: 9px;
}
.section-head h2::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }
.section-head .hint { font-size: 11.5px; color: var(--text-3); }
.section-head .spacer { flex: 1; }

.tracks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }

.track-card {
  position: relative; overflow: hidden; cursor: pointer; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px 12px; transition: .18s; font: inherit; color: inherit;
  box-shadow: var(--shadow-1);
}
.track-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tc); }
.track-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--tc), transparent); opacity: .25; }
.track-card::after {
  content: ""; position: absolute; right: -22px; top: -34px; width: 84px; height: 84px;
  border-radius: 50%; background: var(--tc); opacity: .07; filter: blur(8px);
  transition: .25s; pointer-events: none;
}
.track-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--tc); }
.track-card:hover::after { opacity: .15; transform: scale(1.25); }
.track-card.active { border-color: var(--tc); box-shadow: 0 0 0 2px var(--tc) inset, var(--shadow-2); }

.tc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.tc-name { font-size: 13px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.tc-heat {
  margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--tc); padding: 1.5px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--tc) 12%, transparent);
}
.tc-num { font-family: var(--mono); font-size: 27px; font-weight: 700; letter-spacing: -1.2px; line-height: 1.1; color: var(--text); }
.tc-num small { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0; margin-left: 3px; }
.tc-desc { font-size: 10.5px; color: var(--text-3); margin: 3px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-spark { height: 28px; margin-bottom: 8px; }
.tc-entity {
  display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-2);
  padding-top: 8px; border-top: 1px dashed var(--line);
}
.tc-entity .lbl { color: var(--text-3); font-size: 10px; }
.tc-entity .val { font-family: var(--mono); font-weight: 600; }

/* ================= 主体两栏 ================= */
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }

.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 12px; box-shadow: var(--shadow-1);
}
.chip {
  font: inherit; font-size: 12px; font-weight: 550; color: var(--text-2); cursor: pointer;
  background: var(--card-2); border: 1px solid transparent; border-radius: 8px;
  padding: 5px 11px; transition: .15s; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); background: var(--card-3); }
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 1px 6px rgba(79,155,217,.24); }
.chip .cnt { font-family: var(--mono); font-size: 10px; color: var(--text-3); font-weight: 700; }
.chip.active .cnt { color: rgba(255,255,255,.85); }
.filters .divider { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; }
.filters .grow { flex: 1; }
.filters select {
  font: inherit; font-size: 12px; font-weight: 550; color: var(--text-2); background: var(--card-2);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 9px; outline: none; cursor: pointer;
}
.filters select:focus { border-color: var(--accent); }

.stream { display: flex; flex-direction: column; gap: 9px; }

.item {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 96px;
  gap: 14px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: .16s;
  box-shadow: var(--shadow-1);
}
.item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 12px 0 0 12px; background: var(--tc, var(--accent)); opacity: 0;
  transition: .16s;
}
.item:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-1px); }
.item:hover::before { opacity: 1; }
.item:hover .it-title { color: var(--accent); }
.item.high::before { opacity: 1; }

.it-score { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 1px; }
.it-score .v { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--tc, var(--accent)); line-height: 1; }
.it-score .bar { width: 30px; height: 3px; border-radius: 2px; background: var(--card-3); overflow: hidden; }
.it-score .bar i { display: block; height: 100%; background: var(--tc, var(--accent)); border-radius: 2px; }
.it-score .l { font-size: 8.5px; letter-spacing: .8px; color: var(--text-3); font-family: var(--mono); font-weight: 700; }

.it-body { min-width: 0; }
.it-title { font-size: 14.5px; font-weight: 620; line-height: 1.55; color: var(--text); margin-bottom: 5px; letter-spacing: .1px; transition: .15s; }
.it-sum { font-size: 12px; color: var(--text-3); line-height: 1.62; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.it-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }

.tag {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; letter-spacing: .1px;
  background: color-mix(in srgb, var(--tc) 10%, transparent); color: var(--tc);
  border: 1px solid color-mix(in srgb, var(--tc) 24%, transparent); white-space: nowrap;
}
.tag.plain { background: var(--card-2); color: var(--text-3); border-color: var(--line-2); }
.tag.ent { background: var(--card-2); color: var(--text-2); border-color: var(--line-2); font-family: var(--mono); font-size: 10px; font-weight: 550; }
.tag.metric {
  background: rgba(224, 142, 60, .10); color: #a9641f; border-color: rgba(224, 142, 60, .28);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
}
.tag.hi { background: rgba(229,96,92,.14); color: var(--pos); border-color: rgba(229,96,92,.24); font-weight: 700; }
.it-src { font-size: 10.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-left: auto; }
.it-src .sep { opacity: .35; }

.it-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.it-time { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); white-space: nowrap; font-weight: 550; }
.tone { font-size: 9.5px; font-family: var(--mono); font-weight: 700; letter-spacing: .4px; padding: 2px 6px; border-radius: 5px; }
.tone.positive { color: var(--pos); background: rgba(229,96,92,.14); }
.tone.negative { color: var(--neg); background: rgba(63,168,125,.14); }
.tone.neutral { color: var(--text-3); background: var(--card-3); }
.corro { font-size: 9.5px; color: var(--text-3); font-family: var(--mono); }

.empty {
  text-align: center; padding: 64px 20px; color: var(--text-3);
  border: 1.5px dashed var(--line-2); border-radius: 14px; font-size: 13px; background: var(--card);
}

.load-more { margin-top: 12px; }

/* ================= 侧栏 ================= */
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-1);
}
.card-head { display: flex; align-items: center; gap: 8px; padding: 13px 15px 11px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 12px; font-weight: 750; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-2); }
.card-head .badge { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-3); font-weight: 600; }
.card-body { padding: 13px 15px; }

.pulse { display: flex; flex-direction: column; gap: 7px; }
.pulse-row { display: grid; grid-template-columns: 1fr 56px; gap: 8px; align-items: center; cursor: pointer; }
.pulse-row:hover .pulse-name { color: var(--accent); }
.pulse-name { font-size: 12px; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-name i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pulse-track { position: relative; height: 21px; border-radius: 5px; background: var(--card-2); overflow: hidden; }
.pulse-track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; opacity: .26; }
.pulse-track b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text-2);
}

.health-list { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.health-row {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px;
}
.health-row:last-child { border-bottom: 0; }
.health-row .nm { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.health-row .val { font-family: var(--mono); font-size: 10px; color: var(--text-3); white-space: nowrap; font-weight: 600; }
.health-row.fail .nm { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(229,96,92,.40); }

.cov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cov-cell { background: var(--card-2); border-radius: 9px; padding: 9px 10px; border: 1px solid var(--line); }
.cov-cell .k { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.cov-cell .v { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--text); }

/* ================= 抽屉 ================= */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(13, 23, 38, .38); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: .22s; z-index: 90;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(660px, 95vw);
  background: #0d1117; border-left: 1px solid var(--line-2);
  transform: translateX(102%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 100; display: flex; flex-direction: column; box-shadow: var(--shadow-3);
}
.drawer.open { transform: none; }
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px; flex-shrink: 0; background: #161b22;
}
.drawer-head .close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text-2);
  font-size: 15px; line-height: 1; flex-shrink: 0; transition: .15s;
}
.drawer-head .close:hover { color: var(--pos); border-color: var(--pos); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }

.drawer h2 { font-size: 19px; line-height: 1.5; font-weight: 720; margin-bottom: 14px; color: var(--text); }

.d-hero { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.d-stat { flex: 1; min-width: 96px; background: #1c232c; border: 1px solid #333d4a; border-radius: 10px; padding: 10px 12px; }
.d-stat .k { font-size: 10px; color: var(--text-3); font-weight: 600; }
.d-stat .v { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.d-stat .v.sm { font-size: 13px; }

.meta-line { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); margin-bottom: 16px; }

.block { margin-bottom: 20px; }
.block h4 {
  font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 8px; font-weight: 750; display: flex; align-items: center; gap: 7px;
}
.block h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.block p { font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.block p.muted { color: var(--text-3); font-style: italic; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 9px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-3); font-weight: 550; }
.kv dd { color: var(--text-2); }

.link-out {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(180deg, #4f9bd9, #3f80b3); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; box-shadow: 0 2px 11px rgba(79,155,217,.26);
}
.link-out:hover { filter: brightness(1.07); }

.related { display: flex; flex-direction: column; gap: 8px; }
.rel-item {
  display: block; padding: 10px 12px; border-radius: 9px; background: var(--card-2);
  border: 1px solid var(--line); text-decoration: none; transition: .15s;
}
.rel-item:hover { border-color: var(--accent); background: #1c232c; }
.rel-item .t { font-size: 12.5px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-item .m { font-size: 10px; color: var(--text-3); font-family: var(--mono); margin-top: 3px; }

/* ================= 表格 ================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; font-weight: 700; font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase;
  color: #e6edf3; padding: 10px; border-bottom: 1.5px solid var(--line-2); white-space: nowrap;
  background: var(--card-3);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.tbl tr:hover td { background: var(--card-2); }
.tbl .mono { font-family: var(--mono); font-size: 11px; }
.tbl .ok { color: var(--neg); font-weight: 700; }
.tbl .bad { color: var(--pos); font-weight: 700; }

.cmdbox {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.9;
  background: #0a0e14; border: 1px solid #333d4a; border-radius: 10px;
  padding: 13px 15px; color: #9aa7b5; overflow-x: auto; white-space: pre;
}
.cmdbox .c { color: #6b7885; }
.cmdbox .g { color: #3fa87d; }

.monitor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }

.foot {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 11px; color: var(--text-3); font-family: var(--mono);
}
.foot .spacer { flex: 1; }

/* ================= 响应式 ================= */
@media (max-width: 1560px) {
  .tracks { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1320px) {
  .hero { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .side .card:last-child { grid-column: span 2; }
}
@media (max-width: 1000px) {
  .side { grid-template-columns: 1fr; }
  .side .card:last-child { grid-column: auto; }
  .nav { display: none; }
  .monitor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .page { padding: 14px 13px 44px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .tracks { grid-template-columns: repeat(2, 1fr); }
  .item { grid-template-columns: 40px minmax(0, 1fr); }
  .it-side { display: none; }
  .search-wrap input { width: 150px; }
  .search-wrap input:focus { width: 180px; }
  .status-pill { display: none; }
}
@media (max-width: 560px) {
  .brand-text span { display: none; }
  .tracks { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   图表悬停提示（挂 body，避免被卡片 overflow 裁切）
   ============================================================ */
.chart-tip {
  position: fixed;
  z-index: 300;
  min-width: 168px;
  max-width: 268px;
  padding: 10px 12px;
  background: #1c232c;
  border: 1px solid #333d4a;
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(15, 26, 42, .34);
  color: #e8eef7;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .13s ease, transform .13s ease;
}
.chart-tip.on { opacity: 1; transform: translateY(0); }

.chart-tip .tip-title {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #8fb8e4;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  white-space: nowrap;
}
.chart-tip .tip-body { display: flex; flex-direction: column; gap: 4px; }
.chart-tip .tip-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 7px;
  align-items: center;
}
.chart-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip .tip-row .k { color: #9aa7b5; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-tip .tip-row .v { font-family: var(--mono); font-size: 12px; font-weight: 700; color: #e6edf3; }

.chart-tip .tip-extra {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chart-tip .tip-ent {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 11px;
}
.chart-tip .tip-ent .nm { color: #9aa7b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-tip .tip-ent .ct { font-family: var(--mono); font-weight: 700; color: #3fa87d; }

/* 折线图数据点在悬停时放大 */
#modelTrendChart svg circle.pt { transition: r .12s ease; }

/* ============================================================
   图表卡片视觉打磨
   ============================================================ */
.chart-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.chart-card:hover {
  box-shadow: var(--shadow-2);
}
/* 卡片顶部细高光 */
.chart-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(63, 149, 189, .32), transparent);
  pointer-events: none;
}
.chart-head {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 17px 8px;
}
.chart-head h3 {
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.chart-head h3::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--policy));
  box-shadow: 0 0 6px rgba(63, 149, 189, .35);
}
.chart-head .sub {
  font-size: 10.5px; color: var(--text-3); font-family: var(--mono);
  white-space: nowrap;
}
.chart-body { padding: 0 17px 16px; flex: 1; }

/* 图例：胶囊化 */
.legend { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; }
.legend span {
  font-size: 10px; color: var(--text-2); font-family: var(--mono);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 6px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  white-space: nowrap;
}
.legend i {
  width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.9);
}

/* 分段控件：更精致 */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--card-3);
  padding: 3px;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .30);
}
.seg button {
  font: inherit; font-size: 11px; font-weight: 550; color: var(--text-3);
  background: transparent; border: 0; cursor: pointer;
  padding: 3.5px 10px; border-radius: 6px;
  transition: .16s; white-space: nowrap;
}
.seg button:hover { color: var(--text-2); background: rgba(255,255,255,.55); }
.seg button.on {
  color: #fff;
  background: linear-gradient(180deg, #4f9bd9, #3f80b3);
  box-shadow: 0 1px 4px rgba(79, 155, 217, .32);
  font-weight: 650;
}

/* 图表 SVG 内的文字与线条更柔和 */
#modelTrendChart svg text,
#trendChart svg text { user-select: none; }

/* 图表 svg 外发光（悬停时） */
.chart-body > div:hover svg {
  filter: drop-shadow(0 1px 2px rgba(63, 149, 189, .10));
}
