﻿/* ==========================================================================
   首页 Hero 第 3 屏 · 手机端（<= 767px）视觉重设计
   --------------------------------------------------------------------------
   修三处硬伤：① 文案卡与视频之间 ~132px 死白；② 黑胶囊条整片压住视频、
   第二行被右缘切；③ OPEN THE CATALOGUE 纯文字无描边。

   全部规则包在 @media (max-width:767px) 内 —— 桌面 1440 与本文件任何一行都无关。

   真实 DOM（逐屏实测校正；参考草稿里的 .fy3-hero__plant-pills /
   .fy3-plant-switch-bar / .fy3-hero__slide--onPhoto / .fy3-hero__slide[data-hero-slide="2"]
   在真机上全部不存在，一个都没用）：
     article.fy3-hero__slide[data-hero-slide]
       div.fy3-hero__media.fy3-hero__media--bleed     ← 第 3 屏唯一标识
         video.fy3-hero__video
         span.fy3-hero__scrim
         div.fy3-hero__cam-bar[data-cam-bar]
           div.fy3-hero__cam-opts > button.fy3-hero__cam-btn[data-cam] × 4
           a.fy3-hero__cam-btn       (Book Factory Audit —— 手机端不留)
           a.fy3-hero__cam-btn       (WhatsApp —— 手机端不留)
           button.fy3-hero__cam-mute[hidden]
       div.fy3-hero__copy.fy3-hero__copy--onPhoto
         div.fy3-hero__copy-inner.fy3-container
           h2.fy3-hero__slogan / p.fy3-hero__line / div.fy3-hero__actions > a.fy3-btn

   基线实测（390×844，改前）：
     .fy3-hero          min-height 844（100svh−64 解析值），padding 106 / 120
     .fy3-hero__stage   358 宽贴左（右侧空 32px）、558 高
     .fy3-hero__slide   558 高；文案卡底 341、视频顶 473 → 132px 空白带
     .fy3-hero__copy    padding 25.32px / 101.28px
     .fy3-hero__cam-bar absolute / rgba(20,20,19,.62) / blur(8px) / radius 999 / wrap，
                        与 video 重叠 36330px²，7 个可点项，第二行被右缘切
     .fy3-btn--ghost    border 0 / style none（只剩一行字）

   ★ 布局稳定原则（CLS）
     第 3 屏**绝不改变 hero 的高度与内距**：hero 盒子由三屏共用的
     min-height:calc(100svh−64px) + 三屏一致的 padding 决定，第 1/2/3 屏切换时
     高度恒定、文档总高不变。多余的高度不靠"收缩 hero"消除，而是让**视频吃满**
     第 3 屏剩余空间（.fy3-hero__slide 改 flex 列，video flex:1 1 auto）。
     早前一版把第 3 屏 hero 压成 685px 来消死白，导致自动轮播每 7s 页面整体位移
     159px（CLS 回归，R-M30-04），已回退为「恒定高度 + 视频伸展」。

   注：本文件为纯 CSS，不改 DOM —— cam-bar 是 .fy3-hero__media 的子元素，
   把父级 overflow 放开、自身改 static 后自然排到视频下方，无需移动节点。
   ========================================================================== */

@media (max-width: 767px) {

  /* ---------------------------------------------------------------------
     H-1 · 消除上下死白（不靠收缩 hero）
     hero 的高度与内距一律沿用基线：三屏同盒 → 切屏零位移。
     死白由「第 3 屏内部重新分配」消除：文案贴顶、视频伸展吃掉余量。
     --------------------------------------------------------------------- */

  /* 舞台：只有「第 3 屏激活」时才把内容框从「358px 贴左、右侧空 32px」改成满宽 +
     左右各 16px —— 卡片与视频左右两边才对齐。第 1、2 屏不满足 :has 条件，几何与
     本文件无关 → 零回归。 */
  html body .fy3-hero:has(.fy3-hero__slide.is-active > .fy3-hero__media--bleed) .fy3-hero__stage {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  /* 第 3 屏：由 grid 改 flex 列，占满与另两屏相同的格子高度。
     DOM 里 media 在 copy 之前，用 order 把文案提到上方。 */
  html body .fy3-hero .fy3-hero__slide:has(> .fy3-hero__media--bleed) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    grid-template-rows: none !important;
    align-content: stretch !important;
    row-gap: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* 文案卡：上下内距清零，卡底到视频只留 14px（改前 132px）；高度按内容，不参与伸展。
     align-self:stretch + width:100% 是必须的：基类给了 .fy3-hero__copy
     { align-self: center }，在 flex 列里会退化成"按内容收缩"，卡片会比视频窄一圈。 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto {
    order: 1 !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 0 14px !important;
    color: #141311 !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__copy-inner {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  /* 文字已离开视频画面，不再需要白字 + 阴影；统一回墨色正文 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__slogan,
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__slogan em,
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__line {
    color: #141311 !important;
    text-shadow: none !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__slogan {
    font-size: 34px !important;
    line-height: 1.08 !important;
    letter-spacing: -.02em !important;
    max-width: 100% !important;
  }

  /* ---------------------------------------------------------------------
     H-2 · 视频 100% 干净 + 胶囊条移到视频下方 + 视频吃满剩余高度
     --------------------------------------------------------------------- */
  /* 媒体框：改成可伸展的 flex 列（视频 + 胶囊条），不再绝对定位、不再裁切；
     深底与外景兜底图一并去掉 —— 否则胶囊条下方会露一条深色带 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__media--bleed {
    position: relative !important;
    inset: auto !important;
    order: 2 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
  }

  /* 文案不在画面上 → 去掉压在视频上的暗角，画面回到原始亮度 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__media--bleed .fy3-hero__scrim {
    display: none !important;
  }

  /* 视频：4:3 是**下限**，flex:1 再把剩余高度给它（aspect-ratio 只提供基准尺寸，
     伸展时以 flex 结果为准）。object-fit 必须 cover，否则拉高后会变形。 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__media--bleed .fy3-hero__video {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center 50% !important;
    border-radius: 14px !important;
    background: #141311 !important;
    transform: none !important;
  }

  /* 胶囊条：静态流式排到视频正下方，高度按内容、不参与伸展 */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__media--bleed .fy3-hero__cam-bar {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    scroll-snap-type: x proximity;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__media--bleed .fy3-hero__cam-bar::-webkit-scrollbar {
    display: none !important;
  }

  html body .fy3-hero__cam-bar .fy3-hero__cam-opts {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
  }

  /* 4 个产线机位胶囊：白底 + 1px 灰描边；激活态用全站墨绿 */
  html body .fy3-hero__cam-bar .fy3-hero__cam-btn {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border: 1px solid #8A8A82 !important;
    border-radius: 999px !important;
    background: #FFFFFF !important;
    color: #141311 !important;
    font-size: 11px !important;
    letter-spacing: .06em !important;
    line-height: 1 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    scroll-snap-align: start;
  }
  html body .fy3-hero__cam-bar .fy3-hero__cam-btn .fy3-mono {
    font-size: 11px !important;
    letter-spacing: .06em !important;
    color: inherit !important;
  }
  html body .fy3-hero__cam-bar .fy3-hero__cam-btn.is-active,
  html body .fy3-hero__cam-bar .fy3-hero__cam-btn[aria-pressed="true"] {
    background: #1B4D3E !important;
    border-color: #1B4D3E !important;
    color: #FFFFFF !important;
  }
  html body .fy3-hero__cam-bar .fy3-hero__cam-btn:focus-visible {
    outline: 2px solid #1B4D3E !important;
    outline-offset: 2px !important;
  }

  /* 手机端这一行只留 4 个产线机位：审计预约 / WhatsApp / 静音在窄屏没有位置，
     一律移出胶囊条（HTML 不动，桌面照旧显示） */
  html body .fy3-hero__cam-bar > a.fy3-hero__cam-btn,
  html body .fy3-hero__cam-bar > .fy3-hero__cam-mute {
    display: none !important;
  }

  /* ---------------------------------------------------------------------
     H-3 · 两个 CTA 视觉统一（满宽胶囊 + ghost 细描边）
     --------------------------------------------------------------------- */
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 16px !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions .fy3-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 46px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    font-size: 12px !important;
    letter-spacing: .1em !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions .fy3-btn--solid {
    background: #141311 !important;
    border: 1px solid #141311 !important;
    color: #FBF9F4 !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions .fy3-btn--ghost {
    background: transparent !important;
    border: 1px solid #8A8A82 !important;
    color: #141311 !important;
  }
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions .fy3-btn--ghost:hover,
  html body .fy3-hero .fy3-hero__slide > .fy3-hero__copy--onPhoto .fy3-hero__actions .fy3-btn--ghost:focus-visible {
    border-color: #141311 !important;
    background: rgba(20, 19, 17, .04) !important;
  }
}