/* ==========================================================================
   海丽应急官网 · 响应式覆盖层
   仅在 <= 768px 生效，PC 端完全不加载任何规则 —— 保证桌面 1:1 视觉零变化。
   骨架 HTML 与原有 CSS/JS 均不改动，本文件由 render.php 在 </head> 前注入。
   ========================================================================== */
@media screen and (max-width: 768px) {

  /* ---------- 1. 基线：杜绝横向滚动 ---------- */
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
  }
  *, *::before, *::after { box-sizing: border-box !important; }

  body, div, section, article, header, footer, nav, ul, ol, li,
  dl, dt, dd, p, h1, h2, h3, h4, h5, h6, table, form {
    max-width: 100% !important;
  }

  /* 原站大量固定宽度容器（.content / .h_con / inline width:1200px） */
  .content, .h_con, .header, .footer, .nav, .nav_con, .main, .wrap,
  .container, .w1200, .w1000, .blk, .blk-sm, .con, .con_wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  [style*="width:1200"], [style*="width: 1200"],
  [style*="width:1100"], [style*="width: 1100"],
  [style*="width:1000"], [style*="width: 1000"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ---------- 2. 图片 / 视频 / 表格 ---------- */
  img, video, canvas, svg {
    max-width: 100% !important;
    height: auto !important;
  }
  iframe, embed, object {
    max-width: 100% !important;
    width: 100% !important;
  }
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  table td, table th { white-space: normal !important; }

  /* ---------- 3. 取消左右浮动，改为纵向堆叠 ---------- */
  [class~="fl"], [class~="fr"],
  .fl, .fr, .left, .right,
  [class*="-l "], [class*="-r "] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 14px 0 !important;
    display: block !important;
  }

  /* 常见的左右分栏（首页 new_l / new_r、cg_l / cg_r 等） */
  [class*="new_l"], [class*="new_r"],
  [class*="cg_l"],  [class*="cg_r"],
  [class*="pro_l"], [class*="pro_r"],
  [class*="case_l"],[class*="case_r"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* ---------- 4. 导航：折叠为可横向滚动的条 ---------- */
  .nav ul, .h_nav ul, .nav_con ul, .f_nav ul,
  .header ul, .footer ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
    scrollbar-width: none;
  }
  .nav ul::-webkit-scrollbar, .h_nav ul::-webkit-scrollbar,
  .f_nav ul::-webkit-scrollbar { display: none; }
  .nav li, .h_nav li, .nav_con li, .f_nav li {
    flex: 0 0 auto !important;
    float: none !important;
    white-space: nowrap !important;
    margin: 0 14px 0 0 !important;
  }
  .nav a, .h_nav a, .nav_con a { font-size: 14px !important; }

  /* 下拉菜单在移动端改为静态展开（避免 hover 不可用） */
  .nav li ul, .h_nav li ul, .nav_con li ul {
    position: static !important;
    display: none !important;
  }

  /* ---------- 5. 列表条目：图左文右 -> 上下堆叠或紧凑横排 ---------- */
  dl, .p14-infolist-1-list dl, .p15-infolist-1 dl {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin: 0 0 18px 0 !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid #eee;
  }
  .p14-infolist-1-list dt, .p15-infolist-1 dt {
    width: 108px !important;
    flex: 0 0 108px !important;
    float: none !important;
    margin: 0 !important;
  }
  .p14-infolist-1-list dt img { width: 108px !important; height: 78px !important; object-fit: cover; }
  .p14-infolist-1-list dd, .p15-infolist-1 dd {
    flex: 1 1 calc(100% - 120px) !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
  }
  .p14-infolist-1-list h4, .p15-infolist-1 h4 { font-size: 15px !important; line-height: 1.5 !important; }
  .p14-infolist-1-list-desc, .p15-infolist-1-t1-desc,
  .p14-infolist-1-list-deta { font-size: 13px !important; line-height: 1.65 !important; }
  .p14-infolist-1-list-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }

  /* ---------- 6. 正文排版 ---------- */
  [class*="endit-content"], [class*="infocontent"], [class*="aboutinfo"],
  [class*="prodcontent"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 0 !important;
    font-size: 16px !important;
    line-height: 1.85 !important;
    overflow-x: auto !important;
  }
  [class*="endit-content"] p,
  [class*="endit-content"] span,
  [class*="endit-content"] div {
    font-size: 16px !important;
    line-height: 1.85 !important;
    text-indent: 0 !important;
    max-width: 100% !important;
  }
  [class*="endit-content"] img { display: block; margin: 12px auto !important; }
  h1, h2 { font-size: 22px !important; line-height: 1.4 !important; }
  h3 { font-size: 19px !important; line-height: 1.4 !important; }
  h4, h5 { font-size: 16px !important; }

  /* ---------- 7. 首页 / 栏目页常见栅格 ---------- */
  .new_list, .news_t, .new_s, .cg_s, .cg_con, .case_con, .pro_t,
  [class*="infolist"], [class*="prodlist"], [class*="projectlist"] {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .news_t p, .new_s p, .cg_s p { white-space: normal !important; }
  .news_t p a, .new_s p a, .cg_s p a { font-size: 14px !important; line-height: 1.7 !important; }

  /* 产品/项目卡片：一行 2 个 */
  [class*="prolist"] li, [class*="prodlist"] li,
  [class*="caselist"] li, [class*="cglist"] li,
  .pro_t li, .case_con li {
    width: 48% !important;
    float: none !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 1% 14px !important;
  }

  /* ---------- 8. 分页 ---------- */
  [class*="pagination"] { width: 100% !important; text-align: center !important; }
  [class*="pagination"] a { display: inline-block !important; padding: 6px 10px !important; font-size: 14px !important; }

  /* ---------- 9. 表单 ---------- */
  input[type="text"], input[type="tel"], input[type="email"],
  textarea, select {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important;   /* 防止 iOS 聚焦时自动放大 */
    box-sizing: border-box !important;
  }
  .form_item, .form-group { width: 100% !important; }

  /* ---------- 10. 隐藏 PC 端专属元素 ---------- */
  .pc_only, .f_fixed, .side_bar, .float_qq, .kf, .online_qq,
  [class*="gotop"], [class*="fixed-right"], [class*="erweima"] {
    display: none !important;
  }
  .wow { visibility: visible !important; animation: none !important; opacity: 1 !important; }

  /* ---------- 11. 页脚 ---------- */
  .footer, .f_nav, .footer .content {
    width: 100% !important;
    text-align: center !important;
  }
  .footer p, .footer a { font-size: 13px !important; line-height: 1.8 !important; }
}


/* ==========================================================================
   中间宽度适配层（769–1199px）· 方案 A
   PC 骨架是 1200px 固定版式，强行把内部容器改成 100% 会破坏轮播 / 导航的
   浮动与绝对定位。这里不动任何内部布局，由注入的缩放脚本把整页等比缩到
   视口宽（视觉 1:1）。CSS 只做兜底：消除横向滚动、隐藏压正文的悬浮客服条。
   仅在 769–1199px 生效；>=1200px 与 <=768px 零影响。
   ========================================================================== */
@media screen and (min-width: 769px) and (max-width: 1199px) {
  html {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* 右侧悬浮客服条在窄屏会压住正文；>=1200px 仍保留 */
@media screen and (max-width: 1199px) {
  .client-2 { display: none !important; }
}
