/* ============================================================
   huipaicc.com H5 响应式适配
   原则：仅在小屏(<=1024px)生效，PC 端(>1024px)完全不受影响。
   原 1100px 固定宽度布局保持不变，此处只做移动端流式覆盖。
   ============================================================ */

/* ---------- 平板与手机通用 (<=1024px) ---------- */
@media (max-width: 1024px) {

  html, body {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  /* 兜底：清除固定最小宽度，任何元素不得强制超过视口；
     max-width:100% 对正常元素无害，只约束少数写死宽度的老模板块 */
  body * { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
  html, body { max-width: 100% !important; overflow-x: hidden !important; }
  .center, .plc, .right_main, .base_con, .gsjs, .gsjstext, .gwlc, .lxwmer { float: none !important; }

  /* 所有固定宽度容器改为流式 */
  .top, .head, .nav, .container, .linkswrap .links,
  .block1, .block2, .block3, .block4, .hotprobox,
  .subpic, .fixin, .ny_banner, .ny_content, .pro_content,
  .horproBox, .pro_add, .proshow, .pages_espcms_width_content,
  .fottter_width_str, .tter, .ttertext, .tter ul, .login,
  .fNav, .fNavin, .yqljy, .footer, .foot,
  .center, .plc, .right_main, .base_con, .page_title, .gsjs, .gsjstext,
  .gwlc, .gwlcnei, .gwlctext, .gwlctu, .lxwmer, .page_head,
  .ys, .ysyi, .ysyiz, .ysyiy, .ysyiyte, .ysyiw,
  .footer_str, .icon_logo, .flink-links, .daohang, .dhlogo,
  .pro_conty, .news_conty, .article_conty, .case_conty,
  .page_conty, .search_conty, .list-ad-01, .list-ad-01 ul,
  .content, .wrap, .w, .main, .mainbox, .listbox, .detailbox {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* 顶部条 */
  .topwrap { height: auto; }
  .top { text-align: center; line-height: 1.8; padding: 6px 10px; }
  .top > p, .top > a, .top > span { float: none !important; display: inline-block; width: auto !important; margin: 0 6px; }
  .top marquee { width: 90% !important; }
  #addHomePage { display: inline-block; }

  /* 头部：logo / 搜索 / 电话 竖向堆叠 */
  .head { height: auto !important; padding: 12px 10px; }
  .head > div { float: none !important; }
  .logo { display: block; width: 100%; text-align: center; margin-bottom: 12px; }
  .logo img { max-width: 200px; height: auto; }
  .searchbox { width: 100% !important; margin: 0 0 12px 0 !important; }
  .search b { width: calc(100% - 92px) !important; }
  .search .iptxt { width: 96% !important; }
  .search .ipbtn { width: 88px !important; }
  .tel { float: none !important; width: 100% !important; height: auto !important; text-align: center;
         background: none !important; padding: 0 !important; }
  .tel p { line-height: 1.6; }
  .tel big { font-size: 26px; line-height: 1.3; }

  /* 导航：隐藏 mega 菜单与侧栏下拉，改为横向可滚动主导航 */
  .navwap { height: auto !important; overflow: visible; }
  .nav { height: auto !important; position: static !important; padding: 0; }
  .navside, .navsideB, .snavbox, .snavin, .nav_bj { display: none !important; }
  .navin { display: flex !important; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
           width: 100% !important; }
  .navin li { float: none !important; flex: 0 0 auto; width: auto !important; }
  .navin li > a { display: block; width: auto !important; padding: 0 14px; white-space: nowrap; font-size: 15px; }
  .navin li div { display: none !important; }
  .scroll_menu { left: 0 !important; margin: 0 !important; }

  /*  banner / 焦点图：原图为宽幅宣传图，按比例整图显示不裁切。
      li 内部是绝对定位(脱离文档流)，必须给 .banner 显式比例高度，
      否则高度塌陷，.syarrows 指示器会掉到导航下方。 */
  .ad_body { width: 100%; overflow: hidden; }
  .banner { height: 52vw !important; min-height: 160px; max-height: 320px; width: 100% !important; float: none !important; }
  .banner ul, .banner li, .banner li > a { height: 100% !important; width: 100% !important; }
  .banner li { background-size: contain !important; background-position: center center !important; }
  .banner li img, .banner li .jzimg { width: 100% !important; height: auto !important; max-width: 100% !important; }
  .bannerWord img { max-width: 100% !important; height: auto !important; }
  .bannerWord { width: 100% !important; height: auto !important; }
  .syarrows { bottom: 8px !important; z-index: 5; }

  /* 隐藏 PC 端漂浮广告/侧边工具条：小屏上会遮挡内容且定位错乱 */
  .fixbox, .lsideBar, .scroll_menu, .side { display: none !important; }
  /* 导航右侧"正品低价+电话"促销图，窄屏会错到导航下方，隐藏（头部已有完整电话） */
  .nav_tg { display: none !important; }

  /* 图片通用自适应：防溢出 */
  img { max-width: 100% !important; height: auto; }
  .jzimg { max-width: 100% !important; }

  /* 产品/文章列表：float 块改流式，多列改单/双列 */
  .l_advbox, .hotprolist li, .prolist li, .newslist li, .caselist li,
  .product-item, .pro_item, .list-item {
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 12px 0 !important;
    float: none !important;
  }
  .hotprolist, .prolist, .newslist, .caselist { width: 100% !important; }
  .hotprolist ul, .prolist ul { width: 100% !important; }
  .hotprolist li { height: auto !important; padding: 10px !important; border: 1px solid #e3e3e3 !important; }
  .hotprolist li img, .prolist li img { max-width: 100% !important; height: auto !important; }

  /* 首页广告区块：原 @media 内仍是固定宽，这里强制流式并允许换行 */
  .list-ad-01 li, .list-ad-01 li div,
  .ad_01, .ad_02, .adtext { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .list-ad-01 ul { display: flex; flex-wrap: wrap; }
  .list-ad-01 li { float: none !important; height: auto !important; }
  .ad_01, .ad_02 { background-size: cover !important; min-height: 100px; }

  /* 左右两栏布局：堆叠为单列 */
  .fl, .fr, .f_left, .f_right, .left, .right, .sidebar, .main_col {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
    margin-bottom: 14px;
  }
  /* 关于我们等单页的多列图文块：用属性选择器一次性覆盖所有 ys* 变体 */
  [class^="ys"], [class*=" ys"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  [class^="ys"] img, [class*=" ys"] img { max-width: 100% !important; height: auto !important; }
  .ysyiyte h2, .ysyiyte span { max-width: 100%; overflow-wrap: break-word; }
  /* 单页里写死的左缩进与右侧绝对定位装饰图 */
  .yser, .ysertext { padding-left: 0 !important; margin-left: 0 !important; }
  .ysertext H2, .ysertext h2 { font-size: 20px !important; }
  /* gwlcnei 是富文本块，含 inline width:1000px 与绝对定位装饰图，移动端收窄并隐藏装饰 */
  .gwlcnei { width: 100% !important; max-width: 100% !important; }
  .gwlcnei div { position: static !important; }
  .gwlcnei > div, .gwlcnei img { max-width: 100% !important; }

  /* 页脚多列：堆叠 */
  .fNav .fNavin > div, .fNavin dl, .fNavin .f_nav_col {
    float: none !important; width: 100% !important; box-sizing: border-box; margin-bottom: 10px;
  }
  .yqlj, .yqljy, .linkswrap { width: 100% !important; }

  /* 面包屑：允许换行完整显示，去掉固定45%宽与省略 */
  .bread { height: auto !important; line-height: 1.8 !important; padding: 6px 0; }
  .bread .bread_l, .bread .bread_r {
    float: none !important; display: block !important;
    width: 100% !important; max-width: 100% !important;
    margin: 0 !important; padding: 2px 10px !important;
    white-space: normal !important; text-overflow: clip !important; overflow: visible !important;
    box-sizing: border-box;
  }
  .bread .bread_r { text-align: left !important; }

  /* 产品详情：图片与放大镜区强制不溢出 */
  .pro_left, .pro_right, .magnifierView, .magnifierImg,
  .proshow, .pro_img, #zoom { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .magnifierView .vm, .magnifierView .vm img,
  .pro_left .pro_img img, #zoom img { max-width: 100% !important; height: auto !important; }
  .pro_left { position: relative !important; }

  /* 表格：横向滚动，避免撑破 */
  table { max-width: 100%; }
  .article_conty table, .content table, .news_conty table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 正文富文本内嵌样式兜底 */
  .article_conty, .news_conty, .case_conty, .content, .detailbox {
    font-size: 15px; line-height: 1.8; overflow-wrap: break-word; word-wrap: break-word;
  }
  .article_conty p, .news_conty p { max-width: 100%; }
  /* 单页富文本里的长英文/连续文字：强制断行，避免被裁 */
  .gsjstext, .gwlctext, .ysertext, .base_con, .detailbox,
  .article_conty, .news_conty { overflow-wrap: break-word !important; word-break: break-word !important; white-space: normal !important; }
  .gsjstext *, .gwlctext *, .ysertext * { max-width: 100% !important; overflow-wrap: break-word !important; word-break: break-word !important; }
}

/* ---------- 手机 (<640px) ---------- */
@media (max-width: 640px) {
  .top { font-size: 12px; }
  .tel big { font-size: 22px; }
  .navin li > a { font-size: 14px; padding: 0 10px; }
  .head, .top, .nav, .container, .block2, .block3, .block4 { padding-left: 8px; padding-right: 8px; }
  .banner, .banner li { min-height: 130px; }
  .hotprolist li { padding: 8px !important; }
  .fNav { font-size: 13px; }

  /* 侧边悬浮客服在移动端缩小 */
  .side { transform: scale(0.8); transform-origin: right center; }
}

/* ---------- 超小屏 (<380px) ---------- */
@media (max-width: 380px) {
  .tel big { font-size: 20px; }
  .search .ipbtn { width: 74px !important; }
  .search b { width: calc(100% - 76px) !important; }
}
