/* ═══════════════════════════════════════════
   预览样板 · 公共样式（对应 scripts/1acl-board/assets/style.css 设计）
   style-guide.css 层1 token + 组件（对齐 html-gen 标准）
   版本: 0.3(2026-09-05)  [CL037: +stats 区/trend-bars/chip/projects-table]
   ═══════════════════════════════════════════ */
:root {
  --cobalt-50: #eef2ff;
  --cobalt-100: #e0e7ff;
  --cobalt-400: #818cf8;
  --cobalt-500: #6366f1;
  --cobalt-600: #4f46e5;
  --cobalt-700: #4338ca;
  --cobalt-800: #3730a3;
  --cobalt-900: #312e81;
  --cobalt-950: #1e1b4b;
  --accent-400: #facc15;
  --accent-500: #eab308;
  --accent-600: #ca8a04;
  --surface-800: #1e1e2e;
  --surface-850: #181825;
  --surface-900: #11111b;
  --surface-950: #0a0a14;
  --line: #2a2a3e;
  --line-dim: #1a1a2e;
  --text: #e0e0e0;
  --text-dim: #9ca3af;
  --ok: #34d399;
  --run: #60a5fa;
  --wait: #9ca3af;
  --warn: #fbbf24;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, 'JetBrains Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--surface-950); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.board-wrap { max-width: 1320px; margin: 0 auto; padding: 16px; }

/* 单行头部: 标题 + 页面导航(链接) + meta 居右 */
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.topbar h1 { font-size: 1.25rem; font-weight: 700; color: #f0f0f0; white-space: nowrap; }
.nav-tabs { display: flex; gap: 4px; }
.tab-link {
  display: inline-block; background: var(--surface-900); color: var(--text-dim);
  border: 1px solid var(--line); padding: 4px 14px; border-radius: var(--radius-md);
  font-size: 0.78rem; text-decoration: none; font-family: inherit;
}
.tab-link:hover { color: var(--text); border-color: var(--cobalt-500); text-decoration: none; }
.tab-link.active { background: var(--cobalt-600); color: #fff; border-color: var(--cobalt-600); }
.meta-side { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.75rem; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; color: var(--text-dim); font-size: 0.72rem; }
.switch input { accent-color: var(--cobalt-500); }
.notice { background: rgba(250,204,21,0.08); border: 1px solid rgba(250,204,21,0.35); color: var(--accent-400); border-radius: var(--radius-md); padding: 4px 10px; font-size: 0.72rem; margin-bottom: 10px; }

/* 标准表格（html help table 模板样式） */
.table-card { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-900); }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--surface-900); border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left;
  font-size: 0.7rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.05em; white-space: nowrap; user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable::after { content: " \25b4\25be"; font-size: 10px; color: #555; }
.data-table th.sort-asc::after { content: " \25b4"; color: var(--cobalt-400); }
.data-table th.sort-desc::after { content: " \25be"; color: var(--cobalt-400); }
.data-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-dim); font-size: 0.8rem; vertical-align: middle; white-space: nowrap; }
.data-table td.col-desc { white-space: normal; min-width: 220px; }
.data-table td.col-time { color: var(--text-dim); font-size: 0.74rem; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(79,70,229,0.08); }
.data-table tbody tr.selected { background: rgba(79,70,229,0.15); }
/* 编号列: 加宽 ≈1.5×, 完整展示不截断 */
.data-table th.col-number { min-width: 240px; }
.data-table td.col-number { min-width: 240px; max-width: none; overflow: visible; }
/* 进度列 + 分栏列宽稳定: 两模式共用同一最小宽, 进入/退出分栏不跳变 */
.data-table th.col-progress, .data-table td.col-progress { min-width: 190px; }
.data-table.mode-split { width: auto; }
.num-link { color: var(--cobalt-400); cursor: pointer; font-family: var(--font-mono); font-size: 0.78rem; white-space: nowrap; }
.num-link:hover { color: var(--cobalt-500); text-decoration: underline; }
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); font-size: 0.7rem; margin: 1px; border: 1px solid transparent; }
.badge-pending { background: #1a1a1a; color: var(--wait); border-color: #333; }
.badge-active { background: #1e3a5f; color: var(--run); }
.badge-done { background: #123524; color: var(--ok); }
.progress-cell { font-size: 0.76rem; color: var(--text-dim); }
.empty-row { color: var(--text-dim); font-size: 0.78rem; text-align: center; padding: 22px 0 !important; font-style: italic; }

/* 分栏: 列表(仅2列内容宽) + 详情区吃满其余宽度（参考 html-gen split view） */
.board-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.table-side { min-width: 0; }
.board-main.split-on { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.detail-panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-900); padding: 12px 14px; max-height: 80vh; overflow-y: auto;
}
.board-main.split-on .detail-panel { max-width: none; width: auto; }
.detail-panel.closed { display: none; }
.detail-close { float: right; border: 1px solid var(--line); background: var(--surface-800); color: var(--text-dim); border-radius: var(--radius-sm); cursor: pointer; padding: 0 8px; font-size: 0.8rem; }
.detail-close:hover { color: #fff; border-color: var(--cobalt-500); }
.detail-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.detail-number { font-size: 1rem; font-weight: 700; color: #f0f0f0; word-break: break-all; font-family: var(--font-mono); }
.detail-proj { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.detail-section { margin-bottom: 12px; }
.detail-title { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.detail-text { font-size: 0.82rem; white-space: pre-wrap; word-break: break-word; color: #d0d0d0; }
.detail-none { color: var(--text-dim); font-size: 0.78rem; font-style: italic; }
.step-row { display: flex; align-items: baseline; gap: 8px; font-size: 0.8rem; padding: 2px 0; }
.step-idx { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.step-label { flex: 0 0 auto; }
.step-state { flex: 0 0 auto; font-size: 0.68rem; padding: 0 6px; border-radius: var(--radius-full); }
.step-state.done { color: var(--ok); background: #123524; }
.step-state.running { color: var(--run); background: #1e3a5f; }
.step-state.pending { color: var(--wait); background: #1a1a1a; }
.retro-summary { font-size: 0.74rem; font-family: var(--font-mono); background: #0d0d1a; border: 1px solid var(--line-dim); border-radius: var(--radius-md); padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin-bottom: 6px; }
.ops-row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ops-cmd { flex: 1 1 auto; word-break: break-all; font-family: var(--font-mono); font-size: 0.76rem; color: #d0d0d0; }
.btn-copy { background: var(--cobalt-600); color: #fff; border: none; border-radius: var(--radius-md); padding: 3px 12px; font-size: 0.72rem; cursor: pointer; flex: 0 0 auto; }
.btn-copy:hover { background: var(--cobalt-500); }
.ops-hint { font-size: 0.7rem; color: var(--text-dim); }

/* 历史分析卡 */
.hist-analysis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hist-card { flex: 1 1 200px; background: var(--surface-900); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px 12px; font-size: 0.75rem; }
.hist-card .hc-title { color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.hist-card .hc-value { font-size: 1rem; font-weight: 700; color: #f0f0f0; margin-top: 2px; }
.hist-card .hc-sub { color: var(--text-dim); font-size: 0.7rem; margin-top: 2px; }
.hist-card.verdict { border-color: var(--cobalt-500); }

/* 指导页 */
.guide-sec { margin-bottom: 14px; }
.guide-sec h2 { font-size: 0.95rem; font-weight: 600; color: #e0e0e0; margin: 0 0 2px; }
.guide-sec .gs-note { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 6px; }
.guide-table td.col-cmd { white-space: normal; }
.guide-table td.col-ex { font-size: 0.74rem; color: var(--text-dim); white-space: normal; }

footer { margin-top: 12px; color: var(--text-dim); font-size: 0.7rem; }
@media (max-width: 960px) {
  .board-main, .board-main.split-on { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { max-height: none; }
}

/* ── CL037 index stats 区 ── */
.stats-section { margin-bottom: 10px; }
.stats-strip { display: grid; grid-template-columns: 3fr 3fr 3fr 11fr; gap: 10px; }
.stat-card { background: var(--surface-900); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; min-width: 0; }
.stat-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--cobalt-400); line-height: 1.3; }
.stat-sub { font-size: 0.66rem; color: var(--text-dim); }
.trend-bars { display: flex; align-items: flex-end; gap: 5px; height: 78px; padding: 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 70%; background: linear-gradient(180deg, var(--cobalt-500), var(--cobalt-800)); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-val { font-size: 0.58rem; color: var(--text-dim); white-space: nowrap; }
.bar-day { font-size: 0.58rem; color: var(--text-dim); margin-top: 2px; }

/* ── CL037 projects 页 ── */
.projects-table th, .projects-table td { vertical-align: top; }
.projects-table .col-name { min-width: 170px; }
.projects-table .col-src, .projects-table .col-www, .projects-table .col-loc { min-width: 130px; }
.projects-table .col-desc { min-width: 190px; }
.p-title { font-weight: 700; color: #f0f0f0; }
.p-path { font-size: 0.64rem; color: var(--text-dim); font-family: var(--font-mono); }
.desc-text { font-size: 0.72rem; color: var(--text-dim); line-height: 1.5; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-850); border-radius: var(--radius-md); padding: 2px 8px; margin: 1px 3px 1px 0; font-size: 0.68rem; max-width: 100%; }
.chip-em { color: var(--text-dim); white-space: nowrap; }
.chip-link { color: var(--cobalt-400); text-decoration: none; white-space: nowrap; }
.chip-link:hover { text-decoration: underline; color: var(--cobalt-500); }
.chip-invalid { color: var(--warn); white-space: nowrap; font-size: 0.64rem; }
.chip-copy { background: transparent; color: #f9a8d4; border: 1px solid #831843; border-radius: 3px; font-size: 0.62rem; padding: 1px 8px; cursor: pointer; font-family: inherit; }
.chip-copy:hover { color: #fff; border-color: #f9a8d4; }

@media (max-width: 1100px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
