/* ==========================================================================
   M15-M2 · 移动端 375/390/430 深度适配（m15-mobile 独占）
   --------------------------------------------------------------------------
   本文件由 lead 在 index/studio 的 head 末尾注入，最后加载，只覆盖移动端。
   所有选择器均已对照真 DOM 实测（M0b 假想类名命中表）：
     可用 .hd / .fy3-hero__* / .fy3-sets__chips / .fy3-grid[data-grid]
     / .fy3-spec-row / .fy3-craft-grid[data-craft-grid] / .fy3-brands__grid
     / .fy3-book__* / .fy3-field__input / .h8-dock[data-h8] / .mobile-cta
   参考件中 M0b 实测 0 命中的假想名一律未使用（清单见本轮回报）。
   !important 用于三处硬约束：iOS 16px 输入防缩放、横向溢出归零、
   移动端 44px 触控命中框（lead 在 M15-M2g 明确授权的 R15-4 例外）。
   ========================================================================== */

/* 桌面默认：品牌墙展开触发器只在移动端出现（按钮由 m15-mobile.js 注入） */
.m15-brands-toggle { display: none; }

@media (max-width: 768px) {
  /* 硬约束①：零横向溢出。用 !important 覆盖历史 !important 声明，避免被共写样式回顶。 */
  html, body { overflow-x: clip !important; }

  /* ① 页头 60px + 44×44 热区 + 抽屉 */
  .hd { height: 60px; }
  .hd button,
  .hd [data-lang-open],
  [data-drawer] button,
  .drawer button { min-width: 44px; min-height: 44px; }
  /* 6 档实测回修：Logo 链接实测 116×36、语言面板按钮实测 110×41，
     原因是现有 nav-v2.css/styles.css 对这两类节点有更高特异性的固定高度。
     用足够特异性只扩命中框，不改视觉（logo 仍 30px mark、文字排布不变）。 */
  .hd a.hd__brand {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
  }
  .hd button.hd__lang,
  .hd button.hd__tool,
  .hd button.hd__menu,
  .hd .hd-lang[data-lang-panel] button[data-lang],
  .hd-lang[data-lang-panel] button[data-lang] {
    min-width: 44px;
    min-height: 44px;
    height: auto;
  }
  [data-lang-panel] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .drawer a { min-height: 44px; display: inline-flex; align-items: center; }

  /* ② Hero：标题流体 / 热点 26px 视觉 + 44px 热区 / 对比器 pan-y / 航拍全出血 / 机位横滑 */
  .fy3-hero__slogan {
    font-size: clamp(32px, 9.2vw, 44px);
    line-height: 1.06;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .55); /* 航拍叠字对比度辅助 */
  }
  .fy3-hero__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }
  .fy3-hero__actions a { min-height: 46px; justify-content: center; }

  .fy3-hotspot { min-width: 44px; min-height: 44px; }
  .fy3-hotspot__dot { inset: 9px; } /* 44 - 2×9 = 26px 视觉圆点 */

  .fy3-compare__range { touch-action: pan-y; min-height: 44px; }
  .fy3-compare[data-compare] { width: 100%; }

  .fy3-hero__cam-bar[data-cam-bar] {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
  }
  .fy3-hero__cam-bar[data-cam-bar]::-webkit-scrollbar { display: none; }
  .fy3-hero__cam-btn { flex: 0 0 auto; min-height: 44px; }

  /* 第三轮实测回修：Hero 控制条 tab 高 41px、箭头 40×40px（01-hero.css:532
     在窄档把箭头压成 40px）。按真 DOM 用高特异性只扩命中框；
     tab 视觉（编号+进度条）与箭头字形保持不变。 */
  .fy3-hero__tabs button.fy3-hero__tab[data-hero-tab] {
    min-width: 44px;
    min-height: 44px;
  }
  .fy3-hero .fy3-hero__nav button.fy3-hero__arrow[data-hero-prev],
  .fy3-hero .fy3-hero__nav button.fy3-hero__arrow[data-hero-next] {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  /* ③ §02 五件套组件条：横滑 + 112px 固定卡宽（领导裁定方案） */
  .fy3-sets__chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 6px;
  }
  .fy3-sets__chips > * {
    flex: 0 0 112px;
    scroll-snap-align: start;
  }

  /* final 6 档回修：§02 卡片内 20 项 <44px 控件（02-sets.js 动态生成的真类）。
     专利按钮 95×24、器型胶囊 74-88×31、卡片链接 145-172×36，
     统一抬高命中框到 44px；视觉（★编号、胶囊标签、按钮文案）不变。 */
  .fy3-sets__card button.fy3-sets__patent[data-patent],
  .fy3-sets__card .fy3-sets__angles button.fy3-sets__angle[data-angle],
  .fy3-sets__card .fy3-sets__actions a.fy3-btn,
  .fy3-sets__chooser .fy3-sets__pills button.fy3-sets__pill[data-val],
  .fy3-sets__result-actions a.fy3-btn,
  .fy3-sets__dialog-close[data-dialog-close] {
    min-width: 44px;
    min-height: 44px;
  }

  /* ④ §03 SKU 2 列 + 4:3 舞台 + CAD 10px + 规格行防截断 */
  .fy3-grid[data-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .fy3-stage-media[data-stage-media] { aspect-ratio: 4 / 3; width: 100%; }
  .fy3-cad-tag[data-cad] {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
  }
  /* 6 档实测回修：dt「Neck finish (Ø × H)」在 375/390/430 末行孤字 H)。
     改为 max-content 列 + dt nowrap，整条标签不换行，孤字消失。 */
  .fy3-spec-row { grid-template-columns: max-content minmax(0, 1fr); }
  .fy3-spec .fy3-spec-dl .fy3-spec-row dt { white-space: nowrap; }
  .fy3-spec-row dd { overflow-wrap: anywhere; }

  /* ⑤ §04 工艺卡：瓶身 3 卡单列 / Logo 2 卡双列 / 按钮满宽 */
  .fy3-craft-grid[data-craft-grid] { grid-template-columns: minmax(0, 1fr); }
  .fy3-finish-group:nth-of-type(2) .fy3-craft-grid[data-craft-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fy3-craft-card__actions .fy3-link-underline {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* ⑥ §05 品牌墙 4 列 + 前 20；画册 44 热区 + 手指滑动 + 16px 跳页框 */
  .fy3-brands__grid[data-fy3-brands] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .fy3-brands__grid[data-fy3-brands]:not([data-m15-brands-expanded="true"]) .fy3-brand-tile:nth-child(n+21) {
    display: none;
  }
  .m15-brands-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 12px;
    padding: 0 16px;
    font: inherit;
    color: #F7F4EE;
    background: #141311;
    border: 1px solid #B8965A;
    border-radius: 8px;
    cursor: pointer;
  }
  .fy3-book__nav[data-fy3-flip-prev],
  .fy3-book__nav[data-fy3-flip-next] { min-width: 44px; min-height: 44px; }
  .fy3-book__stage,
  .fy3-book__viewport[data-fy3-flip-viewport] { touch-action: pan-y; }

  /* 硬约束②：iOS Safari 聚焦输入自动缩放。16px 是系统阈值，必须 !important 压过历史规则。 */
  .fy3-field__input,
  .fy3-listbox__native,
  .foot-sub__input,
  .fy3-book__goto[data-fy3-book-goto],
  input, textarea, select { font-size: 16px !important; }
  .fy3-book__goto[data-fy3-book-goto] { min-height: 44px; }

  /* ⑦ 悬浮坞安全区：复用现有 .h8-dock / .mobile-cta，不造新类名 */
  .h8-dock[data-h8] {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }
  .h8-dock__btn { min-height: 44px; }
  .mobile-cta { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: 84px; }

  /* ===================== final2 全站兜底：杜绝第四轮打地鼠 =====================
     静态筛选了全站 CSS 中固定 height/min-height<44 的可点规则：
     01-hero.css:532 40px / 03-collection.css:139 32px、:282 34px、
     :226 36px、:454 40px、:492 34px / home-v2.css:32 32px、:38 38px /
     floating-cta.css:40 40px / styles.css 多处 30-40px。
     统一在最后加载的本文件一次性覆盖，不再逐轮补单个控件。 */
  button,
  [role="button"] {
    min-width: 44px;
    min-height: 44px;
  }

  /* 行内 <a> 的 min-height 不生效（"All 70 shapes →" 335×21 的根因），
     须先变 inline-flex 才能吃 44px 命中框；只作用于已知可点链接类，不改文案与配色。 */
  a.fy3-link-underline,
  a.fy3-capsule-link,
  a.fy3-btn,
  a.h8-dock__btn,
  a.h8-bottom__btn,
  a.mobile-cta__btn,
  a.hv2-card__act,
  a.certgallery__arrow,
  a.cat-flip__btn,
  button.hv2-tab,
  button.cat-flip__btn,
  .capselect__tabs button,
  .foot-sub__btn,
  .fy3-3d-close {
    min-width: 44px;
    min-height: 44px;
  }
  a.fy3-link-underline,
  a.fy3-capsule-link,
  a.fy3-btn,
  a.h8-dock__btn,
  a.h8-bottom__btn,
  a.mobile-cta__btn,
  a.hv2-card__act,
  a.certgallery__arrow {
    display: inline-flex;
    align-items: center;
  }

  /* §03 专项：视图按钮 32 / 器型筛选 34 / 胶囊链接 36 / fy3-btn 40 / 3D 关闭 34 */
  .fy3-collection button.fy3-viewmode[data-viewmode],
  .fy3-collection button.fy3-filter[data-filter],
  .fy3-collection button.fy3-angle[data-angle],
  .fy3-collection .fy3-stage-capsule a.fy3-capsule-link[data-capsule-customise],
  .fy3-collection .fy3-stage-capsule a.fy3-capsule-link[data-capsule-sample],
  .fy3-collection .fy3-stage-nav a.fy3-link-underline,
  .fy3-collection .fy3-spec-actions a.fy3-link-underline,
  .fy3-collection a[data-3d-studio] {
    min-height: 44px;
  }

  /* ===================== M15-M2g 最终根治（禁止第五轮） =====================
     第四轮真因：上一版兜底 `button, [role="button"]` 特异性 (0,0,1)
     压不住组件类 .fy3-btn / .fy3-preset / .fy3-doc__page (0,1,0+)。
     lead 明确授权此处为唯一可扩大 !important 的移动端硬约束
     （R15-4：44px 是甲方硬指标，非视觉装饰）。
     final3.json 8 项全部覆盖：
       3D preview → button.fy3-btn[data-3d]
       Frosted + gold / Amber gloss → button.fy3-preset[data-preset]
       Loading → [data-fy3-floor-toggle]
       Download ↓ → a.fy3-doc__page
       All notes / All notes on quality → a.fy3-journal__all
       gzfuyao@gmail.com → a[href^="mailto:"] / .link-quiet */
  html body button,
  html body button.fy3-btn[data-3d],
  html body button.fy3-preset[data-preset],
  html body [data-fy3-floor-toggle],
  html body [role="button"],
  html body [tabindex="0"],
  html body a[href],
  html body .fy3-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  /* 行内 <a> 不吃 min-height，必须改 display；只针对 final3 命中的链接类，
     不把全站正文里所有行内链接变成块级。 */
  html body a.fy3-journal__all,
  html body a.fy3-doc__page,
  html body a.link-quiet,
  html body a[href^="mailto:"],
  html body a[href^="tel:"] {
    display: inline-flex !important;
    align-items: center;
    min-height: 44px !important;
  }

  /* ===== M4 设计关 B-05：黑卡 CTA 移动端金实心（桌面规则只在 @media min-width:901px） =====
     真 DOM：04-customise.html:149-156
     .fy3-craft-card--special .fy3-btn--solid（Contact our engineers）
     .fy3-craft-card--special .fy3-link-underline（WhatsApp）
     #C8A464 on #141311 ≈ 7:1（金底墨字同值），满宽好点，不改文案。 */
  html body .fy3-craft-card--special .fy3-btn--solid {
    background: #C8A464;
    border-color: #C8A464;
    color: #141311;
    font-weight: 700;
    width: 100%;
  }
  html body .fy3-craft-card--special .fy3-btn--solid:hover {
    background: #D8B679;
    border-color: #D8B679;
  }
  /* M26-04 i18n 根治：旧版用伪元素硬写英文短标签，会在 11 语
     渲染态零漏译门禁判漏译。现在短标签是真实 HTML 节点
     `<span class="fy3-btn__label-mobile" data-i18n="m26.ui.contactUs">`，
     桌面隐藏、移动端显示；原文案节点移动端 display:none 由移动端短标签
     承担可访问名（"Contact us →" 语义等价），不再靠 font-size:0 视觉隐藏。 */
  html body .fy3-craft-card--special .fy3-btn--solid {
    letter-spacing: 0;
  }
  html body .fy3-craft-card--special .fy3-btn--solid .fy3-btn__label-desktop {
    display: none;
  }
  html body .fy3-craft-card--special .fy3-btn--solid .fy3-btn__label-mobile {
    display: inline;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
  }
  html body .fy3-craft-card--special .fy3-link-underline {
    color: #C8A464;
    border-bottom-color: #C8A464;
    font-weight: 700;
  }
  html body .fy3-craft-card--special .fy3-link-underline:hover {
    color: #D8B679;
    border-bottom-color: #D8B679;
  }

  /* A 类观察①：窄屏 br 被 01-hero.css:516 隐藏，标题两段贴合缺空格 */
  .fy3-hero__slogan em::before { content: " "; white-space: pre; }

  /* A 类观察②：07-enquiry.css:222-229 只写 outline/border，无 box-shadow。
     这里显式补 M10 同款金环，computed 不得为 none。 */
  html body .fy3-field__input:focus,
  html body .fy3-field__input:focus-visible {
    box-shadow: 0 0 0 3px rgba(200, 164, 100, .22);
  }
}
