/* =========================================================
   HEIE — 移动端 / iPad 响应式适配层
   最后加载，只做覆盖，桌面端（>1024px）完全不受影响。
   断点：
     1024  iPad 横屏 / 导航已收起为汉堡菜单
      768  iPad 竖屏
      640  手机
      480  小屏手机
   本文件是全站响应式的唯一入口，方便统一审阅与维护。
   ========================================================= */

/* ---------------------------------------------------------
   0. 全局横向溢出保护（所有尺寸）
   --------------------------------------------------------- */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, table, iframe { max-width: 100%; }

/* 邮箱 / 网址等无空格长串必须换行，避免顶破容器被裁掉 */
.team-info, .contact-info, .contact-company, .cb-body, .info-section p,
.dining-loc, .dining-scope, .sponsor-col-body, .info-notes, .sh-org-sm,
.sh-intro, .footer-copy, .fc-value, .contact-info p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 宽数据表格：横向滚动而不是被裁切（配合 HTML 中的 .table-scroll 包裹） */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------
   1. iPad 横屏及以下（<=1024）
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  /* 子页顶部横幅：01–12 全部页面都是 <section class="subpage-hero"><img/></section>，
     没有任何叠加的标题/文字层。但 subpage.css 的移动端断点给 .subpage-hero 强制了
     min-height（460px/380px）+ padding-bottom，那本是给"图 + 叠加标题"版式准备的，
     套在纯图片版式上就会比图片实际渲染高度更高，多出来的部分露出 section 自己的
     深绿背景，看起来像"背景没跟着图片高度走"。这里把高度交还给图片本身。
     （hero-thin / hero-photo-only / hero-stub / subpage-hero-new 这些变体都有各自
     更高优先级的规则，不受影响。） */
  .subpage-hero {
    min-height: 0;
    height: auto;
    padding-bottom: 0;
  }
  .subpage-hero > img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* 正文区块此前无左右内边距，窄屏会贴边——补上 */
  .content-block {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  /* 媒体 logo 墙：6 列 → 4 列 */
  .media-grid { grid-template-columns: repeat(4, 1fr); }

  /* 子页大标题此前被 .subpage-main .sd-text 硬锁 36px（特异性高于旧规则），此处开始逐级缩小 */
  .subpage-main .sd-text { font-size: 28px; letter-spacing: .05em; }
  .subpage-main .sd-text i { font-size: 16px; }

  /* subpage-hero-new 的主标题此前没有任何响应式，逐级缩小 */
  .subpage-hero-new .sh-title { font-size: 44px; }
  .subpage-hero-new .sh-subtitle { font-size: 22px; }
  .subpage-hero-new .sh-org-text { font-size: 20px; }
}

/* ---------------------------------------------------------
   2. iPad 竖屏（<=768）
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .subpage-main .sd-text { font-size: 24px; letter-spacing: .04em; }
  .subpage-main .sd-text i { font-size: 15px; }
  .subpage-main .sd-line { max-width: 48px; }
  .section-deco { gap: 12px; }

  .subpage-hero-new .sh-title { font-size: 36px; }
  .subpage-hero-new .sh-subtitle { font-size: 18px; }

  /* 表格保持可读，靠外层 .table-scroll 横向滚动 */
  .table-scroll .price-table { min-width: 460px; }
  .table-scroll .price-table.zanzhu { min-width: 640px; }
  .table-scroll .schedule-table { min-width: 420px; }
}

/* ---------------------------------------------------------
   3. 手机（<=640）
   --------------------------------------------------------- */
@media (max-width: 640px) {
  .subpage-main .sd-text { font-size: 20px; }
  .subpage-main .sd-text i { font-size: 13px; }

  .subpage-hero-new .sh-title { font-size: 30px; }
  .subpage-hero-new .sh-subtitle { font-size: 15px; }
  .subpage-hero-new .sh-org-text { font-size: 16px; }

  /* 媒体 logo 墙：手机 3 列 */
  .media-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  /* 02 展区规划：两列标签堆叠为单列，一行一个标签 */
  .zone-lists-wrapper { flex-direction: column; gap: 18px; }
  .zone-lists-wrapper .zone-list:last-child { margin-top: 0; }
  .zone-list { grid-template-columns: 1fr; }
  .zone-pill { text-align: left; }

  /* 子页顶部日期/场馆条：堆叠居中，避免拥挤 */
  .sh-top-bar { height: auto; padding: 12px 0; }
  .sh-top-bar-inner { flex-direction: column; gap: 4px; text-align: center; }
  .sh-date-text { font-size: 13px; }
  .sh-date-en { font-size: 11px; }

  /* 12 联系我们：团队卡片头像缩小，联系方式换行 */
  .team-card { grid-template-columns: 64px 1fr; gap: 14px; margin-bottom: 32px; }
  .team-avatar { width: 64px; height: 64px; }
  .team-info .team-name { font-size: 18px; }

  /* 触摸目标：语言切换按钮加大 */
  .lang-btn { padding: 8px 16px; }

  /* 首页 hero：把服务卡片改为正常流布局，去掉手机上大片空白视频区 */
  .hero { min-height: auto; padding-bottom: 40px; }
  .hero-content { padding-top: 118px; padding-bottom: 28px; }
  .service-cards { position: static; margin-top: 22px; }
  .hero-eyebrow-en, .hero-subtitle { overflow-wrap: break-word; }
}

/* ---------------------------------------------------------
   4. 小屏手机（<=480）
   --------------------------------------------------------- */
@media (max-width: 480px) {
  :root { --gutter: 16px; }

  .hero-title { font-size: 24px; }
  .subpage-hero-new .sh-title,
  .subpage-hero .sh-title { font-size: 24px; }

  /* 团队卡片：头像置于信息上方，最窄屏更好读 */
  .team-card { grid-template-columns: 1fr; justify-items: start; gap: 10px; }
  .team-avatar { width: 72px; height: 72px; }

  /* 赞助价目表列多，保证横向滚动可用 */
  .table-scroll .price-table.zanzhu { min-width: 560px; }
}

/* =========================================================
   5. 补充修正（真机截图审计发现的残留问题）
   本层加载在最后，用 !important / anywhere 兜底，确保生效。
   ========================================================= */

/* 长英文 / 网址等无空格串强制换行；anywhere 还会缩小 min-content，
   让其所在的网格/弹性列能够收缩，避免把容器顶宽后被裁切 */
.info-section p, .info-notes, .cb-body, .info-bullets li,
.team-info, .contact-info, .contact-info p,
.dining-loc, .dining-scope, .adv-item {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1024px) {
  /* 05 线上填报：正文 + 二维码强制单列，避免二维码把正文挤出视口被裁切 */
  .info-section,
  .info-section.info-section-rev { grid-template-columns: 1fr !important; gap: 26px; }
  .info-section .qr-card { justify-content: flex-start; }

  /* 长标题 / 装饰标题英文必须换行 */
  .info-heading, .info-h, .info-h .en,
  .cb-cn-left, .zone-cn-title,
  .sd-text, .sd-text i { overflow-wrap: anywhere; }
}

@media (max-width: 768px) {
  /* 09 馆内餐饮：位置 / 经营范围两列在窄屏堆叠为上下，不再被裁切 */
  .dining-row { grid-template-columns: 56px 1fr !important; gap: 12px; padding: 12px 14px; }
  .dining-logo { width: 56px; height: 56px; }
  .dining-scope { grid-column: 1 / -1 !important; padding-left: 68px; margin-top: 2px; }

  /* 超长英文小标题（如“CHTF Professional audience WeChat consultation”）缩小并换行 */
  .info-h { font-size: 20px; }
  .info-h .en { font-size: 17px; display: inline; margin-right: 8px; }
}

@media (max-width: 640px) {
  .info-heading { font-size: 20px; }
  .cb-cn-left { font-size: 22px; }
}
