/* ==========================================================================
   移动端样式（仅 ≤768px 生效，PC 端不受影响）
   由 _build 流程维护；改这里不影响桌面版
   ========================================================================== */
@media (max-width: 768px) {

  /* ---------- 通用：间距、字号、触控 ---------- */
  .container { padding-left: 18px; padding-right: 18px; }
  .section { padding: 44px 0; }
  .section--tight { padding: 30px 0; }
  .section-head { margin-bottom: 22px; }
  h1 { font-size: 30px; line-height: 1.22; }
  h2 { font-size: 23px; line-height: 1.3; }
  h3 { font-size: 17px; }
  p, li { font-size: 15px; line-height: 1.75; }
  .eyebrow { font-size: 12px; }
  body { -webkit-text-size-adjust: 100%; }

  /* 可点区域放大到 44px 以上 */
  .btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
  .pdp-slider__arrow { width: 38px; height: 38px; }
  .lang-switch__btn { height: 40px; }


  /* ---------- 移动端导航抽屉：关闭时不拦截点击（修复点击穿透跳产品页） ---------- */
  .nav, .nav * { pointer-events: none !important; }
  .nav:not(.is-open) { visibility: hidden !important; }
  .nav:not(.is-open) .nav-sub { visibility: hidden !important; }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav.is-open, .nav.is-open * { pointer-events: auto !important; }

  /* ---------- 首屏：压到 60~65vh ---------- */
  .scene-banner { min-height: 0; height: 62vh; }
  .scene-banner > img, .scene-banner .scene-banner__img { height: 62vh; object-fit: cover; }
  .scene-banner__body { padding: 18px; }
  .scene-banner h1, .scene-banner .scene-banner__title { font-size: 26px; line-height: 1.25; }
  .scene-banner p { font-size: 14px; }
  .pdp-hero { padding: 18px 0 26px; }
  .pdp-hero__grid { display: block; }
  .pdp-hero h1 { font-size: 28px; }
  .pdp-hero__lead { font-size: 15px; }
  .pdp-hero__figure { margin-top: 16px; }
  .page-hero { padding: 34px 0 30px; }
  .page-hero h1 { font-size: 27px; }
  .page-hero p { font-size: 15px; }

  /* ---------- 按钮通栏 ---------- */
  .btn-row { flex-direction: column; align-items: stretch; gap: 10px; width: 100%; }
  .btn-row > .btn, .btn-row > a.btn, .btn-row > button.btn { width: 100%; justify-content: center; }
  .pdp-hero .btn-row, .page-hero .btn-row { margin-top: 18px; }
  form .btn, form .btn--lg, .form .btn { width: 100%; }
  .pdp-cta .btn-row { width: 100%; }

  /* ---------- 统计条 / 参数卡：两列 ---------- */
  .pdp-stats__grid { grid-template-columns: repeat(2, 1fr) !important; }
  .pdp-stat { padding: 14px 12px; }
  .pdp-stat strong { font-size: 20px; }
  .pdp-stat span { font-size: 12.5px; }
  .pdp-facts { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pdp-fact strong { font-size: 18px; }
  .pdp-spec-grid { grid-template-columns: 1fr 1fr !important; }
  .features--4, .features--3 { grid-template-columns: 1fr !important; }
  .features--2 { grid-template-columns: 1fr !important; }
  .feature { padding: 16px; }

  /* ---------- 产品卡片：双列 ---------- */
  .cards { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .card__body { padding: 12px; }
  .card__body h3 { font-size: 15px; line-height: 1.4; }
  .card__body .sub { font-size: 12.5px; }
  .card__link { font-size: 13px; }
  .card__dl li {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: 12.5px; line-height: 1.5; padding: 5px 0;
  }
  .card__dl li span:first-child { flex: 0 0 42%; color: #6c757e; }
  .card__dl li span:last-child { flex: 1 1 auto; text-align: right; font-weight: 600; }
  .cards--4 { grid-template-columns: repeat(2, 1fr) !important; }
  .card__media img { aspect-ratio: 3 / 2; object-fit: cover; }

  /* 锚点定位不被吸顶头挡住 */
  [id] { scroll-margin-top: 96px; }

  /* 底部固定条 + 浮动侧栏 -> 内容留白 */
  body.has-float-contact main { padding-bottom: 84px; }
  body.has-pdp-cta main { padding-bottom: 150px; }
  body.has-config-bar main { padding-bottom: 90px; }

  /* ---------- 页内导航：单行横滑 + 渐隐提示 ---------- */
  .pdp-nav { position: sticky; top: var(--header-h, 60px); z-index: 40; }
  .pdp-nav .container { position: relative; padding-right: 0; }
  .pdp-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 18px 2px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
  }
  .pdp-nav ul::-webkit-scrollbar { display: none; }
  .pdp-nav li { flex: 0 0 auto; scroll-snap-align: start; }
  .pdp-nav a { font-size: 14px; padding: 8px 2px; display: inline-block; }

  /* ---------- 配置参数表：隐藏「部位」列（由 JS 处理 DOM） ---------- */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table, .table-wrap table.spec { min-width: 0 !important; width: 100% !important; table-layout: fixed; }
  .table-wrap table.spec th, .table-wrap table.spec td {
    white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  }
  .table-wrap table.spec td:nth-child(1), .table-wrap table.spec th:nth-child(1) { width: 34px; }
  .table-wrap table.spec td:nth-child(2), .table-wrap table.spec th:nth-child(2) { width: 34%; }
  .table-wrap table.spec th, .table-wrap table.spec td { padding: 10px 8px; font-size: 13.5px; }
  .table-wrap table.spec th:nth-child(1), .table-wrap table.spec td:nth-child(1) { width: 44px; }

  /* ---------- 配置器：上下堆叠 + 底部固定提交 ---------- */
  .config { display: block; }
  .config__panel { width: 100%; }
  .config__summary { position: static; margin-top: 20px; padding: 18px; }
  .config__list { max-height: none; }
  .config__actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line, #e6e8eb);
    box-shadow: 0 -8px 24px -16px rgba(20, 24, 29, .35);
  }
  .config__actions .btn { width: 100%; }
  body.has-config-bar { padding-bottom: 74px; }

  /* ---------- 页脚 ---------- */
  .footer { padding-top: 34px; }
  .footer__grid { grid-template-columns: 1fr 1fr !important; gap: 22px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; gap: 8px; align-items: flex-start; font-size: 12px; }

  /* ---------- 底部联系条：保留 4 个图标，避让固定条 ---------- */
  .float-contact { bottom: 14px; right: 12px; gap: 8px; }
  .float-contact__item { width: 46px; height: 46px; }
  .float-contact__icon svg { width: 22px; height: 22px; }
  .float-contact__label { display: none; }
  body.has-config-bar .float-contact { bottom: 84px; }
  body.has-pdp-cta .float-contact { bottom: 84px; }

  /* ---------- 图片画廊 ---------- */
  .pdp-gallery__main img, .pdp-slider__stage img { border-radius: 12px; }
  .pdp-thumbs { gap: 8px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .pdp-thumb { flex: 0 0 auto; width: 72px; }
  .pdp-slider__thumbs { gap: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .pdp-slider__thumb { flex: 0 0 auto; width: 64px; }

  /* ---------- 视频 ---------- */
  .pdp-video video { border-radius: 12px; }
  .pdp-video__tabs { gap: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .pdp-video__tab { flex: 0 0 auto; font-size: 13px; padding: 8px 12px; }

  /* ---------- 表单 ---------- */
  .form-row { display: block; }
  .form-row .field { margin-bottom: 14px; }
  .field input, .field select, .field textarea { font-size: 16px; } /* 防 iOS 缩放 */

  /* ---------- 案例 / 工厂图集 ---------- */
  .gallery-grid, .case-grid { grid-template-columns: 1fr !important; }
  .showcase__stage img { border-radius: 12px; }
}

/* ==========================================================================
   滑块图片比例修正（追加块，优先级最高；仍只作用于 ≤768px）
   ========================================================================== */
@media (max-width: 768px) {
  .pdp-gallery__main, .pdp-slider__stage, .showcase__stage {
    overflow: hidden;
  }
  .pdp-gallery__main img,
  .pdp-slider__stage img,
  .showcase__stage img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 2 !important;
    object-fit: cover !important;
    object-position: center !important;
    background: transparent;
  }
  .pdp-gallery__main figcaption {
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
  }
  .pdp-gallery__arrow, .pdp-slider__arrow {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ==========================================================================
   移动端滑块体验修正（缩略图尺寸 / 悬浮条位置）
   ========================================================================== */
@media (max-width: 768px) {
  /* 缩略图：宽度收小，一行放得下 5 张，不裁切 */
  .pdp-slider__thumbs, .pdp-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 2px;
    scrollbar-width: none;
  }
  .pdp-slider__thumbs::-webkit-scrollbar, .pdp-thumbs::-webkit-scrollbar { display: none; }
  .pdp-slider__thumb { width: 60px !important; flex: 0 0 auto; }
  .pdp-slider__thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
  .pdp-thumb { width: 64px !important; flex: 0 0 auto; }
  .pdp-thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }

  /* 滑块底部留白，避免缩略图被底部固定条压住 */
  .pdp-gallery, .pdp-slider, .showcase { margin-bottom: 10px; }

  /* 悬浮联系条：移动端改为右侧竖排小圆，减少对图片遮挡 */
  .float-contact {
    flex-direction: column;
    right: 8px !important;
    bottom: 96px !important;
    gap: 8px !important;
  }
  .float-contact__item {
    width: 42px !important;
    height: 42px !important;
  }
  .float-contact__icon svg { width: 20px !important; height: 20px !important; }
  body.has-config-bar .float-contact { bottom: 150px !important; }
  body.has-pdp-cta .float-contact { bottom: 150px !important; }
}

/* ==========================================================================
   表格自适应（所有 table.spec，含不在 .table-wrap 内的）
   ========================================================================== */
@media (max-width: 768px) {
  table.spec {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed;
    font-size: 13.5px !important;
  }
  table.spec th, table.spec td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 9px 7px !important;
  }
  table.spec tbody th[colspan] { text-align: left; background: #f6f7f8; }
  table.spec thead th:first-child,
  table.spec tbody td:first-child,
  table.spec tbody th:first-child { min-width: 0 !important; width: auto !important; }
}

/* ==========================================================================
   悬浮联系条：手机端贴右侧竖排（修正居中/遮挡）
   ========================================================================== */
@media (max-width: 768px) {
  .float-contact {
    left: auto !important;
    right: 8px !important;
    transform: none !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 96 !important;
  }
  .float-contact__item {
    width: 42px !important;
    height: 42px !important;
    box-shadow: 0 6px 16px -6px rgba(20, 24, 29, .45);
  }
  body.has-pdp-cta .float-contact { bottom: 148px !important; }
  body.has-config-bar .float-contact { bottom: 148px !important; }
  body:not(.has-pdp-cta):not(.has-config-bar) .float-contact { bottom: 16px !important; }
}

/* ==========================================================================
   悬浮联系条最终定位：右侧垂直居中（不压底部按钮）
   ========================================================================== */
@media (max-width: 768px) {
  .float-contact {
    left: auto !important;
    right: 8px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 96 !important;
  }
  .float-contact__item { width: 40px !important; height: 40px !important; }
  .float-contact__icon svg { width: 19px !important; height: 19px !important; }
  /* 底部固定条存在时整体上移一点，避免压住缩略图 */
  body.has-pdp-cta .float-contact { top: 44% !important; }
}

/* ==========================================================================
   灯箱 / 图片放大：手机端严格居中，不被裁切
   ========================================================================== */
@media (max-width: 768px) {
  .lightbox { box-sizing: border-box; }
  .lightbox.is-open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px !important;
  }
  .lightbox img {
    position: static !important;
    max-width: calc(100vw - 28px) !important;
    max-height: 76vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    border-radius: 10px;
  }
  .lightbox__close {
    top: 12px !important;
    right: 12px !important;
    width: 42px !important;
    height: 42px !important;
  }
  .lightbox__nav {
    width: 40px !important;
    height: 40px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  .lightbox__nav--prev { left: 8px !important; }
  .lightbox__nav--next { right: 8px !important; }
}


/* 视频播放按钮：手机端大一些 */
@media (max-width: 768px) {
  .pdp-video__play { width: 64px !important; height: 64px !important; }
  .pdp-video__play svg { width: 28px !important; height: 28px !important; }
}

/* ==========================================================================
   手机端悬浮联系方式：改为底端横向悬浮条（覆盖以上所有规则）
   ========================================================================== */
@media (max-width: 768px) {
  .float-contact {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 12px !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    width: auto !important;
    padding: 7px 12px !important;
    background: rgba(255, 255, 255, .94) !important;
    backdrop-filter: saturate(180%) blur(10px);
    border-radius: 999px !important;
    box-shadow: 0 10px 30px -12px rgba(20, 24, 29, .35) !important;
    z-index: 96 !important;
  }
  .float-contact__item {
    width: 42px !important;
    height: 42px !important;
    box-shadow: none !important;
  }
  .float-contact__icon svg { width: 21px !important; height: 21px !important; }
  .float-contact__label { display: none !important; }

  /* 有底部固定条时整体上移，避免叠在一起 */
  body.has-pdp-cta .float-contact { bottom: 82px !important; }
  body.has-config-bar .float-contact { bottom: 88px !important; }

  /* 内容底部留白，避免最后一块被悬浮条盖住 */
  body.has-float-contact main { padding-bottom: 96px; }
  body.has-pdp-cta main { padding-bottom: 168px; }
  body.has-config-bar main { padding-bottom: 96px; }
}

/* ==========================================================================
   悬浮条定位覆盖（修 top:44% 造成的巨大白块）
   ========================================================================== */
@media (max-width: 768px) {
  body.has-pdp-cta .float-contact,
  body.has-config-bar .float-contact {
    top: auto !important;
    bottom: 82px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    height: auto !important;
  }
}

/* ==========================================================================
   产品外观图集（.gallery--product）：手机端 2 列 + 图注在图片下方
   ========================================================================== */
@media (max-width: 768px) {
  .gallery--product {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    justify-items: stretch !important;
  }
  .gallery--product .gallery__item { width: 100% !important; margin: 0 !important; }
  .gallery--product .gallery__item {
    aspect-ratio: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, #f2f4f6 100%);
  }
  .gallery--product .gallery__item img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: contain !important;
    padding: 6px !important;
    border-radius: 10px;
  }
  .gallery--product .gallery__cap {
    position: static !important;
    left: auto; bottom: auto;
    display: block;
    padding: 0 6px 8px !important;
    background: transparent !important;
    color: var(--ink, #14181d) !important;
    font-size: 12.5px !important;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    backdrop-filter: none !important;
  }
  /* 其它图集：图注字号收小，避免长文案溢出卡片 */
  .gallery__cap {
    font-size: 11.5px !important;
    max-width: calc(100% - 12px);
    line-height: 1.35;
  }
}

/* ==========================================================================
   手机端导航：产品中心折叠/展开（手风琴）
   ========================================================================== */
@media (max-width: 768px) {
  .nav-item .nav-sub { display: none !important; }
  .nav-item.is-open .nav-sub { display: grid !important; }
  /* 指示箭头 */
  .nav-item > a::before {
    content: "" !important;
    display: inline-block !important;
    order: 2;
    width: 6px; height: 6px;
    margin-left: 8px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .55;
    transition: transform .2s ease;
  }
  .nav-item.is-open > a::before {
    transform: rotate(-135deg) translateY(-2px);
  }
  .nav-item.is-open > a { color: var(--brand, #f08a00); }
}

/* ==========================================================================
   手机端导航子菜单：确保展开后文字可见（防止被其它规则置为不可见）
   ========================================================================== */
@media (max-width: 768px) {
  .nav-item.is-open .nav-sub {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    position: static !important;
    padding: 0 0 6px 16px !important;
    background: transparent !important;
  }
  .nav-item.is-open .nav-sub a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #262d35 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    padding: 11px 0 !important;
  }
}

/* ==========================================================================
   手机端顶栏：语言切换 + 汉堡菜单靠右
   ========================================================================== */
@media (max-width: 768px) {
  .header__inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  .brand { margin-right: auto !important; flex: 0 0 auto; }
  .header__actions {
    margin-left: auto !important;
    margin-right: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .lang-switch { margin-right: 0 !important; }
  .lang-switch__btn { height: 38px !important; padding: 0 10px !important; }
  .nav-toggle {
    margin-left: 0 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
  }
}

/* ==========================================================================
   底部联系图标：图标在圆钮内严格居中
   ========================================================================== */
@media (max-width: 768px) {
  .float-contact__item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  .float-contact__icon {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  .float-contact__icon svg {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
  }
}

/* ==========================================================================
   手机端配置参数：卡片式（原表格隐藏，仅手机生效）
   ========================================================================== */
@media (max-width: 768px) {
  table.spec[data-mobile-cards="1"] { display: none !important; }

  .spec-cards { display: block; }

  .spec-cards__group {
    margin: 22px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--brand, #f08a00);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #14181d);
    letter-spacing: .02em;
  }

  .spec-card {
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--line, #e6e8eb);
    border-radius: 12px;
    background: #fff;
  }
  .spec-card__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .spec-card__idx {
    flex: 0 0 auto;
    min-width: 16px;
    font-size: 11.5px;
    color: #9aa1a9;
    font-variant-numeric: tabular-nums;
  }
  .spec-card__name {
    flex: 1 1 auto;
    font-size: 14.5px;
    font-weight: 650;
    color: var(--ink, #14181d);
    line-height: 1.45;
  }
  .spec-card__qty {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--brand, #f08a00);
    font-weight: 600;
  }
  .spec-card__spec {
    margin-top: 5px;
    padding-left: 24px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #4a525c;
    overflow-wrap: anywhere;
  }
}

/* ==========================================================================
   手机端：去掉产品对比（勾选框 / 底部对比栏 / 对比面板）
   ========================================================================== */
@media (max-width: 768px) {
  .compare-toggle,
  #compareBar,
  #comparePanel,
  .compare-bar {
    display: none !important;
  }
}

/* ==========================================================================
   手机端隐藏指定区块（页面里给元素加 class="is-mobile-hidden" 即可）
   ========================================================================== */
@media (max-width: 768px) {
  .is-mobile-hidden { display: none !important; }
}
