/* ===========================================================
   打印专用样式：报价单 A4 输出，不跨行截断、不错位
   =========================================================== */

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  html, body {
    background: #fff !important;
    font-size: 12px;
    color: #000;
  }

  /* 打印时只显示打印视图 */
  body > .shell,
  body > .toast-host,
  .topbar,
  .nav,
  .tabbar,
  .foot,
  .no-print {
    display: none !important;
  }

  #print-root { display: block !important; }

  .print-doc {
    color: #000;
    font-size: 12px;
  }

  .print-doc__title {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
  }

  .print-doc__meta {
    font-size: 11px;
    color: #333;
    margin-bottom: 8px;
  }

  .print-doc table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-doc th,
  .print-doc td {
    border: 1px solid #666;
    padding: 4px 5px;
    text-align: left;
    font-size: 11px;
  }

  .print-doc th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 关键：不跨行截断 */
  .print-doc tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-doc thead {
    display: table-header-group;
  }

  .print-doc .num { text-align: right; }

  .print-doc__total {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
  }

  .print-doc__hint {
    margin-top: 4px;
    font-size: 11px;
    text-align: right;
  }

  .print-doc__foot {
    margin-top: 14px;
    font-size: 10px;
    color: #555;
    border-top: 1px solid #999;
    padding-top: 6px;
  }

  a { color: #000; text-decoration: none; }
}

/* 屏幕上默认隐藏打印视图 */
#print-root { display: none; }

/* 导出 PNG / Excel 的载体（离屏） */
.offscreen { position: fixed; left: -99999px; top: 0; opacity: 0; }
