:root {
  --navy: #102A4C;
  --navy-2: #1A5FB4;
  --navy-soft: #E8F0FB;
  --ink: #1B2430;
  --text: #475569;
  --muted: #94A3B8;
  --line: #E4E9F0;
  --bg: #F5F7FA;
  --amber: #B45309;
  --amber-bg: #FFF7ED;
  --white: #FFFFFF;
  --side-ink: #DCE8F7;
  --side-muted: #8FB3DC;
  --side-mute-2: #7FA3CC;
  --slate: #64748B;
  --thead-bg: #EEF3FA;
  --zebra: #F8FAFC;
  --navy-2-hover: #144E96;
  --red-bg: #FEE2E2;
  --red-ink: #B91C1C;
  --green-bg: #DCFCE7;
  --green-ink: #15803D;
  --panel-line: #CBDCF2;
  /* C3 补全：同类硬编码色 1:1 归入 :root（实际渲染色值不变） */
  --panel-line-2: #C9DCF5;
  --print-line: #CCC;
  --blue-050: #F4F8FE;
  --amber-050: #FFFAF4;
  --amber-line: #F3DFC2;
  --side-fact: #BBD3EF;
  --blue-100: #DBE8FA;
  --yida-grad-top: #F7FAFF;
  --yida-grad-bottom: #EDF4FF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app { display: flex; min-height: 100vh; }

/* 侧栏 */
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--navy); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 13px; font-weight: 700; color: var(--white); line-height: 1.5; }
.brand-sub { font-size: 11px; color: var(--side-muted); margin-top: 2px; }
.nav-current {
  background: var(--navy-2); color: var(--white); font-size: 11px; font-weight: 500;
  padding: 7px 10px; border-radius: 4px; margin-top: 6px;
}
.nav-group { font-size: 10px; font-weight: 500; color: var(--side-mute-2); margin-top: 10px; letter-spacing: .5px; }
.nav-item {
  display: block; font-size: 13px; line-height: 1.4; padding: 7px 10px; border-radius: 4px;
  color: var(--side-ink); transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(255,255,255,.14); color: var(--white); font-weight: 500; }
.sidebar-spacer { flex: 1; }
.sidebar-foot { font-size: 10px; line-height: 1.8; color: var(--side-mute-2); border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex: 0 0 60px; background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 16px;
}
.crumb { font-size: 13px; color: var(--slate); white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 16px; }
.search {
  width: 270px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  padding: 0 10px; font-size: 11px; color: var(--ink); outline: none;
}
.search:focus { border-color: var(--navy-2); background: var(--white); }
.user { font-size: 12px; color: var(--slate); white-space: nowrap; }
.content { padding: 24px; flex: 1; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: .5 } to { opacity: 1 } }

/* 通用块 */
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0; }
.head-note { font-size: 11px; color: var(--amber); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.card > h2 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.card > h3 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.row > .card { flex: 1; min-width: 320px; }
.cols-2 > .card { min-width: 380px; }
.cols-3 > .card { min-width: 260px; }
.muted { color: var(--slate); font-size: 10px; line-height: 1.6; }
.mini { font-size: 11px; color: var(--text); line-height: 1.75; }
.mono { font-family: "SFMono-Regular", Consolas, "Noto Sans SC", monospace; font-size: 10.5px; }
.hint { color: var(--slate); font-size: 10px; margin-left: 4px; }
p { margin: 0 0 8px; line-height: 1.75; }
ul { margin: 0 0 8px; padding-left: 18px; }
li { line-height: 1.75; font-size: 11.5px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.kpi .lab { font-size: 11px; color: var(--slate); }
.kpi .val { font-size: 24px; font-weight: 700; color: var(--navy-2); margin: 6px 0; line-height: 1.2; }
.kpi .val.warn { color: var(--amber); font-size: 20px; }
.kpi .val.small { font-size: 13px; line-height: 1.5; word-break: break-all; }
.kpi .cap { font-size: 10px; color: var(--slate); line-height: 1.5; }

/* 提示条 */
.bar { border-radius: 6px; padding: 12px 14px; font-size: 11px; line-height: 1.7; margin-bottom: 16px; }
.bar.blue { background: var(--navy-soft); color: var(--navy-2); font-weight: 500; }
.bar.amber { background: var(--amber-bg); color: var(--amber); }
.bar .bar-t { font-weight: 700; }
.btn {
  background: var(--navy-2); color: var(--white); border: 0; border-radius: 6px;
  padding: 8px 16px; font-size: 11px; font-weight: 500;
}
.btn:hover { background: var(--navy-2-hover); }
.btn.ghost { background: var(--white); color: var(--navy-2); border: 1px solid var(--line); }

/* 两端开口式表格 */
.grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.grid th, .grid td { padding: 8px 10px; vertical-align: middle; line-height: 1.5; }
.grid thead th {
  text-align: left; font-weight: 700; color: var(--text); background: var(--thead-bg);
  border-top: 1.5px solid var(--navy); border-bottom: 1.5px solid var(--navy);
  white-space: nowrap;
}
.grid tbody td { border-bottom: .5px solid var(--line); border-left: 0; border-right: 0; color: var(--text); }
.grid tbody tr:last-child td { border-bottom: 1.5px solid var(--navy); }
.grid tbody tr:nth-child(even) { background: var(--zebra); }
.grid .tal { text-align: left; }
.grid .tar { text-align: right; font-variant-numeric: tabular-nums; }
.grid strong { color: var(--ink); font-weight: 600; }
.grid .placeholder { color: var(--muted); }
.grid .pending-cell { color: var(--amber); }
.table-note { font-size: 10px; color: var(--slate); line-height: 1.6; margin-top: 10px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.table-count { font-size: 11px; color: var(--slate); }

.tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; font-weight: 500; vertical-align: middle; }
.tag.must { background: var(--red-bg); color: var(--red-ink); }
.tag.pending { background: var(--amber-bg); color: var(--amber); margin-left: 0; }
.tag.ok { background: var(--green-bg); color: var(--green-ink); margin-left: 0; }

.detail { margin-top: 6px; }
.detail summary { cursor: pointer; font-size: 10.5px; color: var(--navy-2); list-style: none; }
.detail summary::-webkit-details-marker { display: none; }
.detail summary::before { content: '▸ '; }
.detail[open] summary::before { content: '▾ '; }
.detail-body { background: var(--zebra); border-left: 2px solid var(--navy-2); padding: 10px 12px; margin-top: 6px; }
.mini-t { font-size: 10px; font-weight: 700; color: var(--navy); margin: 6px 0 4px; }
.mini-t:first-child { margin-top: 0; }
.fields { color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 4px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.flow span { background: var(--white); border: 1px solid var(--line); border-radius: 3px; padding: 3px 7px; font-size: 10px; color: var(--text); }
.flow i { font-style: normal; color: var(--navy-2); font-size: 11px; }

/* 阶段分列 */
.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stage-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.stage-box.compile { background: var(--blue-050); border-color: var(--panel-line-2); }
.stage-box.runtime { background: var(--amber-050); border-color: var(--amber-line); }
.stage-box h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink); }
.stage-box .big { font-size: 20px; font-weight: 700; color: var(--navy-2); }
.stage-box.runtime .big { color: var(--amber); }

/* 公式条 */
.formula { font-family: "SFMono-Regular", Consolas, "Noto Sans SC", monospace; font-size: 11.5px; color: var(--navy); background: var(--navy-soft); padding: 8px 10px; border-radius: 4px; display: inline-block; margin: 2px 6px 6px 0; }
.link-list a { color: var(--navy-2); border-bottom: 1px solid var(--panel-line-2); }
.link-list a:hover { border-color: var(--navy-2); }
.dl { display: inline-block; background: var(--thead-bg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px; font-size: 11px; color: var(--navy-2); margin: 0 8px 8px 0; }
.dl:hover { background: var(--navy-soft); }

/* 入口层：认证前置与业务后台分层（V0.4） */
.entry-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--white); min-height: 620px;
}
.entry-left {
  background: var(--navy); color: var(--side-ink); padding: 32px;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
}
.entry-left .e-brand { font-size: 16px; font-weight: 700; color: var(--white); line-height: 1.5; }
.entry-left .e-sub { font-size: 12px; color: var(--side-muted); margin-top: 4px; }
.entry-left .e-rule { height: 1px; background: rgba(255,255,255,.22); }
.entry-left h2 { font-size: 12px; font-weight: 700; color: var(--side-muted); margin: 0 0 8px; letter-spacing: .5px; }
.entry-facts { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.entry-facts th, .entry-facts td { padding: 9px 0; border-bottom: .5px solid rgba(255,255,255,.18); }
.entry-facts thead th { border-top: 1.5px solid var(--side-muted); border-bottom: 1.5px solid var(--side-muted); text-align: left; color: var(--white); font-size: 10.5px; }
.entry-facts tbody tr:last-child td { border-bottom: 1.5px solid var(--side-muted); }
.entry-facts td:first-child { color: var(--side-fact); }
.entry-facts td:last-child { text-align: right; color: var(--white); font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-left .e-note { font-size: 10.5px; line-height: 1.8; color: var(--side-muted); }
.entry-left .e-foot { margin-top: 4px; font-size: 10px; color: var(--side-mute-2); line-height: 1.8; border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px; }

.entry-right { background: var(--white); padding: 40px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.entry-meta { display: flex; justify-content: flex-end; font-size: 10.5px; color: var(--muted); }
.entry-right h1 { font-size: 22px; }
.entry-right .e-lead { font-size: 11.5px; color: var(--text); line-height: 1.8; margin: -8px 0 0; }
.entry-path { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.entry-path.primary { border-color: var(--panel-line-2); background: var(--blue-050); }
.entry-path .p-tag { font-size: 10px; font-weight: 700; color: var(--navy-2); letter-spacing: .5px; }
.entry-path .p-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 4px 0 6px; }
.entry-path .p-desc { font-size: 11px; color: var(--text); line-height: 1.7; }
.entry-path .p-link { display: inline-block; margin-top: 10px; font-size: 11px; color: var(--navy-2); border-bottom: 1px solid var(--panel-line-2); }
.entry-path .p-link:hover { border-color: var(--navy-2); }
.entry-btn {
  display: block; width: 100%; background: var(--navy-2); color: var(--white); border: 0;
  border-radius: 6px; padding: 11px 16px; font-size: 12px; font-weight: 500; text-align: center;
}
.entry-btn:hover { background: var(--navy-2-hover); }
.entry-status { background: var(--amber-bg); color: var(--amber); border-radius: 6px; padding: 12px 14px; font-size: 11px; line-height: 1.8; }
.entry-right .e-bottom { margin-top: 4px; font-size: 10px; color: var(--muted); line-height: 1.8; }

@media (max-width: 1100px) {
  .entry-wrap { grid-template-columns: 1fr; }
  .entry-right { padding: 28px; }
}

/* 打印抬头（仅打印时显示） */
.print-only { display: none; }

/* 全站检索结果面板 */
.search-panel { display: none; margin: 0 24px 12px; padding: 10px 14px; background: var(--white);
  border: 1px solid var(--panel-line); border-radius: 8px; box-shadow: 0 2px 8px rgba(16,42,76,.06); }
.search-panel.active { display: block; }
.sr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--text); }
.sr-head strong { color: var(--navy); }
.sr-clear { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px;
  font-size: 10.5px; color: var(--navy-2); cursor: pointer; }
.sr-clear:hover { background: var(--navy-soft); }
.sr-rows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sr-row { display: inline-flex; align-items: center; gap: 10px; background: var(--navy-soft);
  border: 1px solid var(--panel-line); border-radius: 4px; padding: 6px 10px; font-size: 11px;
  color: var(--navy-2); cursor: pointer; }
.sr-row:hover { background: var(--blue-100); border-color: var(--navy-2); }
.sr-n { font-size: 10px; color: var(--muted); }
.sr-empty { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* 键盘可访问性 */
.nav-item:focus-visible, .dl:focus-visible, .btn:focus-visible, .entry-btn:focus-visible,
.yida-entry-button:focus-visible, .sr-row:focus-visible, .sr-clear:focus-visible,
.search:focus-visible, .p-link:focus-visible, .table-note a:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* 表格统一列头字阶（消除 15 处内联覆盖的双套写法） */
.card .table-tools h2 { font-size: 15px; font-weight: 700; color: var(--ink); }

/* 打印：只输出空白闭合看板 */
@media print {
  .sidebar, .topbar, .no-print, .search-panel { display: none !important; }
  .view { display: none !important; }
  #view-evidence { display: block !important; }
  /* 一页纸成果物：只输出空白看板卡，其余说明卡不随附 */
  #view-evidence > .head,
  #view-evidence > .bar,
  #view-evidence > .card,
  #view-evidence > .row:not(#printable-row) { display: none !important; }
  #printable-row { display: block !important; }
  #printable-row > .card:not(#printable-board) { display: none !important; }
  #printable-board { border: 0 !important; padding: 0 !important; margin: 0 !important; }
  #printable-board > h2, #printable-board > .table-tools, #printable-board > .table-note { display: none !important; }
  .print-only { display: block !important; }
  .po-title { font-size: 15px; font-weight: 700; text-align: center; color: var(--ink); }
  .po-sub { font-size: 11px; text-align: center; margin: 4px 0 12px; color: var(--text); }
  .po-meta { font-size: 10px; line-height: 1.9; border-bottom: 1px solid var(--print-line); padding-bottom: 8px; margin-bottom: 12px; }
  .po-foot { font-size: 9.5px; line-height: 1.8; color: var(--text); margin-top: 12px; border-top: 1px solid var(--print-line); padding-top: 8px; }
  .content { padding: 0; }
  .card { border: 1px solid var(--print-line); break-inside: avoid; }
  body { background: var(--white); font-size: 11px; }
  .bar.blue { background: var(--white); border: 1px solid var(--print-line); }
  #board-table thead { display: table-header-group; }
  #board-table tr { break-inside: avoid; }
  #board-table .placeholder { color: var(--muted); }
  .head-note, .pending-cell { color: var(--text) !important; }
  /* A3 打印恢复：不横向滚动、不裁切列 */
  .card { overflow: visible !important; }
  .grid { min-width: 0 !important; }
  .grid thead th { white-space: nowrap !important; }
  /* A8：检索状态下打印仍输出完整看板行 */
  .row-hidden { display: table-row !important; }
  @page { margin: 15mm; }
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .stage { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 92px; flex-basis: 92px; padding: 12px 6px; }
  .sidebar .brand { font-size: 10px; line-height: 1.4; word-break: break-all; }
  .sidebar .brand-sub, .sidebar .nav-current, .sidebar-foot { display: none; }
  .sidebar .nav-group { font-size: 9px; padding-left: 4px; }
  /* 保留导航文字并允许换行，避免出现无法辨识的空链接 */
  .nav-item { font-size: 9.5px; text-align: left; padding: 8px 4px; line-height: 1.4; }
  .nav-item span { display: inline; white-space: normal; word-break: break-all; }
  .nav-item::before { content: ''; }
  .search { width: 110px; }
  .user { display: none; }
  .topbar { flex-wrap: wrap; gap: 6px; }
  .crumb { white-space: normal; }
  .content { padding: 14px; }
  .row > .card, .cols-2 > .card, .cols-3 > .card { min-width: 0; }
  .kpis { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; }
  .entry-right { padding: 24px 18px; }
  .yida-entry-panels { grid-template-columns: 1fr; }
  .search-panel { margin: 0 14px 12px; }
  /* A3：9 / 12 列宽表在窄屏可横向滚动，不裁切列 */
  .card { overflow-x: auto; }
  .grid { min-width: 720px; }
  .grid thead th { white-space: normal; word-break: break-word; }

}

/* 宜搭应用入口 · 纯按钮版（2026-11-17 展示层视觉改造，对齐 Ardot S12） */
.yida-quick-entry { background: linear-gradient(180deg, var(--yida-grad-top) 0%, var(--yida-grad-bottom) 100%); border: 1px solid var(--panel-line); }
.yida-entry-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.yida-entry-panels.single { grid-template-columns: 1fr; }
.yida-entry-panel { background: var(--navy-soft); border: 1px solid var(--panel-line); border-left: 4px solid var(--navy-2); border-radius: 8px; padding: 16px; display: flex; align-items: center; justify-content: center; }
.yida-entry-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; border-radius: 6px; background: var(--navy-2); color: var(--white); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; transition: background .15s ease; }
.yida-entry-button:hover { background: var(--navy-2-hover); }
@media (max-width: 1100px) { .yida-entry-panels { grid-template-columns: 1fr; } }

/* C2：code 与 .mono 统一等宽，避免浏览器默认衬线混排 */
code, .mono { font-family: "SFMono-Regular", Consolas, "Noto Sans SC", monospace; }
code { font-size: 10.5px; padding: 0 3px; border: 1px solid var(--line); border-radius: 3px; background: var(--thead-bg); color: var(--ink); }
/* C9：读屏可见、视觉隐藏 */
.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; }
/* A8：静态表检索筛行（动态表由 5 个 render 函数自行筛选） */
.row-hidden { display: none; }
