/* 城发股权 · AI 指挥舱 —— 亮色企业级界面；仅负责视觉，不改变数据与交互 */
:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --card-subtle: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #172033;
  --muted: #64748b;
  --red: #dc2626;
  --red-soft: #fff1f2;
  --yellow: #b45309;
  --yellow-soft: #fffbeb;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --purple: #7c3aed;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .035);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, .10);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -10%, rgba(37, 99, 235, .055), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 2px;
}
button { transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
::selection { background: #dbeafe; color: #1e3a8a; }

/* ---------- 顶栏 ---------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(15, 23, 42, .025);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.brand { font-size: 18px; font-weight: 650; letter-spacing: .2px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 700; }
#mainnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item {
  position: relative;
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .16s, color .16s;
}
.nav-item:hover { background: var(--card-subtle); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.asof { color: var(--muted); font-size: 12px; white-space: nowrap; }
#globalSearch {
  width: 224px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  color: var(--text);
  transition: border-color .16s, background-color .16s, box-shadow .16s;
}
#globalSearch::placeholder, input::placeholder { color: #94a3b8; }
#globalSearch:focus { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.btn-ghost, .btn-primary, .btn-mini, .btn-danger {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.btn-ghost { border: 1px solid var(--line); background: #fff; color: #334155; }
.btn-ghost:hover { border-color: #bfdbfe; background: var(--blue-soft); color: var(--accent); }
.btn-primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 12px rgba(37, 99, 235, .18); }
.btn-mini { min-height: 30px; padding: 4px 11px; border: 1px solid var(--line); background: #fff; color: #334155; font-size: 12px; }
.btn-mini:hover { color: var(--accent); border-color: #93c5fd; background: var(--blue-soft); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: var(--red-soft); border-color: #fca5a5; }

/* ---------- 设置下拉 ---------- */
.settings-wrap { position: relative; }
.dropdown {
  position: absolute;
  right: 0;
  top: 44px;
  width: 216px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 60;
  box-shadow: var(--shadow-md);
}
.dropdown a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 7px; cursor: pointer; color: #334155; }
.dropdown a:hover { background: var(--blue-soft); color: var(--accent); }
.dropdown a span { color: var(--muted); font-size: 11px; }
.dropdown a.disabled { color: #94a3b8; cursor: not-allowed; }
.dropdown a.disabled:hover { background: transparent; }

/* ---------- 主体与通用标题 ---------- */
#content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 24px 28px 36px; }
.page { min-width: 0; }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; min-height: 38px; }
.page-head h2, .maintain-head h2 { margin: 0; font-size: 22px; line-height: 1.35; letter-spacing: -.3px; }
.page-head h2::after, .maintain-head h2::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-left: 10px;
  border-radius: 4px;
  background: var(--accent);
  vertical-align: -2px;
}
.hint, .maintain-tip { color: var(--muted); font-size: 12px; line-height: 1.7; }
.maintain-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.maintain-head h2 { margin-bottom: 0; }
.maintain-tip { margin-bottom: 14px; }
.readonly-badge { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid #bfdbfe; border-radius: 999px; background: var(--blue-soft); color: var(--accent); font-size: 11px; font-weight: 650; }
#publicReadOnly { flex: none; }
.public-readonly .write-action,
.public-readonly [data-action="importexport"],
.public-readonly [data-action="demo"] { display: none !important; }
.maintain-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.maintain-tabs { margin: 0; flex: none; }
.maintain-search { width: 260px; height: 36px; margin-left: auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.maintain-search:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.maintain-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.maintain-table-wrap { min-height: 320px; max-height: calc(100vh - 250px); }
.maintain-table { width: max-content; min-width: 100%; }
.maintain-table th { min-width: 110px; }
.maintain-table td { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.maintain-table th:first-child, .maintain-table td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 var(--line); }
.maintain-table th:first-child { z-index: 4; background: #f8fafc; }
.maintain-table tr:hover td:first-child { background: #f8fbff; }
.maintain-number { text-align: right; font-variant-numeric: tabular-nums; }
.maintain-note { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tabs, .view-tabs, .io-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs { margin-bottom: 16px; }
.tab {
  min-height: 34px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
}
.tab:hover { background: #eaf0f7; color: var(--text); }
.tab.active, .io-tabs .tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; border-color: #bfdbfe; }
.io-tabs { margin-bottom: 18px; padding: 4px; width: fit-content; background: #eaf0f7; border-radius: 10px; }
.io-tabs .tab { padding: 7px 14px; border: 1px solid transparent; color: var(--muted); cursor: pointer; }

/* ---------- 指挥舱：一屏仪表盘，空间用于内容而非简单拉高 ---------- */
#page-cockpit { height: calc(100dvh - 128px); min-height: 620px; display: flex; flex-direction: column; }
#page-cockpit .cockpit-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(220px, 1fr) auto;
  gap: 16px;
}
#page-cockpit .col { display: contents; }
#page-cockpit .kpi-grid { grid-column: 1 / 9; grid-row: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-card {
  position: relative;
  min-height: 132px;
  padding: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #bfdbfe; }
.kpi-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 8px 22px rgba(15, 23, 42, .08); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi-value { margin: 10px 0 6px; color: #0f172a; font-size: clamp(23px, 2vw, 30px); line-height: 1.15; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; word-break: break-all; }
.kpi-value.pos { color: var(--green); }
.kpi-sub { color: var(--muted); font-size: 11px; line-height: 1.6; }
#page-cockpit .bar { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#page-cockpit #riskBar { grid-column: 1 / 5; grid-row: 2; }
#page-cockpit #supervisionBar { grid-column: 5 / 9; grid-row: 2; }
.bar { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.bar-risk { background: linear-gradient(145deg, #fff 35%, var(--red-soft)); border-color: #fecdd3; }
.bar-supervision { background: linear-gradient(145deg, #fff 35%, var(--yellow-soft)); border-color: #fde68a; }
.bar-head { flex: none; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 650; font-size: 15px; }
.bar-risk .bar-head { color: var(--red); }
.bar-supervision .bar-head { color: var(--yellow); }
.bar-count { margin-left: auto; font-size: 26px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.bar-list { flex: none; max-height: 104px; overflow: auto; padding-right: 4px; color: #475569; font-size: 12px; line-height: 1.8; white-space: pre-line; }
.bar-visual { flex: 1; min-height: 132px; display: flex; align-items: center; justify-content: center; gap: 26px; padding: 14px 0; }
.bar-donut { position: relative; flex: none; width: clamp(110px, 16vh, 150px); height: clamp(110px, 16vh, 150px); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .08); }
.bar-donut::before { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 1px rgba(100, 116, 139, .08); }
.bar-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bar-donut-value { color: #0f172a; font-size: 30px; line-height: 1.1; font-weight: 750; font-variant-numeric: tabular-nums; }
.bar-donut-label { margin-top: 5px; color: var(--muted); font-size: 11px; }
.bar-legend { min-width: 108px; display: flex; flex-direction: column; gap: 8px; }
.bar-legend-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; min-width: 110px; padding: 6px 0; color: #475569; font-size: 12px; }
.bar-legend-swatch { width: 9px; height: 9px; border-radius: 50%; }
.bar-legend-value { color: #0f172a; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(100, 116, 139, .15); font-size: 11px; color: var(--muted); }
.bar-empty { color: var(--muted); font-size: 12px; line-height: 1.8; }
#page-cockpit .xj-main { grid-column: 9 / 13; grid-row: 1 / 4; }
.xj-main {
  width: 100%;
  padding: 26px;
  display: flex;
  flex-direction: column;
  text-align: center;
  background: linear-gradient(160deg, #fff 15%, #f5f9ff 100%);
  border: 1px solid #dbe7f6;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(37, 99, 235, .07);
}
.xj-avatar { width: 124px; height: 124px; margin: 0 auto 12px; display: block; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(37, 99, 235, .14)); }
.xj-main:has(.xj-answer:empty) .xj-avatar { margin-top: auto; }
.xj-main:has(.xj-answer:empty) .xj-quick { margin-bottom: auto; }
.xj-title { font-size: 18px; font-weight: 700; letter-spacing: .1px; }
.xj-sub { color: var(--muted); font-size: 12px; margin: 6px 0 18px; }
.xj-ask { display: flex; gap: 8px; margin-bottom: 14px; }
.xj-ask input { flex: 1; min-width: 0; height: 38px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); }
.xj-ask input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.xj-quick { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.xj-quick button, .xj-quickrow button { padding: 5px 10px; border-radius: 999px; border: 1px solid #dbe7f6; background: #fff; color: #526177; cursor: pointer; font-size: 11px; }
.xj-quick button:hover, .xj-quickrow button:hover { color: var(--accent); border-color: #93c5fd; background: var(--blue-soft); }
.xj-answer { flex: 1; min-height: 140px; margin-top: 16px; padding: 13px 14px; overflow: auto; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: #334155; font-size: 13px; line-height: 1.7; }
.xj-answer:empty { display: none; }
.placeholder-card { background: var(--card-subtle); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
#page-cockpit #inspectPlaceholder { grid-column: 1 / 9; grid-row: 3; min-height: 52px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ph-title { font-size: 13px; color: #475569; font-weight: 600; margin-bottom: 5px; }
.ph-text { font-size: 12px; }
#page-cockpit #inspectPlaceholder .ph-title { margin-bottom: 0; }

/* ---------- 表格 / 三表维护 ---------- */
.table-wrap { overflow: auto; max-height: 72vh; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { border-bottom: 1px solid #edf2f7; padding: 10px 12px; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #526177; font-weight: 650; box-shadow: inset 0 -1px 0 var(--line); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fbff; }
.empty-row td { text-align: center; color: var(--muted); padding: 36px; }
.big-placeholder { text-align: center; padding: 120px 20px; color: var(--muted); }
.bp-title { font-size: 22px; color: var(--text); margin-bottom: 10px; }
.bp-text { font-size: 14px; }

/* ---------- 全局搜索浮层 ---------- */
#searchResults {
  position: fixed;
  right: max(28px, calc((100vw - 1560px) / 2 + 28px));
  top: 62px;
  width: min(460px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 70;
  box-shadow: var(--shadow-md);
}
.sr-group { margin-bottom: 10px; }
.sr-group h4 { margin: 6px 4px; color: var(--muted); font-size: 12px; }
.sr-item { padding: 9px 10px; border-radius: 8px; background: var(--card-subtle); border: 1px solid #edf2f7; margin-bottom: 6px; font-size: 12px; }
.sr-item b { color: var(--text); }
.sr-empty { color: var(--muted); padding: 20px 16px; text-align: center; }

/* ---------- 小金悬浮球 + 气泡 + 面板 ---------- */
.xj-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dbe7f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .18);
  user-select: none;
}
.xj-fab:hover { border-color: #93c5fd; box-shadow: 0 10px 28px rgba(37, 99, 235, .24); }
.xj-fab img { width: 88%; height: 88%; object-fit: contain; pointer-events: none; }
.xj-bubble { position: fixed; right: 94px; bottom: 34px; max-width: 320px; background: #fff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 11px 14px; color: #334155; font-size: 12px; line-height: 1.6; z-index: 90; box-shadow: var(--shadow-md); animation: bubbleIn .3s ease-out; }
.xj-bubble .bb-badge { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.xj-panel { position: fixed; right: 24px; bottom: 94px; width: 372px; height: min(540px, calc(100vh - 130px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; z-index: 95; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 48px rgba(15, 23, 42, .16); }
.xj-panel-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; background: #f8fbff; border-bottom: 1px solid var(--line); font-weight: 650; }
.xj-head-avatar { width: 30px; height: 30px; object-fit: contain; flex: none; }
.xj-badge { font-size: 10px; color: var(--muted); font-weight: 400; }
.xj-close { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.xj-close:hover { color: var(--text); }
.xj-quickrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.xj-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfdff; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .msg-src { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.msg.user .msg-src { color: rgba(255, 255, 255, .78); }
.msg .msg-degraded { color: var(--yellow); }
.xj-inputrow { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.xj-inputrow input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-subtle); color: var(--text); }

/* ---------- 公司 / 项目：筛选、标签、架构树 ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.filter-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.filter-item select { min-height: 34px; padding: 5px 28px 5px 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #334155; }
.filter-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); background: #fff; }
.tag-rel { color: var(--blue); border-color: #bfdbfe; background: var(--blue-soft); }
.tag-status { color: #526177; background: var(--card-subtle); }
.dot { font-size: 12px; margin-left: 4px; }
.dot-risk { color: var(--red); }
.dot-sup { color: var(--yellow); }
.legend { color: var(--muted); font-size: 11px; margin-top: 12px; }
.tree { padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tree-node { margin: 2px 0; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; }
.tree-row:hover { background: var(--blue-soft); }
.tree-name { color: #334155; cursor: pointer; font-weight: 600; }
.tree-name:hover { color: var(--accent); text-decoration: underline; }
.tree-children { margin-left: 22px; border-left: 1px dashed var(--line-strong); padding-left: 10px; }
.cbar { position: relative; width: 90px; height: 16px; background: #e8eef5; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.cbar-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #22c55e); }
.cbar-txt { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 14px; color: #0f172a; font-weight: 600; }
.recent-cell { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cell-link { color: var(--blue); cursor: pointer; }
.cell-link:hover { text-decoration: underline; }
.pos-cell { color: var(--green); }
.neg-cell { color: var(--red); }
.row-sleeping td { color: #94a3b8; }
.empty-state { text-align: center; padding: 72px 20px; color: var(--muted); background: rgba(255, 255, 255, .55); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.es-title { font-size: 17px; color: #334155; font-weight: 600; margin-bottom: 8px; }
.es-sub { font-size: 12px; line-height: 1.7; }

/* ---------- 详情头 / 信息卡 ---------- */
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head h2 { margin: 0; font-size: 21px; line-height: 1.4; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.info-card-title { font-weight: 650; margin-bottom: 10px; color: var(--accent); font-size: 14px; }
.info-row { display: flex; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.info-row:last-child { border-bottom: none; }
.info-k { color: var(--muted); width: 132px; flex-shrink: 0; }
.info-v { color: #334155; flex: 1; word-break: break-word; }
.info-row2 { font-size: 13px; padding: 5px 0; }
.detail-section { margin-top: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h3 { margin: 0; font-size: 16px; }
.remind { color: var(--yellow); font-size: 12px; margin-top: 6px; }
.ok-tip { color: var(--green); font-size: 12px; margin-top: 6px; }
.pen-chain { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 8px; }
.pen-pct { font-size: 15px; }
.pen-pct b { font-size: 24px; color: var(--accent); }

/* ---------- 事项：阶段栏 + 详情侧栏 ---------- */
.events-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.phase-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.phase-col { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 9px; min-height: 140px; }
.phase-title { font-size: 12px; color: #526177; font-weight: 650; margin-bottom: 9px; text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.phase-empty { color: #94a3b8; font-size: 11px; text-align: center; padding: 14px 0; }
.event-item { background: #fff; border: 1px solid #edf2f7; border-left: 3px solid var(--line-strong); border-radius: 8px; padding: 9px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 3px rgba(15, 23, 42, .025); }
.event-item:hover { border-color: #bfdbfe; border-left-color: var(--accent); box-shadow: 0 3px 10px rgba(15, 23, 42, .06); }
.event-item.risk-urgent { border-left-color: var(--red); }
.event-item.risk-warn { border-left-color: #ea580c; }
.event-item.risk-watch { border-left-color: #d97706; }
.ev-date { color: var(--muted); font-size: 11px; }
.ev-title { color: #334155; font-size: 13px; margin: 4px 0; line-height: 1.5; }
.ev-type { color: var(--muted); font-size: 11px; }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.event-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 88px; box-shadow: var(--shadow-sm); }
.side-title { font-weight: 650; margin-bottom: 10px; font-size: 15px; }
.event-side .btn-ghost { margin-top: 10px; width: 100%; }
.policy-echo { margin-top: 14px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.pe-title { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.pe-body { font-size: 11px; color: var(--muted); line-height: 1.7; }

/* ---------- 文档 / 人员 / 趋势 ---------- */
.doc-group { margin-bottom: 16px; }
.doc-group-title { font-size: 13px; color: #526177; font-weight: 600; margin-bottom: 7px; }
.doc-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid #edf2f7; border-radius: 8px; margin-bottom: 7px; font-size: 12px; }
.doc-att { color: var(--muted); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.person-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow-sm); }
.person-name { font-weight: 650; margin-bottom: 9px; }
.post-line { font-size: 12px; padding: 4px 0; color: var(--muted); }
.post-title { color: var(--muted); }
.mini-trend { margin-top: 16px; }
.mt-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mt-bars { display: flex; gap: 12px; align-items: flex-end; height: 84px; }
.mt-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.mt-bar { width: 24px; background: linear-gradient(180deg, #60a5fa, var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; }
.mt-lab { font-size: 10px; color: var(--muted); margin-top: 5px; }

/* ---------- 智能洞察 ---------- */
.graph-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 18px; overflow: auto; box-shadow: var(--shadow-sm); }
.graph-card svg { display: block; max-width: none; margin: 0 auto; }
.graph-node circle { transition: filter .15s, opacity .15s; }
.graph-node:hover circle { filter: brightness(1.06); opacity: .9; }
.graph-tip { position: absolute; pointer-events: none; background: rgba(255, 255, 255, .98); border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 12px; color: #334155; font-size: 12px; z-index: 20; max-width: 260px; box-shadow: var(--shadow-md); }
.gt-name { font-weight: 650; margin-bottom: 4px; }
.gt-line { color: var(--muted); }
.gt-risk { color: var(--red); margin-top: 3px; }
.graph-legend { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 10px; border-top: 1px solid #f1f5f9; }
.lg-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.insight-card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.ic-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ic-title { font-weight: 650; font-size: 15px; }
.ic-count { background: var(--accent-soft); color: var(--accent); border: 1px solid #bfdbfe; font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ic-summary { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.ic-items { flex: 1; display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.ic-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.ic-item-name { color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.ic-item-val { color: var(--muted); }
.ic-empty { color: #94a3b8; font-size: 12px; }
.ic-jump { align-self: flex-start; }

/* ---------- 制度库 / 上传 ---------- */
.policy-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 20px; align-items: start; }
.policy-tree { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 88px; box-shadow: var(--shadow-sm); }
.pt-title { font-size: 12px; color: var(--muted); padding: 7px 9px; }
.pt-item { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #475569; }
.pt-item:hover { background: var(--card-subtle); color: var(--text); }
.pt-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.pt-count { opacity: .75; font-variant-numeric: tabular-nums; }
.policy-main { min-width: 0; }
.policy-main .page-head { padding: 4px 0; }
.policy-main .page-head h2 { margin-right: auto; }
#policySearch { height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); width: 240px; }
.upload-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.uf-title { font-size: 14px; color: var(--accent); font-weight: 650; margin-bottom: 12px; }
.uf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.uf-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.uf-field input, .uf-field select, .fin-draft input, .rp-sec-body, .map-wrap select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
}
.uf-field input, .uf-field select { min-height: 36px; padding: 7px 10px; }
.uf-msg { margin: 12px 0; font-size: 12px; color: var(--yellow); }
.uf-btns { display: flex; gap: 10px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); backdrop-filter: blur(3px); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-card { width: 760px; max-width: 94vw; max-height: 84vh; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(15, 23, 42, .22); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #f8fbff; border-bottom: 1px solid var(--line); font-weight: 650; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; overflow: auto; white-space: pre-wrap; color: #334155; font-size: 13px; line-height: 1.8; margin: 0; flex: 1; }
.modal-foot { padding: 11px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* ---------- 数据管理 ---------- */
.io-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.io-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.io-card-title { font-weight: 650; margin-bottom: 12px; font-size: 15px; }
.io-sub { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.io-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.io-row input[type=file], .io-row select { padding: 7px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #334155; font-size: 12px; max-width: 100%; }
.io-result { margin-top: 10px; max-height: 240px; overflow: auto; }
.io-msg { font-size: 12px; padding: 4px 0; line-height: 1.6; }
.io-msg.ok { color: var(--green); }
.io-msg.err { color: var(--red); }
.io-msg.warn { color: var(--yellow); }
.io-msg.hint { color: var(--muted); }
.io-note { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.cmp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 820px; box-shadow: var(--shadow-sm); }
.cmp-lab { font-size: 12px; color: var(--muted); min-width: 70px; }
.cmp-out { margin-top: 14px; }
.cmp-sum { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 10px; }

/* ---------- 演示模式 / 空态引导 ---------- */
.empty-banner { background: linear-gradient(110deg, #eff6ff, #fff); border: 1px solid #bfdbfe; border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.empty-banner .es-title { font-size: 16px; font-weight: 650; margin-bottom: 6px; color: #1e40af; }
.empty-banner .es-sub { color: var(--muted); font-size: 13px; line-height: 1.7; }
.demo-body { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.demo-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.demo-card-title { font-weight: 650; margin-bottom: 12px; font-size: 15px; }
.demo-line { font-size: 13px; color: #334155; padding: 4px 0; }
.demo-note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ---------- 财报草稿 / 制度返显 ---------- */
.fin-draft { margin-top: 14px; }
.fin-draft table { width: 100%; border-collapse: collapse; }
.fin-draft th, .fin-draft td { border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; text-align: left; }
.fin-draft th { position: static; box-shadow: none; }
.fin-draft input { width: 100%; padding: 6px 8px; }
.conf-high { color: var(--green); }
.conf-low { color: var(--yellow); font-weight: 600; }
.conf-miss { color: var(--red); font-weight: 600; }
.draft-tip { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.pe-tag { font-size: 10px; color: var(--accent); margin-bottom: 4px; }
.pe-item { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.pe-sum { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.5; }
.pe-none { color: #94a3b8; font-size: 12px; }

/* ---------- 情况汇报 / 报表填报 ---------- */
.rp-sec-title { font-weight: 650; margin: 14px 0 6px; color: var(--accent); font-size: 14px; }
.rp-sec-body { width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.7; resize: vertical; font-family: inherit; }
.report-body { display: flex; flex-direction: column; gap: 16px; }
.report-body > .demo-card, .report-body > .upload-form { margin-bottom: 0; }
.map-wrap { max-height: 440px; overflow: auto; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.map-wrap table { width: 100%; border-collapse: collapse; }
.map-wrap th, .map-wrap td { border-bottom: 1px solid var(--line); padding: 8px 10px; font-size: 12px; text-align: left; }
.map-wrap th { position: sticky; top: 0; background: #f8fafc; }
.map-wrap select { padding: 5px 7px; }

/* ---------- 工商巡检 ---------- */
.inspect-body { display: flex; flex-direction: column; gap: 16px; max-width: 960px; }
.inspect-counter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.ic-label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.ic-cap { font-size: 12px; color: var(--muted); }
.ic-num { font-size: 26px; font-weight: 750; padding: 0 4px; font-variant-numeric: tabular-nums; }
.ic-num.ic-risk { color: var(--red); }
.ic-num.ic-ic { color: var(--blue); }
.ic-num.ic-pop { animation: icpop .7s ease; }
@keyframes icpop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
.inspect-intro { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.ii-title { font-weight: 650; font-size: 15px; margin-bottom: 8px; }
.ii-text { color: var(--muted); font-size: 13px; line-height: 1.75; margin-bottom: 14px; }
.inspect-scan { background: #f8fbff; border: 1px solid #dbe7f6; border-radius: var(--radius); padding: 24px 18px; text-align: center; }
.is-head { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--blue); font-size: 13px; margin-bottom: 14px; }
.is-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: isblink .8s infinite; }
@keyframes isblink { 0%, 100% { opacity: .3; } 50% { opacity: 1; box-shadow: 0 0 8px rgba(37, 99, 235, .35); } }
.is-name { font-size: 18px; font-weight: 650; color: var(--text); min-height: 27px; letter-spacing: .3px; }
.is-bar { margin: 16px auto 0; width: 70%; height: 6px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.is-fill { height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, var(--accent)); }
.inspect-queue { display: flex; flex-direction: column; gap: 12px; }
.iq-head { font-size: 13px; color: var(--accent); font-weight: 650; }
.ins-warn { background: var(--yellow-soft); border: 1px solid #fde68a; border-radius: var(--radius); padding: 18px; }
.iw-title { color: var(--yellow); font-weight: 650; margin-bottom: 8px; }
.iw-text { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
.ins-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.ins-card.ins-done { border-left-color: var(--green); opacity: .82; }
.ins-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.ins-co { font-weight: 650; font-size: 14px; }
.ins-risk { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.ins-risk.ins-urgent { color: #fff; background: var(--red); border-color: var(--red); font-weight: 600; }
.ins-risk.ins-warning { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.ins-risk.ins-watch { color: var(--yellow); border-color: #fde68a; background: var(--yellow-soft); }
.ins-risk.ins-none { color: var(--muted); background: var(--card-subtle); }
.ins-type { font-size: 12px; color: var(--blue); }
.ins-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.ins-title { font-size: 14px; margin-bottom: 5px; }
.ins-detail { font-size: 12px; color: var(--muted); line-height: 1.7; }
.ins-ai { margin-top: 12px; padding: 10px 12px; background: #f8f7ff; border: 1px solid #ede9fe; border-radius: 9px; display: flex; gap: 9px; align-items: flex-start; }
.ins-ai-tag { flex: none; font-size: 10px; color: #fff; background: var(--purple); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.ins-ai-text { font-size: 12px; line-height: 1.7; color: #334155; }
.ins-ai-disc { margin-top: 4px; font-size: 10px; color: var(--muted); }
.ins-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ins-src { font-size: 11px; color: var(--muted); }

/* ---------- 响应式：先重排指挥舱，再折叠为单列 ---------- */
@media (max-width: 1240px) {
  #topbar { gap: 16px; padding: 0 20px; }
  .brand { font-size: 16px; }
  .nav-item { padding: 9px 12px; }
  .asof { display: none; }
  #content { padding: 22px 20px 32px; }
  #page-cockpit .cockpit-grid { gap: 14px; }
  .kpi-card { padding: 15px; }
  .xj-main { padding: 20px; }
  .cards-grid, .io-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .events-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .phase-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1020px) {
  #topbar { flex-wrap: wrap; gap: 8px 16px; padding: 12px 20px; }
  #mainnav { order: 3; flex-basis: 100%; overflow-x: auto; padding-top: 2px; }
  .topbar-right { margin-left: auto; }
  #page-cockpit { height: auto; min-height: 0; }
  #page-cockpit .cockpit-grid { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: 16px; }
  #page-cockpit .xj-main { grid-column: 1 / -1; grid-row: 1; }
  #page-cockpit .kpi-grid { grid-column: 1 / -1; grid-row: 2; }
  #page-cockpit #riskBar { grid-column: 1; grid-row: 3; min-height: 210px; }
  #page-cockpit #supervisionBar { grid-column: 2; grid-row: 3; min-height: 210px; }
  #page-cockpit #inspectPlaceholder { grid-column: 1 / -1; grid-row: 4; }
  #page-cockpit .xj-answer { flex: none; min-height: 0; max-height: 220px; }
  #page-cockpit .xj-main:has(.xj-answer:empty) .xj-avatar { margin-top: 0; }
  #page-cockpit .xj-main:has(.xj-answer:empty) .xj-quick { margin-bottom: 0; }
  .policy-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 16px; }
  .events-layout { grid-template-columns: 1fr; }
  .event-side { position: static; }
}

@media (max-width: 760px) {
  #topbar { padding: 10px 14px; }
  .brand { font-size: 15px; }
  .topbar-right { gap: 8px; }
  #globalSearch { width: 170px; }
  .nav-item { padding: 8px 12px; }
  #content { padding: 18px 14px 28px; }
  #page-cockpit .cockpit-grid { grid-template-columns: minmax(0, 1fr); }
  #page-cockpit .xj-main { grid-column: 1; grid-row: 1; }
  #page-cockpit .kpi-grid { grid-column: 1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-cockpit #riskBar { grid-column: 1; grid-row: 3; }
  #page-cockpit #supervisionBar { grid-column: 1; grid-row: 4; }
  #page-cockpit #inspectPlaceholder { grid-column: 1; grid-row: 5; }
  .page-head { align-items: flex-start; gap: 12px; }
  .page-head h2, .maintain-head h2 { font-size: 20px; }
  .filters { margin-left: 0; width: 100%; }
  .detail-grid, .cards-grid, .io-grid, .uf-grid { grid-template-columns: minmax(0, 1fr); }
  .policy-layout { grid-template-columns: 1fr; }
  .policy-tree { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .pt-title { width: 100%; }
  .pt-item { gap: 10px; }
  .policy-main .page-head h2 { width: 100%; }
  #policySearch { flex: 1; min-width: 160px; }
  .phase-cols { grid-template-columns: 1fr; }
  .xj-panel { right: 12px; bottom: 86px; width: calc(100vw - 24px); }
  .xj-fab { right: 16px; bottom: 16px; }
  .xj-bubble { right: 84px; bottom: 24px; max-width: calc(100vw - 108px); }
  .modal { padding: 12px; }
  .info-k { width: 112px; }
  .maintain-toolbar { flex-wrap: wrap; }
  .maintain-tabs { width: 100%; }
  .maintain-search { flex: 1; min-width: 180px; margin-left: 0; }
  .maintain-table-wrap { max-height: 65vh; }
}

@media (max-width: 460px) {
  #globalSearch { width: 132px; }
  #settingsBtn { padding: 7px 10px; }
  #page-cockpit .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-card { min-height: 116px; }
  .xj-main { padding: 18px 14px; }
  .xj-ask { flex-wrap: wrap; }
  .xj-ask input { flex-basis: 100%; }
  .xj-ask .btn-primary { width: 100%; }
  .bar { min-height: 0; }
  .detail-head .btn-ghost { width: 100%; }
  .doc-line { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
