/* ==========================================================================
   ★ 内容区专项优化（2026-11-05）
   --------------------------------------------------------------------------
   左侧（侧边栏）已经现代化，但右侧内容区还是 B0~B20 的老代码 —— 新旧混杂反而更显眼。

   内容区 LOW 的四个具体成因：
     ① 「卡片套卡片」—— card → card-body(padding) → table，表格被框在框里，双重边框
     ② 统计卡片平铺 —— 4 个一模一样的「图标+数字」，没有主次
     ③ 区块节奏乱 —— 一处 mt-4 一处没有，间距全靠内联 style
     ④ 搜索框/图标还是 emoji，跟新的线性图标系统不搭

   本层解决这四点。采用后置覆盖，不改原有规则。
   ========================================================================== */

/* ==========================================================================
   ① 消除「卡片套卡片」—— 表格独立成数据面板
   ========================================================================== */
.card > .card-body.flush { padding: 0; }
.card > .card-body.flush > .data-table { border-radius: 0; }

/* 通用：贴边的卡片内容区 */
.card-body.flush { padding: 0 !important; }

/* 数据面板（表格独立成一块，不再被卡片 padding 包住） */
.data-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.data-panel > .data-table { border-radius: 0; }
.data-panel > .data-table thead th:first-child { border-top-left-radius: 0; }
.data-panel > .data-table thead th:last-child { border-top-right-radius: 0; }
.data-panel > .data-table tbody tr:last-child td { border-bottom: none; }

/* 面板式工具条（表格上方的筛选/搜索） */
.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.panel-toolbar + .data-panel { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ==========================================================================
   ② KPI 面板重做（不再是四个一样的图标+数字）
   ========================================================================== */
.stats-grid { gap: 12px; }

.stat-card {
  position: relative;
  padding: 16px 18px;
  gap: 0;
  align-items: flex-start;
  overflow: hidden;
}
/* 图标退到右上角，淡化 —— 让数字成为主角 */
.stat-card .stat-icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  opacity: .9;
}
.stat-card .stat-icon .ic { width: 17px; height: 17px; }
.stat-info { width: 100%; }
.stat-label {
  order: -1;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .04em;
  margin: 0 0 4px;
  text-transform: none;
}
.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.stat-card .stat-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 6px;
}

/* 数字等宽 —— 多个 KPI 并排时不跳动 */
.stat-value, .kpi-value { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   ③ 区块节奏统一
   ========================================================================== */
/* 内容区直接子元素统一间距（覆盖零散的 mt-4 / inline margin） */
.content-area > .card,
.content-area > .data-panel,
.content-area > .page-header + * { margin-bottom: 16px; }
.content-area > .card:last-child,
.content-area > .data-panel:last-child { margin-bottom: 0; }

/* 通用堆叠容器 */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }

/* 行内元素组 */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   ④ 搜索框（emoji → 线性图标 + 绝对定位）
   ========================================================================== */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box > span:first-child {
  position: absolute;
  left: 10px;
  display: inline-flex;
  color: var(--text-muted);
  pointer-events: none;
}
.search-box > span:first-child .ic { width: 15px; height: 15px; }
/* emoji 未被转换时的兜底 */
.search-box > span:first-child:not(:has(.ic)) {
  font-size: 13px;
  width: auto; height: auto;
}
.search-box input {
  padding-left: 32px;
  padding-right: 30px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-base);
  transition: border-color .15s ease, box-shadow .15s ease;
  min-width: 0;
}
.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--sh-ring);
}
.search-box input::placeholder { color: var(--text-muted); }

/* ==========================================================================
   ⑤ 表格精致度
   ========================================================================== */
.data-table { font-size: var(--fs-base); }
.data-table th,
.data-table td { padding: 11px 14px; }
/* 表头更轻 */
.data-table thead th {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: .03em;
  text-transform: uppercase;
  padding-top: 9px;
  padding-bottom: 9px;
}
/* 数字列右对齐（表头是「数量/进度/比例」这类时） */
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 名称列加粗一点 —— 视觉锚点 */
.data-table td .doc-title, .data-table td strong { color: var(--text); font-weight: 600; }

/* 阶段分组行（表格里的分节标题） */
.data-table tr.group-row { background: var(--surface-muted); }
.data-table tr.group-row td {
  font-weight: 650;
  color: var(--text);
  font-size: var(--fs-base);
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   ⑥ 阶段时间线重做（老样式 → 现代进度轨）
   ========================================================================== */
.stage-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.timeline-step {
  position: relative;
  text-align: left;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.timeline-step:hover { box-shadow: var(--sh-sm); }
.timeline-step.active {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  box-shadow: 0 0 0 1px var(--brand-border);
}
.timeline-step.completed { border-color: var(--ok-border); background: var(--ok-bg); }
/* 顶部进度条 */
.timeline-step .tl-bar {
  height: 4px;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  overflow: hidden;
  margin-bottom: 9px;
}
.timeline-step.completed .tl-bar { background: rgba(5,150,105,.18); }
.timeline-step .tl-bar > i {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
}
.timeline-step.completed .tl-bar > i { background: var(--ok); }
.timeline-step .tl-name {
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}
.timeline-step .tl-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.timeline-step.completed .tl-name { color: var(--ok); }
.timeline-step.active .tl-name { color: var(--brand); }

/* ==========================================================================
   ⑦ 项目列表项（仪表盘）重做
   ========================================================================== */
.dash-project-list { display: flex; flex-direction: column; }
.dash-project-item {
  border-bottom: 1px solid var(--border-subtle);
  transition: background .14s ease;
}
.dash-project-item:last-child { border-bottom: none; }
.dash-project-item:hover { background: var(--surface-hover); }
.dash-project-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  cursor: pointer;
}
.dash-project-header .proj-name {
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}
.dash-project-header .proj-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 3px;
}
/* 有在办文档的项目 → 左侧色条 + 浅底（一眼看到重点） */
.dash-project-item.current-focus { background: #fcfdff; }
.dash-project-item.current-focus .dash-project-header {
  box-shadow: inset 3px 0 0 var(--brand);
}

/* ==========================================================================
   ⑧ 空状态（替代裸文字）
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ==========================================================================
   ⑨ 区块小标题（内容区里区分不同用途的段落）
   ========================================================================== */
.block-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.block-title .bt-main {
  font-size: var(--fs-md);
  font-weight: 650;
  color: var(--text);
}
.block-title .bt-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ==========================================================================
   ⑩ 卡片层级
   ========================================================================== */
.card-flat {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: none;
}
.card-hero {
  background: linear-gradient(135deg, #f8fbff, #eff6ff);
  border-color: var(--brand-border);
  box-shadow: var(--sh-sm);
}

/* ==========================================================================
   ⑪ 表单区（填表页）细节
   ========================================================================== */
.doc-form-section {
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  background: var(--surface);
}
.doc-form-section-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 14px;
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
}
.doc-form-content {
  border-radius: var(--r-md);
  border-color: var(--border-strong);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.doc-form-content:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--sh-ring);
}

/* ==========================================================================
   ⑫ 响应式
   ========================================================================== */
@media (max-width: 1100px) {
  .stage-timeline { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .stage-timeline { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-project-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .stage-timeline { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ★ 待办卡（B50 仪表盘 / 我的任务）
   ========================================================================== */
.todo-card { margin-bottom: 16px; }

.todo-group { margin-bottom: 14px; }
.todo-group:last-child { margin-bottom: 0; }

.todo-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  font-weight: 650;
  margin-bottom: 8px;
}
.todo-group-title .ic { width: 14px; height: 14px; }
.todo-group-title .tg-count {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--text-secondary);
}
.todo-group-title .tg-tip {
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.todo-group-title.tone-purple { color: #7c3aed; }
.todo-group-title.tone-blue   { color: var(--brand); }
.todo-group-title.tone-amber  { color: var(--warn); }
.todo-group-title.tone-purple .tg-count { background: #f5f3ff; color: #7c3aed; }
.todo-group-title.tone-blue .tg-count   { background: var(--brand-subtle); color: var(--brand); }
.todo-group-title.tone-amber .tg-count  { background: var(--warn-bg); color: var(--warn); }

.todo-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.todo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 4px 11px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.todo-chip:hover {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  box-shadow: var(--sh-xs);
}
.todo-chip .tc-name { font-weight: 550; color: var(--text); }
.todo-chip .tc-sep { color: var(--gray-300); }
.todo-chip .tc-proj { color: var(--text-secondary); }
.todo-chip .tc-stage { color: var(--text-muted); font-size: var(--fs-xs); }
.todo-chip .tc-time {
  font-weight: 650;
  font-size: var(--fs-xs);
  padding: 0 6px;
  border-radius: var(--r-full);
}
.todo-chip.time-overdue { border-color: var(--danger-border); background: var(--danger-bg); }
.todo-chip.time-overdue .tc-time { color: var(--danger); }
.todo-chip.time-today { border-color: var(--warn-border); background: var(--warn-bg); }
.todo-chip.time-today .tc-time { color: var(--warn); }
.todo-chip.time-tomorrow .tc-time { color: var(--warn); }
.todo-chip.time-week .tc-time,
.todo-chip.time-future .tc-time { color: var(--text-muted); }

.todo-more {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  align-self: center;
}

/* ==========================================================================
   ★ 语义化徽标补充
   ========================================================================== */
.badge-purple { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-warn    { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info    { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }

/* ==========================================================================
   ★ B59 仪表盘改造（2026-11-05）
   --------------------------------------------------------------------------
   仪表盘不再是「项目详情复刻 + 点哪儿都跳转」：
     · 项目卡片默认收起（一行摘要），点行展开阶段概览
     · 只有明确的「查看详情 / 处理」按钮才跳转
     · 新增「需要关注」区块 —— 全厂卡点汇总（这才是仪表盘的作用）
   ========================================================================== */

/* ---------- 项目卡片：摘要行 ---------- */
.dash-project-header {
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.dash-project-header:hover { background: var(--surface-hover); }
.dash-project-header:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* 展开箭头 */
.dash-expand {
  display: inline-flex;
  color: var(--text-muted);
  transition: transform .18s ease;
  flex: none;
}
.dash-expand .ic { width: 15px; height: 15px; }
.dash-expand.rotated { transform: rotate(90deg); }

/* 摘要里的元信息 */
.proj-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.proj-meta .dot { color: var(--gray-300); }
.proj-meta .meta-wip { color: var(--text-secondary); }
.proj-meta .meta-gate { color: var(--warn); font-weight: 600; }
.proj-meta .meta-overdue { color: var(--danger); font-weight: 600; }

.proj-pct {
  font-size: 13px;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 「查看详情」按钮 —— 明确的入口 */
.dash-open-btn { flex: none; }

/* ---------- 阶段概览：默认收起 ---------- */
.dash-project-stages {
  display: none;
  gap: 6px;
  padding: 0 18px 14px 46px;
}
.dash-project-stages.expanded { display: grid; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) {
  .dash-project-stages.expanded { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .dash-project-stages.expanded { grid-template-columns: repeat(2, 1fr); }
}

/* 阶段小卡：不再是链接，去掉 pointer */
.dash-stage-mini {
  cursor: default;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 9px;
  background: var(--surface);
  transition: border-color .14s ease, background .14s ease;
}
.dash-stage-mini:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.dash-stage-mini.completed { border-color: var(--ok-border); background: var(--ok-bg); }
.dash-stage-mini.current { border-color: var(--brand-border); background: var(--brand-subtle); }
.dash-stage-mini .mini-name {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-stage-mini.completed .mini-name { color: var(--ok); }
.dash-stage-mini.current .mini-name { color: var(--brand); }
.dash-stage-mini .mini-stats {
  font-size: 10px;
  color: var(--text-muted);
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}
.dash-stage-mini .mini-bar {
  height: 3px;
  background: var(--surface-muted);
  border-radius: var(--r-full);
  overflow: hidden;
}
.dash-stage-mini .mini-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-full);
}
.dash-stage-mini.completed .mini-bar-fill { background: var(--ok); }

/* ==========================================================================
   「需要关注」区块
   ========================================================================== */
.attention-card { border-left: 3px solid var(--warn); }
.attention-list { display: flex; flex-direction: column; }

.attention-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background .14s ease;
}
.attention-row:last-child { border-bottom: none; }
.attention-row:hover { background: var(--surface-hover); }

/* 左侧色条标示级别 */
.ar-level {
  width: 3px;
  height: 30px;
  border-radius: var(--r-full);
  flex: none;
}
.ar-level.ar-danger { background: var(--danger); }
.ar-level.ar-warn   { background: var(--warn); }
.ar-level.ar-info   { background: var(--info); }

.ar-main { flex: 1; min-width: 0; }
.ar-doc {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.ar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ==========================================================================
   ★ B60 体验反馈页重做（2026-11-06）
   --------------------------------------------------------------------------
   原来：两个同名入口（顶栏「体验反馈」=提交 / 导航「体验反馈」=汇总）→ 混淆；
        页面全内联样式；提交弹窗是自建 overlay 不统一；没有「我的反馈」视角。
   现在：双视角页签 + 页头主按钮 + 统计卡 + 语义化芯片 + 分层卡片 + 系统弹窗。
   ========================================================================== */

/* ---------- 页头卡 ---------- */
.fb-head-card { margin-bottom: 16px; }
.fb-head-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.fb-head-icon .ic { width: 21px; height: 21px; }

/* ---------- 视角页签 ---------- */
.fb-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.fb-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.fb-tab:hover { color: var(--text); }
.fb-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-xs);
  font-weight: 650;
}
.fb-tab-n {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--text-secondary);
}
.fb-tab.active .fb-tab-n { background: var(--brand-subtle); color: var(--brand); }

/* ---------- 类型筛选芯片 ---------- */
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fb-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.fb-chip:hover { border-color: var(--border-strong); color: var(--text); }
.fb-chip.active {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--brand);
  font-weight: 600;
}
.fb-chip .fc-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.fb-chip.active .fc-n { color: var(--brand); }

/* ---------- 反馈卡片 ---------- */
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--sh-xs);
  transition: box-shadow .16s ease, border-color .16s ease;
}
.fb-item:hover { box-shadow: var(--sh-sm); }
/* 左侧色条标示处理状态 */
.fb-item { border-left: 3px solid var(--neutral-border); }
.fb-st-pending  { border-left-color: var(--warn); }
.fb-st-doing    { border-left-color: var(--info); }
.fb-st-accepted { border-left-color: var(--ok); }
.fb-st-rejected { border-left-color: var(--border-strong); }

.fb-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fb-time { font-size: var(--fs-xs); color: var(--text-muted); }
.fb-who { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 550; }
.fb-ops { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.fb-waiting { font-size: var(--fs-xs); color: var(--text-muted); }

.fb-desc {
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}
.fb-suggest {
  margin-top: 8px;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--surface-muted);
  border-radius: var(--r-md);
  padding: 8px 11px;
}
.fb-suggest .fb-lbl {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 7px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--surface);
}
.fb-meta {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.fb-meta .ic { width: 12px; height: 12px; }
.fb-shot { margin-top: 8px; font-size: var(--fs-sm); }
.fb-shot a {
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.fb-shot a:hover { text-decoration: underline; }

/* ---------- 提交表单（系统弹窗内） ---------- */
.fb-form-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-radius: var(--r-md);
  padding: 8px 11px;
  margin-bottom: 16px;
}
.fb-form-note .ic { width: 14px; height: 14px; }
.fb-msg { font-size: var(--fs-sm); color: var(--danger); min-height: 20px; margin-top: 4px; }

/* ==========================================================================
   ★ B61 阶段管理页（2026-11-07）
   --------------------------------------------------------------------------
   原来：5 张阶段卡塞在 2 列网格，每张信息过载（统计+项目列表+文档徽章），
        文档徽章截断成 "+N"，没有横向对比，项目行点击直接跳走。
   现在：顶部全厂阶段进度轨（横向对比）+ 阶段卡全宽可展开（项目进度 + 真实卡点清单）。
   ========================================================================== */

/* ---------- 顶部阶段进度轨 ---------- */
.stage-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.rail-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 13px;
  box-shadow: var(--sh-xs);
  transition: box-shadow .16s ease, border-color .16s ease;
}
.rail-step:hover { box-shadow: var(--sh-sm); }
.rail-step.tone-ok    { border-color: var(--ok-border); background: var(--ok-bg); }
.rail-step.tone-doing { border-color: var(--brand-border); }

.rs-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 9px; }
.rs-no {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: var(--r-full);
  padding: 1px 7px;
  flex: none;
}
.rail-step.tone-ok .rs-no { background: rgba(5,150,105,.14); color: var(--ok); }
.rs-name {
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rs-bar {
  height: 5px;
  background: var(--surface-muted);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 5px;
}
.rail-step.tone-ok .rs-bar { background: rgba(5,150,105,.16); }
.rs-bar > i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-full);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.rail-step.tone-ok .rs-bar > i { background: var(--ok); }
.rs-pct {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.rs-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.rs-block {
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: var(--r-sm);
  padding: 2px 7px;
  display: inline-block;
}

/* ---------- 阶段卡（全宽 + 可展开） ---------- */
.stage-v2-card { margin-bottom: 0; }
.stage-v2-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .14s ease;
}
.stage-v2-head:hover { background: var(--surface-hover); }
.stage-v2-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.stage-v2-card.expanded .stage-v2-head { border-bottom: 1px solid var(--border-subtle); }
.stage-v2-card.expanded .dash-expand { transform: rotate(90deg); }

.svh-title { display: flex; align-items: center; gap: 10px; flex: none; }
.svh-no {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--brand-subtle);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}
.svh-name { font-size: var(--fs-md); font-weight: 650; color: var(--text); line-height: 1.3; }
.svh-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }

.svh-stats { display: flex; gap: 14px; margin-left: auto; flex: none; }
.svh-stat {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.svh-stat b {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.svh-stat.ok b { color: var(--ok); }
.svh-stat.doing b { color: var(--brand); }
.svh-stat.idle b { color: var(--text-muted); }
.svh-stat.gate b { color: var(--warn); }

.svh-bar {
  width: 130px;
  height: 6px;
  background: var(--surface-muted);
  border-radius: var(--r-full);
  overflow: hidden;
  flex: none;
}
.svh-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: var(--r-full);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.svh-pct {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---------- 展开内容 ---------- */
.stage-v2-body { padding: 14px 18px 16px; }
.svb-block { margin-bottom: 16px; }
.svb-block:last-child { margin-bottom: 0; }
.svb-title {
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.svb-clear {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--r-md);
}

/* 项目进度行 */
.svb-projs { display: flex; flex-direction: column; gap: 4px; }
.svb-proj {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  font-size: var(--fs-sm);
}
.svb-proj.wip { background: var(--brand-subtle); }
.sbp-name {
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svb-bar {
  flex: 1;
  height: 5px;
  background: var(--surface);
  border-radius: var(--r-full);
  overflow: hidden;
  min-width: 60px;
}
.svb-bar > i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-full);
}
.sbp-num {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sbp-gate {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--surface);
}
.sbp-gate.warn { color: var(--warn); background: var(--warn-bg); font-weight: 600; }

/* 卡点清单 */
.svb-blockers {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.svb-blocker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
}
.svb-blocker:last-child { border-bottom: none; }
.svb-blocker:hover { background: var(--surface-hover); }
.sbb-doc {
  font-weight: 550;
  color: var(--text);
  min-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbb-proj { color: var(--text-secondary); min-width: 100px; }
.sbb-who { color: var(--text-muted); font-size: var(--fs-xs); }
.sbb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.svb-more {
  padding: 7px 12px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--surface-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stage-rail { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .svh-stats { display: none; }
  .svh-bar { display: none; }
}
@media (max-width: 680px) {
  .stage-rail { grid-template-columns: repeat(2, 1fr); }
  .svb-proj { flex-wrap: wrap; }
  .sbb-doc { min-width: 0; flex: 1 1 100%; }
}

/* ==========================================================================
   ★ B61 文档管理页（2026-11-07）
   --------------------------------------------------------------------------
   原来：3 层嵌套长列表，只能搜索不能筛选，没有概览。
   现在：可点统计卡 + 双视图 + 组合筛选 + 表格化。
   ========================================================================== */

/* ---------- 统计卡行 ---------- */
.doc-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.doc-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-stat:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.doc-stat:disabled { cursor: default; opacity: .75; }
.doc-stat:disabled:hover { transform: none; box-shadow: var(--sh-xs); }
.doc-stat.active {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  box-shadow: 0 0 0 1px var(--brand-border);
}
.ds-icon {
  display: inline-flex;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.ds-icon .ic { width: 15px; height: 15px; }
.ds-n {
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ds-l { font-size: var(--fs-xs); color: var(--text-secondary); }
.doc-stat.tone-ok .ds-n { color: var(--ok); }
.doc-stat.tone-doing .ds-n { color: var(--brand); }
.doc-stat.tone-danger .ds-n { color: var(--danger); }
.doc-stat.tone-info .ds-n { color: var(--info); }

/* ---------- 工具条 ---------- */
.doc-toolbar { border-radius: var(--r-lg); margin-bottom: 10px; }
.doc-view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: var(--r-md);
}
.dvs-btn {
  border: none;
  background: transparent;
  padding: 5px 13px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dvs-btn:hover { color: var(--text); }
.dvs-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  box-shadow: var(--sh-xs);
}
.form-select-sm { padding: 5px 9px; font-size: var(--fs-sm); width: auto; min-width: 108px; }

/* 结果行 */
.doc-result-line {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.doc-result-line b { color: var(--text); font-weight: 700; }

/* ---------- 按项目视图 ---------- */
.doc-stage-group { border-top: 1px solid var(--border-subtle); }
.doc-stage-group:first-of-type { border-top: none; }
.dsg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--surface-muted);
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--text);
}
.dsg-no {
  width: 20px; height: 20px;
  border-radius: var(--r-sm);
  background: var(--brand-subtle);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.dsg-sub { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 400; }
.dsg-n { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 400; }
.doc-stage-group .data-table th:first-child,
.doc-stage-group .data-table td:first-child { padding-left: 20px; }

/* ---------- 按类型视图 ---------- */
.doc-type-stage { margin-bottom: 2px; }
.dts-title {
  font-size: var(--fs-base);
  font-weight: 700;
  padding-bottom: 5px;
  border-bottom: 2px solid currentColor;
  margin-bottom: 10px;
}

/* 表格里的文档名 */
.data-table .doc-title { font-weight: 600; color: var(--text); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .doc-toolbar { flex-direction: column; align-items: stretch; }
  .doc-stat-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .doc-stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   ★ B62 我的任务页 + 项目管理页（2026-11-07）
   ========================================================================== */

/* ---------- B36 今日待办横幅 ---------- */
.b36-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: var(--fs-base);
  color: var(--ok);
}
.b36-banner.is-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.b36-seg { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.b36-seg .ic { width: 13px; height: 13px; }
.b36-seg.info { color: var(--info); }

/* ---------- 时间颜色图例 ---------- */
.time-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-radius: var(--r-md);
}
.tl-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.tl-item i {
  width: 11px; height: 11px;
  border-radius: 3px;
  display: inline-block;
}
.tl-overdue i { background: #b71c1c; }
.tl-today i { background: #ef4444; }
.tl-tomorrow i { background: #f97316; }
.tl-week i { background: #eab308; }
.tl-future i { background: #22c55e; }

/* ---------- 任务卡里的图标 ---------- */
.task-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.task-source-badge .ic { width: 12px; height: 12px; }
.task-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.task-meta-item .ic { width: 12px; height: 12px; color: var(--text-muted); }

/* ---------- doc-stat 的点击态（任务页用） ---------- */
.doc-stat.clickable { cursor: pointer; }
.doc-stat.clickable:active { transform: translateY(0); }

/* ==========================================================================
   ★ B63 统计报表 / 公司台账 / 系统设置（2026-11-07）
   ========================================================================== */

/* ---------- 公司台账：概览卡 ---------- */
.ledger-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.ledger-stat:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.ledger-stat.active {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
  box-shadow: 0 0 0 1px var(--brand-border);
}
.ls-icon {
  display: inline-flex;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.ls-icon .ic { width: 15px; height: 15px; }
.ls-n {
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ls-l { font-size: var(--fs-xs); color: var(--text-secondary); }

/* 台账概览卡排版 */
.ledger-stat-row, .card-body > .ledger-stat {
  display: inline-block;
}
.content-area .ledger-stat { margin-right: 10px; margin-bottom: 10px; }

/* 台账工具条 */
.ledger-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* 台账卡里的图标 */
.ledger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  background: var(--surface-muted);
  color: var(--text-secondary);
  flex: none;
}
.ledger-icon .ic { width: 14px; height: 14px; }

/* ---------- 系统设置：当前登录头像 ---------- */
.role-avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex: none;
}

/* ---------- 报表页：数字列 ---------- */
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   ★ B64 内联 style 清理 —— 工具类（第 1 批：布局与排版）
   --------------------------------------------------------------------------
   为什么分批：内联 style 优先级高于 class，删错会直接改外观。
   → 第 1 批只抽**布局与排版**类（width / flex / padding / margin / text-align /
     white-space / font-size / font-weight），**不动颜色和背景** —— 颜色改错一眼可见，
     布局改错不容易发现，所以先做风险低的。
   → 数值全部对齐现有 CSS 变量的设计刻度，不引入新视觉。
   ========================================================================== */

/* ---------- 布局 ---------- */
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.flex-none { flex: none; }
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }

/* ---------- 间距 ---------- */
.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-10 { padding: 10px; }
.p-10-12 { padding: 10px 12px; }
.p-12 { padding: 12px; }
.p-14-16 { padding: 14px 16px; }
.m-0 { margin: 0; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }

/* ---------- 排版 ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.nowrap { white-space: nowrap; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.lh-15 { line-height: 1.5; }
.lh-17 { line-height: 1.7; }

/* ---------- B64 第 2 批补充 ---------- */
.inline-block { display: inline-block; }
.cursor-pointer { cursor: pointer; }
.m-2-8-2-0 { margin: 2px 8px 2px 0; }
.min-w-180 { min-width: 180px; }
.min-h-80 { min-height: 80px; }
.w-auto { width: auto; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-8 { width: 8%; }
.w-10 { width: 10%; }
.w-12 { width: 12%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-22 { width: 22%; }
.w-25 { width: 25%; }
.w-80 { width: 80px; }
.w-88 { width: 88px; }
.w-90 { width: 90px; }
.w-150 { width: 150px; }

/* ---------- B64 第 3 批：语义化颜色/标签类 ----------
   ★ 色值全部【照抄】原内联 style 的值，不引入任何新颜色 —— 保证外观零变化。 */
.text-muted { color: var(--gray-500); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-600 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-strong { color: #1f2937; }
.text-danger { color: #dc2626; }
.text-warn-dark { color: #975a16; }
.text-ok { color: #059669; }
.border-danger { border-color: #c53030; }
.border-warn-dark { border-color: #975a16; }
.border-gray-300 { border: 1px solid #d1d5db; }
.bg-gray-50 { background: #f9fafb; }
.bg-gray-100 { background: #f3f4f6; }
.bg-warn-soft { background: #fefcbf; }
.br-4 { border-radius: 4px; }
.br-6 { border-radius: 6px; }
.br-8 { border-radius: 8px; }
.p-3-10 { padding: 3px 10px; }
.p-6-10 { padding: 6px 10px; }
.p-8-12 { padding: 8px 12px; }
.p-12-8 { padding: 12px 8px; }
.p-20 { padding: 20px; }
.w-60 { width: 60%; }
.w-120 { width: 120px; }
.w-180 { width: 180px; }
.h-80 { height: 80px; }
.max-h-180 { max-height: 180px; }
.overflow-y-auto { overflow-y: auto; }
.va-top { vertical-align: top; }
.fw-bold { font-weight: bold; }
.border-collapse { border-collapse: collapse; }
.ml-8 { margin-left: 8px; }
.col-span-2 { grid-column: span 2; }

/* ---------- B64 第 3 批补充：离群色值的精确对应类 ----------
   ★ 这些色值与 text-danger / text-gray-600 视觉接近但**并不相等**，
     为保证「抽类前后外观零变化」，单独建类照抄原值。 */
.text-slate-600 { color: #718096; }
.text-red-600 { color: #e53e3e; }
.text-red-700 { color: #c53030; }
.border-red-700 { border-color: #c53030; }

/* ==========================================================================
   ★ B65 表单填写体验：通用外壳（2026-11-07）
   --------------------------------------------------------------------------
   目的：回答一线人员最茫然的三个问题 ——
     「我现在填的这个是干啥的」「填完会怎样」「还剩多少要填」
   ★ 一次改动对全部 83 个模板生效（所有表单都汇到 renderDocumentBody）。
   ========================================================================== */

.form-guide {
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--sh-xs);
}
.fg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fg-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--brand);
}
.fg-title .ic { width: 15px; height: 15px; }
.fg-stage {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-radius: var(--r-full);
  padding: 2px 9px;
}
.fg-docname {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-left: auto;
}

.fg-what {
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 6px;
}
.fg-after {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-radius: var(--r-md);
  padding: 7px 11px;
  line-height: 1.6;
}
.fg-after .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.fg-after b { color: var(--text); }

/* ---------- 完成度条 ---------- */
.fg-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.fg-progress-fill {
  position: absolute;
  left: 0; top: -1px;
  height: 2px;
  background: var(--brand);
  border-radius: var(--r-full);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.fg-progress {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.fg-progress b {
  font-size: 21px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -.02em;
}
.fg-pct-label { font-size: var(--fs-xs); color: var(--text-muted); }
.fg-remain { font-size: var(--fs-sm); color: var(--text-secondary); }
.fg-remain.has-empty { color: var(--warn); font-weight: 600; }
.fg-remain.all-done { color: var(--ok); font-weight: 600; }
.fg-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- 未填字段聚焦闪烁 ---------- */
.fg-focus-flash {
  animation: fgFlash 1.6s ease;
  outline: 2px solid var(--warn) !important;
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
@keyframes fgFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  15%      { box-shadow: 0 0 0 5px rgba(245,158,11,.28); }
}

/* ---------- 移动端：指南条不占地方 ---------- */
@media (max-width: 680px) {
  .form-guide { padding: 12px 14px; border-radius: var(--r-md); }
  .fg-docname { display: none; }
  .fg-actions { margin-left: 0; width: 100%; }
  .fg-actions .btn { flex: 1; }
}

/* ==========================================================================
   ★ B65 职责分配表简化（2026-11-07）
   --------------------------------------------------------------------------
   原来：9 行 × 6 列 = 54 个格子，其中 NO / 职责说明 / 部门 都是灰底 readonly 输入框
        （假输入点），职务要手打 → 实际要人操作的只有「选人」和「备注」。
   现在：固定字段仍是原元素（保存与联动逻辑一点没动），只是样式改成「看起来像文本」；
        职务保留可编辑（选人后自动带出）；顶部加一段人话说明。
   ========================================================================== */

/* 固定不变的字段：看起来像普通文字，不是输入框 */
.doc-form-fixed {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 2px 4px !important;
  box-shadow: none !important;
}
.doc-form-fixed:read-only { cursor: default; }
/* 多行（职责说明）：保留换行与自适应高度 */
.doc-form-fixed-area {
  min-height: 20px !important;
  resize: none !important;
  overflow: hidden !important;
  line-height: 1.6 !important;
}
/* 自动带出的字段（职务）：视觉上弱一点，提示它是系统填的 */
.doc-form-auto {
  border-color: var(--border) !important;
  background: var(--surface-muted) !important;
  color: var(--text-secondary) !important;
}
.doc-form-auto:focus {
  background: var(--surface) !important;
  color: var(--text) !important;
}

/* 职责表：固定列不因 hover 变化 */
.resp-table td.resp-td-fixed { background: transparent; }
.resp-table tbody tr:hover td.resp-td-fixed { background: transparent; }

/* 顶部提示条 */
.resp-hint {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 12px;
}
.resp-hint b { color: var(--text); }

/* ==========================================================================
   ★ B66 通用「自动带入」标记（2026-11-07）
   --------------------------------------------------------------------------
   B40 已经把项目名/型号/日期/编制人等自动带进来，但【静默】——
   一线人员看不出哪些是系统填的、哪些要自己填。
   现在：自动带入的字段加一个「已自动带入」小标 + 弱化底色。
   ========================================================================== */

.doc-form-autofill {
  background: var(--surface-muted);
  border-left: 2px solid var(--brand-border);
  border-radius: var(--r-sm);
  padding: 4px 8px 4px 10px;
  margin-bottom: 10px;
}
.doc-form-autofill-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--brand);
  background: var(--brand-subtle);
  border-radius: var(--r-full);
  padding: 0 7px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
  cursor: help;
}
.doc-form-autofill .form-label { color: var(--text-secondary); }

/* ==========================================================================
   ★ B66 通用分步（按区块自动生成）
   ========================================================================== */
.step-flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
}
.step-flow .step-flow-title {
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}
.step-flow .step-flow-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 10px;
}
.step-flow .step-flow-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.step-flow .step-btn {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  border-radius: 14px;
  padding: 4px 12px;
  font-size: var(--fs-xs);
  cursor: pointer;
  line-height: 1.6;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.step-flow .step-btn:hover { border-color: var(--brand-border); color: var(--text); }
.step-flow .step-btn.current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.step-flow .step-btn.done {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}
/* 分步时的当前步提示 */
.step-flow-tip {
  font-size: var(--fs-sm);
  color: var(--info);
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  padding: 8px 12px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: 14px;
  line-height: 1.7;
}

/* ==========================================================================
   ★ B67 工作保证计划「一份表·五段」（2026-11-07）
   --------------------------------------------------------------------------
   原来：5 个阶段各一份文档 → 点 5 次、滚 5 屏、280 个输入点。
   现在：一个页面 5 个可折叠分区（当前阶段默认展开）+ 标准清单预填
        「工作内容 / 权责单位」→ 实际要操作的只剩「责任人」下拉和「日期」。
   ★ 数据仍各存各的阶段文档 → 门控/任务/统计/历史数据完全不变。
   ========================================================================== */

.wp-agg-hint {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 12px;
}
.wp-agg-hint b { color: var(--text); }

/* ---------- 阶段分区 ---------- */
.wp-stage {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--surface);
}
.wp-stage.is-cur {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 1px var(--brand-border);
}
.wp-stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  background: var(--surface-muted);
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.wp-stage-head::-webkit-details-marker { display: none; }
.wp-stage.is-cur > .wp-stage-head { background: var(--brand-subtle); }
.wp-stage-no {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.wp-stage-name { flex: none; }
.wp-stage-cnt {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
}
.wp-stage-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-full);
  padding: 1px 8px;
}
.wp-stage-arrow {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform .2s ease;
  display: inline-flex;
}
.wp-stage-arrow .ic { width: 15px; height: 15px; }
.wp-stage[open] .wp-stage-arrow { transform: rotate(90deg); }
.wp-stage-body { padding: 12px 16px 4px; }

/* ---------- 自动带入的行 ---------- */
.wp-row-auto td:nth-child(2) input,
.wp-row-auto td:nth-child(3) input {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--text-secondary);
}
.wp-row-auto td:nth-child(2) input::placeholder,
.wp-row-auto td:nth-child(3) input::placeholder { color: var(--text-muted); }

/* ==========================================================================
   ★ B68 工作保证计划「确认清单」（2026-11-07）
   --------------------------------------------------------------------------
   心智：默认即接受，改了才算数。
     · 系统带入的行淡色显示 → 用户一改就变回白色（说明他做过判断）
     · 「一键确认带入内容」→ 批量标记已确认（留下审核痕迹）
   ★ 清单是【公司自己的资产】：出厂值是 APQP 参考（借鉴），管理员可在设置里改。
   ========================================================================== */

/* ---------- 顶部确认条 ---------- */
.wp-confirm-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}
.wpc-txt { flex: 1; min-width: 220px; }
.wpc-txt b { color: var(--text); }
.wpc-src {
  display: inline-block;
  margin-left: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

/* ---------- 系统带入的行：淡色；改过就变白 ---------- */
.wp-row-auto td:nth-child(2) input,
.wp-row-auto td:nth-child(3) input {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
  color: var(--text-secondary);
}
.wp-row-custom td input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
/* 已确认的行：左侧一道绿条 + 底色更明确 */
.wp-row-auto.is-ok td:nth-child(1) {
  box-shadow: inset 3px 0 0 var(--ok);
}
.wp-row-auto.is-ok td:nth-child(2) input,
.wp-row-auto.is-ok td:nth-child(3) input {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

/* ==========================================================================
   ★ B69 工作保证计划清单编辑器（2026-11-09）
   --------------------------------------------------------------------------
   这份清单是【公司自己的资产】：出厂值只是借鉴来的初始值，
   管理员改成自己的做法后，新项目就按公司的带出。
   ========================================================================== */

.wps-intro {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 14px;
}
.wps-intro b { color: var(--text); }

.wps-stage {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow: hidden;
}
.wps-stage-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
}
.wps-no {
  width: 20px; height: 20px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.wps-cnt {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
  margin-right: auto;
}
.wps-empty {
  padding: 16px 14px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}
.wps-table { margin: 0; }
.wps-table td { vertical-align: middle; }
.wps-table .form-input,
.wps-table .form-select { font-size: var(--fs-sm); }

/* ==========================================================================
   ★★ B74 屏幕端表单视觉重构（2026-11-09）
   --------------------------------------------------------------------------
   用户反馈：「这些表单整体看起来太丑了，而且有点还被整体框架给束缚住了。整体全部更改」

   ## 问题诊断（对照截图）
   1. **被 A4 束缚**：`.doc-form-page { max-width: 210mm }` → 屏幕只有 ~790px 宽，
      1080p 下两侧大片空白，像"打印预览"而不是"工作界面"
   2. **宋体 + 居中大标题 + 黑框**：整份表单像 20 年前的 Excel，屏幕阅读疲劳
   3. **层级混乱**：文档头（居中大字）→ 编号表格（老式 5 行 2 列）→ 指南条（大蓝框）
      → 填写指南（更大的蓝框）→ 表单正文 —— 指南条和表单"两张皮"
   4. **表格全是重边框**，看不出哪里是要填的

   ## 设计决策（专业取舍）
   ★ **屏幕端 = 工作界面；打印端 = 正式文件。两者彻底分离。**
     → 本块全部包在 `@media screen` 内 → **打印版式一个像素都不变**（审核归档不受影响）
     → 打印时那套 A4/宋体/正式表格恰恰是**对的**，不能改

   ## 屏幕端做了什么
   · 解除 A4 宽度 → 内容自适应（可读宽度上限 1280px），去纸张阴影、去居中留白
   · 字体：宋体 → 系统无衬线（阅读效率 + 现代感）
   · 文档头：左对齐、标题当主角（22px 粗体）、公司名降级为次要信息、阶段变 chip
   · 编号信息表 → **chips 布局**（flex），不再是 5 行 2 列的老式表格
   · 区块标题：加左侧品牌色条、去掉下边框
   · 表格：浅色表头、无竖线、行悬浮、输入框 focus 才显形
   · 内容框：最小高度 400px → 120px（不再一上来就是巨大空白框）
   ========================================================================== */

@media screen {
  /* ---------- 外壳：解除 A4 纸张束缚 ---------- */
  .doc-form-page {
    max-width: min(1280px, 100%);
    margin: 0 auto 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
  }

  /* ---------- 文档头：左对齐、标题当主角 ---------- */
  .doc-form-header {
    text-align: left;
    margin: 0;
    padding: 20px 28px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  }
  .doc-form-company {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-muted);
    margin-bottom: 5px;
  }
  .doc-form-subtitle {
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.3;
    letter-spacing: -0.2px;
  }
  .doc-form-phase {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--brand);
    background: var(--brand-subtle);
    border: 1px solid var(--brand-border);
    border-radius: var(--r-full);
    padding: 2px 11px;
    line-height: 1.7;
  }

  /* ---------- 编号信息：老式表格 → chips ---------- */
  .doc-form-info-table {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 26px;
    width: auto;
    border-collapse: collapse;
    margin: 0;
    padding: 13px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }
  .doc-form-info-table td {
    border: none;
    padding: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    /* ★ label 与 value 是相邻的两个 td，靠 margin 拉开（原来黏成一片） */
    margin-right: 20px;
  }
  .doc-form-info-table td:last-child { margin-right: 0; }
  .doc-form-info-label {
    background: none;
    font-weight: 500;
    width: auto;
    text-align: left;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
  }
  .doc-form-info-value {
    width: auto;
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .doc-form-inline-input {
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    padding: 3px 8px;
    font-size: 13px;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    font-weight: 500;
    transition: border-color .12s ease, background .12s ease;
  }
  .doc-form-inline-input:hover {
    border-color: var(--border);
    background: var(--surface-hover);
  }
  .doc-form-inline-input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  }
  /* 打印时才显示的纯文本版，屏幕端隐藏 */
  .doc-form-page .no-screen { display: none !important; }

  /* ---------- 区块标题：左侧品牌色条 ---------- */
  .doc-form-section {
    margin-bottom: 26px;
  }
  .doc-form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 650;
    color: var(--text);
    margin: 0 0 12px;
    padding: 0 0 8px 11px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    line-height: 1.5;
  }
  .doc-form-section-title::first-letter { margin-right: 2px; }

  /* ★ B75：表格样式已回退到 styles.css 的原样（重边框 + 灰表头 + 无边框输入框）
     —— 用户反馈「表格的样式还是改回原来的样子吧，在一页里面体现」。
        ★ 只回退表格；外壳宽度 / 文档头 / 编号信息 / 指南条 / 区块标题色条 保留 B74 的新样式。 */

  /* ---------- 内容框：不再一上来就是巨大空白 ---------- */
  .doc-form-content {
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
  }
  .doc-form-content:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  }

  /* ---------- 分区间距（屏幕端用内边距，避免白到边）---------- */
  .doc-form-page > .doc-form-section,
  .doc-form-page > .doc-form-table,
  .doc-form-page > .form-guide {
    margin-left: 28px;
    margin-right: 28px;
  }
  .doc-form-page > .doc-form-section:first-of-type { margin-top: 22px; }
}

/* ==========================================================================
   ★ B74 指南条紧凑化（屏幕端）
   --------------------------------------------------------------------------
   原来：两个叠在一起的蓝框（大框套小框）→ 和下面的表单"两张皮"。
   现在：一行摘要（图标 + 一句话 + 阶段 + 展开按钮），详情默认收起。
   ========================================================================== */
@media screen {
  .form-guide {
    margin: 18px 28px 4px !important;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
  }
  .form-guide .fg-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    background: var(--brand-subtle);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .form-guide .fg-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex: none;
  }
  .form-guide .fg-title .ic { width: 15px; height: 15px; }
  .form-guide .fg-what-inline {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    min-width: 0;
    flex: 1 1 260px;
  }
  .form-guide .fg-stage {
    font-size: 11px;
    color: var(--brand);
    background: var(--surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--r-full);
    padding: 1px 9px;
    white-space: nowrap;
    flex: none;
  }
  .form-guide .fg-docname { display: none; }

  /* 展开按钮 */
  .form-guide .fg-expand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 3px 11px;
    cursor: pointer;
    white-space: nowrap;
    flex: none;
    font-family: inherit;
    transition: border-color .12s ease, color .12s ease;
  }
  .form-guide .fg-expand:hover { border-color: var(--brand-border); color: var(--brand); }
  .form-guide .fg-expand .ic { width: 13px; height: 13px; transition: transform .16s ease; }
  .form-guide .fg-expand.open .ic { transform: rotate(90deg); }

  /* 详情：默认收起 */
  .form-guide .fg-detail {
    display: none;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.85;
    color: var(--text-secondary);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .form-guide .fg-detail[data-open="1"] { display: block; }
  .form-guide .fg-what b { color: var(--text); }
  .form-guide .fg-after { margin-top: 6px; }
  .form-guide .fg-after .ic { width: 13px; height: 13px; vertical-align: -2px; }
  .form-guide .fg-after b { color: var(--text); }

  /* 进度条：与摘要同一条，不再单独一个框 */
  .form-guide .fg-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--surface);
    flex-wrap: wrap;
  }
  .form-guide .fg-progress {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
  }
  .form-guide .fg-progress b {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
  }
  .form-guide .fg-remain { font-size: 12px; color: var(--text-muted); }
  .form-guide .fg-remain b { color: var(--warn); font-weight: 600; }
  .form-guide .fg-actions { margin-left: auto; display: inline-flex; gap: 7px; }
  .form-guide .fg-actions .btn {
    font-size: 12px;
    border-radius: var(--r-full);
    padding: 3px 12px;
  }
}

/* ==========================================================================
   ★ B77 宽表滚动优化（2026-11-09）
   --------------------------------------------------------------------------
   B76 曾加过「列分组可折叠」，用户反馈「画蛇添足」→ **已全部回退**（两层表头、折叠按钮、
   分组映射、打印展开规则全没了）。
   ★ 这里只保留【不改信息结构】的滚动体验改善：
     · overflow-y: hidden → auto  —— ★ 真 bug：纵向内容被裁掉
     · min-width 用列宽定义之和  —— ★ 原来用 colCount*78 估算，和 schema 对不上
     · table-layout: fixed       —— 严格按 schema 列宽，不被内容撑开
     · 表头吸顶 / 序号列固定     —— 横向滚动不丢行号，纵向滚动不丢列名
   ========================================================================== */

@media screen {
  /* ---------- 滚动容器：不裁切纵向内容 ---------- */
  .doc-form-table-wrap.is-wide {
    overflow-x: auto;
    overflow-y: auto;          /* ★ 原来 hidden → 纵向内容被裁掉 */
    max-height: 74vh;          /* 纵向滚动时表头常驻（sticky 生效的前提） */
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
  }
  /* 固定列宽：严格按 schema 定义，不再被内容撑开 */
  .doc-form-table.is-fixed { table-layout: fixed; }

  /* ---------- 表头吸顶（单行）---------- */
  .doc-form-table-wrap.is-wide thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f0f0f0;      /* 与 styles.css 原样的灰表头一致 */
  }

  /* ---------- 序号列固定（横向滚动不丢行号）---------- */
  .doc-form-table-wrap.is-wide thead th:first-child,
  .doc-form-table-wrap.is-wide tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  .doc-form-table-wrap.is-wide thead th:first-child {
    z-index: 4;
    background: #f0f0f0;
  }
  .doc-form-table-wrap.is-wide tbody tr:hover td:first-child { background: var(--surface-hover); }

  /* ---------- 右边缘渐变：提示还有更多列 ---------- */
  .doc-form-table-wrap.is-wide::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 26px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(15,23,42,.10), rgba(15,23,42,0));
  }

  /* 滚动条细一点，别喧宾夺主 */
  .doc-form-table-wrap.is-wide::-webkit-scrollbar { height: 10px; width: 10px; }
  .doc-form-table-wrap.is-wide::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--r-full);
  }
  .doc-form-table-wrap.is-wide::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
  .doc-form-table-wrap.is-wide::-webkit-scrollbar-track { background: var(--surface-muted); }
}

/* ==========================================================================
   ★ B78 宽表：屏幕竖排字段流 / 打印标准宽表（2026-11-09）
   --------------------------------------------------------------------------
   用户选择：「屏幕竖排字段，打印仍是标准宽表」（只处理超过 15 列的表）。
   两套 DOM 并存，靠媒体查询切换：
     屏幕 → .wt-wide-table 隐藏、.wt-wide-flow 显示（**不横向滚动**）
     打印 → .wt-wide-flow 隐藏、.wt-wide-table 显示（**标准五步法宽表**）
   ★ 字段流里的小标题按 AIAG 五步法分组（**没有折叠按钮** —— 那是上一版被否掉的）。
   ========================================================================== */

@media screen {
  /* 宽表：屏幕走字段流 */
  .wt-wide-table { display: none; }
  .wt-wide-flow { display: block; }

  /* ---------- 字段流：一条记录一个区块 ---------- */
  .wtf-record {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 14px;
    background: var(--surface);
    overflow: hidden;
  }
  .wtf-record-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
  }
  .wtf-record-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }
  .wtf-sec { padding: 12px 14px 4px; }
  .wtf-sec + .wtf-sec { border-top: 1px dashed var(--border); }
  .wtf-sec-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 9px;
    padding-left: 9px;
    border-left: 3px solid var(--brand);
    line-height: 1.5;
  }
  /* 两列网格：字段多也不会撑出横向滚动 */
  .wtf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px 18px;
  }
  .wtf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .wtf-label {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
  }
  .wtf-input { display: block; }
  .wtf-textarea {
    min-height: 34px;
    resize: vertical;
    line-height: 1.6;
  }
  .wtf-empty {
    padding: 26px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
  }
}

/* ---------- 打印：走标准宽表（审核归档格式不变）---------- */
@media print {
  .wt-wide-flow { display: none !important; }
  .wt-wide-table { display: block !important; }

  /* ★ 宽表打印：缩放到页宽完整打印（原来 min-width: 2500px 会把右侧列裁掉，
     印出来的表是残缺的 —— 审核归档不可接受）。FMEA 打印本来就是缩着排的。 */
  .doc-form-table-wrap.is-wide {
    overflow: visible !important;
    max-height: none !important;
    border: none !important;
  }
  .doc-form-table.is-fixed {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 6.5pt !important;
  }
  .doc-form-table.is-fixed th,
  .doc-form-table.is-fixed td {
    padding: 1px 2px !important;
    word-break: break-all;
  }
  .doc-form-table.is-fixed .form-input,
  .doc-form-table.is-fixed .doc-form-cell-area {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 6.5pt !important;
    min-height: 0 !important;
  }
  /* 打印时不需要固定列与吸顶 */
  .doc-form-table-wrap.is-wide thead th,
  .doc-form-table-wrap.is-wide tbody td:first-child {
    position: static !important;
    box-shadow: none !important;
  }
  .doc-form-table-wrap.is-wide::after { display: none !important; }
}


/* ★ B90：跨部门兜底分派区（把行内 style 抽成类，避免内联 style 数量超标） */
.sf-assign-card { margin-top:8px; padding:8px 10px; background:#fff; border:1px solid #ede9fe; border-radius:8px; }
.sf-assign-dept { font-size:13px; font-weight:600; margin-bottom:6px; }
.sf-assign-empty { font-size:12px; color:#b91c1c; }
.sf-assign-bulk { display:flex; gap:6px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
.sf-assign-select { width:150px; font-size:13px; }
.sf-assign-row { display:flex; gap:8px; align-items:center; padding:5px 0; border-top:1px solid var(--gray-100); font-size:13px; }
.sf-assign-row .sf-assign-select { width:140px; font-size:12px; }
.sf-assign-sub { color:var(--gray-400); font-size:12px; }
.sf-assign-cross { margin-top:10px; border-top:1px dashed #c4b5fd; padding-top:8px; }
.sf-assign-cross summary { cursor:pointer; font-size:12px; color:#7c3aed; font-weight:600; }
.sf-assign-note { font-size:11px; color:#94a3b8; margin:6px 0; }

/* ★ B96：用户级权限覆盖编辑器 */
.po-box { margin-top:16px; padding-top:14px; border-top:1px solid var(--gray-200); }
.po-title { font-weight:600; font-size:13px; margin-bottom:4px; }
.po-desc { font-size:12px; color:var(--gray-500); margin-bottom:10px; }
.po-group { font-size:12px; font-weight:500; color:var(--gray-500); margin:10px 0 4px; }
.po-row { display:flex; align-items:center; gap:8px; padding:3px 0; }
.po-name { flex:1; font-size:12px; }
.po-cap { color:var(--gray-400); font-size:11px; }
.po-select { width:120px; font-size:12px; }
.po-foot { margin-top:10px; font-size:11px; color:var(--gray-400); }
