/* ============================================================
   TIECEC 移动端硬化层  mobile-hardening.css
   2026-12-01 — 移动端专业标准核验后补齐
   目标：消除横向滚动、防止 iOS 聚焦缩放、保证触控目标、小字可读
   ------------------------------------------------------------
   注意：本文件只做「兜底 + 下限」，页面自身布局问题要在页面里修，
        不要靠 overflow-x:hidden 掩盖（会裁掉内容）。
   ============================================================ */

/* ① 媒体不被撑破 —— 图片/视频/嵌入一律自适应 */
img, video, iframe, canvas, embed, object { max-width: 100%; height: auto; }
table { max-width: 100%; }

/* ② 网格/弹性子项可收缩
   长 placeholder、长英文单词、长数字默认会把 1fr 轨道撑到 min-content，
   在窄屏产生横向溢出。加 min-width:0 让轨道真正可缩。 */
.grid > *, .g2 > *, .g3 > *, .g4 > *,
.order-grid > *, .feats > *, .order-col > *,
.matrix-wrap > *, .panel > * { min-width: 0; }

input, select, textarea, button {
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
textarea { width: 100%; }

/* ③ iOS Safari 聚焦自动放大：输入控件字号必须 ≥16px
   （低于 16px 时 iOS 会自动放大整个页面，是最常见的移动端体验缺陷） */
@media (max-width: 860px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select, textarea { font-size: 16px !important; }
}

/* ④ 触控目标下限 44×44（WCAG 2.5.5 / Apple HIG）
   只作用于按钮类控件，不影响正文里的行内链接 */
@media (max-width: 860px) {
  button,
  input[type="submit"], input[type="button"],
  a.btn, a.btn-primary, a.btn-gold, a.btn-ghost,
  .cta-btn, .cat-tab, a[role="button"] {
    min-height: 44px;
  }
}

/* ⑤ 小字下限
   页脚 / 法务 / 备案 / 版权：不小于 14px（用户硬要求）
   其余辅助说明：不小于 12px，避免 9px、10px 这类不可读字号 */
@media (max-width: 860px) {
  footer p, footer li, footer span, footer a,
  .ui-foot p, .ui-foot span, .ui-foot a,
  .ui-slim-legal span, .ui-slim-legal a,
  .ui-foot-in, .ui-foot-in * { font-size: 14px !important; line-height: 1.7 !important; }

  .small, .meta, .note, .caption, .subtitle, .section-label,
  .section-desc, small, .kv span, .price-note, .fineprint {
    font-size: 13px;
  }
}

/* ⑤b 极小字号兜底：10–11px 在手机上不可读，提到 12.5px
   说明：12–12.5px 属「次要元信息」正常尺度，保留；
        10–11px 属不可读区间，必须提起来。 */
@media (max-width: 860px) {
  /* 内联 style 里的极小字号（内联优先级最高，只能同样用 !important + 属性选择器压制） */
  [style*="font-size:9px"], [style*="font-size:10px"], [style*="font-size:10.5px"],
  [style*="font-size:11px"], [style*="font-size:11.5px"], [style*="font-size:12px"],
  [style*="font-size:12.5px"] { font-size: 13px !important; }

  /* Tailwind 任意值类 */
  [class*="text-[10px]"], [class*="text-[11px]"],
  [class*="text-[10.5px]"], [class*="text-[11.5px]"] { font-size: 12.5px !important; }

  /* 各站点的微型标签类 */
  .tag, .card-tag, .tag-pill, .cert, .kpl, .co, .ds, .ptxt, .pmor,
  .dir, .req, .chip, .pill, .badge, .eyebrow, .label-xs,
  .cat-tag, .industry, .cat-dir, .cat-cap, .company, .mcap, .sec-label,
  .tri-n, .hero-card-desc, .lg-lbl, .lg-brand, .uca-lv, .section-label,
  .stt, .ct, .srcnote, .mini, .meta-mini,
  .src, .en, .en2, .ribbon, .upd, .dt, .tm, .rev,
  .snv-grp, .featured-badge, .card-badge, .who, .who b, .who small {
    font-size: 12.5px !important;
  }

  /* small 元素容易被页面规则（如 .who small）按更高特异性压住，这里加 !important */
  small { font-size: 12.5px !important; }

  /* TGCP 品牌标语（10.5px）与账单小标（11px）—— 页面规则特异性更高，需 !important */
  .brand-text span, .bill-box .bill-to b { font-size: 12px !important; }

  /* 8–9px 的任意值类（是全站最不可读的一档） */
  [class*="text-[8px]"], [class*="text-[9px]"] { font-size: 12.5px !important; }

  /* Tailwind text-xs = 12px，次要文案提到 13px 更好读 */
  .text-xs { font-size: 13px !important; }
}

/* ⑥ 兜底：任何情况下手机上不出现横向滚动条
   （真溢出已在上方与各页面内修好；此处仅防第三方内容如长 URL、iframe 撑破） */
@media (max-width: 860px) {
  body { overflow-x: hidden; }
}

/* ⑦ 窄屏头部：语言切换 + 汉堡菜单在 ≤420px 会把 header 撑破
   （实测 TGCP 首页 @360 → 布局视口被撑到 385，真机需要横向滚动）
   这里收紧内距与间距，并允许 head-actions 收缩。 */
@media (max-width: 420px) {
  .head-inner { padding: 0 12px !important; gap: 10px !important; }
  .head-actions { gap: 6px !important; flex-shrink: 1 !important; min-width: 0 !important; }
  .head-actions > * { flex-shrink: 1; min-width: 0; }
  .brand span, .head-actions .btn-primary { white-space: nowrap; }
}
