:root {
  /* 主色：中车红（参照 CRRC 视觉：深红 + 白 + 中性灰） */
  --brand: #c0111a;
  --brand-2: #d8323c;
  --brand-dark: #8e0b12;
  --brand-soft: #fdf1f2;
  --brand-line: #f2cfd2;

  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e7e9ee;
  --line-strong: #d3d7df;
  --text: #1b1f27;
  --text-2: #59606f;
  --muted: #8b92a1;

  --key: #c97a08;
  --key-soft: #fff6e8;
  --ok: #1f8a5b;
  --ok-soft: #eefaf3;
  --danger: #b3261e;
  --danger-soft: #fdf1f0;
  --doing: #1a6ab0;
  --doing-soft: #eef5fc;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(24, 28, 38, .05), 0 6px 20px rgba(24, 28, 38, .06);
  --shadow-hi: 0 2px 6px rgba(24, 28, 38, .08), 0 14px 34px rgba(24, 28, 38, .10);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

/* 应用外壳：整页不滚动，滚动交给各表格容器，
   这样表头 position:sticky 才能一直贴在容器顶部（页面滚动时表头会跟着滚走）。 */
body { display: flex; flex-direction: column; overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(118deg, var(--brand-dark), var(--brand) 52%, #d8323c);
  color: #fff;
  box-shadow: 0 2px 12px rgba(140, 12, 20, .26);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text h1 { font-size: 17px; letter-spacing: .5px; }
.brand-text p { margin: 0; font-size: 12px; opacity: .8; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.save-state {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  white-space: nowrap;
}
.save-state.saving { background: rgba(255, 214, 102, .22); }
.save-state.saved { background: rgba(46, 204, 113, .22); }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 7px 14px;
  border: 1px solid transparent;
  transition: .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #fff; color: var(--brand); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--brand-soft); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.btn-back, .crumb .btn-ghost {
  background: #fff; color: var(--brand); border: 1px solid var(--line-strong);
}
.btn-back:hover, .crumb .btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand-2); }

.panel .btn-ghost, .legend + .btn-ghost {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line-strong);
}
.panel .btn-ghost:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand-2); }
.panel .btn-ghost.danger { color: var(--danger); border-color: #eccac5; }
.panel .btn-ghost.danger:hover:not(:disabled) { background: #fdf1ef; }

.icon-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 6px;
}
.icon-btn:hover { color: var(--danger); }

/* ---------- 布局 ---------- */
.view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 14px 22px;
  max-width: 1900px;
  margin: 0 auto;
  width: 100%;
}
.view > * { flex: 0 0 auto; }

/* 需要占满剩余高度的表格面板：其内部 .table-wrap 独立滚动，表头固定 */
.panel-fill {
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}
.panel-fill .table-wrap,
.panel-fill .table-wrap.tall { flex: 1 1 auto; min-height: 0; max-height: none; }
.view > .panel:last-child { margin-bottom: 0; }

/* 售前存档展开时改为整页滚动，当前计划给一个固定高度 */
.view.archive-open .panel-fill { flex: 0 0 auto; min-height: 0; }
.view.archive-open .panel-fill .table-wrap { height: 46vh; flex: 0 0 auto; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

/* ---------- 可折叠信息条 ----------
   默认收起成一行，点击左侧按钮展开；让表格占据页面绝大部分高度。 */
.foldbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px 14px;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 面板内部的一行折叠条（项目信息 / 填写说明 / 显示规则） */
.foldrow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 3px 14px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.foldbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.foldbar-btn:hover { background: var(--brand-soft); border-color: var(--line-strong); }
.foldbar-btn .caret {
  display: inline-block;
  width: 9px;
  font-size: 10px;
  color: var(--text-2);
}
.foldbar-summary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.foldbar-summary b { color: var(--text); font-weight: 600; }
.foldbar-summary .sep { color: var(--line-strong); margin: 0 2px; }
.foldbar-hint { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.kpi .kpi-label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.kpi .kpi-value { font-size: 24px; font-weight: 700; color: var(--brand); line-height: 1.3; }
.kpi .kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi.accent-key .kpi-value { color: var(--key); }
.kpi.accent-doing .kpi-value { color: #1a6ab0; }
.kpi.accent-done .kpi-value { color: var(--ok); }
.kpi.accent-over .kpi-value { color: #b3281c; }
.kpi.accent-soon .kpi-value { color: #a4700a; }
.kpi.accent-month .kpi-value { color: #5b46ac; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-title h2 { font-size: 15px; color: var(--brand); }
.panel-title p { margin: 2px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.filters { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: 1 1 auto; }
/* 筛选项宽度按内容自适应：只留「够显示文字 + 下拉箭头」的宽度。
   以前 min-width 142 把短下拉也撑宽，而「全部项目」会被最长的项目名撑到 300px 以上。 */
.filters .input, .filters select { width: auto; min-width: 0; max-width: 260px; }
.filters #fKeyword { min-width: 0; max-width: 250px; }
.filters .btn { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
/* 详细计划筛选条图标化后的按钮：与项目管理页 .btn-mini 同规格的小圆钮 */
.filters .btn-mini {
  width: 36px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 15px; flex: 0 0 auto;
}
.filters .btn-mini svg { width: 17px; height: 17px; display: block; }
/* 草稿状态条挪进筛选条同一行：不再单独占一行；自身仍是一条小横幅 */
.filters .draft-bar {
  flex: 0 0 auto;
  margin-bottom: 0;
  margin-right: 2px;
  max-width: 100%;
}
/* 审批对比模式的提示条：蓝色系（与改动行同色族） */
.draft-bar.diff-mode {
  border-left-color: #1f5fa8;
  background: #eef5fc;
  border-color: #c3d9f0;
  color: #274a68;
}
.draft-bar.diff-mode b { color: #174a7c; }

.input {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(31, 111, 178, .12); }
textarea.input { resize: vertical; line-height: 1.5; font-family: inherit; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); }
.table-wrap.tall { max-height: calc(100vh - 420px); }

table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; table-layout: fixed; }
table.grid col { min-width: 0; }

table.grid th, table.grid td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  /* 行距（个人偏好，JS 写 CSS 变量）：上下留白决定每行的最小高度 */
  padding: var(--row-pad-y, 7px) 9px;
  text-align: left;
  vertical-align: top;
  background: var(--panel);
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 标签 / 勾选框 / 按钮类单元格在行内垂直居中 */
table.grid td.c-center { vertical-align: middle; }

table.grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef4fa;
  color: var(--brand);
  font-weight: 600;
  /* 表头文字一律居中；列窄了自动换行，不再挤成一行 */
  text-align: center;
  white-space: normal;
  border-bottom: 1px solid var(--line-strong);
}

table.grid tbody tr:hover td { background: #f8fbff; }

table.grid td.c-num, table.grid th.c-num { text-align: center; color: var(--text-2); }
table.grid td.c-center, table.grid th.c-center { text-align: center; }

/* 阶段梳理表格：前两列吸附 */
.stage-grid th.sticky-col, .stage-grid td.sticky-col { position: sticky; z-index: 2; background: #fff; }
.stage-grid .sticky-last { box-shadow: 2px 0 4px -2px rgba(0,0,0,.12); }
.stage-grid thead th.sticky-col { z-index: 5; background: #eef4fa; }
.stage-grid tbody tr:hover td.sticky-col { background: #f8fbff; }
/* 详细计划表列头：拖拽排序 + 锁定列 */
.stage-grid th[data-colkey] { cursor: grab; }
.stage-grid th.col-dragging { opacity: .5; }
.stage-grid th.col-drop-target { box-shadow: inset 2px 0 0 var(--brand); }
.stage-grid th .col-freeze {
  margin-left: 4px; padding: 0 3px;
  font-size: 10px; line-height: 15px;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; vertical-align: middle;
}
.stage-grid th .col-freeze:hover { color: var(--brand); border-color: var(--brand); }
.stage-grid th .col-freeze.on {
  color: #fff; background: var(--brand); border-color: var(--brand);
}
.stage-grid th .col-freeze.on:hover { background: var(--brand-dark); }
.stage-grid td.cell-edit { padding: 3px; }

.stage-grid td.cell-edit input,
.stage-grid td.cell-edit textarea,
.stage-grid td.cell-edit select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 5px 6px;
  font: inherit;
  color: inherit;
  outline: none;
  resize: none;
  font-family: inherit;
}

/* 自适应高度的文本域：文字全部换行显示，行高随内容与列宽自动增长 */
.stage-grid td.cell-edit textarea.asz {
  display: block;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 行距变量：行距调大时正文行更松、最小高度更高（换行能力保持不变） */
  line-height: var(--row-lh, 1.55);
  min-height: var(--row-min-h, 30px);
}
.stage-grid td.cell-edit select { cursor: pointer; padding: 4px 6px; }
.stage-grid td.cell-edit input:hover,
.stage-grid td.cell-edit textarea:hover,
.stage-grid td.cell-edit select:hover { border-color: var(--line-strong); background: #fff; }
.stage-grid td.cell-edit input:focus,
.stage-grid td.cell-edit textarea:focus,
.stage-grid td.cell-edit select:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(31,111,178,.1); }

.stage-grid .ro { display: block; padding: 5px 6px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

tr.row-key > td { background: #fffdf7; }
tr.row-key:hover > td, .stage-grid tbody tr.row-key:hover td.sticky-col,
.stage-grid tbody tr.row-key:hover td.sticky-col { background: #fff8ec; }
tr.row-key td.sticky-col, tr.row-key td.sticky-col { background: #fffdf7; }
tr.row-filled > td { background: #f7fdfa; }
tr.row-filled td.sticky-col, tr.row-filled td.sticky-col { background: #f7fdfa; }
tr.row-filled.row-key > td { background: #fffaf0; }
tr.row-custom .c-seq { font-style: italic; }

/* ---------- 已完成：绿色（勾选完成后 7 天内显示在项目管理中） ---------- */
tr.row-done > td { background: #eefaf3; }
tr.row-done td.sticky-col, tr.row-done td.sticky-col { background: #eefaf3; }
tr.row-done > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.row-done:hover > td { background: #e6f7ee; }
.stage-grid tbody tr.row-done:hover td.sticky-col,
.stage-grid tbody tr.row-done:hover td.sticky-col { background: #e6f7ee; }
tr.row-done td.cell-edit input, tr.row-done td.cell-edit textarea { background: transparent; }

/* 勾选框列 */
.cell-check { vertical-align: middle; }
.stage-grid td.cell-check input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); margin: 0;
}
tr.row-done td.cell-check input[type="checkbox"] { accent-color: var(--ok); }

/* ---------- 计划完成时间：3天内标黄、过期标红 ---------- */
.due-cell { vertical-align: middle; }
.due-cell .due-date { white-space: pre-wrap; word-break: break-word; }
.due-badge {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
tr td.due-soon { background: #fff6d9 !important; }
tr td.due-overdue { background: #ffe2e0 !important; }
tr td.due-done { background: #eaf8f0 !important; }
tr td.due-soon .due-badge { color: #a4700a; }
tr td.due-overdue .due-badge { color: #b3281c; }
tr td.due-done .due-badge { color: var(--ok); }
tr.due-soon > td:first-child { box-shadow: inset 3px 0 0 #e0a020; }
tr.due-overdue > td:first-child { box-shadow: inset 3px 0 0 #d6453a; }
tr.due-soon > td:not(.due-soon) { background: #fffdf4; }
tr.due-overdue > td:not(.due-overdue) { background: #fff6f5; }
tr.due-soon td.sticky-col, tr.due-soon td.sticky-col { background: #fffdf4; }
tr.due-overdue td.sticky-col, tr.due-overdue td.sticky-col { background: #fff6f5; }
tr.due-soon:hover > td:not(.due-soon) { background: #fffaea; }
tr.due-overdue:hover > td:not(.due-overdue) { background: #ffefee; }
tr.due-soon td.cell-edit input, tr.due-overdue td.cell-edit input,
tr.due-soon td.cell-edit select, tr.due-overdue td.cell-edit select { background: transparent; }
tr.due-soon td.cell-edit input:hover, tr.due-overdue td.cell-edit input:hover { background: #fff; }
.txt-over { color: #b3281c; font-weight: 600; }
.txt-soon { color: #a4700a; font-weight: 600; }
.txt-month { color: #5b46ac; font-weight: 600; }
.txt-warn { color: #a4700a; }

.level-1 td { font-weight: 600; }
.level-2 > td { font-weight: 500; }
.level-3 > td, .level-4 > td { font-weight: 400; }

/* ---------- 树形层级：序号列（固定 75px，序号过长自动换行） ---------- */
/* 选择器需带 table.grid 前缀才能盖过 `table.grid td { padding: 7px 9px }`，否则右侧白占 7px */
table.grid td.cell-tree { padding: 3px 2px; vertical-align: middle; }
.tree-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tree-toggle {
  flex: 0 0 auto;
  width: 15px; height: 15px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 3px;
  color: var(--brand);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tree-toggle:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.tree-toggle.collapsed { background: var(--brand-soft); }
/* 叶子节点无折叠按钮：占位宽度收窄，把空间让给序号 */
.tree-toggle.placeholder { width: 8px; border-color: transparent; background: transparent; cursor: default; }
.tree-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 4px 1px;
  font: inherit;
  color: inherit;
  outline: none;
  /* 固定窄列：放不下时换行，而不是被截断 */
  display: block;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-all;
}
.tree-input:hover { border-color: var(--line-strong); background: #fff; }
.tree-input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(31,111,178,.1); }
.level-4 td.cell-tree .tree-input, .level-5 td.cell-tree .tree-input { color: var(--text-2); }

/* ---------- 列宽调整 ---------- */
/* 注意：不要给 thead th 设 position:relative，否则会覆盖 position:sticky 导致表头不再固定。
   position:sticky 本身就是已定位元素，绝对定位的 .col-resizer 依然以表头单元格为参照。 */
.col-resizer {
  position: absolute;
  top: 0; right: -3px;
  width: 7px; height: 100%;
  cursor: col-resize;
  z-index: 6;
  background: transparent;
}
.col-resizer:hover, .col-resizer:active { background: linear-gradient(to right, transparent 2px, var(--brand-2) 2px, var(--brand-2) 4px, transparent 4px); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* 末尾占位列：吸收剩余宽度，保证固定列宽不被拉伸 */
table.grid th.col-spacer, table.grid td.col-spacer {
  border-right: none;
  background: transparent;
  padding: 0;
}
table.grid tbody tr:hover td.col-spacer { background: transparent; }
tr.row-key td.col-spacer, tr.row-done td.col-spacer, tr.row-filled td.col-spacer,
tr.due-soon > td.col-spacer:not(.due-soon), tr.due-overdue > td.col-spacer:not(.due-overdue) { background: transparent; }

/* ---------- 拖动排序 ---------- */
.rowbtns .drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.rowbtns .drag-handle:hover { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
.rowbtns .drag-handle:active { cursor: grabbing; }
tr.dragging > td { opacity: .45; background: var(--brand-soft) !important; }
tr.drop-before > td { box-shadow: inset 0 2px 0 0 var(--brand-2) !important; }
tr.drop-after > td { box-shadow: inset 0 -2px 0 0 var(--brand-2) !important; }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-key { background: var(--key-soft); color: var(--key); border-color: #f2d9ae; font-weight: 600; }
.tag-type-售前 { background: var(--brand-soft); color: var(--brand); border-color: #c9dcf0; }
.tag-type-执行 { background: #eef7ef; color: var(--ok); border-color: #cfe8d3; }
/* 项目等级：重大（红）/ 重点（橙）/ 一般（灰） */
.tag-level-重大 { background: #fdeaea; color: #b3281c; font-weight: 600; }
.tag-level-重点 { background: var(--key-soft); color: var(--key); font-weight: 600; }
.tag-level-一般 { background: #f1f3f6; color: var(--muted); }
.tag-type-招标 { background: var(--key-soft); color: var(--key); border-color: #f2d9ae; }
.tag-muted { background: #f1f3f7; color: var(--muted); border-color: var(--line); }
.tag-doing { background: #e6f1fd; color: #1a6ab0; border-color: #bcd9f2; font-weight: 600; }
.tag-done { background: #e8f7ef; color: var(--ok); border-color: #c6e8d6; font-weight: 600; }
.tag-soon { background: #fff4d6; color: #a4700a; border-color: #f0d9a3; font-weight: 600; }
.tag-over { background: #ffe4e1; color: #b3281c; border-color: #f0c4bf; font-weight: 600; }
.tag-month { background: #eee9fb; color: #5b46ac; border-color: #d4caf3; font-weight: 600; }

/* 无进行中事项的项目占位行 */
tr.plan-empty-row > td { background: #fbfcfe; }
tr.plan-empty-row:hover > td { background: #f5f9ff; }
tr.plan-empty-row .p-link { font-weight: 600; }
.plan-empty-tip {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  background-image: repeating-linear-gradient(45deg, #f7f9fc 0 8px, #fbfcfe 8px 16px);
}

/* 项目名称可点击进入详细内容 */
.p-link { color: var(--brand); font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--brand-2); cursor: pointer; }
.p-link:hover { color: var(--brand-2); border-bottom-style: solid; }
/* 手机专用：点亮世界单图切换条（桌面两张图并排，切换条隐藏） */
.light-switch { display: none; }
/* 单元格最多显示 5 行：超出部分省略；文字长时挂 title，鼠标移到该位置看完整内容 */
.clamp5 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 导入提示：模板里的关键节点、导入的表格里没有 —— 整行标红 + 状态列「⚠ 需确认」标签 */
.tag-warn { background: #fdeaea; color: #b3281c; border-color: #f2c7c1; font-weight: 600; cursor: pointer; }
.tag-warn:hover { background: #f8d5d1; }
#planTable tr.plan-row.row-warn > td,
#stageTable tr.row-warn > td { background-color: #fdeaea; }
#stageTable tr.row-warn > td:first-child { box-shadow: inset 3px 0 0 #d9534f; }

tr.plan-row { cursor: pointer; }
tr.plan-row .rowbtns button { cursor: pointer; }
/* 单击选中：同一项目的所有行一起高亮；双击才进入详细计划。
   用 #planTable 提高优先级，避免被后面的 .row-done / .due-* 背景色盖掉。 */
#planTable tr.plan-row.is-sel > td { background-color: var(--brand-soft); }
#planTable tr.plan-row.is-sel > td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.rowbtns { display: flex; gap: 3px; justify-content: center; }
.rowbtns button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 6px;
  width: 24px; height: 24px;
  cursor: pointer;
  color: var(--text-2);
  line-height: 1;
  font-size: 13px;
  padding: 0;
}
.rowbtns button:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
.rowbtns button.del:hover:not(:disabled) { border-color: #e0b5ae; color: var(--danger); background: #fdf1ef; }
.rowbtns button:disabled { opacity: .35; cursor: not-allowed; }

/* 行内「+」的小菜单：下属 / 并列 */
.add-pop {
  position: fixed;
  z-index: 90;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.add-pop button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.add-pop button:hover { background: var(--brand-soft); color: var(--brand); }
.add-pop b { display: block; font-weight: 600; }
.add-pop span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* ---------- 推进表右键菜单 ---------- */
.ctx-menu {
  position: fixed;
  z-index: 3000;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ctx-menu button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.ctx-menu button:hover { background: var(--brand-soft); color: var(--brand); }
.ctx-menu button:disabled { color: var(--muted); cursor: not-allowed; }
.ctx-menu button:disabled:hover { background: transparent; color: var(--muted); }
.ctx-menu .ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---------- 单元格填充柄（下拉填充） ---------- */
.fill-handle {
  position: fixed;
  z-index: 2000;
  width: 11px;
  height: 11px;
  background: var(--brand, #2f6bff);
  border: 2px solid #fff;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  cursor: crosshair;
  display: none;
}
.stage-grid tr.fill-range > td { background: var(--brand-soft, #eaf0ff) !important; }

/* 项目行右击菜单：进入项目 / 归集到项目集 / 删除 */
.ctx-menu {
  position: fixed;
  z-index: 95;
  min-width: 168px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(16, 32, 56, .18);
  display: flex;
  flex-direction: column;
}
.ctx-menu button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.ctx-menu button:hover { background: var(--brand-soft); color: var(--brand); }
.ctx-menu button.del:hover { background: #fdeaea; color: #b3281c; }
.ctx-menu button:disabled { opacity: .62; cursor: not-allowed; background: transparent; color: var(--muted); }

/* 归集弹窗里的"已有项目集"快捷块：点一下就把名字填进输入框 */
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.set-chips .set-chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.set-chips .set-chip:hover { background: var(--brand-soft); border-color: var(--brand-2); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-actions { margin: 16px 0 0; }

/* 确认弹窗正文按原样换行：导入 Excel 的识别结果是多行文本 */
#confirmText { white-space: pre-line; }

/* ---------- 拖拽导入 Excel 的提示遮罩 ---------- */
.drop-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(16, 30, 50, .45);
  pointer-events: none;
}
.drop-mask-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 28px 40px;
  border-radius: 14px;
  background: #fff;
  border: 2px dashed var(--brand-2);
  box-shadow: 0 12px 40px rgba(10, 40, 80, .3);
  color: var(--brand);
}
.drop-mask-box strong { font-size: 16px; }
.drop-mask-box span { font-size: 12.5px; color: var(--text-2); }

/* ---------- 项目视图 ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 12px;
  min-height: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.crumb-sep { color: var(--line-strong); }
.crumb-name { font-weight: 600; color: var(--brand); }
.crumb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-convert {
  background: linear-gradient(120deg, #12805c, #1aa06f);
  color: #fff;
  font-weight: 600;
  border: 1px solid #0d6b4c;
  box-shadow: 0 2px 8px rgba(18, 128, 92, .28);
}
.btn-convert:hover { background: linear-gradient(120deg, #0f7152, #17915f); }
.btn-convert::before { content: '⇥ '; }

.project-meta { padding: 14px 16px 12px; }
.project-meta #metaSource { margin: 10px 0 0; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-2); }
.field-wide { grid-column: 1 / -1; }
.req { color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.legend { margin: 0; padding: 10px 16px; background: #fbfcfe; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 12px; }
.legend .tag { margin-right: 6px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(16, 30, 50, .45);
  display: grid; place-items: center;
  z-index: 60;
  padding: 20px;
}
/* 弹窗可以叠弹窗（账号管理 → 改登录名 → 确认框），必须显式指定层级，
   否则后出现的反而被 DOM 靠后的弹窗盖住、点不到。 */
#modalPrompt { z-index: 70; }
#modalConfirm { z-index: 80; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: min(720px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(10, 30, 60, .3);
  overflow: hidden;
}
.modal-sm { width: min(440px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; color: var(--brand); }
.modal-body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-body p { margin: 0; white-space: pre-line; line-height: 1.7; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--line); background: #fafbfd;
}
.modal-foot .btn-primary { background: var(--brand); color: #fff; }
.modal-foot .btn-primary:hover:not(:disabled) { background: var(--brand-2); }
.modal-foot .btn-ghost { background: #fff; color: var(--text-2); border-color: var(--line-strong); }
.modal-foot .btn-ghost:hover { background: #f1f4f9; }

.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-card {
  font: inherit; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  display: flex; flex-direction: column; gap: 6px;
  transition: .15s;
}
.type-card strong { font-size: 15px; color: var(--text); }
.type-card small { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.type-card:hover { border-color: var(--brand-2); background: #f7fbff; }
.type-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(31,111,178,.1); }
.type-card.active strong { color: var(--brand); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translateX(-50%);
  background: #22314a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(10, 25, 50, .3);
  font-size: 13px;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- 登录 ---------- */
/* 未登录时把整个应用外壳藏起来，只留登录框 */
.not-logged-in .topbar,
.not-logged-in .view { display: none !important; }

.login-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f3f70 0%, #1c61a6 55%, #2b7cc0 100%);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px 22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(6, 24, 48, .45);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand .brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #14508c, #2b7cc0);
  color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
}
.login-brand h1 { font-size: 17px; color: var(--brand); }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.login-msg { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--danger); }
.btn-login {
  background: linear-gradient(120deg, #14508c, #1f6fb2);
  color: #fff;
  font-weight: 600;
  padding: 11px 14px;
  letter-spacing: 2px;
}
.btn-login:hover:not(:disabled) { background: linear-gradient(120deg, #0f3f70, #1a5f9c); }
.login-tip { margin: 0; text-align: center; }

/* ---------- 顶栏用户区 ---------- */
.topbar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, .3);
  margin: 0 2px;
}
.topbar-user {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  white-space: nowrap;
}
.topbar-user .role-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 214, 102, .28);
  font-size: 11px;
}

/* ---------- 只读（项目负责人不是当前账号） ---------- */
.ro-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #8a6d1a;
  background: #fff6d9;
  border: 1px solid #f0d9a3;
  vertical-align: middle;
  cursor: help;
}
.ro-banner {
  margin: 0 0 6px;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: #fffaf0;
  border: 1px solid #f0d9a3;
  color: #8a6d1a;
  font-size: 12px;
  line-height: 1.6;
}
.ro-banner b { color: #a4700a; }

/* 只读时给输入框一点视觉暗示：不再像可编辑的样子 */
.view-readonly .stage-grid td.cell-edit input,
.view-readonly .stage-grid td.cell-edit textarea,
.view-readonly .stage-grid td.cell-tree .tree-input,
.view-readonly .project-meta .input {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  cursor: default;
}
.view-readonly .stage-grid td.cell-edit input:hover,
.view-readonly .stage-grid td.cell-edit textarea:hover,
.view-readonly .stage-grid td.cell-tree .tree-input:hover { border-color: transparent !important; }
.view-readonly .rowbtns button { opacity: .35; }
.view-readonly .tree-toggle { opacity: 1; }

/* 行级只读：不是项目负责人、也不是这一行主办的行 —— 视觉上置灰，只保留查看与折叠 */
.stage-grid tr.row-ro > td { background: #fbfcfe; }
.stage-grid tr.row-ro td.cell-edit input,
.stage-grid tr.row-ro td.cell-edit textarea,
.stage-grid tr.row-ro td.cell-tree .tree-input {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  cursor: default;
}
.stage-grid tr.row-ro td.cell-edit input:hover,
.stage-grid tr.row-ro td.cell-edit textarea:hover { border-color: transparent !important; }
.stage-grid tr.row-ro .rowbtns button { opacity: .3; }
.stage-grid tr.row-ro .rowbtns .del,
.stage-grid tr.row-ro .rowbtns .drag-handle { display: none; }
.stage-grid tr.row-ro .date-pick,
.stage-grid tr.row-ro .list-pick { display: none; }
.stage-grid tr.row-ro .att-up,
.stage-grid tr.row-ro .att-x { display: none; }
.stage-grid tr.row-ro .tree-toggle { opacity: 1; }

/* ---------- 账号管理 ---------- */
.modal-lg { max-width: 860px; }
.modal-xl { width: min(1200px, 96%); }
.user-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 4px;
}
.user-grid { width: 100%; font-size: 12.5px; }
.user-grid th {
  position: sticky; top: 0; z-index: 1;
  background: #eef4fa;
  font-size: 12px;
}
.user-grid td { padding: 7px 10px; }
.user-grid td.rowbtns { white-space: nowrap; }
.user-grid td.rowbtns button {
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  margin-right: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}
.user-grid td.rowbtns button:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.user-add-title {
  margin: 18px 0 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--brand);
}

/* ---------- 日期列：手动输入 + 点击日历选择 ---------- */
.date-wrap, .list-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.date-wrap { position: relative; }
.date-wrap > textarea, .list-wrap > input { flex: 1 1 auto; min-width: 0; width: auto; }
.date-pick, .list-pick {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}
.date-pick:hover, .list-pick:hover { background: var(--brand-soft); border-color: var(--line-strong); }
.date-pick svg, .list-pick svg { display: block; }
/* 真正弹出的原生控件：盖在日历按钮上但完全透明，只负责唤起选择器。
   必须留在可视位置，否则 showPicker() 会被浏览器拒绝。 */
.stage-grid td.cell-edit input.date-native {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 21px; height: 26px;
  min-width: 0; padding: 0; border: 0;
  opacity: 0;
  pointer-events: none;
}
.view-readonly .date-pick, .view-readonly .list-pick { display: none; }
.stage-grid td.cell-edit input.name-input { width: 100%; padding: 4px 6px; }

/* ---------- 筛选：只看我负责的 ---------- */
.filters .filter-chk {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.filters .filter-chk:hover { border-color: var(--brand-2); color: var(--text); }
.filters .filter-chk input { accent-color: var(--brand); margin: 0; }

/* ---------- 我的任务 ---------- */
.task-badge {
  display: inline-block;
  margin-left: 5px;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d6453a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.task-section { margin: 16px 0 2px; font-size: 13px; color: var(--brand); }
#taskBody > .task-section:first-child { margin-top: 2px; }
.task-proj { margin: 10px 0 6px; font-size: 12.5px; font-weight: 600; }
.task-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.task-item:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.task-item .t-seq { flex: 0 0 auto; font-weight: 600; color: var(--brand); }
.task-item .t-main { flex: 1 1 auto; min-width: 0; }
.task-item .t-activity { display: block; }
.task-item .t-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.task-item.is-done .t-activity { color: var(--muted); text-decoration: line-through; }
.task-item .t-flag {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}
.task-empty { padding: 28px 10px; text-align: center; color: var(--muted); }

/* ---------- 变更对比（审批依据） ---------- */
#modalDiff, #modalAudit { z-index: 75; }
.diff-row {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.diff-row .d-head {
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
}
.diff-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.diff-table td { padding: 4px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.diff-table tr:last-child td { border-bottom: 0; }
.diff-table .d-field {
  width: 110px;
  color: var(--muted);
  white-space: nowrap;
  background: #f7f9fc;
}
.diff-table .d-old {
  width: 38%;
  color: #b3281c;
  background: #fff6f5;
  text-decoration: line-through;
  text-decoration-color: rgba(179, 40, 28, .35);
}
.diff-table .d-to { color: #1c7a3e; background: #f4fdf6; font-weight: 600; }
.d-empty { color: var(--muted); font-style: normal; opacity: .7; }
.d-added td { background: #f4fdf6; }
.d-removed td { background: #fff6f5; color: #b3281c; }
.d-add-title { color: #1c7a3e !important; }
.d-del-title { color: #b3281c !important; }

/* ---------- 审批「查看改动」：改动直接显示在格子内（2026-11-03 定稿） ---------- */
tr > td.dc-cell { vertical-align: top; }
tr > td.dc-cell .dc-old {
  display: block;
  color: #b3281c;
  background: #fff6f5;
  text-decoration: line-through;
  text-decoration-color: rgba(179, 40, 28, .45);
  text-decoration-thickness: 1.5px;
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}
tr > td.dc-cell .dc-new {
  display: block;
  color: #0b6b3a;
  background: #f0fbf4;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
  margin-top: 3px;
}
tr > td.dc-cell .dc-now { display: block; margin-top: 3px; font-size: 12px; }
.dc-add-tag { color: #d8323c; font-weight: 700; margin-right: 4px; letter-spacing: .5px; }
/* 行下方仅「新增行 / 整行删除」一句话 */
tr.diff-detail > td {
  padding: 0 !important;
  background: #f7f9fc;
  border-bottom: 2px solid #dbe5f3;
}
tr.diff-detail .dg-detail-box { padding: 6px 10px 8px; }
tr.diff-detail .dg-detail-note { font-size: 12.5px; padding: 2px 2px; }
tr.diff-detail .dg-detail-note.del { color: #b3281c; }
tr.diff-detail .dg-detail-note.add { color: #0b6b3a; font-weight: 600; }

/* ---------- 操作日志 ---------- */
.audit-filter { display: flex; gap: 8px; margin-bottom: 10px; }
.audit-filter #auditKeyword { flex: 1 1 auto; min-width: 0; }
.audit-filter #auditAction { flex: 0 0 auto; }
.audit-time { white-space: nowrap; color: var(--muted); }

/* ---------- 已拖期 / 风险预警 明细 ---------- */
#modalAggr { z-index: 70; }
.kpi.clickable { cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.kpi.clickable:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.kpi.clickable::after {
  content: '明细 ▸';
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--brand);
}
.aggr-row { cursor: pointer; }
.aggr-row:hover td { background: var(--brand-soft); }

/* ---------- 变更审批 / 版本历史 ---------- */
#modalSubmit { z-index: 70; }
#modalApprovals, #modalVersions, #modalVerDetail { z-index: 70; }
.flow-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: 8px;
  background: #fff;
}
.flow-item .f-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.flow-item .f-proj { font-weight: 600; }
.flow-item .f-reason { flex: 1 1 auto; min-width: 0; }
.flow-item .f-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.flow-item .f-note {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f7f9fc;
  font-size: 12px;
  white-space: pre-wrap;
}
.flow-item .f-btns { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.flow-item .f-btns input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
}
.flow-st { font-size: 11px; padding: 1px 7px; border-radius: 9px; }
.flow-st.pending_leader { background: #fff3c4; color: #8a6400; }
.flow-st.pending_director { background: #dcecff; color: #1c5aa8; }
.flow-st.approved { background: #d9f2e0; color: #1c7a3e; }
.flow-st.rejected { background: #ffe2e0; color: #b3281c; }
/* 审批弹窗：可折叠的历史区块（默认收起，点标题展开） */
.approve-fold {
  margin: 14px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.approve-fold summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
}
.approve-fold summary::-webkit-details-marker { display: none; }
.approve-fold .af-title { font-size: 13px; font-weight: 600; color: var(--brand); }
.approve-fold .af-caret { margin-left: auto; color: var(--muted); }
.approve-fold .af-caret::before { content: '▸'; }
.approve-fold[open] .af-caret::before { content: '▾'; }
.approve-fold .af-body { padding: 2px 12px 10px; }
.approve-fold .af-body .task-empty { padding: 18px 10px; }
.ver-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ver-table th, .ver-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.ver-table th { color: var(--muted); font-weight: 600; background: #f7f9fc; }
.ver-table th { text-align: center; }
/* 项目列表里的「项目集」列：给个下限，别让名字被挤成一竖条 */
.ver-table .col-set { min-width: 96px; max-width: 168px; }
.ver-table tr.is-cur td { background: #f2fbf4; }
.ver-open {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  padding: 2px 7px;
  cursor: pointer;
}
.ver-open:hover { background: var(--brand-soft); border-color: var(--brand-2); }
/* 版本行尾的「看内容 / 查看改动」：两个按钮并排，别挤成上下两块 */
.ver-table td.ver-acts { white-space: nowrap; }
.ver-table td.ver-acts .ver-open + .ver-open { margin-left: 6px; }

/* ---------- 草稿状态条 ---------- */
.draft-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
}
.draft-bar b { color: var(--text); }
.draft-bar.dirty { border-left-color: #e0a020; background: #fffdf4; }
.draft-bar.dirty b { color: #a4700a; }
.draft-bar.locked { border-left-color: #d6453a; background: #fff6f5; color: #8a2b22; }
.draft-bar.locked b { color: #b3281c; }
.draft-dot {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e0a020;
}
.draft-bar.locked .draft-dot { background: #d6453a; }
.draft-bar:not(.dirty):not(.locked) .draft-dot { display: none; }

/* ---------- 输出载体附件 ---------- */
.cell-output { vertical-align: top; }
.att-box {
  margin-top: 3px;
  padding: 3px 2px 1px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
}
.att-row { display: flex; align-items: center; gap: 3px; min-height: 19px; }
.att-label {
  flex: 0 0 auto;
  width: 24px;
  color: var(--muted);
  font-size: 10.5px;
}
.att-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.att-none { color: #b9c2cc; }
.att-chip {
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #f4f8fc;
  color: var(--brand);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  padding: 0 5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-chip:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.att-x {
  flex: 0 0 auto;
  width: 15px; height: 15px;
  border: 0; padding: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.att-x:hover { background: #ffe2e0; color: #b3281c; }
.att-up {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--brand);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.att-up:hover { background: var(--brand-soft); border-color: var(--brand-2); }
/* 只读项目：能下载，不能上传 / 删除 */
.view-readonly .att-up, .view-readonly .att-x { display: none; }

/* 从「我的任务」跳过来时高亮那一行 */
@keyframes rowFlash { 0%, 100% { background: transparent; } 35% { background: #fff3c4; } }
tr.row-flash > td { animation: rowFlash 1.5s ease-in-out 2; }

@media (max-width: 720px) {
  .type-cards, .field-row { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
}

/* ---------- 统计概览：项目列表区栅格（一行 3 格，按行填充） ----------
   第一行：售前 / 招标 / 执行；第二行：售后 / 已结束项目（空出来的第三格留着）。
   「项目总数」不在这里 —— 它单独一整行，放在标题下面（见 .mx-sum-row）。
   DOM 顺序就是视觉顺序（见 js 的 renderKpis）。 */
.stat-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  padding: 12px 16px 16px;
}
/* 窄屏退回单列，顺序仍是 售前 / 招标 / 执行 / 售后 / 已结束 */
@media (max-width: 1180px) {
  .stat-matrix {
    grid-template-columns: 1fr;
  }
}
.mx-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.mx-head {
  display: block;
  width: 100%;
  padding: 10px 12px 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mx-head:hover { background: var(--brand-soft); }
.mx-head .mx-name { display: block; font-weight: 700; font-size: 14px; }
.mx-head .mx-proj { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.mx-head .mx-proj b { font-size: 21px; color: #1f2733; }
.mx-head .mx-sub { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); }
.mx-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mx-row:last-child { border-bottom: 0; }
/* 「项目总数」块里的类型徽章行：售前 / 招标 / 执行 / 售后 / 已结束，一点即看项目列表 */
.mx-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.mx-chip {
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #eef3f9;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.mx-chip b { font-size: 13px; color: #1f2733; }
.mx-chip:hover { background: var(--brand-soft); }
.mx-chip-end { background: #fdf3ec; border-color: #eed8c4; }
/* 详细计划工具条：桌面把「更多」包着的按钮摊平显示，「⋯」按钮本身隐藏 */
.more-btns { display: contents; }
#btnStageMore { display: none; }

/* ---------- 售后「问题图片」列（2026-11-06）：缩略图 + 上传 + 大图预览 ---------- */
.cell-img { background: #fff; }
.img-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; padding: 4px 0; }
.img-thumb { position: relative; display: inline-block; line-height: 0; }
.img-thumb img {
  width: 84px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); cursor: zoom-in; background: #f2f5f9; display: block;
}
.img-thumb img:hover { border-color: var(--brand-2); }
.img-thumb .img-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; border: 1px solid #e3b7ae; background: #fff;
  color: #b3281c; font-size: 12px; line-height: 16px; padding: 0; cursor: pointer;
}
.img-thumb .img-x:hover { background: #b3281c; color: #fff; }
.img-add {
  padding: 5px 9px; border: 1px dashed #b9c4d2; border-radius: 6px;
  background: #f7fafc; color: #62718a; font: inherit; font-size: 12px; cursor: pointer;
}
.img-add:hover { border-color: var(--brand-2); color: var(--brand); }
/* 大图预览层 */
.img-viewer {
  position: fixed; inset: 0; z-index: 400; background: rgba(20, 24, 30, .82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.img-viewer img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }
.img-viewer .iv-bar { display: flex; gap: 14px; align-items: center; color: #e8edf4; font-size: 13px; }
.img-viewer .iv-close {
  padding: 6px 16px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px;
  background: transparent; color: #fff; font: inherit; cursor: pointer;
}
.img-viewer .iv-close:hover { background: rgba(255,255,255,.15); }
/* 模板管理页：售后只读说明 */
.tpl-readonly { padding: 18px 16px; color: #62718a; font-size: 13px; line-height: 1.8; background: #fbfcfe; }
/* 售后问题行的「详」标记：点开这个问题的解决详细计划 */
.sub-plan-link {
  display: inline-block; margin-left: 5px; padding: 0 5px; font-size: 11px; line-height: 16px;
  border-radius: 4px; background: var(--brand-soft); color: var(--brand);
  border: 1px solid #d8c6c6; text-decoration: none; vertical-align: middle;
}
.sub-plan-link:hover { background: var(--brand); color: #fff; }
.mx-row:hover { background: var(--brand-soft); }
.mx-row .mx-label { flex: 1 1 auto; font-size: 12.5px; color: var(--muted); }
.mx-row .mx-value { font-size: 19px; font-weight: 700; }
.mx-row .mx-unit { flex: 0 0 60px; font-size: 10.5px; color: var(--muted); text-align: right; }
.mx-row .mx-unit i { display: block; font-style: normal; }
.mx-doing .mx-value { color: #1a6ab0; }
.mx-done .mx-value { color: var(--ok); }
.mx-overdue .mx-value { color: #b3281c; }
.mx-soon .mx-value { color: #a4700a; }
.mx-zero .mx-value { color: #b9c0cc; font-weight: 600; }
.stat-extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 4px 16px 12px;
}
/* 放进项目列表矩阵右下角那格时：三块竖着叠，边框和旁边的格子一致 */
.stat-matrix > .stat-extras {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  align-self: stretch;
}
.stat-matrix > .stat-extras .stat-block + .stat-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
@media (max-width: 980px) {
  .stat-matrix {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
  .stat-extras { grid-template-columns: 1fr; }
  .stats-top2 { grid-template-columns: 1fr; }
}

/* ---------- 账号「所属区域」多选勾选框 ---------- */
.region-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.rg-chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.rg-chk input { margin: 0; }

/* ---------- 统计页顶部一行：待办事项 + 任务日历 ---------- */
.stats-top2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;      /* 左列（待办）与右列（任务日历）等高 */
}

/* ---------- 矩阵内：进行中的项目与具体步骤 ---------- */
.mx-list-head {
  padding: 7px 12px 5px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.mx-none { padding: 12px; font-size: 12px; color: var(--muted); }
.mx-pj { border-bottom: 1px solid var(--line); }
.mx-pj:last-child { border-bottom: 0; }
.mx-pj-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px 6px;
  border: 0;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.mx-pj-name:hover { background: var(--brand-soft); }
.mx-pj-name span { font-weight: 400; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mx-step {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  padding: 4px 12px 4px 22px;
  border: 0;
  background: #fff;
  font: inherit;
  font-size: 12px;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
}
.mx-step:hover { background: var(--brand-soft); color: var(--brand); }
.mx-step b { flex: 0 0 auto; font-weight: 600; color: #1f2733; }
.mx-step i {
  flex: 0 0 auto;
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
}
.mx-more { padding: 5px 12px; font-size: 11px; color: var(--muted); }

/* ---------- 已拖期：醒目块（必须补填追赶措施） ---------- */
.catch-panel {
  border: 1px solid #e8b4ae;
  border-left: 5px solid #c0392b;
  background: #fff8f7;
}
.catch-head { padding: 9px 14px 5px; border-bottom: 1px dashed #e8b4ae; }
.catch-head h2 { margin: 0 0 4px; font-size: 15px; color: #b3281c; }
.catch-rule { margin: 0; font-size: 12.5px; color: #6b4a46; }
.catch-rule b { color: #b3281c; }
.catch-body { padding: 5px 14px 11px; }
.catch-item {
  margin: 5px 0;
  padding: 6px 10px;
  border: 1px solid #f0d5d1;
  border-radius: 8px;
  background: #fff;
}
.catch-item.lv-leader { border-color: #e8a79f; background: #fff4f2; }
.catch-item.lv-director { border-color: #c0392b; background: #ffeae7; }
.catch-item.lv-done { border-color: #cfe8d3; background: #f6fdf7; }
.catch-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
  line-height: 1.5;
}
.catch-lv {
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 11px;
  white-space: nowrap;
  background: #ffe2e0;
  color: #b3281c;
}
.lv-done .catch-lv { background: #d9f2e0; color: #1c7a3e; }
.lv-leader .catch-lv { background: #ffd9d3; color: #b3281c; font-weight: 600; }
.lv-director .catch-lv { background: #c0392b; color: #fff; font-weight: 600; }
.catch-meta { color: var(--muted); font-size: 11px; }
/* 负责人醒目标签（拖期提醒 / 风险预警 / 拖期明细共用）：
   区域负责人、主任扫一眼就知道这条该找谁催 */
.own-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: #eaf2ff;
  border: 1px solid #c4d8f5;
  color: #14508f;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
/* 「项目负责人」用暖色区分开，和「主办」不混 */
.own-tag.own-tag-owner {
  background: #fff3e4;
  border-color: #f0d3ab;
  color: #9a5208;
}
.own-tag.own-none {
  background: #f5f7fa;
  border-color: #dfe6ef;
  color: #8a97a8;
  font-weight: 600;
}
.own-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
/* 业务活动（节点名）并到第一行显示 */
.catch-node { color: #1f2733; font-weight: 600; }
.catch-go {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 11.5px;
  padding: 2px 8px;
  cursor: pointer;
}
.catch-go:hover { background: var(--brand-soft); }

/* ---------- 风险预警面板：黄色警示（没到拖期那级红），独立入口可从工作台直达 ---------- */
.soon-panel {
  border: 1px solid #ecd9a8;
  border-left: 5px solid #e8a20c;
  background: #fffdf7;
}
.soon-panel .catch-head { border-bottom-color: #ecd9a8; }
.soon-panel .catch-head h2 { color: #b06a00; }
.soon-panel .catch-rule { color: #6b5a46; }
.soon-panel .catch-rule b { color: #b06a00; }
.soon-panel .catch-item.lv-soon { border-color: #ecd9a8; border-left-width: 4px; border-left-color: #e8a20c; }
/* 今天到期：更急一档的橙红 */
.soon-panel .catch-item.lv-today { border-left-color: #d84a1f; background: #fff6f0; }
.soon-panel .catch-lv { background: #fff4e0; color: #b06a00; font-weight: 600; }
.soon-panel .lv-today .catch-lv { background: #fdeff0; color: #c8262f; }
.catch-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
/* 标签与输入同一行：追赶措施 / 追赶计划 / 按钮 一行放得下就一行 */
.catch-form label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.catch-form input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  color: #1f2733;
}
.catch-ro { margin-top: 6px; font-size: 12px; color: var(--muted); }
/* 追赶措施内容展示 / 审核意见 / 审核操作条 */
.catch-view { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: #1f2733; }
.catch-view b { color: #6b4a46; }
.catch-view.catch-none { color: var(--muted); }
.catch-review { margin-top: 3px; font-size: 11px; color: var(--muted); }
.catch-review-bar { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.catch-review-bar input {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  color: #1f2733;
}
.catch-mine { color: #b3281c; font-weight: 600; }

/* 按要求：项目管理页 / 统计概览页标题下的解释性小字不再显示 */
#planSubtitle,
#viewMain .foldrow .foldbar-summary,
#viewStats .stats-head .muted,
#viewStats .panel-title .muted { display: none; }

/* ---------- 矩阵内：项目列表表格 ---------- */
.mx-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mx-table th, .mx-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.mx-table th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
}
.mx-tr { cursor: pointer; }
.mx-tr:hover td { background: var(--brand-soft); }
.mx-st { padding: 1px 7px; border-radius: 9px; font-size: 11px; white-space: nowrap; }
.st-正在进行 { background: #e6f1fd; color: #1a6ab0; }
.st-已完成 { background: #e8f7ef; color: var(--ok); }
.st-已拖期 { background: #ffe2e0; color: #b3281c; font-weight: 600; }
.st-未开始 { background: #f1f3f7; color: var(--muted); }
.mx-cnt { margin-left: 6px; font-style: normal; font-size: 10.5px; color: var(--muted); }

/* 「全部/本月」：斜杠后面是本月数字
   本月口径 = 进行中 / 已拖期 / 风险预警 看「计划完成时间」落在本月，已完成看「完成日期」在本月 */
.mx-value .mx-m { margin-left: 1px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mx-cbtn .mx-m { margin-left: 1px; font-size: 11px; font-weight: 600; color: var(--muted); }
.mx-c0 .mx-m { color: #c8cdd6; }
.mx-table th .mx-ths {
  display: block;
  margin-top: 1px;
  font-weight: 400;
  font-size: 10px;
  color: #b3bac5;
}

/* ---------- 矩阵内：每个类型的项目表（序号|项目名|负责人|进度|进行中|已拖期|风险预警） ---------- */
.mx-tblwrap { overflow-x: auto; }
.mx-table th, .mx-table td { padding: 5px 8px; }
.mx-table th.c-center, .mx-table td.c-center { text-align: center; }
.mx-table th { text-align: center; }

/* 行距下拉：工具栏里别占太宽 */
.row-spacing-pick { width: auto; min-width: 108px; }
.mx-table tbody tr:last-child td { border-bottom: 0; }
.mx-table .mx-no { color: var(--muted); font-size: 11.5px; }
.mx-table .mx-pname { min-width: 112px; }
.mx-table .mx-own { color: var(--text-2); }
.mx-table .mx-pg { color: var(--muted); font-size: 11.5px; }
.mx-pg-num { display: block; white-space: nowrap; }
.mx-node { display: block; margin-bottom: 1px; font-size: 11.5px; color: #2b5c9b; }
.mx-node-done { color: #2f7d4f; }
.mx-tr-closed td { color: var(--muted); }
.mx-tr-closed .mx-pname { text-decoration: line-through; }
.mx-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10.5px;
  background: #e8f7ef;
  color: var(--ok);
}
.mx-cbtn {
  min-width: 24px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mx-cbtn:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.mx-cbtn.mx-c-doing { color: #1a6ab0; }
.mx-cbtn.mx-c-overdue { color: #b3281c; }
.mx-cbtn.mx-c-soon { color: #a4700a; }
.mx-cbtn.mx-c0 { color: #b9c0cc; font-weight: 600; }

/* ---------- 矩阵内：项目名列表（个人同时负责的项目少，列名字就够） ---------- */
.mx-names { list-style: none; margin: 0; padding: 4px 0 6px; }
.mx-names li { margin: 0; }
.mx-name-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  padding: 5px 12px 5px 14px;
  border: 0;
  border-left: 3px solid transparent;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  color: #1f2733;
  cursor: pointer;
}
.mx-name-item:hover { background: var(--brand-soft); }
.mx-name-item .pn-text { flex: 1 1 auto; min-width: 0; }
.mx-name-item .pn-owner {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}
.mx-name-item .pn-tag {
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10.5px;
  background: #e8f7ef;
  color: var(--ok);
}
.mx-name-item .pn-tag.over { background: #ffe2e0; color: #b3281c; }
.mx-name-item.pn-已拖期 { border-left-color: #c0392b; }
.mx-name-item.pn-正在进行 { border-left-color: #4a90d9; }
.mx-name-item.pn-未开始 { border-left-color: #d5dae2; }
.mx-name-item.pn-已完成, .mx-name-item.pn-done { border-left-color: #7fbf94; color: var(--muted); }
.mx-name-item.pn-closed { border-left-color: #b3281c; color: var(--muted); text-decoration: line-through; }
.mx-name-item.pn-closed .pn-tag { background: #ffe2e0; color: #b3281c; }
.mx-name-item.pn-done .pn-tag { background: #e8f7ef; color: var(--ok); }

/* ---------- 阶段梳理模板编辑 ---------- */
.tpl-tabs { display: flex; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.tpl-tab {
  font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fff; color: var(--text-2); cursor: pointer;
}
.tpl-tab:hover { border-color: var(--brand-2); color: var(--text); }
.tpl-tab.active { border-color: var(--brand); color: var(--brand); font-weight: 600; background: #f2f7ff; }
.tpl-tab-n { margin-left: 6px; font-size: 11.5px; color: var(--muted); }
.tpl-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.tpl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tpl-table th {
  position: sticky; top: 0; z-index: 2; background: #f6f8fb; text-align: left; font-weight: 600;
  padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tpl-table td { padding: 3px 5px; border-bottom: 1px solid #eef1f6; }
.tpl-table tr:hover td { background: #fafcff; }
.tpl-no { width: 40px; text-align: right; padding-right: 8px; color: var(--muted); }
.tpl-in {
  width: 100%; font: inherit; font-size: 13px; padding: 4px 6px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 5px; background: transparent;
}
.tpl-in:hover { border-color: var(--line-strong); background: #fff; }
.tpl-in:focus { border-color: var(--brand); background: #fff; outline: none; }
.tpl-seq { font-weight: 600; color: var(--brand); }
.tpl-ops { white-space: nowrap; text-align: right; }
.tpl-ops .icon-btn { padding: 2px 6px; font-size: 13px; }
.tpl-gap { flex: 1 1 auto; }
#tplVerBox { margin: 10px 0 4px; }
#tplCount { margin: 6px 0 0; }

/* ---------- 项目列表里的「当前节点」标签（1100 级自动识别） ---------- */
.tag-node { background: #eef4ff; color: #2b5c9b; border-color: #cfe0f7; }
.tag-node-done { background: #eefaf0; color: #2f7d4f; border-color: #cfe9d6; }

/* ---------- 模板：详细计划显示列（删列 / 加回列） ---------- */
.tpl-colbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px 0 10px; padding: 8px 10px;
  border: 1px dashed var(--line-strong); border-radius: 8px; background: #fbfcfe;
}
.tpl-colbtn {
  font: inherit; font-size: 12.5px; padding: 3px 10px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; color: var(--muted);
}
.tpl-colbtn:hover { border-color: var(--brand-2); color: var(--text); }
.tpl-colbtn.on { border-color: var(--brand); color: var(--brand); background: #f2f7ff; font-weight: 600; }

/* ---------- 状态列：当前状态标签 + 手动状态下拉 ---------- */
.cell-status .st-box { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.cell-status .st-select {
  font-size: 11px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink); cursor: pointer; max-width: 100%;
}
.cell-status .st-select:hover { border-color: var(--brand); }

/* ---------- 草稿条：被驳回时显示的审核意见 ---------- */
.draft-bar .draft-why {
  display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px;
  background: #fdeaea; color: #b3281c; border: 1px solid #f0c4bf;
}

/* 草稿条里追加的「我提过的重大节点申请」说明（待审 / 驳回 / 重提按钮）：
   跟在主文案后面同一行内联显示，不再单独占一行（省空间） */
.draft-bar .node-app-line {
  flex: 0 1 auto; min-width: 0;
  line-height: 1.6;
}
/* 按钮默认是给深色顶栏用的（白字），放在浅色草稿条里会看不清，这里单独给一套 */
.draft-bar .node-app-line .btn {
  margin-left: 6px; vertical-align: baseline;
  background: #fff; color: var(--brand); border: 1px solid var(--line-strong);
}
.draft-bar .node-app-line .btn:hover { background: var(--brand-soft); border-color: var(--brand-2); }

/* ---------- 变更对比（表格视图）：改动行着色 + 单元格「旧 → 新」 ---------- */
.diff-scroll { overflow-x: auto; margin-bottom: 6px; }
.diff-grid { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: auto; }
.diff-grid th, .diff-grid td {
  border: 1px solid var(--line); padding: 3px 6px; vertical-align: top; text-align: left;
  max-width: 260px; word-break: break-word;
}
.diff-grid thead th { background: #f6f7f9; font-weight: 600; white-space: nowrap; }
.diff-grid td.dg-at, .diff-grid th.dg-at { width: 40px; text-align: center; white-space: nowrap; }
.diff-grid td.dg-kind, .diff-grid th.dg-kind { width: 58px; text-align: center; white-space: nowrap; }
.diff-grid tr.d-add > td { background: #e8f7ef; }
.diff-grid tr.d-chg > td { background: #fff8e6; }
.diff-grid tr.d-del > td { background: #fdeaea; color: #8a3a32; }
.diff-grid td.d-cell-chg { background: #fff1cf; }
.diff-grid tr.d-extra > td { background: #fbfbfc; color: #444; font-size: 11.5px; }
.diff-grid .d-from { color: #b3281c; text-decoration: line-through; }
.diff-grid .d-arrow { color: var(--muted); margin: 0 4px; }
.diff-grid .d-to { color: #0b6b3a; font-weight: 600; }
.dg-legend .dg-chip {
  display: inline-block; margin: 0 6px 0 2px; padding: 0 6px; border-radius: 4px; font-size: 11px;
}
.dg-add { background: #e8f7ef; color: #0b6b3a; }
.dg-chg { background: #fff1cf; color: #8a5b00; }
.dg-del { background: #fdeaea; color: #b3281c; }

/* ---------- 变更对比：弹窗够宽 + 表格不再被挤成一团 ---------- */
/* 注意：.modal 的 width 是 min(720px,100%)，只写 max-width 是压不宽的，这里显式给 width */
.modal-diff { width: min(1560px, 97vw); max-width: none; }
.modal-diff .modal-body { overflow-x: auto; }
.modal-diff #diffBody { min-width: 0; }

.diff-grid { min-width: 1360px; }                 /* 宁可横向滚动，也不把每列挤成一条 */
.diff-grid th, .diff-grid td { white-space: normal; }
.diff-grid th[data-k="seq"], .diff-grid td[data-k="seq"] { width: 86px; white-space: nowrap; }
.diff-grid th[data-k="phase"], .diff-grid td[data-k="phase"] { width: 100px; }
.diff-grid th[data-k="activity"], .diff-grid td[data-k="activity"] { width: 200px; }
.diff-grid th[data-k="output"], .diff-grid td[data-k="output"] { width: 180px; }
.diff-grid th[data-k="planDate"], .diff-grid td[data-k="planDate"] { width: 116px; white-space: nowrap; }
.diff-grid th[data-k="deptLeader"], .diff-grid td[data-k="deptLeader"] { width: 96px; white-space: nowrap; }
.diff-grid th[data-k="ownerDept"], .diff-grid td[data-k="ownerDept"] { width: 124px; }
.diff-grid th[data-k="completed"], .diff-grid td[data-k="completed"] { width: 62px; }
.diff-grid th[data-k="completedAt"], .diff-grid td[data-k="completedAt"] { width: 104px; white-space: nowrap; }
.diff-grid th[data-k="progress"], .diff-grid td[data-k="progress"] { width: 240px; }

/* 被改的格子：旧值一行（红色划线）、新值一行（绿色，前面带 →） */
.diff-grid td.d-cell-chg .d-from { display: block; }
.diff-grid td.d-cell-chg .d-arrow { display: none; }

/* ================= AI 助手（本地大模型，全屏聊天面板） ================= */
.ai-panel {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; flex-direction: column;
  background: #f6f4fb;
}
.ai-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #fff; border-bottom: 1px solid #e4def5;
}
.ai-title { font-weight: 700; font-size: 15px; color: #3b2f66; }
.ai-model { font-weight: 400; font-size: 12px; color: #8b7fc4; }
.ai-head-btns { display: inline-flex; gap: 6px; }
.ai-hbtn {
  border: 1px solid #d8d0f0; background: #fff; color: #5b4f9e;
  font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
}
.ai-hbtn:hover { background: #f1ecff; }
.ai-hbtn.ai-close { color: #b3423f; border-color: #e3c4c3; }
.ai-hbtn.ai-close:hover { background: #fbeeee; }
.ai-setup {
  padding: 10px 14px; background: #fbfaff; border-bottom: 1px solid #e4def5;
  display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: #55506e;
}
.ai-setup label { display: flex; flex-direction: column; gap: 4px; }
.ai-setup .input { font-size: 13px; padding: 6px 9px; }
.ai-setup-btns { display: flex; align-items: center; gap: 8px; }
.ai-test-out { font-size: 12px; color: #4a8f5c; }
.ai-models { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-model-item {
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 14px;
  border: 1px solid #d8d0f0; background: #fff; color: #5b4f9e; cursor: pointer;
}
.ai-model-item:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-empty { margin: auto; color: #a09cc0; font-size: 13px; text-align: center; padding: 0 30px; line-height: 1.8; }
.ai-row { display: flex; }
.ai-row.ai-me { justify-content: flex-end; }
.ai-bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.65; word-break: break-word; white-space: pre-wrap;
}
.ai-me .ai-bubble { background: #7c3aed; color: #fff; border-bottom-right-radius: 4px; }
.ai-bot .ai-bubble {
  background: #fff; color: #2e2a45; border: 1px solid #e6e1f5; border-bottom-left-radius: 4px;
  white-space: normal; max-width: 86%;
}
/* 助手回复的会话排版（标题/列表/表格/代码/公式） */
.ai-bot .ai-bubble h1, .ai-bot .ai-bubble h2,
.ai-bot .ai-bubble h3, .ai-bot .ai-bubble h4 {
  margin: 10px 0 6px; font-weight: 700; line-height: 1.4;
}
.ai-bot .ai-bubble h1 { font-size: 16px; }
.ai-bot .ai-bubble h2 { font-size: 15px; }
.ai-bot .ai-bubble h3 { font-size: 14px; }
.ai-bot .ai-bubble h4 { font-size: 13.5px; color: #5b4f9e; }
.ai-bot .ai-bubble h1:first-child, .ai-bot .ai-bubble h2:first-child,
.ai-bot .ai-bubble h3:first-child, .ai-bot .ai-bubble h4:first-child,
.ai-bot .ai-bubble p:first-child { margin-top: 0; }
.ai-bot .ai-bubble p { margin: 6px 0; }
.ai-bot .ai-bubble ul, .ai-bot .ai-bubble ol { margin: 6px 0; padding-left: 20px; }
.ai-bot .ai-bubble li { margin: 3px 0; }
.ai-bot .ai-bubble hr { border: 0; border-top: 1px solid #e6e1f5; margin: 10px 0; }
.ai-bot .ai-bubble blockquote {
  margin: 6px 0; padding: 4px 10px; border-left: 3px solid #c9b8f5;
  background: #faf8ff; border-radius: 4px; color: #55506e;
}
.ai-bot .ai-bubble code {
  font-family: Consolas, Menlo, monospace; font-size: 12.5px;
  background: #f1ecff; border-radius: 4px; padding: 1px 5px;
}
.ai-bot .ai-bubble pre {
  margin: 8px 0; padding: 9px 11px; background: #2e2a45; border-radius: 8px;
  overflow-x: auto;
}
.ai-bot .ai-bubble pre code { background: transparent; color: #ece7ff; padding: 0; font-size: 12px; line-height: 1.55; }
.ai-bot .ai-bubble table {
  border-collapse: collapse; margin: 8px 0; font-size: 12.5px; width: 100%;
  display: block; overflow-x: auto;
}
.ai-bot .ai-bubble th, .ai-bot .ai-bubble td {
  border: 1px solid #ddd6f3; padding: 5px 9px; text-align: left;
}
.ai-bot .ai-bubble th { background: #f1ecff; font-weight: 700; white-space: nowrap; }
.ai-bot .ai-bubble .katex-display {
  overflow-x: auto; overflow-y: hidden; padding: 3px 0; margin: 8px 0;
}
.ai-bot .ai-bubble .katex { font-size: 1.02em; }

/* 拖期 / 预警面板的筛选下拉（区域负责人 / 主任） */
.panel-filter {
  font-size: 12px; padding: 2px 6px; margin-right: 8px;
  border: 1px solid #d8d0f0; border-radius: 6px;
  background: #faf8ff; color: #55506e; vertical-align: middle;
}
.panel-filter:focus { outline: none; border-color: #b9a7f0; }

/* 详细计划的表格内容搜索（工具栏放大镜 / Ctrl+F） */
.stage-search { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.stage-search-input {
  font-size: 12px; padding: 3px 8px; width: 180px;
  border: 1px solid #cfd8e8; border-radius: 6px; background: #fbfdff;
}
.stage-search-input:focus { outline: none; border-color: #7ea6e8; background: #fff; }
.stage-search-count { font-size: 12px; color: #2b7a3d; white-space: nowrap; }
/* 备案信息栏（ICP / 公安备案） */
.site-foot {
  text-align: center;
  font-size: 12px;
  color: #8a93a6;
  padding: 18px 12px calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom, 0px) + 14px);
}
.site-foot a { color: #8a93a6; text-decoration: none; }
.site-foot a:hover { color: #2f6bd6; }
.site-foot .foot-sep { margin: 0 6px; }
@media (min-width: 821px) {
  .site-foot { padding-bottom: 34px; }
}

/* Excel 式列筛选：表头小漏斗 + 下拉面板 */
.cf-btn {
  border: 0; background: transparent; padding: 0 2px; margin-left: 4px;
  color: #9aa4b8; cursor: pointer; vertical-align: middle; line-height: 0; opacity: .5;
}
.cf-btn svg { width: 12px; height: 12px; }
th:hover .cf-btn { opacity: 1; }
.cf-btn:hover { color: #2f6bd6; }
.cf-btn.on { color: #d4491f; opacity: 1; }
.cf-panel {
  position: fixed; z-index: 4000; background: #fff; border: 1px solid #dfe5ef;
  border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 30, 60, .18);
  font-size: 12.5px; overflow: hidden;
}
.cf-head { display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: #f7f9fc; border-bottom: 1px solid #eef1f6; }
.cf-x { border: 0; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; color: #8a93a6; }
.cf-tools { display: flex; align-items: center; gap: 8px; padding: 6px 10px 0; }
.cf-link { border: 0; background: transparent; color: #2f6bd6; cursor: pointer; padding: 0; font-size: 12px; }
.cf-body { max-height: 260px; overflow: auto; padding: 6px 10px 8px; }
.cf-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.cf-row input { margin: 0; }
.cf-text { width: 100%; box-sizing: border-box; padding: 4px 8px; border: 1px solid #cfd8e8; border-radius: 6px; font-size: 12.5px; }
.cf-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid #eef1f6; background: #fbfcfe; }

/* Excel 式搜索：命中行整行高亮（不隐藏），当前停留的行再深一档 */
#stageTable tbody tr.row-search-hit > td { background-color: #fdf2b8; }
#stageTable tbody tr.row-search-hit > td textarea,
#stageTable tbody tr.row-search-hit > td input { background-color: #fdf6d8; }
#stageTable tbody tr.row-search-cur > td { background-color: #fbe38a; }
#stageTable tbody tr.row-search-cur > td textarea,
#stageTable tbody tr.row-search-cur > td input { background-color: #fdeeb0; }
.ai-bubble.ai-thinking { color: #8b7fc4; font-size: 12.5px; }
/* 附件：待发送列表 + 消息里的图片 */
.ai-attach {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 14px; background: #fff; border-top: 1px dashed #e4def5;
}
.ai-att-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  border: 1px solid #d8d0f0; background: #faf8ff; border-radius: 10px; padding: 4px 6px;
}
.ai-att-chip img {
  width: 30px; height: 30px; object-fit: cover; border-radius: 6px; flex: none;
}
.ai-att-ico { font-size: 15px; flex: none; }
.ai-att-name {
  font-size: 12px; color: #55506e; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ai-att-x {
  border: 0; background: transparent; color: #9a92b8;
  font-size: 13px; line-height: 1; padding: 2px 4px; cursor: pointer; border-radius: 4px;
}
.ai-att-x:hover { background: #efe9ff; color: #b3423f; }
.ai-attach-btn {
  align-self: flex-end; font-size: 17px; line-height: 1;
  padding: 11px 12px; border: 1px solid #d8d0f0; border-radius: 10px;
  background: #fff; cursor: pointer;
}
.ai-attach-btn:hover { background: #f1ecff; }
.ai-img {
  display: block; max-width: 190px; max-height: 190px; border-radius: 8px;
  margin-bottom: 6px; cursor: zoom-in;
}
.ai-img-ph {
  display: inline-block; font-size: 12px; color: #8b7fc4;
  background: #f1ecff; border-radius: 6px; padding: 2px 8px; margin-bottom: 6px;
}
.ai-inputbar {
  display: flex; gap: 8px; padding: 10px 14px 12px;
  background: #fff; border-top: 1px solid #e4def5;
}
.ai-text {
  flex: 1; resize: none; font: inherit; font-size: 13.5px; line-height: 1.5;
  padding: 9px 12px; border: 1px solid #d8d0f0; border-radius: 10px; min-height: 46px;
}
.ai-text:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12); }
.ai-send {
  align-self: flex-end; font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 11px 20px; border: 0; border-radius: 10px;
  background: #7c3aed; color: #fff; cursor: pointer;
}
.ai-send:hover { background: #5b21b6; }
@media (max-width: 720px) {
  .ai-bubble { max-width: 88%; }
  .ai-hbtn { padding: 5px 9px; }
}
.diff-grid td.d-cell-chg .d-to { display: block; }
.diff-grid td.d-cell-chg .d-to::before { content: "→ "; color: var(--muted); }
.diff-grid tr.d-extra > td { white-space: normal; }
.diff-grid tr.d-extra .d-from { text-decoration: line-through; }

/* ---------- 日期格：日期数字一行、日历按钮单独一行（用户口径）----------
   原来 .date-wrap 是横排（日期 + 日历并排），现在改成竖排：
   第一行放日期文本，第二行只放那个小日历按钮。
   注意：真正唤起选择器的原生 date 控件是绝对定位压在按钮上的，
   它必须跟着挪到第二行（左下角），否则弹出的日历会锚在格子中间。 */
.date-wrap { flex-direction: column; align-items: flex-start; gap: 1px; }
.date-wrap > textarea { flex: 0 0 auto; width: 100%; }
.date-wrap .date-pick { height: 22px; }
.stage-grid td.cell-edit input.date-native {
  right: auto; left: 0; top: auto; bottom: 0;
  transform: none;
  width: 22px; height: 22px;
}

/* ---------- 输出载体模版库 ---------- */
.att-chip-tpl { background: #eef4ff; border-color: #cddcf7; color: #1f4fa8; }
.att-chip-tpl:hover { background: #dfeaff; }
.otpl-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fafbfd;
}
.otpl-form .otpl-lbl { font-size: 12.5px; color: var(--text-2); }
.otpl-form input[type="text"], .otpl-form input:not([type]) {
  flex: 0 1 300px; padding: 5px 8px; border: 1px solid var(--line-strong);
  border-radius: 6px; font-size: 12.5px;
}
.otpl-form input[type="file"] { font-size: 12.5px; max-width: 260px; }
.otpl-msg { font-size: 12.5px; color: var(--brand); }
.otpl-list { max-height: 46vh; overflow: auto; }

/* ---------- 输出载体模版：名称按阶段分组 + 搜索 ---------- */
.otpl-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.otpl-pick #otplSearch {
  flex: 0 1 340px; padding: 5px 9px; border: 1px solid var(--line-strong);
  border-radius: 6px; font-size: 12.5px;
}
.otpl-groups {
  max-height: 264px; overflow-y: auto; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 10px;
}
.otpl-grp + .otpl-grp { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.otpl-grp-h { font-size: 12px; font-weight: 600; color: var(--brand-dark); margin-bottom: 5px; }
.otpl-grp-b { display: flex; flex-wrap: wrap; gap: 5px; }
.otpl-name {
  font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fafbfd; color: var(--text-2); cursor: pointer;
}
.otpl-name:hover { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }
.otpl-name.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 输出载体模版：两层折叠分组（阶段 → 子类 → 名称） ---------- */
.otpl-groups details.otpl-grp { border: 0; }
.otpl-groups details.otpl-grp + details.otpl-grp {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line);
}
.otpl-groups summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand-dark);
  padding: 3px 2px; list-style: revert;
}
.otpl-groups summary:hover { color: var(--brand); }
.otpl-groups details.otpl-sub { margin: 4px 0 2px 12px; }
.otpl-groups details.otpl-sub > summary {
  font-weight: 400; font-size: 12px; color: var(--text-2);
}
.otpl-groups details.otpl-sub .otpl-grp-b { margin: 4px 0 6px 12px; }

/* ---------- 待办卡片高度跟随内容：内容少不再留一大片空白 ----------
   早期做法是把卡片和列表都 flex:1 撑到与右侧日历等高（JS 还会按日历高度
   给列表写 inline maxHeight），待办一少底下就空一大块、多了又被裁断。
   现在卡片和列表都由内容决定高度，equalizeStatsRow() 已改为空操作，
   列表有多少条就显示多少条，左右两列各自生长。 */
#viewStats .stats-top2 > .top-col > #todoCardStat,
#viewStats .stats-top2 > .top-col > #statDirectorTodo {
  flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0;
}
#viewStats #todoCardStat > .side-body,
#viewStats #statDirectorTodo > .side-body {
  flex: 0 0 auto; max-height: none; min-height: 0; overflow-y: visible;
}

/* 拖期追赶措施：页面上不放审核按钮，只提示去「审批」 */
.catch-hint { color: #8a8f98; font-size: 12px; margin-right: 6px; }

/* 「模板」行里来自模版库的通用模版（只读、公司共享） */
.att-chip-shared { border-style: dashed; }
.att-share-tag { font-style: normal; font-size: 10px; color: #8a8f98; margin-right: 3px; }

/* 便签「完成」按钮（待办 / 主任卡 / 日历当天共用） */
.todo-ok {
  border: 0; background: transparent; color: #2f9e44; font-size: 13px;
  padding: 1px 6px; border-radius: 6px; cursor: pointer; flex: 0 0 auto;
}
.todo-ok:hover { background: #e7f7ec; }
.cal-note-ok { color: #2f9e44; }
.cal-note-ok:hover { background: #e7f7ec; color: #237a35; }

/* ---------- 文件中心（共用文件库：文件夹 + 文件列表） ---------- */
.fc-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 6px 2px 10px;
  border-bottom: 1px solid #e6e8ee;
}
.fc-crumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.fc-citem { color: #4a5160; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.fc-citem:hover { background: #f0f2f6; }
.fc-citem.on { color: #c0111a; font-weight: 600; }
.fc-sep { color: #b6bcc8; }
.fc-list { margin-top: 4px; }
.fc-head, .fc-row {
  display: grid; align-items: center; gap: 8px; padding: 8px 6px;
  grid-template-columns: 26px minmax(150px, 1fr) 90px 100px 130px 128px;
}
.fc-head { font-size: 12px; color: #8b92a1; border-bottom: 1px solid #eef0f4; }
.fc-row { border-bottom: 1px solid #f2f4f8; }
.fc-row:hover { background: #fafbfd; }
.fc-ico { text-align: center; font-size: 15px; }
.fc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-name.fc-dir { font-weight: 600; cursor: pointer; }
.fc-name[data-fc-dl] { cursor: pointer; color: #2a6cf0; }
.fc-size, .fc-by, .fc-at { font-size: 12.5px; color: #8b92a1; }
.fc-ops { display: flex; gap: 6px; justify-content: flex-end; }
.fc-up { cursor: pointer; color: #8b92a1; }
@media (max-width: 720px) {
  .fc-head { display: none; }
  .fc-row { grid-template-columns: 24px 1fr auto; }
  .fc-size, .fc-by, .fc-at { display: none; }
}
