:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --border: #e3e6ea;
  --text: #1f2328;
  --text-2: #5b6470;
  --muted: #8b95a1;
  --primary: #2f6feb;
  --primary-soft: #e8f0fe;
  --primary-d: #2860d4;
  --danger: #d94a4a;
  --danger-soft: #fdecec;
  --ok: #17915c;
  --warn: #c8811a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
  --surface: #ffffff;   /* 卡片 / 输入框 / 弹窗等"白面"元素底色 */
  --track: #eceff3;     /* 进度条 / 轨道底色 */
  --row-alt: #f5f8fc;   /* 列表 / 表格隔行底色（斑马纹） */
  /* 界面显示比例（1 = 100%）：由 app.js 的 applyZoom() 写入。
     注意 vh/vw 不受 zoom 影响，而元素尺寸会被放大 —— 所以凡是"撑满视口"的高度都要除以它，
     否则 125% 时整页会比窗口高 25%，底部设置栏被顶到屏幕外。 */
  --ui-zoom: 1;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
h1 { font-size: 20px; margin: 0 0 2px; font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 13px; margin: 0 0 6px; font-weight: 600; color: var(--text-2); }
p { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }

.app { display: flex; height: calc(100vh / var(--ui-zoom)); }

/* 侧边栏 */
.sidebar {
  width: 244px; flex: none; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 14px; gap: 14px; overflow: hidden;
}
/* 中部可滚动区（导航 + 检索筛选）：只有这块滚动，底部设置栏才能一直钉在底部 */
.side-body {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; overflow-x: hidden; padding-right: 2px; margin-right: -2px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.brand-title { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left;
}
.nav-item span { width: 16px; color: var(--muted); }
.nav-item em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active em, .nav-item.active span { color: var(--primary); }

.filter-box { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.filter-title { font-size: 11px; color: var(--muted); letter-spacing: .5px; }

/* 底部设置栏：整体钉在侧栏底部（不随导航滚动），「设置 / 主题」始终点得到 */
.side-foot {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding-top: 10px; background: var(--panel); border-top: 1px solid var(--border);
}
.foot-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; row-gap: 4px; }

/* 主区 */
.main { flex: 1; overflow: auto; padding: 22px 26px 60px; }
.view { max-width: 1180px; margin: 0 auto; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.progress-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.progress-line .bar { flex: 1; height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress-line .bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s; }
.progress-line span { font-size: 12px; color: var(--text-2); width: 40px; text-align: right; }

/* 控件 */
.input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px; outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-sm { width: auto; padding: 6px 8px; font-size: 12px; }
.btn {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { color: var(--danger); border-color: #f0c9c9; background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.link { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12px; padding: 2px 0; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }
.check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }

/* 按钮选中态（分段控件 / 「批量选择」开关都靠它，勿删） */
.btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 12px; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.bulk-bar .bulk-info { font-size: 13px; }
.bulk-bar .bulk-info b { color: var(--primary); font-size: 15px; }
/* 详情页「进展概览 / 检查落实」用的指标行（不是项目列表的卡片） */
.card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.mini-bar { flex: 1; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--primary); }

/* 项目列表（列表式，非卡片）
   改动要点：
   - 去掉卡片的阴影 / 圆角 / 悬浮位移，只用 1px 分隔线把行与行分开，便于纵向扫描对比
   - 行内用 grid 固定列（负责人 / 科室 / 周期 / 事项 / 进度），保证同一字段在各行纵向对齐
   - 容器**始终单列**：字段纵向对齐是列表式相对卡片式的主要收益，一旦分栏成多列，
     第二栏的行与第一栏的行就处在不同的 x 起点，"可横向扫读同一字段"立刻失效。
     响应式体现在行内字段列数上：宽屏 5 列、窄屏 2 列 / 1 列（见下方 @media），而不是把列表拆成多栏
   - hover / selected 只改底色与左侧色条，不做 transform，避免列表阅读时"跳动" */
.plist {
  display: grid; gap: 0; grid-template-columns: 1fr;
  background: var(--panel); border: 1px solid var(--border);
}
/* S10 列表减负：单行时就是「名称 + 状态徽标 —— 进度条」两条主干，
   描述 / 标签 / 负责人 / 科室 / 周期 / 事项数 默认收起，点行尾 ▾ 展开成多行。 */
.plist-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 14px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; position: relative; min-width: 0;
}
.plist-row:last-child { border-bottom: 0; }
.plist-row:nth-child(even) { background: var(--row-alt); }
.plist-row:hover { background: var(--panel-2); }
.plist-row.selected { background: var(--primary-soft); }
.plist-row.selected::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--primary);
}
.pl-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; grid-column: 1; }
.pl-sel { display: inline-flex; align-items: center; cursor: pointer; }
.pl-title { font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.pl-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-tags { display: flex; gap: 6px; flex-wrap: wrap; }
/* 行尾展开按钮：默认淡，悬浮/展开时变实，避免和「打开项目」的点击区抢注意力 */
.pl-expand {
  margin-left: auto; flex: none; width: 22px; height: 22px; line-height: 20px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted);
  font-size: 11px; cursor: pointer; transition: transform .15s, color .15s, background .15s;
}
.plist-row:hover .pl-expand { color: var(--text-2); background: var(--surface); border-color: var(--border); }
.pl-expand:hover { color: var(--primary); }
.plist-row.expanded .pl-expand { transform: rotate(180deg); color: var(--primary); background: var(--surface); border-color: var(--border); }
/* 描述单行省略：收起态不占位（正文挂在行的 title 上，鼠标悬浮即可看到全文） */
.pl-desc {
  grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plist-row:not(.expanded) .pl-desc { display: none; }
.plist-row:not(.expanded) .pl-tags { display: none; }
/* 字段区：收起时只剩「进度」这一格，贴在右侧与名称同一行 */
.pl-fields {
  display: grid; grid-template-columns: repeat(5, minmax(0, auto)); gap: 4px 18px;
  align-items: center; grid-column: 2; justify-items: end;
}
.pl-cell { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12px; }
.plist-row:not(.expanded) .pl-cell:not(:nth-child(5)) { display: none; }
/* 展开态：次要字段换到下一行、整宽五列排布，跨行仍可纵向对齐扫读 */
.plist-row.expanded .pl-fields {
  grid-column: 1 / -1; justify-items: start; margin-top: 2px;
}
.pl-k { color: var(--muted); flex: none; }
.pl-v { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-cell.is-red .pl-v { color: var(--danger); }
.pl-cell.is-yellow .pl-v { color: var(--warn); }
/* 周期列要放得下完整日期区间，故给它更宽的固定列 */
.pl-fields > .pl-cell:nth-child(3) { min-width: 190px; }
.pl-bar { display: inline-block; width: 64px; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.pl-bar i { display: block; height: 100%; background: var(--primary); }
.pl-pct { margin-left: 6px; color: var(--muted); }
/* .rm-red / .rm-yellow（逾期标记）沿用下方提醒模块的既有定义，勿重复声明 */

/* 窄屏：字段区从 5 列折成 2 列，仍保持标签+值成对；≤480px 折成 1 列 */
@media (max-width: 760px) {
  .plist-row { padding: 10px 12px; }
  .pl-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-fields > .pl-cell:nth-child(3) { min-width: 0; }
  .pl-desc { white-space: normal; }
}
@media (max-width: 480px) { .pl-fields { grid-template-columns: 1fr; } }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-2);
}
.badge.s-planning { background: #eef1f5; color: #5b6470; }
.badge.s-active { background: var(--primary-soft); color: var(--primary); }
.badge.s-paused { background: #f3efe6; color: var(--warn); }
.badge.s-blocked { background: var(--danger-soft); color: var(--danger); }
.badge.s-done { background: #e6f5ee; color: var(--ok); }
.badge.p-P0 { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.badge.p-P1 { background: #fdf0e3; color: var(--warn); font-weight: 600; }
.badge.p-P2 { background: #eef1f5; color: var(--text-2); }
.badge.p-P3 { background: #f2f4f7; color: var(--muted); }
.badge.tag { background: var(--primary-soft); color: var(--primary); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* 项目详情页头：名称 + 状态/优先级/标签/更新于 同处一行（窄屏自动换行），少占一行版面 */
.detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title-row h1 { margin: 0; }
.detail-title-row #d-badges { margin-top: 0; align-items: center; }

/* 详情 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  padding: 8px 12px; border: 0; background: none; color: var(--text-2); cursor: pointer;
  font-size: 13px; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.section { margin-bottom: 18px; }
.section:last-child { margin-bottom: 0; }
/* 区块标题行：标题左、操作右 —— 用于「项目描述」与记事本同源时的来源说明与按钮 */
.sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-ops {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 400;
}
.sec-ops .desc-src { color: var(--muted); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; background: var(--surface);
}
.row:hover { background: var(--panel-2); }
.row.sub { margin-left: 22px; background: var(--panel-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 13px; }
.row-title.done { text-decoration: line-through; color: var(--muted); }
.row-sub { font-size: 11px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; }
.tk-caret {
  flex: 0 0 auto; width: 20px; height: 20px; line-height: 18px; padding: 0; border: none; background: transparent;
  color: var(--text-2); font-size: 12px; cursor: pointer; border-radius: 4px;
}
.tk-caret:hover { background: var(--border); color: var(--text); }
.tk-caret-empty { display: inline-block; width: 20px; flex: 0 0 auto; }
.tk-collapse-ctl { display: flex; gap: 6px; }
.note {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--panel-2);
  /* 右上角「⋯」与正文并排：避免绝对定位压住第一行文字，也让长内容自然换行 */
  display: flex; align-items: flex-start; gap: 8px;
}
.note-body { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; font-size: 13px; word-break: break-word; overflow-wrap: anywhere; line-height: 1.6; }
/* 备注的「来源 / 时间 / 操作」都收在 ⋯ 里；按钮本身保持全局三点的弱化外观 */
.note-more { flex: 0 0 auto; }
/* 「添加到记事本」弹窗里的内容预览：保留换行、长串自动断行、可滚动 */
.np-add-preview { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; max-height: 220px; overflow: auto; background: var(--panel-2); padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.6; margin: 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty.lg { padding: 60px 0; }

/* 时间线 */
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 14px 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -16px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary); border: 2px solid #fff;
}
.tl-time { font-size: 11px; color: var(--muted); }
.tl-title { font-size: 13px; }
.tl-detail { font-size: 12px; color: var(--text-2); }

/* 关联图 */
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.legend .lg-tip { color: var(--muted); }
.legend .ln { display: inline-block; width: 22px; height: 0; border-top: 2px solid; margin-right: 6px; vertical-align: middle; }
.ln.parent { border-color: var(--primary); }
.ln.depends { border-color: var(--warn); border-top-style: dashed; }
.ln.related { border-color: var(--muted); border-top-style: dotted; }
/* 关联视图撑满整页宽度、图区尽量用满纵向空间，避免右侧被裁切、页面留白浪费 */
#view-graph { max-width: none; }
.graph-wrap {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; position: relative; margin-bottom: 14px;
  height: calc(100vh / var(--ui-zoom) - 320px); min-height: 440px;
}
.graph-wrap svg { display: block; }
.g-edge-label { font-size: 10.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
/* 关系标签实底背景：与节点文字区隔开，避免关系名与项目名糊在一起；同样不拦截点击 */
.g-edge-bg { fill: var(--surface); stroke: var(--border); stroke-width: 0.75; pointer-events: none; }
.g-rubber { stroke: #2f6feb; stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
/* 分层背景带：把同一层级的项目圈在一起，并标注「第 N 层 · N 项」；未关联项目用虚线带区分 */
.g-band > rect { fill: var(--panel-2); stroke: var(--border); stroke-width: 1; }
.g-band-iso > rect { fill: var(--surface); stroke-dasharray: 6 4; }
.g-band-title { font-size: 12px; font-weight: 600; fill: var(--text-2); pointer-events: none; }
.g-band-hint { font-weight: 400; fill: var(--muted); font-size: 11px; }
.g-node { cursor: pointer; }
.g-node .g-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.g-node:hover .g-card { stroke: var(--primary); }
.g-node.focus .g-card { stroke: var(--primary); stroke-width: 2.5; }
/* 「刚从这里返回」的项目：返回后视图保持原样，只把它描一圈暖色，告诉用户"你在这儿" */
.g-node.visited .g-card { stroke: var(--warn); stroke-width: 2.5; }
.g-node.archived .g-card { stroke-dasharray: 5 3; }
/* 拖拽建立关联：拖中的落点目标节点描边高亮（虚线 + 加粗），提示松手即可建立关联 */
.g-node.link-target .g-card { stroke: #2f6feb; stroke-width: 2.5; stroke-dasharray: 5 3; }
.g-node .g-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.g-node .g-meta { font-size: 10.5px; fill: var(--muted); }
.g-node .g-pct { font-size: 10.5px; font-weight: 600; fill: var(--text-2); }
/* 悬停/单击某张卡片时：点亮它与它的直接关系，其余淡出，关系一眼可辨 */
.g-svg.has-focus .g-node:not(.hl) { opacity: .25; }
.g-svg.has-focus .g-edge:not(.hl) { opacity: .12; }
.g-svg.has-focus .g-band { opacity: .5; }
.g-svg .g-node, .g-svg .g-edge, .g-svg .g-band { transition: opacity .15s ease; }
.g-node.hl .g-card { stroke: var(--primary); stroke-width: 2.5; }
.g-edge.hl > path { stroke-width: 2.6; }
/* 从待办预警/关联视图跳转进详情后，短暂点亮目标那一条，明确「点的是哪一个」 */
@keyframes pm-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 235, 0); }
  15% { box-shadow: 0 0 0 3px rgba(47, 111, 235, .35); }
  60% { box-shadow: 0 0 0 3px rgba(47, 111, 235, .22); }
}
.pm-flash { animation: pm-flash 1.8s ease-out 1; border-radius: var(--radius); }

.relation-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(20, 26, 38, .38); display: grid; place-items: center;
  z-index: 50; padding: 20px;
}
/* 叠层弹窗（如摘录弹窗上再开「备注」/「确认删除」）：上层遮罩调浅，
   否则两层遮罩叠加会把下层的弹窗压得几乎看不见 */
.modal-layer + .modal-layer .mask { background: rgba(20, 26, 38, .2); }
.modal {
  background: var(--surface); border-radius: 12px; width: 480px; max-width: 100%; max-height: calc(86vh / var(--ui-zoom)); overflow: auto;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .22);
}
.modal.wide { width: 780px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text-2); }
.field .hint { font-size: 11px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.input { min-height: 84px; resize: vertical; font-family: inherit; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2328; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 100;
}
.preview-box { max-height: calc(70vh / var(--ui-zoom)); overflow: auto; }
.preview-box img { max-width: 100%; }
.preview-box iframe { width: 100%; height: calc(60vh / var(--ui-zoom)); border: 1px solid var(--border); border-radius: 8px; }
.preview-box pre { background: var(--panel-2); padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }

/* ---------- 回收站 ---------- */
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.trash-main { min-width: 0; }
.trash-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.trash-meta { font-size: 12px; }
.trash-ops { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- 待办预警 ---------- */
.rm-list { display: flex; flex-direction: column; gap: 16px; }
.rm-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rm-h { font-size: 13px; font-weight: 600; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); margin: 0; }
.rm-h .muted { font-weight: 400; }
.rm-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.rm-row:last-child { border-bottom: none; }
.rm-row:hover { background: var(--panel-2); }
.rm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: var(--muted); }
.rm-dot.red, .rm-red { color: #c0392b; }
.rm-dot.yellow, .rm-yellow { color: #b7791f; }
.rm-dot.red { background: #c0392b; }
.rm-dot.yellow { background: #dda90e; }
/* 「全部事项」模式下会把未到期的也列出来：给它们一个绿灯，与逾期/临期区分开 */
.rm-dot.green { background: #2e9e5b; }
/* 「显示已完成」：已完成项用灰绿点 + 降饱和度文字，排在各组末尾，不与待办抢注意力 */
.rm-dot.done { background: #8aa891; }
.rm-row-done .rm-title { color: var(--text-2); }
.rm-due.rm-done { color: var(--text-2); }
.rm-due.rm-done em { color: #5f8a68; }
.rm-main { flex: 1; min-width: 0; }
.rm-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-meta { font-size: 12px; }
.rm-due { font-size: 12px; text-align: right; flex-shrink: 0; color: var(--text-2); }
.rm-due em { display: block; font-style: normal; font-size: 12px; }
.nav-item em.red { background: #c0392b; color: #fff; }

/* 侧边栏数字角标（记事本待办到期数等）：0 时隐藏，有逾期标红 */
.nav-item em.nav-badge {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600;
  min-width: 18px; padding: 0 5px; line-height: 16px; border-radius: 9px; text-align: center;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border);
}
.nav-item em.nav-badge.hot { background: #c0392b; color: #fff; border-color: #c0392b; }
.nav-item.active em.nav-badge { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.nav-item.active em.nav-badge.hot { background: #c0392b; color: #fff; border-color: #c0392b; }

/* 项目详情页签数字徽标（事项 / 备注条数）：数量为 0 时隐藏，变化随详情重绘自动更新 */
.tab em.tab-badge {
  margin-left: 6px; font-style: normal; font-size: 11px; font-weight: 600;
  display: inline-block; vertical-align: 1px;
  min-width: 18px; padding: 0 5px; line-height: 16px; border-radius: 9px; text-align: center;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border);
}
.tab.active em.tab-badge { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ---------- 统计看板 ---------- */
.dash { display: flex; flex-direction: column; gap: 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi-v { font-size: 24px; font-weight: 600; line-height: 1.2; }
.kpi-l { font-size: 12px; color: var(--text-2); }
.kpi-s { font-size: 11px; color: var(--muted); }
.kpi.warn .kpi-v { color: #c0392b; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.dash-card h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bar-l { width: 68px; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.bar-track { flex: 1; height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--primary); }
.bar-v { width: 28px; text-align: right; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.trend { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.trend .col-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.trend .col-bars i { width: 5px; border-radius: 2px 2px 0 0; min-height: 2px; }
.trend .c1 { background: #85b7eb; }
.trend .c2 { background: #1d9e75; }
.trend .col span { font-size: 10px; color: var(--muted); }
.trend-legend { display: flex; gap: 12px; font-size: 11px; margin-top: 6px; }
.trend-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- 问题 / 创新模块 ---------- */
.tk-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tk-bar .tk-q { flex: 1 1 220px; min-width: 180px; }
.tk-grow { flex: 1; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 99px;
  padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.chip em { font-style: normal; color: var(--muted); margin-left: 4px; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.tk-summary { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

.tk-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; }
/* 表格取消 overflow:hidden 后，用首末单元格圆角保留外观，避免下拉菜单被裁切 */
.tk-table > thead > tr > th:first-child { border-top-left-radius: var(--radius); }
.tk-table > thead > tr > th:last-child { border-top-right-radius: var(--radius); }
.tk-table > tbody > tr:last-child > td:first-child { border-bottom-left-radius: var(--radius); }
.tk-table > tbody > tr:last-child > td:last-child { border-bottom-right-radius: var(--radius); }
.tk-table th, .tk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; vertical-align: middle; }
.tk-table th { background: var(--panel-2); color: var(--text-2); font-weight: 500; font-size: 12px; white-space: nowrap; }
.tk-table tbody tr:nth-child(even) { background: var(--row-alt); }
.tk-table tbody tr:hover { background: var(--panel-2); }
.tk-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.tk-table .sortable { cursor: pointer; }
.tk-table .sortable:hover { color: var(--primary); }
.tk-sub { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.tk-clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 长文本列：默认折叠若干行（问题内容/原因/结论 3 行，标题 2 行），点击「展开」看全文 */
.tk-cell-clamp {
  max-width: 320px; line-height: 1.5; white-space: normal; word-break: break-word;
  max-height: 4.5em; overflow: hidden; transition: max-height .15s ease;
}
.tk-cell-clamp.expanded { max-height: none; overflow: visible; }
/* 标题列：默认折叠 2 行（仅作用于标题链接，不影响下方标签换行） */
.tk-title-cell {
  display: inline-block; max-width: 240px; line-height: 1.5; white-space: normal; word-break: break-word;
  max-height: 3em; overflow: hidden; vertical-align: bottom;
}
.tk-title-cell.expanded { max-height: none; overflow: visible; }
/* 展开/收起 触发器（仅当内容确实溢出时由 JS 解除 hidden） */
.tk-expand {
  display: inline-block; margin-top: 2px; padding: 0; border: 0; background: none;
  color: var(--accent, #2b6cb0); cursor: pointer; font-size: 12px; line-height: 1.4;
}
.tk-expand:hover { text-decoration: underline; }
.tk-expand[hidden] { display: none; }

/* 记事本 */
.np-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.np-bar #np-q { flex: 1; min-width: 200px; max-width: 360px; }
.np-list { display: flex; flex-direction: column; gap: 10px; }
.np-row { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.np-row.np-fav { border-color: var(--warn); }
.np-row.np-done { opacity: .62; }
.np-row.np-done .np-title { text-decoration: line-through; color: var(--muted); }
.np-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.np-row-main { min-width: 0; flex: 1; }
.np-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.np-row-ops { position: relative; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
/* 三点的视觉样式统一在下方「全局⋯三点按钮」一处定义，这里只保留布局约束 */
.np-more { flex: none; }
.np-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 80;
  min-width: 160px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 26px rgba(20, 26, 38, .18); padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.np-menu[hidden] { display: none; }
.np-menu-info { padding: 6px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.np-menu-item {
  border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; width: 100%;
}
.np-menu-item:hover { background: var(--panel-2); }
.np-menu-item.danger { color: var(--danger); }
.np-menu-item.danger:hover { background: var(--danger-soft); }
.np-menu-item:disabled { opacity: .45; cursor: not-allowed; }
.np-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.np-row-content { font-size: 13.5px; color: var(--text-2); line-height: 1.7; word-break: break-word; max-height: 132px; overflow: hidden; position: relative; }
.np-row.np-expanded .np-row-content { max-height: none; overflow: visible; }
.np-row-content img { max-width: 100%; border-radius: 4px; margin: 4px 0; }
.np-row-content:empty { display: none; }
.np-row-content.np-clamp-mask::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 38px; background: linear-gradient(transparent, var(--panel)); }
.np-row-foot { display: flex; justify-content: flex-end; }
.np-meta-row { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.np-meta { white-space: nowrap; }
.np-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.np-seg-btn { border: none; background: transparent; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.np-seg-btn + .np-seg-btn { border-left: 1px solid var(--border); }
.np-seg-btn.active { background: var(--accent, #2b6cb0); color: #fff; }

/* 记事本：按日期归档目录 —— 资源管理器式树状结构：
   [−]/[+] 折叠钮 + 点状连接线 + 年/月日历图标 + 日文档图标，逐级缩进 */
.np-date-tree { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; }
.np-date-node { background: transparent; }
.np-date-head { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 2px; cursor: pointer; user-select: none; font-size: 14px; line-height: 20px; border-radius: 4px; }
.np-date-head:hover { background: var(--panel-2, #f3f5f8); }
/* [−]/[+] 折叠钮：小方块，展开显示 −，折叠显示 + */
.np-twist { flex: none; box-sizing: border-box; width: 14px; height: 14px; border: 1px solid var(--border-strong, #98a6b8); border-radius: 3px; background: var(--panel, #fff); position: relative; }
.np-twist::before { content: '\2212'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; font-weight: 600; color: var(--text-2, #5a6a7d); }
.np-date-node.np-date-collapsed > .np-date-head .np-twist::before { content: '+'; }
.np-date-node.np-date-collapsed > .np-date-body { display: none; }
/* 连接线：子节点区左侧点状竖线 + 每个子节点头部的肘形点状横线 */
.np-date-node > .np-date-body { position: relative; display: flex; flex-direction: column; gap: 2px; margin-left: 6px; padding: 2px 0 2px 24px; }
.np-date-node > .np-date-body::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 10px; border-left: 1px dotted var(--border-strong, #98a6b8); }
.np-date-body > .np-date-node > .np-date-head { position: relative; }
.np-date-body > .np-date-node > .np-date-head::before { content: ''; position: absolute; left: -18px; top: 9px; width: 16px; border-top: 1px dotted var(--border-strong, #98a6b8); }
/* 日节点的子级是记事行（非树节点），不再画连接线 */
.np-date-node[data-np-level="day"] > .np-date-body { padding: 4px 0 4px 20px; }
.np-date-node[data-np-level="day"] > .np-date-body::before,
.np-date-node[data-np-level="day"] .np-date-head::before { display: none; }
.np-date-body .np-row { box-shadow: none; }
.np-date-head .np-ico { flex: none; font-size: 14px; line-height: 1; }
.np-date-head .np-date-label { font-weight: 600; }
.np-date-node[data-np-level="day"] > .np-date-head { font-size: 13.5px; }
.np-date-node[data-np-level="day"] > .np-date-head .np-date-label { font-weight: 500; }
.np-date-head .np-meta { color: var(--muted); font-size: 12px; }
.np-date-head .np-date-count { margin-left: auto; font-weight: 400; color: var(--muted); }

/* 斑马纹：记事本列表（列表视图与按日期视图）隔行交替底色，提升可读性 */
.np-list > .np-row:nth-child(even),
.np-date-body > .np-row:nth-child(even) { background: rgba(43, 108, 176, 0.045); }

/* 检查落实页签：从巡检清单跳转过来时，高亮对应项点 */
.chk-flash { animation: chkFlash 1.6s ease-out; }
@keyframes chkFlash {
  0% { box-shadow: 0 0 0 3px var(--accent, #2b6cb0); background: rgba(43, 108, 176, 0.12); }
  100% { box-shadow: none; background: transparent; }
}

/* 记事本模板库 */
.npt-list { display: flex; flex-direction: column; gap: 10px; }
.npt-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; }
.npt-item-main { min-width: 0; flex: 1; }
.npt-name { font-weight: 600; font-size: 15px; }
.npt-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.npt-item-ops { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.npt-editor { display: flex; flex-direction: column; gap: 12px; }
.npt-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.npt-content { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.6; }
.reg-link-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.reg-link-item:hover { background: var(--panel-2, #f5f7fa); }

/* 记事本编辑页（参照 eDiary：突出内容、专注写作） */
.np-editor { display: flex; flex-direction: column; gap: 12px; }
.np-editor-title { font-size: 20px; font-weight: 600; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.np-editor-title:focus { border-color: var(--accent, #2b6cb0); outline: none; }
.np-rich { min-height: 320px; max-height: calc(60vh / var(--ui-zoom)); overflow: auto; line-height: 1.85; font-size: 15px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); outline: none; }
.np-rich:focus { border-color: var(--accent, #2b6cb0); }
.np-rich:empty:before { content: attr(data-placeholder); color: var(--muted); }
.np-rich img { max-width: 100%; border-radius: 4px; margin: 4px 0; }
.np-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.np-tb { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); cursor: pointer; color: var(--text); font-size: 14px; }
.np-tb:hover { background: var(--surface); border-color: var(--accent, #2b6cb0); }
.np-tb.active { background: var(--accent, #2b6cb0); color: #fff; border-color: var(--accent, #2b6cb0); }
.np-tb-sel { height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 0 6px; }
.np-tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.np-editor-count { text-align: right; color: var(--muted); font-size: 12px; margin-top: -6px; }
.np-editor-tags { display: flex; flex-direction: column; gap: 6px; }
.np-tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-tag-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft, #eef3fb); color: var(--accent, #2b5cb8); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.np-tag-chip button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: .7; }
.np-tag-chip button:hover { opacity: 1; }
.np-editor-meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.np-meta-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }

/* 巡检清单 */
.ins-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ins-groups { display: flex; flex-direction: column; gap: 16px; }
.ins-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.ins-group-head { padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-group .tk-table { border: 0; border-radius: 0; }
/* 巡检清单：可点击跳转的项目 / 事项名称 */
.ins-jump { color: var(--accent, #2b6cb0); cursor: pointer; }
.ins-jump:hover { text-decoration: underline; }
/* 项目级落实就地编辑行（检查人 / 落实状态 / 备注） */
.ins-proj-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel-2, #eef1f6); border-bottom: 1px solid var(--border); }
.ins-proj-row .muted { white-space: nowrap; }
.ins-proj-row .chk-status { flex: 0 0 auto; }
.ins-proj-row .chk-checker { flex: 0 0 120px; }
.ins-proj-row .chk-note { flex: 1 1 220px; min-width: 160px; }
.ins-groups .tk-table .chk-status, .ins-groups .tk-table .chk-checker { max-width: 130px; }
.ins-groups .tk-table .chk-note { min-width: 120px; }
/* 落实情况下拉改多选 → 一排 checkbox */
.ins-st-list { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ins-st-pick { white-space: nowrap; }
.ins-st-pick input { margin-right: 4px; }
/* 事项前「选择」列：默认全选，取消勾选的整行淡出（导出将不含） */
.ins-pick { text-align: center; }
.ins-group tr.ins-off td { opacity: .45; }
.ins-group tr.ins-off td.ins-pick { opacity: 1; }
.ins-group tr.ins-off td:not(.ins-pick) { text-decoration: line-through; text-decoration-color: var(--muted); }
/* 事项未把当前车站列入检查范围：该行弱化显示，落实状态 / 检查人 / 备注 三列以「—」占位（不显示可编辑字段） */
.ins-group tr.ins-out td { background: rgba(150, 160, 175, .06); }
.ins-group tr.ins-out .ins-na, .ins-na { color: var(--muted); text-align: center; }
.ins-proj-row .ins-na { flex: 1 1 auto; }
.badge.ck-done { background: var(--ok); color: #fff; }
.badge.ck-partial { background: var(--warn); color: #fff; }
.badge.ck-undone { background: var(--danger); color: #fff; }
.badge.ck-unchecked { background: var(--muted); color: #fff; }
.tk-bulk { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.tk-bulk .input-sm { width: auto; min-width: 90px; }
.tk-ops { position: relative; white-space: nowrap; }
/* 三点的视觉样式统一在下方「全局⋯三点按钮」一处定义，这里只保留布局约束 */
.tk-more { flex: none; }
.tk-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 80;
  min-width: 152px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 26px rgba(20, 26, 38, .18); padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.tk-menu[hidden] { display: none; }
.tk-menu-item {
  border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; width: 100%;
}
.tk-menu-item:hover { background: var(--panel-2); }
.tk-menu-item.danger { color: var(--danger); }
.tk-menu-item.danger:hover { background: var(--danger-soft); }
.tk-menu-item:disabled { opacity: .45; cursor: not-allowed; }
.bulk-row td { background: var(--panel-2); }

.tk-ops .link { margin-right: 6px; }
.tk-pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.tk-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tk-detail-title { font-size: 16px; font-weight: 600; }
.tk-flow { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-comment { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; background: var(--panel-2); }
.tk-comment-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.tk-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; max-height: 190px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

.badge.s-open { background: #fdf0e3; color: var(--warn); }
.badge.s-in_progress { background: var(--primary-soft); color: var(--primary); }
.badge.s-closed { background: #eef1f5; color: var(--muted); }
.badge.s-draft { background: #eef1f5; color: var(--text-2); }
.badge.s-submitted { background: var(--primary-soft); color: var(--primary); }
.badge.s-approved { background: #e6f5ee; color: var(--ok); }
.badge.s-rejected { background: var(--danger-soft); color: var(--danger); }
.badge.s-implementing { background: #fdf0e3; color: var(--warn); }
.badge.s-implemented { background: #e6f5ee; color: var(--ok); }

/* ============================================================
   主题切换：在 <html> 上设置 data-theme 即可整站换肤
   ① 默认（蓝·浅） = 无 data-theme 或 data-theme="default"
   ② 深邃（深色） = data-theme="dark"
   ③ 青绿（Emerald·浅） = data-theme="emerald"
   ④ 暖橙（Amber·浅） = data-theme="amber"
   ⑤ 科技（深空·深色） = data-theme="tech"
   ⑥ 可爱（糖果·浅色） = data-theme="cute"
   ⚠️ 新增主题 = 这里加一组变量 + app.js 的 THEMES 加一条（名称 / 色标 / 预览色 / 是否深色），
      以及 index.html 头部内联脚本里的标题栏色表（否则启动瞬间会闪一下错误的窗口色）。
   ============================================================ */
[data-theme="dark"] {
  --bg: #14171c; --panel: #1c2027; --panel-2: #232832; --border: #2c323c;
  --text: #e6e9ee; --text-2: #aeb6c2; --muted: #7b8492;
  --primary: #4c8dff; --primary-soft: rgba(76, 141, 255, .16); --primary-d: #3a76e6;
  --danger: #ff6b6b; --danger-soft: rgba(255, 107, 107, .14); --ok: #3fb27f; --warn: #e0a23a;
  --shadow: none;
  --surface: #232832; --track: #2c323c;
  --row-alt: #20252e;
}
[data-theme="dark"] .badge, [data-theme="tech"] .badge { background: var(--panel-2) !important; }
[data-theme="dark"] .toast { background: #2a2f3a; }

[data-theme="emerald"] {
  --primary: #0e9f8a; --primary-soft: #e2f5f1; --primary-d: #0b8977;
  --ok: #0e9f8a;
}

[data-theme="amber"] {
  --primary: #e07b1a; --primary-soft: #fdeede; --primary-d: #c96a12;
  --warn: #b8860b;
}

/* ⑤ 科技：深空底色 + 青蓝主色。所有颜色仍走同一组变量，因此组件层零改动；
   另加极轻的径向光晕与冷色描边，做出"屏幕/仪表"的科技观感，不影响文字对比度。 */
[data-theme="tech"] {
  --bg: #0b1220; --panel: #101a2c; --panel-2: #152238; --border: #22314d;
  --text: #e4f1ff; --text-2: #9fb6d6; --muted: #6d84a6;
  --primary: #22d3ee; --primary-soft: rgba(34, 211, 238, .15); --primary-d: #12b8d1;
  --danger: #ff5f8f; --danger-soft: rgba(255, 95, 143, .16); --ok: #34d399; --warn: #fbbf24;
  --shadow: 0 1px 0 rgba(34, 211, 238, .06), 0 10px 28px rgba(0, 0, 0, .5);
  --surface: #152238; --track: #1d2c45; --row-alt: #121e33;
}
[data-theme="tech"] body {
  background-image:
    radial-gradient(1100px 520px at 10% -12%, rgba(34, 211, 238, .12), transparent 62%),
    radial-gradient(900px 460px at 102% -6%, rgba(139, 92, 246, .12), transparent 58%);
  background-attachment: fixed;
}
[data-theme="tech"] .brand-mark,
[data-theme="tech"] .tb-mark { box-shadow: 0 0 14px rgba(34, 211, 238, .5); }
[data-theme="tech"] .nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .32), 0 0 16px rgba(34, 211, 238, .16);
}
[data-theme="tech"] .panel { border-color: rgba(34, 211, 238, .14); }
[data-theme="tech"] .toast { background: #17233a; }
/* .btn-danger 的边框色是硬编码的浅粉，深色底上会亮得突兀，跟着主题走 */
[data-theme="dark"] .btn-danger,
[data-theme="tech"] .btn-danger { border-color: rgba(255, 107, 107, .38); }
/* 亮青底 + 白字对比不足，主色按钮改深色字（科技主题的主色是"亮"，不是"深"） */
[data-theme="tech"] .btn-primary,
[data-theme="tech"] .btn.active { color: #04222b; font-weight: 600; }

/* ⑥ 可爱：奶白粉底 + 糖果粉主色，圆角加大、按钮与徽标改胶囊。
   只动"形状与色"，不动字号与间距，避免挤压已有布局。 */
[data-theme="cute"] {
  --bg: #fff7fb; --panel: #ffffff; --panel-2: #fdf2f8; --border: #f7dbe8;
  --text: #4a2b3a; --text-2: #85616f; --muted: #b394a1;
  --primary: #f472b6; --primary-soft: #fde7f3; --primary-d: #e35ba3;
  --danger: #e8557f; --danger-soft: #ffe6ee; --ok: #35b98a; --warn: #e09a35;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(244, 114, 182, .1), 0 10px 24px rgba(244, 114, 182, .1);
  --surface: #ffffff; --track: #fbe4ef; --row-alt: #fff5fa;
}
[data-theme="cute"] body {
  background-image:
    radial-gradient(900px 420px at 6% -10%, #ffe9f4, transparent 62%),
    radial-gradient(760px 380px at 100% -4%, #eef4ff, transparent 58%);
  background-attachment: fixed;
}
[data-theme="cute"] .btn,
[data-theme="cute"] .badge { border-radius: 999px; }
/* 亮粉底配白字对比偏低，主色按钮改深棕字：既清楚，也是糖果色卡片的常见配法 */
[data-theme="cute"] .btn-primary,
[data-theme="cute"] .btn.active { color: #43202f; font-weight: 600; }
[data-theme="cute"] .panel { border-radius: 16px; }
[data-theme="cute"] .sidebar { background: linear-gradient(180deg, #fff3f9, #ffffff 42%); }
[data-theme="cute"] .brand-mark {
  border-radius: 11px;
  background: linear-gradient(135deg, #f472b6, #fb923c);
}

/* ---------- 主题选择器：底部设置栏入口 + 卡片网格（弹窗 / 设置中心共用） ---------- */
/* 入口不再是侧栏上方独立一行，而是与「⚙ 设置」并排的小链接：
   只显示当前主题名与色标，主题再多也只是一行文字，不会把界面上方撑长。 */
.foot-theme { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; max-width: 100%; }
.foot-theme-ico { font-size: 12px; line-height: 1; }
.foot-theme-name {
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px;
}
.theme-open-dot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
/* 界面显示比例入口：与主题入口同排，只显示当前百分比 */
.foot-zoom { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.foot-zoom-ico { font-size: 12px; line-height: 1; }
.foot-zoom span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
/* 文档工具入口（格式转换 / 文件对比降级到这里） */
.foot-tools { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.foot-tools-ico { font-size: 12px; line-height: 1; }

/* 侧栏底部系统小条目：通知 / 回收站不占分组标题，一行两列小按钮 */
.nav-mini {
  display: flex; gap: 4px; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border);
}
.nav-mini .nav-item { flex: 1; justify-content: center; gap: 5px; font-size: 12px; padding: 5px 6px; color: var(--muted); }
.nav-mini .nav-item span { width: auto; }
.nav-mini .nav-item em { margin-left: 2px; }
.nav-mini .nav-item:hover { color: var(--text); }

/* 组合入口的页签栏：分析（统计看板 / 数据洞察 / 最近动态）、落实台账（督办检查 / 巡检清单） */
.subtabs {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px;
}
.subtabs[hidden] { display: none; }
.subtab {
  border: 0; background: none; padding: 5px 13px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* 显示比例面板：一排档位按钮 + 当前值，选完不关闭窗口，方便连续微调 */
.zoom-pane .muted { margin-bottom: 10px; }
.zoom-pane .zoom-now { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.zoom-pane .zoom-now b { font-size: 20px; color: var(--text); margin-left: 6px; font-variant-numeric: tabular-nums; }
.zoom-presets { display: flex; flex-wrap: wrap; gap: 8px; }

/* 工具弹窗：两张卡片（格式转换 / 文件对比），点一下进对应视图 */
.tool-pane .muted { margin-bottom: 12px; }
.tool-list { display: grid; gap: 8px; }
.tool-card {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.tool-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.tool-ico { font-size: 18px; line-height: 1.2; flex: none; }
.tool-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-txt b { font-size: 13px; }
.tool-txt .muted { font-size: 12px; }
.zoom-presets .zoom-step {
  min-width: 64px; padding: 7px 10px; cursor: pointer;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.zoom-presets .zoom-step:hover { border-color: var(--primary); color: var(--primary); }
.zoom-presets .zoom-step.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.zoom-pane .hint { margin-top: 10px; font-size: 12px; color: var(--muted); }

.theme-pane .muted { margin-bottom: 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 620px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme-card {
  display: flex; flex-direction: column; gap: 7px; padding: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.theme-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
/* 缩略图：左窄条=侧栏、两条灰线=正文、彩色胶囊=主色按钮。颜色全部来自卡片内联的 --tc-* */
.tc-preview {
  position: relative; display: block; height: 58px; border-radius: 7px; overflow: hidden;
  background: var(--tc-bg); border: 1px solid var(--border);
}
.tc-side { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; background: var(--tc-panel); border-right: 1px solid var(--tc-line); }
.tc-bar, .tc-line2 { position: absolute; left: 40%; height: 6px; border-radius: 99px; background: var(--tc-line); }
.tc-bar { top: 15px; width: 46%; }
.tc-line2 { top: 26px; width: 32%; }
.tc-btn { position: absolute; left: 40%; top: 37px; width: 24%; height: 10px; border-radius: 99px; background: var(--tc-primary); }
.tc-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.tc-meta b { font-weight: 600; color: var(--text); }
.tc-meta em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); }

/* 导入数据包：逐项目决策弹窗 */
.imp-list { display: flex; flex-direction: column; gap: 10px; max-height: calc(56vh / var(--ui-zoom)); overflow: auto; }
.imp-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.imp-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.imp-check input { width: 16px; height: 16px; }
.imp-counts { font-size: 12px; margin: 4px 0 0 24px; }
.imp-new { font-size: 12px; margin: 4px 0 0 24px; }
.imp-warn { font-size: 12px; color: var(--warn, #b8860b); margin: 6px 0 0 24px; font-weight: 600; }
.imp-strat { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 24px; }
.imp-strat label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.imp-strat-sel { flex: 1; max-width: 520px; }
.imp-strat-sel:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 车站多选（落实范围） ---------- */
.stations-pick { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface); }
.sp-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sp-tools .sp-filter { width: 160px; flex: 1; }
.sp-count { margin-left: auto; white-space: nowrap; }
.sp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 10px; max-height: 240px; overflow: auto; }
.sp-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }

/* ---------- 机构管理 ---------- */
.org-add { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.org-add .input-sm { width: auto; flex: 1; }
.org-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.org-col h4 { margin: 0 0 8px; font-size: 13px; }
.org-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: var(--surface); }
.org-name { font-size: 13px; }
.org-ops { display: flex; gap: 6px; }

/* ---------- 检查落实 ---------- */
.chk-table td .input-sm { width: 100%; }
.chk-table td { vertical-align: top; }
/* 备注列：多行自适应、完整显示；最小宽度保证可读，长文本在列内换行不挤压其他字段 */
.chk-table th:nth-child(4), .chk-table td:nth-child(4) { min-width: 200px; width: 34%; }
textarea.chk-note {
  resize: vertical;
  min-height: 30px;
  max-height: 200px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  font-family: inherit;
}
.kpi.ok .kpi-v { color: var(--ok); }
.kpi.warn .kpi-v { color: var(--warn); }
.kpi.bad .kpi-v { color: var(--danger); }
.badge.chk-done { background: #e6f5ee; color: var(--ok); }
.badge.chk-partial { background: #fdf0e3; color: var(--warn); }
.badge.chk-undone { background: var(--danger-soft); color: var(--danger); }
.badge.chk-unchecked { background: var(--panel-2); color: var(--muted); }

/* 督办检查：聚合行可点击下钻 + 展开面板 */
.sp-click { cursor: pointer; }
.sp-click:hover td { background: var(--panel-2); }
.sp-click.sp-active td { background: var(--panel-2); font-weight: 600; }
.sp-drill h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-drill { border: 1px dashed var(--border); border-radius: var(--radius); padding: 4px 14px 10px; margin-top: 14px; background: var(--surface); }

@media (max-width: 1100px) { .org-cols { grid-template-columns: 1fr; } }

/* ============================================================
   评审优化：信息架构分组 / 分段状态 / 热力矩阵 / 趋势坐标轴
   / 命令面板 / Tab 横向滚动 / 空态 CTA / KPI 可点击
   ============================================================ */

/* 侧栏分组 */
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  font-size: 10px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase;
  padding: 8px 10px 2px; font-weight: 600;
}
.nav-item .nav-ico {
  width: 18px; text-align: center; display: inline-block; flex: 0 0 18px;
  font-size: 13px; line-height: 1;
}

/* 列表页分段状态控制 */
.list-seg {
  display: inline-flex; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.list-seg button {
  border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.list-seg button.on { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.list-seg button .seg-cnt { font-size: 11px; color: var(--muted); margin-left: 4px; }
.list-seg button.on .seg-cnt { color: var(--primary); }

/* 督办热力矩阵 */
.matrix-scroll { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.chk-matrix { border-collapse: collapse; width: 100%; font-size: 12px; }
.chk-matrix th, .chk-matrix td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; white-space: nowrap; }
.chk-matrix thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; color: var(--text-2); font-weight: 500; }
.chk-matrix tbody th { position: sticky; left: 0; background: var(--panel-2); z-index: 1; text-align: left; font-weight: 600; color: var(--text-2); }
.chk-matrix td.cell { cursor: default; color: #fff; font-weight: 600; }
.chk-matrix td.cell.none { background: var(--panel-2); color: var(--muted); font-weight: 400; }
.chk-matrix td.cell .rate-sub { display: block; font-size: 9px; font-weight: 400; opacity: .85; }

/* 趋势图坐标轴与数值 */
.trend-card { display: flex; flex-direction: column; }
.trend-axis { display: flex; align-items: stretch; gap: 8px; }
.trend-y {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  font-size: 9px; color: var(--muted); padding: 0 2px; min-width: 26px; flex: 0 0 auto;
}
.trend-y i { font-style: normal; }
.trend-inner { flex: 1; min-width: 0; }
.trend-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 18px; pointer-events: none; }
.trend-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); }
.trend-wrap { position: relative; }
.trend .col-bars i { position: relative; }
.trend-val { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 8px; color: var(--text-2); white-space: nowrap; }

/* 看板 KPI 可点击下钻 */
.kpi.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi.clickable::after { content: " ›"; color: var(--primary); font-weight: 700; }

/* 命令面板 */
.palette-input { width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font-size: 15px; outline: none; }
.palette-list { max-height: calc(60vh / var(--ui-zoom)); overflow: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.palette-item .pi-ico { width: 20px; text-align: center; color: var(--muted); }
.palette-item .pi-hint { margin-left: auto; font-size: 11px; color: var(--muted); }
.palette-item.active, .palette-item:hover { background: var(--primary-soft); color: var(--primary); }
.palette-item.active .pi-ico, .palette-item:hover .pi-ico { color: var(--primary); }
.palette-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* 详情 Tab 横向滚动 */
.tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.tab { white-space: nowrap; flex: 0 0 auto; }
.tabs-scroll-hint { font-size: 11px; color: var(--muted); margin-left: auto; align-self: center; }

/* 空态首屏引导 */
.empty-cta { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-cta .ec-emoji { font-size: 40px; }
.empty-cta h3 { font-size: 16px; color: var(--text-2); margin: 12px 0 6px; }
.empty-cta p { font-size: 13px; margin-bottom: 16px; }
.empty-cta .btn { display: inline-block; }
/* 空库第一屏的定位句：整屏最大的一行字，比下面那句"先记下一件事"还显眼。
   第一次打开的人只会记住这一句，所以它必须是产品的一句话价值，不能是功能说明。 */
.empty-cta .first-run-say { font-size: 20px; font-weight: 600; color: var(--text); margin: 6px 0 18px; }

/* ============================================================
   新增功能样式：今日聚焦 / 日程甘特 / 数据洞察 / 风险 / 通知 / 设置
   智能新建 / 个人周报 / 撤销条 / 附件预览
   ============================================================ */

/* 今日聚焦 */
/* 今日聚焦首行：先说人话（今天几件事），数字统计退到下面那行小字。
   字号刻意比正文大一档——它是整屏的"标题句"，用户扫一眼就能决定要不要往下看。 */
.focus-say { font-size: 18px; line-height: 1.45; font-weight: 600; margin: 2px 0 12px; color: var(--text); }
.focus-summary { padding: 10px 14px; background: var(--panel-2); border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.focus-list { display: flex; flex-direction: column; gap: 8px; }
.focus-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.focus-item.overdue { border-color: var(--danger, #d94a4a); }
.focus-item .fi-main { flex: 1; min-width: 0; }
.focus-item .fi-title { font-weight: 600; font-size: 14px; }
.focus-item .fi-sub { font-size: 12px; margin-top: 3px; }
.focus-item .fi-sub.danger { color: var(--danger, #d94a4a); }

/* 日程甘特 */
.gantt { overflow: auto; padding: 12px; }
.gt-wrap { min-width: 760px; }
/* 月份表头：左列标签 + 右侧月份刻度（与下方竖线对齐） */
.gt-head { display: grid; grid-template-columns: 220px 1fr; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.gt-head-label { font-size: 11px; color: var(--muted); }
.gt-head-months { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.gt-head-months span { position: absolute; top: 0; transform: translateX(2px); white-space: nowrap; }
.gt-rows { position: relative; display: flex; flex-direction: column; }
.gt-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.gt-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.gt-track { position: relative; height: 22px; background: var(--panel-2); border-radius: 6px; }
.gt-bar { position: absolute; top: 3px; height: 16px; border-radius: 4px; background: var(--primary); min-width: 4px; }
/* 项目条内的浅色进度填充 */
.gt-bar i { display: block; height: 100%; border-radius: inherit; background: rgba(255, 255, 255, 0.4); }
.gt-bar.gt-overdue { background: var(--danger, #d94a4a); }
.gt-bar.gt-soon { background: #d4b106; }
.gt-bar.gt-done { background: #17915c; }
.gt-bar.gt-milestone { background: #c8811a; height: 10px; top: 6px; }
/* S15：关键路径（橙色描边 + 虚线）+ 传导延期（红色描边 + 推迟天数徽标） */
.gt-bar.gt-critical { box-shadow: 0 0 0 2px #e8730a; outline: 1px dashed #e8730a; outline-offset: 1px; }
.gt-bar.gt-late { background: var(--danger, #d94a4a); box-shadow: 0 0 0 2px #b13030; }
.gt-bar .gt-delay { position: absolute; right: 2px; top: -14px; font-size: 10px; font-weight: 600; color: var(--danger, #d94a4a); white-space: nowrap; }
/* S15：前置依赖编辑器 */
.dep-editor { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.dep-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.dep-row .dep-name { flex: 1 1 auto; min-width: 0; }
.dep-row .dep-type { flex: none; }
/* 条尾日期标注（MM-DD 或 MM-DD~MM-DD） */
.gt-bar-label { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; pointer-events: none; }
/* 月份分界竖线 + 今天参考线（绝对定位覆盖在行区上，左列 220px 之外按百分比折算） */
.gt-vline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--border); pointer-events: none; }
/* S16：工时填报弹窗 */
.wl-list { display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow: auto; margin-bottom: 8px; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.wl-row .wl-owner { flex: none; font-weight: 600; }
.wl-row .wl-date { flex: none; color: var(--muted); }
.wl-row .wl-hours { flex: none; color: var(--primary, #2f6fed); font-weight: 600; }
.wl-row .wl-note { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.wl-sum { margin-bottom: 10px; font-size: 13px; }
.wl-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.wl-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.wl-form .wl-note-lab { flex: 1 1 200px; }
/* S16：负荷热力 */
.lh-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.lh-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: middle; }
.lh-legend .lh-cool { background: #cfe3fb; } .lh-legend .lh-warm { background: #ffd591; }
.lh-legend .lh-hot { background: #ff9c6e; } .lh-legend .lh-over { background: #e05555; }
.lh-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border); border-radius: 8px; }
.lh-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.lh-table th, .lh-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: center; }
.lh-table .lh-name { text-align: left; font-weight: 600; white-space: nowrap; background: var(--panel-2, rgba(0,0,0,.03)); }
.lh-cell { min-width: 64px; }
.lh-cell.cool { background: #cfe3fb; } .lh-cell.warm { background: #ffd591; }
.lh-cell.hot { background: #ff9c6e; color: #fff; } .lh-cell.over { background: #e05555; color: #fff; font-weight: 700; }
.lh-sum { font-weight: 700; background: var(--panel-2, rgba(0,0,0,.03)); }
.lh-overload { margin-top: 10px; color: var(--danger, #d94a4a); font-size: 12.5px; }
.lh-ok { margin-top: 10px; color: var(--ok, #3d9a50); font-size: 12.5px; }
.gt-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--danger, #d94a4a); opacity: 0.5; pointer-events: none; }
.gt-legend { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.gt-legend .gt-bar { position: static; display: inline-block; width: 22px; height: 12px; vertical-align: middle; }

/* 计划日历（月历看板） */
.cal { padding: 12px; }
.cal-month-title { font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-week { padding: 6px 8px; font-size: 12px; color: var(--muted); background: var(--panel-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.cal-cell { min-height: 88px; padding: 4px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:hover { background: var(--panel-2); }
/* 周末列淡黄底色（同参考界面） */
.cal-cell.weekend { background: rgba(212, 177, 6, 0.07); }
.cal-cell.out { opacity: 0.4; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-d { font-size: 12.5px; font-weight: 600; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; flex: none; }
.cal-cell.today .cal-d { background: var(--primary); color: #fff; }
.cal-items { display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-width: 0; }
.cal-chip { font-size: 11px; line-height: 1.5; padding: 1px 6px; border-radius: 4px; background: var(--primary-soft, rgba(47, 111, 235, 0.12)); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip:hover { text-decoration: underline; }
.cal-chip.overdue { background: rgba(217, 74, 74, 0.14); color: var(--danger, #d94a4a); }
.cal-chip.done { opacity: 0.55; text-decoration: line-through; }
.cal-chip.milestone { background: rgba(200, 129, 26, 0.14); }
/* 风险 / 问题 / 创新的截止日也进日历（统一计划项取数后新增） */
.cal-chip.risk { background: rgba(217, 74, 74, 0.10); }
.cal-chip.issue { background: rgba(80, 120, 200, 0.14); }
.cal-chip.idea { background: rgba(90, 170, 120, 0.14); }
.cal-more { font-size: 10.5px; color: var(--muted); }
.cal-panel { margin-top: 14px; }
.cal-panel h2 { font-size: 14px; margin: 0 0 8px; }
.cal-hint { font-size: 12.5px; margin-top: 10px; }

/* 数据洞察 */
.ins-section { margin-bottom: 22px; }
.ins-section h2 { font-size: 14px; margin: 0 0 10px; color: var(--text-2); }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ins-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface); }
.ins-grade { font-size: 26px; font-weight: 800; line-height: 1; }
.ins-card.g-A { border-color: #17915c; } .ins-card.g-A .ins-grade { color: #17915c; }
.ins-card.g-B { border-color: #2f6feb; } .ins-card.g-B .ins-grade { color: #2f6feb; }
.ins-card.g-C { border-color: #c8811a; } .ins-card.g-C .ins-grade { color: #c8811a; }
.ins-card.g-D { border-color: #d94a4a; } .ins-card.g-D .ins-grade { color: #d94a4a; }
.ins-name { font-weight: 600; margin: 6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-meta { font-size: 11px; }
.risk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.risk-table th, .risk-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.risk-table th { background: var(--panel-2); color: var(--text-2); font-weight: 600; }
/* 长文本列（风险描述 / 应对措施）允许换行：全局视图里一行被拉得很宽，单行截断反而看不全 */
.risk-table .risk-cell { white-space: normal; word-break: break-word; max-width: 340px; }
.risk-table .rt-ops { white-space: nowrap; width: 1%; }
.dc-item { margin-bottom: 10px; }
.dc-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.dc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.impacted-item { padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.weekly-box { background: var(--panel-2); border-radius: 10px; padding: 12px; }
.weekly-box pre { white-space: pre-wrap; margin: 0 0 10px; font-size: 13px; line-height: 1.6; }

/* 工时投入与燃尽 */
.labor-grid { display: flex; flex-direction: column; gap: 8px; }
.labor-row { display: grid; grid-template-columns: 160px 1fr 120px; align-items: center; gap: 10px; font-size: 13px; }
.labor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.labor-bars { position: relative; height: 18px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.labor-bar { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px; transition: width .2s; }
.labor-est { background: #2f6feb; opacity: .35; }
.labor-act { background: #17915c; }
.labor-num { text-align: right; color: var(--text-2); font-size: 12px; }
.labor-total { margin-top: 6px; font-size: 13px; color: var(--text-2); }

/* 通知中心 */
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notif-item { padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--primary); background: var(--surface); font-size: 13px; }
.notif-item.lv-red { border-left-color: var(--danger, #d94a4a); }
.notif-item.lv-orange { border-left-color: #c8811a; }
.notif-item.lv-yellow { border-left-color: #d4b106; }
.notif-time { font-size: 11px; margin-top: 3px; }
.notif-actions { margin-top: 12px; display: flex; gap: 8px; }

/* 设置中心 */
.member-list { display: flex; flex-direction: column; gap: 6px; }
.set-panel { padding: 8px 0; }
/* 设置中心：面板内按钮组（主题选择与侧栏/弹窗共用 .theme-grid / .theme-card，此处不再单独定义） */
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#set-panel .field { margin-bottom: 12px; }
#set-panel .input { width: 100%; }
#set-panel .kv { grid-template-columns: 84px 1fr; }
/* 权限矩阵（S12）：全局角色行 + 两张只读矩阵表 */
.perm-role-list { display: flex; flex-direction: column; gap: 6px; }
.perm-role-row { display: flex; align-items: center; gap: 10px; }
.perm-role-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-role-row .input { width: 140px; flex: none; }
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.perm-matrix-col h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.perm-table th, .perm-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.perm-table th { color: var(--muted); font-weight: 500; }
.perm-table td:nth-child(2) { white-space: nowrap; }

/* 撤销条 */
.undo-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 14px; border-radius: 10px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 60; font-size: 13px; }
.undo-bar[hidden] { display: none; }
.undo-bar .btn { background: rgba(255,255,255,.18); color: #fff; border: 0; }

/* 智能新建 */
.smart-new .hint { font-size: 11px; }

/* 附件预览缩略 */
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.row-thumb { flex: 0 0 auto; }
.file-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }
.file-thumb.file-pdf { display: inline-flex; align-items: center; justify-content: center; background: #d94a4a; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.row-main { flex: 1; min-width: 0; }

/* 命令面板批量项 */
.palette-item .pi-ico { width: 20px; text-align: center; color: var(--muted); }
.palette-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }


/* ================= 规章制度 ================= */
.regs-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.regs-toolbar .input[type="search"] { flex: 1; }

/* 状态徽章 */
.reg-st-ok { background: #e6f6ee !important; color: #17915c !important; }
.reg-st-rev { background: #fff4e0 !important; color: #c8811a !important; }
.reg-st-dead { background: var(--panel-2) !important; color: var(--muted) !important; text-decoration: line-through; }

/* 检索聚合结果 */
.reg-hit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.reg-hit-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.reg-hit-head b { font-size: 14px; }
/* 折叠按钮与制度名：制度名可点（就地展开该制度），折叠只影响结果卡片本身 */
.reg-hit-fold {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 6px; font: inherit; font-size: 12px; line-height: 1; padding: 2px 7px; cursor: pointer; flex: none;
}
.reg-hit-fold:hover { border-color: var(--primary); color: var(--primary); }
.reg-hit-name { cursor: pointer; font-size: 14px; }
.reg-hit-name:hover { color: var(--primary); text-decoration: underline; }
.reg-hit.is-folded .reg-hit-body { display: none; }
.reg-hit-file { padding: 8px 0 2px; }
.reg-hit-fname { cursor: pointer; }
.reg-hit-fname:hover { color: var(--primary); }
.reg-file-ico { margin-right: 2px; }
.reg-snippet { font-size: 12.5px; color: var(--text-2); padding: 3px 6px 3px 10px; cursor: pointer; line-height: 1.7; border-radius: 6px; }
.reg-snippet:hover { background: var(--panel-2); }
/* 命中序号：与命中导航条的「第 N / M 处」严格同序，点进去前就知道自己看到第几处 */
.reg-snippet-no {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  font-size: 11px; font-weight: 600;
}
/* 从原文返回后高亮「刚才点的那一条」，用户一眼看到自己看到哪儿了 */
.reg-snippet.is-cur { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.reg-snippet.is-cur .reg-snippet-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.reg-kw-inline { color: var(--primary); }
.reg-snippet mark, .reg-hit mark { background: #ffe58f; color: inherit; padding: 0 1px; border-radius: 2px; }

/* 详情：文件表 */
.reg-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.reg-table th, .reg-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.reg-table th { background: var(--panel-2); color: var(--text-2); font-weight: 600; font-size: 12px; }
.reg-table tr:last-child td { border-bottom: 0; }
/* 斑马间隔色：隔行浅底，长文件列表更易于逐行阅读 */
.reg-table tbody tr:nth-child(even) { background: var(--panel-2); }
/* 文件名即预览入口：可点击，hover 高亮提示 */
.reg-file-name { cursor: pointer; }
.reg-file-name:hover { color: var(--primary); text-decoration: underline; }
.reg-file-ops { white-space: nowrap; }
/* 文件表改为「文件名 / 操作」两列后，操作列右对齐，文件名占据剩余宽度 */
.reg-table td.rt-ops { text-align: right; white-space: nowrap; width: 1%; }

/* 预览 */
.reg-preview-box { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.reg-preview-title { padding: 8px 12px; font-size: 12.5px; color: var(--text-2); background: var(--panel-2); border-bottom: 1px solid var(--border); }
.reg-frame { width: 100%; height: 560px; border: 0; background: #fff; }

/* 备注 */
.reg-note-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.reg-note-form-ops { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; align-items: center; }
.reg-note-list { display: flex; flex-direction: column; gap: 8px; }
.reg-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.reg-note-meta { margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 对比 */
.compare-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.df-table, .df-merged { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.df-table th, .df-table td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; line-height: 1.7; }
.df-table th { background: var(--panel-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.df-table td:nth-child(2), .df-table td:nth-child(4) { width: 38%; }
.df-table td:nth-child(1), .df-table td:nth-child(3) { width: 12%; white-space: nowrap; color: var(--muted); font-size: 12px; }
.df-click { cursor: pointer; border-radius: 4px; }
.df-click:hover { background: var(--panel-2); }
.df-del td { background: rgba(217, 74, 74, .07); }
.df-ins td { background: rgba(23, 145, 92, .08); }
.df-mod td { background: rgba(200, 129, 26, .07); }
.df-del .df-click, .df-row.df-del .df-click { color: #b23a3a; }
.df-ins .df-click, .df-row.df-ins .df-click { color: #157a4e; }
mark.df-old { background: #ffd7d7; color: #a03030; text-decoration: line-through; padding: 0 2px; border-radius: 2px; }
mark.df-new { background: #d1f0df; color: #106b45; padding: 0 2px; border-radius: 2px; }
.df-row { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); align-items: baseline; }
.df-row > div { flex: 1; line-height: 1.7; }
.df-badge { width: 64px; flex: none; text-align: center; }
.df-b-ins { background: #d1f0df !important; color: #106b45 !important; }
.df-b-del { background: #ffd7d7 !important; color: #a03030 !important; }
.df-b-mod { background: #ffe9c2 !important; color: #a36708 !important; }
.df-row.df-del { background: rgba(217, 74, 74, .05); }
.df-row.df-ins { background: rgba(23, 145, 92, .06); }
.df-row.df-mod { background: rgba(200, 129, 26, .05); }

/* ---- 对比优化：工具条 / 忽略项 / 显示切换 / 导航 / 摘要 ---- */
/* 工具条（含上一处/下一处导航）固定在滚动视口顶部，向下翻找变化时按钮始终可点 */
.compare-tools { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 10px 8px; margin: 0 -2px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.compare-tools::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: linear-gradient(var(--surface), transparent); pointer-events: none; }
.df-tools-label { font-size: 12px; color: var(--muted); }
.df-ignore { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.df-ignore input { accent-color: var(--primary); cursor: pointer; }
.df-disp { margin: 0; }
.df-nav { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.df-nav .muted { font-size: 12px; min-width: 92px; text-align: center; }
.df-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 4px 2px; }
.df-summary-empty { color: var(--green, #17915c); font-weight: 600; }
.df-summary-tip { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.df-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); transition: transform .08s ease; }
.df-chip:hover { transform: translateY(-1px); }
.df-chip b { font-size: 13px; }
.df-chip.c-mod { color: #a36708; border-color: #f0d29a; background: rgba(200, 129, 26, .08); }
.df-chip.c-ins { color: #157a4e; border-color: #a9e0c4; background: rgba(23, 145, 92, .08); }
.df-chip.c-del { color: #b23a3a; border-color: #f0b4b4; background: rgba(217, 74, 74, .08); }
.df-chip.c-eq { color: var(--muted); }
/* 折叠的相同段分隔条 */
.df-eq-fold { text-align: center; color: var(--muted); font-size: 12px; padding: 5px 10px; background: var(--panel-2); border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.df-table tr.df-eq-fold td { background: var(--panel-2); color: var(--muted); text-align: center; font-size: 12px; }
/* 变化块高亮闪动（导航定位时） */
.df-change.df-flash { outline: 2px solid var(--primary); outline-offset: -2px; animation: dfFlash 1.4s ease; }
@keyframes dfFlash { 0% { box-shadow: 0 0 0 3px rgba(33, 118, 220, .35); } 100% { box-shadow: 0 0 0 3px rgba(33, 118, 220, 0); } }

/* ---- 对比：整合对照文档（单一可读文档，行内标注 删除/新增/修改） ---- */
.df-integrated { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; line-height: 1.95; font-size: 14px; max-height: calc(72vh / var(--ui-zoom)); overflow: auto; }
.df-ip { margin: 0 0 9px; padding: 1px 0; color: var(--text); }
.df-ip-eq { white-space: pre-wrap; }
.df-ip-del, .df-ip-ins, .df-ip-mod { border-left: 3px solid var(--border); padding-left: 10px; margin-left: 2px; }
.df-ip-del { background: rgba(217, 74, 74, .04); }
.df-ip-ins { background: rgba(23, 145, 92, .05); }
.df-ip-mod { background: rgba(200, 129, 26, .04); }
.df-tag { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
.df-ip-del .df-tag { background: #ffd7d7; color: #a03030; }
.df-ip-ins .df-tag { background: #d1f0df; color: #106b45; }
.df-ip-mod .df-tag { background: #ffe9c2; color: #a36708; }
.df-del-text { color: #a03030; text-decoration: line-through; background: #fff0f0; padding: 0 2px; border-radius: 2px; }
.df-ins-text { color: #106b45; text-decoration: underline; background: #eefaf3; padding: 0 2px; border-radius: 2px; }
/* 整合对照文档图例：一眼看懂三类变化标识 */
.df-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.df-legend .df-leg { display: inline-flex; align-items: center; gap: 5px; }
.df-legend i { width: 22px; height: 0; border-top-width: 3px; border-top-style: solid; display: inline-block; }
.df-leg-eq { border-top-color: var(--border); }
.df-leg-del { border-top-color: #a03030; }
.df-leg-ins { border-top-color: #106b45; }
.df-leg-mod { border-top-color: #a36708; }
.ds-int-fmt { font-size: 13px; color: var(--text-2); }
.ds-note { font-size: 12px; margin-top: 4px; }


/* ================= 规章制度：树形 / 分类 / 批量 / 对比工作台 / 预览 ================= */
.btn-xs { padding: 2px 7px; font-size: 11.5px; border-radius: 6px; }
.flex-1 { flex: 1; }

/* 树形工具条 */
.reg-tree-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.reg-tree { display: flex; flex-direction: column; gap: 8px; }

.reg-tree-cat { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.reg-node { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; }
.reg-node + .reg-node { border-top: 1px dashed var(--border); }
.reg-node-cat { background: var(--panel-2); font-weight: 600; }
.reg-node-reg { background: var(--surface); }
.reg-node-file { font-size: 12.5px; color: var(--text-2); }
.reg-node:hover { background: var(--panel-2); }
.reg-node-cat:hover { background: var(--panel-2); }
.rt-arrow { width: 16px; text-align: center; cursor: pointer; user-select: none; color: var(--muted); flex: none; }
.rt-arrow:hover { color: var(--primary); }
.rt-ico { flex: none; }
.rt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-open { cursor: pointer; }
.rt-open:hover { color: var(--primary); text-decoration: underline; }
.rt-count { font-style: normal; font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 9px; padding: 0 6px; }
.rt-meta { font-size: 11.5px; }
.rt-check { flex: none; margin: 0; }

/* 制度行的「勾选框」与「状态 / 文号 · N 文件 · N 备注」默认隐藏：
   列表平时只剩「箭头 + 制度名 + ⋯」，需要时从页头「⋯」菜单里打开常显（.show-check / .show-meta），
   信息类内容另外做了悬停制度名即临时露出，兼顾「界面干净」与「随手可查」。 */
.reg-tree .rt-check { display: none; }
.reg-tree.show-check .rt-check { display: inline-block; }
.reg-tree .reg-node-reg .badge,
.reg-tree .reg-node-reg .rt-meta { display: none; }
.reg-tree.show-meta .reg-node-reg .badge { display: inline-flex; }
.reg-tree.show-meta .reg-node-reg .rt-meta { display: inline; }
.reg-tree .reg-node-reg .rt-name:hover ~ .badge { display: inline-flex; }
.reg-tree .reg-node-reg .rt-name:hover ~ .rt-meta { display: inline; }

.reg-node-ops { margin-left: auto; display: flex; gap: 8px; flex: none; opacity: .55; transition: opacity .15s; }
.reg-node:hover .reg-node-ops { opacity: 1; }
.reg-node-ops .link { font-size: 12px; }
.reg-tree-kids { display: flex; flex-direction: column; }
.reg-tree-reg { display: flex; flex-direction: column; }
.reg-tree-reg + .reg-tree-reg { border-top: 1px solid var(--border); }
.reg-node-reg { padding-left: 26px; }
/* 制度行斑马纹：偶数行铺一层底色，与文件表的隔行底色保持同一节奏 */
.reg-tree-kids > .reg-tree-reg:nth-child(even) > .reg-node-reg { background: var(--panel-2); }
/* 斑马纹行自己的 hover：底色相同再叠一层极淡的着色，保证「悬停有反馈」且四种主题都成立 */
.reg-tree-kids > .reg-tree-reg:nth-child(even) > .reg-node-reg:hover {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 999px rgba(127, 140, 160, 0.08);
}

/* 页头「⋯ 更多」：视觉样式统一在下方「全局⋯三点按钮」，这里只保留 details 的结构约束 */
.head-more { display: inline-block; }
.head-more-btn { list-style: none; }
.head-more-btn::-webkit-details-marker { display: none; }
/* 制度行 / 文件行的「⋯」：视觉样式同上（菜单定位沿用 row-more 的 fixed 机制） */

/* 预览面板 */
.reg-preview-box { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.reg-preview-title {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px;
  color: var(--text-2); background: var(--panel-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 4;
}
/* 预览区文件名：纵列布局下横向空间充裕，但仍限宽，避免长名挤压查找框与操作按钮 */
.rp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52%; flex: none; }
.rp-ops { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
/* 预览区页内查找 */
.rpv-find { display: flex; align-items: center; gap: 6px; }
.rpv-find .input { width: 156px; }
.rpv-hit { font-size: 11.5px; color: var(--muted); min-width: 38px; text-align: center; }
.rp-tagi { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.rp-close { color: var(--danger); border-color: #f0c9c9; }
.reg-frame { width: 100%; height: calc(min(78vh, 880px) / var(--ui-zoom)); border: 0; background: #fff; display: block; }

/* 预览主体：目录栏（可折叠） + 舞台（iframe） */
.rp-body { display: flex; align-items: stretch; min-height: 0; }
.rp-stage { flex: 1 1 auto; min-width: 0; }
.rp-outline {
  flex: 0 0 250px; max-height: calc(min(78vh, 880px) / var(--ui-zoom)); overflow: auto;
  border-right: 1px solid var(--border); background: var(--panel-2);
  display: flex; flex-direction: column;
}
.rp-outline[hidden] { display: none; }
.rpo-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--panel-2); z-index: 2;
}
.rpo-list { padding: 4px; display: flex; flex-direction: column; }
.rpo-item {
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--text-2);
  padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rpo-item:hover { background: var(--surface); color: var(--primary); }
.rpo-item.on { background: var(--primary-soft); color: var(--primary); }
.rpo-item.lv1 { padding-left: 8px; font-weight: 600; }
.rpo-item.lv2 { padding-left: 20px; }
.rpo-item.lv3 { padding-left: 32px; font-size: 12px; }

/* 阅读设置条 */
.rp-reader-bar { padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.rp-reader-bar[hidden] { display: none; }
.rp-rd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.rp-rd-lab { color: var(--muted); }
.rp-rd-hint { font-size: 11.5px; }
.rp-rg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.rp-rb {
  border: 0; background: none; font: inherit; font-size: 12px; cursor: pointer; padding: 3px 9px;
  color: var(--text-2); border-right: 1px solid var(--border);
}
.rp-rg .rp-rb:last-child { border-right: 0; }
.rp-rb:hover { background: var(--panel-2); }
.rp-rb.on { background: var(--primary); color: #fff; }

/* 段落导航条 */
.rp-para-bar {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface); font-size: 12px;
}
.rp-para-bar[hidden] { display: none; }
.rp-para-lab { color: var(--muted); }
.rp-para-input { width: 72px; }

/* 对比工作台 */
.df-side {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 7px 10px; min-width: 280px; flex: 1;
}
.df-side-label { font-size: 11.5px; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 1px 6px; }
.df-side-ops { margin-left: auto; display: flex; gap: 8px; }
.df-side-ops .link { font-size: 12px; }
.df-run { display: flex; gap: 6px; }
.df-keepbar {
  display: flex; flex-direction: column; gap: 6px; margin: 8px 0;
  border: 1px dashed #e6b64c; background: rgba(230, 182, 76, .12);
  border-radius: var(--radius); padding: 8px 12px; font-size: 12.5px;
}
.df-keepbar > span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 对比文件选择器 */
.rdp-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.rdp-bar .input { flex: 1; }
.rdp-list { max-height: calc(46vh / var(--ui-zoom)); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.rdp-group + .rdp-group { border-top: 1px solid var(--border); }
.rdp-gname { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--panel-2); padding: 5px 10px; position: sticky; top: 0; }
.rdp-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 22px;
  font-size: 12.5px; cursor: pointer; border-top: 1px dashed var(--border);
}
.rdp-item:hover { background: var(--primary-soft); }
.rdp-item > span:last-child { margin-left: auto; }

/* 失败明细（批量上传/导入未成功的项） */
.fail-list { margin: 8px 0 4px; padding-left: 20px; max-height: calc(42vh / var(--ui-zoom)); overflow: auto; }
.fail-list li { font-size: 12.5px; color: var(--text-2); line-height: 1.9; word-break: break-all; }
.reg-file-ops .link[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 录入向导：拖拽上传区 / 就地新建分类 / 更多信息折叠 ---------- */
.file-drop { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--panel-2); }
.file-drop.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.file-drop-input { display: none; }
.file-drop-zone { display: flex; align-items: center; gap: 8px; padding: 14px 12px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.file-drop-zone .fd-ico { font-size: 18px; }
.file-chips { padding: 0 12px 10px; font-size: 12px; line-height: 1.8; word-break: break-all; }
.combo-new { margin-top: 6px; }
.adv-box { margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 10px; }
.adv-box > summary { cursor: pointer; font-size: 12.5px; color: var(--primary); padding: 2px 0; user-select: none; }
.adv-inner { padding-top: 8px; }

/* ---------- 行内展开面板：头部就地改 + 左列表右预览（原详情页已并入列表） ---------- */
.reg-inline-slot { display: none; }
.reg-inline-slot.is-open { display: block; }
.reg-inline-panel {
  margin: 2px 0 10px 22px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 10px 14px 12px;
}
.reg-inline-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 10px;
}
.rdb-item { display: flex; align-items: center; gap: 6px; }
.rdb-item .input { min-width: 120px; }
.rdb-tip { font-size: 11.5px; }
.reg-inline-sec { margin-bottom: 12px; }
.reg-inline-sec:last-child { margin-bottom: 0; }
.reg-sec-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
/* 折叠区（备注 / 对比）共用：标题即开关，带 ▸/▾ 指示；默认折叠，面板更短 */
details.reg-inline-sec > summary.reg-sec-title { cursor: pointer; user-select: none; list-style: none; }
details.reg-inline-sec > summary.reg-sec-title::-webkit-details-marker { display: none; }
details.reg-inline-sec > summary.reg-sec-title::before { content: '▸ '; }
details.reg-inline-sec[open] > summary.reg-sec-title::before { content: '▾ '; }
/* 预览与文件表「纵列式」排列：文件表在上、预览在下，文件名与预览上下相邻（而非左右并排） */
.reg-work { display: flex; flex-direction: column; gap: 12px; }
.reg-work-list { min-width: 0; }
#reg-preview { width: 100%; min-width: 0; }
.reg-work #reg-preview .reg-preview-box { margin-top: 0; }

/* ---------- 工具栏「更多」折叠 ---------- */
.bar-more { position: relative; }
.bar-more > summary { list-style: none; cursor: pointer; }
.bar-more > summary::-webkit-details-marker { display: none; }
.bar-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 8px; min-width: 168px;
}
.bar-more-menu .btn { justify-content: flex-start; }

/* ---------- 行内「⋯」更多操作（文件行 / 制度行共用，低频操作收进来，行内保持干净） ---------- */
.row-more { position: relative; display: inline-block; }
.row-more > summary { list-style: none; cursor: pointer; }
.row-more > summary::-webkit-details-marker { display: none; }
/* 坐标由 JS（placeRowMore）按按钮位置写入。必须 fixed：祖先 .reg-table / .reg-tree-cat 带
   overflow:hidden，absolute 会被裁掉（菜单显示不全、点不到）。 */
.row-more-menu {
  position: fixed; left: 0; top: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px 8px; min-width: 128px; text-align: left;
}
.row-more-menu .link { text-align: left; white-space: nowrap; }
/* 菜单里的纯文字说明（来源 / 创建 / 最后修改）：允许换行、比操作项更淡，只作背景信息 */
.row-more-info { max-width: 240px; padding: 3px 2px 5px; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: normal; }
.row-more-info + .link { border-top: 1px solid var(--border); padding-top: 6px; }
/* 文件行操作区在面板表格中共用：表格里没有 .reg-node 祖先，需常显（否则恒为半透明） */
.reg-node-ops.reg-file-ops { opacity: 1; }

/* ---------- 全局「⋯」三点按钮：统一弱化（唯一真源） ----------
   三点是**低频入口**（重命名 / 下载 / 删除 / 导出 / 上传都收在里面），不该跟正文和主按钮抢视觉。
   改前各样：制度行是裸字符、记事本是 30×28 描边方块（悬停还变实心主色）、问题创新又是另一个方块、
   文件行是 12px 蓝链 —— 同一类操作长了四种脸，而且方块那种比正文还显眼。
   现在统一成：无边框无底色、灰色、半透明，悬停才提亮到正文色 + 一层极浅底。
   ⚠️ 要调三点的外观只改这一处，别在 .np-more / .tk-more 里另加样式。 */
.row-more-btn,
.head-more-btn,
.np-more,
.tk-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; height: auto; min-width: 0;
  padding: 2px 5px; border: 0; border-radius: 6px; box-shadow: none;
  background: none; color: var(--muted); opacity: .55;
  font-size: 16px; line-height: 1; letter-spacing: 1px;
  cursor: pointer; user-select: none;
}
.row-more-btn:hover,
.head-more-btn:hover,
.np-more:hover,
.tk-more:hover,
details.row-more[open] > .row-more-btn,
details.bar-more[open] > .head-more-btn {
  opacity: 1; color: var(--text); background: var(--panel-2);
}
/* 制度行 / 文件行的三点在 .reg-node-ops 里：容器本身已做 .55 → 1 的淡出，
   再叠一次透明度会淡到几乎看不见 —— 透明度交给容器统一负责；
   字号也要在这里压回来，否则会被更具体的 `.reg-node-ops .link{font-size:12px}` 盖掉。 */
.reg-node-ops .row-more-btn { opacity: 1; font-size: 16px; padding: 2px 5px; }
.row-more-btn:focus-visible,
.head-more-btn:focus-visible,
.np-more:focus-visible,
.tk-more:focus-visible { opacity: 1; color: var(--text); outline: 2px solid var(--primary); outline-offset: 1px; }

/* ================= 检索命中：关键词可点 / 命中导航 / 摘录 ================= */

/* 片段里**每一处**关键词都做成独立可点入口（点多处命中时点哪一处就定位到哪一处） */
.reg-kw {
  cursor: pointer; background: #ffe58f; color: inherit; padding: 0 1px; border-radius: 2px;
  border-bottom: 1px dotted #c9a227;
}
.reg-kw:hover { background: #ffd54f; }
.reg-kw-cur { background: #ff9f43 !important; color: #3a2000; font-weight: 600; }
.reg-snippet { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reg-snippet-txt { flex: 1 1 auto; min-width: 0; }
.reg-snippet-meta { font-size: 11.5px; white-space: nowrap; }
.reg-snippet-save { font-size: 12px; white-space: nowrap; }
.reg-snippet-save.is-saved { color: var(--muted) !important; cursor: default; }
.reg-hit-file-ops { margin-left: 8px; }
.reg-hit-file-ops .link { font-size: 12px; }

/* 命中导航已搬进预览 iframe 的浮标（.pv-hitnav / p.rg-hit-para 都在后端版式模板里）。
   这里只留「返回检索结果」那一行的提示文字样式。 */
.rdb-search-tip { font-size: 11.5px; }
/* 面板底部合并行：上传文件 · 状态/分类 · 快速备注 · 编辑更多信息 */
.reg-inline-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.reg-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reg-status-row .rdb-item .input { min-width: 120px; }
/* 文件名突出：文件表首列加粗放大（面板最上方就是文件名，一眼能看到是哪份文件） */
.reg-file-name { font-weight: 600; font-size: 13.5px; }

/* 预览里被定位到的那一处关键词：闪一下，便于在长文里一眼看到 */
mark.rg-jump { animation: rg-jump-flash 1.4s ease-out 2; }
@keyframes rg-jump-flash {
  0% { background: #ff9f43; box-shadow: 0 0 0 4px rgba(255, 159, 67, .45); }
  100% { background: #ffe58f; box-shadow: 0 0 0 0 rgba(255, 159, 67, 0); }
}

/* 对比：某侧正在解析本地文件 */
.df-side.is-busy { border-color: #e6b64c; background: rgba(230, 182, 76, .12); }
.df-busy { font-size: 12.5px; color: #a36708; }

/* ---------- 检索摘录弹窗 ---------- */
.exc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.exc-bar .input { min-width: 220px; }
.exc-list { max-height: calc(56vh / var(--ui-zoom)); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* 分组（按关键词 / 按制度）：组头常驻吸顶，组体可折叠 */
.exc-group + .exc-group { border-top: 1px solid var(--border); }
.exc-group-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2); background: var(--panel-2);
  padding: 5px 10px; border-bottom: 1px solid var(--border);
}
.exc-g-arrow {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px;
  font: inherit; font-size: 11px; line-height: 1; padding: 2px 6px; cursor: pointer; flex: none;
}
.exc-g-arrow:hover { border-color: var(--primary); color: var(--primary); }
.exc-g-name { font-size: 12.5px; color: var(--text); }
.exc-g-count { font-style: normal; font-size: 11.5px; }
.exc-group.is-closed .exc-group-body { display: none; }
.exc-tag { color: var(--text-2); }
.exc-meta > span { margin-right: 10px; }
.exc-note-txt { color: var(--primary); }

.exc-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-bottom: 1px dashed var(--border); }
.exc-row:last-child { border-bottom: 0; }
.exc-main { flex: 1; min-width: 0; }
.exc-text { font-size: 13px; line-height: 1.75; color: var(--text); word-break: break-word; }
.exc-text mark { background: #ffe58f; color: inherit; padding: 0 1px; border-radius: 2px; }
.exc-meta { font-size: 11.5px; margin-top: 3px; word-break: break-all; }
.exc-ops { display: flex; gap: 8px; white-space: nowrap; }
.exc-ops .link { font-size: 12px; }
/* 旧版摘录组头类名（.exc-reg）保留一个等价样式，避免外部样式/旧断言找不到元素 */
.exc-reg {
  position: sticky; top: 0; z-index: 1; font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--panel-2); padding: 5px 10px; border-bottom: 1px solid var(--border);
}

/* ---------- 格式转换（独立工具视图） ---------- */
.conv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.conv-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; min-width: 0;
}
.conv-card-h { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.conv-card p { margin: 8px 0 0; font-size: 11.5px; line-height: 1.7; }
.conv-fmt { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9; }
.conv-fmt li { margin: 0; }
.conv-steps { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.85; }
.conv-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 10px;
}
.conv-to-lab { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.conv-drop {
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--panel-2);
  padding: 22px 16px; text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 12px;
  transition: border-color .15s, background .15s;
}
.conv-drop.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--panel-2)); }
.conv-drop-ico { font-size: 22px; line-height: 1.2; margin-bottom: 4px; }
.conv-drop .muted { font-size: 11.5px; margin-top: 4px; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) 158px minmax(0, 1.2fr) auto;
  align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px;
}
.conv-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-status { font-size: 12px; min-width: 0; }
.conv-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.conv-to { min-width: 0; }
@media (max-width: 900px) {
  .conv-row { grid-template-columns: minmax(0, 1fr); }
  .conv-ops { justify-content: flex-start; }
}

/* ---------------- 已保存对比管理弹窗 ---------------- */
.ds-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-toolbar .ds-search { flex: 1; min-width: 180px; }
.ds-toolbar .ds-when { width: auto; }
.ds-toolbar .flex-1 { flex: 1; }
.ds-count { font-size: 12px; }
.ds-list { max-height: calc(52vh / var(--ui-zoom)); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-table th, .ds-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: middle; line-height: 1.6; }
.ds-table th { background: var(--panel-2); color: var(--text-2); font-size: 12px; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.ds-table tr:hover td { background: var(--panel-2); }
.ds-table .ds-c { width: 34px; text-align: center; }
.ds-table .ds-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ds-table .ds-ops { white-space: nowrap; }
.ds-table .ds-ops .link { margin-right: 8px; font-size: 12.5px; }
.ds-list .empty { padding: 28px 16px; text-align: center; }


/* ---------- 备注 ↔ 记事本共享（同一份内容、多处一致） ---------- */
.note-head-ops { display: inline-flex; gap: 8px; flex-wrap: wrap; }
/* 共享备注只用一道极窄的左边线提示「这条有出处」，来源文字与操作都已收进 ⋯ 菜单 */
.note-shared { border-left: 3px solid var(--primary); }

.np-row.np-shared { border-color: var(--primary); }
.np-share-badge { background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.np-share-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; }
.np-share-bar.np-share-empty { border-top: none; padding-top: 0; }
.np-share-item { background: var(--row-alt); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: var(--text-2); }
.np-row.np-flash { animation: npFlash 1.8s ease; }
@keyframes npFlash { 0%, 100% { background: var(--panel); } 20%, 60% { background: var(--primary-soft); } }

.npick-hint { line-height: 1.7; margin-bottom: 8px; }
.npick-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: var(--panel-2); }
.npick-row { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.npick-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.npick-title { font-size: 13px; font-weight: 600; color: var(--text); }
.npick-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.npick-foot { margin-top: 10px; }

.share-panel { display: flex; flex-direction: column; gap: 6px; }
.share-sec-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 6px; }
.share-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 8px; background: var(--panel-2); }
.share-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px dashed var(--border); }
.share-row:last-child { border-bottom: none; }
.share-where { flex: 1; font-size: 13px; }
.share-add { display: flex; gap: 8px; align-items: center; }
.share-add .input { flex: 1; max-width: 320px; }

/* ---------- 事项列表：斑马纹交替行（含子任务），去掉卡片化外框，便于横向扫读 ---------- */
.task-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.task-list > .row {
  border: none; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 0;
  background: transparent;
}
.task-list > .row.sub { margin-left: 22px; background: transparent; }
.task-list > .row:nth-child(odd) { background: var(--row-alt); }
.task-list > .row:last-child { border-bottom: none; }
.task-list > .row:hover { background: var(--primary-soft); }
.tk-owner { color: var(--text-2); }

/* 工作项清单分组小标题（里程碑 / 事项） */
.tk-subhead { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .3px; margin: 0 0 6px 2px; }
.tk-subhead-gap { margin-top: 16px; }
/* 里程碑行：橙色左竖条 + 徽标，与事项在同一清单里仍可一眼区分。
   用 inset 阴影而非 border-left —— border 会占宽度，里程碑行的勾选框会比事项行右移 3px，
   同一清单里两个勾选框列对不齐。 */
.task-list > .row.tk-ms-row { box-shadow: inset 3px 0 0 var(--ms-accent, #e08a2e); }
.badge.ms-badge { background: rgba(224, 138, 46, .14); color: var(--warn); border-color: rgba(224, 138, 46, .32); }
.ms-hint { font-size: 12px; margin: -6px 0 12px 2px; line-height: 1.6; }

/* ---------- 详情页签：核心页签常显，次要页签收进「其他」 ---------- */
.tabs { flex-wrap: wrap; }
.tabs-more { display: contents; }
.tabs-more[hidden] { display: none; }
.tab-more { color: var(--text-2); }
.tab-more::after { content: ' ▾'; font-size: 10px; opacity: .8; }
.tab-more.open { color: var(--primary); }
.tab-more.open::after { content: ' ▴'; }
/* 分组按钮（推进 / 记录）：仍是页签长相，右侧小三角暗示下面还有一层 */
.tab-grp::after { content: ' ▾'; font-size: 9px; opacity: .5; }
.tab-grp.active::after { opacity: .9; }
/* 分组副行（第 9 批）：占满整行，做成胶囊条，和首行页签明确区分成两层；
   边框交给它，首行在同层显示时去掉底边，避免出现两条平行线。 */
#d-tabs { overflow: visible; } /* 早期为横向滚动加的 overflow 会裁掉第二排，这里放开 */
.tabs-sub {
  flex: 0 0 100%; display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 0 10px; border-bottom: 1px solid var(--border);
}
.tabs-sub[hidden] { display: none; } /* 作者样式会压过 UA 的 [hidden]，必须显式补 */
#d-tabs.with-sub { border-bottom: 0; }
.tab.sub {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--panel-2); font-size: 12px; line-height: 1.5;
}
.tab.sub[hidden] { display: none; }
.tab.sub.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
  font-weight: 600;
}
/* 概览页签：自动汇总说明条 + 历史手工值标注（S11） */
.ov-auto-hint {
  font-size: 12px; color: var(--text-2); background: var(--panel-2);
  border: 1px dashed var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}
.ov-sum { align-items: center; }
.ov-sum .muted { font-size: 11px; }
.ov-hist {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 99px; font-size: 11px;
  border: 1px dashed var(--warn); color: var(--warn); cursor: help;
}
/* 加权进度标记（S13）：实线，与"历史数据"的虚线警告区分开 */
.ov-hist.ov-weighted { border-style: solid; border-color: var(--primary); color: var(--primary); }
.badge.ov-od { background: var(--danger-soft); color: var(--danger); }
.ov-weight-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }

/* ---------- 计划基线 / 偏差（S14） ---------- */
#ov-baseline-sec .bl-rows { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.bl-row { font-size: 12.5px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.bl-tag { flex: 0 0 auto; font-size: 10.5px; padding: 0 6px; border-radius: 99px; line-height: 16px; }
.bl-row.bl-add .bl-tag { background: var(--ok-soft); color: var(--ok); }
.bl-row.bl-rem .bl-tag { background: var(--danger-soft); color: var(--danger); }
.bl-row.bl-chg .bl-tag { background: var(--warn-soft); color: var(--warn); }
.bl-type { flex: 0 0 auto; color: var(--text-2); font-size: 11px; }
.bl-list { display: flex; flex-direction: column; gap: 8px; }
.bl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.bl-item-main { font-size: 13px; }

/* ---------- 督办清单折叠块 ---------- */
.chk-block-head { display: flex; align-items: center; gap: 8px; }
.chk-block-head .chk-fold {
  flex: 0 0 auto; width: 20px; height: 20px; line-height: 18px; padding: 0; border: none; background: transparent;
  color: var(--text-2); font-size: 12px; cursor: pointer; border-radius: 4px;
}
.chk-block-head .chk-fold:hover { background: var(--border); color: var(--text); }
.chk-block-head h3 { margin: 0; }
.chk-tools { display: flex; gap: 6px; }

/* ============================================================
   自定义标题栏（Window Controls Overlay）
   仅在 PWA 应用窗口（display_override: window-controls-overlay）激活时显示。
   背景取侧栏底色 --panel，与界面顶条同色；右侧为系统最小化/最大化/关闭按钮
   （由 env(titlebar-area-*) 预留，不绘制、不可交互）。
   ============================================================ */
#titlebar {
  display: none; /* 非 WCO（普通浏览器/未激活叠加层）时隐藏，不占用布局 */
  position: fixed; top: 0;
  left: env(titlebar-area-x, 0);
  width: env(titlebar-area-width, 100%);
  height: env(titlebar-area-height, 0px);
  z-index: 60;
  align-items: center; gap: 10px;
  padding: 0 160px 0 14px; /* 右侧 160px 避让系统窗口控件 */
  background: var(--panel);
  color: var(--text);
  font-weight: 600; font-size: 13px;
  user-select: none;
  /* 让整条标题栏可拖动窗口；内部交互元素单独 no-drag */
  app-region: drag;
  -webkit-app-region: drag;
  border-bottom: 1px solid var(--border);
}
#titlebar .tb-mark {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  app-region: no-drag; -webkit-app-region: no-drag;
}
#titlebar .tb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* WCO 激活：主区域下移到标题栏之下，并隐藏侧栏里重复的品牌块 */
body.wco #titlebar { display: flex; }
body.wco .app {
  height: calc((100vh - env(titlebar-area-height, 0px)) / var(--ui-zoom));
  margin-top: calc(env(titlebar-area-height, 0px) / var(--ui-zoom));
}
body.wco .brand { display: none; }
/* 标题栏高度作为一个可读变量，供需要时引用（保持与 env 一致） */
:root { --tb-h: env(titlebar-area-height, 0px); }

/* 事项与子任务页顶部：项目描述
   不画框、不写「项目描述」标签 —— 它就是列表前的一段引言，只用略淡的字色与行高融进页面；
   想要强调的项目描述在「概览」页签里另有独立区块（#d-panel 概览的 h2「项目描述」）。 */
.task-proj-desc { white-space: pre-wrap; margin: 2px 0 16px; font-size: 13px; line-height: 1.75; color: var(--text-2); }

/* 计划日历：本月概览（原「今天/逾期/已完成/里程碑/记事」色块图例与独立月份大标题已移除） */
.cal-summary { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.cal-summary b { color: var(--text); }

/* 文件对比：文件变化点汇总 */
.cc-summary { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.cc-title { font-size: 14px; margin: 0 0 10px; }
.cc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.cc-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; }
.cc-card .cc-num { font-size: 20px; font-weight: 700; }
.cc-card .cc-lab { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cc-card.c-mod .cc-num { color: #c8811a; }
.cc-card.c-ins .cc-num { color: #17915c; }
.cc-card.c-del .cc-num { color: #d94a4a; }
.cc-block { border-top: 1px solid var(--border); padding: 8px 0; }
.cc-block > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.cc-block[open] > summary { color: var(--text); }
.cc-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.cc-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.cc-table td:first-child { color: var(--text-2); width: 42%; }
.cc-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.6; }
.cc-idx { flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center; background: var(--panel-2); border-radius: 50%; font-size: 11px; color: var(--text-2); }
.cc-txt { white-space: pre-wrap; flex: 1; }
.cc-pos { flex: none; font-size: 11px; }
.cc-mod-old { color: #d94a4a; }
.cc-mod-new { color: #17915c; }

/* 已保存对比导出选项 */
.ds-export-opts { padding: 4px 2px; }
.ds-export-opts .check { display: block; margin: 10px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ================= S19 / S20 / S21（第 5 批） ================= */

/* --- S21：附件版本徽标 + 版本弹窗 --- */
.att-ver {
  display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 10px; line-height: 16px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); vertical-align: 1px;
}
.ver-row { padding: 8px 10px; }
.ver-cur { background: var(--panel-2); border-radius: 8px; }

/* --- S21：在线预览（文本 / 表格 / Word 段落） --- */
.pv-pre {
  max-height: 60vh; overflow: auto; font-size: 12px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-all; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0;
}
.pv-table-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.pv-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.pv-table td, .pv-table th {
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 5px 8px; text-align: left; vertical-align: top; max-width: 320px; word-break: break-all;
}
.pv-table thead th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; }
.pv-doc { max-height: 60vh; overflow: auto; font-size: 13px; line-height: 1.7; padding: 2px 4px; }
.pv-doc p { margin: 4px 0; }
.pv-doc .pv-h { margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
.pv-badge { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 10px; line-height: 16px; }
.pv-new { background: rgba(46, 160, 67, 0.15); color: #1a7f37; border: 1px solid rgba(46, 160, 67, 0.4); }
.pv-skip { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.pv-wbs { white-space: nowrap; font-family: Consolas, monospace; color: var(--muted); }

/* --- S20：提醒日志 --- */
.nt-log { max-height: 200px; overflow: auto; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.nt-log-row { padding: 4px 8px; background: var(--panel-2); border-radius: 6px; }
.nt-log-time { color: var(--muted); font-family: Consolas, monospace; }

/* --- S21：界面密度档（紧凑） ---
 * 只压行距与留白，不动字号（可读性优先）；scope 到 html[data-density=compact]，舒适档零改动。 */
html[data-density='compact'] .row { padding: 4px 8px; margin-bottom: 3px; }
html[data-density='compact'] .row-sub { display: inline; margin-left: 8px; }
html[data-density='compact'] .section { margin-bottom: 10px; }
html[data-density='compact'] .plist-row { padding-top: 4px; padding-bottom: 4px; }
html[data-density='compact'] .tk-table td { padding-top: 3px; padding-bottom: 3px; }

/* --- 记事本图片编辑器（尺寸 / 裁剪 / 旋转 / 压缩质量） ---
 * 全部用主题变量，6 套主题自动适配；高度用 calc(... / var(--ui-zoom))，
 * 因为 vh 不随 zoom 缩放（125% 时裸 vh 会把弹窗顶出视口）。 */
.modal.imged-modal { width: min(1080px, 96vw); }
.modal.imged-modal .modal-body { overflow: hidden; padding: 12px 14px; }
.imged { display: flex; gap: 12px; height: calc(64vh / var(--ui-zoom)); min-height: 360px; }
.imged-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.imged-stage {
  position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel-2);
}
.imged-canvas {
  max-width: 100%; max-height: 100%; display: block; border-radius: 4px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e9edf2 25%, transparent 25%, transparent 75%, #e9edf2 75%),
    linear-gradient(45deg, #e9edf2 25%, transparent 25%, transparent 75%, #e9edf2 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.imged-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.imged-btn {
  height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer;
}
.imged-btn:hover:not(:disabled) { border-color: var(--accent, #2b6cb0); background: var(--surface); }
.imged-btn:disabled { opacity: .45; cursor: not-allowed; }
.imged-btn.active { background: var(--accent, #2b6cb0); color: #fff; border-color: var(--accent, #2b6cb0); }
.imged-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }

/* 裁剪覆盖层：用超大 box-shadow 当遮罩，避免再叠四个 div */
.imged-crop { position: absolute; inset: 0; }
.imged-crop-box {
  position: absolute; box-sizing: border-box; border: 1px dashed #fff; outline: 1px solid rgba(43, 108, 176, .9);
  box-shadow: 0 0 0 9999px rgba(12, 18, 28, .5); cursor: move; touch-action: none;
}
.imged-crop-box::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
.imged-g { position: absolute; width: 12px; height: 12px; background: #fff; border: 1px solid #2b6cb0; border-radius: 2px; z-index: 1; }
.imged-g[data-g='nw'] { left: -6px; top: -6px; cursor: nwse-resize; }
.imged-g[data-g='n'] { left: 50%; margin-left: -6px; top: -6px; cursor: ns-resize; }
.imged-g[data-g='ne'] { right: -6px; top: -6px; cursor: nesw-resize; }
.imged-g[data-g='e'] { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.imged-g[data-g='se'] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.imged-g[data-g='s'] { left: 50%; margin-left: -6px; bottom: -6px; cursor: ns-resize; }
.imged-g[data-g='sw'] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.imged-g[data-g='w'] { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }

.imged-cropbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.imged-cropbar-h { font-size: 12px; color: var(--text-2); margin-right: 2px; }
.imged-rbtn {
  height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--panel); color: var(--text-2); font-size: 12px; cursor: pointer;
}
.imged-rbtn.on { background: var(--accent, #2b6cb0); color: #fff; border-color: var(--accent, #2b6cb0); }
.imged-grow { flex: 1 1 auto; }
.imged-cropsize { font-size: 12px; color: var(--muted); font-family: Consolas, monospace; margin-right: 4px; }

.imged-side { flex: 0 0 262px; display: flex; flex-direction: column; gap: 6px; overflow: auto; padding-right: 2px; }
.imged-sec { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; display: flex; flex-direction: column; gap: 5px; background: var(--panel); }
/* 目标体积：一行放「数值 + 单位 + 按钮」，省掉一整块表单的高度 */
.imged-fitrow { display: flex; align-items: center; gap: 6px; }
.imged-fitrow input[type='number'] {
  flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 13px;
}
.imged-fitrow select {
  flex: 0 0 62px; height: 28px; padding: 0 4px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.imged-fitrow .btn { flex: 0 0 auto; height: 28px; }
.imged-sec-info { gap: 4px; }
.imged-h { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .3px; }
.imged-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.imged-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.imged-f input[type='number'], .imged-f select {
  height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
  color: var(--text); padding: 0 6px; font-size: 13px; min-width: 0;
}
.imged-f input[type='number']:focus, .imged-f select:focus { outline: none; border-color: var(--accent, #2b6cb0); }
.imged-lock { font-size: 12px; }
.imged-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.imged-chip {
  height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel-2); color: var(--text-2); font-size: 11px; cursor: pointer;
}
.imged-chip:hover { border-color: var(--accent, #2b6cb0); color: var(--text); }
.imged-chip.on { background: var(--accent, #2b6cb0); color: #fff; border-color: var(--accent, #2b6cb0); }
.imged-qrow.off { opacity: .5; }
.imged-qwrap { display: flex; align-items: center; gap: 6px; }
.imged-qwrap input[type='range'] { flex: 1 1 auto; min-width: 0; }
.imged-qwrap b { font-size: 12px; color: var(--text-2); min-width: 26px; text-align: right; font-weight: 600; }
.imged-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.imged-info { font-size: 12px; color: var(--text-2); line-height: 1.6; word-break: break-all; }

/* hidden 属性会被上面的 display:flex 压掉（作者样式优先于 UA 的 [hidden]），必须显式补回 */
.imged-cropbar[hidden], .imged-crop[hidden] { display: none; }
.imged-metabar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); line-height: 1.5; }
.imged-sep-dot { color: var(--border); }
.imged-metabar b { color: var(--text-2); font-weight: 600; }

/* 编辑器里被选中的图片：点一下出现描边，双击即可进编辑器 */
.np-rich { position: relative; }
.np-rich img { cursor: pointer; }
.np-rich img.np-img-sel { outline: 2px solid var(--accent, #2b6cb0); outline-offset: 2px; border-radius: 4px; box-shadow: 0 0 0 5px rgba(47, 111, 235, .25); }

/* ================= 工具模块 · 图片编辑（选图面板） ================= */
.modal.imgtl-modal { width: min(620px, 96vw); }
.imgtl { display: flex; flex-direction: column; gap: 10px; }
.imgtl-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 26px 16px; border: 2px dashed var(--border); border-radius: 10px;
  background: var(--panel-2); color: var(--text-2); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.imgtl-drop:hover, .imgtl-drop:focus-visible { border-color: var(--accent, #2b6cb0); background: var(--primary-soft); color: var(--text); outline: none; }
.imgtl-drop.over { border-color: var(--accent, #2b6cb0); background: var(--primary-soft); color: var(--text); }
.imgtl-drop.busy { opacity: .7; cursor: progress; }
.imgtl-ico { font-size: 30px; line-height: 1; }
.imgtl-main { font-size: 13px; }
.imgtl-main b { color: var(--accent, #2b6cb0); }
.imgtl-sub { font-size: 11px; color: var(--muted); }
.imgtl-busy { font-size: 12px; color: var(--accent, #2b6cb0); }
.imgtl-busy[hidden] { display: none; }
.imgtl-err {
  padding: 7px 10px; border-radius: 6px; font-size: 12px; line-height: 1.6;
  /* 用半透明红底 + 主题文字色：6 套主题（含深色）都保证对比度，不必为每套主题各写一遍 */
  border: 1px solid rgba(229, 72, 77, .45); background: rgba(229, 72, 77, .12); color: var(--text);
  border-left: 3px solid #e5484d;
}
.imgtl-err[hidden] { display: none; }
.imgtl-tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.imgtl-tips li { font-size: 12px; color: var(--muted); line-height: 1.65; }
.imgtl-tips li b { color: var(--text-2); font-weight: 600; }

/* ================= 工具面板 · 分组 ================= */
/* 工具一多就平铺成一片，用户要在十张卡里找 —— 分组标题把「文档/图片/数据」分开，
   低频项自然沉到底部，不必再藏进二级菜单。 */
.tool-group { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tool-group:first-of-type { margin-top: 4px; }
.tool-group-t { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.tool-group .tool-list { display: flex; flex-direction: column; gap: 8px; }
/* 工具面板主区：四张卡两列排开，一眼扫完；折叠区默认收起，卡片仍是完整可点的按钮 */
.tool-core { grid-template-columns: 1fr 1fr; margin-bottom: 6px; }
.tool-more { margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 10px; }
.tool-more > summary {
  cursor: pointer; font-size: 12px; color: var(--muted); list-style: none;
  padding: 6px 2px; user-select: none;
}
.tool-more > summary::-webkit-details-marker { display: none; }
.tool-more > summary::before { content: '▸ '; }
.tool-more[open] > summary::before { content: '▾ '; }
.tool-more > summary:hover { color: var(--primary); }

/* ================= 工具面板 · 通用（tp-*） ================= */
.tp { display: flex; flex-direction: column; gap: 12px; }
.tp .muted { font-size: 12px; line-height: 1.7; }
.tp-loading { padding: 14px 0; }
.tp-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.tp-hint code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.tp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tp-kpi { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.tp-kpi-v { font-size: 17px; font-weight: 700; color: var(--text); }
.tp-kpi-k { font-size: 11px; color: var(--muted); }

.tp-sec { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 7px; }
.tp-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.tp-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.tp-line > span:first-child { flex: 0 0 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-line > b { flex: 0 0 auto; margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.tp-bar-bg { flex: 1 1 auto; height: 6px; border-radius: 999px; background: rgba(120, 120, 120, .18); overflow: hidden; min-width: 60px; }
.tp-bar-bg > i { display: block; height: 100%; border-radius: 999px; }
.tp-bar-bg > i.c1 { background: #2f6feb; }
.tp-bar-bg > i.c2 { background: #2f9e6b; }
.tp-bar-bg > i.c3 { background: #d98a2b; }
.tp-tag { font-size: 11px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tp-tag.bad { border-color: #e0a3a3; color: #a32020; background: rgba(220, 80, 80, .08); }
.tp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.tp-actions > .muted { font-size: 11px; }
.tp-ok { padding: 22px; text-align: center; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-2); font-size: 13px; }
.tp-badge-warn { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(217, 138, 43, .16); color: #a8691a; margin-left: 6px; }

/* 项目多选器 */
.tp-picker { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.tp-bar { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--panel-2); flex-wrap: wrap; }
.tp-bar .tp-q { flex: 1 1 180px; min-width: 140px; }
.tp-bar .tp-st { flex: 0 0 112px; }
.tp-cnt { margin-left: auto; font-size: 11px; }
.tp-list { max-height: 208px; overflow: auto; padding: 4px 6px; }
.tp-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.tp-row:hover { background: var(--panel-2); }
.tp-name { flex: 1 1 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-meta { flex: 0 0 auto; color: var(--muted); font-size: 11px; }

/* 表单行 */
.tp-form { display: flex; gap: 12px; flex-wrap: wrap; }
.tp-f { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.tp-f-wide { flex: 1 1 100%; align-items: flex-start; }
.tp-f-label { flex: 0 0 auto; padding-top: 3px; }
.tp-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tp-checks .check { font-size: 12px; }

/* 体检明细表 */
.tp-int-tablewrap { max-height: 190px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.tp-int-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tp-int-table th { position: sticky; top: 0; background: var(--panel-2); text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--border); }
.tp-int-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.tp-int-table tr:last-child td { border-bottom: none; }
.tp-int-name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-int-ref { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.tp-int-op { width: 64px; }

/* ================= 工具面板 · 图片批量（imgb-*） ================= */
.modal.imgb-modal { width: min(940px, 96vw); }
.imgb { display: flex; flex-direction: column; gap: 10px; }
.imgb-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 20px 16px; border: 2px dashed var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.imgb-drop:hover, .imgb-drop:focus-visible { border-color: var(--accent, #2b6cb0); background: var(--primary-soft); outline: none; }
.imgb-drop.over { border-color: var(--accent, #2b6cb0); background: var(--primary-soft); }
.imgb-rules { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.imgb-rule { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.imgb-rule.off { opacity: .55; }
.imgb-num { width: 76px; }
.imgb-unit { width: 62px; }
.imgb-rule input[type='range'] { width: 110px; }
.imgb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imgb-progress { font-size: 12px; color: var(--muted); }
.imgb-tablewrap { border: 1px solid var(--border); border-radius: 8px; overflow: auto; max-height: calc(34vh / var(--ui-zoom)); }
.imgb-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.imgb-table th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 9px; border-bottom: 1px solid var(--border); }
.imgb-table td { padding: 5px 9px; border-bottom: 1px solid var(--border); color: var(--text-2); font-variant-numeric: tabular-nums; }
.imgb-table tr:last-child td { border-bottom: none; }
.imgb-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.imgb-empty td { text-align: center; padding: 22px 8px; color: var(--muted); }
.imgb-foot { display: flex; align-items: center; gap: 10px; }
.imgb-foot .muted { font-size: 12px; }

/* ================= 决策记录（S24，dec-*） ================= */
.dec-list { display: flex; flex-direction: column; gap: 10px; }
.dec-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 11px 13px; display: flex; flex-direction: column; gap: 8px; }
.dec-card.due { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger-soft); }
.dec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dec-q { font-weight: 600; font-size: 14px; color: var(--text); }
.dec-badges { display: flex; align-items: center; gap: 6px; flex: none; }
.dec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.dec-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dec-grid b { font-size: 11px; font-weight: 600; color: var(--muted); }
.dec-grid span { font-size: 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.dec-wide { grid-column: 1 / -1; }
.dec-opt { font-size: 12px; color: var(--text-2); }
.dec-opt.rejected { color: var(--muted); text-decoration: line-through; }
.dec-opt em { font-style: normal; color: var(--muted); margin-left: 4px; }
.dec-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--border); }
.dec-foot .row-actions { display: flex; gap: 10px; }
.dec-form { display: flex; flex-direction: column; gap: 9px; }
.dec-form label, .dec-note-lab { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.dec-form textarea.input { resize: vertical; font-family: inherit; line-height: 1.5; }
.dec-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dec-recap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); margin-bottom: 10px; }
.dec-recap div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dec-recap b { font-size: 11px; color: var(--muted); font-weight: 600; }
.dec-recap span { font-size: 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
/* 轻提示条：不挡点击（只有自己那块接收事件），12 秒自动消失 */
.dec-prompt { position: fixed; left: 50%; bottom: calc(18px / var(--ui-zoom)); transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); max-width: min(720px, 92vw); }
.dec-prompt-t { display: flex; flex-direction: column; font-size: 12px; color: var(--text-2); }
.dec-prompt-t em { font-style: normal; font-size: 11px; color: var(--muted); max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 项目审视（P1-2）：.ab-next 用了 display:flex，必须显式补 [hidden]，
   否则作者样式会压过 UA 的 [hidden]{display:none}，输入行会一直露在外面。 */
.ab-item { gap: 6px; }
.ab-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ab-acts[hidden], .ab-next[hidden] { display: none; }
.ab-next { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.ab-next .input { flex: 1 1 auto; min-width: 160px; }

/* 工时类型徽标（P2）：与「未分类」区分，让返工占比一眼能看出来 */
.wl-row .wl-type { flex: none; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-d); }

/* ---------------- 三端适配：网络登录 + 小屏触控 ----------------
   桌面端这些元素全部 display:none，老断言、老选择器、交互流程一个都不改。 */
.g-node { touch-action: none; } /* 触屏拖节点时不要连带滚动页面 */
.mobile-nav-toggle, .nav-mask { display: none; }
.login-layer {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(18, 24, 36, .48); padding: 16px;
}
.login-layer[hidden], .login-err[hidden] { display: none !important; }
.login-card {
  width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 26px 24px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}
.login-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 19px;
}
.login-card h2 { margin: 0; font-size: 18px; color: var(--text); }
.login-sub { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
.login-card .input, .login-card input {
  width: 100%; box-sizing: border-box; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); font: inherit;
}
.login-card .btn { min-height: 42px; width: 100%; }
.login-err { font-size: 12px; color: var(--danger); line-height: 1.5; }

@media (max-width: 720px) {
  .app { display: block; height: auto; min-height: calc(100vh / var(--ui-zoom)); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 120;
    width: min(84vw, 300px); transform: translateX(-102%);
    transition: transform .16s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, .16);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-mask {
    display: block; position: fixed; inset: 0; z-index: 110;
    background: rgba(15, 22, 34, .36); opacity: 0; pointer-events: none; transition: opacity .16s ease;
  }
  body.nav-open .nav-mask { opacity: 1; pointer-events: auto; }
  .mobile-nav-toggle {
    display: grid; place-items: center; position: fixed; z-index: 130;
    left: 10px; top: 10px; width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 19px;
  }
  .main { padding: 66px 12px 90px; }
  .view-head { flex-wrap: wrap; gap: 8px; }
  .modal, .modal.wide, .modal.imged-modal, .modal.imgtl-modal, .modal.imgb-modal {
    width: calc(100vw - 20px) !important; max-height: calc(100vh - 24px); overflow: auto;
  }
  .modal-foot { position: sticky; bottom: 0; background: var(--panel); flex-wrap: wrap; }
  .btn, .nav-item, .chip, .tabs button, .seg button { min-height: 42px; }
  .plist-row { padding: 12px; }
  .view table { display: block; overflow-x: auto; }
  #d-tabs { overflow: visible; } /* 第二排副页签必须完整露出，不能被横向滚动裁掉 */
}
