/* ==========================================================================
   print.css · v1.81（对话 ⑨ 导出体系）
   用途：① 打印视图（任何页面加 ?print=1）② 浏览器「另存为 PDF」共用一套规则。
   ⑤ 条要点（改动前先读，都是踩过的坑）：
     1) @page A4 纵向 + 页边距，保证分页可控；
     2) 左导航 / 页签栏 / 页脚 / 筛选区 / 分页条 / 按钮 / 输入控件一律不出现；
     3) .tbl-scroll / .table-wrap / .bnk-scroll **必须取消 max-height 与 overflow**，
        否则长表只打得出屏幕可视区那几行（⑦C 起账套三表都有 .tbl-scroll，这是必踩的坑）；
     4) thead 设 table-header-group：跨页时表头重复；
     5) 打印态一律黑白友好：去底色、字全黑，不依赖深浅主题变量。
   ========================================================================== */

/* ——— 抬头（公司 / 表名 / 期间 / 导出时间）———
   屏幕上打开 ?print=1 也能看见，方便核对「导的是哪张表、哪段期间」；
   打印时同样显示，只是字号收紧。 */
.print-head {
  margin: 0 0 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 12px;
  color: var(--text-2, #4b5563);
  line-height: 1.5;
}
.print-head .ph-co {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #111827);
}
.print-head .ph-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text, #111827);
}
.print-head .ph-meta { margin-top: 2px; }
.print-head .ph-meta > span + span::before { content: "　·　"; color: var(--muted, #9ca3af); }

/* 屏幕态：只隐藏「导出按钮组」里的自身重复项，其余不动 */
.print-only { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm 10mm 14mm; }

  html, body { background: #fff !important; color: #000 !important; }

  /* ① 结构性元素全部隐藏 */
  .sidebar, .side-head, .side-foot, .tab-strip, .site-foot,
  .filters, .pager, .toolbar, .no-print, .exp-group, .ops,
  button, .btn, input, select, textarea { display: none !important; }

  /* 筛选表单（各页 <form class="inline"> 那一行） */
  form.inline { display: none !important; }

  /* ② 去掉左侧留白与容器限宽 */
  .main-wrap, .main-wrap.no-side { margin: 0 !important; }
  .container {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 0 6mm !important;
  }

  /* ③ 长表取消滚动 —— 这条不做，账簿/报表只能打出可视区几行 */
  .tbl-scroll, .table-wrap, .bnk-scroll {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }
  .tbl-scroll thead th, .bnk-scroll thead th, .table-wrap thead th {
    position: static !important;
    box-shadow: none !important;
  }

  /* ④ 表格：跨页重复表头、行不劈开、黑白友好 */
  table { width: 100% !important; border-collapse: collapse !important; }
  table.list { font-size: 9.5pt !important; }
  table.list > thead { display: table-header-group; }
  tfoot { display: table-row-group; }
  tr, .vch-block { page-break-inside: avoid; break-inside: avoid; }
  th, td {
    border-color: #999 !important;
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  thead th, tr.tot td, tfoot td { background: #f2f2f2 !important; font-weight: 700 !important; }

  /* ⑤ 链接、标签、说明文字 */
  a { color: #000 !important; text-decoration: none !important; }
  .tag, .badge { border: 1px solid #999 !important; background: transparent !important; color: #000 !important; }
  h3 { margin: 0 0 4px !important; font-size: 12pt !important; }
  p.muted { font-size: 9pt !important; color: #333 !important; }
  .muted { color: #333 !important; }

  /* 抬头在打印时正常显示 */
  .print-head {
    display: block !important;
    border-bottom: 1px solid #000 !important;
    color: #000 !important;
    margin-bottom: 4mm;
  }
  .print-head .ph-co, .print-head .ph-title { color: #000 !important; }
  .print-head .ph-title { font-size: 12pt; }
  .print-head .ph-meta { font-size: 9pt; }

  /* 凭证页：一张凭证不跨页（vch-block 已在上面统一处理） */
  .vch-block + .vch-block { page-break-before: auto; }
}
