/* ==========================================================================
   采购智能辅助系统 · 页面级样式
   ========================================================================== */

/* ==========================================================================
   M1 工作台首页
   卡片间距统一 12px（--sp-3）
   ========================================================================== */
.wb-page { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1 1 auto; min-height: 0; }
.wb-page .welcome-bar { padding: var(--sp-3) var(--sp-4); }
.wb-page .card-head { padding: var(--sp-3) var(--sp-4); }
.wb-page .card-body { padding: 0 var(--sp-4); }
.wb-page .card-body-flush { padding: 0; }
.wb-page .msg-item { padding: var(--sp-3) var(--sp-4); }
.wb-page .card-body:not(.wb-list) { padding: var(--sp-2) var(--sp-4); }

.welcome-bar {
  background: #fff; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  border: 1px solid var(--c-split); flex-wrap: wrap;
}
.welcome-bar .wb-left { display: flex; align-items: center; gap: var(--sp-4); }
.welcome-bar .wb-greet { font-size: 20px; font-weight: 600; color: var(--c-title); }
.welcome-bar .wb-meta { font-size: 13px; color: var(--c-text-2); margin-top: 4px; }
.welcome-bar .wb-right { display: flex; align-items: center; gap: var(--sp-6); }

/* 快捷入口：图标与文字同行，间距 20px */
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-3); }
.quick-card {
  background: #fff; border: 1px solid var(--c-split); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); cursor: pointer;
  display: flex; flex-direction: row; align-items: center; gap: 20px;
  transition: all var(--e-normal); position: relative; overflow: hidden;
}
.quick-card:hover { box-shadow: var(--sh-hover); transform: translateY(-4px); border-color: var(--c-primary-200); }
.quick-card .qc-icon {
  width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--c-primary-100); color: var(--c-primary); flex: none;
}
.quick-card .qc-text { min-width: 0; }
.quick-card .qc-name { font-size: 14px; font-weight: 500; color: var(--c-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-card .qc-desc { font-size: 12px; color: var(--c-text-2); line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-card .qc-badge {
  position: absolute; top: var(--sp-2); right: var(--sp-2);
}

/* 待办 + 消息：等高卡片，底部对齐分页 */
.wb-main { display: grid; grid-template-columns: 3fr 2fr; gap: var(--sp-3); align-items: stretch; }
.wb-main .card { display: flex; flex-direction: column; }
.wb-main .card .wb-list { flex: 1 1 auto; }
.stat-row { display: flex; gap: var(--sp-3); }

/* 工作台列表迷你分页 */
.wb-pager {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--c-split);
}
.wb-pager .wp-btns { display: flex; align-items: center; gap: var(--sp-2); }
.wb-pager .wp-info { font-size: 12px; color: var(--c-text-2); font-family: var(--font-num); min-width: 36px; text-align: center; }

/* 待办行：环节标签跟随标题，间距 20px（flex gap 4px + margin 16px）；处理按钮垂直居中 */
.todo-node { margin-left: 16px; vertical-align: middle; }
.wb-page .msg-item .btn { flex: none; align-self: center; }

.todo-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: 12px; color: var(--c-text-2); margin-top: 4px; flex-wrap: wrap; }
.msg-item {
  display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-split); cursor: pointer;
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: #FAFBFC; }
.msg-item .mi-ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.msg-item .mi-title { font-size: 13px; color: var(--c-title); font-weight: 500; display: flex; align-items: center; gap: var(--sp-1); }
.msg-item .mi-desc { font-size: 12px; color: var(--c-text-2); margin-top: 4px; line-height: 20px; }
.msg-item .mi-time { font-size: 12px; color: var(--c-text-2); flex: none; }

/* ==========================================================================
   M2-2.2 新建采购文件（三步引导）
   ========================================================================== */
.guide-panel { background: #fff; border-radius: var(--r-sm); padding: var(--sp-5); min-height: 420px; }
.guide-foot {
  background: #fff; border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.guide-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }

/* 项目列表精简筛选：单一搜索框加宽，小类随大类级联（默认由 .is-hidden 隐藏） */
.filter-bar .filter-item.kw-item { flex: 1 1 320px; max-width: 440px; }
.filter-bar .filter-item.kw-item .input { width: 100%; }

/* 选模板页：筛选面板与统计行、卡片网格之间的呼吸 */
.tpl-pick-info { margin: 2px 0 var(--sp-4); }


.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(166px, 1fr)); gap: var(--sp-4); }
.tpl-card { cursor: pointer; min-width: 0; }
.tpl-card .tc-thumb {
  position: relative; aspect-ratio: 5 / 6; overflow: hidden;
  background: var(--c-gray-bg); border: 1px solid var(--c-split); border-radius: var(--r-sm);
  transition: border-color var(--e-fast), box-shadow var(--e-fast), transform var(--e-fast);
}
.tpl-card:hover .tc-thumb { border-color: var(--c-primary-200); box-shadow: 0 4px 14px rgba(2, 123, 208, .14); transform: translateY(-2px); }
.tpl-card.is-active .tc-thumb { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-100); }
/* 不可用模板（未启用 / 章节结构为空）：灰显且不可选择 */
.tpl-card.is-disabled { cursor: not-allowed; }
.tpl-card.is-disabled .tc-thumb { filter: grayscale(1); opacity: .55; }
.tpl-card.is-disabled:hover .tc-thumb { transform: none; box-shadow: none; border-color: var(--c-split); }

/* 缩略图角标：采购方式 / 不可用 / 已选中 */
.tc-mode, .tc-check { position: absolute; z-index: 2; top: 6px; font-size: 10px; line-height: 16px; }
.tc-mode { left: 6px; padding: 0 6px; border-radius: var(--r-full); background: rgba(16, 16, 21, .55); color: #fff; }
.tc-mode.is-off { background: rgba(245, 34, 45, .85); }
.tc-check {
  right: 6px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--c-primary); color: #fff;
}
.tc-check .ic { width: 12px; height: 12px; }

/* 缩略图内的信息页：模板名称 / 文件分类 / 版本号 */
.tc-p {
  position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px; overflow: hidden;
  background: #fff; border: 1px solid #EDEEF3; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(16, 16, 21, .06); padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
}
.tc-p-name {
  font-size: 9px; line-height: 1.55; font-weight: 600; color: #2A2B33; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-p-cat {
  font-size: 8px; line-height: 1.4; color: var(--c-primary); background: var(--c-primary-100);
  border-radius: 8px; padding: 1px 8px; text-align: center; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-p-ver {
  font-size: 8px; line-height: 1.4; color: #8A8C99; text-align: center;
  padding-top: 8px; border-top: 1px solid #F0F1F5; width: 60%;
}

.tc-name {
  margin-top: var(--sp-2); font-size: 13px; line-height: 18px; color: var(--c-title);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpl-card:hover .tc-name { color: var(--c-primary); }
.tpl-card.is-active .tc-name { color: var(--c-primary); font-weight: 600; }
.tpl-card.is-disabled .tc-name { color: var(--c-text-3); }
/* 卡片内的「使用」按钮：鼠标移入模板卡片时浮现在缩略图底部，点击即进入下一步 */
.tpl-card .tc-use {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; justify-content: center; padding: 14px 8px 10px;
  background: linear-gradient(to top, rgba(255, 255, 255, .98) 40%, rgba(255, 255, 255, 0));
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--e-fast), transform var(--e-fast);
  pointer-events: none;
}
.tpl-card:hover .tc-use, .tpl-card:focus-within .tc-use,
.tpl-card.is-active .tc-use { opacity: 1; transform: none; pointer-events: auto; }
.tpl-card .tc-use .btn { width: 82%; justify-content: center; height: 30px; font-size: 12px; }

/* 推荐卡片 */
.rec-card {
  border: 1px solid var(--c-split); border-radius: var(--r-sm); padding: var(--sp-3);
  cursor: pointer; transition: all var(--e-fast); display: flex; gap: var(--sp-3); align-items: flex-start;
}
.rec-card:hover { border-color: var(--c-primary-200); background: #FAFDFF; }
.rec-card .rc-ic { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--c-primary-100); color: var(--c-primary); display: grid; place-items: center; flex: none; }
.rec-card .rc-title { font-size: 13px; color: var(--c-title); font-weight: 500; }
.rec-card .rc-meta { font-size: 12px; color: var(--c-text-2); margin-top: 4px; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.rec-card .rc-score { margin-left: auto; flex: none; }


.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5) var(--sp-6); }
.form-2col .span-2 { grid-column: 1 / -1; }
/* 表单页卡片堆叠：统一居中宽度并给出卡片间距（.card 自身无外边距） */
.form-page { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.form-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5) var(--sp-6); }

/* ==========================================================================
   M2-2.3 编制工作台（三栏）
   ========================================================================== */
.editor-shell {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--r-sm); overflow: hidden;
}
.editor-toolbar {
  flex: none; height: 56px; display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-4); border-bottom: 1px solid var(--c-split); background: #fff;
}
.editor-toolbar .et-name {
  font-size: 15px; font-weight: 500; color: var(--c-title); display: flex; align-items: center; gap: var(--sp-2);
  min-width: 0;
}
.editor-toolbar .et-name .tn-input {
  border: 1px solid transparent; background: transparent; border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2); font-size: 15px; font-weight: 500; color: var(--c-title); min-width: 260px;
}
.editor-toolbar .et-name .tn-input:hover { border-color: var(--c-border); background: #fff; }
.editor-toolbar .et-name .tn-input:focus { border-color: var(--c-primary); background: #fff; outline: none; }
.editor-toolbar .et-actions { display: flex; align-items: center; gap: var(--sp-2); }
/* 顶部指标区：字数 + 最近保存时间（必填完成度已移至左栏文档目录） */
.editor-toolbar .et-meta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.editor-toolbar .et-meta > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.editor-toolbar .et-meta .ic { width: 13px; height: 13px; }
/* 进度条（v1.9 起统一挂载在左栏文档目录的搜索框下方） */
.ep-bar {
  width: 100%; height: 5px; border-radius: var(--r-full); background: var(--c-thead); overflow: hidden;
}
.ep-bar i { display: block; height: 100%; background: var(--c-primary); transition: width var(--e-fast); }

.editor-body { flex: 1 1 auto; min-height: 0; display: flex; }

/* —— 三栏宽度由 CSS 变量驱动，支持左右拖动与自动收起 —— */
.editor-left {
  flex: 0 0 var(--ed-left, 264px); width: var(--ed-left, 264px);
  min-width: 190px; max-width: 42%; border-right: 1px solid var(--c-split);
  display: flex; flex-direction: column; background: #fff;
}
.editor-left .el-search { padding: var(--sp-3); border-bottom: 1px solid var(--c-split); flex: none; }
/* 完成度进度条 + 批量编辑入口（位于搜索框下方） */
.editor-left .el-prog {
  flex: none; padding: var(--sp-3); border-bottom: 1px solid var(--c-split);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.editor-left .el-prog .el-prog-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.editor-left .el-prog .btn { justify-content: center; }
.editor-left .el-scroll { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-2); }
.editor-center { flex: 1 1 auto; min-width: 0; background: #EFF1F4; overflow-y: auto; padding: var(--sp-5); }
.editor-right {
  flex: 0 0 var(--ed-right, 380px); width: var(--ed-right, 380px);
  min-width: 300px; max-width: 58%; border-left: 1px solid var(--c-split);
  display: flex; flex-direction: column; background: #fff;
}

/* 拖动分隔条（左右两处：目录｜正文｜人工智能助手） */
.ed-split {
  flex: none; width: 7px; position: relative; cursor: col-resize;
  background: transparent; z-index: 5;
}
.ed-split::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%); background: transparent; transition: background var(--e-fast);
}
.ed-split:hover::before, .ed-split.is-dragging::before { background: var(--c-primary); }
.ed-split-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 36px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-2);
  display: grid; place-items: center; opacity: 0; transition: opacity var(--e-fast), color var(--e-fast);
  box-shadow: var(--sh-card, 0 1px 3px rgba(0,0,0,.12));
}
.ed-split-handle .ic { width: 12px; height: 12px; }
.ed-split:hover .ed-split-handle { opacity: 1; }
.ed-split-handle:hover { color: var(--c-primary); border-color: var(--c-primary-200); }
/* 收起态：该侧栏宽度归零，分隔条加宽并常驻把手（点击可重新展开） */
.editor-left.is-collapsed, .editor-right.is-collapsed {
  flex: 0 0 0 !important; width: 0 !important; min-width: 0 !important; max-width: 0 !important;
  overflow: hidden; border: none; padding: 0;
}
.ed-split.is-collapsed { width: 14px; }
.ed-split.is-collapsed .ed-split-handle { opacity: 1; }

/* —— 站内全屏：隐藏全局导航，编辑区铺满整屏（由 app.js 在 /editor/:id 路由上切换）—— */
body.is-editor-fs .topnav,
body.is-editor-fs .side-menu,
body.is-editor-fs .tabs-bar { display: none; }
body.is-editor-fs .content { padding: 0; gap: 0; overflow: hidden; }
body.is-editor-fs .page-body,
body.is-editor-fs .page-body.is-fluid,
body.is-editor-fs .page-body.is-panel.is-fluid { flex: 1 1 auto; min-height: 0; border: none; border-radius: 0; }
body.is-editor-fs .editor-shell { flex: 1 1 auto; min-height: 0; border-radius: 0; }
body.is-editor-fs .editor-center { padding: 0; }
/* 全屏下的文档纸面：占满中栏宽度，去掉外阴影的居中留白 */
body.is-editor-fs .doc-paper { max-width: none; box-shadow: none; min-height: 100%; padding: 40px 56px 96px; }

/* 字段导航 */
.fld-group { margin-bottom: 4px; }
.fld-group-head {
  display: flex; align-items: center; gap: var(--sp-1); height: 36px; padding: 0 var(--sp-2);
  font-size: 13px; font-weight: 500; color: var(--c-title); cursor: pointer; border-radius: var(--r-sm);
}
.fld-group-head:hover { background: var(--c-thead); }
.fld-group-head .ic { color: var(--c-icon); transition: transform var(--e-normal); }
.fld-group.is-open .fld-group-head .ic { transform: rotate(90deg); }
.fld-group-head .fg-count { margin-left: auto; font-size: 12px; color: var(--c-text-2); font-family: var(--font-num); }
/* 章节锚点：点击章节名跳转正文对应位置；当前所在章节高亮 */
.fld-group-head .fg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld-group-head .fg-name:hover { color: var(--c-primary); }
.fld-group-head.is-current { background: var(--c-primary-100); color: var(--c-primary); }
.fld-group-head.is-current .ic { color: var(--c-primary); }
.fld-list { display: none; }
.fld-group.is-open .fld-list { display: block; }
.fld-item {
  display: flex; align-items: center; gap: var(--sp-1); height: 32px; padding: 0 var(--sp-2) 0 var(--sp-4);
  border-radius: var(--r-sm); font-size: 13px; color: var(--c-text); cursor: pointer;
  transition: background var(--e-fast); position: relative;
}
.fld-item:hover { background: var(--c-thead); }
.fld-item.is-active { background: var(--c-primary-100); color: var(--c-primary); }
.fld-item.is-active::before {
  content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 4px; background: var(--c-primary);
}
.fld-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld-item .fi-star { color: var(--c-danger); font-size: 12px; flex: none; }
.fld-item .fi-state { flex: none; display: grid; place-items: center; width: 16px; }
.fld-item.is-filled .fi-state { color: var(--c-success); }
.fld-item.is-empty .fi-state { color: var(--c-icon); }

/* 模板管控策略：锁定项 / 需提醒项 */
.fld-item.is-locked { color: var(--c-text-3); cursor: not-allowed; }
.fld-item.is-locked .fi-state { color: var(--c-info); }
.fld-item.is-locked:hover { background: transparent; }
.fld-item.is-locked.is-active { background: var(--c-primary-100); color: var(--c-primary); }
.fld-item .fi-warn {
  flex: none; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-warning); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}
.fld-group-head .fg-lock {
  display: inline-flex; align-items: center; gap: 2px; font-size: 11px;
  color: var(--c-info); background: var(--c-primary-100); border-radius: var(--r-xs);
  padding: 1px 5px; flex: none;
}
.fld-group-head .fg-lock .ic { width: 11px; height: 11px; }


/* 右侧面板策略说明条 */
.rec-policy-note {
  border-left: 3px solid var(--c-success); background: var(--c-thead); padding: 8px var(--sp-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 12px; color: var(--c-text-2); margin-bottom: var(--sp-3);
}

/* 文档内固定（不可编辑）内容：按正常文案呈现，不加任何底纹 / 边框 */
.doc-slot.is-locked { background: none; border-bottom: none; color: #1A1A1A; cursor: default; }
.doc-slot.is-locked:hover { background: none; }
.doc-slot.is-warn { border-bottom: none; }
.doc-slot.is-locked.is-active { background: var(--c-primary); color: #fff; }

/* 文档预览（Word 样式渲染） */
.doc-paper {
  background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.1); margin: 0 auto;
  width: 100%; max-width: 720px; padding: 56px 64px; min-height: 900px;
  font-family: var(--font-cn); font-size: 14px; line-height: 1.9; color: #1A1A1A;
}
.doc-paper h1 { font-size: 22px; text-align: center; font-weight: 700; margin-bottom: var(--sp-6); letter-spacing: 1px; }
.doc-paper h2 { font-size: 16px; font-weight: 700; margin: var(--sp-5) 0 var(--sp-3); }
.doc-paper h3 { font-size: 14px; font-weight: 600; margin: var(--sp-4) 0 var(--sp-2); }
.doc-paper p { margin-bottom: var(--sp-3); text-indent: 2em; }
.doc-paper .doc-meta { text-align: center; font-size: 13px; color: #666; margin-bottom: var(--sp-6); }
.doc-paper table.doc-tb { width: 100%; border-collapse: collapse; margin: var(--sp-3) 0 var(--sp-4); font-size: 13px; }
.doc-paper table.doc-tb th, .doc-paper table.doc-tb td {
  border: 1px solid #BFBFBF; padding: 8px 12px; line-height: 1.7; vertical-align: middle;
}
.doc-paper table.doc-tb th { background: #F2F2F2; font-weight: 600; text-align: center; }
.doc-paper table.doc-tb td { text-indent: 0; }

/* --------------------------------------------------------------------------
   字段底纹（v1.9 统一口径）
   · 仅「可编辑字段」着色，固定条款与模板正文按普通文本呈现；
   · 核验前：浅蓝；核验通过：浅绿；核验发现问题：浅橙；
   · 一律纯色背景，不加边框、虚线或其他装饰元素。
   -------------------------------------------------------------------------- */
.doc-slot {
  display: inline-block; min-width: 80px; padding: 0 var(--sp-1); border-radius: var(--r-xs);
  background: #E8F2FD; color: #1A1A1A; cursor: pointer;
  transition: background var(--e-fast); text-indent: 0;
}
.doc-slot:hover { background: #D6E9FC; }
.doc-slot.is-active { background: var(--c-primary); color: #fff; }
.doc-slot.vf-ok, .doc-clause.vf-ok .dc-val { background: #E9F7EE; }
.doc-slot.vf-err, .doc-clause.vf-err .dc-val { background: #FFF0E0; }
.doc-anchor { display: inline-block; }
.doc-anchor.is-target { animation: docFlash 1.2s ease-out; border-radius: var(--r-xs); }
@keyframes docFlash {
  0% { background: #FFE9A8; box-shadow: 0 0 0 3px rgba(250,173,20,.35); }
  100% { background: transparent; box-shadow: none; }
}

/* 文档正文：范本条款段落 + 末级条款行（编号 名称：取值） */
.doc-paper .doc-para { text-indent: 2em; color: #333; }
.doc-paper h4 { font-size: 13.5px; font-weight: 600; margin: var(--sp-3) 0 var(--sp-2); color: #1A1A1A; }
.doc-paper h5 { font-size: 13px; font-weight: 600; margin: var(--sp-3) 0 var(--sp-1); color: #333; }
/* 条款行：普通条款为 <p>，含表格的条款为 <div>（可容纳块级表格） */
.doc-paper .doc-clause {
  text-indent: 0; margin: 0 0 6px; padding: 2px 8px 2px 6px; border-radius: var(--r-xs);
  line-height: 1.85; cursor: pointer; transition: box-shadow var(--e-fast);
}
.doc-paper .doc-clause:hover { box-shadow: inset 3px 0 0 var(--c-primary-200); }
.doc-paper .doc-clause.is-active { box-shadow: inset 3px 0 0 var(--c-primary); }
.doc-paper .doc-clause.is-target { animation: docFlash 1.2s ease-out; }
/* 章节式小节标题（作为字段锚点）高亮 */
.doc-paper h3.doc-head, .doc-paper h4.doc-head, .doc-paper h5.doc-head { cursor: pointer; border-radius: var(--r-xs); }
.doc-paper h3.doc-head:hover, .doc-paper h4.doc-head:hover, .doc-paper h5.doc-head:hover { background: #FFFDF3; }
.doc-paper h3.doc-head.is-active, .doc-paper h4.doc-head.is-active, .doc-paper h5.doc-head.is-active {
  background: #EAF4FE; box-shadow: inset 3px 0 0 var(--c-primary);
}
.doc-paper h3.doc-head.is-target, .doc-paper h4.doc-head.is-target, .doc-paper h5.doc-head.is-target { animation: docFlash 1.2s ease-out; }
.doc-clause .dc-no { display: inline-block; min-width: 3.6em; font-weight: 600; color: #333; }
.doc-clause .dc-name { font-weight: 600; color: #1A1A1A; }
.doc-clause .dc-val { color: #333; }
/* 可编辑条款的取值部分带底纹（纯色，无边框）：默认浅蓝，核验后浅绿 / 浅橙 */
.doc-clause:not(.is-locked):not(.has-tb) .dc-val {
  background: #E8F2FD; border-radius: var(--r-xs); padding: 0 4px;
}
.doc-clause.is-locked .dc-val { background: none; color: #333; }
.doc-clause.is-warn .dc-name { border-bottom: none; }

/* --------------------------------------------------------------------------
   编辑器内表格（可插入 · 可选样式 · 单元格可编辑）
   -------------------------------------------------------------------------- */
.doc-tb-holder { position: relative; margin: var(--sp-2) 0 var(--sp-3); }
.doc-clause .doc-tb-holder { margin: 4px 0 8px 0; }
.doc-tb-bar {
  position: absolute; top: -13px; right: 0; display: flex; gap: 3px; z-index: 4;
  opacity: 0; pointer-events: none; transition: opacity var(--e-fast);
}
.doc-tb-holder:hover .doc-tb-bar { opacity: 1; pointer-events: auto; }
.doc-tb-bar button {
  height: 22px; padding: 0 7px; border-radius: var(--r-xs); cursor: pointer;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-2);
  font-size: 11px; font-family: inherit; display: inline-flex; align-items: center; gap: 3px;
}
.doc-tb-bar button:hover { color: var(--c-primary); border-color: var(--c-primary-200); background: var(--c-primary-100); }
.doc-tb-bar button.is-danger:hover { color: var(--c-danger); border-color: var(--c-danger); background: #FEECEC; }
.doc-tb-bar .ic { width: 11px; height: 11px; }
.doc-slot.has-table, .doc-clause .dc-val.has-table { display: block; background: none; border: none; padding: 0; min-width: 0; }
.doc-paper table.doc-tb td[contenteditable], .doc-paper table.doc-tb th[contenteditable] { outline: none; }
.doc-paper table.doc-tb td[contenteditable]:focus,
.doc-paper table.doc-tb th[contenteditable]:focus { background: #FFF6DA; box-shadow: inset 0 0 0 1px var(--c-primary); }
.doc-paper table.doc-tb td[contenteditable]:empty::before { content: ' '; }
/* 表格样式：全框线网格（v1.9 起唯一形态；原 tb-std / tb-head / tb-plain 三变体已随统一口径删除） */
.doc-paper table.doc-tb.tb-grid th, .doc-paper table.doc-tb.tb-grid td { border: 1px solid #9A9A9A; }




/* --------------------------------------------------------------------------
   编制工作台 · 正文在线编辑（文档即编辑器，不含任何样式设置组件）
   -------------------------------------------------------------------------- */
/* 正文工具栏：插入表格等文档级操作（吸附在正文区顶部，随正文滚动不消失） */
.ec-tools {
  display: flex; align-items: center; gap: var(--sp-2);
  position: sticky; top: 0; z-index: 6; background: #fff;
  margin: 0 0 var(--sp-2); padding: 4px 0;
}
.ec-tools .grow { min-width: 0; }
.ec-tools .t-xs { white-space: nowrap; }
/* 视图切换（文档视图 / 表单视图）：正文区顶部左侧的二段式切换 */
.ec-tools .evs {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px; flex: none;
  background: var(--c-thead); border-radius: var(--r-sm);
}
.ec-tools .evs-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border: none; background: transparent; border-radius: var(--r-xs); cursor: pointer;
  font-size: 12px; color: var(--c-text-2); transition: background var(--e-fast), color var(--e-fast);
}
.ec-tools .evs-btn .ic { width: 13px; height: 13px; }
.ec-tools .evs-btn:hover { color: var(--c-primary); }
.ec-tools .evs-btn.is-on { background: #fff; color: var(--c-primary); font-weight: 500; }
/* 右侧：字数 / 版本号 / 校验 */
.ec-tools .ec-tools-right { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.ec-tools .ec-tools-right .btn { display: inline-flex; align-items: center; gap: 4px; }
/* 中栏「表单视图」：内嵌页面（非弹窗），单列表单 */
.ed-form-view { display: flex; flex-direction: column; gap: var(--sp-4); }
.ed-form-view[hidden], .doc-paper[hidden] { display: none; }
.fv-body.is-single { grid-template-columns: 1fr; }
body.is-editor-fs .ec-tools {
  margin: 0; padding: 6px var(--sp-4); border-bottom: 1px solid var(--c-split); background: #fff;
}
/* 可编辑单元：条款行的取值部分 / 表格插槽 */
.doc-paper .doc-ed {
  outline: none; border-radius: var(--r-xs); padding: 0 2px;
  transition: background var(--e-fast), box-shadow var(--e-fast);
}
.doc-slot.doc-ed { cursor: text; }
.doc-slot.doc-ed:hover { background: #FFF3CD; }
.doc-paper .doc-ed:focus { background: #FFF6DA; box-shadow: inset 0 0 0 1px var(--c-primary); }
.doc-paper .doc-ed:empty::before { content: attr(data-ph); color: #B58A00; font-size: 12px; pointer-events: none; }
.doc-clause .dc-colon { color: #333; }
.doc-clause.is-locked .dc-val { color: #595959; cursor: not-allowed; }
/* 需标注提醒字段：修改说明留痕入口 */
.dc-reason {
  margin-left: 6px; width: 16px; height: 16px; line-height: 1; padding: 0; vertical-align: middle;
  border-radius: 50%; cursor: pointer; font-size: 11px; font-weight: 700;
  border: 1px solid var(--c-warning); background: #FFF7E6; color: var(--c-warning);
}
.dc-reason:hover { background: var(--c-warning); color: #fff; }
.dc-reason.is-done { border-color: var(--c-success); background: #F0FBF3; color: var(--c-success); }

/* --------------------------------------------------------------------------
   编制工作台 · 右侧人工智能对话
   -------------------------------------------------------------------------- */
/* 页签即标题行：不再展示「人工智能助手」标题与「在线」状态 */
.editor-right .ec-head {
  flex: none; display: flex; flex-direction: column; align-items: stretch;
  border-bottom: 1px solid var(--c-split); background: #fff;
}
.editor-right .ec-head-top {
  height: 44px; flex: none; display: flex; align-items: stretch; gap: 4px;
  padding: 0 var(--sp-2) 0 var(--sp-1);
}
.editor-right .ec-head-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.editor-right .ec-ico-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--c-text-2); border-radius: var(--r-sm); cursor: pointer;
}
.editor-right .ec-ico-btn:hover { background: var(--c-thead); color: var(--c-primary); }
.editor-right .ec-ico-btn .ic { width: 16px; height: 16px; }
/* 页签条（位于标题行）：常驻「对话」+ 检索后打开的可关闭页签，超出横向滚动不显示滚动条 */
.editor-right .ec-tabs {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; gap: 2px;
  background: transparent; overflow-x: auto; scrollbar-width: none;
}
.editor-right .ec-tabs::-webkit-scrollbar { display: none; }
.editor-right .ec-tab {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 100%;
  padding: 0 10px; cursor: pointer; position: relative; font-size: 13px;
  color: var(--c-text-2); white-space: nowrap; user-select: none;
  border-bottom: 2px solid transparent; transition: color var(--e-fast), border-color var(--e-fast), background var(--e-fast);
}
.editor-right .ec-tab .ic { width: 14px; height: 14px; }
.editor-right .ec-tab:hover { color: var(--c-primary); background: var(--c-thead); }
.editor-right .ec-tab.is-on { color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary); }
.editor-right .ec-tab.is-dyn { padding-right: 3px; }
.editor-right .ec-tab.is-dyn span { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
.editor-right .ec-tab-x {
  width: 18px; height: 18px; padding: 0; border: none; background: transparent; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--c-text-3);
}
.editor-right .ec-tab-x:hover { background: var(--c-thead); color: var(--c-danger); }
.editor-right .ec-tab-x .ic { width: 11px; height: 11px; }
.editor-right .ec-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
/* 页签内页头（返回 + 标题） */
.editor-right .ec-view-head {
  flex: none; display: flex; align-items: center; gap: 8px; height: 38px;
  padding: 0 var(--sp-3); border-bottom: 1px solid var(--c-split); background: #fff;
}
.editor-right .ec-view-head .btn { padding: 0 4px; }
.editor-right .ec-view-head .evh-title {
  font-size: 13px; font-weight: 600; color: var(--c-title); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editor-right .ec-chat-view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.editor-right .ec-scroll { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4); background: var(--c-gray-bg); }
.editor-right .ec-compose { flex: none; position: relative; padding: var(--sp-3); border-top: 1px solid var(--c-split); background: #fff; }
/* 对话框内检索层：输入关键词即列出匹配的历史项目 / 类似项目 */
.ec-ai-drop {
  position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: calc(100% - 2px);
  max-height: 288px; overflow-y: auto; z-index: 30;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--r-md);
  box-shadow: 0 8px 20px rgba(15, 35, 74, .12); padding: 4px;
}
.ec-ai-g + .ec-ai-g { border-top: 1px solid var(--c-split); margin-top: 2px; padding-top: 2px; }
.ec-ai-gh {
  width: 100%; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--sp-2);
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; color: var(--c-title); font-family: inherit; text-align: left;
}
.ec-ai-gh:hover { background: var(--c-thead); color: var(--c-primary); }
.ec-ai-gh .ic { width: 13px; height: 13px; color: var(--c-text-2); }
.ec-ai-gh:hover .ic { color: var(--c-primary); }
.ec-ai-n {
  font-size: 11px; font-weight: 500; color: var(--c-text-2); background: var(--c-thead);
  border-radius: var(--r-full); padding: 0 6px; line-height: 16px;
}
.ec-ai-arrow { margin-left: auto; width: 12px; height: 12px; color: var(--c-text-3); }
.ec-ai-item {
  width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 6px var(--sp-2);
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-sm);
  font-family: inherit; text-align: left;
}
.ec-ai-item:hover { background: var(--c-primary-100); }
.ec-ai-name {
  font-size: 12px; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ec-ai-item:hover .ec-ai-name { color: var(--c-primary); }
.ec-ai-meta { font-size: 11px; color: var(--c-text-2); font-family: var(--font-num); }
/* 工具栏「批注」入口的条数标记：红色加粗数字，无底圆 */
.et-anno-n {
  margin-left: 4px; color: var(--c-danger); font-weight: 700;
  font-size: 13px; line-height: 1; font-family: var(--font-num);
}
/* 批注页签（右栏）：字段名与「定位」按钮分列两端 */
.editor-right .ec-anno-list { padding: var(--sp-3); }
.editor-right .ec-anno-list .an-item-top { justify-content: space-between; }
.editor-right .ec-anno-list .an-field { max-width: calc(100% - 48px); }
/* 退回文件：正文中被审核人批注过的字段（序号 + 虚线下划线） */
.editor-center [data-fid].has-anno { border-bottom: 2px dotted rgba(200, 40, 40, .55); }
.editor-center [data-fid].has-anno::after {
  content: attr(data-anno-n);
  display: inline-grid; place-items: center; width: 13px; height: 13px; margin-left: 3px;
  border-radius: 50%; background: var(--c-danger); color: #fff;
  font-size: 9px; line-height: 1; vertical-align: 2px; font-family: var(--font-num);
  user-select: none;
}
.editor-right .ec-proj-list { padding: var(--sp-3); }
.editor-right .ec-proj { cursor: pointer; transition: box-shadow var(--e-fast), transform var(--e-fast); }
.editor-right .ec-proj:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.editor-right .ec-proj-detail { padding: var(--sp-4); }
/* 放大：覆盖整个中栏编辑区、左侧文档目录不覆盖（left 由 syncPaneFsLeft 写入）；顶端让开顶部操作栏，无阴影 */
.editor-right.is-fullscreen {
  position: fixed; left: 0; right: 0; bottom: 0; top: 56px;
  width: auto !important; max-width: none; min-width: 0;
  z-index: 1200; border-left: none; box-shadow: none;
}
.editor-right .ec-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: var(--sp-2); }
.ec-ctx-tag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--c-text-2);
  background: var(--c-thead); border: 1px solid var(--c-split); border-radius: var(--r-xs); padding: 1px 6px;
  cursor: pointer; font-family: inherit; line-height: 18px;
  transition: color var(--e-fast), border-color var(--e-fast), background var(--e-fast);
}
.ec-ctx-tag:hover { color: var(--c-primary); border-color: var(--c-primary-200); background: var(--c-primary-100); }
.ec-ctx-tag.is-field { color: var(--c-primary); border-color: var(--c-primary-200); background: var(--c-primary-100); }
.ec-ctx-tag .ic { width: 12px; height: 12px; }
.ec-compose-bar { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-2); }

.ec-msg { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.ec-msg.is-user { justify-content: flex-end; }
.ec-avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-primary); color: #fff;
}
.ec-avatar .ic { width: 14px; height: 14px; }
.ec-bubble {
  max-width: 88%; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--c-split);
  border-radius: var(--r-sm); background: #fff; font-size: 13px; line-height: 21px;
  color: var(--c-text); word-break: break-word;
}
.ec-msg.is-user .ec-bubble { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.ec-text { white-space: pre-wrap; }
.ec-typing { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.ec-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--c-text-3); animation: ecBlink 1.2s infinite; }
.ec-typing i:nth-child(2) { animation-delay: .2s; }
.ec-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ecBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.ec-refs { display: flex; flex-direction: column; gap: 4px; }
.ec-ref {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 6px 8px; border: 1px solid var(--c-split); border-radius: var(--r-xs); background: #fff;
  transition: border-color var(--e-fast), background var(--e-fast);
}
.ec-ref:hover { border-color: var(--c-primary-200); background: #FAFDFF; }
.ec-ref-name { font-size: 12px; font-weight: 500; color: var(--c-title); }
.ec-ref-meta { font-size: 11px; color: var(--c-text-2); }

/* —— 蓝色快捷标签：把匹配到的历史项目收起为底部一个标签 —— */
.ec-refs-tag {
  display: inline-flex; align-items: center; gap: 5px; margin-top: var(--sp-2);
  padding: 4px 10px; border-radius: 12px; cursor: pointer; font-size: 12px; font-family: inherit;
  border: 1px solid var(--c-primary-200); background: var(--c-primary-100); color: var(--c-primary);
  transition: all var(--e-fast);
}
.ec-refs-tag:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.ec-refs-tag .ic { width: 12px; height: 12px; }
.ec-refs-tag .ec-rt-arrow { transition: transform var(--e-normal); }
.ec-refs-tag.is-open .ec-rt-arrow { transform: rotate(90deg); }
.ec-refs-fold { display: none; margin-top: 6px; }
.ec-refs-fold.is-open { display: flex; }

/* —— 候选文案卡片：优先展示全部相似度匹配到的具体内容，可一键插入 —— */
.ec-match {
  margin-top: var(--sp-2); border: 1px solid var(--c-primary-200); border-radius: var(--r-sm);
  background: #fff; overflow: hidden;
}
.ec-match-head {
  display: flex; align-items: center; gap: 6px; padding: 6px var(--sp-2);
  background: var(--c-primary-100); color: var(--c-primary); font-size: 12px; font-weight: 500;
}
.ec-match-head .ic { width: 13px; height: 13px; }
.ec-match-head .ec-match-n { margin-left: auto; font-size: 11px; color: var(--c-text-2); font-weight: 400; }
.ec-match-item { padding: 8px var(--sp-2); border-top: 1px solid var(--c-split); }
.ec-match-item:first-of-type { border-top: none; }
.ec-mi-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ec-mi-name { font-size: 12px; font-weight: 500; color: var(--c-title); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-mi-score { flex: none; font-size: 11px; color: var(--c-success); font-family: var(--font-num); }
.ec-mi-text {
  font-size: 12px; line-height: 19px; color: var(--c-text); background: var(--c-gray-bg);
  border-radius: var(--r-xs); padding: 6px 8px; max-height: 108px; overflow-y: auto; white-space: pre-wrap;
  word-break: break-word;
}
.ec-mi-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.ec-mi-from { font-size: 11px; color: var(--c-text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-mi-insert { flex: none; }

.ec-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.ec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); }
.ec-chip {
  padding: 3px 10px; border: 1px solid var(--c-primary-200); border-radius: 12px;
  background: var(--c-primary-100); color: var(--c-primary); font-size: 12px; cursor: pointer;
  transition: all var(--e-fast);
}
.ec-chip:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }


/* ==========================================================================
   M2-2.4 文件预览页
   ========================================================================== */
.preview-shell { display: flex; gap: var(--sp-4); align-items: flex-start; }
.preview-outline { width: 240px; flex: none; background: #fff; border-radius: var(--r-sm); padding: var(--sp-3); position: sticky; top: 0; }
.preview-main { flex: 1; min-width: 0; background: #EFF1F4; border-radius: var(--r-sm); padding: var(--sp-4); }

/* --------------------------------------------------------------------------
   模板全文预览：真实文档版面（卷 / 章 / 节 / 条 / 表格 / 目录）
   -------------------------------------------------------------------------- */
.tpl-doc-view {
  background: #fff; max-width: 860px; margin: 0 auto; padding: 56px 64px 80px;
  font-family: "FangSong", "仿宋", "SimSun", "宋体", serif;
  font-size: 14px; line-height: 1.95; color: #1A1A1A;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}
.tpl-doc-view .td-cv { text-indent: 0; text-align: center; margin: 0 0 2px; }
.tpl-doc-view .td-cv + .td-cv { margin-top: 0; }
.tpl-doc-view .td-cv:first-child { text-align: left; }
.tpl-doc-view .td-p { text-indent: 2em; margin: 0 0 4px; }
.tpl-doc-view .td-p.is-center { text-indent: 0; text-align: center; }
.tpl-doc-view .td-vol {
  font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 2px;
  margin: 48px 0 20px; padding-bottom: 10px; border-bottom: 1px solid #D8D8D8;
}
.tpl-doc-view .td-h1 { font-size: 17px; font-weight: 700; text-align: center; margin: 28px 0 14px; }
.tpl-doc-view .td-h2 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; }
.tpl-doc-view .td-h3 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.tpl-doc-view .td-tb {
  width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; line-height: 1.7;
}
.tpl-doc-view .td-tb th, .tpl-doc-view .td-tb td {
  border: 1px solid #9A9A9A; padding: 5px 8px; vertical-align: middle; text-indent: 0; word-break: break-word;
}
.tpl-doc-view .td-tb th { background: #F2F2F2; font-weight: 600; text-align: center; }
/* 目录 */
.tpl-doc-view .td-toc { margin: 8px 0 24px; padding: 12px 8px; border-top: 1px dashed #DCDCDC; border-bottom: 1px dashed #DCDCDC; }
.tpl-doc-view .td-toc-title {
  text-align: center; font-size: 16px; font-weight: 700; letter-spacing: 4px;
  margin-bottom: 10px; cursor: pointer; user-select: none;
}
.tpl-doc-view .td-toc-title:hover { color: var(--c-primary); }
.tpl-doc-view .td-toc-title .td-toc-n {
  display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--c-text-2); margin-top: 2px;
}
.tpl-doc-view .td-toc.is-collapsed { padding-bottom: 6px; }
.tpl-doc-view .td-toc.is-collapsed .td-toc-body { display: none; }
.tpl-doc-view .td-toc.is-collapsed .td-toc-title { margin-bottom: 0; }
.tpl-doc-view .td-toc-row { display: flex; align-items: baseline; font-size: 13px; line-height: 1.9; }
.tpl-doc-view .td-toc-row.lv1 { padding-left: 2em; color: #333; }
.tpl-doc-view .td-toc-row.lv1 .ttx { font-weight: 600; }
.tpl-doc-view .td-toc-row .ttd { flex: 1; margin: 0 4px; border-bottom: 1px dotted #B9B9B9; transform: translateY(-3px); }
.tpl-doc-view .td-toc-row .ttp { font-family: var(--font-num); color: #555; }
/* 可编辑标记 */
.td-mk {
  display: inline-block; padding: 0 4px; border-radius: 3px; background: #E8F2FD; color: #0B5FA5;
  font-family: var(--font-num); font-size: .92em; line-height: 1.6; cursor: default;
}
.tpl-doc-view .td-mk:hover { background: #D6E9FC; }
.tpl-doc-view .td-tb .td-mk { font-size: 12px; }
.preview-outline .tree-row.is-vol .tr-label { font-weight: 600; color: var(--c-title); }
.preview-outline .lg-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--c-text-2); margin-top: 8px; line-height: 18px; }
.preview-outline .lg-row .td-mk { font-size: 11px; flex: none; }
.preview-outline .lg-row .lg-txt { flex: 1; min-width: 0; }
.preview-outline .lg-fixed { width: 14px; height: 10px; border-radius: 2px; background: #EFEFEF; border: 1px solid #D8D8D8; flex: none; margin-top: 4px; }

/* ==========================================================================
   M3 审核详情页
   ========================================================================== */
/* 5 环节流程条 */
.flow-bar {
  display: flex; align-items: center; gap: 0; background: #fff; border-radius: var(--r-sm);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3);
}
.flow-bar .fb-step { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.flow-bar .fbs-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--c-thead); color: var(--c-text-3); flex: none;
}
.flow-bar .fbs-label { font-size: 13px; color: var(--c-text-3); white-space: nowrap; }
.flow-bar .fb-step.is-done .fbs-num { background: var(--c-success); color: #fff; }
.flow-bar .fb-step.is-done .fbs-label { color: var(--c-text); }
.flow-bar .fb-step.is-active .fbs-num { background: var(--c-primary); color: #fff; }
.flow-bar .fb-step.is-active .fbs-label { color: var(--c-primary); font-weight: 600; }
.flow-bar .fb-line { flex: 1; height: 2px; background: var(--c-split); margin: 0 var(--sp-3); min-width: 20px; }
.flow-bar .fb-line.is-done { background: var(--c-success); }

/* 页头右上角「当前环节」标签：替代原蓝色提示条；悬停展示环节流转 */
.rd-stage { position: relative; display: inline-flex; align-items: center; }
.rd-stage-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 var(--sp-3);
  border-radius: var(--r-full); background: var(--c-primary-100); color: var(--c-primary);
  font-size: 12px; font-weight: 600; cursor: default; white-space: nowrap;
}
.rd-stage-tag .ic { width: 13px; height: 13px; }
.rd-stage-tip {
  position: absolute; top: 100%; right: 0; z-index: 40;
  padding-top: 6px; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--e-fast), transform var(--e-fast), visibility var(--e-fast);
  pointer-events: none;
}
.rd-stage:hover .rd-stage-tip { opacity: 1; visibility: visible; transform: translateY(0); }
.rd-stage-tip .rst-card {
  min-width: 262px; max-width: 320px; padding: var(--sp-3); background: #fff; border: 1px solid var(--c-split);
  border-radius: var(--r-sm); box-shadow: var(--sh-pop);
}
.rd-stage-tip .rst-head {
  display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--c-title); margin-bottom: var(--sp-2);
}
.rd-stage-tip .rst-head .ic { color: var(--c-primary); width: 13px; height: 13px; }
.rd-stage-tip .rst-row { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: 12px; line-height: 20px; }
.rd-stage-tip .rst-k { flex: none; width: 64px; color: var(--c-text-2); }
.rd-stage-tip .rst-v { color: var(--c-title); font-weight: 500; }

/* 三栏面板：编制工作台与审核详情共用同一套结构（assets/js/pane-shell.js）——
   .editor-body = 左栏 | 分隔条 | 中栏 | 分隔条 | 右栏，列宽由 --ed-left / --ed-right 驱动，
   两处分隔条可拖动调宽（双击复位）、点击把手收起展开。 */
/* 审核详情采用 is-flow 变体：三栏不做内部纵向滚动，统一由页面纵向滚动承载；
   三列等高（左 / 右栏随中栏拉到同高，竖分隔线通高）。 */
.editor-body.is-flow { align-items: stretch; min-height: 560px; }
/* 中栏为纵向 flex：工具条固定高度，纸面吃满剩余高度（避免 100% 高度叠加工具条后溢出） */
.editor-body.is-flow .editor-center { padding: 0; overflow: visible; display: flex; flex-direction: column; }
.editor-body.is-flow .editor-left .el-scroll { overflow: visible; }
.editor-body.is-flow .ec-tools {
  position: static; margin: 0; padding: 6px var(--sp-4);
  border-bottom: 1px solid var(--c-split); background: #fff;
  flex-wrap: wrap; row-gap: 6px;
}
.editor-body.is-flow .ec-tools .ec-tools-right { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
/* 中栏纸面与编制工作台全屏编辑区同口径（满栏宽、无阴影、保留纸面留白） */
.editor-body.is-flow .doc-paper {
  flex: 1 1 auto; max-width: none; box-shadow: none; min-height: 0; padding: 40px 56px 96px;
}

/* 审核详情（v1.19）：左右两栏随页面纵向滚动吸顶，正文滚动时「AI 核验调度」「审核意见」始终可见。
   三个前提缺一不可：
   ① 解除 .page-body.is-panel 的 overflow:hidden —— 否则 sticky 的滚动容器变成不滚动的卡片，等于失效；
   ② 左右栏 align-self:flex-start 退出「等高拉伸」—— 被拉满整行高度后没有可移动余量，也不会吸顶；
   ③ 栏高上限 = 可视区高度，超出时栏内滚动，保证展开核验明细后底部仍可点到。
   分隔条同步吸顶并取同高，竖线在滚动过程中保持通高。 */
.page-body.is-review { overflow: visible; }
/* 外层滚动区同页去掉底部内边距：中栏「审核意见」吸底时下沿才能压住底部边框，
   否则滚动区 12px 内边距会露出一条正文（镂空）。类名由 app.js 按 pageClass 切换。 */
#content.is-review-scroll { padding-bottom: 0; }
/* 解除裁切后，卡片底部圆角改由两侧栏自身收角（栏底色为白，不影响观感） */
.page-body.is-review > .editor-body:last-child > .editor-left:first-child { border-bottom-left-radius: var(--r-md); }
.page-body.is-review > .editor-body:last-child > .editor-right:last-child { border-bottom-right-radius: var(--r-md); }
.page-body.is-review .editor-body.is-flow > .editor-left,
.page-body.is-review .editor-body.is-flow > .editor-right {
  position: sticky; top: 8px; align-self: flex-start;
  /* --rd-pane-max 由页面按「栏顶到可视区底」实测写入（见 pages-review.js fitPanes）；缺省回退整屏限高。
     v1.21：由 max-height 改为 height —— 左右两栏恒等高、且与分隔条（同变量定高）底边对齐，
     不再出现分隔竖线长出两侧栏的错位；栏内超出由自身 / rc-body 滚动承载。 */
  height: var(--rd-pane-max, calc(100vh - var(--h-topnav) - var(--h-tabs) - 28px));
  overflow-y: auto; overscroll-behavior: contain;
}
/* 栏内抬头随栏吸顶（栏内滚动时标题不跑掉） */
.page-body.is-review .editor-body.is-flow > .editor-left > .pane-head,
.page-body.is-review .editor-body.is-flow > .editor-right > .pane-head {
  position: sticky; top: 0; z-index: 2; background: #fff;
}
/* 屏高较小（如 1366×768）时左栏放不下 5 个核验点 + 汇总：只让核验项列表内滚，
   圆环、结论状态与「通过 / 需复核 / 不通过」汇总始终可见 */
.page-body.is-review .editor-body.is-flow > .editor-left > .rc-body {
  display: flex; flex-direction: column; min-height: 0;
}
.page-body.is-review .editor-body.is-flow > .editor-left .avp-top,
.page-body.is-review .editor-body.is-flow > .editor-left .av-status,
.page-body.is-review .editor-body.is-flow > .editor-left .av-summary,
.page-body.is-review .editor-body.is-flow > .editor-left .av-list { flex: none; }
/* 核验列表不再自带滚动条：整块左栏（pane-head 以下）由左栏自身滚动，
   滚动条仅在内容超出栏高时出现（未超出时无滚动条、也不占位） */
.page-body.is-review .editor-body.is-flow > .editor-left .av-list { overflow: visible; }
/* 左栏自身滚动条：细轨、无底色，内容未溢出时由 overflow:auto 自动不出现 */
.page-body.is-review .editor-body.is-flow > .editor-left { scrollbar-width: thin; }
.page-body.is-review .editor-body.is-flow > .editor-left::-webkit-scrollbar { width: 6px; }
.page-body.is-review .editor-body.is-flow > .editor-left::-webkit-scrollbar-track { background: transparent; }
.page-body.is-review .editor-body.is-flow > .editor-left::-webkit-scrollbar-thumb {
  background: var(--c-border); border-radius: 3px;
}
.page-body.is-review .editor-body.is-flow > .editor-left::-webkit-scrollbar-thumb:hover { background: var(--c-icon); }
.page-body.is-review .editor-body.is-flow > .ed-split {
  position: sticky; top: 8px; align-self: flex-start;
  height: var(--rd-pane-max, calc(100vh - var(--h-topnav) - var(--h-tabs) - 28px));
}
/* 三栏直接顶到面板边缘，面板自身不留内边距 */
.page-body.is-panel > .editor-body { padding: 0; }

/* 三栏内的面板抬头 / 面板主体（左栏核验调度、右栏审核意见共用一套规格） */
.pane-head {
  flex: none; height: 48px; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); padding: 0 var(--sp-4); border-bottom: 1px solid var(--c-split);
  font-size: 14px; font-weight: 500; color: var(--c-title);
}
.pane-head .pane-hd { display: inline-flex; align-items: center; gap: 6px; }
.rc-body { flex: 1 1 auto; padding: var(--sp-4); }


/* 中栏底部「审核意见」区（v1.22 重排）：
   ① 按钮收入标题行右侧（审核记录 / 退回 / 通过），整块白底、高度压缩；
   ② sticky 吸底 —— 正文滚动过程中整块始终钉在中栏可视底部，滚到文末停在自然位置。 */
.rd-opinion {
  /* bottom:0 + 无下外边距：整块下沿贴住中栏底部边框，不留镂空缝隙 */
  position: sticky; bottom: 0; z-index: 5;
  /* 宽度与中栏「文件预览区」一致：去掉左右外边距，整块铺满中栏；边框改白、去阴影 */
  flex: none; margin: var(--sp-4) 0 0; padding: var(--sp-3) var(--sp-4);
  background: #fff; border: 1px solid #fff;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.rd-op-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.rd-op-title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--c-title); }
.rd-op-title .ic { width: 15px; height: 15px; color: var(--c-primary); }
.rd-op-acts { display: inline-flex; align-items: center; gap: var(--sp-2); }
.rd-opinion .readonly-box { margin: 0; }
.rd-opinion .u-form-item, .rd-opinion textarea { margin-bottom: 0; }
.rd-opinion textarea { min-height: 0; }

/* 右栏（批注）：记录列表随栏内滚动，填写区固定栏底 */
.page-body.is-review .editor-body.is-flow > .editor-right > .rc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.page-body.is-review .editor-body.is-flow > .editor-right > .rc-body { scrollbar-width: thin; }
.page-body.is-review .editor-body.is-flow > .editor-right > .rc-body::-webkit-scrollbar { width: 6px; }
.page-body.is-review .editor-body.is-flow > .editor-right > .rc-body::-webkit-scrollbar-track { background: transparent; }
.page-body.is-review .editor-body.is-flow > .editor-right > .rc-body::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }

/* —— 右栏「批注」（v1.21）：记录展示 批注内容 / 批注人 / 批注时间 —— */
.an-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.an-item {
  border: 1px solid var(--c-split); border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3); background: #fff; cursor: pointer;
  transition: box-shadow var(--e-fast), border-color var(--e-fast);
}
.an-item:hover { box-shadow: var(--shadow-1); border-color: var(--c-primary-200); }
.an-item-top { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.an-field {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--c-primary);
  background: var(--c-primary-100); border-radius: var(--r-xs); padding: 1px 8px;
}
.an-content { font-size: 12px; line-height: 19px; color: var(--c-text); margin-top: 6px; word-break: break-all; }
.an-meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin-top: 6px; font-size: 11px; color: var(--c-text-2);
}
.an-empty { text-align: center; padding: var(--sp-6) var(--sp-3); color: var(--c-text-2); }
.an-empty .ic { width: 30px; height: 30px; color: var(--c-border); }
.an-empty p { margin: var(--sp-2) 0 4px; font-size: 13px; color: var(--c-text); }
.an-empty span { font-size: 12px; line-height: 19px; }
.an-compose { flex: none; padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--c-split); background: #fff; }
.an-compose.is-viewonly { padding: var(--sp-3) var(--sp-4); }
.an-target { font-size: 12px; line-height: 18px; color: var(--c-text); margin-bottom: 6px; }
.an-target b { color: var(--c-primary); }
.an-input {
  width: 100%; min-height: 58px; resize: vertical;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  padding: 6px 9px; font-size: 12px; line-height: 19px; font-family: inherit; color: var(--c-text);
  transition: border-color var(--e-fast), box-shadow var(--e-fast);
}
.an-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-100); }
.an-acts { display: flex; justify-content: flex-end; margin-top: var(--sp-2); }
/* 选中的待批注字段：主色描边叠加在底纹上（底纹口径不变，仅可编辑字段有着色） */
.doc-slot.an-on, .doc-clause.an-on .dc-val { box-shadow: inset 0 0 0 2px var(--c-primary); }
/* 历史审核意见弹窗内的文件名条 */
.an-his-file {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--c-gray-bg); border-radius: var(--r-sm); font-size: 12px;
}
.an-his-file .ic { width: 13px; height: 13px; color: var(--c-primary); flex: none; }

/* 修改建议条（编制工作台的核验结果复用） */
.rk-fix {
  font-size: 12px; line-height: 20px; color: #1E7A38; background: var(--c-success-bg);
  border-radius: var(--r-sm); padding: var(--sp-2); margin-top: var(--sp-2);
}

/* 版本对比 */
.diff-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.diff-pane { border: 1px solid var(--c-split); border-radius: var(--r-sm); overflow: hidden; }
.diff-pane .dp-head {
  height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-3); background: var(--c-thead); font-size: 13px; font-weight: 500; color: var(--c-title);
}
.diff-pane .dp-body { padding: var(--sp-3); font-size: 13px; line-height: 1.9; max-height: 420px; overflow-y: auto; }
.diff-line { padding: 4px 8px; border-radius: var(--r-xs); }
.diff-line.is-add { background: #E8F7EC; }
.diff-line.is-del { background: #FEECEC; text-decoration: line-through; color: #B31820; }
.diff-line.is-mod { background: #FFFBE6; }
.legend { display: flex; align-items: center; gap: var(--sp-4); font-size: 12px; color: var(--c-text-2); }
.legend .lg-item { display: flex; align-items: center; gap: var(--sp-1); }
.legend .lg-swatch { width: 16px; height: 16px; border-radius: var(--r-xs); }

/* ==========================================================================
   M4 项目分析
   ========================================================================== */

.conclusion-card {
  border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); border: 1px solid transparent;
}
.conclusion-card.cc-ok { background: var(--c-success-bg); border-color: #BFE7CB; }
.conclusion-card.cc-warn { background: var(--c-warning-bg); border-color: #FAE7B3; }
.conclusion-card.cc-bad { background: var(--c-danger-bg); border-color: #F9C9CB; }
.conclusion-card .cc-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); }
.conclusion-card .cc-desc { font-size: 13px; line-height: 24px; margin-top: var(--sp-2); color: var(--c-text); }

/* 图表容器 */
.chart-box { width: 100%; }

/* ==========================================================================
   M6 传输中心（原「数据导入中心」）
   ========================================================================== */
/* 传输中心：上传队列表（进度 / 结果） */
.qi-prog { display: flex; align-items: center; gap: var(--sp-2); }
.qi-prog .qi-bar { flex: 1 1 auto; height: 6px; border-radius: 99px; background: var(--c-thead); overflow: hidden; }
.qi-prog .qi-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-200)); transition: width var(--e-base);
}
.qi-prog .qi-pct { width: 36px; text-align: right; font-size: 12px; font-family: var(--font-num); color: var(--c-text-2); }
.qi-res { display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 17px; }
.qi-res .ok { color: var(--c-success); font-family: var(--font-num); }
.qi-res .bad { color: var(--c-danger); font-family: var(--font-num); }
/* 上传记录：结果单行「成功 N 条 · 失败 M 条」 */
.imp-res-line { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
.imp-res-line .ok { color: var(--c-success); font-family: var(--font-num); }
.imp-res-line .bad { color: var(--c-danger); font-family: var(--font-num); }
.imp-res-line .sep { color: var(--c-split); }
.imp-empty { padding: 30px 0; text-align: center; font-size: 13px; color: var(--c-text-2); }
.imp-empty .ic { width: 26px; height: 26px; color: var(--c-primary-200); }
.file-chip {
  display: flex; align-items: center; gap: var(--sp-2); background: var(--c-gray-bg);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); font-size: 13px; color: var(--c-text);
}
.file-chip .fc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fc-size { font-size: 12px; color: var(--c-text-2); font-family: var(--font-num); }

/* 校验概览 */
.check-overview { display: flex; gap: var(--sp-3); }
.check-pill {
  flex: 1; border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); text-align: center;
  border: 1px solid transparent;
}
.check-pill .cp-num { font-size: 24px; font-weight: 600; font-family: var(--font-num); line-height: 32px; }
.check-pill .cp-label { font-size: 12px; margin-top: 4px; }
.check-pill.cp-ok { background: var(--c-success-bg); border-color: #BFE7CB; }
.check-pill.cp-ok .cp-num, .check-pill.cp-ok .cp-label { color: #1E7A38; }
.check-pill.cp-bad { background: var(--c-danger-bg); border-color: #F9C9CB; }
.check-pill.cp-bad .cp-num, .check-pill.cp-bad .cp-label { color: #B31820; }
.check-pill.cp-total { background: var(--c-info-bg); border-color: #BAE0F7; }
.check-pill.cp-total .cp-num, .check-pill.cp-total .cp-label { color: #015A9A; }

/* ==========================================================================
   M7 系统管理
   ========================================================================== */
.org-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--sp-4); align-items: start; }
.perm-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-4); align-items: start; }
.role-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  border-radius: var(--r-sm); cursor: pointer; border: 1px solid transparent;
}
.role-item:hover { background: var(--c-thead); }
.role-item.is-active { background: var(--c-primary-100); border-color: var(--c-primary-200); }
.role-item .ri-name { font-size: 14px; color: var(--c-title); font-weight: 500; }
.role-item .ri-desc { font-size: 12px; color: var(--c-text-2); margin-top: 4px; }

.perm-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.perm-node { border: 1px solid var(--c-split); border-radius: var(--r-sm); padding: var(--sp-3); }
.perm-node .pn-head {
  display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; font-weight: 500;
  color: var(--c-title); padding-bottom: var(--sp-2); border-bottom: 1px dashed var(--c-split); margin-bottom: var(--sp-2);
}
.perm-node .pn-body { display: flex; flex-direction: column; gap: var(--sp-2); }
/* 权限配置子分页（功能权限 / 数据权限） */
.perm-subtabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--c-split); margin-bottom: var(--sp-4); }
.perm-subtab {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px var(--sp-4);
  border: none; background: none; font-family: inherit; font-size: 13px; color: var(--c-text-2);
  cursor: pointer; position: relative; border-radius: var(--r-xs) var(--r-xs) 0 0;
}
.perm-subtab:hover { color: var(--c-primary); background: var(--c-primary-100); }
.perm-subtab.is-on { color: var(--c-primary); font-weight: 500; }
.perm-subtab.is-on::after {
  content: ''; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: -1px;
  height: 2px; background: var(--c-primary); border-radius: 2px;
}
.perm-subtab .ic { width: 14px; height: 14px; }

/* 角色权限 · 适配人员列表（七.4） */
.user-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.user-row {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #fff;
}
.user-row .ur-name { font-size: 14px; color: var(--c-title); font-weight: 500; }
.user-row .ur-account { font-size: 12px; color: var(--c-text-2); font-family: var(--font-num); }
.user-row .ur-desc { font-size: 12px; color: var(--c-text-2); margin-top: 3px; }

/* 项目详情 · 材料统计（五.2） */
.mat-stats { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   指标涨跌（工作台统计卡等）
   ========================================================================== */
.trend-up { color: var(--c-danger); display: inline-flex; align-items: center; gap: var(--sp-1); font-size: 12px; }
.trend-down { color: var(--c-success); display: inline-flex; align-items: center; gap: var(--sp-1); font-size: 12px; }

/* ==========================================================================
   通用页内两栏
   ========================================================================== */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: start; }
.split-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: var(--sp-4); align-items: start; }

/* ---- 二.3：项目名称 + 选择 / 新建项目（合并「关联项目 + 项目名称」） ---- */
.proj-name-field { display: flex; gap: var(--sp-2); align-items: center; }

/* 项目选择器弹窗 */
.pp-new { display: flex; gap: var(--sp-2); align-items: flex-end; margin-bottom: var(--sp-4); }
.pp-new .form-inline { flex: 1; margin: 0; }
.pp-sep { font-size: 12px; color: var(--c-text-muted); margin: 4px 0 10px; padding-left: 2px; }
.pp-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.pp-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--c-split); border-radius: 6px; cursor: pointer; transition: border-color .15s, background .15s; }
.pp-card:hover { border-color: var(--c-primary); background: var(--c-primary-soft); }
.pp-card.is-active { border-color: var(--c-primary); background: var(--c-primary-soft); }
.pp-ic { color: var(--c-primary); flex: none; }
.pp-card .grow { flex: 1; min-width: 0; }
.pp-name { font-weight: 500; color: var(--c-text); }
.pp-meta { margin-top: 2px; }

/* ==========================================================================
   文件模板中心
   覆盖：模板列表、上传文件创建模板、模板预览（Word 版式还原）
   ========================================================================== */

/* ---- 提示性文字 ---- */
.t-warn { color: var(--c-warning); font-weight: 500; }


.tpl-legend { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--c-split); }
.lg-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 12px; color: var(--c-text); padding: 3px 0; }

/* --------------------------------------------------------------------------
   Word 版式还原（模板预览）
   -------------------------------------------------------------------------- */
.tpl-doc-cover { text-align: center; padding: var(--sp-8) 0 var(--sp-6); border-bottom: 1px dashed var(--c-border); margin-bottom: var(--sp-6); }
.tpl-doc-cover .tdc-prj { font-size: 13px; color: var(--c-text-2); letter-spacing: 2px; }
.tpl-doc-cover h1 { font-size: 22px; margin: var(--sp-3) 0; text-indent: 0; }
.tpl-doc-cover .tdc-meta { font-size: 12px; color: var(--c-text-2); }
.tpl-doc-cover .tdc-org { font-size: 13px; color: var(--c-text); margin-top: var(--sp-5); }
.tpl-doc-vol {
  text-align: center; font-size: 15px; font-weight: 600; color: var(--c-title);
  letter-spacing: 4px; margin: var(--sp-8) 0 var(--sp-4);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--c-title);
}
.tpl-doc-h2 { font-size: 16px; margin-top: var(--sp-6); text-indent: 0; }
.tpl-doc-badges { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-3); }
/* Word 版式：章说明（范本编排要点，不属于文档正文，浅底小字） */
.tpl-doc-note {
  margin: 0 0 var(--sp-4); padding: 8px 10px;
  background: var(--c-fill-1); border-left: 2px solid var(--c-primary-300);
  font-size: 12px; line-height: 18px; color: var(--c-text-3);
}
.tpl-doc-h3 { font-size: 14px; font-weight: 600; color: var(--c-title); margin: var(--sp-4) 0 var(--sp-2); text-indent: 0; }
.tpl-doc-h4 { font-size: 13px; font-weight: 500; color: var(--c-text); margin: var(--sp-3) 0 var(--sp-2); text-indent: 0; }

.tpl-doc-field {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 5px var(--sp-2); margin: 3px 0; border-radius: var(--r-xs);
  border-left: 3px solid var(--c-border); background: #FAFBFC;
  font-size: 13px; color: var(--c-text);
}
.tpl-doc-field .tf-no { font-size: 12px; color: var(--c-text-2); min-width: 68px; flex: none; }
.tpl-doc-field .tf-mark { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.tpl-doc-field .tf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-doc-field .tf-req { font-size: 11px; color: var(--c-danger); flex: none; }
.tpl-doc-field .tf-ai { font-size: 11px; color: var(--c-info); flex: none; }
.tpl-doc-field.is-fill { border-left-color: var(--c-primary); background: var(--c-primary-100); }
.tpl-doc-field.is-fill .tf-mark { background: var(--c-primary); }
.tpl-doc-field.is-select { border-left-color: var(--c-warning); background: var(--c-warning-bg); }
.tpl-doc-field.is-select .tf-mark { background: var(--c-warning); }
.tpl-doc-field.is-ref { border-left-color: var(--c-success); background: var(--c-success-bg); }
.tpl-doc-field.is-ref .tf-mark { background: var(--c-success); }
.tpl-doc-field.is-table { border-left-color: var(--c-info); background: var(--c-info-bg); }
.tpl-doc-field.is-table .tf-mark { background: var(--c-info); }
.tpl-doc-field.is-fixed { border-left-color: var(--c-text-2); background: var(--c-gray-bg); }
.tpl-doc-field.is-fixed .tf-mark { background: var(--c-text-2); }

/* 版本对比表 */
.diff-tb td, .diff-tb th { font-size: 13px; }
.diff-tb .t-muted { color: var(--c-text-2); }

/* 响应式 */
/* ==========================================================================
   编辑器 · 版本切换弹窗
   （表格样式已统一为「全框线表格」，原样式选择器 / 预览块已随 v1.9 下线）
   ========================================================================== */
.ver-pick { display: flex; flex-direction: column; gap: 8px; }
.ver-item {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: 10px var(--sp-3);
  border: 1px solid var(--c-split); border-radius: var(--r-sm); cursor: pointer;
  transition: all var(--e-fast);
}
.ver-item:hover { border-color: var(--c-primary-200); background: #FAFDFF; }
.ver-item.is-on { border-color: var(--c-primary); background: var(--c-primary-100); }
.ver-item.is-cur { background: #F4FBF6; border-color: #BFE3C8; }
.ver-item.is-cur.is-on { border-color: var(--c-primary); background: var(--c-primary-100); }
.ver-item .vi-num { flex: none; min-width: 46px; font-size: 14px; font-weight: 600; color: var(--c-primary); font-family: var(--font-num); }
.ver-item .vi-title { display: block; font-size: 13px; font-weight: 500; color: var(--c-title); }
.ver-item .vi-desc { display: block; font-size: 12px; color: var(--c-text-2); margin-top: 3px; line-height: 18px; }
.ver-item .vi-cur { flex: none; align-self: center; }
.ver-item .grow { min-width: 0; }

@media (max-width: 1440px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .wb-main { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
  .editor-right { display: none; }
  .editor-body.is-flow .editor-left,
  .editor-body.is-flow .ed-split { display: none; }
  .org-layout, .perm-layout { grid-template-columns: 1fr; }
  .guide-split, .split-2, .split-3-2 { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .form-2col, .form-3col { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .stat-row { flex-wrap: wrap; }
  .stat-card { flex: 1 1 45%; }
  .diff-row { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--sp-3); }
}

/* ==========================================================================
   v1.9 · 批量编辑表单视图 / 核验规则 / 知识库 / 模板版本 / 一键生成
   ========================================================================== */

/* ---- 批量编辑 · 纯表单视图（编制工作台与审核详情共用同一套渲染） ---- */
.fv-tip {
  display: flex; align-items: flex-start; gap: var(--sp-2); font-size: 12px; line-height: 20px;
  color: var(--c-text-2); background: var(--c-info-bg); border: 1px solid var(--c-primary-100);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
}
.fv-tip .ic { color: var(--c-primary); flex: none; margin-top: 3px; }
.fv-group { border: 1px solid var(--c-split); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.fv-group-head {
  display: flex; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-4);
  background: var(--c-thead); font-size: 13px; font-weight: 600; color: var(--c-title);
}
.fv-group-head .ic { width: 14px; height: 14px; color: var(--c-text-2); }
.fv-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--c-text-2); font-family: var(--font-num); }
.fv-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3) var(--sp-4); padding: var(--sp-4); }
.fv-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fv-item.is-active { border-radius: var(--r-xs); box-shadow: 0 0 0 4px var(--c-primary-100); }
.fv-item.is-active .fv-label { color: var(--c-primary); }
.fv-item.span-2 { grid-column: 1 / -1; }
.fv-label { font-size: 12px; color: var(--c-text-2); display: flex; align-items: flex-start; gap: 4px; line-height: 18px; }
.fv-label .ic { width: 11px; height: 11px; flex: none; }
.fv-lock { color: var(--c-text-3); }
.fv-req { color: var(--c-danger); }
.fv-warn { color: var(--c-warning); font-weight: 700; }
.fv-readonly {
  background: var(--c-gray-bg); border-radius: var(--r-xs); padding: 9px var(--sp-3);
  font-size: 13px; line-height: 20px; color: var(--c-text-2); min-height: 38px;
}
.fv-note { font-size: 12px; color: var(--c-text-3); line-height: 18px; }
.fv-table { overflow-x: auto; }

/* 输入即检索（如结果录入的「成交单位」→ 供应商库） */
.ac-wrap { position: relative; }
.ac-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30;
  background: #fff; border: 1px solid var(--c-split); border-radius: var(--r-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  max-height: 260px; overflow-y: auto; padding: 4px;
}
.ac-menu[hidden] { display: none; }
.ac-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 7px 10px; border-radius: var(--r-xs); cursor: pointer;
}
.ac-item:hover { background: var(--c-info-bg); }
.ac-item .ac-name { font-size: 13px; color: var(--c-title); }
.ac-item .ac-meta { font-size: 12px; color: var(--c-text-2); font-family: var(--font-num); }

/* ---- 模板校验点：核验规则开关列表 ---- */
.chk-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.chk-item {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3);
  border: 1px solid var(--c-split); border-radius: var(--r-sm); background: #fff;
}
.chk-main { flex: 1; min-width: 0; }
.chk-name { font-size: 13px; color: var(--c-title); font-weight: 500; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.chk-desc { font-size: 12px; color: var(--c-text-2); line-height: 18px; margin-top: 4px; }
.chk-sw { flex: none; padding-top: 2px; }
/* 平台已停用的核验点：灰显且不提供开关（平台总闸优先） */
.chk-item.is-off { opacity: .62; background: var(--c-gray-bg); }
.chk-item.is-off .chk-name { color: var(--c-text-2); }


/* ---- 一键生成：上传 Word / 手动输入 分段切换 ---- */
.af-seg { display: inline-flex; border: 1px solid var(--c-border); border-radius: var(--r-sm); overflow: hidden; margin-bottom: var(--sp-4); }
.af-seg-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px var(--sp-4); border: none;
  background: #fff; font-family: inherit; font-size: 13px; color: var(--c-text-2); cursor: pointer;
}
.af-seg-btn + .af-seg-btn { border-left: 1px solid var(--c-border); }
.af-seg-btn:hover { background: var(--c-primary-100); }
.af-seg-btn.is-on { background: var(--c-primary); color: #fff; }
.af-seg-btn .ic { width: 14px; height: 14px; }

/* 导入进度（编辑器「导入」：上传后展示解析 + 校验进度，列出可填充字段） */
.af-steps { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.af-step { flex: 1; font-size: 13px; color: var(--c-muted); padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--r-sm); text-align: center; }
.af-step.is-active { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-100); }
.af-step.is-done { color: var(--c-success); border-color: var(--c-success); }
.af-bar { height: 6px; background: var(--c-border); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.af-bar > i { display: block; height: 100%; background: var(--c-primary); transition: width .2s ease; }
.af-field-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 208px; overflow: auto; columns: 2; column-gap: 16px; }
.af-field-list li { font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--c-border); break-inside: avoid; }

/* 模板创建页：「讲解生成模板」弹窗图 + 文 + 上传后内容预览 */
/* 真实文档截图（讲解生成模板） */
.guide-shot { border: 1px solid var(--c-split); border-radius: var(--r-sm); background: var(--c-gray-bg); padding: var(--sp-3); }
.guide-shot img {
  display: block; width: 100%; max-width: 460px; margin: 0 auto;
  border: 1px solid #E3E5EA; border-radius: 2px; box-shadow: 0 3px 14px rgba(16, 16, 21, .1);
}
.guide-shot .gs-cap { margin-top: 8px; text-align: center; font-size: 12px; line-height: 1.7; color: var(--c-text-2); }
.guide-rules { margin: 8px 0 0; padding-left: 20px; }
.guide-rules li { margin: 6px 0; line-height: 1.7; }
.guide-rules code, .guide-illus + * code, .modal-body .tb code {
  font-family: var(--font-num); background: var(--c-gray-bg); padding: 1px 6px; border-radius: 4px; color: var(--c-primary);
}
.pv-box { border: 1px solid var(--c-border); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); background: var(--c-gray-bg); max-height: 280px; overflow: auto; }
/* 上传后的全文预览：可滚动的文档视图 */
.pv-doc {
  border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #EDEFF3;
  padding: var(--sp-3); max-height: 620px; overflow: auto;
}
.pv-doc .tpl-doc-view.is-mini {
  max-width: none; padding: 30px 34px 40px; box-shadow: 0 1px 6px rgba(0, 0, 0, .08); font-size: 13px;
}
.pv-doc .tpl-doc-view.is-mini .td-vol { margin: 28px 0 14px; font-size: 17px; }
.pv-doc .tpl-doc-view.is-mini .td-h1 { font-size: 15px; margin: 18px 0 10px; }
.pv-doc .tpl-doc-view.is-mini .td-tb { font-size: 12px; }
.pv-vol { margin-bottom: 8px; }
.pv-vol:last-child { margin-bottom: 0; }
.pv-vol-name { font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.pv-chs { list-style: none; margin: 0; padding: 0; }
.pv-chs li { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--c-border); display: flex; align-items: center; gap: 8px; }
.pv-chs li:last-child { border-bottom: none; }
.pv-no { font-family: var(--font-num); color: var(--c-primary); min-width: 38px; }

/* ---- 核验规则管理 ---- */
.cr-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.cr-card { border: 1px solid var(--c-split); border-radius: var(--r-sm); padding: var(--sp-4); background: #fff; }
.cr-card .cr-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.cr-card .cr-name { font-size: 14px; font-weight: 600; color: var(--c-title); }
.cr-card .cr-desc { font-size: 13px; color: var(--c-text); line-height: 20px; margin-top: var(--sp-2); }
.cr-card .cr-items { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* 核验点 · 提示词展示 */
.cr-card .cr-prompt { margin-top: var(--sp-3); border: 1px dashed var(--c-border); border-radius: var(--r-sm); background: var(--c-bg-soft); padding: var(--sp-3); }
.cr-card .cr-prompt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.cr-card .cr-prompt-title { font-size: 12px; font-weight: 600; color: var(--c-title); }
.cr-card .cr-prompt-body { margin: 0; font-family: var(--font-mono, monospace); font-size: 12px; line-height: 18px; color: var(--c-text); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.cr-card .cr-refs { margin-top: var(--sp-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cr-card .cr-refs-label { font-size: 12px; font-weight: 600; color: var(--c-text-2); margin-right: var(--sp-1); }

/* 核验点表单 · 参考文件编辑 */
.cf-ref-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.cf-ref-title { font-size: 13px; font-weight: 600; color: var(--c-title); }
.cf-ref-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.cf-ref-row { display: flex; gap: var(--sp-2); align-items: center; }

/* 提示词管理 */
.pm-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.pm-card { border: 1px solid var(--c-split); border-radius: var(--r-sm); padding: var(--sp-4); background: #fff; }
.pm-top { display: flex; align-items: center; gap: var(--sp-2); }
.pm-idx { width: 22px; height: 22px; border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pm-name { font-size: 14px; font-weight: 600; color: var(--c-title); }
.pm-apply { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.pm-apply-label { font-size: 12px; font-weight: 600; color: var(--c-text-2); margin-right: var(--sp-1); }
.pm-desc { font-size: 13px; color: var(--c-text); line-height: 20px; margin-top: var(--sp-2); }
.pm-content { margin-top: var(--sp-3); border: 1px dashed var(--c-border); border-radius: var(--r-sm); background: var(--c-bg-soft); padding: var(--sp-3); }
.pm-content-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.pm-content-title { font-size: 12px; font-weight: 600; color: var(--c-title); }
.pm-content-body { margin: 0; font-family: var(--font-mono, monospace); font-size: 12px; line-height: 18px; color: var(--c-text); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.row-end { display: flex; justify-content: flex-end; }

/* 四.1：AI 核验调度（圆形进度 + 逐项输出，杀毒软件式，可展开 / 收起） */
/* 左栏「AI 核验调度」（原页头整卡迁入；列宽 264，故环形与字号按窄栏收敛） */
.avp-top { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.editor-left .av-ring-wrap, .editor-left .av-ring { width: 72px; height: 72px; }
.editor-left .av-ring-num { font-size: 14px; }
.av-ring-wrap { position: relative; flex: none; width: 108px; height: 108px; }
.av-ring { width: 108px; height: 108px; transform: rotate(-90deg); }
.av-ring-bg { fill: none; stroke: var(--c-primary-100); stroke-width: 10; }
.av-ring-fg { fill: none; stroke: var(--c-primary); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .35s ease; }
.av-ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: var(--c-primary); font-family: var(--font-num); }
.av-status {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-bottom: var(--sp-3); text-align: center;
}
.av-status-main { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--c-primary); }
.av-status-main .ic { flex: none; }
.av-status-main.is-ok { color: var(--c-success); }
.av-status-sub { font-size: 11px; color: var(--c-text-2); line-height: 16px; }
.av-list { display: flex; flex-direction: column; gap: var(--sp-2); }
/* 核验结果行：默认可见（不再依赖逐项入场动画，避免非动画路径渲染后整块空白），
   逐项输出时由 .is-in 播放一次淡入。
   flex: 0 0 auto 不可省 —— .av-list 是列向 flex 容器且高度受限，核验项若参与收缩
   会被压到低于内容高度，再被自身 overflow:hidden 拦腰裁掉（标签行只剩上半截）。 */
.av-item { flex: 0 0 auto; border: 1px solid var(--c-split); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.av-item.is-in { animation: avIn .3s ease both; }
@keyframes avIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.av-item-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px;
  padding: 6px var(--sp-3) 7px; cursor: pointer; user-select: none;
}
/* 第二行与名目文字左对齐（让开状态点 8px + 间距 6px） */
.av-item-head .av-tags { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 14px; }
.av-item-head:hover { background: var(--c-thead); }
.av-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.av-dot.is-success { background: var(--c-success); }
.av-dot.is-warning { background: var(--c-warning); }
.av-dot.is-danger { background: var(--c-danger); }
.av-item-name {
  flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 500; color: var(--c-title);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.av-caret { margin-left: auto; color: var(--c-text-2); transition: transform var(--e-fast); display: inline-flex; }
/* 结论小色块（11px / 18px 高）：替代原先直接复用的 24px .tag，窄栏不再折行或被裁切 */
.av-res {
  flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border-radius: var(--r-xs); font-size: 11px; font-weight: 500; line-height: 1;
}
.av-res.is-success { background: var(--c-success-bg); color: var(--c-success); }
.av-res.is-warning { background: var(--c-warning-bg); color: #B87A00; }
.av-res.is-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.av-eng { font-size: 11px; color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-item.is-open .av-caret { transform: rotate(180deg); }
.av-item-body { display: none; padding: var(--sp-3); border-top: 1px dashed var(--c-split); background: #F7F9FC; }
.av-item.is-open .av-item-body { display: block; }
.av-items { margin-bottom: var(--sp-2); }
.av-none { font-size: 12px; color: var(--c-success); display: inline-flex; align-items: center; gap: 4px; }
.av-risk {
  border-left: 3px solid var(--c-split); padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-2);
  background: #fff; border-radius: var(--r-xs); cursor: pointer; transition: box-shadow var(--e-fast);
}
.av-risk:hover { box-shadow: var(--sh-hover); }
.av-risk.is-high { border-left-color: var(--c-danger); }
.av-risk.is-mid { border-left-color: var(--c-warning); }
.av-risk.is-low { border-left-color: var(--c-info); }
.av-risk-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 4px; flex-wrap: wrap; }
.av-risk-desc { font-size: 12px; color: var(--c-text); line-height: 18px; }
.av-risk-fix { font-size: 12px; color: var(--c-text-2); margin-top: 4px; display: flex; gap: 4px; }
.av-risk-fix .ic { color: var(--c-success); flex: none; margin-top: 2px; }
/* 汇总置顶（环形进度下方），与列表之间留出分隔间距 */
.av-summary { margin: 0 0 var(--sp-3); }
.av-summary:empty { display: none; }
/* 三列等分：数字在上、名目在下（原一行长句在 240px 栏内折成 4 行，占掉 150px 高度） */
.av-summary-inner {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); background: var(--c-primary-100); border-radius: var(--r-sm);
}
.av-sum { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.av-sum b { font-family: var(--font-num); font-size: 17px; font-weight: 600; line-height: 1.2; }
.av-sum span { font-size: 11px; line-height: 14px; }
.av-sum.is-pass b, .av-sum.is-pass span { color: var(--c-success); }
.av-sum.is-review b, .av-sum.is-review span { color: #C77700; }
.av-sum.is-fail b, .av-sum.is-fail span { color: var(--c-danger); }
.av-summary-note {
  display: flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 11px; line-height: 16px; color: var(--c-text-2);
}

/* ==========================================================================
   项目中心 · 新建项目（M4-4.0）：创建方式 / 导入解析 / 项目级核验规则
   ========================================================================== */
.form-3col .span-2 { grid-column: span 2; }
.form-3col .span-3 { grid-column: 1 / -1; }

.np-src { display: inline-flex; align-items: center; gap: 3px; margin-top: var(--sp-2);
  height: 18px; padding: 0 var(--sp-2); border-radius: 9px;
  background: var(--c-primary-100); color: var(--c-primary); font-size: 11px; line-height: 18px; }
.np-src svg { width: 11px; height: 11px; }

.np-rules { display: flex; flex-direction: column; gap: var(--sp-4); }
.np-rule-cat-h { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2);
  font-size: 13px; font-weight: 500; color: var(--c-title); }
.np-rule-cat-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-bg);
  color: var(--c-text-2); font-size: 11px; line-height: 18px; text-align: center; font-family: var(--font-num); }
.np-rule-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2) var(--sp-4); }
.np-rule { display: flex; align-items: center; gap: var(--sp-2); padding: 7px var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.np-rule.is-on { border-color: var(--c-primary); background: var(--c-primary-100); }
.np-rule input { width: 14px; height: 14px; accent-color: var(--c-primary); }
.np-rule-name { font-size: 13px; color: var(--c-text); }
.np-rule-eng { margin-left: auto; font-size: 11px; color: var(--c-text-2); }
.np-rule.is-on .np-rule-name { color: var(--c-primary); }

.form-item.is-invalid .input, .form-item.is-invalid .select, .form-item.is-invalid .textarea { border-color: var(--c-danger); }

/* 项目详情 · 项目级核验规则（只读展示） */
.pr-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pr-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border: 1px solid var(--c-border); border-radius: 13px; background: #fff;
  font-size: 13px; color: var(--c-text); }
.pr-chip-cat { font-size: 11px; color: var(--c-text-2); }

/* 项目详情 · 同类项目（归集） */
.fam-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.fam-name { font-size: 14px; font-weight: 600; color: var(--c-title); }
.fam-sug { display: flex; flex-direction: column; gap: var(--sp-2); }
.fam-opt { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-4);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.fam-opt.is-on { border-color: var(--c-primary); background: var(--c-primary-100); }
.fam-opt input { width: 14px; height: 14px; accent-color: var(--c-primary); }
.fam-opt-n { font-size: 14px; color: var(--c-title); }
.fam-opt-c { margin-left: auto; font-size: 12px; color: var(--c-text-2); }
table.tb tbody tr.is-self td { background: var(--c-primary-100); }
/* 卡片内联空态：不用整块 emptyState，避免撑出大片空白 */
.mod-empty { padding: 10px 0 2px; font-size: 13px; color: var(--c-text-2); }
/* 打印 */
@media print {
  .topnav, .side-menu, .tabs-bar, .editor-toolbar, .editor-foot, .editor-left, .editor-right { display: none !important; }
  .doc-paper { box-shadow: none; padding: 0; max-width: none; }
}
