
  :root{
    --brand:#005e32;
    --brand-dark:#004625;
    --light:#f1f7f4;
    --line:#2d2d2d;
    --muted:#666;
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    background:#e9e9e9;
    color:#111;
    font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",Arial,sans-serif;
  }
  .toolbar{
    position:sticky;
    top:0;
    z-index:20;
    display:grid;
    grid-template-columns:auto auto 1fr;
    align-items:center;
    gap:9px 18px;
    padding:10px 18px 9px;
    background:#fff;
    border-bottom:1px solid #ddd;
    box-shadow:0 1px 5px rgba(0,0,0,.08);
  }
  .toolbar-brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:max-content;
  }
  .toolbar-brand img{
    width:48px;
    height:34px;
    object-fit:contain;
  }
  .toolbar-company{
    color:var(--brand);
    font-size:17px;
    font-weight:800;
    letter-spacing:.5px;
  }
  .toolbar button{
    border:0;
    border-radius:6px;
    padding:9px 24px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
  }
  .primary{background:var(--brand);color:#fff;}
  .toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;}
  .toolbar button:disabled{opacity:.6;cursor:wait;}
  .pdf-button{background:#e8f2ed;color:var(--brand-dark);}
  .tips{
    justify-self:end;
    color:#666;
    font-size:13px;
  }
  .toolbar-note{
    grid-column:1 / -1;
    padding-top:7px;
    border-top:1px dashed #d8d8d8;
    color:#9a4f00;
    font-size:13px;
  }
  @media (max-width:850px){
    .toolbar{grid-template-columns:1fr auto;}
    .tips{
      grid-column:1 / -1;
      justify-self:start;
    }
  }

  .page{
    position:relative;
    width:210mm;
    min-height:297mm;
    margin:14px auto;
    padding:10mm 12mm 10mm;
    background:#fff;
    box-shadow:0 2px 12px rgba(0,0,0,.14);
    overflow:hidden;
  }
  .page::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:4mm;
    background:linear-gradient(90deg,var(--brand-dark),var(--brand));
  }
  .document-header{
    display:grid;
    grid-template-columns:39mm 1fr 42mm;
    align-items:center;
    gap:3mm;
    min-height:22mm;
    margin-top:1mm;
    margin-bottom:4mm;
  }
  .brand-block{
    display:flex;
    align-items:center;
    gap:2mm;
  }
  .logo-frame{
    width:35mm;
    height:19mm;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }
  .logo-frame img{
    width:29mm;
    height:29mm;
    object-fit:contain;
    transform:scale(.95);
  }
  .document-title{text-align:center;}
  .document-title h1{
    margin:0;
    font-size:24px;
    letter-spacing:3px;
    font-weight:800;
    white-space:nowrap;
  }
  .document-title .company-name{
    margin-top:1.5mm;
    color:var(--brand);
    font-size:12px;
    font-weight:700;
    letter-spacing:1px;
  }
  .doc-meta{
    font-size:9.8px;
    line-height:1.9;
    text-align:right;
    white-space:nowrap;
  }
  .doc-meta strong{font-size:12px;}
  .rule{
    height:1px;
    margin-bottom:3mm;
    background:var(--brand);
  }

  table{
    width:100%;
    table-layout:fixed;
    border-collapse:collapse;
    margin-bottom:3.5mm;
  }
  th,td{
    border:1px solid var(--line);
    padding:2.3mm 2.2mm;
    font-size:11.5px;
    line-height:1.45;
    vertical-align:middle;
    word-break:break-word;
  }
  th,.label{
    background:var(--light);
    font-weight:700;
    text-align:center;
  }
  .label{width:24mm;}
  .basic-info .label{width:auto;}
  .value{min-height:7mm;}
  .center{text-align:center;}
  .right{text-align:right;}
  .strong{font-weight:700;}
  .section-title{
    display:flex;
    align-items:center;
    gap:7px;
    margin:3.5mm 0 1.8mm;
    color:var(--brand);
    font-size:14px;
    font-weight:800;
  }
  .section-title::before{
    content:"";
    width:4px;
    height:16px;
    background:var(--brand);
  }
  .detail th,.detail td{text-align:center;}
  .detail td.item-name{text-align:left;}
  .total-row td{
    background:#fafafa;
    font-weight:700;
  }
  .check-box{
    display:inline-block;
    width:13px;
    height:13px;
    margin:0 4px 0 2px;
    border:1px solid #222;
    vertical-align:-2px;
  }
  .remark{
    height:24mm;
    vertical-align:top;
  }
  .notice-remark{
    height:20mm;
    vertical-align:top;
  }
  .signatures td{
    height:18mm;
    padding:3mm 2.5mm;
    vertical-align:bottom;
  }
  .sign-line{
    display:inline-block;
    min-width:24mm;
    height:7mm;
    border-bottom:1px solid #333;
    vertical-align:bottom;
  }
  .footer{
    display:flex;
    justify-content:space-between;
    margin-top:4mm;
    padding-top:2.5mm;
    border-top:1px solid #999;
    color:var(--muted);
    font-size:10px;
  }
  .copy-note{
    position:absolute;
    bottom:5mm;
    left:0;
    right:0;
    color:#777;
    font-size:9.5px;
    text-align:center;
  }
  .status-pill{
    display:inline-block;
    padding:1px 7px;
    border:1px solid #8ebaa6;
    border-radius:10px;
    color:var(--brand);
    font-size:10px;
  }
  .package-table .label{width:25mm;}
  /* 包装物料订单：按参考表单使用黑白表格和独立抬头。 */
  .order-page{width:297mm;min-height:210mm;padding:8mm 10mm;color:#000;font-family:"SimSun","宋体","Noto Serif SC",serif;}
  .order-page::before{display:none;}
  .order-page .order-header{position:relative;min-height:26mm;padding-top:1mm;text-align:center;}
  .order-page .order-logo{position:absolute;left:0;top:0;width:26mm;height:auto;}
  .order-page .order-title{margin:0 0 2mm;font-size:26px;line-height:1.35;font-weight:700;letter-spacing:1px;}
  .order-page .order-company{font-size:19px;line-height:1.4;font-weight:700;}
  .order-page table{width:100%;border-collapse:collapse;table-layout:fixed;margin:0;}
  .order-page .order-info{margin:1mm 0 4mm;}
  .order-page .order-info td{border:0;background:#fff;padding:.5mm 0;height:6mm;font-size:13px;line-height:1.4;vertical-align:top;overflow-wrap:anywhere;}
  .order-page .order-info .info-label{font-weight:700;white-space:nowrap;}
  .order-page .order-items th,.order-page .order-items td{border:1px solid #000;background:#fff;color:#000;padding:1.3mm 1.5mm;font-size:13px;line-height:1.4;overflow-wrap:anywhere;}
  .order-page .order-items th{height:8mm;text-align:left;font-weight:700;vertical-align:top;}
  .order-page .order-items .order-item-values td{height:22mm;text-align:left;vertical-align:middle;white-space:pre-wrap;}
  .order-page .order-items .order-remark-label{font-weight:700;vertical-align:top;}
  .order-page .order-items .order-remark{height:18mm;vertical-align:top;white-space:pre-wrap;}
  .order-page .order-people{display:flex;justify-content:space-between;margin:4mm 1mm 5mm;font-size:13px;font-weight:400;line-height:1.4;}
  .order-page .order-conditions{margin:0;font-size:13px;font-weight:700;line-height:1.5;}
  .order-page .order-conditions ol{margin:0;padding-left:5.5mm;}
  .order-page .order-conditions li{margin:0 0 1mm;break-inside:avoid;}
  .order-page .order-print-meta{display:flex;justify-content:flex-end;gap:8mm;margin-top:4mm;font-size:9px;color:#666;}
  .order-page.pdf-export{width:277mm;min-height:0;margin:0;padding:0;box-shadow:none;overflow:visible;}
  .order-page.pdf-export::before{display:none;}




  /* ===== A4横版：多规格生产通知单（最多6个规格） ===== */
  #production.production-landscape{
    width:297mm;
    min-height:210mm;
    height:210mm;
    margin:12px auto;
    padding:6mm 8mm 5mm;
    overflow:hidden;
  }
  #production.production-landscape::before{height:2.5mm;}
  #production .document-header{
    grid-template-columns:34mm 1fr 90mm;
    min-height:16mm;
    margin-top:0;
    margin-bottom:1.5mm;
    position:relative;
  }
  #production .document-header .document-title{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    width:max-content;
    max-width:90mm;
    text-align:center;
    z-index:2;
  }
  #production .document-header .brand-block{
    grid-column:1;
    justify-self:start;
  }
  #production .document-header .doc-meta{
    grid-column:3;
    justify-self:end;
    align-self:center;
    width:100%;
    text-align:right;
    position:relative;
    z-index:3;
    font-size:10px;
    line-height:1.7;
    white-space:nowrap;
  }
  #production .logo-frame{
    width:31mm;
    height:15mm;
  }
  #production .logo-frame img{
    width:24mm;
    height:24mm;
  }
  #production .document-title h1{
    font-size:17.5px;
    letter-spacing:3px;
  }
  #production .document-title .company-name{
    margin-top:.7mm;
    font-size:10.5px;
  }
  #production .doc-meta{
    font-size:10px;
    line-height:1.6;
  }
  #production .rule{margin-bottom:1.6mm;}
  #production table{margin-bottom:1.8mm;}
  #production th,
  #production td{
    padding:1.15mm 1mm;
    font-size:9.2px;
    line-height:1.2;
  }
  #production .production-order-info td{
    height:7.2mm;
    padding:.9mm .75mm;
    font-size:8.8px;
    line-height:1.12;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  #production .production-order-info .label{
    width:auto;
    font-weight:700;
  }
  #production .section-title{
    margin:1.7mm 0 1mm;
    font-size:11.5px;
  }
  #production .section-title::before{
    width:3px;
    height:13px;
  }
  #production .production-items{
    margin-bottom:1.5mm;
  }
  #production .production-items th{
    text-align:center;
    font-size:9.5px;
    padding:.65mm .5mm;
    line-height:1.08;
  }
  #production .production-items .group-head th{
    height:5.6mm;
    background:#e9f2ed;
    font-size:10.3px;
  }
  #production .production-items tbody td{
    height:18mm;
    padding:1mm .6mm;
    text-align:center;
    font-size:9.6px;
    line-height:1.15;
    word-break:break-all;
    overflow-wrap:anywhere;
  }
  #production .production-items tbody td.text-left{text-align:left;}
  #production .production-items th:nth-child(3):nth-child(-n+5),
  #production .production-items tbody td:nth-child(3):nth-child(-n+5),
  #production .production-items th:nth-child(8):nth-child(-n+13),
  #production .production-items tbody td:nth-child(8):nth-child(-n+13){
    font-size:9.1px;
  }
  #production .production-items tbody td:nth-child(2){
    font-size:10.6px;
    font-weight:700;
  }
  #production .production-items tbody td:nth-child(n+3):nth-child(-n+5){
    font-size:10.1px;
    font-weight:700;
  }
  #production .production-items tbody td:nth-child(6),
  #production .production-items tbody td:nth-child(7){
    font-size:8.6px;
  }
  #production .production-items tbody td:last-child{
    font-size:9px;
    line-height:1.12;
    white-space:pre-wrap;
  }

  #production .production-items tbody tr:nth-child(even) td{background:#fbfbfb;}
  #production .production-items .empty-row td{
    color:#777;
    height:13mm;
  }
  #production .production-bottom-grid{
    display:grid;
    grid-template-columns:1.45fr 1fr;
    gap:3mm;
    align-items:start;
  }
  #production .production-remark-table td{
    height:9mm;
    vertical-align:top;
    font-size:9.1px;
  }
  #production .production-signatures td{
    height:8.5mm;
    padding:1mm 1.2mm;
    vertical-align:bottom;
    white-space:nowrap;
    font-size:8.8px;
  }
  #production .production-signatures .sign-line{
    min-width:20mm;
    height:4mm;
  }
  #production .production-footer{
    margin-top:1.6mm;
    padding-top:1.3mm;
    font-size:8.8px;
  }

  /* ===== A4竖向上半页：验收入库单（保留原横向样式） ===== */
  #inbound.inbound-a5{
    width:210mm;
    min-height:297mm;
    height:297mm;
    margin:12px auto;
    padding:0;
    background:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,.16);
    overflow:hidden;
    color:#000;
    font-family:"SimSun","宋体","NSimSun",serif;
    font-size:12px;
  }
  #inbound.inbound-a5::before{display:none;}
  #inbound .half-sheet{
    width:210mm;
    height:148.5mm;
    box-sizing:border-box;
    padding:4mm 6mm 3.5mm;
    overflow:hidden;
  }
  #inbound .blank-half{
    width:210mm;
    height:148.5mm;
    box-sizing:border-box;
  }
  #inbound .inbound-heading{
    display:grid;
    grid-template-columns:1fr;
    align-items:center;
    height:11mm;
    margin:0 0 1mm;
  }
  #inbound .title{
    height:9mm;
    line-height:9mm;
    margin:0;
    text-align:center;
    font-size:21px;
    font-weight:700;
    letter-spacing:5px;
  }
  #inbound .head-info{
    margin-bottom:2mm;
  }
  #inbound .head-info td{
    height:7.2mm;
    padding:.8mm 1.5mm;
    border:0;
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #inbound .head-info .k{
    font-weight:700;
  }
  #inbound table{
    width:100%;
    margin:0;
    border-collapse:collapse;
    table-layout:fixed;
  }
  #inbound th,
  #inbound td{
    border:1px solid #000;
    padding:1mm 1.2mm;
    background:#fff;
    color:#000;
    font-family:"SimSun","宋体","NSimSun",serif;
    font-size:11.5px;
    line-height:1.25;
    vertical-align:middle;
    word-break:break-all;
  }
  #inbound th{
    height:7.5mm;
    font-weight:700;
    text-align:center;
  }
  #inbound .detail td{
    height:12mm;
    text-align:center;
  }
  #inbound .detail .name{text-align:left;}
  #inbound .detail .total td{
    height:7.5mm;
    font-weight:700;
  }
  #inbound .remark-table{
    margin-top:2mm;
  }
  #inbound .remark-table td{
    height:18mm;
    padding:1.5mm;
    vertical-align:top;
  }
  #inbound .remark-title{
    font-weight:700;
    white-space:nowrap;
  }
  #inbound .signature-table{
    margin-top:2mm;
  }
  #inbound .signature-table td{
    height:14mm;
    padding:1.5mm 1.8mm;
    vertical-align:bottom;
    white-space:nowrap;
  }
  #inbound .signature-line{
    display:inline-block;
    min-width:22mm;
    height:5mm;
    border-bottom:1px solid #000;
    vertical-align:bottom;
  }
  #inbound .print-meta{
    display:flex;
    justify-content:flex-end;
    gap:8mm;
    margin-top:1.2mm;
    font-size:10.5px;
  }


  /* ===== A4竖向：同供应商同日入库明细合并打印 ===== */
  #supplierInbound{
    width:210mm;
    margin:0 auto;
  }
  #supplierInbound .supplier-inbound-paper{
    width:210mm;
    min-height:297mm;
    height:297mm;
    margin:12px auto;
    padding:0;
    background:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,.16);
    overflow:hidden;
    color:#000;
    font-family:"SimSun","宋体","NSimSun",serif;
    font-size:11px;
    box-sizing:border-box;
  }
  #supplierInbound .summary-half-sheet{
    width:210mm;
    min-height:148.5mm;
    height:auto;
    box-sizing:border-box;
    padding:4mm 5mm 3.5mm;
    overflow:visible;
  }
  #supplierInbound .summary-blank-half{
    display:none;
  }
  #supplierInbound .summary-heading{
    position:relative;
    height:10mm;
    margin-bottom:.7mm;
  }
  #supplierInbound .summary-title{
    text-align:center;
    font-size:19px;
    line-height:9mm;
    font-weight:700;
    letter-spacing:3px;
  }
  #supplierInbound .summary-page-no{
    position:absolute;
    right:0;
    top:1mm;
    font-size:9px;
    white-space:nowrap;
  }
  #supplierInbound .summary-head-info{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin:0 0 1.2mm;
  }
  #supplierInbound .summary-head-info td{
    border:0;
    height:6.5mm;
    padding:.45mm 1mm;
    font-size:10.2px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #supplierInbound .summary-head-info .k{
    font-weight:700;
  }
  #supplierInbound .summary-detail{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin:0;
  }
  #supplierInbound .summary-detail th,
  #supplierInbound .summary-detail td{
    border:1px solid #000;
    padding:.45mm .35mm;
    color:#000;
    background:#fff;
    font-size:7.6px;
    line-height:1.12;
    vertical-align:middle;
    text-align:center;
    word-break:break-all;
    overflow-wrap:anywhere;
  }
  #supplierInbound .summary-detail th{
    height:7mm;
    font-weight:700;
  }
  #supplierInbound .summary-detail tbody td{
    height:8.2mm;
  }
  #supplierInbound .summary-detail .text-left{
    text-align:left;
  }
  #supplierInbound .summary-detail .money{
    white-space:nowrap;
  }
  #supplierInbound .summary-detail .summary-total td{
    height:7mm;
    font-weight:700;
    font-size:8px;
  }
  #supplierInbound .summary-warning{
    display:none;
    margin-top:.8mm;
    font-size:8px;
    line-height:1.15;
  }
  #supplierInbound .summary-signatures{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin-top:1.3mm;
  }
  #supplierInbound .summary-signatures td{
    border:1px solid #000;
    height:9.5mm;
    padding:.8mm 1mm;
    font-size:9px;
    vertical-align:bottom;
    white-space:nowrap;
  }
  #supplierInbound .summary-sign-line{
    display:inline-block;
    min-width:22mm;
    height:4mm;
    border-bottom:1px solid #000;
    vertical-align:bottom;
  }
  #supplierInbound .summary-footnote{
    margin-top:.7mm;
    font-size:8px;
    line-height:1.15;
  }
  #supplierInbound .summary-print-meta{
    display:flex;
    justify-content:flex-end;
    gap:7mm;
    margin-top:.7mm;
    font-size:8.5px;
  }

  /* ===== A4竖向上半页：原料入库验收记录 ===== */
  #rawInbound.raw-inbound-a5{
    width:210mm;
    min-height:297mm;
    height:297mm;
    margin:12px auto;
    padding:0;
    background:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,.16);
    overflow:hidden;
    color:#000;
    font-family:"SimSun","宋体","NSimSun",serif;
  }
  #rawInbound.raw-inbound-a5::before{display:none;}
  #rawInbound .half-sheet{
    width:210mm;
    height:148.5mm;
    box-sizing:border-box;
    padding:4mm 6mm 3.5mm;
    overflow:hidden;
  }
  #rawInbound .blank-half{
    width:210mm;
    height:148.5mm;
    box-sizing:border-box;
  }
  #rawInbound .raw-title{
    height:11mm;
    line-height:11mm;
    text-align:center;
    margin:0 0 1mm;
    font-size:20px;
    font-weight:700;
    letter-spacing:3px;
  }
  #rawInbound .raw-head-info{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6mm;
    margin-bottom:1.8mm;
    font-size:11.5px;
  }
  #rawInbound .raw-head-info .head-item{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #rawInbound .raw-head-info .head-item:last-child{
    text-align:right;
  }
  #rawInbound .raw-head-info .k{
    font-weight:700;
  }
  #rawInbound table{
    width:100%;
    margin:0;
    border-collapse:collapse;
    table-layout:fixed;
  }
  #rawInbound td,
  #rawInbound th{
    border:1px solid #000;
    padding:.85mm 1.15mm;
    color:#000;
    background:#fff;
    font-size:10.5px;
    line-height:1.2;
    vertical-align:middle;
    word-break:break-all;
  }
  #rawInbound .raw-label{
    font-weight:700;
    text-align:center;
    white-space:nowrap;
  }
  #rawInbound .raw-basic td{
    height:7mm;
  }
  #rawInbound .raw-section-title{
    margin:1.5mm 0 .8mm;
    font-size:11.5px;
    font-weight:700;
  }
  #rawInbound .raw-accept-price td{
    height:7mm;
  }
  #rawInbound .raw-result td{
    height:8mm;
  }
  #rawInbound .raw-sign{
    margin-top:1.5mm;
  }
  #rawInbound .raw-sign td{
    height:8mm;
    font-size:10.2px;
  }
  #rawInbound .raw-remark{
    margin-top:1.5mm;
  }
  #rawInbound .raw-remark td{
    height:14mm;
    vertical-align:top;
    padding:1.5mm;
  }

  #rawInbound .raw-combined{
    margin-top:1.5mm;
  }
  #rawInbound .raw-combined td{
    height:8mm;
  }
  #rawInbound .raw-combined tr:nth-child(2) td{
    height:9mm;
  }
  #rawInbound .raw-scope-note{
    margin-top:1mm;
    font-size:10.5px;
    line-height:1.4;
  }
  #rawInbound .raw-print-meta{
    display:flex;
    justify-content:space-between;
    gap:4mm;
    margin-top:1.2mm;
    padding-top:1mm;
    border-top:1px solid #aaa;
    font-size:9.5px;
  }

  /* 原料入库验收记录：A4下半页完整记录 */
  #rawInbound .raw-full-half{
    width:210mm;
    height:148.5mm;
    box-sizing:border-box;
    padding:4.2mm 6mm 3.2mm;
    overflow:hidden;
    position:relative;
    border-top:1px dashed #999;
  }
  #rawInbound .raw-full-half::before{
    content:"";
    position:absolute;
    left:50%;
    top:-1px;
    width:22mm;
    height:1px;
    transform:translateX(-50%);
    background:#fff;
  }
  #rawInbound .raw-full-title{
    margin:0 0 1.2mm;
    text-align:center;
    font-size:16px;
    line-height:7.5mm;
    font-weight:700;
    letter-spacing:2px;
  }
  #rawInbound .raw-full-head-info{
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:center;
    gap:8mm;
    margin-bottom:1.2mm;
    font-size:10.2px;
    line-height:6.5mm;
  }
  #rawInbound .raw-full-head-info .head-item{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #rawInbound .raw-full-head-info .head-item:last-child{
    text-align:right;
  }
  #rawInbound .raw-full-head-info .k{
    font-weight:700;
  }

  /* 统一12等分网格，所有上下单元格尽量对齐 */
  #rawInbound .raw-full-table{
    width:100%;
    margin:0;
    border-collapse:collapse;
    table-layout:fixed;
  }
  #rawInbound .raw-full-table col{
    width:8.3333%;
  }
  #rawInbound .raw-full-table td{
    border:1px solid #000;
    height:7.2mm;
    padding:.65mm .8mm;
    font-size:8.8px;
    line-height:1.12;
    vertical-align:middle;
    word-break:break-all;
  }
  #rawInbound .raw-full-table .full-label{
    font-weight:700;
    text-align:center;
    white-space:nowrap;
    background:#fafafa;
    padding-left:.35mm;
    padding-right:.35mm;
  }
  #rawInbound .raw-full-table .full-value{
    text-align:left;
  }
  #rawInbound .raw-full-table .compact-row td{
    font-size:8.1px;
    padding-left:.45mm;
    padding-right:.45mm;
  }
  #rawInbound .raw-full-table .amount-row td{
    font-size:8.2px;
    padding-left:.45mm;
    padding-right:.45mm;
  }
  #rawInbound .raw-full-table tr{
    margin:0;
    padding:0;
  }
  #rawInbound .raw-full-table .two-line-label{
    white-space:normal;
    line-height:1.05;
  }
  #rawInbound .raw-full-table .amount-row-primary td,
  #rawInbound .raw-full-table .amount-row-secondary td{
    height:7.2mm;
  }
  #rawInbound .raw-full-table .full-result{
    height:7.8mm;
  }
  #rawInbound .raw-full-table .full-remark{
    height:13mm;
    vertical-align:top;
    padding-top:1.3mm;
  }
  #rawInbound .raw-full-footer{
    display:flex;
    justify-content:space-between;
    gap:6mm;
    margin-top:1.1mm;
    padding-top:.9mm;
    border-top:1px solid #aaa;
    font-size:8.5px;
  }

  /* ===== A4横版：产品销售出库单记录（同一发票号最多6个规格） ===== */
  #outbound.outbound-landscape{
    width:297mm;
    min-height:210mm;
    height:210mm;
    margin:12px auto;
    padding:6mm 8mm 5mm;
    overflow:hidden;
  }
  #outbound.outbound-landscape::before{height:2.5mm;}
  #outbound .document-header{
    grid-template-columns:34mm 1fr 55mm;
    min-height:16mm;
    margin-top:0;
    margin-bottom:1.5mm;
  }
  #outbound .logo-frame{
    width:31mm;
    height:15mm;
  }
  #outbound .logo-frame img{
    width:24mm;
    height:24mm;
  }
  #outbound .document-title h1{
    font-size:21px;
    letter-spacing:3px;
  }
  #outbound .document-title .company-name{
    margin-top:.7mm;
    font-size:10.5px;
  }
  #outbound .doc-meta{
    font-size:10px;
    line-height:1.6;
  }
  #outbound .rule{margin-bottom:1.6mm;}
  #outbound table{margin-bottom:1.8mm;}
  #outbound th,
  #outbound td{
    padding:1.15mm 1mm;
    font-size:9.2px;
    line-height:1.2;
  }
  #outbound .outbound-order-info td{height:7.2mm;}
  #outbound .outbound-order-info .label{
    width:auto;
    font-weight:700;
  }
  #outbound .section-title{
    margin:1.7mm 0 1mm;
    font-size:11.5px;
  }
  #outbound .section-title::before{
    width:3px;
    height:13px;
  }
  #outbound .outbound-items{
    margin-bottom:1.5mm;
  }
  #outbound .outbound-items th{
    text-align:center;
    font-size:9px;
    padding:1mm .7mm;
    line-height:1.1;
  }
  #outbound .outbound-items tbody td{
    height:16mm;
    padding:1mm .8mm;
    text-align:center;
    font-size:9.1px;
    line-height:1.18;
    word-break:break-all;
    overflow-wrap:anywhere;
  }
  #outbound .outbound-items tbody td.text-left{text-align:left;}
  #outbound .outbound-items tbody tr:nth-child(even) td{background:#fbfbfb;}
  #outbound .outbound-items .empty-row td{
    color:#777;
    height:13mm;
  }
  #outbound .outbound-logistics td{
    height:8mm;
    font-size:9.2px;
  }
  #outbound .outbound-bottom-grid{
    display:grid;
    grid-template-columns:1.25fr 1fr;
    gap:3mm;
    align-items:start;
  }
  #outbound .outbound-remark-table td{
    height:22mm;
    vertical-align:top;
    font-size:9.5px;
  }
  #outbound .outbound-approvals td{
    height:11mm;
    padding:1.2mm 1.3mm;
    font-size:9px;
    white-space:nowrap;
  }
  #outbound .approval-mark{
    display:inline-block;
    min-width:5mm;
    margin-right:1mm;
    font-size:12px;
    font-weight:700;
    text-align:center;
  }
  #outbound .outbound-footer{
    margin-top:1.6mm;
    padding-top:1.3mm;
    font-size:8.8px;
  }


  /* ===== 费用报销凭证粘贴单：240mm × 140mm 横版 ===== */
  #expense.expense-a5{
    width:240mm;
    min-height:140mm;
    height:140mm;
    margin:12px auto;
    padding:7mm 8mm 6mm;
    background:#fff;
    box-shadow:0 2px 12px rgba(0,0,0,.14);
    overflow:hidden;
    color:#111;
    font-family:"SimSun","Songti SC","Microsoft YaHei",sans-serif;
  }
  #expense.expense-a5::before{display:none;}
  #expense .expense-top{
    display:grid;
    grid-template-columns:1fr auto;
    align-items:end;
    gap:4mm;
    margin-bottom:2mm;
  }
  #expense .expense-title{
    text-align:center;
    font-size:20px;
    font-weight:700;
    letter-spacing:6px;
    padding-left:30mm;
  }
  #expense .expense-top-no{
    font-size:10.5px;
    white-space:nowrap;
    text-align:right;
  }
  #expense .expense-shell{
    display:grid;
    grid-template-columns:1fr 59mm;
    border:1.2px solid #111;
    height:112mm;
  }
  #expense .expense-paste{
    position:relative;
    border-right:1.2px solid #111;
    padding:5mm;
  }
  #expense .paste-hint{
    position:absolute;
    top:50%; left:50%;
    transform:translate(-50%,-50%);
    color:#b8b8b8;
    font-size:17px;
    letter-spacing:4px;
    white-space:nowrap;
  }
  #expense .expense-number{display:none;}
  #expense .expense-handler{display:none;}
  #expense .expense-note-left{
    position:absolute;
    left:5mm; right:5mm;
    bottom:13mm;
    font-size:9.5px;
    line-height:1.5;
    max-height:18mm;
    overflow:hidden;
  }
  #expense .expense-side table{
    width:100%;
    height:100%;
    margin:0;
    border-collapse:collapse;
    table-layout:fixed;
  }
  #expense .expense-side th,
  #expense .expense-side td{
    border:0;
    border-bottom:1px solid #111;
    padding:1.4mm 1.5mm;
    font-size:9.8px;
    line-height:1.35;
    vertical-align:middle;
    background:#fff;
  }
  #expense .expense-side tr:last-child th,
  #expense .expense-side tr:last-child td{border-bottom:0;}
  #expense .expense-side th{
    width:19mm;
    text-align:center;
    font-weight:600;
    border-right:1px solid #111;
  }
  #expense .expense-side td{word-break:break-word;}
  #expense .expense-side .reason-row{height:31mm;}
  #expense .expense-side .reason-row td{vertical-align:top;}
  #expense .expense-side .sign-row{height:13mm;}
  #expense .expense-side .sign-space{
    height:8mm;
    border-bottom:1px solid #222;
    margin:0 3mm;
  }
  #expense .expense-side .amount{font-size:13px;font-weight:700;}
  #expense .expense-bottom{
    display:flex;
    justify-content:space-between;
    margin-top:2mm;
    font-size:8.8px;
    color:#555;
  }



  /* ===== A4竖向三联：包材出库使用记录表 ===== */
  #packagingOutbound.packaging-outbound-triplicate{
    width:210mm;min-height:297mm;height:297mm;margin:12px auto;
    padding:4mm 6mm 5mm;background:#fff;color:#000;
    font-family:"SimSun","宋体","NSimSun",serif;
    box-shadow:0 2px 10px rgba(0,0,0,.16);overflow:hidden;
  }
  #packagingOutbound::before{display:none;}
  #packagingOutbound .outbound-copy{
    position:relative;height:94mm;padding:3mm 10mm 3mm 0;
    box-sizing:border-box;break-inside:avoid;page-break-inside:avoid;
  }
  #packagingOutbound .outbound-copy + .outbound-copy{border-top:1px dashed #666;}
  #packagingOutbound .copy-destination{
    position:absolute;right:0;top:4mm;bottom:4mm;width:8mm;
    display:flex;align-items:center;justify-content:center;
    border-left:1px solid #999;
  }
  #packagingOutbound .copy-destination span{
    writing-mode:vertical-rl;text-orientation:upright;
    white-space:nowrap;font-size:10px;line-height:1.2;letter-spacing:.35px;
  }
  #packagingOutbound .title{
    margin:0 0 1mm;text-align:center;font-size:20px;
    font-weight:700;letter-spacing:3px;line-height:9mm;
  }
  #packagingOutbound table{width:100%;margin:0;border-collapse:collapse;table-layout:fixed;}
  #packagingOutbound th,#packagingOutbound td{
    border:1px solid #000;padding:.8mm 1mm;background:#fff;color:#000;
    font-family:inherit;font-size:11px;line-height:1.25;
    vertical-align:middle;word-break:break-all;overflow-wrap:anywhere;
  }
  #packagingOutbound .head-info{margin-bottom:1mm;}
  #packagingOutbound .head-info td{border:0;height:6mm;padding:.5mm 0;font-size:10.5px;}
  #packagingOutbound .k,#packagingOutbound .remark-title{font-weight:700;}
  #packagingOutbound .extra-info{margin-bottom:1mm;}
  #packagingOutbound .extra-info td{height:7mm;}
  #packagingOutbound .detail th{height:6mm;font-weight:700;text-align:center;}
  #packagingOutbound .detail td{height:10mm;text-align:center;}
  #packagingOutbound .detail .name{text-align:left;}
  #packagingOutbound .remark-table{margin-top:1mm;}
  #packagingOutbound .remark-table td{height:11mm;vertical-align:top;white-space:pre-wrap;}
  #packagingOutbound .signature-table{margin-top:1mm;}
  #packagingOutbound .signature-table td{height:14mm;vertical-align:top;font-size:10.5px;}
  #packagingOutbound .signature-line{display:block;height:7mm;margin-top:.5mm;border-bottom:1px solid #000;}
  #packagingOutbound .print-meta{display:flex;justify-content:flex-end;gap:6mm;margin-top:1mm;font-size:9px;line-height:4mm;}
  #packagingOutbound .triplicate-note{text-align:left;font-size:9px;line-height:5mm;margin:0;white-space:nowrap;}
  @media print{
    #packagingOutbound.packaging-outbound-triplicate{
      width:210mm;min-height:297mm;height:297mm;margin:0;
      padding:4mm 6mm 5mm;box-shadow:none;break-after:avoid;page-break-after:avoid;
    }
  }

  /* ===== 打印模板中心首页 ===== */

  /* ===== A4竖向：半品生产通知单 / 粗加工生产通知单 ===== */
  #semiProduction.internal-production-page,
  #roughProduction.internal-production-page{
    width:210mm;
    min-height:297mm;
    height:297mm;
    margin:12px auto;
    padding:9mm 12mm 10mm;
    overflow:hidden;
  }
  #semiProduction.internal-production-page::before,
  #roughProduction.internal-production-page::before{
    height:3mm;
  }
  .internal-production-page .ip-header{
    display:grid;
    grid-template-columns:34mm 1fr 48mm;
    align-items:center;
    min-height:24mm;
    gap:3mm;
    margin-bottom:3mm;
  }
  .internal-production-page .ip-logo{
    width:28mm;
    height:20mm;
    object-fit:contain;
  }
  .internal-production-page .ip-title{
    text-align:center;
  }
  .internal-production-page .ip-title h1{
    margin:0;
    font-size:25px;
    font-weight:800;
    letter-spacing:4px;
    white-space:nowrap;
  }
  .internal-production-page .ip-company{
    margin-top:1.2mm;
    color:var(--brand);
    font-size:12px;
    font-weight:700;
    letter-spacing:1px;
  }
  .internal-production-page .ip-meta{
    text-align:right;
    font-size:10.5px;
    line-height:1.8;
    white-space:nowrap;
  }
  .internal-production-page .ip-meta strong{
    font-size:12px;
  }
  .internal-production-page .ip-rule{
    height:1px;
    margin-bottom:4mm;
    background:var(--brand);
  }
  .internal-production-page .ip-section-title{
    display:flex;
    align-items:center;
    gap:7px;
    margin:4mm 0 1.6mm;
    color:var(--brand);
    font-size:14px;
    font-weight:800;
  }
  .internal-production-page .ip-section-title::before{
    content:"";
    width:4px;
    height:16px;
    background:var(--brand);
  }
  .internal-production-page .ip-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    margin:0;
  }
  .internal-production-page .ip-table td,
  .internal-production-page .ip-table th{
    border:1px solid #2d2d2d;
    padding:3mm 2.6mm;
    font-size:12px;
    line-height:1.45;
    vertical-align:middle;
    word-break:break-word;
  }
  .internal-production-page .ip-label{
    background:var(--light);
    font-weight:700;
    text-align:center;
    white-space:nowrap;
  }
  .internal-production-page .ip-value{
    min-height:8mm;
  }
  .internal-production-page .ip-large-value{
    font-size:13px;
    font-weight:700;
  }
  .internal-production-page .ip-check{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    font-weight:700;
  }
  .internal-production-page .ip-checkmark{
    font-size:18px;
    line-height:1;
  }
  .internal-production-page .ip-remark{
    height:48mm;
    vertical-align:top !important;
    padding-top:3mm !important;
  }
  .internal-production-page .ip-footer{
    display:flex;
    justify-content:space-between;
    gap:8mm;
    margin-top:4mm;
    padding-top:2mm;
    border-top:1px solid #bbb;
    font-size:10.5px;
    color:#333;
  }
  #roughProduction .ip-remark{
    height:42mm;
  }
  #roughProduction .rough-progress-value{
    font-size:14px;
    font-weight:700;
  }
  .internal-production-page .ip-table .ip-longtext{
    min-height:24mm;
    height:24mm;
    vertical-align:top;
    white-space:pre-wrap;
    line-height:1.55;
    font-size:11px;
  }
  .internal-production-page .ip-table .ip-mediumtext{
    min-height:16mm;
    height:16mm;
    vertical-align:top;
    white-space:pre-wrap;
    line-height:1.5;
    font-size:11px;
  }
  .internal-production-page .ip-table .ip-approval-cell{
    padding-top:2.3mm;
    padding-bottom:2.3mm;
  }
  .internal-production-page .ip-person-table td{
    height:11mm;
  }
  #semiProduction .ip-remark{
    height:30mm;
  }
  #roughProduction .ip-remark{
    height:34mm;
  }

  /* 粗加工生产通知单：专用紧凑排版 */
  #roughProduction.internal-production-page{
    padding:7mm 10mm 8mm;
  }
  #roughProduction .ip-header{
    min-height:21mm;
    margin-bottom:2mm;
  }
  #roughProduction .ip-title h1{
    font-size:23px;
    letter-spacing:3px;
  }
  #roughProduction .ip-company{
    font-size:11px;
  }
  #roughProduction .ip-section-title{
    margin:2.6mm 0 1.1mm;
    font-size:13px;
  }
  #roughProduction .ip-table td,
  #roughProduction .ip-table th{
    padding:2.1mm 2mm;
    font-size:10.8px;
    line-height:1.32;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  #roughProduction .ip-label{
    white-space:normal;
    line-height:1.2;
    font-size:10.5px;
  }
  #roughProduction .rough-basic td,
  #roughProduction .rough-raw td,
  #roughProduction .rough-semi td{
    min-height:9mm;
    height:9mm;
  }
  #roughProduction .rough-process-basic td{
    min-height:10mm;
    height:10mm;
  }
  #roughProduction .rough-tech-label{
    width:18%;
  }
  #roughProduction .rough-tech-value{
    height:38mm;
    min-height:38mm;
    vertical-align:top;
    padding:3mm 3.2mm;
    white-space:pre-wrap;
    font-size:10.6px;
    line-height:1.5;
  }
  #roughProduction .rough-semi-product{
    min-height:12mm !important;
    height:12mm !important;
  }
  #roughProduction .ip-person-table td{
    height:9mm;
  }
  #roughProduction .ip-approval-cell{
    padding-top:1.6mm;
    padding-bottom:1.6mm;
  }
  #roughProduction .ip-check{
    font-size:11px;
  }
  #roughProduction .ip-checkmark{
    font-size:15px;
  }
  #roughProduction .ip-remark{
    height:20mm;
    min-height:20mm;
  }
  #roughProduction .ip-footer{
    margin-top:2.5mm;
    padding-top:1.5mm;
    font-size:9.5px;
  }

  .print-home{
    width:min(920px, calc(100% - 32px));
    margin:48px auto;
    background:#fff;
    border-radius:14px;
    box-shadow:0 4px 22px rgba(0,0,0,.10);
    padding:42px 44px 46px;
    text-align:center;
  }
  .print-home-logo{
    width:118px;
    height:auto;
    object-fit:contain;
    margin-bottom:12px;
  }
  .print-home h1{
    margin:0;
    font-size:27px;
    letter-spacing:3px;
    font-weight:800;
  }
  .print-home-company{
    margin-top:7px;
    color:var(--brand);
    font-size:15px;
    font-weight:700;
    letter-spacing:1px;
  }
  .print-home-tip{
    margin:13px 0 26px;
    color:#777;
    font-size:13px;
  }
  .print-home-buttons{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    max-width:650px;
    margin:0 auto;
  }
  .print-home-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:54px;
    padding:10px 18px;
    border:1px solid #cfd8d2;
    border-radius:9px;
    background:#fff;
    color:#173426;
    font-size:16px;
    font-weight:700;
    text-decoration:none;
    transition:.15s ease;
  }
  .print-home-btn:hover{
    border-color:var(--brand);
    color:var(--brand);
    box-shadow:0 2px 10px rgba(0,94,50,.10);
    transform:translateY(-1px);
  }
  .print-home-btn.primary-home{
    background:var(--brand);
    border-color:var(--brand);
    color:#fff;
  }
  @media (max-width:680px){
    .print-home{padding:30px 20px;margin:24px auto;}
    .print-home-buttons{grid-template-columns:1fr;}
  }
  @media print{
    .print-home{display:none !important;}
  }

  @page{size:A4 portrait;margin:0;}
  @media print{
    body{background:#fff;}
    .toolbar{display:none;}
    .page{
      margin:0;
      box-shadow:none;
      page-break-after:always;
    }
    #production.production-landscape,
    #outbound.outbound-landscape{
      width:297mm;
      min-height:210mm;
      height:210mm;
      margin:0;
      padding:6mm 8mm 5mm;
      box-shadow:none;
      page-break-after:avoid;
    }
    #inbound.inbound-a5,
    #rawInbound.raw-inbound-a5{
      width:210mm;
      min-height:297mm;
      height:297mm;
      margin:0;
      padding:0;
      box-shadow:none;
      page-break-after:avoid;
      overflow:hidden;
    }
    #inbound .half-sheet,
    #rawInbound .half-sheet{
      width:210mm;
      height:148.5mm;
      box-sizing:border-box;
      padding:6mm 8mm 4.5mm;
      overflow:hidden;
    }
    #inbound .blank-half,
    #rawInbound .blank-half{
      width:210mm;
      height:148.5mm;
      box-sizing:border-box;
    }
    #supplierInbound{
      width:210mm;
      margin:0;
      padding:0;
    }
    #supplierInbound .supplier-inbound-paper{
      width:210mm;
      min-height:297mm;
      height:297mm;
      margin:0;
      padding:0;
      box-shadow:none;
      overflow:hidden;
      page-break-after:always;
      break-after:page;
    }
    #supplierInbound .supplier-inbound-paper:last-child{
      page-break-after:auto;
      break-after:auto;
    }
    #supplierInbound .summary-half-sheet{
      width:210mm;
      min-height:148.5mm;
      height:auto;
      box-sizing:border-box;
      padding:5mm 6mm 4mm;
      overflow:visible;
    }
    #supplierInbound .summary-blank-half{
      width:210mm;
      height:148.5mm;
      box-sizing:border-box;
    }
    #expense.expense-a5{
      width:240mm;
      min-height:0;
      height:140mm;
      margin:0;
      padding:7mm 8mm 6mm;
      box-shadow:none;
      page-break-after:avoid;
    }
    #expense .paste-hint{display:none;}
    .page:last-child{page-break-after:auto;}
  }
