/* 打印样式表 */
@media print {
  /* 隐藏不必要的元素 */
  .no-print,
  button,
  nav,
  header,
  footer,
  .sidebar,
  .advertisement,
  .social-media-links,
  .navigation {
    display: none !important;
  }

  /* 确保主要内容可见 */
  main,
  .content,
  .article-content {
    display: block !important;
  }

  /* 设置基本打印样式 */
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }

  /* 链接显示URL */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 8pt;
  }

  /* 不显示mailto链接的URL */
  a[href^="mailto:"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  /* 图片最大宽度 */
  img {
    max-width: 100% !important;
  }

  /* 表格样式 */
  table {
    border-collapse: collapse;
  }

  table,
  th,
  td {
    border: 1px solid #000;
  }

  /* 避免在元素内部断页 */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  /* 列表避免断页 */
  ul,
  ol,
  dl {
    page-break-before: avoid;
  }
}