/* =====================================================================
 * preview-engine.css — 公文 A4 预览共享组件
 * 从 helper.html 抽取，与电脑版预览、文件管理页预览共用；
 * mobile/index.html 亦引用本文件，保证预览效果 100% 一致。
 * 注意：字体路径 ./fonts/ 相对本文件所在目录（项目根目录）解析。
 * =================================================================== */
:root{
  --a4-w: 210mm; --a4-h: 297mm;
  --m-top: 3.7cm; --m-bottom: 3.5cm; --m-left: 2.8cm; --m-right: 2.6cm;
}

/* GB 版式 */
@font-face {
  font-family: 'FangSong_GB2312_Embedded';
  src: url('./fonts/仿宋_GB2312.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HeiTi_Embedded';
  src: url('./fonts/黑体.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'XiaoBiaoSong_Embedded';
  src: url('./fonts/小标宋.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'KaiTi_GB2312_Embedded';
  src: url('./fonts/方正楷体_GB2312.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GongWenHeiTi_Embedded';
  src: url('./fonts/方正公文黑体.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SourceHanSans_Embedded';
  src: url('./fonts/思源黑体 SourceHanSansCN-Normal.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
.a4-page{
  width:var(--a4-w); min-height:var(--a4-h);
  background:#fff; margin:0 auto 20px;
  padding:var(--m-top) var(--m-right) var(--m-bottom) var(--m-left);
  box-shadow:0 2px 12px rgba(0,0,0,.15);
  position:relative; box-sizing:border-box; color:#000;
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
}
.a4-page.edit-canvas{
  min-height:auto;
  margin-bottom:0;
}
.gb-header-meta{
  font-family:"Times New Roman","HeiTi_Embedded","黑体","SimHei","Heiti SC","STHeiti","PingFang SC",sans-serif;
  font-size:16pt; line-height:28pt; color:#000;
}
.gb-header-meta .meta-row{
  display:flex; align-items:baseline; gap:1em;
}
.gb-header-meta .meta-justify{
  display:flex;
  justify-content:space-between;
  overflow:hidden;
  width:6ch;
}
.gb-header-meta .meta-copy{
  font-size:16pt; white-space:nowrap; font-variant-numeric:tabular-nums;
}
.gb-header-meta .meta-spacer{
  flex:1;
}
.gb-red-head{
  font-family:"Times New Roman","XiaoBiaoSong_Embedded","方正小标宋简体","小标宋体","SimSun",serif;
  color:#d40000; font-size:16mm; line-height:1.1; letter-spacing:.02em;
  font-weight:normal; margin-top:35mm; margin-bottom:4mm; word-break:keep-all;
  white-space:nowrap; display:table; position:relative; left:50%; transform-origin:center center;
}
.gb-wzh{font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-size:16pt;text-align:center;color:#000;}
.gb-wzh-up{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-size:16pt;color:#000;
  text-align:left; padding-left:1em; position:relative; margin-top:56pt;
}
.gb-wzh-up .signer{position:absolute; right:0; top:0;}
.gb-signer{font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-size:16pt;text-align:right;color:#000;}
.gb-redline{border:none;border-top:2.5px solid #d40000;margin:0 0 14mm;}
.gb-title{
  font-family:"Times New Roman","XiaoBiaoSong_Embedded","方正小标宋简体","小标宋体","SimSun",serif;
  font-size:22pt; line-height:30pt; text-align:center; margin:0 0 28pt; font-weight:normal;
  --title-scale:1;
  width:calc(100% / var(--title-scale));
  transform:scaleX(var(--title-scale));
  transform-origin:center center;
  flex-shrink:0;
  white-space:pre-line;
}
.gb-spacer{height:28pt;}
/* 附件页标识：第一行顶格编排「附件N」（3号黑体），其下空一行（28pt） */
.gb-attach-no{
  font-family:"Times New Roman","GongWenHeiTi_Embedded","HeiTi_Embedded","黑体","SimHei","Heiti SC","STHeiti","PingFang SC",sans-serif; font-size:16pt; line-height:28pt;
  text-indent:0; text-align:left; color:#000;
}
.gb-attach-blank{height:28pt;}
.gb-recipient{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif; font-size:16pt; line-height:28pt; text-align:left; margin-bottom:0;
}
.gb-body{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif; font-size:16pt; line-height:28pt; text-align:justify;
  --body-scale:1;
  width:calc(100% / var(--body-scale));
  transform:scaleX(var(--body-scale));
  transform-origin:left center;
}
.gb-body p{margin:0;text-indent:2em;min-height:28pt;}
.gb-body h1,.gb-body h2,.gb-body h3,.gb-body h4{font-size:16pt;line-height:28pt;margin:0;text-indent:2em;}
.gb-body h1{font-family:"Times New Roman","GongWenHeiTi_Embedded","HeiTi_Embedded","黑体","SimHei","Heiti SC","STHeiti","PingFang SC",sans-serif;font-weight:normal;}
.gb-body h2{font-family:"Times New Roman","KaiTi_GB2312_Embedded","KaiTi","楷体","STKaiti","华文楷体",serif;font-weight:normal;}
.gb-body h3{font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-weight:normal;}
.gb-body h4{font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-weight:normal;}
.gb-body strong{font-weight:700;}
.gb-body table{font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;font-size:12pt;line-height:1.4;width:100%;border-collapse:collapse;}
.gb-body table td,.gb-body table th{border:1px solid #000;padding:2px 6px;height:0.8cm;}
.gb-body table caption{font-family:"Times New Roman","HeiTi_Embedded","黑体","SimHei",sans-serif;font-size:16pt;text-align:left;margin-bottom:4pt;}
.gb-attach{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;
  font-size:16pt; line-height:28pt; margin-top:0;
}
.gb-attach-line{display:flex;padding-left:2em;text-indent:0;}
.gb-attach-line>span{white-space:nowrap;}
.gb-attach-line .attach-t{white-space:normal;}
.gb-signature{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif; font-size:16pt; line-height:28pt;
  margin-top:0; text-align:right; padding-right:0;
}
.gb-signature .sig-org,.gb-signature .sig-seal,.gb-signature .sig-date{display:table;margin:0 auto;white-space:nowrap;}
.gb-annotation{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif; font-size:16pt; line-height:28pt;
  margin-top:0; padding-left:2em; text-indent:0;
}
.gb-annotation .ann-line{ display:block; }
/* 落款孤页标注：成文日期单独成页时，该页第一行顶格标注（此页无正文），样式同正文、顶格不缩进 */
.gb-nobody{
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif; font-size:16pt; line-height:28pt;
  text-indent:0;
}
.gb-annotation .ann-line + .ann-line{ text-indent:0; padding-left:0; }
.gb-pagenum{
  position:absolute; bottom:2.8cm;
  font-family:"SimSun","宋体","Times New Roman",serif; font-size:14pt; color:#000;
}
.gb-pagenum.odd{ right:2.6cm; text-align:right; }
.gb-pagenum.even{ left:2.8cm; text-align:left; }
.gb-ji{
  position:absolute; bottom:4cm; left:2.8cm; right:2.6cm;
  font-family:"Times New Roman","FangSong_GB2312_Embedded","仿宋_GB2312","FangSong","仿宋",serif;
  font-size:14pt; line-height:26pt;
  /* 版记容器底边距 A4 底线 4cm，末尾 hr 用负 margin 贴紧容器底边，
     使版记下边线恰好落在距 A4 底线 4cm 处 */
  display:flex; flex-direction:column;
}
.gb-ji-line{border:none;border-top:0.35mm solid #000;margin:0;}
.gb-ji-line.thin{border-top:0.25mm solid #000;}
.gb-ji-recipient{text-align:left;padding:2pt 1em;}
.gb-ji-copy{text-align:left;padding:2pt 1em;}
.gb-ji-print{display:flex;justify-content:space-between;padding:2pt 1em;}
/* 版记末尾边线距 A4 底线恰好 4cm：
   抵消印发行的 padding-bottom(2pt)，使最后 hr 贴紧容器底边 */
.gb-ji > .gb-ji-line:last-child{margin-bottom:-2pt;}
