/* =========================================================================
   大势研判 · v2 样式
   零外部依赖：不引 CDN、不引字体文件、不引图标库。图标一律用内联 SVG。
   ========================================================================= */

:root {
  --bg: #080b12;
  --bg-2: #0b0f17;
  --panel: #101725;
  --panel-2: #141d2e;
  --panel-3: #182238;
  --line: #1c2739;
  --line-soft: #162030;
  --text: #e8eefa;
  --text-2: #aab8cd;
  --text-3: #6d7f99;
  --accent: #4f9dff;
  --accent-2: #8a7dff;
  --accent-dim: #1e4f8f;
  --up: #ff5064;
  --down: #16c784;
  --warn: #ffc857;
  --alert: #ff8a5c;
  --violet: #b48cff;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(79, 157, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 8% 0%, rgba(22, 199, 132, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

::selection { background: rgba(79, 157, 255, 0.32); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-2); }
.num.up, .num.down, .num.flat { font-weight: 600; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: #04101f; font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 10px; }

/* ------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: rgba(8, 11, 18, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt strong { font-size: 15px; letter-spacing: 0.06em; }
.brand-txt span { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; }

.tabs {
  display: flex; align-items: center; gap: 2px; flex: 1 1 auto;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 2px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 6px 11px; border-radius: 999px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: rgba(79, 157, 255, 0.08); }
.tab.is-on {
  color: #dbe9ff; background: rgba(79, 157, 255, 0.13);
  border-color: rgba(79, 157, 255, 0.32);
}

.top-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.asof {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); white-space: nowrap;
}
.mode-chip {
  font-size: 11px; font-family: var(--mono); color: var(--warn);
  border: 1px solid rgba(255, 200, 87, 0.35); border-radius: 999px;
  padding: 2px 8px; background: rgba(255, 200, 87, 0.08);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: #2a3a55; background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #5da8ff, #3577e0);
  border-color: transparent; color: #04101f;
  box-shadow: 0 6px 18px rgba(53, 119, 224, 0.28);
}
.btn-primary:hover { color: #04101f; filter: brightness(1.06); }

/* ------------------------------------------------------------- 布局 */
.app {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(14px, 2.4vw, 30px) clamp(14px, 3vw, 34px) 40px;
}

.content { display: flex; flex-direction: column; gap: 42px; }
#content { display: flex; flex-direction: column; gap: 42px; }

.sec { scroll-margin-top: 84px; }
.sec-head { margin-bottom: 16px; }
.sec-title { font-size: clamp(19px, 2.2vw, 23px); letter-spacing: 0.01em; }
.sec-title::before {
  content: ""; display: inline-block; width: 4px; height: 17px; margin-right: 9px;
  border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  vertical-align: -2px;
}
.sec-desc { margin-top: 6px; color: var(--text-3); font-size: 13px; max-width: 92ch; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hero-grid { grid-template-columns: 1.25fr 0.95fr; align-items: start; }

.card {
  background: linear-gradient(180deg, rgba(20, 29, 46, 0.92), rgba(16, 23, 37, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid-2 > .card + .card { margin-top: 0; }

.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-head h3 { font-size: 15px; letter-spacing: 0.02em; }
.hint { color: var(--text-3); font-size: 11.5px; font-weight: 400; text-align: right; }

/* ------------------------------------------------------------- 状态卡 */
.hero { padding: 22px 24px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(79, 157, 255, 0.14); border: 1px solid rgba(79, 157, 255, 0.32);
  color: #cfe4ff; font-size: 12px; font-weight: 650; letter-spacing: 0.03em;
}
.badge-soft { background: var(--line-soft); border-color: var(--line); color: var(--text-2); font-weight: 500; }
.hero-asof { color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }

.state-name {
  margin-top: 12px; font-size: clamp(28px, 4.2vw, 42px); line-height: 1.15;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #ffffff 10%, #b6d3ff 55%, #8de9c4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.state-name.is-limited {
  background: linear-gradient(120deg, #ffd8c7 0%, #ffb27f 60%, #ffc857 100%);
  -webkit-background-clip: text; background-clip: text;
}
.state-summary { margin-top: 10px; color: var(--text); font-size: 15px; }
.state-note { margin-top: 8px; color: var(--text-2); font-size: 13.5px; }
.state-limit {
  margin-top: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 138, 92, 0.10); border: 1px solid rgba(255, 138, 92, 0.35);
  color: #ffd1bd; font-size: 13px;
}

.hero-meters { display: flex; gap: 22px; margin-top: 20px; align-items: center; }
.gauge-wrap { position: relative; width: 128px; height: 146px; flex: 0 0 auto; }
.gauge { width: 128px; height: 128px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: #16233a; stroke-width: 9; }
.gauge-fill {
  fill: none; stroke: url(#none); stroke: var(--accent); stroke-width: 9;
  stroke-linecap: round; transition: stroke-dasharray 0.7s ease, stroke 0.4s ease;
}
.gauge-num {
  position: absolute; inset: 0 0 18px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0;
}
.gauge-num strong { font-family: var(--mono); font-size: 26px; line-height: 1; }
.gauge-num span { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.08em; }
.gauge-cap {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font-size: 10px; color: var(--warn); font-family: var(--mono); white-space: nowrap;
}

.axes { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.axis-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.axis-head b { color: var(--text-2); font-weight: 600; }
.axis-bar {
  position: relative; height: 6px; margin-top: 5px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 199, 132, 0.28), rgba(120, 140, 170, 0.18) 50%, rgba(255, 80, 100, 0.28));
}
.axis-bar::after {
  content: ""; position: absolute; left: 50%; top: -2px; width: 1px; height: 10px;
  background: rgba(232, 238, 250, 0.28);
}
.axis-fill {
  position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--accent);
  border: 2px solid #0b1220; box-shadow: 0 0 0 3px rgba(79, 157, 255, 0.16);
  transition: left 0.6s ease;
}
.axis-fill.risk { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.16); }
.axis-val { margin-top: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.axis-hint { color: var(--text-3); font-size: 11px; margin-top: 2px; }

/* ------------------------------------------------------------- 闸门 */
.gate-banner {
  margin-bottom: 18px; padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  border-left: 3px solid var(--text-3);
}
.gate-banner.gate-full { border-left-color: var(--down); background: rgba(22, 199, 132, 0.06); }
.gate-banner.gate-partial { border-left-color: var(--warn); background: rgba(255, 200, 87, 0.07); }
.gate-banner.gate-insufficient { border-left-color: var(--alert); background: rgba(255, 138, 92, 0.09); }
.gate-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gate-head strong { font-size: 14px; }
.gate-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
}
.gate-full .gate-pill { color: var(--down); border-color: rgba(22, 199, 132, 0.4); background: rgba(22, 199, 132, 0.1); }
.gate-partial .gate-pill { color: var(--warn); border-color: rgba(255, 200, 87, 0.4); background: rgba(255, 200, 87, 0.1); }
.gate-insufficient .gate-pill { color: var(--alert); border-color: rgba(255, 138, 92, 0.45); background: rgba(255, 138, 92, 0.12); }
.gate-cap { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.gate-reason { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.gate-missing { margin-top: 4px; color: #ffd1bd; font-size: 12.5px; }

.static-badge {
  margin-bottom: 18px; padding: 11px 16px; border-radius: var(--radius);
  border: 1px solid rgba(255, 200, 87, 0.38);
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.12), rgba(255, 200, 87, 0.04));
  color: #ffe3a6; font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.static-badge b { color: #fff3cf; }

/* ------------------------------------------------------------- 追问 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12px; text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: rgba(79, 157, 255, 0.45); color: var(--text); background: rgba(79, 157, 255, 0.08); }

.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1 1 auto; min-width: 0;
  padding: 9px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 13.5px;
}
.ask-form input::placeholder { color: #55657d; }
.ask-form input:focus { border-color: rgba(79, 157, 255, 0.55); outline: none; box-shadow: 0 0 0 3px rgba(79, 157, 255, 0.12); }

.qa-log { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.qa { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 11px 13px; background: rgba(11, 15, 23, 0.6); }
.qa.is-pending { opacity: 0.7; }
.qa-q { color: #cfe4ff; font-size: 13px; font-weight: 600; }
.qa-q::before { content: "问"; display: inline-block; margin-right: 7px; padding: 0 5px; border-radius: 4px; background: rgba(79, 157, 255, 0.16); color: var(--accent); font-size: 10px; font-weight: 700; vertical-align: 1px; }
.qa-a { margin-top: 7px; color: var(--text-2); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.qa-a strong { color: var(--text); }
.qa-cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cite {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; cursor: pointer;
  background: rgba(138, 125, 255, 0.10); border: 1px solid rgba(138, 125, 255, 0.30);
  color: #d9d0ff; font-size: 11px; font-family: var(--mono);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cite:hover { background: rgba(138, 125, 255, 0.2); border-color: rgba(138, 125, 255, 0.6); }
.qa-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--text-3); font-size: 11px; font-family: var(--mono); }
.qa-note { margin-top: 6px; color: var(--text-3); font-size: 11.5px; }
.qa-warn { margin-top: 6px; color: var(--warn); font-size: 11.5px; }
.qa-refusal { border-color: rgba(255, 138, 92, 0.35); background: rgba(255, 138, 92, 0.06); }

/* ------------------------------------------------------------- 地图/雷达 */
.map-wrap { position: relative; }
.map-wrap svg { width: 100%; height: auto; }

/* ------------------------------------------------------------- 认识论 */
.epi-card { margin-top: 18px; }
.epi-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.epi-item {
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(11, 15, 23, 0.55);
}
.epi-item h4 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.epi-item p { margin-top: 6px; color: var(--text-3); font-size: 12px; }
.epi-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.epi-stat {
  flex: 1 1 150px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line-soft);
}
.epi-stat b { display: block; font-family: var(--mono); font-size: 19px; line-height: 1.3; }
.epi-stat span { color: var(--text-3); font-size: 11.5px; }

.lbadge {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em;
  border: 1px solid transparent; white-space: nowrap;
}
.lbadge.fact { color: #9fd0ff; background: rgba(79, 157, 255, 0.12); border-color: rgba(79, 157, 255, 0.32); }
.lbadge.induction { color: #d9ccff; background: rgba(138, 125, 255, 0.13); border-color: rgba(138, 125, 255, 0.34); }
.lbadge.judgment { color: #ffe0a3; background: rgba(255, 200, 87, 0.12); border-color: rgba(255, 200, 87, 0.34); }
.lbadge.condition { color: #b9f0dc; background: rgba(22, 199, 132, 0.10); border-color: rgba(22, 199, 132, 0.30); }

/* ------------------------------------------------------------- 维度卡 */
.dims { display: flex; flex-direction: column; gap: 14px; }
.dim {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 29, 46, 0.9), rgba(16, 23, 37, 0.94));
  overflow: hidden;
}
.dim-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; user-select: none;
  transition: background 0.15s ease;
}
.dim-head:hover { background: rgba(79, 157, 255, 0.04); }
.dim-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.dim-title h3 { font-size: 15px; }
.dim-q { color: var(--text-3); font-size: 12px; }
.dim-score {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); flex: 0 0 auto;
}
.dim-score .s { font-size: 16px; font-weight: 700; }
.dim-status {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2); background: var(--panel);
}
.st-strong { color: #b9f0dc !important; border-color: rgba(22, 199, 132, 0.4) !important; background: rgba(22, 199, 132, 0.1) !important; }
.st-weak { color: #ffc4cd !important; border-color: rgba(255, 80, 100, 0.4) !important; background: rgba(255, 80, 100, 0.1) !important; }
.st-neutral { color: #ffe3a6 !important; border-color: rgba(255, 200, 87, 0.35) !important; background: rgba(255, 200, 87, 0.08) !important; }
.dim-toggle { width: 10px; height: 10px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s ease; flex: 0 0 auto; }
.dim.open .dim-toggle { transform: rotate(-135deg); }
.dim-body { display: none; padding: 0 18px 18px; }
.dim.open .dim-body { display: block; }
.dim-headline { color: var(--text); font-size: 13.5px; padding: 2px 0 10px; }
.dim-sub { color: var(--text-3); font-size: 12px; margin: 12px 0 6px; letter-spacing: 0.03em; }

.facts { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.fact-row {
  display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(90px, 0.8fr) minmax(0, 2.4fr) auto;
  gap: 10px; align-items: center; width: 100%;
  padding: 8px 12px; background: transparent; border: 0; border-top: 1px solid var(--line-soft);
  text-align: left; cursor: pointer; color: inherit; font: inherit; font-size: 12.5px;
}
.fact-row:first-child { border-top: 0; }
.fact-row:hover { background: rgba(79, 157, 255, 0.05); }
.fact-row .fl { color: var(--text-2); }
.fact-row .fv { font-family: var(--mono); color: var(--text); }
.fact-row .fn { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-row .fz { color: var(--text-3); font-size: 10.5px; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.fact-row[aria-expanded="true"] { background: rgba(79, 157, 255, 0.07); }
.fact-detail { display: none; padding: 10px 12px; background: rgba(8, 11, 18, 0.55); border-top: 1px solid var(--line-soft); }
.fact-detail.is-open { display: block; }
.fact-detail dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; margin: 0; font-size: 12px; }
.fact-detail dt { color: var(--text-3); }
.fact-detail dd { margin: 0; color: var(--text-2); word-break: break-word; }
.fact-detail code { font-family: var(--mono); font-size: 11.5px; color: #bfe0ff; background: rgba(79, 157, 255, 0.08); padding: 1px 5px; border-radius: 4px; }
.evidence-hit { outline: 2px solid var(--accent-2); outline-offset: 2px; background: rgba(138, 125, 255, 0.12) !important; transition: background 0.3s ease; }

.signals { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }
.signals li { margin: 3px 0; }

.meta-list { display: grid; grid-template-columns: 1fr; gap: 4px; color: var(--text-3); font-size: 12px; }
.meta-list b { color: var(--text-2); font-weight: 600; }

/* ------------------------------------------------------------- 矛盾 */
.contra-list { display: flex; flex-direction: column; gap: 14px; }
.contra-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 16px 18px; }
.contra-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contra-card h3 { font-size: 15px; }
.contra-strength { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.contra-text { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.vs-item { padding: 10px 12px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line-soft); }
.vs-item .vs-d { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-3); }
.vs-item .vs-s { font-family: var(--mono); font-size: 17px; margin-top: 3px; }
.check { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: rgba(22, 199, 132, 0.06); border: 1px solid rgba(22, 199, 132, 0.22); color: #c6f3e2; font-size: 12.5px; }
.check b { color: #e5fff6; }

/* ------------------------------------------------------------- 条件 */
.cond-list { display: flex; flex-direction: column; }
.cond {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 16px;
  padding: 12px 4px; border-bottom: 1px solid var(--line-soft);
}
.cond:last-child { border-bottom: 0; }
.cond-main { min-width: 0; }
.cond-text { font-size: 13.5px; color: var(--text); }
.cond-why { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.cond-right { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.cond-dist { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.cond-triggered { color: var(--warn); font-size: 11px; margin-left: 6px; }
.triggers { display: flex; flex-wrap: wrap; gap: 8px; }
.trig-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(255, 200, 87, 0.10); border: 1px solid rgba(255, 200, 87, 0.32); color: #ffe3a6;
}

/* ------------------------------------------------------------- 计划表 */
.plan-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.plan-top .k { font-size: 11px; color: var(--text-3); letter-spacing: 0.08em; }
.plan-top p { margin-top: 3px; font-size: 13px; color: var(--text-2); }
.plan-note { margin-top: 10px; color: var(--text-3); font-size: 11.5px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.table { min-width: 720px; font-size: 12.5px; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 10px; text-align: left; white-space: nowrap;
  color: var(--text-3); font-weight: 600; font-size: 11.5px; letter-spacing: 0.03em;
  background: #0e1524; border-bottom: 1px solid var(--line);
}
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(79, 157, 255, 0.035); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .empty { text-align: center; color: var(--text-3); padding: 22px 10px; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-family: var(--mono); border: 1px solid var(--line); color: var(--text-2);
}
.pill.ok { color: #a9efcf; background: rgba(22, 199, 132, 0.1); border-color: rgba(22, 199, 132, 0.32); }
.pill.degraded { color: #ffe3a6; background: rgba(255, 200, 87, 0.1); border-color: rgba(255, 200, 87, 0.32); }
.pill.failed, .pill.missing { color: #ffc4cd; background: rgba(255, 80, 100, 0.1); border-color: rgba(255, 80, 100, 0.32); }
.src-chain { color: var(--text-3); font-size: 11.5px; }
.src-chain b { color: var(--text-2); font-weight: 600; }
.err-text { color: #ffb5a0; font-size: 11px; }
.plan-name { color: var(--text); font-weight: 600; }
.plan-need { color: var(--text-3); font-size: 11.5px; }

.gate-detail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gate-box { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line-soft); }
.gate-box .k { font-size: 11px; color: var(--text-3); }
.gate-box .v { font-family: var(--mono); font-size: 16px; margin-top: 2px; }
.gate-box p { margin-top: 4px; color: var(--text-2); font-size: 12px; }

/* ------------------------------------------------------------- 行业 */
.industry-table { min-width: 640px; }
.industry-name { color: var(--text); font-weight: 600; }
.heat-bar { height: 6px; border-radius: 999px; min-width: 60px; background: var(--line-soft); overflow: hidden; }
.heat-bar i { display: block; height: 100%; border-radius: 999px; }
.rank-no { color: var(--text-3); font-family: var(--mono); }

/* ------------------------------------------------------------- 风格 */
.style-card { padding: 16px 18px; }
.style-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.style-head h3 { font-size: 15px; }
.style-win {
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: rgba(79, 157, 255, 0.14); border: 1px solid rgba(79, 157, 255, 0.34); color: #d6e8ff;
}
.style-spread { margin-top: 10px; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.style-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sbar { display: grid; grid-template-columns: 96px 1fr 76px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.sbar .track { position: relative; height: 8px; border-radius: 999px; background: var(--line-soft); }
.sbar .track i { position: absolute; top: 0; height: 100%; border-radius: 999px; }
.sbar .val { text-align: right; font-family: var(--mono); color: var(--text-2); }
.style-note { margin-top: 10px; color: var(--text-3); font-size: 11.5px; }

/* ------------------------------------------------------------- 历史 */
.history-timeline {
  display: flex; gap: 4px; padding: 6px 0 14px;
  overflow-x: auto; scrollbar-width: thin;
}
.phase {
  flex: 1 0 108px; min-width: 108px;
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.phase:hover { border-color: rgba(79, 157, 255, 0.45); background: rgba(79, 157, 255, 0.07); }
.phase[aria-selected="true"] { border-color: rgba(79, 157, 255, 0.85); background: rgba(79, 157, 255, 0.13); box-shadow: inset 0 0 0 1px rgba(79, 157, 255, 0.25); }
.phase .p-range { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.phase .p-name { font-size: 12.5px; font-weight: 650; color: var(--text); }
.phase .p-trend { font-family: var(--mono); font-size: 11.5px; }
.phase .p-now { font-size: 10px; color: var(--accent); }
.history-detail { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line-soft); }
.history-detail h3 { font-size: 14.5px; }
.hd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.hd-item { padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(8, 11, 18, 0.5); border: 1px solid var(--line-soft); }
.hd-item .k { color: var(--text-3); font-size: 11px; }
.hd-item .v { font-family: var(--mono); font-size: 14px; margin-top: 2px; }
.hd-diff { margin-top: 10px; color: var(--text-2); font-size: 12.5px; }
.hd-caveat { margin-top: 8px; color: var(--warn); font-size: 11.5px; }

/* ------------------------------------------------------------- 数据健康 */
.health-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 11px 13px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line-soft); }
.stat b { display: block; font-family: var(--mono); font-size: 20px; line-height: 1.3; }
.stat span { color: var(--text-3); font-size: 11.5px; }

.quality-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.q-box { padding: 12px 14px; border-radius: var(--radius); background: rgba(11, 15, 23, 0.5); border: 1px solid var(--line-soft); }
.q-box h4 { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.q-box ul { margin: 0; padding-left: 16px; color: var(--text-3); font-size: 12px; }
.q-box li { margin: 2px 0; }
.q-box .q-empty { color: var(--text-3); font-size: 12px; }

.prov-list { display: flex; flex-direction: column; }
.prov {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 2px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.prov:last-child { border-bottom: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.dot.ok { background: var(--down); box-shadow: 0 0 0 3px rgba(22, 199, 132, 0.14); }
.dot.bad { background: var(--up); box-shadow: 0 0 0 3px rgba(255, 80, 100, 0.12); }
.prov .name { color: var(--text-2); }
.prov .prov-detail { margin-left: auto; color: var(--text-3); font-family: var(--mono); font-size: 11px; text-align: right; }

.loglist { max-height: 320px; overflow-y: auto; border-radius: var(--radius); border: 1px solid var(--line-soft); }
.logrow {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  padding: 6px 10px; font-size: 11.5px; font-family: var(--mono);
  border-bottom: 1px solid var(--line-soft); color: var(--text-3);
}
.logrow:last-child { border-bottom: 0; }
.logrow.ok { color: #a9c6b8; }
.logrow.bad { color: #ffb5a0; }
.logrow .lg-ms { color: var(--text-3); }
.logrow .lg-time { color: var(--text-3); }

.events { display: flex; flex-direction: column; }
.ev { padding: 9px 2px; border-bottom: 1px solid var(--line-soft); }
.ev:last-child { border-bottom: 0; }
.ev a { color: var(--text); font-size: 13px; }
.ev a:hover { color: var(--accent); }
.ev .ev-meta { color: var(--text-3); font-size: 11px; font-family: var(--mono); margin-top: 2px; }
.ev p { color: var(--text-3); font-size: 12px; margin-top: 3px; }

/* ------------------------------------------------------------- 加载/错误 */
.loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 70px 20px; color: var(--text-2); }
.loading-sub { color: var(--text-3); font-size: 12px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(79, 157, 255, 0.2); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err {
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid rgba(255, 80, 100, 0.35); background: rgba(255, 80, 100, 0.08); color: #ffc4cd;
  font-size: 13px;
}
.err b { color: #fff; }

.foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; }
.foot p + p { margin-top: 6px; font-family: var(--mono); }
#footMeta { color: var(--text-3); }
#footStatic { color: var(--warn); }

/* ------------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .epi-legend { grid-template-columns: 1fr; }
  .gate-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-panel { grid-template-columns: 1fr; }
  .hd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .tabs { order: 3; flex-basis: 100%; padding-bottom: 2px; }
  .top-right { margin-left: auto; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { padding: 10px 12px; }
  .brand-txt span { display: none; }
  .asof { display: none; }
  .app { padding: 12px 12px 30px; }
  .card { padding: 14px 14px; border-radius: var(--radius); }
  .hero { padding: 16px; }
  .hero-top { flex-wrap: wrap; row-gap: 6px; }
  .hero-asof { white-space: nowrap; }
  .hero-meters { flex-direction: column; align-items: stretch; gap: 16px; }
  .gauge-wrap { align-self: center; }
  .state-name { font-size: 30px; }
  .fact-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .fact-row .fn { grid-column: 1 / -1; white-space: normal; }
  .fact-row .fz { justify-self: end; }
  .vs { grid-template-columns: 1fr; }
  .plan-top { grid-template-columns: 1fr; }
  .gate-detail { grid-template-columns: 1fr; }
  .health-stats { grid-template-columns: 1fr 1fr; }
  .cond { grid-template-columns: 1fr; }
  .cond-right { text-align: left; }
  .hd-grid { grid-template-columns: 1fr 1fr; }
  .qa-log { max-height: 340px; }
  .table { min-width: 620px; }
  .sbar { grid-template-columns: 78px 1fr 66px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
