/* ============================================================
   🛡️ 哨兵 · OpenAI 风格主题
   简洁 | 干净 | 低视觉噪音
   ============================================================ */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* ===== Design Tokens — OpenAI 深色风格 ===== */
:root {
  /* 背景 — 浅色主题（字族/字号不变） */
  --bg-deep: #f4f6f8;
  --bg-main: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef2f6;
  --bg-elevated: #f8fafc;
  --bg-surface: #f1f5f9;
  --bg-input: #ffffff;

  /* 主色调 */
  --acc: #0d9f6e;
  --acc-soft: rgba(13, 159, 110, .10);
  --acc-glow: rgba(13, 159, 110, .16);
  --acc-light: rgba(13, 159, 110, .22);

  /* 图文色 — 仅色值适配浅底，字号字族不动 */
  --text: #334155;
  --text-bright: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --border-light: #eef2f6;

  /* 语义色 */
  --danger: #ef4444;
  --warn: #d97706;
  --info: #2563eb;
  --success: #16a34a;
  --purple: #7c3aed;
  --orange: #ea580c;

  /* 字号 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 18px;
  --fs-2xl: 24px;
  --fs-3xl: 32px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* 圆角 — OpenAI 惯用大圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 阴影 — 浅色主题 */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 8px 24px rgba(15,23,42,.10);
  --shadow-xl: 0 16px 48px rgba(15,23,42,.12);

  /* 过渡 */
  --transition: all .15s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  font-weight: 400;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--acc); text-decoration: none; }
a:hover { color: #0b7a54; text-decoration: none; }
::selection { background: var(--acc-soft); color: var(--acc); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Topbar — 线条更简洁 ===== */
.topbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  gap: 16px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 20px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar .brand .logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.topbar .brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.topbar .brand .info { display: flex; flex-direction: column; line-height: 1.2; }
.topbar .brand .info .name {
  font-size: 14px; font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -.2px;
}
.topbar .brand .info .org {
  font-size: 9.5px; color: var(--text-muted);
}
.topbar .nav-tabs {
  display: none !important; /* 与左侧栏重复且半失效，统一用侧栏 */
  gap: 2px;
  overflow-x: auto;
  flex: 1;
}
.topbar .nav-tabs a {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 500;
}
.topbar .nav-tabs a:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}
.topbar .nav-tabs a.active {
  color: var(--acc);
  background: var(--acc-soft);
}
.topbar .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar .actions button {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.topbar .actions button:hover {
  background: var(--bg-hover);
  border-color: var(--acc-light);
  color: var(--acc);
}
.lang-switch { display: flex; gap: 2px; }
.lang-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn.active { background: var(--acc-soft); color: var(--acc); border-color: var(--acc-glow); }
.lang-btn:hover { background: var(--bg-hover); }

/* ===== Layout ===== */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== Sidebar — 无图标版本 ===== */
.sidebar {
  width: 180px;
  background: var(--bg-main);
  border-right: 1px solid var(--border-light);
  padding: 4px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar .sec {
  padding: 14px 16px 6px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.sidebar .ni {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  font-weight: 400;
}
.sidebar .ni:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}
.sidebar .ni.active {
  background: var(--acc-soft);
  color: var(--acc);
  border-left-color: var(--acc);
  font-weight: 500;
}
.sidebar .ni .ic { display: none !important; }
.sidebar .ni .pct {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
}
.sidebar .ni .pct.ph { color: var(--success); }
.sidebar .ni .pct.pm { color: var(--warn); }
.sidebar .ni .pct.pl { color: var(--danger); }

/* ===== Main / Content Area ===== */
.main, .content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

/* ===== Stats Cards ===== */
.stats-bar, .sr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}
.sc:hover {
  border-color: var(--acc-glow);
  background: var(--bg-hover);
}
.sc .n {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: -.3px;
}
.sc .num-unit { font-size: 13px; color: var(--text-muted); }
.sc .l {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== Page Sections ===== */
.page {
  display: none;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.page.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}
.page.active > .st,
.page.active > .tbr {
  flex-shrink: 0;
  padding: 10px 16px;
  margin: 0;
}
.page.active > .tbr { padding-top: 0; }
.page.active > .divination-form,
.page.active > div[id] {
  padding: 0 16px 16px;
  box-sizing: border-box;
}
.page.active > .divination-form { padding-top: 16px; }
#p-chat.page.active { overflow: hidden; }
#p-chat.page.active > .st {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
#p-chat .chat-a { flex: 1; min-height: 0; }

/* ===== Section Block (Overview) ===== */
.section-block {
  margin-bottom: 8px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
}
.section-header .section-icon { display: none !important; }
.section-header .section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: normal;
}
.section-header .section-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== Section Title ===== */
.st {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: normal;
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
.tgg { background: rgba(25, 195, 125, .12); color: var(--acc); }
.tgy { background: rgba(245, 179, 66, .12); color: var(--warn); }
.tgr { background: rgba(239, 68, 68, .12); color: var(--danger); }
.tgc { background: rgba(59, 130, 246, .12); color: var(--info); }

/* ===== Tab Bar ===== */
.tab-bar, .tbr {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tb {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.tb:hover {
  background: var(--bg-hover);
  border-color: var(--acc-glow);
  color: var(--acc);
  text-decoration: none;
}
.tb.act {
  background: var(--acc-soft);
  border-color: var(--acc-glow);
  color: var(--acc);
}

/* ===== Charts ===== */
.charts-row, .chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) { .chart-row { grid-template-columns: 1fr; } }
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  min-height: 280px;
}
.chart-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.chart-title .dot { display: none; }
.chart-body {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-box canvas { max-height: 220px; max-width: 100%; }
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-muted);
}
.loading-state .sp {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: sp .6s linear infinite;
  margin-bottom: 8px;
}
.loading-state .msg { font-size: 12px; }
@keyframes sp { to { transform: rotate(360deg); } }
.error-state {
  text-align: center; padding: 24px;
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.12);
  border-radius: 8px; margin: 10px 0;
}
.error-state .err-icon { font-size: 24px; margin-bottom: 6px; }
.error-state .err-msg { font-size: 12px; color: var(--danger); }
.error-state .err-detail { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.error-state .retry-btn {
  margin-top: 8px; padding: 5px 16px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.15);
  border-radius: 6px; color: var(--danger);
  font-size: 11px; cursor: pointer;
}

/* ===== Gauge ===== */
.gauge-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
}
.gauge-wrap .gauge-score {
  font-size: 32px; font-weight: 600;
  color: var(--text-bright); letter-spacing: -.5px;
}
.gauge-wrap .gauge-label { font-size: 11px; color: var(--text-muted); }
.gauge-wrap .gauge-hint { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ===== Risk Radar ===== */
.risk-radar-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 0 16px 16px;
}
.risk-radar-row.is-pending {
  min-height: 0; padding: 0; margin: 0;
  border: none; background: transparent; overflow: hidden;
}
.risk-radar-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.risk-radar-title .risk-radar-badge {
  font-size: 11px; background: var(--acc-soft);
  color: var(--acc); padding: 2px 10px;
  border-radius: 20px; font-weight: 500;
}
.risk-radar-content { display: flex; gap: 16px; align-items: stretch; }
.risk-radar-chart-box { flex: 0 0 260px; display: flex; align-items: center; justify-content: center; }
.risk-radar-chart-box canvas { max-width: 260px; max-height: 260px; }
.risk-radar-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.risk-radar-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  background: var(--bg-hover);
  border-radius: 6px; font-size: 12px;
}
.risk-radar-item .rri-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.risk-radar-item .rri-name { color: var(--text-muted); min-width: 60px; flex-shrink: 0; }
.risk-radar-item .rri-score { font-weight: 600; min-width: 24px; text-align: right; }
.risk-radar-item .rri-bar {
  flex: 1; height: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 2px; overflow: hidden; margin: 0 6px;
}
.risk-radar-item .rri-fill { height: 100%; border-radius: 2px; transition: width .6s ease; }
.risk-radar-item .rri-level {
  font-size: 10px; padding: 1px 5px;
  border-radius: 3px; flex-shrink: 0;
}
.risk-radar-item .rri-issues { color: var(--warn); font-size: 10px; }
@media (max-width: 768px) {
  .risk-radar-content { flex-direction: column; }
  .risk-radar-chart-box { flex: none; }
  .risk-radar-chart-box canvas { max-width: 200px; max-height: 200px; }
}

/* ===== Module Cards ===== */
.module-grid, .mg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: var(--transition);
}
.mc:hover {
  border-color: var(--acc-glow);
  background: var(--bg-hover);
}
.mc .t { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mc .t .i { display: none; } /* 隐藏图标 */
.mc .t .nm { font-size: 12px; font-weight: 600; color: var(--text-bright); flex: 1; }
.mc .t .pc { font-size: 11px; }
.mc .b {
  height: 3px; background: var(--border-light);
  border-radius: 2px; margin-bottom: 4px; overflow: hidden;
}
.mc .b .f { height: 100%; border-radius: 2px; transition: width .4s ease; }
.mc .b .f.ph { background: var(--success); }
.mc .b .f.pm { background: var(--warn); }
.mc .b .f.pl { background: var(--danger); }
.mc .d { font-size: 10px; color: var(--text-muted); line-height: 1.5; }

/* ===== Footer ===== */
.footer {
  padding: 10px 20px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--bg-main);
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
}

/* ===== Chat ===== */
.chat-area { max-width: 720px; margin: 0 auto; }
.chat-msgs {
  max-height: 480px; overflow-y: auto;
  padding: 16px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}
.msg-row { margin-bottom: 12px; }
.msg-row:last-child { margin-bottom: 0; }
.msg-bubble {
  max-width: 80%; padding: 10px 14px;
  border-radius: 12px; font-size: 13px;
  line-height: 1.5;
}
.msg-user { background: var(--acc); color: #ffffff; margin-left: auto; }
.msg-agent {
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border);
}
.chat-input-area { display: flex; gap: 8px; }
.chat-input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input); color: var(--text);
  font-size: 13px; font-family: inherit; outline: none;
}
.chat-input:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.chat-send {
  padding: 10px 20px;
  border: none; border-radius: 8px;
  background: var(--acc); color: #ffffff;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.chat-send:hover { background: #10a86a; }

/* ===== Chat (inline) ===== */
.chat-a { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; }
.chat-m { flex: 1; overflow-y: auto; padding: 12px 16px; }
.chat-m .msg { margin-bottom: 10px; display: flex; gap: 8px; }
.chat-m .msg.u { flex-direction: row-reverse; }
.chat-m .msg .av {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.chat-m .msg.a .av { background: var(--acc-soft); border: 1px solid var(--acc-glow); }
.chat-m .msg.u .av { background: var(--bg-hover); border: 1px solid var(--border); }
.chat-m .msg .b {
  max-width: 80%; padding: 8px 12px;
  border-radius: 10px; line-height: 1.5; font-size: 13px;
}
.chat-m .msg.a .b { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.chat-m .msg.u .b { background: var(--acc); color: #ffffff; }
.chat-i {
  display: flex; gap: 8px;
  padding: 8px 16px;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
}
.chat-i input {
  flex: 1; padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text);
  font-size: 13px; outline: none;
}
.chat-i input:focus { border-color: var(--acc); }
.chat-i button {
  padding: 8px 16px; border-radius: 8px;
  border: none; background: var(--acc); color: #ffffff;
  font-weight: 500; font-size: 12px; cursor: pointer;
}
.chat-i button:hover { background: #10a86a; }
.chat-actions {
  display: flex; gap: 6px;
  padding: 4px 16px 8px; justify-content: flex-end;
}
.chat-actions .btn-sm {
  font-size: 11px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
}
.chat-actions .btn-sm:hover { background: var(--bg-hover); border-color: var(--acc-glow); color: var(--acc); }
.chat-actions .btn-sm.primary { border-color: var(--danger); color: var(--danger); }
.chat-actions .btn-sm.primary:hover { background: rgba(239,68,68,.08); }

/* ===== Tables ===== */
.dt, table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
th {
  text-align: left; padding: 7px 10px;
  font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
}
td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); color: var(--text); }
tr:hover td { background: var(--bg-hover); }

/* ===== Panel ===== */
.pn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.pn h3 { font-size: 12px; color: var(--text); margin-bottom: 10px; font-weight: 500; }
.pn .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pn .it { font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.pn .it .lb { color: var(--text-dim); font-size: 10px; }
.pn .it .vl { color: var(--text); margin-top: 1px; }

/* ===== Alert Banners ===== */
.ab {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.12);
  border-radius: 6px; padding: 8px 14px;
  font-size: 11px; color: var(--danger);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.ab.w { background: rgba(245,179,66,.06); border-color: rgba(245,179,66,.12); color: var(--warn); }
.ab.i { background: var(--acc-soft); border-color: var(--acc-glow); color: var(--acc); }

/* ===== Empty / Emp ===== */
.emp { text-align: center; padding: 24px; color: var(--text-dim); font-size: 13px; }

/* ===== Loading ===== */
.loading-state .sp { display: inline-block; } /* already defined above, keep for compat */

/* ===== Divination Form ===== */
.divination-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.divination-form .form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.divination-form .form-row-extra { display: flex; gap: 12px; margin-top: 10px; }
.divination-form .form-group { flex: 1; min-width: 100px; }
.divination-form .form-group label {
  display: block; font-size: 10.5px;
  color: var(--text-muted); margin-bottom: 4px;
}
.divination-form .form-group .form-note { color: var(--text-dim); font-size: 9px; }
.divination-form .form-input {
  width: 100%; padding: 6px 10px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-bright);
  font-size: 13px; outline: none;
}
.divination-form .form-input:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.divination-form .form-actions { display: flex; gap: 8px; margin-top: 12px; }
.divination-form .btn-primary, .divination-form .btn-secondary {
  padding: 7px 16px; border-radius: 6px; border: none;
  cursor: pointer; font-size: 12px; font-weight: 500;
}
.divination-form .btn-primary { background: var(--acc); color: #ffffff; }
.divination-form .btn-primary:hover { background: #10a86a; }
.divination-form .btn-secondary { background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border); }
.divination-form .btn-secondary:hover { background: var(--bg-hover); color: var(--text); }

/* ===== Primary Button ===== */
.btn-primary {
  padding: 7px 18px; border-radius: 8px;
  border: none; background: var(--acc); color: #ffffff;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.btn-primary:hover { background: #10a86a; }

/* ===== Hover card for index.html ===== */
.sc.loading .n { color: var(--text-dim); position: relative; }
.sc.loading .n::after { content: '...'; animation: dots 1.2s infinite; }
@keyframes dots { 0%,20%{opacity:0} 50%{opacity:1} 80%,100%{opacity:0} }

/* ===== i18n helper ===== */
[data-i18n] { }

/* ===== Section Title with st class ===== */
.st { font-size: var(--fs-lg); font-weight: 600; color: var(--text-bright); margin-bottom: var(--space-md); padding: 0 var(--space-md) 8px; border-bottom: 1px solid var(--border); }

/* ===== Inline code/pre styling ===== */
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; color: var(--text); }
pre { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12px; }

/* ===== Reset utility ===== */
input, select, textarea {
  font-family: inherit;
}


/* ===== OCR 弹层（默认隐藏，避免露在页面底部） ===== */
.ocr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ocr-overlay.show {
  display: flex;
}
.ocr-modal {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.ocr-modal h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-bright);
}
.ocr-modal .preview-box {
  margin: 12px 0;
  text-align: center;
}
.ocr-modal .preview-box img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ocr-modal .ocr-loading {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
}
.ocr-modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.ocr-modal .actions button {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.ocr-modal .actions .secondary {
  background: var(--bg-hover);
  color: var(--text);
}
.ocr-modal .actions .primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}
.ocr-success { color: var(--success); font-size: 13px; margin-bottom: 8px; }
.ocr-imported { color: var(--warn); font-size: 12px; margin-bottom: 8px; }
.ocr-dropzone {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
}
.ocr-dropzone:hover, .ocr-dropzone.dragover {
  border-color: var(--acc);
  background: var(--acc-soft);
}
#fileInput { display: none; }


/* ===== Content font align sidebar ===== */
.main, .content, .page {
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
}
.page .st,
.page h3, .page h4, .page h5,
.section-title,
.chart-title,
.mc .t .nm {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  letter-spacing: normal !important;
}
.page .st .tag { font-size: 10px; font-weight: 500; }
.tb, .btn-primary, .btn-secondary, .divination-form .btn-primary,
.divination-form .btn-secondary, .topbar .actions button {
  font-size: 12px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
}

/* 全站统一：标题前不显示装饰图标 */
.sidebar .ni .ic,
.section-header .section-icon,
.mc .t .i,
.mc .t .ic,
.chart-title .dot,
.module-card .card-header .icon,
.risk-radar-item .rri-dot {
  display: none !important;
}
.chat-m .msg .av,
.ocr-dropzone > div:first-child,
.error-state .err-icon {
  display: none !important;
}


/* security panel clarity */
#p-security .st { font-size: 12px; font-weight: 500; color: var(--text); }
#p-security .tbr { gap: 6px; }
#sc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}
#sc h3 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
#sc .stats-row, #sc .sr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
#sc .sc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
#sc .sc .n { font-size: 22px; font-weight: 700; color: var(--text-bright); }
#sc .sc .l { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
#sc .alert-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--acc);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text);
}
#sc .alert-item.high { border-left-color: var(--danger); background: rgba(239,68,68,.04); }
#sc .alert-item.medium { border-left-color: var(--warn); background: rgba(217,119,6,.04); }
#sc .alert-item.low { border-left-color: var(--success); background: rgba(22,163,74,.04); }
#sc .html-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
}
#sc .html-content h1, #sc .html-content h2, #sc .html-content h3 {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  margin: 12px 0 8px;
}
#sc .html-content p, #sc .html-content li { color: var(--text); font-size: 12px; }
#sc .emp {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 12px;
}
#sc .dt { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
#sc .dt th {
  text-align: left; padding: 8px 10px;
  background: var(--bg-surface); color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 11px;
}
#sc .dt td {
  padding: 8px 10px; border-bottom: 1px solid var(--border-light); color: var(--text);
}
#sc .sec-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
#sc .sec-block .sec-title {
  font-size: 12px; font-weight: 500; color: var(--text);
  margin-bottom: 10px;
}

/* API 注入片段：法律 / 安全 */
.sec-fragment, .legal-fragment { font-size: 12px; color: var(--text); line-height: 1.6; }
.sec-fragment h2, .sec-fragment h3, .legal-fragment h2, .legal-fragment h3 {
  font-size: 13px; font-weight: 600; color: var(--text-bright);
  margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light);
}
.sec-fragment .stats-4col, .legal-fragment .stats-4col {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0;
}
.sec-fragment .stat-card, .legal-fragment .stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center;
}
.sec-fragment .stat-value, .legal-fragment .stat-value { font-size: 22px; font-weight: 700; color: var(--text-bright); }
.sec-fragment .stat-label, .legal-fragment .stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.sec-fragment .section, .legal-fragment .section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px;
}
.sec-fragment .selfcheck-item, .sec-fragment .incident-item, .sec-fragment .plan-scenario {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 6px 0;
}
.sec-fragment .selfcheck-category { display: inline-block; background: rgba(13,159,110,.08); color: var(--accent); padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-bottom: 4px; }
.sec-fragment .selfcheck-question { font-size: 13px; margin: 4px 0; color: var(--text); }
.sec-fragment .selfcheck-tips { font-size: 12px; color: var(--text-muted); border-left: 2px solid var(--border); padding-left: 8px; margin-top: 4px; }
.sec-fragment .plan-title { color: var(--text-bright); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.sec-fragment .data-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.sec-fragment .tag { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; }
.sec-fragment .tag-warn { background: rgba(217,119,6,.1); color: var(--warn); }
.sec-fragment .tag-proc { background: rgba(59,130,246,.1); color: #2563eb; }
.sec-fragment .tag-done { background: rgba(22,163,74,.1); color: var(--success); }

#lc .legal-fragment .alert-item, #sc .sec-fragment .alert-item {
  padding: 10px 12px; margin: 6px 0; border-radius: 8px; font-size: 12px;
  border-left: 3px solid var(--accent); background: var(--bg-card); border: 1px solid var(--border);
}
#lc .legal-fragment .alert-item.high, #sc .sec-fragment .alert-item.high { border-left-color: var(--danger); }
#lc .legal-fragment .alert-item.medium, #sc .sec-fragment .alert-item.medium { border-left-color: var(--warn); }
#lc .legal-fragment .alert-item.low, #sc .sec-fragment .alert-item.low { border-left-color: var(--success); }
