/**
 * 官网首页手机「整体缩放」（仅 html.official-home-scale + body.official-home-body）
 * PC（无此类名 / ≥769）样式零改动。
 *
 * 双保险：
 * 1) 首页窄屏 viewport=1280 → 浏览器整页缩小 PC 布局
 * 2) 若 WebView 仍按 device-width：.bce-page { zoom: 100vw/1280 } 再缩一次
 */

html.official-home-scale {
  --official-home-design: 1280;
  --official-home-scale: calc(100vw / 1280);
  /* viewport=1280 时布局像素需放大，缩小后视觉约等于正常手机顶栏/底栏 */
  --ops-tabbar-h: 168px;
  --ops-head-h: 148px;
}

html.official-home-scale body.official-home-body {
  overflow-x: hidden !important;
  padding-bottom: calc(var(--ops-tabbar-h) + env(safe-area-inset-bottom, 0px)) !important;
}

@media screen and (max-width: 768px) {
  /* 壳：PC 宽 + zoom（viewport 已是 1280 时 zoom≈1；未生效时仍能缩） */
  html.official-home-scale body.official-home-body .bce-page {
    width: 1280px !important;
    max-width: none !important;
    min-width: 1280px !important;
    box-sizing: border-box !important;
    zoom: calc(100vw / 1280);
  }

  @supports not (zoom: 1) {
    html.official-home-scale body.official-home-body .bce-page {
      zoom: normal;
      transform: scale(var(--official-home-scale));
      transform-origin: top left;
    }
  }

  html.official-home-scale #official-home-campaign {
    font-size: calc(100vw / 120) !important;
    min-width: 1280px !important;
    width: 1280px !important;
    max-width: none !important;
  }

  html.official-home-scale .official-site-footer,
  html.official-home-scale .official-home-footer,
  html.official-home-scale footer.cloud-footer.bce-foot {
    display: none !important;
  }

  html.official-home-scale .bce-float-sidebar {
    display: none !important;
  }

  /* 顶栏放大（缩放后可点） */
  html.official-home-scale .bce-head,
  html.official-home-scale header.bce-head {
    min-height: var(--ops-head-h) !important;
  }
  html.official-home-scale .bce-head-inner,
  html.official-home-scale .bce-head-inner--full {
    min-height: var(--ops-head-h) !important;
    padding: 0 28px !important;
    gap: 20px !important;
    box-sizing: border-box !important;
  }
  html.official-home-scale .bce-head-logo-text {
    font-size: 40px !important;
    max-width: none !important;
  }
  html.official-home-scale .bce-head-logo img,
  html.official-home-scale .bce-head-logo svg {
    width: 68px !important;
    height: 68px !important;
  }
  html.official-home-scale .bce-head-nav,
  html.official-home-scale .bce-head-search-inline {
    display: none !important;
  }
  html.official-home-scale .bce-head-menu {
    display: flex !important;
  }
  html.official-home-scale .bce-head-menu button,
  html.official-home-scale .bce-head-right [data-chat-popup-open],
  html.official-home-scale .bce-head-right a,
  html.official-home-scale .bce-head-right button {
    min-width: 84px !important;
    min-height: 84px !important;
  }
  html.official-home-scale .bce-head-menu svg,
  html.official-home-scale .bce-head-right svg {
    width: 52px !important;
    height: 52px !important;
  }

  /* 底栏在 .bce-page 外，不受 zoom；viewport=1280 时需大尺寸 */
  html.official-home-scale .bce-m-tabbar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1200 !important;
    width: 100% !important;
    height: calc(var(--ops-tabbar-h) + env(safe-area-inset-bottom, 0px)) !important;
    padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-top: 2px solid rgba(15, 23, 42, 0.08) !important;
  }
  html.official-home-scale .bce-m-tabbar__item {
    font-size: 32px !important;
    gap: 6px !important;
    line-height: 1.15 !important;
  }
  html.official-home-scale .bce-m-tabbar__ico {
    width: 56px !important;
    height: 56px !important;
  }
}

@media screen and (min-width: 769px) {
  html.official-home-scale body.official-home-body .bce-page {
    width: auto !important;
    min-width: 0 !important;
    zoom: normal !important;
    transform: none !important;
    margin-bottom: 0 !important;
  }
  html.official-home-scale .bce-m-tabbar {
    display: none !important;
  }
}
