/* ============================================================
   诊段 · 深度整理 全站设备适配层  v20261011b
   作用：手机 / 平板 / 笔记本 / 台式 统一适配
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }
img, video, canvas { max-width: 100%; }
a, p, li, td, th, h1, h2, h3, h4, span { overflow-wrap: anywhere; word-break: break-word; }

/* —— 表格：窄屏块级 + 横向滚动（覆盖页面自带的 min-width） —— */
@media (max-width: 900px) {
  table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  table th, table td { min-width: 0 !important; }
}

/* —— 平板 —— */
@media (max-width: 1024px) {
  .grid-4, .cols-4, .cards-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .container, .wrap, .wrapper { max-width: 100% !important; }
}


/* —— 窄屏页头导航：自动换行，不挤破 —— */
@media (max-width: 760px) {
  header, .zd-header, .topbar, .site-header, .main-header { flex-wrap: wrap !important; }
  header nav, .zd-nav, header .nav, .topbar nav, .topbar .nav, .site-header nav, .main-header-right {
    flex-wrap: wrap !important; justify-content: flex-end !important;
    gap: 4px 12px !important; row-gap: 2px !important;
  }
  header nav a, .zd-nav a, .topbar .nav a, .main-header-right a { font-size: 13px !important; white-space: nowrap !important; }
}

/* —— 手机 —— */
@media (max-width: 640px) {
  body { font-size: 14px; }
  h1 { font-size: 1.45rem !important; line-height: 1.32 !important; }
  h2 { font-size: 1.18rem !important; line-height: 1.35 !important; }
  h3 { font-size: 1.04rem !important; }
  button, .btn, [class*="btn"], a[class*="btn"], input[type="submit"], input[type="button"] { min-height: 40px; }
  section, .section, .container, .wrap, .wrapper { padding-left: 14px !important; padding-right: 14px !important; }
  .grid-2, .grid-3, .grid-4, .cols-2, .cols-3, .cols-4, .cards-2, .cards-3, .cards-4 {
    grid-template-columns: 1fr !important;
  }
}

/* —— 有页脚的内容页：内容不足一屏时页脚贴底 —— */
body.zd-adapt-footer { display: flex; flex-direction: column; min-height: 100vh; }
body.zd-adapt-footer > footer,
body.zd-adapt-footer > .zd-footer,
body.zd-adapt-footer > .portal-footer { margin-top: auto !important; }
