/* ============================================================
   响应式增强（移动端 / 平板）— 在 style.css / service.css / product.css 之后加载
   目的：修复首页强制 1400px 横向溢出、移动端菜单、页脚堆叠、顶栏换行等
   ============================================================ */

/* 全局防横向溢出（兜底，根因已修复：首页 ft-qr 旧 margin-left:1400px 已移除） */
html,body{max-width:100%;}
body{overflow-x:hidden;}

/* ===== 顶栏：窄屏换行居中，避免长文本撑破布局 ===== */
@media(max-width:768px){
  .topbar .container{
    flex-wrap:wrap;justify-content:center;gap:2px 12px;
    height:auto;padding:8px 12px;font-size:12px;line-height:1.5;
  }
  .topbar .container span{text-align:center;}
}

/* ===== 导航：移动端菜单展开后白底黑字，子菜单可见 ===== */
@media(max-width:768px){
  /* 菜单展开态：白底 + 深色文字（原 .menu>li>a 为白字，会白底白字不可见） */
  .menu{background:#fff;box-shadow:0 12px 28px rgba(0,0,0,.12);}
  .menu>li>a{color:var(--navy)!important;opacity:1!important;padding:14px 20px;font-size:16px;}
  .menu>li>a:hover{color:#5a1480!important;}
  .menu>li.active>a{color:var(--red)!important;}
  /* 子菜单（下拉）在移动端展开显示 */
  .menu.open .dropdown{display:block!important;position:static;box-shadow:none;border:0;background:#f7f7fa;}
  .menu.open .dropdown a{color:var(--navy);padding:10px 18px 10px 36px;font-size:14px;}
  .menu.open .dropdown a:hover{background:#efe7f5;color:var(--red);}
  /* 窄屏收起“搜索”按钮，避免与品牌/汉堡拥挤 */
  .nav-right{margin-left:8px;}
}
@media(max-width:480px){
  .nav-right{display:none;}
  .brand{font-size:17px;}
}

/* ===== 页脚：窄屏纵向堆叠，二维码居中，去掉负 margin ===== */
@media(max-width:768px){
  .footer .container{
    flex-direction:column;
    align-items:stretch;
    gap:28px;
  }
  .footer .ft-hotline{
    flex:1 1 auto;min-width:0;margin-left:0!important;text-align:center;
  }
  .footer .ft-hotline-num{font-size:24px;}
  .footer .cols{grid-template-columns:1fr 1fr;gap:24px;}
  .footer .ft-qr{
    margin:0 auto!important;text-align:center;
  }
  .footer .ft-qr img{margin:0 auto;}
}
@media(max-width:480px){
  .footer .cols{grid-template-columns:1fr;gap:20px;}
}

/* ===== 通用区块内边距收窄（手机更紧凑） ===== */
@media(max-width:768px){
  .section{padding:44px 0;}
  .section-title{font-size:24px;}
  .container{padding:0 14px;}
}

/* ===== 下载/留言等下拉选择：窄屏不撑破 ===== */
@media(max-width:768px){
  .dl-select{min-width:0!important;width:100%!important;font-size:16px;}
}

/* ===== 首页整屏（fp-mobile）：同样禁止横向溢出 ===== */
html.is-home.fp-mobile body{overflow-x:hidden;}
