/* ================== 打印优化 ================== */
@media print {

  /* 设置打印页的边距，去除默认边距，使内容占满整个页面 */
  @page {
      margin: 0; /* 移除所有默认边距 */
      size: auto; /* 根据页面内容自动调整纸张大小 */
  }

  /* 确保body占满全页 */
  body {
      margin: 0; /* 去除默认边距 */
      padding: 0; /* 去除默认内边距 */
      background-color: #f4f4f4 !important; /* 保证背景色在打印时显示 */
      -webkit-print-color-adjust: exact; /* 保证背景颜色不会被忽略 */
  }

  /* 保留头部背景色和字体 */
  .full-header {
      background-color: var(--tsinghua-purple) !important; /* 保持头部背景 */
      box-shadow: none !important; /* 去掉阴影 */
      padding: 1rem 0 !important; /* 调整内边距 */
      width: 100% !important; /* 让头部横向扩展 */
  }

  .header-container {
      display: flex !important;
      justify-content: space-between !important;
      padding: 0 0 !important; /* 去除两侧边距 */
      width: 100% !important; /* 确保头部横向扩展 */
  }

  .header-left h1 {
      font-size: 1.8rem !important; /* 设置标题字体大小 */
      color: #ffffff !important; /* 设置字体颜色 */
      margin: 0; /* 去除外边距 */
      padding: 0; /* 去除内边距 */
  }

  .contact-info,
  .contact-item {
      font-size: 1rem !important;
      color: #ffffff !important;
      text-align: left !important;
  }
  /* 保留二维码显示并定位到页面右侧 */
  .header-qrcode {
    display: block !important; /* 确保二维码显示 */
    position: absolute !important; /* 使用绝对定位 */
    right: 0 !important; /* 让二维码位于右侧 */
    top: 1rem !important; /* 距离顶部1rem */
    width: clamp(50px, 6vw, 70px) !important; /* 保持二维码宽度自适应 */
    height: clamp(50px, 6vw, 70px) !important; /* 保持二维码高度自适应 */
}
  /* 页脚样式优化 */
  .site-footer {
      background-color: rgba(0, 153, 166, 1) !important; /* 保留页脚背景色 */
      color: var(--text-white) !important; /* 保持文本颜色 */
      text-align: center !important;
      font-size: 0.9rem !important;
      padding: 1rem 0 !important; /* 调整页脚内边距 */
      border-top: 1px solid rgba(0, 153, 166, 0.2) !important; /* 保留分隔线 */
      width: 100% !important; /* 让页脚横向扩展 */
  }

  .legal-info {
      color: var(--text-light) !important;
      font-size: 0.9rem !important;
  }

  /* 文章内容优化 */
  .article-content {
      background-color: #ffffff !important; /* 保持文章背景 */
      padding: 1rem !important; /* 为文章内容增加内边距 */
      width: 100% !important; /* 使内容横向扩展至全宽 */
      box-sizing: border-box !important; /* 确保内边距不影响宽度 */
  }

  .article-content p {
      margin: 0 0 15px !important; /* 去除多余的间距 */
      font-size: 1rem !important;
      line-height: 1.5 !important;
      color: #333 !important; /* 确保文字清晰可见 */
  }

  /* 隐藏动画、过渡效果等 */
  .transition,
  .animation {
      display: none !important;
  }

  /* 保留超链接样式 */
  a {
      text-decoration: none !important; /* 保留无下划线 */
  }

  a.qq-contact:hover,
  a.email-contact:hover {
      background: none !important; /* 移除动画背景色 */
  }

  a.qq-contact::after,
  a.email-contact::after {
      display: none !important; /* 移除下划线 */
  }

  /* 页面元素布局 */
  .header-container,
  .contact-info {
      display: block !important; /* 使元素垂直堆叠 */
      width: 100% !important;
  }

  /* 去除不必要的图片和元素 */
  img {
      display: none !important; /* 隐藏所有图片 */
  }

  /* 保证打印时不被分页切割 */
  .full-header,
  .full-footer {
      position: running(header);
      page-break-after: avoid !important;
  }

  /* 页面边缘对齐 */
  .header-left, .footer, .article-content {
      page-break-before: avoid !important; /* 防止分割 */
  }

  /* 最小页边距设置 */
  body {
      padding: 0; /* 去除最小边距，完全利用页面宽度 */
  }
}
