/**
 * 前台移动端覆盖层（加载于 app.css 之后）
 * 主断点：991.98px（与 -mb: 工具类一致）
 */

/* —— 全局防横向溢出 —— */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

/* —— 移动菜单遮罩 —— */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.nav-backdrop.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 991.98px) {
  /* Header 紧凑顶栏 */
  #app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 1px 0 rgba(32, 54, 110, 0.08);
  }

  #app-header .header-box,
  #app-header .navbar {
    min-height: 56px;
  }

  #app-header .navbar-brand {
    max-width: calc(100% - 52px);
  }

  #app-header .title-logo .i-image,
  #app-header #logo img {
    max-height: 40px;
    width: auto;
  }

  #app-header .navbar-toggler {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #1f2a44;
    box-shadow: none;
  }

  #app-header .navbar-toggler:focus {
    outline: 2px solid rgba(64, 102, 184, 0.35);
    outline-offset: 2px;
  }

  /* 侧滑抽屉 */
  #app-header #navbarSupportedContent {
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
    width: min(312px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 8px 16px 24px !important;
    background: #fff !important;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%) !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #app-header #navbarSupportedContent.is-open {
    transform: translateX(0) !important;
  }

  #app-header #navbarSupportedContent .menu-close {
    display: flex !important;
    justify-content: flex-end;
    padding: 8px 0 4px;
  }

  #app-header #navbarSupportedContent .menu-close i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f6fb;
    font-size: 16px !important;
  }

  #app-header #navbarSupportedContent .navbar-nav {
    width: 100%;
    margin: 8px 0 16px !important;
    gap: 0;
  }

  #app-header #navbarSupportedContent .nav-item {
    width: 100%;
    border-bottom: 1px solid #eef2f7;
  }

  #app-header #navbarSupportedContent .nav-link {
    display: block;
    padding: 14px 4px !important;
    font-size: 16px;
    font-weight: 650;
    color: #1f2a44 !important;
    line-height: 1.35;
  }

  #app-header #navbarSupportedContent .serbox {
    width: 100% !important;
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
  }

  #app-header #navbarSupportedContent #search-form {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #app-header #navbarSupportedContent .search_input,
  #app-header #navbarSupportedContent #search_input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border-radius: 10px;
  }

  #app-header #navbarSupportedContent #searchbtn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  /* 容器内边距收紧 */
  .app-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .mx-_interval {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Banner：小屏降低过高比例、去掉 coverflow 留白风险 */
  #banner-swiper,
  .banner-swiper,
  .index-banner {
    overflow: hidden;
  }

  [class*="pt-[21%]"],
  .index-banner .swiper,
  #banner-swiper {
    border-radius: 0;
  }

  /* 首页区块间距 */
  .index-about {
    padding: 40px 0 48px !important;
  }

  .index-title-wrap .index-title {
    font-size: clamp(1.25rem, 5vw, 1.6rem) !important;
  }

  .equipment-content,
  .inspection-content,
  .previous-content {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  /* 轮播箭头内收，避免撑出视口 */
  .swiper-container-wrapper {
    padding: 0 28px;
  }

  .swiper-navigation .swiper-button-next,
  .swiper-navigation .swiper-button-prev {
    width: 32px !important;
    height: 44px !important;
    margin-top: -22px !important;
  }

  .swiper-navigation .swiper-button-next {
    right: 0 !important;
  }

  .swiper-navigation .swiper-button-prev {
    left: 0 !important;
  }

  /* 产品列表：侧栏置顶折叠感 */
  #product-content .content {
    gap: 16px;
  }

  #product-content .left-nav-list,
  #product-content .left-nav {
    position: static !important;
    height: auto !important;
    max-height: none !important;
  }

  #product-content .product-card:hover {
    transform: none;
  }

  /* 页脚 */
  #app-footer .form-item.ft-captcha-row {
    flex-wrap: wrap;
  }

  #app-footer .ft-captcha-row .i-input {
    flex: 1 1 140px !important;
    min-width: 0;
  }

  #app-footer .ft-captcha-row img {
    height: 40px !important;
    max-width: 120px;
  }

  #app-footer .ft-company .name {
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
  }

  #app-footer .ft-contact {
    gap: 6px;
  }

  #app-footer .ft-contact a,
  #app-footer .ft-contact div {
    word-break: break-all;
  }

  /* 内容页表格横向滚动容器 */
  .details-body,
  .content-box,
  .news-detail-content,
  .page-content,
  .related-products {
    max-width: 100%;
  }

  .details-body table,
  .content-box table,
  .news-detail-content table,
  .page-content table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 悬浮询价面板小屏全宽底部抽屉感 */
  .fixedBox {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .fixedBox .box {
    max-height: min(85vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 分页/按钮触控区域 */
  .btn,
  button.btn,
  .action-btn,
  .page-link {
    min-height: 40px;
  }
}

@media (max-width: 640px) {
  .app-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #product-content .content-list .item {
    margin-bottom: 12px;
  }

  #product-content .product-card .image_box img {
    padding: 10px;
  }

  .index-about .ia-stats {
    gap: 10px !important;
  }

  .index-about .ia-stat {
    padding: 12px 10px !important;
  }

  .index-about .ia-stat strong {
    font-size: 1.15rem !important;
  }

  .index-news .news-text-wrap {
    height: auto !important;
    min-height: 120px;
  }

  /* 首页推荐产品标题更紧凑 */
  .index-category .item .title,
  .index-category .model {
    font-size: 13px;
    line-height: 1.4;
  }
}

@media (max-width: 479.98px) {
  #app-header .title-logo .i-image,
  #app-header #logo img {
    max-height: 34px;
  }

  .swiper-container-wrapper {
    padding: 0 22px;
  }
}
