/* 仅放新增部分：登录层、视图占位、顶部用户区。
 * 客户原有样式全部留在 app.css（脚本抽取，勿手改），这里只做加法，便于对照 Demo 逐像素还原。
 */

/* .app 自带 display:flex，会盖掉 [hidden] 的 UA 样式，这里显式兜住 */
.app[hidden] { display: none !important; }

.login-layer {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: #eef2f6;
}
.login-layer[hidden] { display: none; }

.login-card {
  display: flex; width: 720px; min-height: 392px;
  background: #fff; border: 1px solid #dfe6ee; border-radius: 4px;
  box-shadow: 0 10px 30px rgba(14, 42, 71, .12);
  overflow: hidden;
}
.login-brand {
  width: 280px; flex-shrink: 0;
  background: #0e2a47; color: #dce9f6;
  padding: 36px 28px; display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.login-brand svg { width: 34px; height: 34px; color: #7fb4e8; margin-bottom: 6px; }
.login-brand h1 { font-size: 18px; font-weight: 500; color: #fff; line-height: 1.5; letter-spacing: 1px; }
.login-brand p { font-size: 12px; color: #a9bfd6; }

.login-form { flex: 1; padding: 32px 36px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.login-form h2 { font-size: 15px; font-weight: 500; color: #1e293b; margin-bottom: 4px; letter-spacing: 1px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #64748b; }
.login-form input {
  height: 34px; padding: 0 10px;
  border: 1px solid #e2e8f0; border-radius: 4px;
  color: #334155; background: #fff; font-size: 13px;
}
.login-form input:focus { border-color: #4da3ff; box-shadow: 0 0 0 2px rgba(77, 163, 255, .15); }
.login-msg { min-height: 18px; font-size: 12px; color: #dc2626; }
.login-btn {
  height: 36px; border: none; border-radius: 4px;
  background: #175294; color: #fff; font-size: 13px; letter-spacing: 3px;
  transition: background .15s;
}
.login-btn:hover { background: #1d5fa8; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-tip { font-size: 11px; color: #94a3b8; text-align: center; margin-top: 2px; }

/* 顶部用户区：Demo 无登录态，这里补最小必要的身份与退出入口 */
.user-chip {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; color: #64748b; font-size: 12px; border-left: 1px solid #eef2f6;
}
.user-chip .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: #175294; color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.user-chip .logout { color: #94a3b8; cursor: pointer; }
.user-chip .logout:hover { color: #ef4444; }

/* 视图宿主：充当 Demo 里 .content 的内容槽。
   Demo 的 .content 本身就是"白底卡片"（margin 8px + 1px 边框），迁进来的视图自己带卡片，
   所以这里把外壳的 margin/border 收掉，改由 .view 直接摆卡片——实测与原 Demo 同宽同位。 */
.main > .content { margin: 0; border: none; background: transparent; }
.view-host { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0; min-height: 0; }
.view-host > .view.show {
  flex: 1; flex-direction: column; min-height: 0; margin: 8px;
  background: #ffffff; border: 1px solid #dfe6ee; border-radius: 3px; overflow: hidden;
}
.view-placeholder {
  border: 1px dashed #dfe6ee; border-radius: 3px;
  padding: 40px 24px; text-align: center; color: #94a3b8;
  background: #fafcfe;
}
.view-placeholder strong { display: block; font-size: 14px; font-weight: 500; color: #475569; margin-bottom: 8px; }
.view-placeholder p { font-size: 12px; line-height: 1.9; }

/* 纠错页：Demo 只给了四类的徽标配色，七类统计里多出的三类补上（只加不改） */
.cat-信息完整 { background: #ecfeff; color: #0891b2; }
.cat-结构要素 { background: #f1f5f9; color: #475569; }
.cat-版式 { background: #fefce8; color: #a16207; }
.cat-其他 { background: #f1f5f9; color: #475569; }

/* 纠错工具栏的来源文书说明：六类文书的标题比 Demo 的四个长，不限宽会把行撑爆，
   限宽省略后工具栏仍是两行（比 Demo 多一行是六类按钮的必然结果，见 PRJ-003 交付记录）。 */
#corrSource {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 归档页（PRJ-004），以下都是 Demo 没有的新增件 ---------------- */

/* 勾选框列：Demo 的批量归档是"一键全归"，甲方要求能挑件，所以加一列。
   样式跟随表格文字色，不另设主题色，避免和 np-table 的表头分割线打架。 */
#viewArchive .np-table th,
#viewArchive .np-table td { vertical-align: middle; }
#viewArchive .np-check {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
  cursor: pointer;
}
#viewArchive .np-check:disabled { cursor: not-allowed; opacity: 0.45; }
#viewArchive .np-mini[disabled] { opacity: 0.5; cursor: not-allowed; }

/* 归档件详情弹层：沿用 Demo 的卡片语言（白底圆角、浅描边、轻阴影），
   不引入新字体与新色系，保证与整体一致。 */
.ar-layer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.ar-dialog {
  width: 560px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.ar-dialog-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
  color: #1e293b;
}
.ar-x { cursor: pointer; font-size: 18px; line-height: 1; color: #94a3b8; }
.ar-x:hover { color: #475569; }
.ar-dialog-bd { padding: 6px 18px 14px; overflow: auto; }
.ar-meta { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ar-meta th {
  width: 88px;
  text-align: left;
  font-weight: 500;
  color: #64748b;
  padding: 7px 0;
  vertical-align: top;
  white-space: nowrap;
}
.ar-meta td { color: #1e293b; padding: 7px 0; line-height: 1.7; word-break: break-all; }
.ar-meta tr + tr th,
.ar-meta tr + tr td { border-top: 1px dashed #eef2f7; }
.ar-meta-note { margin-top: 12px; font-size: 11.5px; color: #94a3b8; }
.ar-dialog-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #eef2f7;
  background: #fafcfe;
}

/* ---------------- 数据脱敏页（PRJ-005），以下都是 Demo 没有的新增件 ---------------- */

/* 左右对照按段落一行一个 div：Demo 是把整段拼成一坨文本，正式版要能看清"哪一行遮了什么" */
#viewMask .mk-line { min-height: 1em; }
/* 表格行里的制表符用全角空格占位，两个单元格之间不至于粘在一起 */
#viewMask .mk-tab { display: inline-block; width: 1.4em; }

/* 空状态与"解析不了"的提示：解析失败必须一眼看出来，不能只留一片空白让人以为没命中 */
#viewMask .mk-empty {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.9;
  padding: 6px 0;
}
#viewMask .mk-warn { color: #b45309; }
#viewMask .mk-warn strong { display: block; color: #b45309; margin-bottom: 4px; }
#viewMask .mk-warn p { color: #92400e; margin: 0; }

/* 规则行在窄屏下名称列会挤掉说明，收窄一点 */
#viewMask .np-rule .rn { width: 104px; }

/* ---------------- 分权分域页（PRJ-006），以下都是 Demo 没有的新增件 ---------------- */

/* ---------------- 日志审计页（管理员入口改独立页面，PRJ-006 2026-11-23 增补） ---------------- */

/* 口令闸门：原抽屉里贴边全高，独立页里做成居中卡片，与登录页同一卡片语言（白底浅描边轻阴影） */
#viewAdmin .admin-login {
  max-width: 380px;
  margin: 56px auto;
  background: #fff;
  border: 1px solid #e2e9f2;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(14, 42, 71, 0.06);
  padding: 36px 28px;
}

/* 日志列表原来是抽屉里 flex 撑满滚动，页面里改成卡片内限高滚动，两卡并排不把页撑到无限长 */
#viewAdmin .log-list {
  flex: none;
  max-height: 430px;
  overflow-y: auto;
}

/* 矩阵勾选格：Demo 只有 ✓ / —，正式版补上悬停与键盘可达的视觉反馈（不改尺寸） */
#viewRbac .np-matrix td.np-c { user-select: none; }
#viewRbac .np-matrix td.np-c:hover { background: #eff6ff; }
#viewRbac .np-matrix tr:hover td { background: #fbfdff; }

/* 数据域四行可点开编辑：右侧那行「点击修改」在浅色底上要够清但别抢主信息 */
#viewRbac .np-domain:hover { background: #f8fbff; }
#viewRbac .np-domain:hover .dn { color: #1d4ed8; }

/* 恢复默认 / 数据域编辑弹层里的单选与复选：沿用系统字体与 12.5px，和表单行一致 */
#rbDialog label { line-height: 1.9; }
#rbDialog input[type="radio"], #rbDialog input[type="checkbox"] { margin-right: 6px; vertical-align: -1px; }

/* ===== 文书生成页（2026-11-23 流程改造） ===== */

/* 已上传条：只在解析成功后出现，正文不在这里展开 */
.source-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 360px;
  padding: 3px 4px 3px 9px; border: 1px solid #bbf7d0; background: #f0fdf4; color: #15803d;
  border-radius: 14px; font-size: 11.5px; line-height: 1.6;
}
.source-chip.hidden { display: none; }
.source-chip svg { flex-shrink: 0; }
.source-chip #sourceChipText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-reset {
  border: none; background: transparent; color: #15803d; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 50%;
}
.source-reset:hover { background: #dcfce7; }

/* 文书类型：可关闭页签（不是单选按钮组） */
.doc-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.doc-tabs .ds-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #d7e0ea; background: #fff; color: #475569;
  padding: 5px 8px 5px 10px; border-radius: 4px; font-size: 12px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.doc-tabs .ds-btn:hover { background: #f1f5f9; }
.doc-tabs .ds-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.ds-pending {
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; background: #fef3c7; color: #b45309; font-size: 10.5px; padding: 0 4px;
}
.ds-ok { color: #16a34a; font-size: 11px; }
.doc-tabs .ds-btn.active .ds-ok { color: #bbf7d0; }
.doc-tabs .ds-btn.active .ds-pending { background: #fff7ed; color: #c2410c; }
.ds-close {
  display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 12px; line-height: 1; color: #94a3b8;
}
.ds-close:hover { background: rgba(15, 23, 42, .12); color: #0f172a; }
.doc-tabs .ds-btn.active .ds-close { color: #dbeafe; }
.doc-tabs .ds-btn.active .ds-close:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.ds-close.locked { opacity: .35; cursor: not-allowed; }
.ds-close.locked:hover { background: transparent; color: inherit; }

/* 添加文书：下拉多选面板 */
.doc-add { position: relative; display: inline-block; }
.doc-add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px dashed #b9c8d8; background: #fff; color: #2563eb;
  padding: 4px 9px; border-radius: 4px; font-size: 11.5px; cursor: pointer;
}
.doc-add-btn:hover, .doc-add.open .doc-add-btn { background: #eff6ff; border-color: #93c5fd; }
.doc-add-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 210px;
  background: #fff; border: 1px solid #dbe3ec; border-radius: 5px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12); padding: 6px;
}
.doc-add-menu.hidden { display: none; }
.doc-add-head { font-size: 11px; color: #94a3b8; padding: 3px 6px 6px; }
.doc-add-item { display: flex; align-items: center; gap: 7px; padding: 6px; border-radius: 4px; font-size: 12px; color: #334155; cursor: pointer; }
.doc-add-item:hover { background: #f1f5f9; }
.doc-add-empty { font-size: 12px; color: #94a3b8; padding: 8px; }
.doc-add-foot { border-top: 1px solid #eef2f7; margin-top: 6px; padding-top: 6px; text-align: right; }
.doc-add-foot .btn { font-size: 11.5px; padding: 4px 10px; }

/* 待补要素：后端存 {{键}}，页面上换成醒目的标记，保存前再换回去 */
.ph {
  background: #fef3c7; color: #b45309; border-bottom: 1px dashed #f59e0b;
  border-radius: 2px; padding: 0 2px;
}
.ph-line {
  display: block; margin: 8px 0; padding: 8px 10px;
  background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 4px;
  color: #b45309; font-size: 12px;
}
.wb-doc .ph-slot {
  margin: 8px 0; padding: 8px 10px; background: #fffbeb;
  border: 1px dashed #fcd34d; border-radius: 4px;
}
.wb-doc .ph-slot .ph { background: transparent; border-bottom: none; }

/* 脱敏设置：一键脱敏右侧的设置按钮 + 勾选面板（三处共用，见 js/mask-settings.js） */
.mask-set-btn {
  width: 30px; height: 30px; padding: 0; justify-content: center;
  border: 1px solid #cbd5e1; background: #fff; color: #475569;
}
.mask-set-btn:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.mask-set-btn.set-on { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }

.mset-panel {
  position: fixed; z-index: 1200; width: 316px;
  background: #fff; border: 1px solid #dbe4ef; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
  font-size: 12px; color: #334155; overflow: hidden;
}
.mset-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid #eef2f7; background: #fbfdff;
}
.mset-title { font-weight: 600; color: #1e293b; }
.mset-x {
  margin-left: auto; border: 0; background: transparent; color: #94a3b8;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.mset-x:hover { color: #0f172a; }
.mset-body { padding: 6px 4px; max-height: 296px; overflow: auto; }
.mset-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 4px; cursor: pointer;
}
.mset-row:hover { background: #f8fafc; }
.mset-row.on { background: #f1f7ff; }
.mset-row input { width: 13px; height: 13px; accent-color: #2563eb; cursor: pointer; }
.mset-name { color: #1e293b; }
.mset-row.on .mset-name { color: #1d4ed8; font-weight: 600; }
.mset-hint { color: #94a3b8; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mset-hits { margin-left: auto; color: #0284c7; font-size: 11px; white-space: nowrap; }
.mset-hits.zero { color: #cbd5e1; }
.mset-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-top: 1px solid #eef2f7; background: #fbfdff;
}
.mset-total { color: #64748b; font-size: 11px; }
.mset-acts { margin-left: auto; display: inline-flex; gap: 8px; }
.mset-link {
  border: 0; background: transparent; color: #2563eb; font-size: 11.5px;
  cursor: pointer; padding: 0;
}
.mset-link:hover { text-decoration: underline; }
.mset-warn { padding: 5px 10px 7px; color: #b45309; background: #fffbeb; font-size: 11px; }
.mset-note { padding: 6px 10px 8px; color: #94a3b8; font-size: 11px; line-height: 1.5; }

/* ---------------- 文书纠错页的门禁与获取文书（2026-11-23 增补） ---------------- */

/* 未取到文书时：工具栏与正文整块收起，只留门禁卡片，避免点一堆按钮都提示"请先选择文书" */
#viewCorr.gate .toolbar,
#viewCorr.gate .corr-body {
  display: none;
}
.corr-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px 24px;
  text-align: center;
  color: #94a3b8;
}
.corr-gate-title { font-size: 14px; font-weight: 500; color: #475569; }
.corr-gate-sub { max-width: 560px; font-size: 12px; line-height: 1.9; }
.corr-gate-form { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.corr-gate-form .input { width: 240px; }
.corr-gate-note { font-size: 11px; color: #b6c2d1; }

/* 通用弹窗里的正文与清单（保存确认、获取文书） */
.hg-note { margin: 4px 0; font-size: 12.5px; line-height: 1.9; color: #475569; }
.hg-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.hg-search .input { flex: 1; }
.hg-list {
  max-height: 322px; overflow: auto;
  border: 1px solid #eef2f7; border-radius: 5px;
}
.hg-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-bottom: 1px dashed #eef2f7;
  font-size: 12px; color: #334155; cursor: pointer;
}
.hg-row:last-child { border-bottom: 0; }
.hg-row:hover { background: #f1f7ff; }
.hg-type { font-weight: 600; color: #1e293b; white-space: nowrap; }
.hg-no { color: #64748b; white-space: nowrap; }
.hg-meta { margin-left: auto; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.hg-empty { padding: 18px 10px; text-align: center; font-size: 12px; color: #94a3b8; }

/* ---------------- 用户管理页（PRJ-006 增补，2026-11-23） ---------------- */

/* 工具栏里的搜索框：与 .select 同高，别比旁边的下拉高一截 */
#viewUsers .us-search {
  width: 190px; height: 30px; padding: 0 10px;
  border: 1px solid #d7e0ec; border-radius: 5px;
  font-size: 12px; color: #1e293b; background: #fff;
}
#viewUsers .us-search:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
#viewUsers .np-table td { vertical-align: middle; }

/* 角色：一个角色一枚浅蓝签，多个角色并排不换行挤成两行 */
.us-role {
  display: inline-block; margin: 1px 4px 1px 0; padding: 1px 7px;
  background: #eef4ff; color: #1d4ed8; border-radius: 4px;
  font-size: 11px; line-height: 1.7; white-space: nowrap;
}

/* 状态：绿=启用、灰=停用，和日志页的浅色语言一致 */
.us-status {
  display: inline-block; padding: 1px 8px; border-radius: 9px;
  font-size: 11px; line-height: 1.8;
}
.us-status.on { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.us-status.off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.us-self-tag {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  border: 1px solid #bfdbfe; border-radius: 3px;
  background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 400;
}
.us-self-tip { color: #94a3b8; font-size: 11px; }
#viewUsers .us-danger { color: #b91c1c; }
#viewUsers .us-danger:hover { background: #fef2f2; border-color: #fecaca; }
.us-empty { padding: 26px 10px; text-align: center; font-size: 12px; color: #94a3b8; }

/* 新建 / 编辑弹窗：一行一个字段，两列只留给区划与部门 */
.us-form { font-size: 12.5px; color: #334155; }
.us-field { display: block; margin-bottom: 12px; }
.us-field > span { display: block; margin-bottom: 4px; font-weight: 600; color: #1e293b; }
.us-field input {
  width: 100%; height: 32px; padding: 0 9px; box-sizing: border-box;
  border: 1px solid #d7e0ec; border-radius: 5px; font-size: 12.5px; color: #1e293b;
}
.us-field input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.us-field input:disabled { background: #f8fafc; color: #64748b; }
.us-field i { display: block; margin-top: 3px; font-style: normal; font-size: 11px; color: #94a3b8; }
.us-pair { display: flex; gap: 12px; }
.us-pair .us-field { flex: 1; }

.us-roles {
  border: 1px solid #e6edf5; border-radius: 5px;
  max-height: 186px; overflow: auto; padding: 4px;
}
.us-roleline {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 7px; border-radius: 4px; cursor: pointer;
}
.us-roleline:hover { background: #f6f9fd; }
.us-roleline input { width: 13px; height: 13px; accent-color: #2563eb; cursor: pointer; }
.us-roleline span { color: #94a3b8; font-size: 11px; }
.us-form-err { min-height: 16px; color: #b91c1c; font-size: 11.5px; }

.us-confirm { font-size: 12.5px; line-height: 1.95; color: #475569; }
.us-pwd {
  margin: 10px 0 2px; padding: 12px; text-align: center;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 5px;
  font-family: Consolas, "Courier New", monospace; font-size: 18px; letter-spacing: 1px; color: #0f172a;
  user-select: all;
}

/* 分权分域页顶部的「用户管理」入口：工具栏里的小跳转，不抢主按钮 */
#viewRbac .rb-gousers {
  border: 1px solid #cbd5e1; background: #fff; color: #1d4ed8;
  font-size: 11.5px; padding: 4px 9px; border-radius: 4px; cursor: pointer;
}
#viewRbac .rb-gousers:hover { background: #eff6ff; border-color: #93c5fd; }

/* ---------------- 规则库页（PRJ-007，2026-11-23） ---------------- */

/* 四类规则的类型切换：按钮组，选中的用蓝底，跟工具栏按钮同高 */
.rl-tabs { display: inline-flex; gap: 4px; }
.rl-kind {
  height: 28px; padding: 0 11px; border: 1px solid #d7e0ec; border-radius: 5px;
  background: #fff; color: #475569; font-size: 12px; cursor: pointer;
}
.rl-kind:hover { border-color: #93c5fd; color: #1d4ed8; }
.rl-kind.on { background: #2563eb; border-color: #2563eb; color: #fff; }

#viewRules .rl-search {
  width: 190px; height: 28px; padding: 0 9px;
  border: 1px solid #d7e0ec; border-radius: 5px;
  font-size: 12px; color: #1e293b; background: #fff;
}
#viewRules .rl-search:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
#viewRules .np-table td { vertical-align: middle; font-size: 11.5px; color: #475569; }
.rl-code {
  font-family: Consolas, "Courier New", monospace; font-size: 11px;
  background: #f6f8fb; border: 1px solid #e6edf5; border-radius: 3px; padding: 0 4px; color: #334155;
}
.rl-null { color: #cbd5e1; }
.rl-empty { padding: 26px 10px; text-align: center; font-size: 12px; color: #94a3b8; }
.rl-danger { color: #b91c1c; }
.rl-danger:hover { background: #fef2f2; border-color: #fecaca; }

.rl-status { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 11px; line-height: 1.8; }
.rl-status.on { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.rl-status.off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* 试跑面板 */
.rl-sample {
  width: 100%; box-sizing: border-box; min-height: 74px; padding: 8px 10px;
  border: 1px solid #d7e0ec; border-radius: 5px; font-size: 12.5px; line-height: 1.8; color: #1e293b;
  font-family: inherit; resize: vertical;
}
.rl-sample:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.rl-pv-out { margin-top: 10px; font-size: 12px; color: #475569; }
.rl-pv-empty { color: #94a3b8; font-size: 12px; }
.rl-pv-sum { margin-bottom: 6px; color: #0f172a; font-weight: 600; }
.rl-pv-list { margin: 0 0 8px; padding-left: 18px; line-height: 1.95; }
.rl-pv-list li { color: #475569; }
.rl-pv-list del { color: #b91c1c; text-decoration: line-through; background: #fef2f2; padding: 0 2px; }
.rl-pv-list ins { color: #15803d; text-decoration: none; background: #ecfdf5; padding: 0 2px; }
.rl-pv-para { margin-left: 7px; color: #94a3b8; font-size: 11px; }
.rl-pv-hd2 { margin: 8px 0 4px; color: #64748b; font-size: 11px; }
.rl-pv-text {
  margin: 0; padding: 9px 11px; background: #f8fafc; border: 1px solid #e6edf5; border-radius: 5px;
  font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-all; color: #1e293b; max-height: 220px; overflow: auto;
}
.rl-pv-warn { margin-top: 6px; color: #b45309; font-size: 11.5px; }

/* 弹窗表单 */
.rl-form { font-size: 12.5px; color: #334155; }
.rl-field { display: block; margin-bottom: 11px; }
.rl-field > span { display: block; margin-bottom: 4px; font-weight: 600; color: #1e293b; }
.rl-field input, .rl-field select, .rl-field textarea {
  width: 100%; box-sizing: border-box; padding: 0 9px;
  border: 1px solid #d7e0ec; border-radius: 5px; font-size: 12.5px; color: #1e293b;
  font-family: inherit;
}
.rl-field input, .rl-field select { height: 32px; }
.rl-field textarea { padding: 7px 9px; line-height: 1.8; resize: vertical; }
.rl-field input:focus, .rl-field select:focus, .rl-field textarea:focus {
  outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08);
}
.rl-field input:disabled, .rl-field select:disabled, .rl-field textarea:disabled { background: #f8fafc; color: #64748b; }
.rl-field i { display: block; margin-top: 3px; font-style: normal; font-size: 11px; color: #94a3b8; }
.rl-req { font-style: normal; font-weight: 400; color: #f59e0b; font-size: 10px; }
.rl-check { display: flex; align-items: center; gap: 6px; margin-bottom: 11px; font-weight: 600; color: #1e293b; }
.rl-check input { width: 14px; height: 14px; accent-color: #2563eb; }
.rl-form-err { min-height: 16px; color: #b91c1c; font-size: 11.5px; }

.rl-form-pv { margin-top: 4px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
.rl-form-pv-hd { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: #1e293b; }
.rl-form-pv-hd span { font-weight: 400; color: #94a3b8; font-size: 11px; }
.rl-form-pv textarea {
  width: 100%; box-sizing: border-box; min-height: 54px; padding: 7px 9px;
  border: 1px solid #d7e0ec; border-radius: 5px; font-size: 12px; line-height: 1.8; font-family: inherit;
  resize: vertical;
}
.rl-form-pv-ft { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.rl-form-pv-tip { color: #94a3b8; font-size: 11px; }

.rl-confirm { font-size: 12.5px; line-height: 1.95; color: #475569; }

/* 表单弹窗：滚动交给 .ar-dialog-bd（它本来就有 overflow:auto），这里不再套一层 */
.rl-form { padding-right: 4px; }

/* 必填标记跟在标签后，不单独占一行（.rl-field i 是块级提示，会误伤它） */
.rl-field .rl-req { display: inline; margin: 0 0 0 5px; font-style: normal; font-weight: 400; color: #f59e0b; font-size: 10px; }

/* 浏览器自动填充会给输入框铺一层浅绿底，盖成白底保持一致 */
#viewRules input:-webkit-autofill,
#viewRules textarea:-webkit-autofill,
.ar-layer input:-webkit-autofill,
.ar-layer textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #1e293b !important;
  transition: background-color 9999s ease-out 0s;
}

/* ---------------- AI 能力页（PRJ-009，2026-11-24） ---------------- */

/* 配置区：三列九项，窄屏自动塌成一列 */
#viewAi .ai-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}
#viewAi .ai-field > span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #1e293b; }
#viewAi .ai-field input,
#viewAi .ai-field select {
  width: 100%; box-sizing: border-box; height: 32px; padding: 0 9px;
  border: 1px solid #d7e0ec; border-radius: 5px;
  font-size: 12.5px; color: #1e293b; background: #fff; font-family: inherit;
}
#viewAi .ai-field input:focus,
#viewAi .ai-field select:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
#viewAi .ai-field i { display: block; margin-top: 3px; font-style: normal; font-size: 10.5px; color: #94a3b8; }
#viewAi .ai-actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
#viewAi .ai-testout { font-size: 11.5px; color: #64748b; }
#viewAi .ai-testout.ok { color: #15803d; }
#viewAi .ai-testout.bad { color: #b91c1c; }
#viewAi .ai-privacy {
  margin-top: 11px; padding: 8px 11px; border-radius: 5px;
  background: #f6f9fd; border: 1px solid #e2e9f2;
  font-size: 11.5px; line-height: 1.7; color: #475569;
}

/* 二选一按钮组：总开关与每项能力的模式都用它 */
#viewAi .ai-seg { display: inline-flex; gap: 3px; }
#viewAi .ai-seg button {
  height: 30px; padding: 0 13px; border: 1px solid #d7e0ec; border-radius: 5px;
  background: #fff; color: #475569; font-size: 12px; cursor: pointer;
}
#viewAi .ai-seg button:hover { border-color: #93c5fd; color: #1d4ed8; }
#viewAi .ai-seg button.on { background: #2563eb; border-color: #2563eb; color: #fff; }
#viewAi .ai-seg-sm button { height: 27px; padding: 0 11px; font-size: 11.5px; }

/* 六项能力：一行一项，左边说明右边开关 */
#viewAi .ai-feat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #eef2f7;
}
#viewAi .ai-feat:last-child { border-bottom: none; }
#viewAi .ai-feat-hd { grid-column: 1; display: flex; align-items: center; gap: 7px; font-size: 13px; color: #0f172a; }
#viewAi .ai-feat-bd { grid-column: 1; }
#viewAi .ai-feat .ai-seg { grid-column: 2; grid-row: 1 / span 2; }
#viewAi .ai-line { font-size: 11.5px; line-height: 1.9; color: #64748b; }
#viewAi .ai-line span { display: inline-block; width: 60px; color: #94a3b8; }
#viewAi .ai-line em { font-style: normal; color: #475569; }

#viewAi .ai-chip {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 10.5px; line-height: 1.8; white-space: nowrap;
}
#viewAi .ai-chip.on, #viewAi .ai-chip.ok { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
#viewAi .ai-chip.off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
#viewAi .ai-chip.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
#viewAi .ai-chip.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
#viewAi .ai-chip.b { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* 试跑 */
#viewAi .ai-try { display: flex; align-items: center; gap: 9px; }
#viewAi .ai-try select { max-width: 460px; }
#viewAi .ai-trytip { font-size: 11.5px; color: #94a3b8; }
#viewAi .ai-advices { margin-top: 12px; }
#viewAi .ai-empty { padding: 22px 10px; text-align: center; font-size: 12px; color: #94a3b8; }
#viewAi .ai-note {
  margin-bottom: 8px; padding: 8px 11px; border-radius: 5px;
  background: #f8fafc; border: 1px solid #e2e8f0; font-size: 11.5px; color: #475569;
}
#viewAi .ai-note.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
#viewAi .ai-advice-list { display: flex; flex-direction: column; gap: 9px; }
#viewAi .ai-advice { border: 1px solid #e6edf5; border-radius: 6px; overflow: hidden; }
#viewAi .ai-advice-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; background: #fafcff; border-bottom: 1px solid #eef2f7;
}
#viewAi .ai-advice-reason { font-size: 11.5px; color: #64748b; }
#viewAi .ai-advice-bd { padding: 10px 12px; font-size: 12.5px; line-height: 2; color: #334155; }
#viewAi .ai-advice-bd del { color: #b91c1c; background: #fef2f2; padding: 1px 3px; }
#viewAi .ai-advice-bd ins { color: #15803d; background: #ecfdf5; padding: 1px 3px; text-decoration: none; }
#viewAi .ai-arrow { margin: 0 7px; color: #94a3b8; }
#viewAi .ai-hint { margin-left: 7px; color: #b45309; font-size: 11.5px; }
#viewAi .ai-advice-ft { padding: 0 12px 10px; }
#viewAi .ai-tip { font-size: 11px; color: #94a3b8; }
#viewAi .ai-adopt { height: 26px; padding: 0 11px; font-size: 11.5px; }

/* ================= AI 建议抽屉（PRJ-009 第二轮：生成页 / 纠错页共用） =================
 * 建议卡片样式与 #viewAi 同一套，但抽屉挂在 body 下，不能沾 #viewAi 的作用域，
 * 所以这里用 .ai-drawer 前缀再写一遍——值保持一致，改一处要同步另一处。 */
.ai-drawer-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, 0.32);
}
.ai-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 430px; max-width: 94vw;
  background: #fff; display: flex; flex-direction: column;
  box-shadow: -14px 0 36px rgba(15, 23, 42, 0.18);
}
.ai-drawer-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #e2e8f0; color: #1e293b;
}
.ai-drawer-hd svg { color: #6366f1; }
.ai-drawer-title { font-size: 11.5px; color: #64748b; }
.ai-drawer-close {
  margin-left: auto; width: 26px; height: 26px; border: 1px solid #e2e8f0; border-radius: 5px;
  background: #f8fafc; color: #64748b; font-size: 15px; line-height: 1; cursor: pointer;
}
.ai-drawer-close:hover { background: #eef2f7; color: #1e293b; }
.ai-drawer-tip { min-height: 20px; padding: 0 14px; font-size: 11.5px; color: #b45309; }
.ai-drawer-body { flex: 1; overflow: auto; padding: 12px 14px; background: #fbfdff; }
.ai-drawer-ft {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid #e2e8f0;
}
.ai-drawer-ft .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.ai-drawer-meta { font-size: 11px; color: #94a3b8; }
.ai-run-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* 抽屉里的建议卡片：与 #viewAi 同值 */
.ai-drawer .ai-chip {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 10.5px; line-height: 1.8; white-space: nowrap;
}
.ai-drawer .ai-chip.on, .ai-drawer .ai-chip.ok { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.ai-drawer .ai-chip.off { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.ai-drawer .ai-chip.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.ai-drawer .ai-chip.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ai-drawer .ai-chip.b { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ai-drawer .ai-empty { padding: 22px 10px; text-align: center; font-size: 12px; color: #94a3b8; }
.ai-drawer .ai-note {
  margin-bottom: 8px; padding: 8px 11px; border-radius: 5px;
  background: #f8fafc; border: 1px solid #e2e8f0; font-size: 11.5px; color: #475569;
}
.ai-drawer .ai-note.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ai-drawer .ai-advice-list { display: flex; flex-direction: column; gap: 9px; }
.ai-drawer .ai-advice { border: 1px solid #e6edf5; border-radius: 6px; overflow: hidden; background: #fff; }
.ai-drawer .ai-advice-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; background: #fafcff; border-bottom: 1px solid #eef2f7;
}
.ai-drawer .ai-advice-reason { font-size: 11.5px; color: #64748b; }
.ai-drawer .ai-advice-bd { padding: 10px 12px; font-size: 12.5px; line-height: 2; color: #334155; }
.ai-drawer .ai-advice-bd del { color: #b91c1c; background: #fef2f2; padding: 1px 3px; }
.ai-drawer .ai-advice-bd ins { color: #15803d; background: #ecfdf5; padding: 1px 3px; text-decoration: none; }
.ai-drawer .ai-arrow { margin: 0 7px; color: #94a3b8; }
.ai-drawer .ai-hint { margin-left: 7px; color: #b45309; font-size: 11.5px; }
.ai-drawer .ai-advice-ft { padding: 0 12px 10px; }
.ai-drawer .ai-tip { font-size: 11px; color: #94a3b8; }
.ai-drawer .ai-adopt { height: 26px; padding: 0 11px; font-size: 11.5px; }

/* 摘要卡片与反馈按钮（PRJ-009 第四轮） */
.ai-drawer .ai-summary-card {
  margin-bottom: 10px; padding: 10px 12px;
  border: 1px solid #dbe7f5; border-radius: 6px; background: #f6faff;
}
.ai-drawer .ai-summary-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-drawer .ai-summary-hd .ai-copy { margin-left: auto; height: 24px; padding: 0 10px; font-size: 11px; }
.ai-drawer .ai-summary-text { font-size: 12.5px; line-height: 1.9; color: #1e293b; }
.ai-drawer .ai-fb { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.ai-drawer .ai-advice-ft { display: flex; align-items: center; }
.ai-drawer .ai-fb-ask { font-size: 11px; color: #94a3b8; }
.ai-drawer .ai-fb-btn {
  height: 22px; padding: 0 8px; font-size: 11px;
  border: 1px solid #e2e8f0; border-radius: 4px; background: #fff;
  color: #475569; cursor: pointer;
}
.ai-drawer .ai-fb-btn:hover { background: #f1f5f9; }
.ai-drawer .ai-fb-done { font-size: 11px; color: #64748b; }
.ai-drawer .ai-fb-done.up { color: #15803d; }
.ai-drawer .ai-fb-done.down { color: #b45309; }
