/* ========================================
   年龄计算器 - 打印样式表
   优化打印输出，隐藏无关元素
   ======================================== */

@media print {
  *, *::before, *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* 隐藏导航、按钮、页脚链接 */
  .toolbar,
  .btn-row,
  .btn,
  .related-grid,
  .footer-links,
  .breadcrumb,
  .rating,
  nav,
  script,
  style,
  iframe,
  .no-print {
    display: none !important;
  }

  /* 卡片边框保留 */
  .calc-card {
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 12pt;
    padding: 12pt;
  }

  /* 结果项 */
  .results {
    display: block;
  }

  .result-item {
    display: inline-block;
    width: 48%;
    margin: 4pt 1%;
    border: 1px solid #ddd;
    padding: 8pt;
    break-inside: avoid;
  }

  .result-item .value {
    font-size: 16pt;
    color: #000 !important;
  }

  .result-item .value.highlight {
    font-size: 18pt;
    color: #000 !important;
  }

  /* 头部 */
  .header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8pt;
    margin-bottom: 16pt;
  }

  .header h1 {
    font-size: 20pt;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }

  /* 页脚 */
  .footer {
    text-align: center;
    border-top: 1px solid #ccc;
    padding-top: 8pt;
    margin-top: 16pt;
  }

  /* 保证不跨页 */
  h1, h2, h3, h4, h5 {
    break-after: avoid;
  }

  /* 链接显示URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666 !important;
  }

  /* 页面边距 */
  @page {
    margin: 2cm;
  }
}
