/* ============================================
   移动端全站适配优化
   在 style.css 之后加载，覆盖桌面端样式
   ============================================ */

/* ---------- 全局基础 ---------- */
body.has-mobile-contact { padding: 0; }

@media (max-width: 991px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  body { padding: 0; }
  img { max-width: 100% !important; height: auto !important; }
  .container { width: 100% !important; padding-left: 15px; padding-right: 15px; }
  /* 防止固定宽度元素溢出 */
  .row, .clearfix { max-width: 100%; }
  table, .table { max-width: 100%; display: block; overflow-x: auto; }
  .owl-carousel .owl-item img { max-width: 100% !important; height: auto !important; }
}

/* ---------- 头部导航 ---------- */
@media (max-width: 991px) {
  header.transparentHeader { position: relative !important; top: 0 !important; background: #fff; }
  header.transparentHeader .navigation { padding: 10px 0; }
  header.transparentHeader .mobMenu i { background: #333; }
  .logo { float: left; margin: 0; max-width: 60%; }
  .logo img { max-height: 40px; width: auto; }
  .mobMenu { display: block !important; }
  .navigationTop { margin-top: 0 !important; }
  .nav-cta, .offcanvas-info-trigger, .offcanvas-search-trigger { display: none !important; }
}

/* 移动端遮罩菜单
   说明：完全用 display 控制显隐，不再依赖 top 滑动动画。
   menu 始终位于屏幕顶部(top:0)，打开时 display:block，关闭时 display:none，
   确保点击 .mobMenu 后菜单立即出现，不被过渡动画或 setTimeout 延迟卡住。 */
@media (max-width: 991px) {
  /* 遮罩层：透明、置于菜单之上、不拦截点击（关闭按钮除外） */
  .overLayMunu {
    display: block !important;
    z-index: 1001 !important;
    background: transparent !important;
    transition: none !important;
    pointer-events: none;
  }
  .navigation .col-sm-12 > .navigationTop > ul.topNAv {
    display: none;
    position: fixed;
    z-index: 1000;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    padding: 60px 20px 40px;
    transition: none;
  }
  .navigation .col-sm-12 ul.topNAv > li {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: normal !important;
    text-align: left !important;
    margin: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
  }
  .navigation .col-sm-12 ul.topNAv > li > a {
    display: block !important;
    padding: 14px 10px !important;
    font-size: 16px !important;
    font-weight: 500;
    color: #333 !important;
    text-transform: none !important;
  }
  /* 移动端下拉菜单展开 */
  .navigation .col-sm-12 ul.topNAv > li.dropDown > ul,
  .navigation .col-sm-12 ul.topNAv > li.megaDropDown > ul {
    display: block !important;
    position: static !important;
    left: 0 !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 0 0 15px !important;
  }
  .navigation .col-sm-12 ul.topNAv > li.dropDown > ul::before,
  .navigation .col-sm-12 ul.topNAv > li.dropDown > ul::after,
  .navigation .col-sm-12 ul.topNAv > li.megaDropDown > ul::before,
  .navigation .col-sm-12 ul.topNAv > li.megaDropDown > ul::after {
    display: none !important;
  }
  .subMenuBox {
    width: 100% !important;
    float: none !important;
    padding: 8px 0 !important;
  }
  .subMenuBox .blackHD {
    font-size: 14px !important;
    font-weight: 600;
    color: #333 !important;
    padding: 8px 10px !important;
    background: #f7f8fa !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
  }
  .linkBox li a {
    color: #555 !important;
    font-size: 14px !important;
    padding: 6px 10px !important;
    display: block;
  }
  .closeMenu {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 36px !important;
    z-index: 1002 !important;
    opacity: 1 !important;
    filter: invert(1);
    pointer-events: auto;
  }
}

/* ---------- Banner 轮播 ---------- */
@media (max-width: 991px) {
  .SliderOuter,
  .SliderOuter .bannerSlider,
  .SliderOuter .bannerSlider li,
  .SliderOuter .bannerSlider .owl-item {
    height: auto !important;
    min-height: 0 !important;
  }
  .SliderOuter .bannerSlider li img,
  .SliderOuter .bannerSlider .owl-item img,
  .bannerSlider.slider-fixheight .owl-item img {
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain;
  }
  .SliderOuter { padding: 0 !important; }
  .SliderOuter .slider-edge-overlay { display: none; }
}

/* ---------- 栏目/栅格布局 ---------- */
@media (max-width: 991px) {
  .row { margin-left: -10px !important; margin-right: -10px !important; }
  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
  .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
    width: 100% !important;
    float: none !important;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 20px;
  }
  /* 两列布局在平板保留 */
  .col-sm-6 { width: 50% !important; float: left !important; }
}
@media (max-width: 575px) {
  .col-sm-6 { width: 100% !important; float: none !important; }
}

/* ---------- 字体大小适配 ---------- */
@media (max-width: 991px) {
  body { font-size: 14px; }
  h1 { font-size: 24px !important; line-height: 1.4; }
  h2 { font-size: 20px !important; line-height: 1.4; }
  h3 { font-size: 18px !important; }
  h4 { font-size: 16px !important; }
  p { font-size: 14px; line-height: 1.7; }
}
@media (max-width: 575px) {
  h1 { font-size: 20px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }
}

/* ---------- 通用间距优化 ---------- */
@media (max-width: 991px) {
  section { padding: 40px 0 !important; }
  .section-title { margin-bottom: 25px !important; }
  .section-title h2 { font-size: 22px !important; }
  .section-title p { font-size: 14px; }
}

/* ---------- 按钮/触控优化 ---------- */
@media (max-width: 991px) {
  .btn, input[type=submit], button {
    min-height: 44px;
    min-width: 44px;
    font-size: 15px;
  }
  a { -webkit-tap-highlight-color: transparent; }
}

/* ---------- 页脚 ---------- */
@media (max-width: 991px) {
  footer { padding: 30px 0 20px; }
  .copyRight { text-align: center; }
  .copyRight p { font-size: 12px; }
}

/* ---------- 表格横向滚动 ---------- */
@media (max-width: 991px) {
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- 视频/iframe ---------- */
@media (max-width: 991px) {
  iframe, video { max-width: 100% !important; }
  .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
  .video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}

/* ---------- 移动端底部联系栏（首页内嵌版与全站共享脚本版共用） ---------- */
/* 统一字体：避免各页继承 body 字体不同（首页 Microsoft Yahei / 其他页 Raleway）导致差异 */
.mobile-contact-bar, .mobile-wechat-modal { font-family: "Microsoft Yahei", sans-serif; }
.mobile-contact-bar { display: none; }
.mobile-wechat-modal[hidden] { display: none !important; }
.mobile-wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
}
.mobile-wechat-dialog {
  position: relative;
  width: min(86vw, 340px);
  padding: 28px 24px 24px;
  border-radius: 14px;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.mobile-wechat-dialog h2 { margin: 0 44px 20px; color: #222; font-size: 22px; }
.mobile-wechat-dialog img { display: block; width: 220px; max-width: 100%; margin: 0 auto; padding: 10px; background: #fff; }
.mobile-wechat-dialog p { margin: 16px 0 0; color: #666; font-size: 14px; }
.mobile-wechat-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 22px;
  cursor: pointer;
}
body.mobile-wechat-open { overflow: hidden; }

@media (max-width: 991px) {
  body.has-mobile-contact { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .mobile-contact-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    display: flex;
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.16);
  }
  .mobile-contact-btn {
    display: flex;
    flex: 1 1 50%;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 50%;
    height: 56px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-contact-btn:hover, .mobile-contact-btn:focus { color: #fff; text-decoration: none; }
  .mobile-contact-btn i { font-size: 20px; }
  .mobile-call-btn { background: #e60012; }
  .mobile-wechat-btn { background: #07b55b; }
}
