/* ============================================================
   AI 项目看板 · 视觉精修层 v4（2026-11-09）
   定位：覆盖层，只换 token 与组件表现，不改结构、不改 JS 逻辑
   基线：v3（深蓝 #1F4E79 / 浅蓝 #e8f0fe / 无动画 / 暗色手动切换）
   v4 做了三件事：
     1) 灰阶、主色、语义色全部补成 10 级色阶（原来只差一抹灰）
     2) 徽章由「纯饱和色块压白字」改为「浅底 + 同色文字 + 描边」三件套
     3) 边框分层替代阴影，进度条收细，数字统一 tabular-nums
   回滚：删掉 v2.html 里对本文件的一行 <link> 即可
   ============================================================ */

/* ---------------- 1. 色阶 token ---------------- */
:root {
  /* 中性阶（冷灰 H210） */
  --n-0:  #ffffff;
  --n-25: #fafbfc;
  --n-50: #f6f8fa;   /* 页面底 */
  --n-100:#eef1f5;   /* 次级底 / 表头 */
  --n-200:#e3e8ee;   /* 卡片边框 */
  --n-300:#d2d9e1;   /* 分割线 / 强边框 */
  --n-400:#adb8c4;
  --n-500:#8a96a3;
  --n-600:#67737f;   /* 辅助文字（白底 4.9:1，达 AA） */
  --n-700:#46515c;   /* 次级正文 */
  --n-800:#2b343d;
  --n-900:#16202a;   /* 标题 */

  /* 品牌主色阶（H209 S59，锚点 #1F4E79 = 600） */
  --a-50: #ebf2fa;
  --a-100:#cee1f3;
  --a-200:#a6c8e8;
  --a-300:#75aadc;
  --a-400:#3078ba;
  --a-500:#2a68a2;
  --a-600:#1f4e79;
  --a-700:#193e61;
  --a-800:#14304c;
  --a-900:#0f2439;

  /* 语义色三件套：底 / 文字 / 描边（浅色） */
  --green: #1e7b34;  --green-bg: #e9f5ec;  --green-line: #b7dfc0;
  --yellow:#8a5a00;  --yellow-bg:#fff6e5;  --yellow-line:#efd18c;
  --red:   #b42318;  --red-bg:   #fdecea;  --red-line:   #f3c2bc;
  --blue:  #2a68a2;  --blue-bg:  #e8f0fe;  --blue-line:  #b9cfe6;
  --violet:#6b4fa8;  --violet-bg:#f0ecf9;  --violet-line:#d5c9ec;
  --orange:#b45309;  --orange-bg:#fef4e6;  --orange-line:#f0cfa8;

  /* 图表色（canvas 用，浅暗通用中间调） */
  --cat-1:#2a68a2; --cat-2:#2e9e5b; --cat-3:#d9a12e;
  --cat-4:#d93f35; --cat-5:#6b4fa8; --cat-6:#0e7490; --cat-7:#67737f;

  /* 别名（沿用 v3 变量名，JS 内联样式依赖它们） */
  --bg-primary:   var(--n-50);
  --bg-secondary: var(--n-0);
  --bg-card:      var(--n-0);
  --bg-hover:     var(--n-100);
  --bg-tertiary:  var(--n-100);
  --border:       var(--n-200);
  --border-strong:var(--n-300);
  --text-primary: var(--n-900);
  --text-secondary:var(--n-700);
  --text-muted:   var(--n-600);

  --accent:     var(--a-600);
  --accent-ink: var(--a-700);
  --accent-bg:  var(--a-50);
  --accent-line:var(--a-200);
  --accent-text:var(--a-600);   /* 文字用主色（深色档要单独换成浅蓝） */

  --shadow:      0 1px 2px rgba(16, 24, 32, .04);
  --shadow-pop:  0 4px 12px rgba(16, 24, 32, .10);
  --shadow-modal:0 8px 24px rgba(16, 24, 32, .14);
  --radius-lg: 12px; --radius: 8px; --radius-sm: 6px; --radius-xs: 4px;
}

html[data-theme="dark"] {
  --n-0:  #171c21;
  --n-25: #14191e;
  --n-50: #101418;   /* 页面底 */
  --n-100:#1c232a;   /* 次级底 */
  --n-200:#262d35;   /* 卡片边框 */
  --n-300:#38424d;
  --n-400:#4a5560;
  --n-500:#6b7784;
  --n-600:#93a0ad;   /* 辅助文字（深底 6.4:1） */
  --n-700:#b4bec9;
  --n-800:#d3dae1;
  --n-900:#e6eaef;

  --a-50: #16283c;
  --a-100:#1d3550;
  --a-200:#2a4a66;
  --a-300:#3f6b8f;
  --a-400:#5589b8;
  --a-500:#6fa3d2;
  --a-600:#1f4e79;
  --a-700:#163a5a;

  --green: #5fd08a;  --green-bg: #16281c;  --green-line: #2e5c3c;
  --yellow:#f0b842;  --yellow-bg:#2c2413;  --yellow-line:#5c4a1e;
  --red:   #ff8a80;  --red-bg:   #331f1e;  --red-line:   #5c2e2a;
  --blue:  #7fb3e8;  --blue-bg:  #16263d;  --blue-line:  #2a4a66;
  --violet:#b8a0e8;  --violet-bg:#241e33;  --violet-line:#3e3560;
  --orange:#f0a55a;  --orange-bg:#2e2113;  --orange-line:#5c4420;

  --cat-1:#6fa3d2; --cat-2:#4fbf7a; --cat-3:#e0b054;
  --cat-4:#ef6b5f; --cat-5:#a68ce0; --cat-6:#3fa8bd; --cat-7:#93a0ad;

  --bg-primary:   var(--n-50);
  --bg-secondary: #141a20;
  --bg-card:      var(--n-0);
  --bg-hover:     #232b34;
  --bg-tertiary:  var(--n-100);
  --border:       var(--n-200);
  --border-strong:var(--n-300);
  --text-primary: var(--n-900);
  --text-secondary:var(--n-700);
  --text-muted:   var(--n-600);

  --accent:     #6fa3d2;
  --accent-ink: #8fc2ee;
  --accent-bg:  var(--a-50);
  --accent-line:var(--a-200);
  --accent-text:#8fc2ee;        /* 深色档：文字主色必须是浅蓝，不能用深底 */

  --shadow:      0 1px 2px rgba(0, 0, 0, .35);
  --shadow-pop:  0 4px 12px rgba(0, 0, 0, .45);
  --shadow-modal:0 8px 24px rgba(0, 0, 0, .55);
}

/* ---------------- 2. 基础排版 ---------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .page-title, .cockpit-title, .proj-group-title, .section-title,
.metric-value, .pcard-pct, .column-title {
  letter-spacing: 0; /* 中文不加字距 */
}
.metric-value, .pcard-pct, .status-value, .dist-value, .load-count,
.req-metric-value, .tl-bar-meta, .cockpit-table td, .issue-meta, .risk-meta {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 统一焦点环：2px 外环 + 2px 留白，替代发光 */
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--a-400);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] select:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] [tabindex]:focus-visible { outline-color: var(--a-500); }

::selection { background: var(--a-200); color: var(--a-900); }

/* ---------------- 3. 顶栏 / 侧栏（2026-11-09 更现代方向） ----------------
   由「整条实心深蓝」改为「白底 + 发丝线」：品牌色退到 logo / 导航激活条 /
   主按钮上，顶栏只承担分隔，视觉更轻，也让页面主体成为焦点。 */
.topbar {
  height: 52px; min-height: 52px;
  background: var(--n-0);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0 20px;
}
html[data-theme="dark"] .topbar { background: #141a20; border-bottom-color: #262d35; }
.page-title { font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: .01em; }
.btn-icon {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary);
}
html[data-theme="dark"] .btn-icon:hover { background: #232b34; border-color: var(--n-300); }

/* 顶栏内联的刷新/次要按钮：白底上改用中性描边，不再吃深蓝底假设 */
.topbar .btn-refresh {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  font-size: 12.5px;
}
.topbar .btn-refresh:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

.sidebar { background: var(--bg-secondary); border-right: 1px solid var(--border); }
.sidebar-header { padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.logo { font-size: 15px; font-weight: 700; color: var(--accent-text); }
html[data-theme="dark"] .logo { color: var(--n-900); }
.logo-sub { font-size: 11.5px; color: var(--text-muted); letter-spacing: .02em; }
.sidebar-nav { padding: 8px 10px; }
.nav-item {
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px;
  transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-bg); color: var(--accent-text); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--a-600);
}
html[data-theme="dark"] .nav-item.active { box-shadow: inset 3px 0 0 var(--a-500); }
.nav-item .icon { font-size: 14px; width: 18px; opacity: .95; }
/* 侧栏图标去彩：emoji 自带高饱和色，与克制企业风打架；灰度后只留形状 */
.nav-item .icon { filter: grayscale(1); opacity: .85; }
.nav-item .badge {
  font-size: 10.5px; line-height: 15px; min-width: 17px; text-align: center;
  background: var(--red); color: #fff; border-radius: 9px; padding: 0 5px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.version-info, .role-label { color: var(--text-muted); }

/* ---------------- 4. 卡片 / 指标 ---------------- */
.content-area { padding: 20px 24px 40px; }

.section-card, .metric-card, .pcard, .cockpit-head, .status-bar,
.board-column, .issue-item, .risk-item, .member-card, .detail-section,
.snapshot-item, .tl-header, .tl-scroll-wrapper, .report-content, .context-content {
  border: 1px solid var(--border);
  box-shadow: none;
  background: var(--bg-card);
}

/* 更现代方向：面板类 12px 圆角 + 一层极淡投影，靠「线 + 一点点浮起」分层，
   不用灰底块和粗描边；列表行保持 8px，避免整页变圆 */
.section-card, .metric-card, .pcard, .cockpit-head, .status-bar,
.board-column, .member-card, .detail-section, .snapshot-item,
.report-content, .context-content {
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 32, .05);
}
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .pcard,
html[data-theme="dark"] .cockpit-head,
html[data-theme="dark"] .status-bar,
html[data-theme="dark"] .board-column,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .detail-section,
html[data-theme="dark"] .snapshot-item,
html[data-theme="dark"] .report-content,
html[data-theme="dark"] .context-content { box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

.issue-item, .risk-item, .tl-header, .tl-scroll-wrapper { border-radius: var(--radius); }
.section-card:hover, .metric-card:hover, .pcard:hover, .issue-item:hover,
.risk-item:hover, .member-card:hover, .task-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .section-card:hover,
html[data-theme="dark"] .metric-card:hover,
html[data-theme="dark"] .pcard:hover { border-color: var(--a-200); }

.metric-card { padding: 14px 16px; }
.metric-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); letter-spacing: .01em; }
.metric-value { font-size: 27px; font-weight: 650; color: var(--text-primary); line-height: 1.1; letter-spacing: -.01em; }
.metric-detail { font-size: 12px; color: var(--text-muted); }
.metric-bar { height: 4px; background: var(--n-100); border-radius: 2px; margin-bottom: 10px; }
html[data-theme="dark"] .metric-bar { background: #232b34; }
.metric-fill { background: var(--a-600); border-radius: 2px; }
html[data-theme="dark"] .metric-fill { background: var(--a-500); }

.section-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.section-action { font-size: 12px; color: var(--accent); }

/* 状态条 */
.status-bar { padding: 10px 18px; }
.status-label { color: var(--text-muted); font-size: 12px; }
.status-item { border-right-color: var(--border); }

/* 提示条：浅蓝底 + 左侧主色条，替代整框描边 */
.ai-announce, .context-tip {
  background: var(--accent-bg);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--a-600);
  color: var(--text-primary);
}
html[data-theme="dark"] .ai-announce,
html[data-theme="dark"] .context-tip { border-left-color: var(--a-500); }
.ai-announce .announce-text { color: var(--text-secondary); }

/* ---------------- 5. 项目卡片 ---------------- */
.pcard { padding: 14px 16px; gap: 9px; }
.pcard-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.pcard-client { color: var(--text-muted); }
.pcard-dot { width: 7px; height: 7px; }
.pcard-dot.active { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.pcard-dot.pending { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-bg); }
.pcard-dot.danger { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.pcard-dot.done, .pcard-dot.archived { background: var(--n-400); box-shadow: none; }

/* 进度：收细到 4px，去掉压死感 */
.pcard-bar { height: 4px; background: var(--n-100); border-radius: 2px; }
html[data-theme="dark"] .pcard-bar { background: #232b34; }
.pcard-fill { background: var(--a-600); border-radius: 2px; }
html[data-theme="dark"] .pcard-fill { background: var(--a-500); }
.pcard-pct { font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 40px; }

/* 统计 chip：中性底，只有异常态才上语义色 */
.pcard-stats { gap: 6px; margin-top: 2px; }
.pcard-stat {
  font-size: 11.5px; line-height: 18px; padding: 0 8px;
  color: var(--text-secondary); background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 4px;
}
.pcard-stat-warn {
  color: var(--yellow); background: var(--yellow-bg);
  border-color: var(--yellow-line); font-weight: 500;
}
.pcard-stat-danger {
  color: var(--red); background: var(--red-bg);
  border-color: var(--red-line); font-weight: 500;
}
.pcard-phase {
  font-size: 11px; line-height: 17px; padding: 0 7px;
  color: var(--accent-text); background: var(--accent-bg);
  border: 1px solid var(--accent-line); border-radius: 4px;
}

.pcard-focus { background: var(--bg-tertiary); border-color: var(--border); color: var(--text-secondary); }
.pcard-focus .pcard-focus-label { color: var(--accent-text); }

.pcard-foot { border-top: 1px solid var(--border); color: var(--text-muted); }

/* 阶段徽章（全部项目页） */
.proj-stage { font-size: 11px; line-height: 17px; padding: 0 7px; border-radius: 4px; font-weight: 500; }
.proj-stage-delivery { color: var(--accent-text); background: var(--accent-bg); border-color: var(--accent-line); }
.proj-stage-ops { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.proj-stage-pending { color: var(--yellow); background: var(--yellow-bg); border-color: var(--yellow-line); }
.proj-stage-archived { color: var(--text-muted); background: var(--bg-tertiary); border-color: var(--border); }
.proj-cat { color: var(--text-secondary); background: transparent; border-color: var(--border); }
.proj-group-title { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }

/* ---------------- 6. 徽章 / 优先级 / 状态（三件套） ---------------- */
.issue-priority, .risk-level, .detail-status, .risk-level-badge {
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px; line-height: 17px; font-weight: 600;
  padding: 0 7px; min-width: 0; text-align: center;
}
.issue-priority.high, .risk-level.high, .risk-level-badge {
  background: var(--red-bg); color: var(--red); border-color: var(--red-line);
}
.issue-priority.medium, .risk-level.medium {
  background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-line);
}
.issue-priority.low, .risk-level.low {
  background: var(--green-bg); color: var(--green); border-color: var(--green-line);
}
.issue-priority.info, .risk-level.info {
  background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line);
}
/* 任务卡上的优先级文字不再纯色压字，改为左侧细条 + 语义色 */
.task-card.overdue { border-left: 3px solid var(--red); }
.issue-item.risk-high, .risk-item.risk-high { border-left: 3px solid var(--red); }
.todo-item.high, .risk-item-compact.high { border-left-color: var(--red); }
.todo-item.mid { border-left-color: var(--yellow); }
.section-card.risk-alert { border-left: 3px solid var(--red); background: var(--red-bg); }
.section-card.risk-alert .section-title { color: var(--red); }

.column-count, .pcard-group-count, .proj-group-count, .tl-task-count {
  color: var(--accent-text); background: var(--accent-bg);
  border: 1px solid var(--accent-line); border-radius: 10px;
  font-size: 11.5px; font-weight: 600; padding: 0 7px; line-height: 17px;
}


/* ---------------- 7. 按钮统一 ---------------- */
.btn-primary, .btn-secondary, .btn-refresh, .login-btn, .req-btn, .btn-rollback {
  height: 32px; padding: 0 14px;
  font-size: 12.5px; font-weight: 500; line-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn-primary, .login-btn {
  background: var(--a-600); border-color: var(--a-600); color: #fff; font-weight: 600;
}
.btn-primary:hover, .login-btn:hover { background: var(--a-700); border-color: var(--a-700); }
.btn-primary:active, .login-btn:active { background: var(--a-800); border-color: var(--a-800); }
.btn-secondary:hover, .btn-refresh:hover {
  background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent-text);
}

.btn-rollback {
  background: var(--yellow-bg); border-color: var(--yellow-line); color: var(--yellow);
}
.btn-rollback:hover { background: var(--yellow); border-color: var(--yellow); color: #fff; }

.form-group input, .role-switcher select, .project-switcher, .req-field select, .req-field input {
  height: 32px; padding: 0 10px;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.form-group input:hover, .role-switcher select:hover, .project-switcher:hover,
.form-group input:focus, .role-switcher select:focus, .project-switcher:focus {
  border-color: var(--a-400);
}

/* ---------------- 8. 表格 ---------------- */
.cockpit-table, .req-table { width: 100%; border-collapse: collapse; }
.cockpit-table th, .req-table th {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
  text-align: left; white-space: nowrap;
}
.cockpit-table td, .req-table td {
  font-size: 12.5px; color: var(--text-primary);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cockpit-table tbody tr:hover td, .req-table tbody tr:hover td { background: var(--bg-hover); }
.cockpit-table tbody tr:last-child td, .req-table tr:last-child td { border-bottom: none; }
.cockpit-table th.num, .req-table th.num,
.cockpit-table td.num, .req-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cockpit-overdue { color: var(--red); font-weight: 600; }

/* ---------------- 9. 任务看板 / 时间线 ---------------- */
.board-column { background: var(--bg-card); }
.column-header { background: var(--bg-tertiary); border-bottom: 1px solid var(--border); padding: 10px 12px; }
.column-title { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.task-card { padding: 10px 11px; border-radius: var(--radius-sm); }
.card-title { font-size: 12.5px; font-weight: 500; color: var(--text-primary); line-height: 1.45; }
.card-meta, .card-deadline { color: var(--text-muted); }
.card-progress .progress-bar { height: 3px; background: var(--n-100); }
html[data-theme="dark"] .card-progress .progress-bar { background: #232b34; }
.card-progress .progress-fill { background: var(--a-600); }
html[data-theme="dark"] .card-progress .progress-fill { background: var(--a-500); }

.tl-month-row, .tl-day-row { background: var(--bg-tertiary); border-bottom-color: var(--border); }
.tl-day { color: var(--text-muted); border-right-color: var(--border); }
.tl-day.weekend { background: transparent; color: var(--n-400); }
.tl-day.today { background: var(--accent-bg); color: var(--accent-text); font-weight: 700; }
.tl-today-line { background: var(--a-600); width: 1px; opacity: 1; }
.tl-today-line::before { background: var(--a-600); font-size: 10px; border-radius: 3px; }

/* ---------------- 10. 单项目驾驶舱 ---------------- */
.cockpit-head { padding: 16px 18px; }
.cockpit-title { font-size: 19px; font-weight: 650; }
.cockpit-meta { color: var(--text-muted); gap: 6px 18px; }
.cockpit-meta strong { color: var(--text-primary); font-weight: 500; }
.cockpit-back {
  height: 28px; line-height: 26px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 12.5px;
}
.cockpit-back:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.cockpit-step-dot { border-width: 1.5px; }
.cockpit-step.done .cockpit-step-dot { background: var(--a-600); border-color: var(--a-600); }
.cockpit-step.current .cockpit-step-dot { background: var(--accent-bg); color: var(--accent-text); border-color: var(--a-600); }
.cockpit-step.current .cockpit-step-label { color: var(--accent-text); }
.cockpit-step::before { background: var(--n-200); height: 1.5px; }
html[data-theme="dark"] .cockpit-step::before { background: var(--n-300); }
.cockpit-step.done::before, .cockpit-step.current::before { background: var(--a-600); }
.fish-dot.done, .fish-card.done { border-color: var(--a-600); }
.fish-dot.done { background: var(--a-600); }
.cockpit-duty-cell { background: var(--bg-tertiary); border-color: var(--border); }
.cockpit-duty-label { color: var(--text-muted); }

/* 需求看板（内嵌页，自带一套 token，这里对齐到同一色阶） */
.req-board {
  --req-bg: var(--n-0); --req-panel: var(--n-0); --req-text: var(--n-900);
  --req-muted: var(--n-600); --req-border: var(--n-200);
  --req-head: var(--a-600); --req-soft: var(--n-100);
  border-color: var(--border);
}
.req-board.req-dark {
  --req-bg: var(--n-0); --req-panel: var(--n-0); --req-text: var(--n-900);
  --req-muted: var(--n-600); --req-border: var(--n-200);
  --req-head: var(--a-300); --req-soft: var(--n-100);
}
.req-btn { height: 30px; line-height: 28px; border-radius: var(--radius-sm); font-size: 12.5px; }
.req-metric-value { font-size: 22px; font-weight: 650; }
.req-column-head { border-top-color: var(--n-400); background: var(--bg-tertiary); }
.req-card { border-color: var(--border); }
.req-pri { border-radius: 3px; font-weight: 500; }
.req-pri-p0 { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
.req-card-note { border-left-color: var(--a-600); }
.req-status { border-radius: 3px; }

/* ---------------- 11. 成员 / 详情 / 其他 ---------------- */
.member-avatar { background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-line); font-size: 14px; }
.member-name { font-size: 13px; font-weight: 600; }
.member-stats { color: var(--text-muted); }
.detail-section h3 { color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.detail-field { border-bottom-color: var(--border); }
.detail-field label { color: var(--text-muted); }
.detail-status { color: #fff; }

.snapshot-item .snapshot-name { font-weight: 500; }
.empty { color: var(--text-muted); }
.login-box { padding: 32px; border-radius: 10px; }
.login-header h1 { font-size: 19px; font-weight: 650; color: var(--accent-text); }


/* 滚动条低调化 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--n-300); border: 3px solid transparent; background-clip: padding-box; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--n-400); background-clip: padding-box; border: 3px solid transparent; }

/* ============================================================
   12. 「更现代 · 加大幅度」v4.1（2026-11-09 追加）
   上一版只换了顶栏颜色和圆角，幅度不够。这一段换的是视觉语言本身：
     1) 页面底降一档灰、卡片去描边改纯投影 —— 卡片真正「浮」在底色上，
        不再是一堆并排的描边框
     2) 侧栏改成浅底静音区，激活项反白「抬起」，品牌色只留一条 3px
     3) 指标卡去掉左侧色条（那是最典型的 AI 味组合），语义色收进图标小方块
     4) 表头去掉灰底、行高拉到 44、行线改发丝 —— 靠留白分隔而不是格子
     5) 徽章统一成药丸；修掉 .detail-status 白字打白底（原来不可见）
   仍然只覆盖表现层：不动结构、不动 JS、不动 v3 原文件。
   ============================================================ */

/* 12.1 底色与分层 */
:root {
  --bg-primary: #f2f5f9;   /* 页底降一档，白卡才浮得起来 */
  --bg-secondary: #f7f9fb; /* 侧栏等静音区 */
  --line-hair: rgba(16, 24, 32, .07);
  --shadow-card: 0 1px 2px rgba(16, 24, 32, .05), 0 6px 16px rgba(16, 24, 32, .045);
  --shadow-card-hover: 0 2px 4px rgba(16, 24, 32, .06), 0 10px 24px rgba(16, 24, 32, .08);
}
html[data-theme="dark"] {
  --bg-primary: #0c1014;
  --bg-secondary: #10151a;
  --line-hair: rgba(255, 255, 255, .06);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .40), 0 6px 16px rgba(0, 0, 0, .30);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, .50), 0 10px 24px rgba(0, 0, 0, .45);
}

/* 12.2 面板：描边退成发丝，靠投影分层 */
.section-card, .metric-card, .pcard, .cockpit-head, .status-bar,
.board-column, .member-card, .detail-section, .snapshot-item,
.report-content, .context-content {
  border-color: var(--line-hair);
  box-shadow: var(--shadow-card);
}
.section-card:hover, .metric-card:hover, .pcard:hover,
.member-card:hover, .task-card:hover,
.issue-item:hover, .risk-item:hover {
  border-color: var(--line-hair);
  box-shadow: var(--shadow-card-hover);
}

/* 12.3 侧栏：浅底静音区，激活项反白抬起 */
.sidebar { background: var(--bg-secondary); border-right: 1px solid var(--line-hair); }
.sidebar-header { padding: 18px 16px 16px; border-bottom: 1px solid var(--line-hair); }
.logo { font-size: 14.5px; font-weight: 700; }
.logo-sub { font-size: 11px; color: var(--text-muted); }
.sidebar-nav { padding: 10px 10px 14px; }
.nav-item { padding: 9px 10px; gap: 9px; border-radius: 7px; font-size: 13px; }
.nav-item:hover { background: rgba(16, 24, 32, .045); color: var(--text-primary); }
html[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, .05); }
.nav-item.active {
  background: var(--bg-card); color: var(--accent-text); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--a-600), 0 1px 2px rgba(16, 24, 32, .07);
}
html[data-theme="dark"] .nav-item.active {
  background: #1b2229;
  box-shadow: inset 3px 0 0 var(--a-500), 0 1px 2px rgba(0, 0, 0, .45);
}
.sidebar-footer { border-top: 1px solid var(--line-hair); }

/* 12.4 顶栏：再高一点、标题再重一点，与内容区拉开呼吸 */
.topbar { height: 56px; min-height: 56px; border-bottom: 1px solid var(--line-hair); }
.page-title { font-size: 16px; font-weight: 650; }

/* 12.5 指标卡：语义色收进图标方块，去掉左侧色条 */
.metric-card { padding: 16px 18px; }
.metric-header { display: flex; align-items: center; gap: 8px; }
.metric-icon {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); font-size: 14px;
  filter: grayscale(1); opacity: .9;
}
.metric-card.warning, .metric-card.danger, .metric-card.success {
  border-left-width: 1px; border-left-color: var(--line-hair);
}
.metric-card.warning .metric-icon { background: var(--yellow-bg); }
.metric-card.danger  .metric-icon { background: var(--red-bg); }
.metric-card.success .metric-icon { background: var(--green-bg); }
.metric-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.metric-value {
  font-size: 31px; font-weight: 700; line-height: 1.05;
  letter-spacing: -.02em; margin: 8px 0 6px;
}
.metric-detail { font-size: 11.5px; color: var(--text-muted); }
.metric-bar { height: 6px; border-radius: 3px; }
.metric-fill { border-radius: 3px; }

/* 12.6 表格：去表头灰底、行高 44、行线发丝 */
.cockpit-table, .req-table { border-collapse: separate; border-spacing: 0; }
.cockpit-table th, .req-table th {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  background: transparent; padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
}
.cockpit-table td, .req-table td {
  font-size: 13px; padding: 12px;
  border-bottom: 1px solid var(--line-hair);
}
.cockpit-table tbody tr:hover td, .req-table tbody tr:hover td { background: var(--bg-hover); }
.cockpit-table tbody tr:last-child td, .req-table tr:last-child td { border-bottom: none; }

/* 12.7 徽章统一药丸 */
.issue-priority, .risk-level, .risk-level-badge, .detail-status,
.pcard-stat, .pcard-phase, .proj-stage, .proj-cat, .req-pri, .req-status,
.column-count, .pcard-group-count, .proj-group-count, .tl-task-count {
  border-radius: 999px; font-size: 10.5px; line-height: 18px; padding: 0 8px;
}
/* 修：v3 里写的 #fff 在浅色浅底下等于不可见 */
.detail-status { color: var(--text-primary); }

/* 12.8 项目卡 / 区块标题 / 进度条 */
.pcard { padding: 16px 18px; gap: 10px; }
.pcard-name { font-size: 15px; font-weight: 650; }
.pcard-bar { height: 6px; border-radius: 3px; }
.pcard-fill { border-radius: 3px; }
html[data-theme="dark"] .pcard-bar { background: #232b34; }
.section-title { font-size: 13px; font-weight: 650; }
.proj-group-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.column-title { font-size: 12px; font-weight: 600; }
.task-card { padding: 12px; border-radius: var(--radius); }

/* 12.9 空状态：虚线框，别让空白看起来像加载失败 */
.empty {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-secondary); margin: 12px 0;
}

/* 12.10 内容区留白 + 滚动条 */
.content-area { padding: 22px 26px 48px; }
::-webkit-scrollbar { width: 8px; height: 8px; }

/* 12.11 尺度放大一档：小字密排是「后台」观感，松一档才像产品 */
@media (min-width: 641px) {
  .sidebar { width: 204px; min-width: 204px; }
  .sidebar-nav { padding: 12px 12px 16px; }
  .nav-item { padding: 10px 12px; font-size: 13.5px; }
}
.content-area { padding: 24px 32px 56px; }
.section-card { padding: 18px 20px; }
.metrics-row { gap: 14px; margin-bottom: 18px; }
.dashboard-row { gap: 14px; }
html[data-theme="dark"] { --bg-card: #191f26; } /* 深色卡片抬一档，和页底拉开 */

/* 侧栏加宽后底部署名不再折行 */
.sidebar-footer { padding: 12px 8px; }
.version-info, .role-label { font-size: 10.5px; line-height: 1.55; white-space: nowrap; }

/* 打印时去掉一切额外装饰 */
@media print {
  .pcard, .section-card, .metric-card { box-shadow: none !important; }
}
