/* ============================================================
   移动端响应式补丁 mobile.css
   作用：这些页面由设计工具导出，根容器写死 min-width:1360px、
   多列网格无媒体查询，手机上会变成"缩小版电脑页"。本文件仅在
   窄屏(≤1024px)下用 !important 覆盖内联样式，桌面端(>1024px)
   完全不受影响。可维护、可随时删除。
   ============================================================ */

/* 全局：禁止横向溢出（桌面端也安全） */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }

/* ================= 平板 / 手机 (≤1024px) ================= */
@media (max-width: 1024px) {
  /* 1) 去掉写死的 1360px 画布，让页面随屏宽收窄——这是关键的一条 */
  [style*="min-width:1360px"] { min-width: 0 !important; width: 100% !important; }
  [style*="max-width:1360px"] { max-width: 100% !important; }

  /* 2) 所有多列网格 → 单列 */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* 3) 大内边距收窄，避免手机上两侧留白过多 */
  [style*="padding:56px"] { padding: 22px !important; }
  [style*="padding:48px"] { padding: 20px !important; }
  [style*="padding:44px"] { padding: 18px !important; }
  [style*="padding:40px"] { padding: 18px !important; }
  [style*="padding:0 44px"] { padding: 0 16px !important; }
  [style*="padding:0 40px"] { padding: 0 16px !important; }

  /* 4) 大间距收窄 */
  [style*="gap:48px"] { gap: 20px !important; }
  [style*="gap:40px"] { gap: 18px !important; }
  [style*="gap:32px"] { gap: 16px !important; }

  /* 5) 超大标题字号自适应缩小 */
  [style*="font-size:64px"] { font-size: 30px !important; line-height: 1.2 !important; }
  [style*="font-size:56px"] { font-size: 28px !important; line-height: 1.2 !important; }
  [style*="font-size:48px"] { font-size: 27px !important; line-height: 1.25 !important; }
  [style*="font-size:44px"] { font-size: 26px !important; line-height: 1.25 !important; }
  [style*="font-size:40px"] { font-size: 24px !important; }
  [style*="font-size:36px"] { font-size: 23px !important; }
  [style*="font-size:34px"] { font-size: 22px !important; }
  [style*="font-size:32px"] { font-size: 22px !important; }
  [style*="font-size:28px"] { font-size: 20px !important; }

  /* 6) 顶部导航行：允许换行、缩小高度与间距，logo 与菜单不再横向溢出 */
  [style*="position:sticky"] > div {
    flex-wrap: wrap !important;
    height: auto !important;
    padding: 10px 16px !important;
    gap: 6px 12px !important;
    row-gap: 6px !important;
  }

  /* 7) 表格/宽内容可横向滚动，避免撑破屏幕 */
  table { max-width: 100% !important; display: block; overflow-x: auto; }
}

/* ================= 手机 (≤560px) ================= */
@media (max-width: 560px) {
  [style*="font-size:64px"] { font-size: 25px !important; }
  [style*="font-size:56px"] { font-size: 24px !important; }
  [style*="font-size:48px"] { font-size: 23px !important; }
  [style*="font-size:44px"] { font-size: 22px !important; }

  /* 导航菜单在极窄屏居中换行，链接可点区域保持 */
  [style*="position:sticky"] > div { justify-content: center !important; }
  [style*="position:sticky"] a { padding-top: 6px !important; padding-bottom: 6px !important; }

  /* 大区块内边距进一步收窄 */
  [style*="padding:56px"] { padding: 16px !important; }
  [style*="padding:48px"] { padding: 16px !important; }
}
