/* ===================================================
   30 条自查表 · A4 双面文档版式
   屏幕上是"纸"，打印出来是同一份东西（WYSIWYG）
   A4 → 210×297mm，页边距 12mm，可用区 186×272mm
   =================================================== */

.a4-doc { padding: 8px 0 40px; }

.a4-page {
  /* 屏幕：整张 A4，内含 12mm 页边距，与 @page 完全一致 */
  width: 210mm;
  height: 297mm;
  margin: 0 auto 18px;
  padding: 12mm;
  background: #fff;
  color: #111;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "SimSun", "Songti SC", "STSong", serif;
  font-size: 9pt;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.a4-page * { box-sizing: border-box; }

/* ---------- 抬头 ---------- */
.doc-title {
  font-family: "SimHei", "Heiti SC", "Microsoft YaHei", sans-serif;
  font-size: 15pt;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding-top: 1mm;
}
.doc-sub {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 7.5pt; color: #555; margin-top: 1.2mm;
  border-bottom: 1.2pt solid #111; padding-bottom: 1.4mm;
}

/* ---------- 表单头 ---------- */
.form-tbl { width: 100%; border-collapse: collapse; margin-top: 2mm; table-layout: fixed; }
.form-tbl td {
  border: .6pt solid #666; padding: 1.8mm 2mm;
  font-size: 8pt; color: #111; height: 8.2mm; vertical-align: middle;
}
.form-tbl .k { color: #444; }
.form-tbl .blank { display: inline-block; border-bottom: .6pt solid #999; min-width: 14mm; height: 1em; }
.opt-inline { white-space: nowrap; }
.opt-inline .bx { font-family: "SimSun", serif; }

.doc-note {
  font-size: 7.6pt; color: #333; line-height: 1.6;
  margin-top: 2.4mm; padding: 2mm 2.6mm;
  background: #f5f5f3; border-left: 1.6pt solid #333;
}
.doc-note b { font-family: "SimHei", "Microsoft YaHei", sans-serif; }

/* ---------- 分组 ---------- */
.grp { margin-top: 2.6mm; }
.grp-head {
  display: flex; align-items: center; gap: 2mm;
  font-family: "SimHei", "Heiti SC", "Microsoft YaHei", sans-serif;
  font-size: 9pt; font-weight: 700;
  padding: 1.1mm 2mm; background: #ececea;
  border-left: 2.6pt solid #111;
}
.grp-head .gn { font-size: 7.5pt; color: #666; font-weight: 400; letter-spacing: .5px; }
.grp-head .gc { margin-left: auto; font-size: 7pt; color: #666; font-weight: 400; }

/* ---------- 检查项 ---------- */
.ck {
  display: flex; align-items: flex-start; gap: 1.6mm;
  padding: 1.3mm 1mm 1.3mm .4mm;
  border-bottom: .4pt solid #d8d8d4;
}
.ck:last-child { border-bottom: none; }
.ck-n {
  flex: 0 0 6mm; font-size: 7.5pt; color: #888;
  font-variant-numeric: tabular-nums; padding-top: .2mm;
}
.ck-body { flex: 1; min-width: 0; }
.ck-t { font-size: 9pt; line-height: 1.38; color: #111; }
.ck-r { font-size: 7.2pt; color: #6b6b66; line-height: 1.32; margin-top: .35mm; }

/* 三态勾选 */
.ck-opts {
  flex: 0 0 37mm; display: flex; justify-content: flex-end; gap: 1.2mm;
  font-size: 7.6pt; color: #222; padding-top: .3mm;
}
.ck-opts label { display: inline-flex; align-items: center; gap: .5mm; cursor: pointer; white-space: nowrap; }
.ck-opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.ck-opts .mk { font-family: "SimSun", serif; font-size: 8.6pt; line-height: 1; }
.ck-opts input + .mk::before { content: '□'; }
.ck-opts input:checked + .mk::before { content: '■'; }

/* ---------- 页脚 ---------- */
.pg-foot {
  margin-top: auto; padding-top: 2mm; border-top: .6pt solid #bbb;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 7pt; color: #666;
}
.pg-foot b { color: #333; font-weight: 400; }

/* ---------- 结论与签署（第 2 页） ---------- */
.sign-block { margin-top: 2.2mm; border: .8pt solid #666; padding: 0; }
.sign-head {
  font-family: "SimHei", "Microsoft YaHei", sans-serif;
  font-size: 8.6pt; font-weight: 700;
  background: #ececea; padding: 1.4mm 2mm; border-bottom: .6pt solid #666;
}
.sign-body { padding: 1.9mm 2.4mm 2.2mm; }
.sign-line { font-size: 8.2pt; color: #111; line-height: 1.9; }
.sign-line .u { display: inline-block; border-bottom: .6pt solid #888; min-width: 9mm; height: 1em; }
.sign-area {
  margin-top: 1.6mm; font-size: 7.6pt; color: #555;
}
.sign-area .rule { border-bottom: .4pt dotted #aaa; height: 5.8mm; }
.sign-sign { margin-top: 2mm; display: flex; gap: 6mm; font-size: 8pt; color: #111; }
.sign-sign .u { display: inline-block; border-bottom: .6pt solid #888; min-width: 20mm; height: 1em; }

/* ---------- 屏幕上的工具条（不打印） ---------- */
.a4-hint {
  max-width: 210mm; margin: 0 auto 14px;
  font-size: 12.5px; color: var(--tx-2); line-height: 1.7;
}
.a4-hint b { color: var(--tx); font-weight: 500; }

/* ================= 打印 ================= */
@page { size: A4; margin: 12mm; }

@media print {
  html, body {
    background: #fff !important;
    margin: 0 !important; padding: 0 !important;
  }
  .nav, .footer, .progress-bar, .no-print, .a4-hint { display: none !important; }
  .page { padding: 0 !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .a4-doc { padding: 0 !important; }
  .a4-page {
    /* 打印：@page 已经让出 12mm，容器只需撑满可用高度 */
    width: auto; height: 273mm;
    margin: 0 !important; padding: 0 !important;
    box-shadow: none !important;
    page-break-after: always;
    break-after: page;
  }
  .a4-page:last-child { page-break-after: auto; break-after: auto; }
  .ck-opts input + .mk::before { content: '□'; }
  .ck-opts input:checked + .mk::before { content: '■'; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 续页眉头 ---------- */
.doc-head2 {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 8pt; color: #333;
  border-bottom: 1pt solid #111; padding-bottom: .9mm; margin-bottom: .7mm;
}
.doc-head2 b { font-family: "SimHei", "Microsoft YaHei", sans-serif; font-size: 9pt; }
.doc-head2 .u { display: inline-block; border-bottom: .6pt solid #999; min-width: 34mm; height: 1em; }

/* ================= 窄屏（屏幕） ================= */
/* A4 固定 210mm（约 794px），手机上必然撑破视口（实测 scrollWidth 818 vs 390），
   右侧内容被裁掉。窄屏改为「容器内横向滚动」，版式与打印保持一致，
   同时提示可以直接下载 PDF。 */
@media screen and (max-width: 900px) {
  .a4-doc {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 20px;
    border-radius: 6px;
    /* 右侧渐隐，暗示还能往右滑，避免被误认为内容被裁坏 */
    box-shadow: inset -14px 0 14px -14px rgba(0, 0, 0, .9);
  }
  .a4-page {
    margin-left: 0;
    margin-right: 0;
  }
  .a4-hint::after {
    content: "手机上纸张版式较宽，可左右滑动查看，或直接下载上面的 PDF。";
    display: block;
    margin-top: 9px;
    color: var(--amber);
    font-size: 12px;
  }

  /* 底部固定进度条：一行塞了「已核 + 进度条 + 计数 + 统计 + 按钮」，
     窄屏挤不下会把视口撑到 438px（实测），这里改成换行排布。 */
  .progress-in {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 0 16px;
  }
  .progress-in .bar { flex: 1 1 100%; order: -1; height: 5px; }
  .progress-in .pct { min-width: 0; text-align: left; }
  .progress-in #tally { white-space: normal !important; flex: 1 1 auto; }
  .progress-in .btn { padding: 8px 14px !important; font-size: 12.5px !important; }
}
