/* ============================================================
   AI 项目看板 · 全局主题壳 v3（2026-11-08）
   口径与材料页同一套 token：深蓝 #1F4E79 / 浅蓝 #e8f0fe
   无动画、无渐变；暗色手动切换（localStorage: papm-theme）
   变量名沿用旧版（JS 内联样式依赖 var(--bg-card) 等），只换值
   ============================================================ */
:root {
  --bg-primary: #f2f4f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef1f5;
  --bg-tertiary: #f7f9fb;
  --border: #dfe4ea;
  --border-strong: #c9d1da;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #8a94a6;
  --accent: #1F4E79;
  --accent-ink: #163a5a;
  --accent-bg: #e8f0fe;
  --green: #1a7f37;
  --green-bg: #e6f4ea;
  --yellow: #b26a00;
  --yellow-bg: #fdf3e2;
  --red: #c62828;
  --red-bg: #fdecec;
  --blue: #1f6feb;
  --blue-bg: #e8f1fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --radius: 8px;
  --radius-sm: 6px;
  --transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

html[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #161b22;
  --bg-hover: #1f2733;
  --bg-tertiary: #1b2230;
  --border: #2a3341;
  --border-strong: #3a4553;
  --text-primary: #e6edf3;
  --text-secondary: #adbac7;
  --text-muted: #768390;
  --accent: #4d8fd6;
  --accent-ink: #8ec2f2;
  --accent-bg: #16283c;
  --green: #3fb950;
  --green-bg: #132a1a;
  --yellow: #d29922;
  --yellow-bg: #2b2313;
  --red: #f85149;
  --red-bg: #2d1618;
  --blue: #539bf5;
  --blue-bg: #16263d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 客户视角只读：隐藏写操作控件 */
body[data-role="client"] .client-write { display: none !important; }

/* 动画一律禁用（v3 设计口径：无动画无渐变） */
.animate-fade-in, .animate-slide-up, .animate-slide-down, .animate-slide-right,
.animate-slide-left, .animate-scale-in, .animate-pulse, .animate-bounce,
.animate-width, .animate-shimmer, .animate-glow, .animate-shake, .animate-float,
.skeleton, .risk-item.pulse, .risk-item-compact.pulse {
  animation: none !important;
}
.skeleton { background: var(--bg-hover); border-radius: 4px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------------- 登录 ---------------- */
.login-container { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--bg-primary); }
.login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.login-header { text-align: center; margin-bottom: 26px; }
.login-header h1 { font-size: 20px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.login-header p { color: var(--text-muted); font-size: 13px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 9px 11px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13.5px; outline: none; }
.form-group input:focus { border-color: var(--accent); }
.login-btn { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; }
.login-btn:hover { background: #163a5a; }
.login-error { color: var(--red); font-size: 12.5px; text-align: center; margin-top: 14px; }

/* ---------------- 布局 ---------------- */
.app-container { display: flex; height: 100vh; }

.sidebar {
  width: 216px; min-width: 216px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.logo { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .2px; }
.logo-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary); font-size: 13px;
  margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left;
  transition: var(--transition);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-bg); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; }
.nav-item .badge { font-size: 10px; background: var(--red); color: #fff; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.role-switcher { margin-bottom: 10px; }
.role-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.role-switcher select {
  width: 100%; background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px 9px; font-size: 12px; cursor: pointer; outline: none;
}
.role-switcher select:focus { border-color: var(--accent); }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* 顶栏：深蓝底白字（v3 标识性元素） */
.topbar {
  height: 54px; min-height: 54px;
  background: #1F4E79; color: #fff;
  display: flex; align-items: center; padding: 0 20px;
  border-bottom: 1px solid #163a5a;
}
html[data-theme="dark"] .topbar { background: #1F4E79; border-bottom-color: #163a5a; }
.page-title { font-size: 15px; font-weight: 600; color: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.btn-icon {
  position: relative; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-sm); color: #fff; font-size: 15px;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.btn-icon:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.btn-refresh { padding: 7px 14px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.btn-refresh:hover { border-color: var(--accent); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.btn-refresh.spinning .refresh-icon { animation: spin 1s linear infinite; }

.content-area { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ---------------- 驾驶舱 ---------------- */
.dashboard { max-width: 1400px; margin: 0 auto; }

.status-bar {
  display: flex; gap: 0; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 14px;
}
.status-item { display: flex; align-items: center; gap: 8px; padding: 0 22px; border-right: 1px solid var(--border); }
.status-item:first-child { padding-left: 0; }
.status-item:last-child { border-right: none; }
.status-label { font-size: 12px; color: var(--text-muted); }
.status-value { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.status-active { color: var(--green); }

.today-focus-card { border: 1px solid var(--border); border-radius: var(--radius); border-left: 3px solid var(--green); background: var(--bg-card); padding: 14px 16px; }
.today-focus-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.today-focus-title { font-size: 14px; font-weight: 600; }
.today-focus-sub { font-size: 12px; color: var(--text-muted); }

.metrics-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: var(--transition); position: relative;
}
.metric-card:hover { border-color: var(--accent); }
.metric-card.warning { border-left: 3px solid var(--yellow); }
.metric-card.danger { border-left: 3px solid var(--red); }
.metric-card.success { border-left: 3px solid var(--green); }
.metric-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.metric-icon { font-size: 16px; line-height: 1; }
.metric-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.metric-value { font-size: 28px; font-weight: 700; margin-bottom: 8px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.metric-bar { height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.metric-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s ease; }
.metric-detail { font-size: 12px; color: var(--text-muted); }

.ai-announce { display: flex; align-items: center; gap: 12px; background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 11px 15px; margin-bottom: 14px; }
.announce-icon { font-size: 18px; line-height: 1; }
.announce-text { font-size: 13px; color: var(--text-primary); }

.dashboard-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.dashboard-col { min-width: 0; display: flex; flex-direction: column; }
.dashboard-col .section-card { flex: 1; display: flex; flex-direction: column; min-height: 240px; }
.dashboard-col .section-card .collapsible-body { flex: 1; }

.section-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.section-card:hover { border-color: var(--border-strong); }
.section-card.risk-alert { border-left: 3px solid var(--red); background: var(--red-bg); }
.section-card.risk-alert .section-title { color: var(--red); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-title { font-size: 13.5px; font-weight: 600; }
.section-action { font-size: 12px; color: var(--accent); cursor: pointer; }
.section-action:hover { text-decoration: underline; }

.fold-toggle { cursor: pointer; user-select: none; }
.fold-arrow { display: inline-block; font-size: 11px; color: var(--text-muted); margin-left: 6px; transition: transform .15s ease; }
.section-card.collapsed .fold-arrow { transform: rotate(-90deg); }
.section-card.collapsed .collapsible-body { display: none; }
.section-card.collapsed { flex: 0 0 auto; min-height: auto; }
.fold-summary { display: none; font-size: 12px; font-weight: 600; color: var(--text-primary); }
.section-card.collapsed .fold-summary { display: inline-block; }
.fold-hint { font-size: 12px; color: var(--text-muted); }
.section-card.collapsed .fold-hint { display: none; }
.fold-toggle .fold-summary { display: none; }
.fold-toggle.collapsed .fold-summary { display: inline-block; }

body[data-role="dev"] .no-dev-ops-client,
body[data-role="ops"] .no-dev-ops-client,
body[data-role="client"] .no-dev-ops-client { display: none !important; }
body[data-role="client"] .client-hidden { display: none !important; }
body[data-role="biz"] .biz-hidden { display: none !important; }

.project-switcher-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.project-switcher-label { font-size: 12px; color: var(--text-muted); }
.project-switcher {
  background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 6px 11px; font-size: 12.5px; cursor: pointer; outline: none; max-width: 260px;
}
.project-switcher:hover, .project-switcher:focus { border-color: var(--accent); }

.overview-project-list { display: flex; flex-direction: column; gap: 12px; }
.overview-project-list .section-card { min-height: auto; flex: 0 0 auto; }
.overview-stat-line { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.overview-stat-line b { font-weight: 600; color: var(--text-primary); }
.load-role { flex: 1; font-size: 12px; color: var(--text-muted); }

#today-focus-list, #qiqiao-todo-list { max-height: 260px; overflow-y: auto; }
#today-focus-list::-webkit-scrollbar, #qiqiao-todo-list::-webkit-scrollbar { width: 6px; }

.task-distribution { display: flex; flex-direction: column; gap: 9px; }
.dist-item { display: flex; align-items: center; gap: 10px; }
.dist-label { width: 50px; font-size: 12px; color: var(--text-muted); }
.dist-bar { flex: 1; height: 14px; background: var(--bg-hover); border-radius: 7px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 7px; transition: width .6s ease; }
.dist-value { width: 30px; font-size: 12px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.member-load { display: flex; flex-direction: column; gap: 7px; }
.load-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.load-item.overload { color: var(--red); }
.load-item.high { color: var(--yellow); }
.load-name { width: 60px; font-size: 12px; }
.load-count { width: 20px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.load-bar { flex: 1; height: 7px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.load-bar span { display: block; height: 100%; border-radius: 4px; }

.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; }
.todo-item.high { border-left: 3px solid var(--red); }
.todo-item.mid { border-left: 3px solid var(--yellow); }
.todo-priority { font-size: 10px; }
.todo-title { flex: 1; }
.todo-assignee, .todo-deadline { color: var(--text-muted); }

.milestone-list { display: flex; flex-direction: column; gap: 7px; }
.milestone-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.milestone-item.done { color: var(--green); }
.milestone-item.progress { color: var(--yellow); }
.milestone-item.pending { color: var(--text-muted); }
.milestone-status { font-size: 13px; }
.milestone-name { flex: 1; }
.milestone-date { color: var(--text-muted); }

.risk-list-compact { display: flex; flex-direction: column; gap: 7px; }
.risk-item-compact { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; }
.risk-item-compact.high { border-left: 3px solid var(--red); }
.risk-level-badge { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; color: #fff; background: var(--red); }
.risk-title { flex: 1; }
.risk-owner { color: var(--text-muted); }

/* ---------------- 任务看板 ---------------- */
.task-board { max-width: 1400px; margin: 0 auto; }
.board-columns { display: grid; grid-template-columns: repeat(var(--board-cols, 4), 1fr); gap: 12px; }
.board-column { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-height: 400px; }
.column-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg-tertiary); }
.column-title { font-size: 13px; font-weight: 600; }
.column-count { background: var(--accent-bg); color: var(--accent); padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.column-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 600px; overflow-y: auto; }
.task-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; transition: var(--transition); }
.task-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-card.overdue { border-left: 3px solid var(--red); }
.card-title { font-size: 12.5px; font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.card-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.card-priority.high { color: var(--red); }
.card-priority.medium { color: var(--yellow); }
.card-priority.low { color: var(--green); }
.card-deadline { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.card-deadline.overdue { color: var(--red); font-weight: 600; }
.card-progress { display: flex; align-items: center; gap: 6px; }
.card-progress .progress-bar { flex: 1; height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; }
.card-progress .progress-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.card-progress .progress-text { font-size: 10px; color: var(--text-muted); width: 25px; text-align: right; }

/* ---------------- 列表 / 成员 / 报表 ---------------- */
.issue-list, .risk-list, .team-list, .report, .ai-context, .audit-log, .snapshot-list { max-width: 1000px; margin: 0 auto; }
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.list-header h2 { font-size: 17px; font-weight: 600; }
.issue-item, .risk-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  transition: var(--transition);
}
.issue-item:hover, .risk-item:hover { border-color: var(--accent); }
.issue-priority, .risk-level {
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  color: #fff; white-space: nowrap; display: inline-block; min-width: 52px; text-align: center;
}
.issue-priority.high, .risk-level.high { background: var(--red); }
.issue-priority.medium, .risk-level.medium { background: var(--yellow); }
.issue-priority.low, .risk-level.low { background: var(--green); }
.issue-content, .risk-content { flex: 1; min-width: 0; }
.issue-title, .risk-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.risk-description { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue-meta, .risk-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); }
.issue-item.risk-high, .risk-item.risk-high { border-left: 3px solid var(--red); }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.team-list { max-width: 1400px; }
.member-card { display: flex; align-items: flex-start; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.member-card:hover { border-color: var(--accent); }
.member-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex-shrink: 0; }
/* 成员卡内 JS 内联色（旧 neon 调色板）映射到 v3 token，避免浅色底发白发虚 */
.member-card div[style*="justify-content: space-between"] > span:last-child { white-space: nowrap; margin-left: 8px; }
.member-card span[style*="#4ade80"] { color: var(--green) !important; }
.member-card span[style*="#fbbf24"] { color: var(--yellow) !important; }
.member-card span[style*="#f87171"] { color: var(--red) !important; }
.member-name { font-size: 13px; font-weight: 600; }
.member-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.member-stats span { white-space: nowrap; }

.report-header, .context-header { margin-bottom: 14px; }
.report-header h2, .context-header h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.report-content, .context-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.report-content pre, .context-content pre { font-family: Consolas, Menlo, monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.report-actions, .context-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.btn-primary { padding: 7px 14px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; }
.btn-primary:hover { background: #163a5a; }
.btn-secondary { padding: 7px 14px; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-primary); border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; }
.btn-secondary:hover { background: var(--bg-hover); }
.context-tip { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px; font-size: 12px; color: var(--accent); }

/* ---------------- 任务详情 ---------------- */
.task-detail { max-width: 800px; margin: 0 auto; }
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.detail-header h2 { font-size: 17px; font-weight: 600; }
.detail-status { padding: 3px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.detail-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.detail-section h3 { font-size: 13px; font-weight: 600; margin-bottom: 11px; color: var(--accent); }
.detail-field { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.detail-field:last-child { border-bottom: none; }
.detail-field label { color: var(--text-muted); }
.detail-description { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); }
.detail-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------------- 快照 ---------------- */
.snapshot-actions { margin-bottom: 12px; }
.snapshot-items { display: flex; flex-direction: column; gap: 10px; }
.snapshot-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.snapshot-name { font-size: 13px; font-weight: 500; }
.snapshot-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.btn-rollback { padding: 4px 10px; background: var(--yellow-bg); border: 1px solid var(--yellow); border-radius: var(--radius-sm); color: var(--yellow); font-size: 12px; cursor: pointer; }
.btn-rollback:hover { background: var(--yellow); color: #fff; }

.empty { text-align: center; padding: 36px; color: var(--text-muted); font-size: 13px; }
.text-muted { color: var(--text-muted); }

/* ---------------- 时间线 ---------------- */
.timeline-view { display: flex; flex-direction: column; height: 100%; }
.tl-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.tl-header h2 { font-size: 15px; font-weight: 600; }
.tl-controls { display: flex; align-items: center; gap: 16px; }
.tl-task-count { font-size: 12px; color: var(--text-muted); background: var(--bg-tertiary); padding: 3px 10px; border-radius: 12px; }
.tl-legend { display: flex; gap: 12px; }
.tl-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.tl-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tl-scroll-wrapper { flex: 1; overflow: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); position: relative; }
.tl-chart { position: relative; min-height: 200px; }
.tl-month-row { position: sticky; top: 0; height: 24px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border); z-index: 5; }
.tl-month { position: absolute; top: 2px; font-size: 11.5px; font-weight: 600; color: var(--accent); padding-left: 4px; white-space: nowrap; }
.tl-day-row { display: flex; height: 28px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border); }
.tl-day { display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text-muted); border-right: 1px solid var(--border); flex-shrink: 0; }
.tl-day.today { background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.tl-day.weekend { background: var(--red-bg); }
.tl-body { position: relative; padding-top: 8px; }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 4; opacity: .8; pointer-events: none; }
.tl-today-line::before { content: '今天'; position: absolute; top: -2px; left: -14px; font-size: 9px; color: #fff; background: var(--accent); padding: 1px 4px; border-radius: 3px; }
.tl-task-bar { position: absolute; height: 32px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; padding: 0 8px; gap: 6px; color: #fff; font-size: 12px; font-weight: 500; overflow: hidden; white-space: nowrap; opacity: 1; z-index: 2; }
.tl-task-bar:hover { box-shadow: var(--shadow); z-index: 10; }
.tl-task-bar.overdue { outline: 2px dashed var(--red); outline-offset: 1px; }
.tl-bar-text { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tl-bar-meta { font-size: 10px; opacity: .85; margin-left: auto; flex-shrink: 0; }

/* ---------------- 项目卡片墙 ---------------- */
.pcards-wrap { max-width: 1400px; margin: 0 auto; }
.pcard-group { margin-bottom: 20px; }
.pcard-group-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pcard-group-title .pcard-group-count { font-size: 11.5px; background: var(--bg-tertiary); color: var(--text-muted); padding: 1px 8px; border-radius: 10px; }
.pcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pcard {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: var(--transition);
}
.pcard:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pcard.stale { opacity: .5; }
.pcard.stale:hover { opacity: .85; }
.pcard-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pcard-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pcard-dot.active { background: var(--green); }
.pcard-dot.pending { background: var(--yellow); }
.pcard-dot.done, .pcard-dot.archived { background: var(--text-muted); }
.pcard-dot.danger { background: var(--red); }
.pcard-name { font-size: 14px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-client { font-size: 12px; color: var(--text-muted); }
.pcard-phase { font-size: 11.5px; background: var(--accent-bg); color: var(--accent); padding: 1px 8px; border-radius: 10px; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.pcard-progress { display: flex; align-items: center; gap: 8px; }
.pcard-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pcard-stat { font-size: 11.5px; color: var(--text-muted); background: var(--bg-tertiary); border: 1px solid var(--border); padding: 1px 8px; border-radius: 4px; }
.pcard-stat-warn { color: var(--yellow); }
.pcard-stat-danger { color: var(--red); }
.pcard-bar { flex: 1; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.pcard-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.pcard-pct { font-size: 12px; font-weight: 600; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.pcard-status-text { font-size: 12px; color: var(--text-muted); }
.pcard-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pcard-meta .expired { color: var(--red); font-weight: 600; }
.pcard-focus { font-size: 12px; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; line-height: 1.6; }
.pcard-focus .pcard-focus-label { color: var(--accent); font-weight: 600; margin-right: 4px; }
.pcard-risk { font-size: 12px; color: var(--red); display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.pcard-foot { font-size: 11.5px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; }
.pcard-ops-note { font-size: 12px; color: var(--green); }
.pcard-empty { text-align: center; padding: 30px; color: var(--text-muted); font-size: 12.5px; background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------------- 需求看板（国元二期，形态 A） ---------------- */
.req-board {
  --req-bg: #ffffff; --req-panel: #ffffff; --req-text: #1f2937; --req-muted: #5b6675;
  --req-border: #dfe4ea; --req-head: #1F4E79; --req-soft: #e8f0fe;
  background: var(--req-bg); color: var(--req-text); padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--req-border);
}
.req-board.req-dark {
  --req-bg: #0d1117; --req-panel: #161b22; --req-text: #e6edf3; --req-muted: #9aa7b4;
  --req-border: #2a3341; --req-head: #8fb8e8; --req-soft: #16283c;
}
.req-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.req-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--req-head); }
.req-sub { margin-top: 4px; font-size: 12px; color: var(--req-muted); }
.req-tools { display: flex; gap: 8px; }
.req-btn { font-size: 12.5px; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--req-head); background: var(--req-head); color: #fff; }
.req-board.req-dark .req-btn { background: transparent; color: var(--req-head); }
.req-btn-ghost { background: var(--req-panel); color: var(--req-text); border-color: var(--req-border); }
.req-board.req-dark .req-btn-ghost { color: var(--req-text); }
.req-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.req-metric { background: var(--req-panel); border: 1px solid var(--req-border); border-radius: var(--radius-sm); padding: 12px 14px; }
.req-metric-value { font-size: 23px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.req-metric-label { font-size: 12px; color: var(--req-muted); margin-top: 4px; }
.req-stack { background: var(--req-panel); border: 1px solid var(--req-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.req-stack-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--req-soft); }
.req-stack-seg { display: block; height: 100%; }
.req-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.req-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--req-muted); }
.req-legend-item i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.req-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: var(--req-panel); border: 1px solid var(--req-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.req-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--req-muted); }
.req-field select, .req-field input { min-width: 130px; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--req-border); border-radius: 4px; background: var(--req-bg); color: var(--req-text); }
.req-field-search input { min-width: 200px; }
.req-count-line { font-size: 12px; color: var(--req-muted); margin-bottom: 8px; }
.req-columns { display: grid; grid-template-columns: repeat(var(--req-cols, 5), minmax(0, 1fr)); gap: 12px; align-items: start; }
.req-column { background: var(--req-panel); border: 1px solid var(--req-border); border-radius: var(--radius-sm); overflow: hidden; }
.req-column-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 3px solid #8a94a6; background: var(--req-soft); }
.req-column-label { font-size: 13.5px; font-weight: 600; color: var(--req-text); }
.req-column-count { font-size: 12px; color: #fff; border-radius: 10px; padding: 1px 8px; }
.req-column-hint { font-size: 12px; color: var(--req-muted); padding: 6px 12px; border-bottom: 1px solid var(--req-border); }
.req-column-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.req-empty-col { padding: 12px; text-align: center; font-size: 12px; color: var(--req-muted); }
.req-card { background: var(--req-bg); border: 1px solid var(--req-border); border-radius: var(--radius-sm); padding: 10px 12px; }
.req-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.req-no { font-size: 12px; color: var(--req-muted); }
.req-pri { font-size: 12px; padding: 1px 6px; border: 1px solid var(--req-border); border-radius: 3px; }
.req-pri-p0 { color: #b03a2e; border-color: #e6b0aa; background: #fdedec; }
.req-pri-p1 { color: var(--req-muted); }
.req-board.req-dark .req-pri-p0 { color: #f0a9a1; border-color: #7b3b34; background: #3a1f1c; }
.req-card-title { margin-bottom: 6px; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.req-card-meta { margin-bottom: 6px; font-size: 12px; color: var(--req-muted); }
.req-card-detail { margin-bottom: 6px; font-size: 12px; line-height: 1.5; color: var(--req-text); }
.req-card-note { margin-bottom: 6px; padding: 6px 8px; font-size: 12px; color: var(--req-text); background: var(--req-soft); border-left: 3px solid var(--req-head); border-radius: 0 3px 3px 0; }
.req-card-foot { font-size: 12px; color: var(--req-muted); }
.req-table-wrap { overflow-x: auto; background: var(--req-panel); border: 1px solid var(--req-border); border-radius: var(--radius-sm); }
.req-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.req-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--req-muted); background: var(--req-soft); border-bottom: 1px solid var(--req-border); white-space: nowrap; }
.req-table td { padding: 10px 12px; border-bottom: 1px solid var(--req-border); vertical-align: top; }
.req-table tr:last-child td { border-bottom: none; }
.req-td-no { white-space: nowrap; color: var(--req-muted); }
.req-td-title { font-weight: 600; line-height: 1.4; }
.req-td-detail { margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--req-muted); }
.req-td-time { white-space: nowrap; color: var(--req-muted); }
.req-status { font-size: 12px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; white-space: nowrap; }
.req-loading { padding: 24px; text-align: center; font-size: 13px; color: var(--req-muted); }

/* ---------------- 自定义属性管理页（#/task-fields，2026-11-10） ---------------- */
.tf-page { padding: 4px 2px 24px; }
.tf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tf-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-primary); }
.tf-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.tf-tools { display: flex; gap: 8px; flex-shrink: 0; }
.tf-btn { font-size: 12.5px; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: #fff; transition: var(--transition); }
.tf-btn:hover:not(:disabled) { background: var(--accent-ink); }
.tf-btn:disabled { opacity: .5; cursor: not-allowed; }
.tf-btn-ghost { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border-strong); }
.tf-btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }
.tf-notice { margin-bottom: 12px; padding: 9px 12px; font-size: 12.5px; color: var(--yellow); background: var(--yellow-bg); border: 1px solid var(--yellow); border-radius: var(--radius-sm); }
.tf-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tf-metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.tf-metric-value { font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.tf-metric-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.tf-table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tf-table th { padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-tertiary); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tf-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-primary); }
.tf-table tr:last-child td { border-bottom: none; }
.tf-row-archived td { color: var(--text-muted); }
.tf-td-name { font-weight: 600; }
.tf-td-num { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.tf-td-act { white-space: nowrap; }
.tf-key { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; padding: 1px 5px; border-radius: 3px; background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary); }
.tf-chip { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 6px; font-size: 11.5px; border-radius: 3px; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--border); }
.tf-chip-more { background: var(--bg-tertiary); color: var(--text-muted); }
.tf-badge { font-size: 11.5px; padding: 1px 7px; border-radius: 10px; color: var(--green); background: var(--green-bg); border: 1px solid var(--green); }
.tf-badge-off { color: var(--text-muted); background: var(--bg-tertiary); border-color: var(--border-strong); }
.tf-link { background: none; border: none; padding: 0; margin-right: 10px; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.tf-link:hover:not(:disabled) { text-decoration: underline; }
.tf-link:disabled { color: var(--text-muted); cursor: not-allowed; text-decoration: none; }
.tf-link-danger { color: var(--red); }
.tf-dash { color: var(--text-muted); }
.tf-empty { padding: 28px; text-align: center; font-size: 12.5px; color: var(--text-muted); background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.tf-loading { padding: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.tf-foot { margin-top: 12px; font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.tf-form { margin-bottom: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius-sm); }
.tf-form-head { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
.tf-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tf-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.tf-field input, .tf-field select, .tf-field textarea { font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--bg-secondary); color: var(--text-primary); font-family: inherit; }
.tf-field input[readonly], .tf-field select:disabled { background: var(--bg-tertiary); color: var(--text-secondary); }
.tf-field-wide { margin-top: 12px; }
.tf-field textarea { resize: vertical; line-height: 1.6; }
.tf-form-err { margin-top: 10px; font-size: 12.5px; color: var(--red); min-height: 16px; }
.tf-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@media (max-width: 900px) {
  .tf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 2026-11-13 体检#11：顶栏项目切换器（≤640px 才出现，宽屏用侧栏那个，避免两个下拉同时出现） */
.topbar-project-switcher { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
  .req-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { width: 180px; min-width: 180px; }
  .dashboard-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .board-columns { grid-template-columns: repeat(2, 1fr); }
  .req-columns { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 768px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .board-columns { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .tl-header { flex-direction: column; align-items: flex-start; }
  .tl-legend { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .sidebar { width: 56px; min-width: 56px; }
  .sidebar-header { padding: 12px 8px; }
  .logo { white-space: nowrap; overflow: hidden; font-size: 0; }
  .logo::after { content: '\1F3AF'; font-size: 20px; }
  .logo-sub, .version-info { display: none; }
  /* 2026-11-13 体检#11：≤640px 时侧栏收成 56px 图标条，原规则把 .global-project-switcher 直接 display:none
     → 窄屏彻底无法切项目。改为「侧栏副本隐藏、顶栏下拉接管」（同一份 projects 数据 + 同一 onGlobalProjectSwitch）。 */
  .global-project-switcher { display: none; }
  .topbar-project-switcher { display: block; flex: 0 1 auto; min-width: 0; margin-left: 8px; }
  .topbar-project-switcher .project-switcher { max-width: 168px; padding: 5px 8px; font-size: 12px; }
  .page-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .nav-item > span:not(.icon):not(.badge) { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; position: relative; }
  .nav-item .badge { position: absolute; top: 4px; right: 6px; }
  .metrics-row { grid-template-columns: 1fr; }
  .login-box { padding: 24px; }
}
@media (pointer: coarse) {
  .nav-item { min-height: 44px; }
  .btn-icon { min-width: 40px; min-height: 40px; }
  .pcard-stat { padding: 4px 8px; }
}
@media print {
  .sidebar, .topbar, .btn-icon, .login-container { display: none !important; }
  body { overflow: visible; height: auto; }
  .app-container { display: block; height: auto; }
  .main-content { overflow: visible; height: auto; }
  .content-area { overflow: visible; padding: 0; }
}

/* 辅助文字不小于 12px（长期看屏可读性，沿用旧版口径） */
.logo-sub, .today-focus-sub, .fold-arrow, .fold-hint, .load-role, .column-count,
.risk-description, .issue-meta, .risk-meta, .member-stats, .detail-status,
.snapshot-date, .btn-rollback, .tl-legend-item, .tl-month, .pcard-group-count,
.pcard-stat, .pcard-meta, .pcard-focus, .pcard-risk, .pcard-ops-note,
.card-meta, .card-deadline, .pcard-client, .pcard-phase, .pcard-foot,
.version-info, .tl-legend { font-size: 12px !important; }

/* ============================================================
 * 批1 看板焕新（2026-11-08）追加新类
 * 规则：只用已有 CSS 变量（自动跟随浅色/暗色），不改任何 token 值；
 *      无动画、无渐变、单一主色，沿用 v3 企业风。
 * ============================================================ */

/* ---- 全部项目页 #/projects ---- */
.projects-page { max-width: 1400px; }
.proj-group { margin-bottom: 22px; }
.proj-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  padding: 0 0 10px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.proj-group-count {
  display: inline-block; min-width: 20px; padding: 0 6px;
  font-size: 12px; line-height: 18px; text-align: center;
  color: var(--accent); background: var(--accent-bg);
  border-radius: 10px; font-weight: 500;
}
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.proj-card { cursor: pointer; }
.proj-card:hover { border-color: var(--accent); }
.proj-cat {
  font-size: 11px; line-height: 16px; padding: 0 6px;
  color: var(--text-secondary); background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 4px;
  margin-left: 6px; white-space: nowrap;
}
.proj-stage {
  font-size: 11px; line-height: 16px; padding: 0 6px;
  border-radius: 4px; margin-left: auto; white-space: nowrap;
  border: 1px solid transparent;
}
.proj-stage-delivery { color: var(--accent); background: var(--accent-bg); border-color: var(--accent); }
.proj-stage-ops { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.proj-stage-pending { color: var(--yellow); background: var(--yellow-bg); border-color: var(--yellow); }
.proj-stage-archived { color: var(--text-muted); background: var(--bg-tertiary); border-color: var(--border); }
.proj-due { color: var(--text-secondary); }
.proj-due-danger { color: var(--red); font-weight: 500; }

/* ---- 单项目驾驶舱 #/project/<id> ---- */
.cockpit { max-width: 1400px; }
.cockpit-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 18px; margin-bottom: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.cockpit-head-main { min-width: 0; }
.cockpit-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cockpit-title { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0; }
.cockpit-meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.cockpit-meta strong { color: var(--text-primary); }
.cockpit-back {
  flex: 0 0 auto; font-size: 13px; color: var(--accent);
  text-decoration: none; padding: 4px 10px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  white-space: nowrap;
}
.cockpit-back:hover { background: var(--accent-bg); }
.cockpit-card { margin-bottom: 14px; }
.cockpit-track-card { padding: 16px 18px; }

.cockpit-track { display: flex; align-items: flex-start; gap: 0; }
.cockpit-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.cockpit-step::before {
  content: ''; position: absolute; top: 13px; left: 0; right: 0;
  height: 2px; background: var(--border-strong);
}
.cockpit-step:first-child::before { left: 50%; }
.cockpit-step:last-child::before { right: 50%; }
.cockpit-step.done::before, .cockpit-step.current::before { background: var(--accent); }
.cockpit-step-dot {
  position: relative; z-index: 1;
  width: 26px; height: 26px; line-height: 24px; text-align: center;
  font-size: 12px; border-radius: 50%;
  background: var(--bg-card); color: var(--text-muted);
  border: 2px solid var(--border-strong);
}
.cockpit-step.done .cockpit-step-dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.cockpit-step.current .cockpit-step-dot { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.cockpit-step-label { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.cockpit-step.current .cockpit-step-label { color: var(--accent); font-weight: 600; }
.cockpit-track-note { margin-top: 12px; font-size: 12px; color: var(--text-secondary); }

/* 鱼骨图里程碑：横轴 + 上下交替节点 */
.fishbone { position: relative; overflow-x: auto; padding: 6px 2px 2px; }
.fish-nodes { position: relative; display: flex; align-items: stretch; min-width: 100%; }
.fish-nodes::before {
  content: ''; position: absolute; left: 0; right: 0; top: 70px;
  height: 2px; background: var(--border-strong);
}
.fish-col { flex: 1 0 108px; display: flex; flex-direction: column; align-items: center; position: relative; }
.fish-slot { height: 62px; width: 100%; display: flex; align-items: center; justify-content: center; }
.fish-dot {
  position: relative; z-index: 1;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border-strong);
}
.fish-dot.done { background: var(--accent); border-color: var(--accent); }
.fish-dot.overdue { background: var(--red); border-color: var(--red); }
.fish-card {
  width: 100%; max-width: 104px; padding: 4px 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: center;
}
.fish-card.done { border-color: var(--accent); }
.fish-card.overdue { border-color: var(--red); }
.fish-date { font-size: 11px; color: var(--text-secondary); }
.fish-card.overdue .fish-date { color: var(--red); }
.fish-name { font-size: 12px; color: var(--text-primary); margin-top: 2px; }

/* 今日要处理（表格：任务/负责人/期限/状态） */
.cockpit-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.cockpit-table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--text-secondary);
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.cockpit-table td {
  font-size: 13px; color: var(--text-primary);
  padding: 7px 8px; border-bottom: 1px solid var(--border);
}
.cockpit-table tbody tr:last-child td { border-bottom: none; }
.cockpit-td-title { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cockpit-overdue { color: var(--red); }

/* 权责三格 */
.cockpit-duty {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.cockpit-duty-cell {
  padding: 10px 12px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cockpit-duty-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.cockpit-duty-value { font-size: 13px; color: var(--text-primary); }

/* ---- 顶栏「返回全部项目」面包屑（2026-11-11：全部项目=总览层，不并入功能 tab）---- */
.topbar-crumb {
  display: inline-flex; align-items: center; gap: 5px;
  margin-right: 12px; padding: 5px 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px;
  cursor: pointer; transition: var(--transition);
}
.topbar-crumb:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.topbar-crumb[hidden] { display: none; }
.topbar-crumb .crumb-arrow { font-size: 13px; opacity: .85; }
