* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6fa;
  --card: #fff;
  --line: #dfe5ee;
  --text: #1f2733;
  --sub: #7a8699;
  --primary: #2f6fed;
  --ok: #12a150;
  --warn: #f5a524;
  --danger: #e5484d;
}

html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--primary);
  color: #fff; font-weight: bold; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.brand-t { font-size: 15px; font-weight: bold; }
.brand-s { font-size: 11.5px; color: var(--sub); margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.ver { font-size: 11px; color: var(--sub); margin-left: 6px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; padding: 0 18px; background: #fff;
  border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.tab {
  background: none; border: none; padding: 11px 24px; font-size: 13.5px;
  color: var(--sub); cursor: pointer; font-family: inherit;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); font-weight: bold; border-bottom-color: var(--primary); }
/* v2.4.37：顶部页签栏「＋ 新建报告」高频入口（独立样式，桌面端显示） */
.newreport-quick {
  align-self: center; margin-left: 4px; padding: 7px 14px; font-size: 13px;
  font-weight: 700; color: #fff; background: #e5484d; border: none;
  border-radius: 8px; cursor: pointer; font-family: inherit; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(229, 72, 77, .28);
}
.newreport-quick:hover { background: #cf3b40; }

/* ---------- 主体 ---------- */
main { flex: 1 1 auto; overflow: hidden; position: relative; }
.page { position: absolute; inset: 0; overflow-y: auto; padding: 16px 18px 20px; display: none; background: var(--bg); }
.page.active { display: block; }
#page-hazard.active { display: flex; flex-direction: column; overflow: hidden; }
#page-export.active { display: flex; flex-direction: column; }

.hint {
  background: #eef4ff; border: 1px solid #cddffd; border-radius: 6px;
  padding: 8px 11px; color: #29528f; font-size: 12px; margin-bottom: 12px;
  line-height: 1.7;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 12px;
}
.card.grow { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 120px; }
.card-h { font-size: 14px; font-weight: bold; margin-bottom: 12px; }

/* ---------- 表单 ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.field { display: flex; align-items: center; gap: 8px; position: relative; }
.field label { flex: 0 0 132px; text-align: right; color: var(--sub); font-size: 12px; }
.field label b { color: var(--danger); }
.field input, .field select, .field textarea {
  flex: 1 1 auto; min-width: 0; padding: 6px 9px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; font-family: inherit;
  color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
}
.area-field { margin-bottom: 10px; }
.area-field > label { display: block; color: var(--sub); font-size: 12px; margin-bottom: 4px; }
.area-field textarea {
  width: 100%; resize: vertical; padding: 7px 9px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; font-family: inherit;
  color: var(--text); line-height: 1.6;
}
.area-field textarea:focus { outline: none; border-color: var(--primary); }

.chk { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: 13px; cursor: pointer; }
.row { display: flex; gap: 8px; }
.row input { flex: 1 1 auto; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 6px; font-family: inherit; font-size: 13px; background: #fff; }

/* ---------- 按钮 ---------- */
.btn {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--text);
  font-family: inherit; white-space: nowrap;
}
.btn:hover { background: #f2f6ff; border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #2559c9; color: #fff; }
.btn.ghost { background: transparent; }
.btn.warn {
  background: #fff9ec; color: #8a5a00; border-color: #f0d9a0; font-weight: bold;
}
.btn.warn:hover { background: #fff3d6; color: #8a5a00; }
/* v1.8.3 新增：绿色「现场新增问题」按钮 */
.btn.ok {
  background: #e8f6ef; color: #1a7f4b; border-color: #a8dcc0; font-weight: bold;
}
.btn.ok:hover { background: #d3efe0; color: #14603a; }
/* v2.4.28：切换栏「删除」按钮——红色系，语义清晰但不过分刺眼 */
.btn.danger { background: #fff2f2; color: #c0392b; border-color: #f0c0bc; }
.btn.danger:hover { background: #ffe3e1; color: #a5281b; border-color: #e5484d; }
/* v2.4.37：切换栏「逐份管理」入口——红色描边，醒目但不喧宾夺主 */
.btn.danger-outline { background: #fff; color: #c0392b; border: 1.5px solid #e5484d; font-weight: 700; }
.btn.danger-outline:hover { background: #fff2f2; }
/* v1.8.3 新增：字段旁的备选项管理入口按钮（▼） */
/* v1.8.6：▼ 改为绝对定位在输入框右缘（原负 margin 方案会把按钮挤到 label 上） */
.opt-entry {
  /* v2.4.11：改为行内按钮，不再绝对定位压在输入框上造成遮挡 */
  position: static; transform: none; flex: 0 0 auto; align-self: center;
  width: 26px; height: 26px;
  border: 1px solid #c3ccd6; border-radius: 4px; background: #f6f8fa;
  color: #5a6672; font-size: 11px; line-height: 1; cursor: pointer; padding: 0;
  z-index: 2;
}
.opt-entry:hover { background: #e8eef6; color: var(--primary); border-color: var(--primary); }
/* v1.8.6：「默认」开关 —— 点亮后该字段留空自动填默认值，跨报告生效 */
.opt-default {
  /* v2.4.11：同上，行内展示 */
  position: static; transform: none; flex: 0 0 auto; align-self: center;
  height: 26px; padding: 0 8px;
  border: 1px solid #c3ccd6; border-radius: 4px; background: #f6f8fa;
  color: #5a6672; font-size: 11px; line-height: 1; cursor: pointer; z-index: 2;
}
.opt-default:hover { background: #e8eef6; color: var(--primary); border-color: var(--primary); }
.opt-default.on { background: #e7f5ec; color: #1e7e46; border-color: #7dc39a; font-weight: bold; }
.field input.has-entry { padding-right: 9px; }
.btn.big {
  padding: 13px; font-size: 14.5px; font-weight: bold; flex: 0 0 auto;
}

.toolbar { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; flex: 0 0 auto; }
.spacer { flex: 1 1 auto; }
.stat { color: var(--sub); font-size: 12px; margin-right: 6px; }

/* ---------- 隐患表格 ---------- */
.tablewrap {
  flex: 1 1 auto; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
table.hz { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
table.hz th {
  position: sticky; top: 0; z-index: 2; background: #eef1f6; color: #4a5568;
  padding: 7px 6px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line); font-weight: bold; white-space: pre-line;
  line-height: 1.35; text-align: center;
}
table.hz td {
  border-bottom: 1px solid #eef1f6; border-right: 1px solid #eef1f6;
  padding: 4px 5px; vertical-align: top;
}
table.hz tr.sel td { background: #f2f7ff; }
table.hz td.c-no { text-align: center; vertical-align: middle; color: var(--sub); }
/* 行删除按钮：序号下方的小圆点，hover 变红 */
table.hz td.c-no .row-del {
  display: block; margin: 2px auto 0; width: 18px; height: 18px;
  line-height: 15px; text-align: center; font-size: 14px;
  color: #b6c0cd; background: transparent; border: 1px solid #dde3ec;
  border-radius: 50%; cursor: pointer; padding: 0; transition: all .12s;
}
table.hz td.c-no .row-del:hover { color: #fff; background: #e04b4b; border-color: #e04b4b; }
table.hz tr.sel td.c-no .row-del { color: #7d8899; border-color: #c6cfdc; }
table.hz input.cell, table.hz textarea.cell {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 3px 4px; font-size: 12px; font-family: inherit; color: var(--text);
  border-radius: 4px; resize: vertical; line-height: 1.5;
}
table.hz input.cell:hover, table.hz textarea.cell:hover { border-color: #dbe3ee; background: #fff; }
table.hz input.cell:focus, table.hz textarea.cell:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
table.hz textarea.cell { min-height: 46px; }
table.hz td.c-mid { vertical-align: middle; }

.descwrap { display: flex; align-items: center; gap: 4px; }
.descwrap input { flex: 1 1 auto; min-width: 0; }
.badge {
  flex: 0 0 auto; font-size: 10px; font-weight: bold; padding: 2px 6px;
  border-radius: 8px; user-select: none;
}
.badge.hit { background: #e3f7ec; color: var(--ok); }
.badge.miss { background: #f1f3f7; color: var(--sub); }

/* ---------- 照片格 ---------- */
.photocell {
  min-height: 54px; border: 1px dashed #c8d2e0; border-radius: 4px;
  background: #fbfcfe; padding: 3px; cursor: pointer;
  display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start;
}
.photocell:hover { border-color: var(--primary); background: #f2f7ff; }
.photocell.drag { border-color: var(--primary); background: #e8f1ff; border-style: solid; }
.photocell .ph {
  color: #9aa7b8; font-size: 11px; text-align: center; width: 100%;
  padding: 8px 0; line-height: 1.4; user-select: none;
}
.photocell .im { position: relative; width: 58px; }
.photocell .im img {
  width: 58px; height: 58px; object-fit: cover;
  border: 1px solid #d5dce6; border-radius: 2px; display: block;
}
.photocell .im .x {
  position: absolute; top: -6px; right: -6px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--danger); color: #fff; font-size: 12px;
  line-height: 17px; text-align: center; cursor: pointer; display: none;
  box-shadow: 0 0 0 1.5px #fff;
}
.photocell .im:hover .x { display: block; }
/* v2.4.48 拍照存档状态徽标：现场拍照不可重返，未存成功必须肉眼可见 */
.photocell .im .save-badge {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  font-size: 10px; line-height: 14px; padding: 0 4px; border-radius: 2px;
  color: #fff; font-weight: 700; box-shadow: 0 0 0 1px rgba(255,255,255,.85);
  pointer-events: none;
}
.photocell .im .save-badge.bad { background: #d32f2f; }
.photocell .im .save-badge.pending { background: #f59e0b; }
.photocell .im.saved-ok img { border-color: #2e7d32; }

/* ---------- 预览 ---------- */
.preview {
  flex: 1 1 auto; margin: 0; overflow: auto; background: #fff;
  font-family: "Consolas", "Microsoft YaHei", monospace; font-size: 12px;
  line-height: 1.75; color: var(--text); white-space: pre-wrap; word-break: break-all;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,39,51,.94); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .22s; max-width: 70vw;
  z-index: 99; white-space: pre-wrap; line-height: 1.6;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: rgba(18,161,80,.96); }
.toast.err { background: rgba(229,72,77,.96); }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.mask.show { display: flex; }
.dlg { background: #fff; border-radius: 10px; width: 440px; max-width: 88vw; overflow: hidden; }
.dlg-h { padding: 14px 18px; font-size: 15px; font-weight: bold; border-bottom: 1px solid var(--line); }
.dlg-b { padding: 16px 18px; max-height: 56vh; overflow: auto; font-size: 13px; line-height: 1.8; }
.dlg-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ==================== 可输入下拉（隐患名称） ==================== */
.descwrap { position: relative; display: flex; align-items: center; gap: 4px; }
.descwrap .combo-dd {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 60;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(20, 40, 90, .18);
  margin-top: 2px;
}
.descwrap .combo-dd.open { display: block; }
/* v2.4.26：候选浮层改为视口固定定位，由 JS 按输入框实际位置计算，
   空间不够时向上弹，并限制最大高度，不再压住下方签字栏与底部导航。 */
.descwrap .combo-dd.dd-fixed {
  position: fixed; right: auto; margin-top: 0; z-index: 300;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22);
}
.combo-it {
  /* v2.4.27：加大候选项点击热区与字号——手机上原 7px/13px 太挤、容易点错 */
  padding: 12px 12px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid #e8ecf3;
  line-height: 1.45;
  display: flex;
  align-items: center;
}
.combo-it:last-child { border-bottom: none; }
.combo-it:hover { background: #f0f6ff; }
.combo-it.sel { background: #e3edff; }

/* ============ v2.4.29：隐患选择 = 下半幅面板（替代浮动下拉，杜绝遮挡/文字不全） ============ */
.hzs-mask {
  position: fixed; inset: 0; z-index: 420;
  background: rgba(12, 20, 36, .46);
  display: none; align-items: flex-end; justify-content: center;
}
.hzs-mask.show { display: flex; }
.hzs {
  width: 100%; max-width: 720px;
  height: 62vh; min-height: 340px; max-height: 82vh;
  background: #fff; border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(10, 22, 45, .28);
  display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.hzs-hd {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; border-bottom: 1px solid var(--line);
}
.hzs-t { font-size: 16px; font-weight: 700; color: var(--text); }
.hzs-x {
  border: none; background: #f1f4f9; color: #5b6b82; border-radius: 50%;
  width: 34px; height: 34px; font-size: 16px; line-height: 1; cursor: pointer;
}
/* v2.4.36：选择隐患面板顶部——本行现场照片，对照照片选描述 */
.hzs-photos-wrap {
  flex: 0 0 auto; padding: 10px 14px 8px; border-bottom: 1px solid #eef1f6; background: #fafbfd;
}
.hzs-photos-label { font-size: 12px; color: var(--sub); margin-bottom: 8px; }
.hzs-photos {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.hzs-photo {
  flex: 0 0 auto; width: 84px; height: 84px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: #eef1f6; cursor: zoom-in;
}
.hzs-qw { flex: 0 0 auto; padding: 10px 14px; border-bottom: 1px solid #eef1f6; }
.hzs-q {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--primary); border-radius: 8px; font-size: 15px;
  font-family: inherit; color: var(--text); background: #fff;
}
.hzs-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0; }
.hzs-item {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  padding: 12px 16px; min-height: 48px; border: none; border-bottom: 1px solid #edf0f5;
  background: #fff; text-align: left; cursor: pointer; font-family: inherit;
  font-size: 15px; line-height: 1.5; color: var(--text);
}
.hzs-item:active { background: #eef4ff; }
.hzs-item.sel { background: #e3edff; }
.hzs-item-t { flex: 1 1 auto; overflow-wrap: anywhere; word-break: break-word; }
.hzs-item-tag {
  flex: 0 0 auto; align-self: flex-start; font-size: 11px; line-height: 1.4;
  padding: 2px 7px; border-radius: 9px; background: #fff2dd; color: #a5651a;
  border: 1px solid #f4d7a4; white-space: nowrap;
}
.hzs-empty { padding: 28px 18px; text-align: center; color: var(--sub); font-size: 14px; line-height: 1.7; }
.hzs-ft {
  flex: 0 0 auto; display: flex; gap: 10px; padding: 10px 14px;
  border-top: 1px solid var(--line); background: #fbfcfe;
}
.hzs-ft .btn { flex: 1 1 0; padding: 10px 8px; font-size: 15px; }
@media (orientation: landscape) and (max-height: 560px) {
  .hzs { height: 84vh; max-height: 84vh; min-height: 0; }
}

/* v2.4.29：字段完整示例提示行——占满整行、自动换行、完整展示不截断 */
.field-example {
  flex: 1 1 100%; min-width: 0; box-sizing: border-box;
  margin: 2px 0 4px; padding-left: 0;
  font-size: 11px; line-height: 1.5; color: var(--sub);
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
@media (min-width: 761px) { .field-example { padding-left: 140px; } }
.mini-btn {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 2px 7px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover { background: var(--primary); color: #fff; }
.mini-sel, .mini-inp {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-left: 8px;
  font-family: inherit;
}
.mini-inp { width: 180px; }
.mini-sel { font-family: inherit; }

/* ==================== 报告预览（④） ==================== */
/* v2.4.42：当前预览公司横幅——切完一眼确认「现在看的是哪一份」 */
.preview-current-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #eafaf1; border: 1px solid #a9dfbf; border-left: 4px solid #1e8449;
  border-radius: 8px; padding: 8px 12px; margin: 0 0 10px;
  font-size: 13px; line-height: 1.4;
}
.preview-current-bar[hidden] { display: none; }
/* v2.4.42：批量栏默认隐藏必须真正生效——.toolbar{display:flex} 会盖过浏览器默认 [hidden]{display:none} */
.rp-batch-bar[hidden] { display: none !important; }
.preview-current-bar .pcb-label {
  background: #1e8449; color: #fff; border-radius: 5px;
  padding: 2px 8px; font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.preview-current-bar .pcb-name { color: #145a32; font-weight: 700; flex: 1 1 auto; min-width: 0; }
.preview-current-bar .pcb-meta { color: #5d8a6b; font-size: 12px; flex: 0 0 auto; }
.docwrap { padding: 4px 0 20px; }
.docwrap .empty, .docwrap .pv-note {
  color: var(--sub);
  text-align: center;
  padding: 14px;
  font-size: 12px;
}
.doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px 22px;
  max-width: 1180px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.doc-cover { text-align: center; padding: 10px 0 20px; }
.doc-t { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.doc-no { font-size: 12px; color: var(--sub); margin-top: 8px; }
.pv-h2 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.pv-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.pv-tbl th, .pv-tbl td {
  border: 1px solid #b9c2d0;
  padding: 4px 5px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.pv-tbl th { background: #eef2f8; font-weight: 600; text-align: center; }
.pv-tbl.basic th { width: 84px; }
.pv-tbl .c-no { text-align: center; color: var(--sub); }
.pv-tbl .c-mid { text-align: center; }
.pv-quote { font-size: 10.5px; color: #444; max-height: 130px; overflow: hidden; }
.pv-phcell { text-align: center; }
.pv-ph {
  display: block;
  margin: 2px auto;
  max-width: 100%;
  max-height: 92px;
  border: 1px solid #dde2ea;
}
.pv-none { color: #ccc; }
.pv-sign {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pv-note { text-align: left; padding: 12px 0 0; }

/* ==================== 数据库面板（⑤） ==================== */
.kbmeta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.kbmeta > div { display: flex; gap: 8px; font-size: 13px; }
.kbmeta span { color: var(--sub); flex: 0 0 62px; }
.kbmeta b { font-weight: 600; word-break: break-all; }
.tablewrap.slim { max-height: calc(100vh - 420px); }
.hz.slim td { font-size: 12px; padding: 4px 6px; }
.hz.slim th { font-size: 12px; padding: 6px; }
.hint.inline { display: inline; }
.pv-auto { color: #b07d1e; font-size: 10.5px; margin-left: 4px; }

/* ================= 自动判定 / 标签输入 / 场所场景 ================= */
.hint-sm { font-size: 11px; color: var(--sub); font-weight: 400; }
.auto-field { margin-top: 4px; }
.auto-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.auto-src { font-size: 11px; color: var(--sub); }
.tagbox { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; font-size: 11.5px; line-height: 1.6;
  background: #eef3fb; color: #2b4a7d; border: 1px solid #cfdcf0;
  border-radius: 10px; max-width: 100%;
}
.tag .tag-x { cursor: pointer; font-weight: 700; color: #7d94b8; font-size: 12px; }
.tag .tag-x:hover { color: #e04b4b; }
.tag-add {
  padding: 2px 8px; font-size: 11.5px; color: #5a6b82;
  background: #fff; border: 1px dashed #c3cddb; border-radius: 10px; cursor: pointer;
}
.tag-add:hover { color: var(--primary); border-color: var(--primary); }
.judge-el {
  margin-top: 5px; padding: 5px 7px; font-size: 11px; line-height: 1.6;
  color: #8a5a12; background: #fffbf0; border-left: 3px solid #e0a83c; border-radius: 3px;
}
.auto-bar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.std-ver { font-size: 11px; color: var(--sub); }
.auto-tag {
  display: inline-block; margin-left: 4px; padding: 1px 5px;
  font-size: 10px; color: #2b6c4f; background: #e6f4ec;
  border: 1px solid #bfe0cd; border-radius: 8px; vertical-align: middle;
}
.scenebox { grid-column: 1 / -1; }
.quick-scenes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip {
  padding: 2px 8px; font-size: 11px; color: #55647c;
  background: #f4f6fa; border: 1px solid #dde3ec; border-radius: 10px; cursor: pointer;
}
/* v2.4.33：hover 只在真有鼠标的设备生效。触屏点一下会让 :hover 粘住，
   与 .sel 同色时「已取消」看起来仍是绿的——这就是用户说的「取消不掉」。 */
@media (hover: hover) and (pointer: fine) {
  .chip:hover { color: #1d7a43; background: #e8f6ec; border-color: #2e9e5b; }
}
.area-field label .mini-btn { margin-left: 8px; }

/* ================= 批量报告窗口 ================= */
.bt-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.bt-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-bottom: 1px solid #f0f3f7; font-size: 12.5px;
}
.bt-item:last-child { border-bottom: none; }
.bt-item:hover { background: #f7f9fc; }
.bt-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }
.bt-main { flex: 1; min-width: 0; }
.bt-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-meta { font-size: 11px; color: var(--sub); margin-top: 1px; }
.bt-del {
  padding: 2px 7px; font-size: 11px; color: #b04b4b;
  background: #fff; border: 1px solid #e8cccc; border-radius: 4px; cursor: pointer;
}
.bt-del:hover { color: #fff; background: #d9534f; border-color: #d9534f; }
.bt-bar { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.bt-tip { font-size: 11px; color: var(--sub); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---- 签字栏人员候选（可下拉选择 / 手动添加 / 点 × 删除）---- */
.mini-title { font-size: 11px; color: var(--sub); margin-bottom: 3px; }
.chipbox {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px;
  border: 1px dashed #d5d9e0; border-radius: 6px; min-height: 34px;
  background: #fafbfc;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border: 1px solid #c9d3e0; border-radius: 12px; background: #fff;
  font-size: 12px; cursor: pointer; user-select: none;
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: #2e9e5b; } }
.chip.sel { background: #e8f6ec; border-color: #2e9e5b; color: #1d7a43; font-weight: 600; }
.chip .x { font-size: 13px; opacity: .55; }
.chip .x:hover { opacity: 1; color: #d9534f; }
.chipbox input.chipinput {
  border: none; outline: none; font-size: 12px; padding: 3px 4px; min-width: 90px; flex: 1;
  background: transparent;
}

/* ---- 四段式结构化编辑器（一/二单段文本，三/四条目可增删）---- */
.sum-editor { display: block; }
.sum-head {
  font-weight: 700; font-size: 13px; color: #1f2d3d;
  margin: 10px 0 5px; padding-left: 8px; border-left: 3px solid var(--primary);
  line-height: 1.5;
}
.sum-single textarea {
  width: 100%; box-sizing: border-box; font-size: 13px; line-height: 1.65;
  border: 1px solid #d5d9e0; border-radius: 5px; padding: 6px 8px;
  resize: vertical; font-family: inherit; color: var(--text);
}
.sum-single textarea:focus { outline: none; border-color: var(--primary); }
.sum-items { display: flex; flex-direction: column; gap: 5px; }
.sum-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 4px 6px; border: 1px solid #e3e7ee; border-radius: 5px; background: #fbfcfd;
}
.sum-item:hover { border-color: #c6d2e0; background: #f6f9fc; }
.sum-no {
  flex: 0 0 auto; min-width: 26px; padding-top: 6px;
  font-size: 12.5px; color: var(--sub); font-weight: 600; text-align: right;
}
.sum-item textarea {
  flex: 1; border: none; background: transparent; outline: none; resize: vertical;
  font-size: 13px; line-height: 1.6; font-family: inherit; color: var(--text);
  padding: 4px 2px; min-height: 30px;
}
.sum-del { flex: 0 0 auto; margin-top: 3px; }
.sum-add { margin-top: 7px; }

/* ---------- 签字栏手写签名图片 ---------- */
/* 与 docgen 的 ImageRun 尺寸一致：120px × 46px（约 3.2cm × 1.2cm） */
.rp-sign-img {
  width: 120px;
  height: 46px;
  object-fit: contain;
  display: block;
  margin: 2px 0;
}

/* 签名图片拖入框（录入界面） */
.sign-drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 58px;
  padding: 0 10px;
  border: 1px dashed #b9c2cf;
  border-radius: 6px;
  background: #fafbfc;
  color: #8a94a3;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sign-drop:hover { border-color: #2f6bd8; background: #f2f6ff; color: #2f6bd8; }
.sign-drop.drag { border-color: #2f6bd8; background: #e8f0ff; color: #2f6bd8; }
.sign-drop.has {
  border-style: solid;
  border-color: #b7e0c8;
  background: #f2fbf5;
  color: #1f7a4d;
}
.sign-drop img {
  max-width: 140px;
  max-height: 54px;
  object-fit: contain;
  display: block;
}
.sign-drop .sign-clear {
  margin-left: 8px;
  color: #c0392b;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- 批量导出用法说明 ---------- */
.batch-hint {
  font-size: 12px;
  line-height: 1.9;
  color: #5b6675;
  background: #f7f9fc;
  border-left: 3px solid #2f6bd8;
  border-radius: 0 4px 4px 0;
  padding: 9px 12px;
}
.batch-hint b { color: #2f6bd8; }

/* ---------- 「＋ 新建报告（多份）」主入口按钮 ---------- */
/* 多份报告统一从这个按钮进入，做成分组色以便一眼识别 */
.btn.newreport {
  background: #fff4e5;
  border-color: #f0a04b;
  color: #b25a06;
  font-weight: 600;
}
.btn.newreport:hover { background: #ffe9cf; border-color: #dd8b32; color: #8f4705; }

/* ================= v1.7.0 ================= */

/* ---------- 基本信息字段的备选项下拉 ---------- */
/* 用户要求：红框内字段要有「提前输入备选内容」的下拉窗口（HTML5 datalist）
   v1.8.3：右侧留出 ▼ 按钮的位置，避免按钮压住输入文字 */
.field input.has-options { padding-right: 30px; cursor: text; }
.field input.has-options.has-entry { padding-right: 9px; }

/* ---------- 签名位卡片（多备选签名图） ---------- */
.sign-card {
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 420px;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  background: #fcfdff;
  padding: 10px;
}
.sign-card .mini-title { margin-bottom: 6px; font-weight: 600; }
.sign-card .sign-drop {
  display: flex;
  width: 100%;
  height: 62px;
  text-align: center;
  line-height: 1.5;
}
.sign-drop-tip { font-size: 12px; }
.sign-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sign-empty {
  font-size: 12px;
  color: #98a2b0;
  padding: 8px 2px;
  text-align: center;
  border: 1px dashed #e6eaf0;
  border-radius: 6px;
}
.sign-item {
  display: grid;
  grid-template-columns: 84px 1fr 1fr 18px;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  border: 1px solid #e4e9f0;
  border-radius: 6px;
  background: #fff;
}
.sign-item.sel {
  border-color: #2f6bd8;
  background: #f2f6ff;
  box-shadow: 0 0 0 2px rgba(47, 107, 216, .12);
}
.sign-item img {
  width: 84px;
  height: 40px;
  object-fit: contain;
  border: 1px solid #eef1f5;
  border-radius: 4px;
  background: #fafbfc;
  cursor: pointer;
}
.sign-nopic {
  width: 84px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #a8b0bd;
  border: 1px dashed #dfe4eb;
  border-radius: 4px;
  background: #fafbfc;
}
.sign-inp {
  width: 100%;
  min-width: 0;
  border: 1px solid #dfe4eb;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  box-sizing: border-box;
}
.sign-inp:focus { outline: none; border-color: #2f6bd8; }
.sign-inp.sign-tel { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
/* v2.4.27：手机窄屏签名条改两行——签名图+姓名一行、电话独占一行，
   避免 11 位号码挤在 1fr 里被裁，看得清输入对不对。 */
@media (max-width: 560px) {
  .sign-item { grid-template-columns: 72px 1fr 18px; grid-template-areas:
    "img name del" "tel tel tel"; row-gap: 6px; }
  .sign-item > img, .sign-item > .sign-nopic { grid-area: img; width: 72px; }
  .sign-item > .sign-inp[data-f="name"] { grid-area: name; }
  .sign-item > .sign-tel { grid-area: tel; width: 100%; font-size: 14px; }
  .sign-item > .sign-del { grid-area: del; }
}
.sign-del {
  color: #c0392b;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  user-select: none;
}
.sign-del:hover { text-decoration: underline; }
.sign-add {
  margin-top: 8px;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.sign-add .chipinput { flex: 1 1 90px; min-width: 80px; }

/* ---------- ⑥ 多份报告页 ---------- */
.rp-row.cur { background: #eaf1fe; }
.rp-cur {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: #2f6bd8;
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}
.btn.mini { padding: 3px 9px; font-size: 12px; margin-right: 4px; }
.rp-row .btn.mini { margin: 0 4px 0 0; }

/* ---------- v2.1.0 项目组 ---------- */
.sel-mini { font-size: 12px; padding: 3px 6px; max-width: 100%; border: 1px solid #cbd5e1;
  border-radius: 5px; background: #fff; color: inherit; }
.rp-group td {
  background: #f1f5fb; font-size: 13px; padding: 6px 10px;
  border-top: 2px solid #d6e0ee; border-bottom: 1px solid #d6e0ee;
}
.rp-gcount { color: #64748b; font-size: 12px; margin-left: 6px; font-weight: normal; }
#projBar { flex-wrap: wrap; gap: 8px; }
#projBar .stat { margin-right: 0; }
/* ---------- v2.4.41 批量勾选栏 + 紧凑视图 ---------- */
.rp-batch-bar { flex-wrap: wrap; gap: 6px; }
.rp-batch-bar .sel-mini { min-width: 96px; }
.rp-row td.c-no input.rp-ck { width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }
/* 紧凑视图：隐藏检查日期/隐患/照片/存入时间等次要列，保留单位名/项目/网格/标签/操作 */
body.rp-compact #rpTable th.rp-opt,
body.rp-compact #rpTable td.rp-opt { display: none; }
#rpCompactToggle { margin-left: 8px; }
/* 手机窄屏：批量栏提示语精简，控件尽量同行，减少占高 */
@media screen and (max-width: 760px) {
  .rp-batch-bar > .stat { display: none; }
  .rp-batch-bar { gap: 5px; }
  .rp-batch-bar .sel-mini { min-width: 78px; flex: 1 1 78px; }
  .rp-batch-bar #rpBatchSub { flex: 1 1 90px; min-width: 86px; }
  .rp-batch-bar #rpBatchApply, .rp-batch-bar #rpBatchClear { flex: 1 1 44%; }
  #rpBatchHint { flex: 1 1 100%; }
}
#projHint { color: #64748b; }

/* ================= v1.8.0 备选内容管理 ================= */
.optmgr { font-size: 13px; }
.optmgr-hint { color: #666; line-height: 1.6; margin-bottom: 8px; }
.optmgr-hint b { color: #c08a2e; }
.optmgr-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
  max-height: 84px; overflow-y: auto; padding: 2px; }
.otab { padding: 4px 10px; font-size: 12px; border: 1px solid #ccc; background: #fff;
  border-radius: 3px; cursor: pointer; }
.otab:hover { border-color: #c08a2e; }
.otab.active { background: #c08a2e; color: #fff; border-color: #c08a2e; }
.optmgr-add { display: flex; gap: 6px; margin-bottom: 8px; }
.optmgr-add input { flex: 1 1 auto; padding: 5px 8px; font-size: 13px;
  border: 1px solid #ccc; border-radius: 3px; }
.optmgr-list { max-height: 220px; overflow-y: auto; border: 1px solid #e0e0e0;
  border-radius: 3px; padding: 4px; }
.optmgr-empty { color: #999; text-align: center; padding: 18px 0; }
.optrow { display: flex; align-items: center; gap: 6px; padding: 3px 4px;
  border-bottom: 1px dashed #eee; }
.optrow:last-child { border-bottom: none; }
.optval { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.optbadge { flex: 0 0 auto; font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: #fff3dc; color: #c08a2e; }
.optbadge.builtin { background: #f0f0f0; color: #888; }
.optdel { flex: 0 0 auto; width: 20px; height: 20px; line-height: 1; border: none;
  background: transparent; color: #c0392b; font-size: 16px; cursor: pointer; border-radius: 3px; }
.optdel:hover:not(:disabled) { background: #fdecea; }
.optdel:disabled { color: #ccc; cursor: not-allowed; }

/* ===== 区域搭配编辑器（v2.4.18 改为竖排卡片） =====
   用户反馈「横排框内的字体被截断了」：原 5 列 grid 把三个输入框挤到各 ~100px，
   现每套搭配一张卡片、三个字段各占一整行，输入框铺满，字体不再被裁。 */
.pairmgr { font-size: 13px; }
.pairrow { display: block; padding: 3px 2px; border-bottom: 1px dashed #eee; }
.pairrow:last-child { border-bottom: none; }
.pairrow input { padding: 4px 6px; font-size: 12.5px; min-width: 0; }
.pairdel { width: 22px; height: 22px; }
.pairdef { width: 24px; height: 24px; font-size: 14px; line-height: 1;
  color: #bbb; background: none; border: none; cursor: pointer; padding: 0; }
.pairdef.on { color: #e8a020; }
.pairdef:hover { color: #d89020; }
.pairbar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ===== v1.8.7 记录表勾选项（在否/有无/见否/是否） ===== */
.softflags .softflag-box { display: flex; flex-wrap: wrap; gap: 6px 14px;
  align-items: center; padding: 4px 0; }
.softflag-name { font-size: 12.5px; color: #555; }
.softflag-grp { display: inline-flex; align-items: center; gap: 4px; }
.softflag-opt { padding: 3px 9px; font-size: 12.5px; border: 1px solid #ccc;
  background: #fff; border-radius: 3px; cursor: pointer; color: #444; }
.softflag-opt:hover { border-color: #c08a2e; }
.softflag-opt.on { background: #e8f6ec; border-color: #2e9e5b; color: #1d7a43; font-weight: bold; }

/* ================= v1.9.11 第三方检查记录表逐条输入卡 ================= */
#recDetails > summary.card-h { cursor: pointer; list-style: none; }
#recDetails > summary.card-h::-webkit-details-marker { display: none; }
#recDetails > summary.card-h::before { content: '▾ '; color: #c08a2e; }
#recDetails:not([open]) > summary.card-h::before { content: '▸ '; }
.rec-block { border: 1px solid #e3e3e3; border-radius: 5px; padding: 8px 10px; margin: 8px 0; background: #fbfbfb; }
.rec-h { font-weight: 600; color: #333; margin-bottom: 6px; font-size: 13.5px; }
.rec-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 6px; }
.rec-chk { flex: 1 1 0; min-width: 0; font-size: 12.5px; color: #444; padding-top: 4px; line-height: 1.3; }
.rec-input { flex: 1 1 0; min-width: 0; width: 100%; border: 1px solid #ccc; border-radius: 4px;
  padding: 5px 7px; font-size: 12.5px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.rec-remark { flex: 0 0 38%; min-width: 90px; }
.rec-input:focus { outline: none; border-color: #2e9e5b; box-shadow: 0 0 0 2px rgba(46,158,91,.15); }
/* v2.0.0：记录表分类块改为 <details> 可折叠（默认收起），summary 即分类标题 */
.rec-block[open] { background: #fff; }
.rec-block > .rec-h { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.rec-block > .rec-h::-webkit-details-marker { display: none; }
.rec-block > .rec-h::before { content: '▸'; color: #999; margin-right: 2px; font-size: 12px; }
.rec-block[open] > .rec-h::before { content: '▾'; }
.rec-h-t { flex: 1 1 auto; min-width: 0; }
.rec-h-n { font-size: 11px; color: #fff; background: #b9b9b9; border-radius: 8px; padding: 0 7px; font-weight: 600; }
.rec-h-n.has { background: #2e9e5b; }
.rec-toolbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.rec-filled { font-size: 12px; color: #888; margin-left: auto; }

/* ================= v1.8.1 导入拖拽区 ================= */
.dropzone {
  margin-top: 10px; padding: 14px 12px;
  border: 1.5px dashed #c3ccd8; border-radius: 8px;
  background: #fafbfd; color: #6b7684;
  text-align: center; font-size: 12.5px; line-height: 1.7;
  transition: all .15s ease;
}
.dropzone b { color: #2f6fd0; }
.dropzone.drop-on {
  border-color: #2f6fd0; background: #eef4ff; color: #2f6fd0;
  font-weight: 600;
}

/* ===== v1.8.1 默认人员库 ===== */
.prow { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-bottom: 1px solid #eef1f5; }
.prow:hover { background: #f7f9fc; }
.prow input[type=checkbox] { width: 15px; height: 15px; flex: 0 0 auto; }
.prow .pn { width: 120px; }
.prow .pp { width: 140px; }
.prow .optdel { cursor: pointer; color: #c0392b; font-size: 15px; padding: 0 4px; }
.mini-title .btn.mini { float: right; margin-top: -2px; }

/* ===== v1.8.1 顶部快捷模板条 ===== */
.tabs .quick-tpl { display: flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 14px; }
.tabs .btn.quick { padding: 5px 12px; font-size: 12.5px; }
.tabs .spacer { flex: 0 0 14px; }

/* ==================== v1.9.0 移动化布局 ====================
 * 策略：桌面规则全部保留；≤760px（手机浏览器 / 本应用 430 宽窗口）应用手机布局；
 * >760px 的宽屏下内容列限宽居中（手机壳效果）。
 * e2e 红线：仅新增规则与显隐切换，不删任何既有 id/class 语义。 */

/* ---------- 宽屏：手机壳居中 ---------- */
@media (min-width: 761px) {
  /* v2.4.7：手机横屏 / 平板 / 桌面宽窗同样使用手机布局（填写内容已搬入 #page-fill）。
     旧规则把 #page-fill 设为 display:none 会造成整页白屏，这里取消隐藏并放宽页面宽度。 */
  .page { left: 50%; transform: translateX(-50%); width: 100%; max-width: 900px; }
  .phone-nav { display: flex; }
  .mobile-home { display: none; }
  /* v1.9.9：导出页「软件资料」卡片仅手机端显示（桌面在①基本信息→补充说明编辑） */
  #softInfoCard { display: none; }
}

/* ---------- 窄屏：手机布局 ---------- */
@media (max-width: 760px) {
  /* v2.4.19：底栏改回普通流，去掉为 fixed 预留的 58px 空白，底部空隙消失 */
  body { font-size: 14px; padding-bottom: 0; }

  .topbar { padding: 8px 10px; }
  .brand-t { font-size: 13px; }
  .brand-s { display: none; }
  .logo { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 7px 9px; font-size: 12px; }
  .ver { display: none; }

  .tabs { display: none; }
  .quick-tpl { display: none; }

  /* v2.4.19：底栏改回普通流常驻（body 是 flex column，main 自适应撑满），
     与内容区自然贴合，消除 fixed 定位 + body padding 造成的底部空隙。 */
  .phone-nav {
    flex: 0 0 auto;
    display: flex; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* v2.4.40：.page 是铺满全屏的 absolute 不透明层，会盖住凸起圆顶；
       给底栏建立层叠上下文并抬高层级，让整个圆完整显示在内容之上。 */
    position: relative; z-index: 30;
  }
  .ptab {
    flex: 1 1 0; background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 0 6px; font-size: 11px; color: var(--sub); font-family: inherit;
  }
  .ptab .pi { font-size: 19px; line-height: 1; }
  .ptab.active { color: var(--primary); font-weight: bold; }
  /* v2.4.37：底部导航居中的「＋新建」高频按钮——凸起圆形、醒目主色 */
  .pnew {
    /* v2.4.42：原来 margin:-18px 把整个圆顶出导航栏、显得突兀超出底框；
       改为轻微凸起(-7px)，圆与底栏更协调，仍保持醒目的主操作入口。 */
    flex: 0 0 auto; width: 46px; height: 46px; margin: -7px 6px 0;
    border-radius: 50%; border: 3px solid #fff; background: #e5484d; color: #fff;
    font-size: 26px; line-height: 1; font-weight: 300; cursor: pointer;
    font-family: inherit; box-shadow: 0 3px 10px rgba(229, 72, 77, .4);
    display: flex; align-items: center; justify-content: center;
  }
  .pnew:active { transform: scale(.94); }

  /* v2.4.40：「报告」合并页的子分段（数据导出 / 多份清单）——与三段式切换条同款胶囊样式 */
  .rpt-subnav {
    display: flex; gap: 4px; margin: 2px 2px 10px; padding: 4px;
    background: #eef2f7; border-radius: 10px;
  }
  .rpt-subnav .rsb {
    flex: 1 1 0; min-width: 0; padding: 9px 4px; border: none; border-radius: 7px;
    background: transparent; color: var(--sub); font-size: 13.5px; font-family: inherit;
    font-weight: 500; cursor: pointer; white-space: nowrap;
  }
  .rpt-subnav .rsb.active { background: #fff; color: var(--primary); font-weight: 700;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .10); }

  .mobile-home { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .mh-btn {
    min-height: 52px; border-radius: 12px; border: 1.5px solid var(--primary);
    background: #fff; color: var(--primary); font-size: 16px; font-weight: bold;
    cursor: pointer; font-family: inherit;
  }
  .mh-btn.primary { background: var(--primary); color: #fff; }
  .mh-btn.warn { background: #e5484d; border-color: #e5484d; color: #fff; }
  .mh-btn:active { filter: brightness(0.94); }

  .page { padding: 12px 12px 18px; }
  .page.active { display: block; }
  #page-hazard.active { display: block; overflow-y: auto; }
  .card { padding: 12px; border-radius: 10px; }
  .hint { font-size: 12.5px; }

  .grid { grid-template-columns: 1fr; }
  .field label { flex: 0 0 96px; font-size: 13px; }
  .field input, .field select, .field textarea,
  .area-field textarea, .row input, .cell {
    min-height: 42px; font-size: 15px; padding: 8px 10px;
  }
  .chk { font-size: 14px; padding: 6px 0; }
  .chk input { width: 19px; height: 19px; }

  .btn { min-height: 40px; padding: 9px 14px; font-size: 14px; }
  .btn.big { width: 100%; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .btnrow { flex-wrap: wrap; }
  .btnrow .btn { flex: 1 1 46%; }

  .tablewrap { overflow: visible; }
  .hz { border: none; }
  .hz thead { display: none; }
  .hz tr {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; margin-bottom: 10px; padding: 8px 10px;
  }
  .hz tr.sel { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary) inset; }
  .hz td {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; border: none !important; padding: 6px 0;
  }
  .hz td::before {
    content: attr(data-label); flex: 0 0 74px; color: var(--sub);
    font-size: 12.5px; padding-top: 9px;
  }
  .hz td.c-no::before { padding-top: 2px; }
  .hz td > input, .hz td > textarea, .hz td > .cell { flex: 1 1 auto; width: auto; }
  .hz td .photocell { flex: 1 1 auto; }

  .sign-card { flex: 1 1 100%; }
  .dlg { max-width: 92vw; max-height: 82vh; overflow-y: auto; }
  .mask { padding: 12px; }

  .docwrap iframe, .docwrap .doc { width: 100% !important; }
  .docwrap { transform: none !important; }

  /* v1.9.8 手机端：铺满 + 精简 */
  html, body { height: 100%; }
  .topbar { padding: 6px 10px; }
  .brand-t { font-size: 12.5px; line-height: 1.2; }
  .brand-s { display: none; }
  /* 顶部隐藏次要操作，只留极简标题，界面更简洁 */
  .top-actions #btnPhoneCollab,
  .top-actions #btnOpen,
  .top-actions #btnSave { display: none; }
  /* 每页尽量铺满：撑满视口高度、内容区可滚动 */
  .page { min-height: calc(100dvh - 112px); padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0)); }
  .mh-btn { min-height: 56px; font-size: 17px; }
  /* 隐患数据库（软件资料）：手机上改为只读查阅，隐藏导入/恢复/导出等管理操作 */
  #page-kb .toolbar #btnImpKb,
  #page-kb .toolbar #btnResetKb,
  #page-kb .toolbar #btnExpKb,
  #page-kb .toolbar #optNet { display: none; }

  /* ================= v1.9.12 手机端精简 ================= */
  /* 隐藏顶部标题栏（「安全检查报告生成器」不写在最上面）与空操作区 */
  .topbar { display: none; }
  .brand { display: none; }
  /* 说明文字集中到「设置 → 说明」，界面更简洁 */
  .page .hint { display: none; }
  /* 重大火灾场景勾选：判定辅助，移出主填写流；自动判定工具栏保留（位于表一末尾＝非填项在后） */
  .page .scene-box { display: none; }
  /* 旧首页大按钮不再作为首页（已被「填写」单页取代） */
  .mobile-home { display: none; }
  /* 底部导航：4 项纯文字、无图标 */
  .phone-nav .ptab { font-size: 12px; gap: 1px; }
  .phone-nav .pi { display: none; }
  /* 填写单页：作为独立滚动容器，默认（三段折叠 + 100% 缩放）铺满一屏不滚动；
     展开某段或放大后才出现滚动，且滚动与缩放解耦（缩放只作用于内层 #fillZoom） */
  /* 仅在选中「填写」时显示该页；此前无条件 display:block 会导致它常驻并透过其它页内边距露出（即"背景有其他东西"） */
  #page-fill.active {
    display: block;
    height: 100%;
    background: var(--bg);
    padding: 0 0 calc(20px + env(safe-area-inset-bottom, 0));
    overflow-x: auto;              /* v2.4.7：放大后可横向查看，不再永久裁掉右侧 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;   /* iOS/WebView 惯性滚动 */
    touch-action: pan-y;                  /* 只允许纵向手势，避免横向抖动 */
    overscroll-behavior: contain;        /* 不触发上级/下拉刷新 */
    /* 注意：滚动容器本身不要 will-change:transform —— 会让每次重绘都重建合成层，反而卡顿。
       把合成层交给内层 #fillZoom（承载缩放），滚动与缩放各司其职，滑动更顺滑。 */
  }
  /* v1.9.16 内层缩放层去掉 will-change/contain：zoom 越大合成层越大，
     will-change 会强制整层常驻显存并在滚动时反复栅格化（100% 明显卡、70% 流畅的根因）。
     绘制隔离已交由各 .fill-sec 的 contain:content 与段内 content-visibility 承担。 */
  #fillZoom { width: 100%; }
  /* 顶部缩放条（A−/A+，不滚动时可放大） */
  .zoombar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
    justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 12px; margin-bottom: 8px;
  }
  .zb-t { font-weight: 700; font-size: 15px; }
  .zb-ctl { display: flex; align-items: center; gap: 10px; }
  .zb-btn { border: 1px solid var(--line); background: #f6f8fb; border-radius: 8px; min-width: 42px; min-height: 34px; font-size: 15px; cursor: pointer; }
  .zb-val { font-size: 13px; color: var(--sub); min-width: 44px; text-align: center; }
  /* 三张表折叠段：默认折叠→铺满一屏不滚动；展开某段即可填写。
     注意：不在此处 overflow:hidden 裁切，否则段内长内容被切掉且整页无法滚动 */
  .fill-sec { border: 1px solid var(--line); border-radius: 10px; margin: 10px; background: #fff; overflow: visible;
    /* v2.4.16：只用 layout/style 隔离，绝不用 contain:content / paint —— 后者会裁掉
       溢出内容，正是「文字显示不全 / 底部半截标题被裁」的元凶。 */
    contain: layout style; }
  /* v2.4.16：移除 content-visibility:auto + 固定 320px 估算高度。
     它会让屏外子块按估算高度占位，滚动时高度跳变、末尾内容看起来被截断。
     段级 contain:layout style 已足够隔离重绘，正确性优先。 */

  /* v1.9.17：工具栏按钮在极窄屏（如「多份」页按钮很多）不再被压成竖条/重叠。
     改为均匀换行铺满，隐藏占位的 spacer/divider，文字保持单行不折字。 */
  .toolbar, .btnrow { align-items: stretch; }
  .toolbar > .btn, .btnrow > .btn { flex: 1 1 44%; min-width: 0; max-width: 100%; white-space: nowrap; }
  .toolbar .spacer, .toolbar .divider { display: none; }
  .fill-sec > summary { padding: 13px 14px; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
  .fill-sec > summary::-webkit-details-marker { display: none; }
  .fill-sec > summary::before { content: '▸'; color: var(--sub); margin-right: 8px; }
  .fill-sec[open] > summary::before { content: '▾'; }
  .sec-req { font-size: 11px; color: #fff; background: var(--primary); border-radius: 8px; padding: 1px 7px; margin-left: 6px; font-weight: 400; }
  .sec-pri { background: #e8833a; }
  .sec-body { padding: 4px 12px 14px; }
  .fill-hint { margin: 6px 2px 10px; font-size: 12px; color: var(--sub); line-height: 1.6; }
  .sec-body .card { border: none; box-shadow: none; padding: 0; }
  .sec-body .card-h { font-size: 13px; color: var(--sub); padding: 8px 0 4px; }
  .sec-body .tablewrap { overflow: visible; }
  /* 表一内与表三重复的「软件管理」勾选项只保留表三一份（避免双份不同步） */
  .fill-sec[data-sec="basic"] .softflags { display: none; }
  /* 填写控件放大，便于手机点按 */
  #page-fill .field input, #page-fill .field select,
  #page-fill .field textarea, #page-fill .area-field textarea,
  #page-fill .row input, #page-fill .cell { min-height: 44px; font-size: 16px; padding: 9px 10px; }
  #page-fill .field label { flex: 0 0 92px; font-size: 13px; }
  #page-fill .grid { grid-template-columns: 1fr; }
  #page-fill .hz td { font-size: 14px; }
  /* 让所有表单容器与控件严格不超过视口宽度，杜绝横向被裁切 */
  #page-fill .card, #page-fill .grid, #page-fill .tablewrap, #page-fill .field,
  #page-fill .row, #page-fill .area-field { max-width: 100%; }
  #page-fill .field { min-width: 0; }
  #page-fill .field input, #page-fill .field select, #page-fill .field textarea,
  #page-fill .row input, #page-fill .cell, #page-fill .area-field textarea {
    min-width: 0; max-width: 100%; box-sizing: border-box;
  }
  /* 表三（现场隐患）手机端卡片化：默认只显示「隐患名称 + 现场照片」，其余字段点行展开 */
  .fill-sec[data-sec="hazard"] .tablewrap { overflow: visible; max-width: 100%; }
  .fill-sec[data-sec="hazard"] .hz { width: 100% !important; table-layout: auto; }
  /* 折叠态：仅显示 序号 + 隐患名称 + 现场照片，整改意见/期限/依据/原文/等级/备注/整改照片 7 列隐藏 */
  .fill-sec[data-sec="hazard"] .hz td:nth-child(n+4) { display: none; }
  /* 折叠态一行内排版：序号 | 隐患名称（撑满）| 换行后 现场照片（整行） */
  .fill-sec[data-sec="hazard"] .hz tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; cursor: pointer; }
  .fill-sec[data-sec="hazard"] .hz tr > td:nth-child(1) { flex: 0 0 auto; }
  .fill-sec[data-sec="hazard"] .hz tr > td:nth-child(2) { flex: 1 1 180px; min-width: 0; }
  .fill-sec[data-sec="hazard"] .hz tr > td:nth-child(3) { flex: 1 1 100%; }
  /* 折叠态省略隐患名称/现场照片的列名标签，给输入框与照片留足横向空间；展开后再显示。
   * v2.2.4 修复「图框显示不全」：折叠态 ::before 虽 content 为空，但仍是 flex item
   * （继承 .hz td::before 的 flex: 0 0 74px），74px 空占位把输入框/照片框挤出卡片
   * 右边界——「输入区」被截、「展开」竖排、照片框缺右边。改为完全清除占位。 */
  .fill-sec[data-sec="hazard"] .hz tr:not(.row-open) > td:nth-child(2)::before,
  .fill-sec[data-sec="hazard"] .hz tr:not(.row-open) > td:nth-child(3)::before {
    content: none; flex: 0 0 0; width: 0; min-width: 0; padding: 0; margin: 0;
  }
  /* 展开态：所有字段纵向堆叠并显示列名，便于逐项填写整改信息 */
  .fill-sec[data-sec="hazard"] .hz tr.row-open { display: block; }
  .fill-sec[data-sec="hazard"] .hz tr.row-open td { display: flex !important; }
  .fill-sec[data-sec="hazard"] .hz tr.row-open td:nth-child(n+4) { display: flex; }
  /* v2.4.26：折叠态只留一个 11px 小三角，不再用「展开 ▾」两个汉字占掉约 50px。
     实测旧写法让输入框只剩 157px，「输入或下拉选择…」被压掉半句 —— 用户反馈的「文字遮挡」。
     整行可点展开的行为不变。 */
  .fill-sec[data-sec="hazard"] .hz tr:not(.row-open) > td:nth-child(2)::after {
    content: '\25BE'; margin-left: 4px; color: #94a3b8; font-size: 11px; line-height: 1;
    flex: 0 0 auto; white-space: nowrap; align-self: center; padding-top: 0;
  }
  /* 输入框容器必须可收缩，否则 td 里的三角会把 input 顶出去 */
  .fill-sec[data-sec="hazard"] .hz td .descwrap { flex: 1 1 auto; min-width: 0; }

  /* v1.9.16 缩略图放大：原 58px 太小看不清；点缩略图可全屏查看大图 */
  #page-fill .photocell .im { width: 120px; }
  #page-fill .photocell .im img { width: 120px; height: 92px; }
  /* v1.9.16 显式固定输入文字颜色，避免 WebView/输入法主题把文字染红等歧义
     （界面红色仅用于必填项星号 * 与错误/警告提示） */
  #page-fill .field input, #page-fill .row input, #page-fill .cell,
  #page-fill .field textarea, #page-fill .area-field textarea { color: #16202b; }

  /* 设置面板（替代悬浮诊断日志 + 集中说明） */
  .modal-mask { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
  .modal-card { width: 460px; max-width: 92vw; max-height: 84vh; background: #fff; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
  .modal-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
  .modal-x { border: none; background: #eef1f6; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
  .modal-tabs { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .mtab { border: none; background: #f0f3f8; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
  .mtab.active { background: var(--primary); color: #fff; }
  .modal-body { padding: 14px; overflow-y: auto; font-size: 14px; line-height: 1.75; }
  .modal-body h4 { margin: 12px 0 4px; font-size: 14px; color: var(--primary); }
  .modal-body h4:first-child { margin-top: 0; }
  .modal-body p { margin: 4px 0; }

  /* v2.2.4：设置面板手机端全屏浏览（内容多、字号小，半屏弹窗看不清也拖不动） */
  #settingsModal .modal-card { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  #settingsModal .modal-h { padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  #settingsModal .modal-tabs { overflow-x: auto; flex-wrap: nowrap; }
  #settingsModal .modal-body { flex: 1; }
}

/* ---------- v1.9.8 导出进度浮层（全局，桌面/手机通用） ---------- */
.exp-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.exp-overlay[hidden] { display: none; }
.exp-box { width: 320px; max-width: 86vw; background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.exp-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: #1f2d3d; }
.exp-track { height: 8px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.exp-fill { height: 100%; width: 2%; background: linear-gradient(90deg,#3b7dff,#5aa0ff); border-radius: 99px; transition: width .25s ease; }
.exp-overlay.indeterminate .exp-fill { width: 40% !important; animation: expslide 1.1s infinite ease-in-out; }
@keyframes expslide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.exp-status { margin-top: 12px; font-size: 13px; color: #6b7785; min-height: 18px; }

/* ---------- 手机协作面板 ---------- */
.pc-qr { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 8px; }
.pc-url {
  font-family: Consolas, Menlo, monospace; font-size: 13px; color: var(--primary);
  background: #eef4ff; border: 1px solid #cddffd; border-radius: 6px;
  padding: 6px 9px; margin: 4px 0; word-break: break-all;
}

/* ---------- v1.9.0 手写签名板 ---------- */
.signpad-wrap {
  width: 100%;
  height: 200px;
  border: 1.5px dashed #b9c6e0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  touch-action: none;            /* 关键：触屏手写时不触发页面滚动 */
}
#signPadCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.signpad-hint { margin-top: 8px; font-size: 12px; color: var(--sub); }
/* v2.4.27：手写签名弹窗的横屏签名 —— 画布变横向宽屏，弹窗占满屏宽 */
.signpad-wrap.landscape { height: min(56vh, 340px); }
.dlg.signpad-landscape { width: min(96vw, 900px) !important; }
/* 窄屏：让签名卡里的「手写签名」按钮也排得下 */
@media (max-width: 760px) {
  .sign-card .mini-title .sign-write { float: right; margin-top: 2px; }
}

/* ================= v1.9.12 设置面板（全局，手机/桌面均可用） ================= */
.modal-mask { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.modal-mask[hidden] { display: none; }
.modal-card { width: 460px; max-width: 92vw; max-height: 84vh; background: #fff; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-x { border: none; background: #eef1f6; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.modal-tabs { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.mtab { border: none; background: #f0f3f8; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.mtab.active { background: var(--primary); color: #fff; }
.modal-body { padding: 14px; overflow-y: auto; font-size: 14px; line-height: 1.75; }
.modal-body h4 { margin: 12px 0 4px; font-size: 14px; color: var(--primary); }
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 4px 0; }
/* v1.9.23 手机同步（邮箱） */
.sync-item { border: 1px solid #d6deea; border-radius: 8px; padding: 7px 10px; margin: 7px 0; background: #fafcff; }
.sync-item .btn.small { margin-top: 4px; padding: 3px 12px; font-size: 12px; }

/* ---- v2.4.3 点选式候选面板（危险作业/职业危害因素/较大风险事故类型） ---- */
.chip-pick { margin-top: 5px; }
.chip-pick .chip { transition: background .12s, border-color .12s; }
.chip-pick .chip.sel { background: #e8f6ec; border-color: #2e9e5b; color: #1d7a43; font-weight: 600; }
.chip-pick .chip-more { color: #2b6cb0; border-style: dashed; background: #f7fafd; }
.chip-pick .chip-more:hover { background: #eef4fb; }
/* 二级展开分隔标签：折叠态隐藏，展开后才出现的「更多危害因素」分组 */
.chip-pick .chip-sep {
  width: 100%; margin: 6px 0 4px; padding: 3px 8px;
  font-size: 12px; color: #8a94a6; background: #f3f5f8; border-radius: 4px;
}


/* ==================== v2.4.7 手机自适应 / 折叠 / 风格预览 ==================== */
/* 表单行改为上下堆叠：标签独占一行、输入控件占满整行。
   修复「生产经营单/位」「法定代表人电/话」被 92px 固定标签列压到折行截断、
   以及 .field 被撑到 554px 后被 overflow-x 裁掉右半的问题。 */
#page-fill .field { flex-wrap: wrap; align-items: stretch; }
#page-fill .field label {
  flex: 0 0 100%; width: 100%; white-space: normal;
  line-height: 1.45; font-size: 13px; min-height: 0;
}
#page-fill .field input, #page-fill .field select, #page-fill .field textarea {
  flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
}
#page-fill .field .opt-entry, #page-fill .field .region-toggle { flex: 0 0 auto; }

/* 所属区域 / 报送单位 / 区域简称三者联动：后两个默认折叠 */
.region-fold { display: none !important; }
body.region-open .region-fold { display: flex !important; }
.region-toggle {
  border: 1px solid var(--line); background: #f6f8fb; color: var(--primary);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer;
  margin: 2px 0 4px; font-family: inherit;
}

/* v2.4.18：区域搭配改竖排 —— 每套搭配一张卡片、三个字段各占一行，
   彻底解决横排 5 列把输入框挤窄、框内字体被截断的问题。
   原先此处 grid-template-columns 的横排覆盖规则已移除。 */
.optmgr-list { max-height: 46vh; }
.modal-card { max-height: 88vh; }

/* 风格预览 */
.stylepv { display: flex; flex-direction: column; gap: 8px; }
.stylepv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-tab {
  border: 1px solid var(--line); background: #f4f7fb; border-radius: 7px;
  padding: 7px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.sp-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stylepv-body { position: relative; height: min(62vh, 560px); border: 1px solid var(--line); border-radius: 8px; background: #eef1f5; overflow: hidden; }
.sp-pane { position: absolute; inset: 0; }
.sp-pane[hidden] { display: none; }
.sp-frame { width: 100%; height: 100%; border: 0; background: #fff; }

/* 网格（项目下的可选分支）默认折叠 */
.grid-optional { margin: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.grid-optional > summary {
  cursor: pointer; padding: 8px 12px; font-size: 13px; color: var(--sub);
  list-style: none; font-weight: 600;
}
.grid-optional > summary::-webkit-details-marker { display: none; }
.grid-optional > summary::before { content: '▸'; margin-right: 7px; color: var(--primary); }
.grid-optional[open] > summary::before { content: '▾'; }
.grid-optional > .toolbar { padding: 8px 12px 12px; border-top: 1px solid var(--line); }


/* ==================== v2.4.7 补修：grid 列被内容撑宽 ==================== */
/* 根因：窄屏规则写的是 grid-template-columns:1fr，而 1fr 的隐式最小值是 auto
   （等于最宽子项的 min-content），实测被撑到 554px，父容器只有 314~368px，
   于是 .field / input 全部超出视口被 overflow 裁掉。
   minmax(0,1fr) 把最小值锁为 0，列宽严格等于容器宽度。 */
#page-fill .grid { grid-template-columns: minmax(0, 1fr) !important; }
#page-fill .field {
  min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box;
}
#page-fill .field label, #page-fill .field input,
#page-fill .field select, #page-fill .field textarea { max-width: 100%; }
#page-fill .grid > * { min-width: 0; max-width: 100%; }


/* ==================== v2.4.7 使用引导 / 功能介绍 / 演示 ==================== */
/* 层级：toast 99 < .mask 100 < .exp-overlay 200 < .modal-mask 300 < 引导 400。
   分步引导时整层 pointer-events:none，用户仍能直接操作被高亮的真实控件；
   欢迎卡 / 介绍 / 演示是全屏面板，加 .guide-wide 后拦截背景误点。 */
.guide-layer { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.guide-layer.guide-wide { background: rgba(15, 23, 42, .5); pointer-events: auto; }

.guide-ring {
  position: absolute; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55), inset 0 0 0 3px var(--primary);
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
.guide-badge {
  position: absolute; top: -14px; left: -14px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 14px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(47, 111, 237, .5); border: 2px solid #fff;
}

.guide-card {
  position: absolute; width: 360px; max-width: calc(100vw - 24px);
  box-sizing: border-box; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px 12px; pointer-events: auto;
  box-shadow: 0 10px 32px rgba(15, 23, 42, .28); z-index: 402;
}
/* 固定底部兜底：只要 JS 给卡片加了 gc-mobile，无论视口宽度都生效，
   避免出现「class 存在但媒体查询不匹配 → 卡片脱靶到左上角」。 */
.guide-card.gc-mobile { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 8px; top: auto !important; width: min(560px, calc(100vw - 16px)); max-width: none; }
.guide-card.gc-in { animation: gcFade .2s ease-out; }
/* 只做透明度淡入：不用 transform，避免覆盖 gc-mobile 的居中位移 */
@keyframes gcFade { from { opacity: .35; } to { opacity: 1; } }
.gc-head { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); }
.gc-no { flex: 0 0 auto; background: var(--primary); color: #fff; border-radius: 12px;
  padding: 2px 9px; font-size: 12px; font-weight: 700; }
.gc-text { margin: 9px 0 10px; font-size: 13px; line-height: 1.75; color: var(--sub); }
.gc-bar, .gd-bar { height: 5px; border-radius: 4px; background: #e8edf6; overflow: hidden; }
.gc-bar i, .gd-bar i { display: block; height: 100%; background: var(--primary); transition: width .2s ease; }
.gc-actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.gc-spacer, .gd-spacer { flex: 1 1 auto; }

.guide-panel { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 16px; box-sizing: border-box; }
.guide-panel > * { pointer-events: auto; }

/* ---- 欢迎卡 ---- */
.guide-welcome { width: min(520px, 94vw); max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 14px; padding: 26px 26px 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .32); text-align: center; }
.gw-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.guide-welcome h2 { margin: 0 0 8px; font-size: 20px; color: var(--text); }
.gw-sub { margin: 0 0 18px; font-size: 13px; line-height: 1.8; color: var(--sub); }
.gw-actions { display: flex; flex-direction: column; gap: 9px; }
.gw-actions .btn { width: 100%; }
.gw-foot { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.gw-tip { margin: 14px 0 0; font-size: 12px; color: var(--sub); }

/* ---- 功能介绍 ---- */
.guide-intro { width: min(960px, 96vw); max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 20px 24px 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .32); }
.gi-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.gi-head h2 { margin: 0; font-size: 19px; color: var(--text); }
.gi-sub { margin: 12px 0 16px; font-size: 13px; color: var(--sub); }
.gi-group { margin-bottom: 16px; }
.gi-group h3 { margin: 0 0 8px; font-size: 14px; color: var(--primary); }
.gi-group ul { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.gi-group li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; background: #fbfcfe; }
.gi-group li b { font-size: 13px; color: var(--text); }
.gi-group li p { margin: 4px 0 0; font-size: 12px; line-height: 1.7; color: var(--sub); }
.gi-group li .btn { align-self: flex-start; }

/* ---- 演示 ---- */
.guide-demo { width: min(980px, 96vw); max-height: 92vh; display: flex;
  flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .32); }
.gd-top { display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.gd-tag { font-size: 12px; color: var(--warn); font-weight: 600; }
.gd-screen { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px;
  background: #f4f6fa; border-bottom: 1px solid var(--line); }
.gd-caption { padding: 10px 16px 6px; }
.gd-step { font-size: 14px; color: var(--text); }
.gd-step b { color: var(--primary); font-size: 16px; }
.gd-caption p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--sub); }
.gd-ctrl { display: flex; align-items: center; gap: 7px; padding: 8px 16px 14px; flex-wrap: wrap; }
.gd-ctrl .gd-bar { flex: 1 1 120px; max-width: 220px; }

/* 演示里的模拟界面（全部只在引导层内，不触碰真实应用 DOM） */
.gm-cover, .gm-form, .gm-table, .gm-generate, .gm-report {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; min-height: 260px; box-sizing: border-box;
}
.gm-cover { text-align: center; padding: 34px 20px; }
.gm-logo { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.gm-cover h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.gm-cover > p { margin: 0 0 20px; font-size: 12px; color: var(--sub); }
.gm-btn { display: inline-block; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; font-size: 12px; background: #fff; color: var(--text); }
.gm-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.gm-note { margin: 14px 0 0; font-size: 11.5px; color: var(--sub); line-height: 1.7; }
.gm-form h4, .gm-table h4 { margin: 0 0 14px; font-size: 15px; color: var(--text); }
.gm-row { display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px; }
.gm-row label { flex: 0 0 110px; color: var(--sub); font-size: 12px; }
.gm-row span { flex: 1 1 auto; color: var(--text); }
.gm-row em { font-style: normal; font-size: 11px; color: var(--ok); }
.gm-row.gm-linked { background: #f7fbff; }
.gm-chips { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.gm-chips span { border: 1px solid var(--line); border-radius: 16px;
  padding: 5px 12px; font-size: 12px; color: var(--sub); }
.gm-chips span.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.gm-tbar { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.gm-table table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.gm-table th, .gm-table td { border: 1px solid var(--line); padding: 6px 8px;
  text-align: left; vertical-align: top; }
.gm-table th { background: #f2f6fd; color: var(--sub); }
.gm-generate { text-align: center; padding: 34px 20px; }
.gm-gen-ico { font-size: 38px; }
.gm-generate h4 { margin: 10px 0 14px; font-size: 15px; }
.gm-progress { height: 8px; border-radius: 5px; background: #e8edf6; overflow: hidden; margin: 0 auto 16px; max-width: 320px; }
.gm-progress i { display: block; height: 100%; width: 100%; background: var(--primary); }
.gm-ok { color: var(--ok); font-size: 13px; font-weight: 600; }
.gm-report { padding: 0; min-height: 52vh; }
.gm-frame { display: block; width: 100%; height: 56vh; min-height: 320px; border: 0; background: #fff; }

/* ---- 手机端 ---- */
@media (max-width: 760px) {
  .guide-panel { padding: 8px; }
  .guide-welcome { padding: 20px 16px 16px; }
  .guide-intro, .guide-demo { width: 100%; max-height: 96vh; }
  .gi-group ul { grid-template-columns: minmax(0, 1fr); }
  .gd-screen { padding: 10px; }
  .gm-frame { height: 48vh; min-height: 260px; }
  .gm-row label { flex: 0 0 88px; }
  .gd-ctrl .gd-bar { order: 9; flex: 1 1 100%; max-width: none; }
}

/* ==================== v2.4.9 减负：常驻快捷操作条 / 就地入口 ====================
 * S1/S2/S9：任何页面都能一键「生成 Word / 下一家 / 风格 / Logo」，不必再切到导出页。
 * 该条是 body 的 flex 子项，位于 main 之下：
 *   - 宽屏（手机壳）：普通流常驻，与 .phone-nav 上下排列；
 *   - 窄屏：仍在普通流，正好位于 fixed 的 .phone-nav 上方，二者不重叠、不遮挡内容。
 * 只新增样式，不改任何既有 id/class 语义。 */
/* v2.4.14：删除重复的常驻快捷条，改为「按报告三段式切换」+ 签字独立。
 * 仅手机布局显示（body.is-phone 由 buildFillPage 添加）；桌面端已有顶部六个页签。 */
.fillswitch { display: none; }
/* v2.4.19：按用户要求把「三段式切换」这一行从底部移到顶部（main 之上），
   底部只留导航；并且只在「填写」页显示，其它页不再平白占一行、不再留空隙。 */
body.is-phone .fillswitch {
  flex: 0 0 auto;
  display: flex; align-items: stretch; gap: 6px;
  width: 100%; max-width: 900px; margin: 0 auto;
  padding: 6px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
  z-index: 55; position: relative;
}
body.is-phone[data-page]:not([data-page="fill"]) .fillswitch { display: none; }
.fs-btn {
  flex: 1 1 0; min-width: 0;
  white-space: nowrap; text-align: center;
  padding: 9px 4px; font-family: inherit; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); cursor: pointer;
}
.fs-btn:hover { background: #f2f6ff; border-color: var(--primary); color: var(--primary); }
.fs-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-btn.fs-sign { border-color: #f6c98a; color: #a3521a; background: #fffaf3; }
.fs-btn.fs-sign.active { background: #c2701c; border-color: #c2701c; color: #fff; }
.fs-btn:active { transform: translateY(1px); }

/* S11：基本信息页「报告样式」快速卡（先定版式再填，避免填完才发现风格不对） */
.style-quick { border-color: #cddffd; background: #f7faff; }
.style-quick .card-h { color: #29528f; }
.style-quick .sel {
  flex: 0 1 260px; min-width: 160px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 13px; background: #fff; color: var(--text);
}

/* S3：三个低频导出复选框收进「更多选项」折叠，id 与语义全部保留、可任意组合 */
.more-options > summary.card-h { cursor: pointer; list-style: none; margin-bottom: 6px; }
.more-options > summary.card-h::-webkit-details-marker { display: none; }
.more-options > summary.card-h::before { content: '▸ '; color: var(--primary); }
.more-options[open] > summary.card-h::before { content: '▾ '; }
.more-options .chk { padding-left: 4px; }

/* S8：顶部「保存草稿」按钮冗余（已有自动保存 / 菜单保存 / Ctrl+S /
   设置→常规→立即保存草稿），隐藏后顶栏更简洁，保存能力不丢。 */
#btnSave { display: none; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 760px) {
  body.is-phone .fillswitch { padding: 6px 6px; gap: 4px; }
  .fs-btn { padding: 8px 2px; font-size: 11px; border-radius: 7px; }
  /* 「报告样式」卡被搬进填写页折叠段后，去掉外层卡片感、让下拉铺满一行 */
  .sec-body .style-quick { padding: 2px 0 8px; }
  .style-quick .sel { flex: 1 1 100%; min-width: 0; }
  .style-quick .row > .btn { flex: 1 1 40%; }
}

/* ==================== v2.4.10 软件资料问题「点选 / 自定义」模块 ==================== */
.soft-items-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 7px 9px; margin: 0 0 8px;
  background: #f7faff; border: 1px solid #dbe7fa; border-radius: 7px;
}
.soft-items-bar > .hint-sm { flex: 1 1 100%; color: #29528f; font-size: 12px; }
.soft-items-bar .btn.mini { padding: 4px 10px; }

.soft-groups { display: flex; flex-direction: column; gap: 6px; }
.soft-grp { border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.soft-grp > summary.soft-grp-sum {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--text); background: #f5f7fa;
}
.soft-grp > summary.soft-grp-sum::-webkit-details-marker { display: none; }
.soft-grp > summary.soft-grp-sum::before { content: '▸'; color: var(--primary); font-weight: 700; }
.soft-grp[open] > summary.soft-grp-sum::before { content: '▾'; }
.soft-grp > summary.soft-grp-sum > span:first-of-type { flex: 1 1 auto; }
.soft-grp-n { flex: 0 0 auto; font-size: 11px; font-weight: 400; color: #2b6cb0; }
.soft-chips {
  margin: 0; padding: 9px; border: 0; border-top: 1px dashed var(--line);
  border-radius: 0; background: #fff;
}
.soft-chips .chip { text-align: left; border-radius: 6px; line-height: 1.5; min-height: 42px; }
/* v2.4.31：选中=绿框、未选=白框，状态已足够直观，移除多余的红字取消提示 */
.soft-chips .chip.sel { background: #e8f6ec; border-color: #2e9e5b; color: #1d7a43; font-weight: 600; }

.soft-custom-field { margin-top: 10px; }
.soft-custom-field > label { display: block; margin-bottom: 5px; font-size: 13px; }
.soft-custom-field textarea {
  display: block; width: 100%; box-sizing: border-box;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 13px; line-height: 1.6; color: var(--text);
  background: #fff; resize: vertical; min-height: 68px;
}
.soft-custom-field textarea:focus { outline: none; border-color: #2b6cb0; }
.soft-custom-field .hint-sm { display: block; margin-top: 4px; color: var(--sub); }

/* 手机端：工具条按钮平分一行，分组标题与候选项不溢出 */
@media (max-width: 760px) {
  .soft-items-bar { gap: 6px; padding: 6px 8px; }
  .soft-items-bar .btn.mini { flex: 1 1 30%; padding: 7px 4px; text-align: center; }
  .soft-grp > summary.soft-grp-sum { padding: 9px 10px; font-size: 12px; }
  .soft-chips { padding: 8px; gap: 6px; }
  .soft-chips .chip { flex: 1 1 100%; text-align: left; }
}


/* ==================== v2.4.11 填写页整理 ====================
 * 目标：固定下拉化、去遮挡、去重复、折叠大块、预览看全貌、网格按需生成。 */

/* --- 固定下拉与自定义输入 --- */
.field select.fsel { flex: 1 1 auto; min-width: 0; }
.field input.fcustom { flex: 1 1 auto; min-width: 0; }
.field select.fsuffix { flex: 0 0 96px; width: 96px; min-width: 0; }
.field input.fcustom[hidden], .field select.fsel[hidden] { display: none !important; }
.field .fsuffix, .field .fsel { background: #f7faff; border-color: #cddffd; }

/* --- 点选栏：常见项 + 自定义，不再有二级「展开更多 N 项」 --- */
.chip-custom { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; margin-top: 2px; }
.chip-custom .chipinput {
  flex: 1 1 auto; min-width: 90px; padding: 4px 8px; font-size: 12px;
  border: 1px dashed #c9d3e0; border-radius: 8px; background: #fff; font-family: inherit;
}
.chip-custom .chipinput:focus { outline: none; border-color: var(--primary); }
.chip-add { border-style: dashed; background: #f7fafd; color: #2b6cb0; flex: 0 0 auto; }
.chip-add:hover { background: #eef4fb; color: var(--primary); border-color: var(--primary); }

/* --- 自动判定结果：默认折叠，不再铺一长串「待自动生成 / 自动生成」 --- */
.auto-results {
  grid-column: 1 / -1; margin: 4px 0; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: #fcfdff;
}
.auto-results > summary {
  cursor: pointer; list-style: none; padding: 8px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--sub);
}
.auto-results > summary::-webkit-details-marker { display: none; }
.auto-results > summary::before { content: '▸ '; color: var(--primary); }
.auto-results[open] > summary::before { content: '▾ '; }
.auto-results > .field { margin: 0 12px 10px; }
.auto-wrap .auto-field { padding-left: 0; }
.auto-result {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 7px 9px; font-size: 12.5px; line-height: 1.6; font-family: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
.auto-result:focus { outline: none; border-color: var(--primary); }

/* --- 底部工具条：3 个主按钮 + 更多折叠 --- */
.auto-more { position: relative; flex: 0 0 auto; }
.auto-more > summary {
  list-style: none; cursor: pointer; padding: 6px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
.auto-more > summary::-webkit-details-marker { display: none; }
.auto-more > summary:hover { border-color: var(--primary); color: var(--primary); }
.auto-more-body {
  position: absolute; right: 0; top: 110%; z-index: 20; min-width: 210px;
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  box-shadow: 0 6px 18px rgba(30,50,90,.14);
}

/* --- 报告样式卡：默认折叠 --- */
.style-quick { padding: 0; }
.style-quick > summary.card-h {
  cursor: pointer; list-style: none; margin: 0; padding: 10px 14px;
}
.style-quick > summary.card-h::-webkit-details-marker { display: none; }
.style-quick > summary.card-h::before { content: '▸ '; color: var(--primary); }
.style-quick[open] > summary.card-h::before { content: '▾ '; }
.style-quick > .row, .style-quick > .hint-sm { margin-left: 14px; margin-right: 14px; }
.style-quick > .row { padding-bottom: 8px; }

/* --- 风格预览：近全屏 + A4 等比缩略，看得到整页，无遮挡 --- */
.dlg.dlg-stylepv {
  width: 1100px; max-width: 96vw; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.dlg.dlg-stylepv .dlg-b {
  max-height: none; flex: 1 1 auto; overflow: auto; padding: 10px 12px;
}
.dlg.dlg-stylepv .stylepv-body { height: min(74vh, 720px); }
.dlg.dlg-stylepv.full {
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
}
.dlg.dlg-stylepv.full .stylepv-body { height: calc(100vh - 160px); }
.stylepv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stylepv-top .stylepv-tabs { flex: 1 1 auto; }
.dlg.dlg-stylepv .sp-pane { overflow: auto; }
.dlg.dlg-stylepv .sp-fit {
  margin: 8px auto; background: #fff; position: relative; overflow: hidden;
  box-shadow: 0 2px 10px rgba(30,50,90,.16);
}
.dlg.dlg-stylepv .sp-frame {
  display: block; width: 1123px; height: 2200px; border: 0; background: #fff;
  transform-origin: top left;
}

/* --- 网格：不点击「＋ 生成网格」就完全不出现 --- */
#gridOptional[hidden] { display: none !important; }

/* --- 窄屏：下拉与自定义并排、按钮不遮挡 --- */
@media (max-width: 760px) {
  #page-fill .field select.fsel,
  #page-fill .field input.fcustom { flex: 1 1 auto; width: auto; }
  #page-fill .field input[data-key="factory_area"],
  #page-fill .field input[data-key="warehouse"] { flex: 1 1 auto; width: auto; }
  #page-fill .field select.fsuffix { flex: 0 0 96px; width: 96px; }
  #page-fill .field .opt-default { flex: 0 0 auto; }
  .sec-body .style-quick { padding: 0; }
  .style-quick > .row, .style-quick > .hint-sm { margin-left: 4px; margin-right: 4px; }
  .dlg.dlg-stylepv { width: 96vw; max-width: 96vw; max-height: 94vh; }
  .dlg.dlg-stylepv .stylepv-body { height: min(70vh, 620px); }
  .dlg.dlg-stylepv.full .stylepv-body { height: calc(100vh - 170px); }
  .auto-more-body { position: static; box-shadow: none; min-width: 0; }
}

/* ==================== v2.4.12 风格预览：三栏对比 / 真全屏 / 高度自适应 ==================== */
.sp-note { font-size: 12px; color: #475569; background: #f2f6ff; border: 1px solid #dbe6ff;
  border-radius: 8px; padding: 7px 10px; margin: 8px 0; line-height: 1.65; }
.dlg.dlg-stylepv .stylepv-body {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  height: min(70vh, 700px); overflow: auto; align-items: start;
}
.dlg.dlg-stylepv .stylepv-body.sp-focus { grid-template-columns: minmax(0, 1fr); }
.sp-col { min-width: 0; }
.sp-col[hidden] { display: none !important; }
.sp-col-h { font-size: 12px; line-height: 1.5; padding: 6px 8px; background: #eef3fb;
  border: 1px solid #dbe4f2; border-radius: 7px 7px 0 0; }
.sp-col-h b { display: block; color: #1d4ed8; }
.sp-col-h span { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }
.dlg.dlg-stylepv .sp-fit { margin: 0 auto 10px; }
.mask.stylepv-fullscreen { padding: 0; align-items: stretch; justify-content: stretch; }
.dlg.dlg-stylepv.full {
  width: 100vw; max-width: none; height: 100vh; max-height: none;
  border-radius: 0; display: flex; flex-direction: column;
}
.dlg.dlg-stylepv.full .dlg-h { padding: 8px 16px; }
.dlg.dlg-stylepv.full .dlg-f { padding: 8px 16px; }
.dlg.dlg-stylepv.full .dlg-b { flex: 1 1 auto; max-height: none; overflow: auto; padding: 8px 12px; }
.dlg.dlg-stylepv.full .stylepv-body { height: calc(100vh - 190px); }
@media (max-width: 900px) {
  .dlg.dlg-stylepv .stylepv-body { grid-template-columns: minmax(0, 1fr); height: min(66vh, 620px); }
  .dlg.dlg-stylepv.full .stylepv-body { height: calc(100vh - 190px); }
}

/* v2.4.12：四段式自动生成说明 + 输入提示不遮挡 */
.sum-auto-tip { font-size: 11px; color: #64748b; line-height: 1.6; margin: 4px 0 6px; }
#page-fill .field input[placeholder] { min-width: 0; text-overflow: clip; }

/* 预览页：未录入隐患时的顶部说明（不影响报告本身） */
.rp-empty-tip { margin: 0 0 10px; padding: 9px 12px; border-radius: 8px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  font-size: 12.5px; line-height: 1.6; }

/* v2.4.26：软件资料改成「分类 → 小项 → 选项」三级结构 —— 一个小项(条款)一组选项，
   恰好一个补充说明框；删除旧版「每个选项一个框 + 每个分类末尾再一个框」的重复。 */
.soft-chips.soft-subs { display: block; padding: 8px 10px; }
.soft-sub { padding: 10px 0 4px; border-top: 1px dashed #e6ebf3; }
.soft-sub:first-child { border-top: none; padding-top: 2px; }
.soft-sub > .soft-grp-desc { margin: 0 0 8px; }
.soft-sub-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.soft-sub-chips .chip { flex: 0 1 auto; min-width: 148px; max-width: 100%;
  border-radius: 6px; text-align: left; line-height: 1.5; }
.soft-sub-note { display: block; width: 100%; box-sizing: border-box; margin: 7px 0 2px;
  border: 1px dashed #b9c6d8; border-radius: 6px; padding: 7px 9px;
  font-family: inherit; font-size: 12.5px; background: #fbfcfe; color: var(--text); }
.soft-sub-note::placeholder { color: #8b9bb0; font-style: italic; }
.soft-sub-note:focus { outline: none; border-color: #2e9e5b; }
@media (max-width: 760px) {
  .soft-chips.soft-subs { padding: 8px; }
  .soft-sub-chips .chip { min-width: 0; flex: 1 1 100%; }
}

/* v2.4.12：网格是项目下的分支，缩进显示；没开网格的项目不出现 */
.proj-branch { margin: 8px 0 4px 18px; padding-left: 12px; border-left: 2px solid #dbe4f2; }
.proj-branch > .grid-optional { margin-top: 0; }


/* ==================== v2.4.14 ==================== */
/* 单位简称 / 报告编号编码说明 */
.no-hint {
  font-size: 12px; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 6px; padding: 7px 10px; margin: 0 0 10px; line-height: 1.65;
}
.no-hint code {
  background: #fff; border: 1px solid #fcd9b6; border-radius: 3px;
  padding: 0 4px; font-size: 11.5px;
}

/* 风格预览：编号引线标注（告诉用户首段要填本单位简称） */
.sp-note .no-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.no-demo-label { font-size: 11px; color: #64748b; }
.no-demo-code {
  font-size: 13px; letter-spacing: .5px; background: #fff;
  border: 1px solid #cbd9f5; border-radius: 5px; padding: 3px 9px; color: #1e3a8a;
}
.no-demo-code b { color: #c2410c; border-bottom: 2px solid #f59e0b; }
.no-demo-tip {
  position: relative; flex: 1 1 100%; font-size: 11.5px; color: #9a3412;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px;
  padding: 6px 10px; line-height: 1.7; margin-top: 4px;
}
.no-demo-tip code { background: #fff; border: 1px solid #fcd9b6; border-radius: 3px; padding: 0 3px; }
.no-demo-leader {
  position: absolute; left: 34px; top: -9px; width: 2px; height: 9px; background: #f59e0b;
}
.no-demo-leader::after {
  content: ''; position: absolute; left: 0; top: -1px; width: 26px; height: 2px;
  background: #f59e0b; transform: rotate(35deg); transform-origin: left center;
}

/* 填写段标题吸顶：往上滑不划走，填完可直接点标题折叠。
 * 去掉 .fill-sec 的 paint containment，避免把 sticky 元素裁掉。 */
#page-fill .fill-sec { contain: layout style; }
#page-fill .fill-sec > summary {
  position: sticky; top: 50px; z-index: 20;
  background: #fff; border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
/* v2.4.33：用户反馈「第三方检查记录表这几个抬头不跟着移动」——
   触屏上吸顶标题一直钉在半空、内容和标题脱节。改为随内容一起滚动。 */
@media (hover: none) and (pointer: coarse) {
  #page-fill .fill-sec > summary { position: static; top: auto; }
}
/* 签字段独立后给一点强调 */
#page-fill .fill-sec[data-sec="sign"] > summary { color: #a3521a; }
#page-fill .fill-sec[data-sec="sign"] .sec-req { background: #c2701c; }


/* ==================== v2.4.15 防遮挡 / 裁断 / 排版整理 ==================== */
/* ① 手机端表单标签左对齐、独占一行：此前继承桌面 .field label{text-align:right}，
   窄屏里长标签贴右边缘，看着像被裁掉、也与输入框错位。 */
#page-fill .field label { text-align: left; font-size: 14px; line-height: 1.5; color: #334155; }
#page-fill .field .auto-tag { font-size: 11px; }

/* ② 自动判定结果框：窄屏字号放大后两行会被裁，给足高度并允许滚动 */
#page-fill .auto-result { min-height: 92px; font-size: 14px; line-height: 1.65;
  overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
#page-fill .judge-el { font-size: 12px; line-height: 1.6; white-space: normal;
  overflow-wrap: anywhere; max-width: 100%; }

/* ③ 大文本域：按 rows 自适应，不再被固定内联高度裁字 */
#page-fill .area-field textarea { min-height: 72px; resize: vertical; overflow-y: auto;
  line-height: 1.6; font-size: 15px; }
#page-fill .area-field > label { font-size: 14px; color: #334155; line-height: 1.5; }

/* ④ 签字栏「新增备选」：窄屏三控件挤一行导致「名称，如」被裁 → 纵向排布 */
#page-fill .sign-add { flex-direction: column; align-items: stretch; gap: 7px; }
#page-fill .sign-add .chipinput { flex: 1 1 100%; width: 100%; min-width: 0;
  box-sizing: border-box; font-size: 15px; padding: 9px 10px; }
#page-fill .sign-add .btn { width: 100%; }

/* ⑤ 底部三段式切换条 + 底部导航：给填写页留足底部空间，内容不再被压住 */
#page-fill.active { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)) !important; }
#page-fill .fill-sec:last-of-type { margin-bottom: 18px; }
/* v2.4.16：删除 body 的 116px 额外留白 —— 与填写页 150px 叠加后，
   切换条与底栏之间出现一大片空白。窄屏沿用下面媒体查询的 58px（正好容纳 fixed 底栏）。 */

/* ⑥ 报告编号编码说明（基本信息页 / 风格预览共用） */
.code-guide { font-size: 13px; line-height: 1.7; }
.code-guide .cg-title { font-weight: 700; font-size: 14px; color: #7c2d12; margin-bottom: 4px; }
.code-guide .cg-lead { margin-bottom: 6px; }
.code-guide code { font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #fff; border: 1px solid #fcd9b6; border-radius: 3px;
  padding: 0 4px; font-size: 12px; color: #9a3412; }
.code-guide .cg-rows { display: flex; flex-direction: column; gap: 2px; }
.code-guide .cg-rows > div { display: flex; align-items: baseline; gap: 8px;
  padding: 2px 0; border-bottom: 1px dashed #fed7aa; }
.code-guide .cg-rows > div > code { flex: 0 0 78px; text-align: center; font-weight: 700; }
.code-guide .cg-rows > div > span { flex: 1 1 auto; min-width: 0; }
.code-guide .cg-foot { margin-top: 6px; color: #9a3412; font-size: 12px; }
.no-hint.code-guide { padding: 10px 12px; }
.cg-compact { background: #fff; border: 1px solid #fcd9b6; border-radius: 7px;
  padding: 9px 11px; margin: 0 0 8px; }
.cg-compact .cg-rows > div > code { flex-basis: 88px; }
@media (max-width: 760px) {
  .code-guide .cg-rows > div { flex-wrap: wrap; gap: 2px 8px; }
  .code-guide .cg-rows > div > code { flex: 0 0 auto; }
  .code-guide .cg-rows > div > span { flex: 1 1 100%; }
}

/* ⑦ 软件资料问题（一行汇总结论）：紧凑、字号够大、三选一一眼可辨 */
.soft-summary { border: 1px solid #cddffd; background: #f7faff; border-radius: 9px;
  padding: 10px 12px 12px; margin: 0 0 12px; }
.ss-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; font-weight: 700; color: #1d4ed8; margin-bottom: 6px; }
.ss-head .btn.mini { font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.ss-hint { font-size: 12.5px; color: #475569; line-height: 1.6; margin-bottom: 8px; }
.ss-options { display: flex; flex-direction: column; gap: 6px; }
.ss-opt { display: flex; align-items: center; gap: 9px; width: 100%; box-sizing: border-box;
  text-align: left; padding: 9px 11px; font-family: inherit; font-size: 13.5px; line-height: 1.5;
  border: 1px solid #d5e2f7; border-radius: 7px; background: #fff; color: #24364b; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ss-opt:hover { border-color: #2e9e5b; } }
.ss-opt.on { border-color: #2e9e5b; background: #e8f6ec; color: #1d7a43; font-weight: 600;
  box-shadow: inset 0 0 0 1px #2f6fed; }
.ss-opt-n { flex: 0 0 22px; height: 22px; line-height: 20px; text-align: center;
  border: 1px solid #cbd9f5; border-radius: 50%; font-size: 12px; background: #fff; }
.ss-opt.on .ss-opt-n { background: #2e9e5b; border-color: #2e9e5b; color: #fff; }
.ss-opt-t { flex: 1 1 auto; min-width: 0; }
.ss-custom { margin-top: 9px; }
.ss-custom > label { display: block; font-size: 12.5px; color: #475569; margin-bottom: 4px; }
.ss-custom > input { width: 100%; box-sizing: border-box; padding: 9px 11px;
  font-family: inherit; font-size: 14px; border: 1px solid #cfd9e8; border-radius: 7px; }
.ss-custom > input:focus { outline: none; border-color: #2f6fed; }

/* ⑧ 第三方检查记录表（软件资料）：收紧空隙、放大字体、更美观 */
#gSoft .grid { gap: 6px 12px; }
#gSoft .field { margin-bottom: 2px; }
#gSoft .field label { font-size: 13.5px; color: #334155; }
#gSoft .field input, #gSoft .field select { font-size: 14.5px; padding: 9px 10px; }
#gSoft .softflags { margin-top: 8px; }
#gSoft .softflag-box { gap: 7px 12px; }
#gSoft .softflag-name { font-size: 13.5px; color: #334155; font-weight: 600; }
#gSoft .softflag-opt { font-size: 13.5px; padding: 6px 12px; min-height: 34px; }
.duty-wrap { display: flex; flex: 1 1 100%; min-width: 0; gap: 6px; flex-wrap: wrap; }
.duty-wrap .fsel { flex: 1 1 140px; min-width: 0; }
.duty-wrap .fcustom { flex: 1 1 100%; min-width: 0; }
#page-fill .duty-wrap .fsel, #page-fill .duty-wrap .fcustom { flex: 1 1 100%; }
#page-fill #gSoft .field label, #page-fill .area-field.softflags > label { text-align: left; }

/* ⑨ 风格预览：说明不裁、差异速览表、每栏专属标签 */
.sp-note { display: block; max-height: none; overflow: visible; font-size: 12.5px; line-height: 1.65; }
.sp-diff-title { font-weight: 700; color: #1d4ed8; margin: 8px 0 5px; font-size: 13px; }
.sp-diff { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; background: #fff; }
.sp-diff th, .sp-diff td { border: 1px solid #dbe4f2; padding: 5px 7px; text-align: left;
  line-height: 1.5; overflow-wrap: anywhere; }
.sp-diff th { background: #eef3fb; color: #1d4ed8; font-weight: 700; }
.sp-diff td:first-child, .sp-diff th:first-child { width: 88px; color: #475569; font-weight: 600; }
.sp-col-h { border-left: 4px solid #94a3b8; }
.sp-col-current .sp-col-h { border-left-color: #64748b; }
.sp-col-ab .sp-col-h { border-left-color: #2f6fed; }
.sp-col-summary .sp-col-h { border-left-color: #c2701c; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }
.sp-tags span { font-size: 10.5px; padding: 2px 7px; border-radius: 10px;
  background: #e8eef6; color: #334155; border: 1px solid #d5e2f7; }
.sp-col-ab .sp-tags span { background: #e8f0ff; color: #1d4ed8; border-color: #c6d9fb; }
.sp-col-summary .sp-tags span { background: #fff1e2; color: #a3521a; border-color: #f6d2ab; }
.sp-jump { margin-top: 6px; font-size: 11px; padding: 4px 8px; }
@media (max-width: 760px) {
  .sp-diff td:first-child, .sp-diff th:first-child { width: 64px; }
  .sp-diff th, .sp-diff td { padding: 4px 5px; font-size: 11px; }
}

/* ⑩ 弹窗内容不被裁（生成汇报材料等） */
.dlg { max-height: 90vh; overflow-y: auto; }


/* v2.4.15 补：逐项检查记录折叠标题（与卡片标题区分，不重复） */
.rec-fold-h { cursor: pointer; list-style: none; margin: 10px 0 6px !important;
  color: #29528f; font-size: 13px; }
.rec-fold-h::-webkit-details-marker { display: none; }
.rec-fold-h::before { content: '▸ '; color: var(--primary); }
details#recDetails[open] > .rec-fold-h::before { content: '▾ '; }
/* 风格预览：编码说明可折叠，差异速览表始终在最上面 */
.cg-fold > summary { cursor: pointer; font-weight: 700; color: #1d4ed8;
  font-size: 12.5px; padding: 6px 0; list-style: none; }
.cg-fold > summary::-webkit-details-marker { display: none; }
.cg-fold > summary::before { content: '▾ '; }
.cg-fold:not([open]) > summary::before { content: '▸ '; }
.cg-fold .cg-compact { margin-top: 4px; }

/* ==================== v2.4.16 反馈修复：遮挡 / 裁断 / 空隙 / 底栏 / 选择版汇总 ==================== */
/* ① 底纹引导：与「报告编号怎么编写」同一套视觉，给各类填写配说明 */
.fill-guide { margin: 6px 0 10px; padding: 9px 12px; background: #f7faff;
  border: 1px solid #cddffd; border-left: 4px solid #2f6fed; border-radius: 8px;
  font-size: 13px; line-height: 1.65; color: #334155; overflow-wrap: anywhere; }
.fill-guide b { color: #1d4ed8; }
/* 手机端窄屏把说明字号再放大一点，避免「字太小」 */
@media (max-width: 760px) { .fill-guide { font-size: 13.5px; } }

/* ② v2.4.17：恢复「结论文字（可微调）」输入框（v2.4.16 曾误隐藏）。
     只读的 .ss-current 展示条已移除，改由可编辑输入框显示当前结论。 */
.ss-current { margin-top: 9px; padding: 9px 11px; background: #eaf2ff;
  border: 1px dashed #9dbcf5; border-radius: 7px; color: #1d4ed8;
  font-size: 13.5px; font-weight: 600; line-height: 1.6; word-break: break-word; }
.ss-current::before { content: "当前结论："; font-weight: 400; color: #475569; }
/* v2.4.17：恢复「软件资料具体项」点选 / 自定义模块（v2.4.10 版本）的紧凑排版 */
.soft-pick-sec { margin-top: 9px; }
.soft-pick-sec > summary.rec-fold-h { padding-top: 7px; padding-bottom: 7px; }
#softItemsCard .fill-guide { margin-top: 8px; }
#softItemsCard .soft-items-bar { margin: 8px 0 6px; }
#softItemsCard .soft-custom-field { margin-top: 6px; margin-bottom: 2px; }
@media (max-width: 760px) {
  #softItemsCard .soft-chips .chip { font-size: 13px; }
  #softItemsCard .soft-custom-field textarea { font-size: 15px; }
}

/* ③ 逐项检查记录：窄屏纵向排布，检查内容整行显示，不再被右侧输入框挤成窄条 */
@media (max-width: 760px) {
  #page-fill .rec-row { flex-direction: column; align-items: stretch; gap: 4px; margin-bottom: 7px; }
  #page-fill .rec-chk { flex: 1 1 auto; width: 100%; font-size: 13.5px;
    line-height: 1.55; padding-top: 0; color: #334155; }
  #page-fill .rec-input { flex: 1 1 auto; width: 100%; min-height: 46px;
    font-size: 15px; line-height: 1.5; }
}

/* ④ 底部导航：文字放大、选中态顶部色条，布局更美观 */
.phone-nav .ptab { position: relative; font-size: 14px; letter-spacing: .5px;
  padding: 10px 0 9px; font-weight: 500; }
.phone-nav .ptab.active { color: var(--primary); font-weight: 700; }
.phone-nav .ptab.active::before { content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%); width: 30px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--primary); }
@media (max-width: 760px) { .phone-nav .ptab { font-size: 14px; } }

/* v2.4.54 · D方案：6格紧凑底栏。拍照/新建为一级常驻入口，图标在上文字在下、红色强调。
   用独立 .nav-ico 而非 .pi，避免被手机端 `.pi{display:none}` 隐藏。
   拍照(.pcam)/新建(.pnew)都不带 .ptab（铁律 v2.4.37：避免被 $$('.ptab') 绑上 switchTab 误切页），
   靠下面更具体的 .phone-nav .pcam/.pnew 覆盖规则做成与 4 个 ptab 等宽的紧凑格。 */
.phone-nav .ptab .nav-ico, .phone-nav .pcam .nav-ico, .phone-nav .pnew .nav-ico { display: block; font-size: 18px; line-height: 1.15; }
.phone-nav .ptab .nav-lbl, .phone-nav .pcam .nav-lbl, .phone-nav .pnew .nav-lbl { display: block; font-size: 11px; line-height: 1.3; }
.phone-nav .pcam, .phone-nav .pnew {
  color: #e5484d; font-weight: 700; font-size: 11px; font-family: inherit;
  flex: 1 1 0; min-width: 0; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 7px 0 6px; margin: 0; border-radius: 0; box-shadow: none;
}

/* ⑤ 三段式切换条：字号放大，文字不再显小 */
.fs-btn { font-size: 13.5px; padding: 10px 4px; }
@media (max-width: 760px) { .fs-btn { font-size: 12.5px; padding: 9px 2px; } }

/* ⑥ 通篇收紧空隙：段、卡、记录项、签字栏 */
#page-fill .fill-sec { margin: 8px 10px; }
#page-fill .fill-sec > summary { padding: 11px 14px; }
#page-fill .sec-body { padding: 2px 12px 10px; }
#page-fill .fill-sec:last-of-type { margin-bottom: 10px; }
#page-fill .sec-body .card-h { margin-bottom: 7px; padding: 6px 0 3px; }
#page-fill .card { padding: 12px 14px; margin-bottom: 9px; }
#page-fill .fill-hint { margin: 4px 2px 8px; }
.soft-summary { padding: 9px 11px 10px; margin: 10px 0 0; }
.ss-head { margin-bottom: 5px; }
.ss-hint { margin-bottom: 7px; }
.ss-options { gap: 5px; }
.ss-opt { padding: 8px 10px; }
.rec-block { margin: 6px 0; padding: 7px 9px; }
.rec-h { margin-bottom: 4px; }
.rec-row { margin-bottom: 5px; }
.rec-toolbar { margin: 2px 0 8px; }
.rec-fold-h { margin: 8px 0 5px !important; }
.sign-card { padding: 8px; }
.sign-card .sign-drop { height: 52px; }
.sign-drop-tip { font-size: 13px; }
.sign-list { margin-top: 6px; gap: 5px; }
.sign-empty { padding: 6px 2px; font-size: 13px; }
.sign-inp { font-size: 14px; padding: 6px 8px; }
.sign-add { margin-top: 6px; }

/* ==================== v2.4.16 补：真实裁断修复（自动判定「更多」被挤出视口） ==================== */
/* 手机端 .auto-bar 一行塞 4 个项，第 4 个「更多」被挤到视口外（left 375 / 宽 52），
   下拉里的「手动更新标准 / 清空判定」只剩 30px，文字全被裁。改为换行铺满。 */
@media (max-width: 760px) {
  #page-fill .auto-bar { flex-wrap: wrap; gap: 6px; }
  #page-fill .auto-bar > .btn { flex: 1 1 44%; min-width: 0; }
  #page-fill .auto-more { flex: 1 1 100%; }
  #page-fill .auto-more > summary { width: 100%; box-sizing: border-box; text-align: center; }
  #page-fill .auto-more-body { width: 100%; }
  #page-fill .auto-more-body > .btn { width: 100%; white-space: normal; }
}
/* 底栏再美化：轻投影 + 选中态浅底，视觉层次更清楚 */
.phone-nav { box-shadow: 0 -2px 12px rgba(15, 23, 42, .07); }
.phone-nav .ptab.active { background: #f5f8ff; }

/* ==================== v2.4.18 反馈修复：自动记录 / 折叠 / 区域搭配竖排 ==================== */

/* ① 企业基本信息标题后的「?」：默认收起编号说明，点开才展示，不再常驻占地方 */
.cg-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 8px; padding: 0;
  border: 1px solid #a9c2f5; border-radius: 50%; background: #eef4ff;
  color: #1d4ed8; font-size: 13px; font-weight: 700; line-height: 1;
  cursor: pointer; vertical-align: middle; font-family: inherit;
}
.cg-help:hover, .cg-help.on { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.cg-pop[hidden] { display: none !important; }
.cg-pop { margin: 4px 0 10px; animation: cgpop .16s ease-out; }
@keyframes cgpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ② 检查日期 / 检查时间：自动生成，默认折叠 */
.auto-time-fold {
  grid-column: 1 / -1; margin: 4px 0; padding: 0;
  border: 1px dashed #cbd9ef; border-radius: 8px; background: #fbfdff;
}
.auto-time-fold > summary {
  cursor: pointer; list-style: none; padding: 7px 12px;
  font-size: 12.5px; font-weight: 600; color: #4b6584;
}
.auto-time-fold > summary::-webkit-details-marker { display: none; }
.auto-time-fold > summary::before { content: '▸ '; color: var(--primary); }
.auto-time-fold[open] > summary::before { content: '▾ '; }
.auto-time-fold > .field { margin: 0 12px 10px; }
.auto-time-fold > .field label { flex: 0 0 132px; }

/* ③ 字段右侧「历史」按钮（替代 ▼ / 默认 两个按钮） */
.opt-history {
  flex: 0 0 auto; align-self: center; height: 26px; padding: 0 9px;
  border: 1px solid #b9cbe8; border-radius: 4px; background: #f2f7ff;
  color: #1d4ed8; font-size: 11.5px; line-height: 1; cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.opt-history:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
#page-fill .field .opt-history { flex: 0 0 auto; }

/* ④ 历史记录弹窗：填过的值可复用、可删除 */
.fh { font-size: 13px; }
.fh-hint { color: #666; line-height: 1.6; margin-bottom: 8px; }
.fh-list { max-height: 40vh; overflow-y: auto; border: 1px solid #e0e0e0;
  border-radius: 6px; padding: 4px; }
.fh-empty { color: #999; text-align: center; padding: 18px 0; }
.fhrow { display: flex; align-items: center; gap: 6px; padding: 3px 4px;
  border-bottom: 1px dashed #eee; }
.fhrow:last-child { border-bottom: none; }
.fhval { flex: 1 1 auto; min-width: 0; text-align: left;
  white-space: normal; overflow-wrap: anywhere; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 4px; background: #f7faff;
  color: #24364d; font-size: 13px; cursor: pointer; font-family: inherit; }
.fhval:hover { border-color: #1d4ed8; background: #eef4ff; }
.fhdel { flex: 0 0 auto; width: 24px; height: 24px; line-height: 1;
  border: 1px solid #f0cccc; border-radius: 4px; background: #fff;
  color: #c0392b; font-size: 15px; cursor: pointer; }
.fhdel:hover { background: #fdecea; }

/* ⑤ 区域搭配：只留虚拟引导 + 竖排卡片（三字段各占一行，框内字体不再被截断） */
.pairguide { margin: 0 0 10px; padding: 9px 12px; background: #f7faff;
  border: 1px solid #cddffd; border-left: 4px solid #2f6fed; border-radius: 8px;
  font-size: 13px; line-height: 1.65; color: #334155; overflow-wrap: anywhere; }
.pairguide b { color: #1d4ed8; }
.pairmgr .pairrow {
  display: block; padding: 10px; margin-bottom: 8px;
  border: 1px solid #dfe7f3; border-radius: 8px; background: #fcfdff;
}
.pairmgr .pairrow:last-child { margin-bottom: 0; }
.pairmgr .pairline { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pairmgr .pairk { flex: 0 0 76px; text-align: right;
  color: #64748b; font-size: 12.5px; white-space: nowrap; }
.pairmgr .pairline input {
  flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box;
  font-size: 13px; padding: 7px 9px; font-family: inherit;
}
.pairmgr .pairfoot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pairmgr .pairdef {
  width: auto; height: auto; padding: 4px 9px; font-size: 12px;
  border: 1px solid #d9d9d9; border-radius: 4px; background: #fff;
  color: #999; cursor: pointer; font-family: inherit;
}
.pairmgr .pairdef.on { color: #a86808; background: #fff6e2; border-color: #e8c98a; font-weight: 700; }
.pairmgr .pairdel { width: auto; height: auto; padding: 4px 9px; font-size: 12px;
  border: 1px solid #f0cccc; border-radius: 4px; }
.pairmgr .pairhead { display: none; }

/* ==================== v2.4.19 本轮反馈 ==================== */

/* 1) 说明性文字统一「点击 ? 查看」：平时只占一行小胶囊，点开展开原文 */
.help-fold { margin: 6px 0 8px; }
.help-head {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0f6ff; border: 1px solid #cfe0fd; border-radius: 999px;
  padding: 3px 10px 3px 4px; font-family: inherit; font-size: 12px;
  line-height: 1.4; color: #1d4ed8; cursor: pointer;
  max-width: 100%; flex-wrap: wrap; text-align: left;
}
.help-head:hover { background: #e4efff; }
.help-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: 0 0 auto;
  border-radius: 50%; background: #2f6fed; color: #fff;
  font-weight: 700; font-size: 12px;
}
.help-tag { font-weight: 600; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.help-fold.open .help-head { background: #e4efff; }
.help-fold > [hidden] { display: none !important; }
.help-fold.open > .fill-guide,
.help-fold.open > .hint,
.help-fold.open > .fill-hint,
.help-fold.open > .pairguide,
.help-fold.open > .no-hint { margin-top: 6px; }

/* 2) 所属区域 / 单位简称 / 编制单位 默认折叠（与时间字段同一套观感） */
.auto-more-fold { margin: 4px 0 10px; border: 1px solid #e2e8f5;
  border-radius: 8px; background: #fbfcff; }
.auto-more-fold > summary { cursor: pointer; list-style: none;
  padding: 9px 12px; font-size: 13px; font-weight: 600; color: #29528f; }
.auto-more-fold > summary::-webkit-details-marker { display: none; }
.auto-more-fold > summary::before { content: '▸ '; color: var(--primary); }
.auto-more-fold[open] > summary::before { content: '▾ '; }
.auto-more-fold > .field { margin: 0 12px 10px; }
.auto-more-fold > .field label { flex: 0 0 132px; }

/* 3) 区域搭配弹窗：当前基本信息（自动记录）三值展示 */
.paircurrent { margin: 0 0 10px; padding: 10px 12px;
  background: #f8fbff; border: 1px solid #dbe7fb; border-radius: 8px; font-size: 12.5px; }
.paircurrent .pct { font-weight: 700; color: #29528f; margin-bottom: 6px; }
.paircurrent .pcrow { display: flex; gap: 8px; padding: 2px 0; }
.paircurrent .pcrow span { flex: 0 0 72px; color: #64748b; }
.paircurrent .pcrow b { font-weight: 600; color: #1f2937; word-break: break-all; }
.paircurrent .pcst { margin-top: 6px; font-size: 12px; color: #8a6d3b; }
.paircurrent .pcst.ok { color: #1a8a3c; }

/* ===== v2.4.20：软件资料分类描述 + 每项「选项 + 自定义特殊情况」一行 =====
   用户口径：照抄截图分类描述、删掉「备注 / 其他」、每个项后面跟一个自定义框；
   双重预防体系汇总到最后一组（已建立 / 未建立 / 自定义 三分类）。 */
.soft-grp-desc { margin: 2px 0 7px; padding: 6px 9px;
  font-size: 12.5px; line-height: 1.65; color: #475569;
  background: #f7faff; border-left: 3px solid #c7dcf7; border-radius: 4px; }
.soft-grp-dual > summary.soft-grp-sum { background: #eaf3ff; color: #1d4ed8; }

/* 2) 手写签名图片：整卡折叠 + 头部重排 + 拖入区折叠 + 横屏排列 */
.sign-sec-h { cursor: pointer; list-style: none; }
.sign-sec-h::-webkit-details-marker { display: none; }
.sign-sec-h::before { content: '▸ '; color: var(--primary); }
.sign-sec[open] > .sign-sec-h::before { content: '▾ '; }
.sign-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
/* v2.4.43：检查人/带队领导签过后默认折叠，签字页更短 */
.sign-body-fold { border-top: 1px solid #eef2f8; padding-top: 6px; }
.sign-body-fold > .sign-body-sum { cursor: pointer; list-style: none; font-size: 12px;
  color: var(--sub); padding: 4px 2px; }
.sign-body-fold > .sign-body-sum::-webkit-details-marker { display: none; }
.sign-body-fold > .sign-body-sum::before { content: '▸ '; color: var(--primary); }
.sign-body-fold[open] > .sign-body-sum::before { content: '▾ '; color: var(--primary); }
.sign-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px; margin: 0 0 8px; padding-bottom: 7px; border-bottom: 1px solid #e7ecf4; }
.sign-title { font-size: 13px; font-weight: 700; color: var(--text); }
.sign-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sign-acts .btn.mini { float: none; margin: 0; }
.sign-drop-fold { margin: 0 0 8px; border: 1px solid #e6ebf3; border-radius: 6px; background: #fbfcfe; }
.sign-drop-fold > summary { cursor: pointer; list-style: none; font-size: 12px;
  color: var(--sub); padding: 7px 10px; }
.sign-drop-fold > summary::-webkit-details-marker { display: none; }
.sign-drop-fold > summary::before { content: '▸ '; color: var(--primary); }
.sign-drop-fold[open] > summary::before { content: '▾ '; }
.sign-drop-fold .sign-drop { margin: 0 10px 10px; width: auto; }
.sign-row.landscape { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px; align-items: start; padding: 6px; background: #f4f8ff;
  border: 1px dashed #b9cdf0; border-radius: 8px; }
.sign-row.landscape .sign-card { max-width: none; min-width: 0; }

/* 3) 手写签名板横屏 */

/* 4) 区域搭配管理：示例格式说明 + 历史填过的不同值 */
.pairsample { margin: 0 0 10px; padding: 10px 12px; border: 1px dashed #cfd9e8;
  border-radius: 7px; background: #fbfcff; }
.ps-t { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.psrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; }
.psrow span { color: var(--sub); }
.psrow b { color: var(--text); background: #eef4ff; border-radius: 4px; padding: 2px 7px; }
.ps-n { margin-top: 7px; font-size: 11.5px; line-height: 1.7; color: #7a8698; }
.pairhist { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #e2e8f5;
  border-radius: 7px; background: #fff; }
.ph-t { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.phrow { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.phk { flex: 0 0 66px; font-size: 12px; color: var(--sub); padding-top: 4px; text-align: right; }
.phvals { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 auto; min-width: 0; }
.phchip { border: 1px solid #cfd9e8; background: #f7faff; color: var(--text);
  border-radius: 14px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.phchip:hover { border-color: var(--primary); background: #eaf1ff; color: var(--primary); }
.phempty { font-size: 12px; color: #a5aebc; padding-top: 4px; }

/* 5) 输出目录：三个控件不挤压 */
#outDir { flex: 1 1 auto; min-width: 120px; }
#outDirHint { margin-top: 6px; }

/* 6) 导出页五个大按钮：长文案允许换行，窄屏让「快速新建下一份」独占一行，
      避免 .btn / .btnrow 的 nowrap 把「（同地区）」几个字裁掉。 */
.btnrow > .btn.big { white-space: normal; line-height: 1.35; text-align: center; }
@media (max-width: 900px) {
  #btnQuickNext { flex: 1 1 100%; }
}

@media (max-width: 760px) {
  .sign-row.landscape { grid-template-columns: 1fr; }
  .sign-head { flex-direction: column; align-items: flex-start; }
  .phk { flex: 0 0 60px; }
}


/* ===== v2.4.23：纯静态 Web 版未连接电脑端时的状态条 =====
   文档流细横条（body 是 flex column、main 是 flex:1），内容整体下移、零遮挡；
   不用 fixed 浮层，避免盖住签名卡 / toast / 底部导航。 */
.aq-offline-bar {
  flex: 0 0 auto;
  position: relative;
  display: flex; align-items: flex-start; gap: 8px;
  background: #fff6e8; color: #8a4b08;
  border-bottom: 1px solid #f0c98a;
  font-size: 12.5px; line-height: 1.5; padding: 6px 36px 6px 12px;
}
.aq-offline-bar b { color: #a3521a; white-space: nowrap; }
.aq-offline-bar span { flex: 1 1 auto; min-width: 0; }
.aq-offline-bar button {
  flex: 0 0 auto;
  border: 0; background: transparent; color: #a3521a;
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 6px;
  align-self: flex-start;
}
@media (max-width: 760px) {
  .aq-offline-bar { font-size: 11.5px; line-height: 1.45; padding: 5px 32px 5px 10px; }
}

/* ===== v2.4.23 修复 ⑤：布局 / 美观 / 触控目标 ===== */

/* P2-7：761~900px 中等宽度下 .toolbar 默认 nowrap 会把末尾按钮挤出视口
   （实测 768px 下 btnDown 右边界 814、btnImportAqc 831）。 */
@media (min-width: 761px) and (max-width: 900px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar > .btn { min-width: 0; max-width: 100%; }
}

@media (max-width: 760px) {
  /* P2-8：签字栏标题的「单独填写」徽章被拆成两行、包围盒被拉成整行宽；
     inline-block + nowrap 保证它始终是完整的小胶囊。 */
  .sec-req { display: inline-block; white-space: nowrap; vertical-align: middle; }
  #page-fill .fill-sec > summary { line-height: 1.55; }

  /* P2-8：复选框说明文字被挤进 193px 窄列、出现「用本次签 / 名」断行 */
  .chk { flex-wrap: wrap; }
  .chk > .hint-sm { flex: 1 1 100%; margin-left: 24px; line-height: 1.55; }

  /* P2-9：手机端辅助控件原先 19~26px 高，手指容易点错。
     只提下限到 32px，不改字号、不铺满 44px，避免版面膨胀。 */
  .zb-btn, .btn.mini, .more-options > summary.card-h {
    min-height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* v2.4.25：问号图标只提触控尺寸、宽高必须相等，否则 18/20px 宽被
     min-height:32px 拉成竖椭圆。统一 32×32 正方形 + 50% 圆角 = 正圆。 */
  .cg-help, .help-q {
    width: 32px; height: 32px; min-height: 32px; padding: 0;
    aspect-ratio: 1 / 1; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .chip { min-height: 32px; padding-top: 6px; padding-bottom: 6px; line-height: 1.4; }
}

/* v2.4.24：恢复江宁内置示例行的视觉标识（蓝色左边条 + 淡蓝底 + 示例徽章） */
.pairrow.pair-builtin { border-left: 3px solid #2f6fd0; background: #f6f9ff; }
.pairtag { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: #2f6fd0; padding: 0 0 6px; }

/* v2.4.35：隐患数据库「浏览库内隐患」行可点开看完整描述 + 依据原文 */
table.hz tr.kb-row { cursor: pointer; }
table.hz tr.kb-row:active td { background: #eef6f0; }
@media (hover: hover) and (pointer: fine) {
  table.hz tr.kb-row:hover td { background: #f2f8f4; }
}

/* ==================== v2.4.37 逐份管理面板（每行独立删除按钮） ==================== */
#reportMgrModal .modal-card { width: 520px; }
.rmgr-tip { padding: 10px 14px; font-size: 13px; color: #8a6d3b; background: #fffbe6;
  border-bottom: 1px solid #f3e6b8; line-height: 1.6; }
.rmgr-list { display: flex; flex-direction: column; gap: 8px; }
.rmgr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rmgr-row.rmgr-empty-row { background: #fffafa; border-color: #f3d7d5; }
.rmgr-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rmgr-idx { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px;
  background: #eef2f8; color: #64748b; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.rmgr-proj { color: #2563eb; font-size: 12px; }
.rmgr-title { font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rmgr-cur { flex: 0 0 auto; font-size: 11px; color: #1a7f37; background: #e8f6ec;
  border-radius: 5px; padding: 2px 6px; }
.rmgr-emptytag { flex: 0 0 auto; font-size: 11px; color: #b91c1c; background: #fee2e2;
  border-radius: 5px; padding: 2px 6px; }
.rmgr-del { flex: 0 0 auto; padding: 7px 12px; font-size: 13px; }
.rmgr-empty { text-align: center; color: var(--sub); padding: 28px 12px; font-size: 14px; }
@media screen and (max-width: 760px) {
  #reportMgrModal .modal-card { width: 100vw; max-width: 100vw; height: auto; max-height: 88vh; border-radius: 12px 12px 0 0; }
  .rmgr-row { padding: 11px 10px; }
}

/* v2.4.38 显眼数据出口：导出数据总表 / 生成汇报材料 */
.quick-data-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line, #d7dce5); }
.quick-data-row .hint-sm { color: var(--sub, #6b7280); font-weight: 600; }
.quick-data-row [data-quick-export],
.quick-data-row [data-quick-material] {
  border-color: #2f6fed; color: #1f5fd0; background: #f4f8ff; font-weight: 600;
}
.quick-data-row [data-quick-export]:hover,
.quick-data-row [data-quick-material]:hover { background: #e7f0ff; border-color: #1f5fd0; }
@media screen and (max-width: 760px) {
  .quick-data-row [data-quick-export],
  .quick-data-row [data-quick-material] { flex: 1 1 100%; }
}

/* v2.4.56 隐患库面板头部：默认单行（PC），窄屏两行 grid 杜绝标题/提示竖排挤压 */
#hzPanel .hz-head {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #eef1f5;
}
#hzPanel .hz-title { flex: 0 0 auto; white-space: nowrap; }
#hzPanel .hz-search { flex: 1 1 260px; min-width: 0; }
#hzPanel .hz-tip { flex: 0 1 auto; white-space: nowrap; }
#hzPanel .hz-close { flex: 0 0 auto; }
@media screen and (max-width: 760px) {
  #hzPanel .hz-head {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title close" "search search" "tip tip";
    gap: 8px;
    padding: 10px 12px;
  }
  #hzPanel .hz-title { grid-area: title; }
  #hzPanel .hz-close { grid-area: close; justify-self: end; }
  #hzPanel .hz-search { grid-area: search; width: 100%; }
  #hzPanel .hz-tip { grid-area: tip; white-space: normal; line-height: 1.5; }
}
