/* ============================================================================
 * GF-SpecBuilder · 打印样式（规格书 B1–B8 · S3）
 * 本文件在 index.html 中以 media="print" 引入，仅浏览器打印/存 PDF 时生效。
 * 打印版 v1 口径：无图、无价、无内部码；A4 友好；正文不跨页断行。
 * ========================================================================== */
@media print {
  @page {
    size: A4;
    margin: 12mm 11mm 13mm;
  }

  /* 只保留规格书容器，隐藏应用界面 */
  body { background: #fff; }
  body > *:not(#spec-print) { display: none !important; }
  #spec-print { display: block !important; }

  html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 10.5pt;
    line-height: 1.5;
    color: #111;
  }

  .spec-sheet { color: #111; }

  /* ---------- B1 页眉 ---------- */
  .spec-header {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 12mm;
    padding-bottom: 2.4mm; border-bottom: 2.5pt solid #1a2540;
  }
  .spec-brand-name { font-size: 17pt; font-weight: 800; letter-spacing: 0.01em; color: #1a2540; }
  .spec-brand-sub { font-size: 8.5pt; color: #333; margin-top: 0.6mm; }
  .spec-doc-meta { text-align: right; font-size: 8pt; color: #333; }
  .spec-doc-meta div { margin-top: 0.4mm; }
  .spec-doc-meta .spec-no { font-weight: 700; color: #1a2540; }

  /* ---------- B2 引文 ---------- */
  .spec-intro { margin: 5mm 0 4mm; }
  .spec-intro h1 { font-size: 16pt; line-height: 1.2; color: #1a2540; margin: 0 0 1.2mm; }
  .spec-intro .spec-prepped { font-size: 10pt; color: #333; margin: 0; }

  /* ---------- B3 项目与客户信息 ---------- */
  .spec-info {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.2mm 6mm;
    padding: 3mm 3.5mm; margin: 3mm 0;
    background: #f4f5f7; border: 0.5pt solid #d9dee5; border-radius: 1.5mm;
    font-size: 8.8pt;
  }
  .spec-info .row { display: flex; gap: 2mm; min-width: 0; }
  .spec-info .k { flex: none; width: 27mm; font-weight: 700; color: #1a2540; }
  .spec-info .v { color: #111; }

  /* ---------- B4 基础包含声明 ---------- */
  .spec-base {
    padding: 2.6mm 3.5mm; margin: 2.5mm 0 3mm;
    border-left: 2.5pt solid #6e9b3c; background: #f6f9f0;
    font-size: 8.8pt; color: #222;
  }

  /* ---------- 通用分节标题 ---------- */
  .spec-block { margin: 0 0 4mm; }
  .spec-block h3 {
    margin: 3.5mm 0 1.6mm; padding-bottom: 0.8mm;
    font-size: 10.5pt; color: #1a2540;
    border-bottom: 0.8pt solid #1a2540;
  }
  .spec-block h3 .b6-n { font-weight: 700; }

  /* ---------- B5 分组明细（无图/无价/无内部码） ---------- */
  .spec-group { break-inside: avoid; margin-bottom: 2.6mm; }
  .spec-group .g-name { font-weight: 700; font-size: 9.2pt; color: #1a2540; margin: 2.2mm 0 0.6mm; }
  .spec-group .g-count { font-weight: 400; color: #555; font-size: 8.2pt; }
  .spec-item { display: flex; gap: 3mm; align-items: baseline; break-inside: avoid; padding: 0.6mm 0; }
  .spec-item .name { font-weight: 600; min-width: 0; }
  .spec-item .desc { color: #444; font-size: 8.6pt; min-width: 0; }
  .spec-item .qty { flex: none; margin-left: auto; font-weight: 700; font-size: 8.4pt; color: #1a2540; white-space: nowrap; }

  /* ---------- B6 所选项数量统计（无金额含义） ---------- */
  .spec-stats { break-inside: avoid; padding: 2mm 0; font-size: 9pt; }
  .spec-stats .total { font-size: 10.5pt; font-weight: 700; color: #1a2540; margin-bottom: 0.8mm; }
  .spec-stats ul { list-style: none; margin: 0; padding: 0; }
  .spec-stats li { color: #333; }

  /* ---------- B7 免责 ---------- */
  .spec-disclaimer {
    margin-top: 3mm; padding: 2.6mm 3.5mm;
    background: #f7f7f8; border: 0.5pt solid #d9dee5; border-radius: 1.5mm;
    font-size: 7.6pt; color: #555;
  }
  .spec-disclaimer h3 { border-bottom: 0; margin: 0 0 1mm; font-size: 8.6pt; color: #333; }
  .spec-disclaimer p { margin: 0 0 1mm; }
  .spec-disclaimer ul { margin: 0; padding-left: 4mm; }
  .spec-disclaimer li { margin-bottom: 0.8mm; }

  /* ---------- B8 页脚 ---------- */
  .spec-footer {
    display: flex; justify-content: space-between; gap: 4mm; flex-wrap: wrap;
    margin-top: 5mm; padding-top: 1.6mm;
    border-top: 0.8pt solid #9aa3b3;
    font-size: 7.6pt; color: #555;
  }
}
