/* =========================================================
   广西信合 · print.css
   ---------------------------------------------------------
   一键打印样式 —— 接入产品页、联系页和地市落地页。
   使用方式：在目标页面 <head> 中加入
     <link rel="stylesheet" href="/path/to/print.css" media="print"/>
   打印会默认转为 A4 纵向、灰度友好、去除导航和交互件。
   设计约束：字号不低于 10pt；正文黑白可阅读；图表用
   线稿替代色彩；表格边线保留。
   ========================================================= */

@media print {

  /* ---------- Page geometry ---------- */
  @page {
    size: A4 portrait;
    margin: 18mm 16mm 20mm 16mm;
    @bottom-right {
      content: "gxxh.tech · 第 " counter(page) " 页 / 共 " counter(pages) " 页";
      font-family: "Inter","PingFang SC",sans-serif;
      font-size: 9pt;
      color: #666;
    }
    @bottom-left {
      content: "广西信合科技 · 400-xxx-0771";
      font-family: "Inter","PingFang SC",sans-serif;
      font-size: 9pt;
      color: #666;
    }
  }

  /* ---------- Root ---------- */
  html, body {
    background: #fff !important;
    color: #111 !important;
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body { font-family: "Inter","PingFang SC","Microsoft YaHei",sans-serif !important; }

  /* ---------- Kill web chrome ---------- */
  nav, header nav, footer nav,
  .topbar, .tb-nav, .tb-inner .brand small,
  .hero-cta, .cta, .cta-row,
  .tweaks, .band, [data-noprint],
  .mobile-cta, .sticky, .toolbar,
  button, .btn, .tb-nav a,
  .hero-orn, .ornament { display: none !important; }

  /* ---------- Standard paper header (inserted per page) ---------- */
  body::before {
    content: "广西信合 · 交付资料";
    display: block;
    padding-bottom: 8mm;
    margin-bottom: 8mm;
    border-bottom: 1.5pt solid #111;
    font-family: "Noto Serif SC", serif;
    font-size: 13pt;
    font-weight: 500;
    letter-spacing: .06em;
  }

  /* ---------- Typography ---------- */
  h1 { font-size: 22pt !important; margin: 0 0 4mm 0 !important; color:#111 !important; font-weight:500 !important; line-height:1.2 !important; letter-spacing:-.01em !important; }
  h2 { font-size: 15pt !important; margin: 10mm 0 3mm 0 !important; color:#111 !important; font-weight:500 !important; page-break-after: avoid; }
  h3 { font-size: 12pt !important; margin: 6mm 0 2mm 0 !important; color:#111 !important; font-weight:600 !important; page-break-after: avoid; }
  h4 { font-size: 11pt !important; margin: 4mm 0 2mm 0 !important; color:#111 !important; font-weight:600 !important; }
  p, li, td, th { font-size: 10.5pt !important; color: #222 !important; }
  .eyebrow {
    display: inline-block !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    color: #666 !important;
    font-size: 9pt !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    margin-bottom: 2mm !important;
  }

  /* ---------- Layout normalisation ---------- */
  .container, .wrap, main, section, .sec, .hero {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }
  .hero { padding-top: 2mm !important; padding-bottom: 6mm !important; }

  /* Grids collapse to single column unless explicitly preserved */
  .grid, .hero-grid, .feat-grid, .ind-grid, .case-box,
  .sec-grid, .contact-grid, .tier-grid {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }
  .grid > *, .hero-grid > *, .feat-grid > *, .ind-grid > *, .tier-grid > * {
    margin-bottom: 5mm !important;
    break-inside: avoid;
  }

  /* Cards render as line-framed boxes */
  .card, .feat-card, .ind-card, .tier, .ops, .case-box, .stat-card {
    border: 0.5pt solid #999 !important;
    background: #fff !important;
    color: #111 !important;
    padding: 4mm !important;
    border-radius: 2pt !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  /* ---------- Section dividers ---------- */
  .sec { border-top: 0.5pt solid #ccc !important; padding-top: 5mm !important; }
  .sec:first-of-type { border-top: none !important; padding-top: 0 !important; }

  /* ---------- Links ---------- */
  a { color: #111 !important; text-decoration: none !important; }
  /* Reveal URLs for external links on print (only href outside current host) */
  main a[href^="http"]::after,
  article a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: "SF Mono", Menlo, monospace;
    font-size: 8.5pt;
    color: #666;
  }
  /* internal anchors stay clean */
  a[href^="#"]::after, a[href^="mailto:"]::after, a[href^="tel:"]::after { content: none !important; }

  /* ---------- Tables ---------- */
  table { width: 100% !important; border-collapse: collapse !important; margin: 3mm 0 !important; }
  th, td { border: 0.5pt solid #999 !important; padding: 2mm 3mm !important; text-align: left !important; }
  th { background: #eee !important; font-weight: 600 !important; }
  thead { display: table-header-group; }

  /* ---------- Dark case blocks flip to light ---------- */
  .case-sec, .dark-sec, [data-theme="dark"] {
    background: #fff !important;
    color: #111 !important;
  }
  .case-sec *, .dark-sec * { color: #111 !important; background: transparent !important; }
  .case-big { font-size: 40pt !important; color: #111 !important; font-weight: 500 !important; }

  /* ---------- Contact page specifics ---------- */
  form { break-inside: avoid; }
  .form-grid, .contact-grid { display: block !important; }
  input, select, textarea {
    border: 0.5pt solid #999 !important;
    padding: 2mm !important;
    background: #fff !important;
    color: #111 !important;
    font-size: 10pt !important;
    width: 100% !important;
  }
  input::placeholder, textarea::placeholder { color: #aaa !important; }
  label { font-size: 9pt !important; color: #666 !important; margin-bottom: 1mm !important; display:block !important; }

  /* ---------- Page-break rules ---------- */
  h2, h3 { break-after: avoid; }
  .card, .feat-card, .ind-card, .tier, .case-box, table, figure, pre {
    break-inside: avoid;
  }
  .page-break { break-before: page; }

  /* ---------- Ornaments / images ---------- */
  img, svg { max-width: 100% !important; height: auto !important; filter: grayscale(20%); }
  figure { break-inside: avoid; margin: 3mm 0 !important; }
  figcaption { font-size: 9pt !important; color: #666 !important; font-style: italic; }

  /* ---------- Phone / CTA replacement copy ---------- */
  /* Since we hide .hero-cta, inject a printable contact line right after h1 on product / contact pages */
  .printable-contact {
    display: block !important;
    margin-top: 2mm;
    padding: 2mm 0;
    border-top: 0.5pt solid #999;
    border-bottom: 0.5pt solid #999;
    font-size: 10pt;
  }
  .printable-contact span { margin-right: 8mm; }
  /* When not printing, hide it */
}

@media screen {
  .printable-contact { display: none; }
}
