/* ============================================================
   官网主站移动端适配补全（全站共用）
   v12.1 初版 / v12.4 深度修复（2026-09-07）
   在各页内联样式之后加载，补齐小屏体验细节；防御式书写，
   不破坏各页已有断点逻辑。
   ============================================================ */
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
iframe, video { max-width: 100%; }

/* v12.4: 彻底禁止横向滚动（hidden 在 iOS Safari 上不可靠，
   clip 可阻止 scrollWidth 被屏外抽屉菜单撑大，杜绝"页面能左右晃"） */
html, body { overflow-x: clip; }

@media (max-width: 768px) {
  body { font-size: 15px; overflow-x: hidden; overflow-x: clip; }

  /* 布局容器 */
  .container { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
  .sec { padding: 52px 16px; }

  /* 标题与主视觉 */
  .hero { padding-top: 42px; padding-bottom: 42px; }
  .hero h1 { font-size: 30px !important; line-height: 1.3; }
  .page-hero h1 { font-size: 26px !important; line-height: 1.3; }
  .sec-head h2 { font-size: 26px !important; line-height: 1.35; }

  /* CTA 按钮组：纵向铺满，提升触达面积 */
  .ctas { flex-direction: column; align-items: stretch; gap: 10px; }
  .ctas .btn { width: 100%; box-sizing: border-box; text-align: center; }

  /* 数据条 */
  .stats-inner { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }
  .stats-inner b { font-size: 26px !important; }
  .t-stats-inner { flex-wrap: wrap; gap: 14px; }

  /* 导航 */
  .nav-tel { display: none; }
  .nav-inner { height: 60px; }
  /* 抽屉菜单关闭态彻底移出渲染树，避免撑宽文档/被滑动露出 */
  .menu:not(.open) { visibility: hidden; }
  .menu { transition: transform .3s, visibility .3s; }

  /* v12.4: 内联 style 栅格兜底（内联样式优先级高于媒体查询，
     须用 !important 覆盖，恢复页面 640 断点的预期单列布局） */
  .container[style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 28px; }
  .course-grid[style] { grid-template-columns: 1fr !important; }
  .news-teaser-grid[style] { grid-template-columns: 1fr !important; }

  /* 浮动装饰件小屏收起，避免遮挡内容 */
  .float-chip { display: none; }

  /* 表格兜底：窄屏横向滚动，避免撑破布局 */
  .sec table, .container table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 卡片栅格在窄屏降为单列（未在页面自身断点覆盖到的情况） */
  .f-card, .t-card, .course-card, .news-teaser-card { max-width: 100%; }

  /* about 页「数字一览」块：小屏降为两列 */
  .about-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .about-stats b { font-size: 22px !important; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px !important; }
  .page-hero h1 { font-size: 23px !important; }
  .sec-head h2 { font-size: 22px !important; }
  .btn { font-size: 14px; }
  .sec { padding: 42px 14px; }
}
