/* ============================================================
   优车卡酷主题 - 移动端响应式统一补丁
   版本：20261014（横向溢出修复版）
   ------------------------------------------------------------
   本文件为 responsive-fix.css 的完整替代版本。
   因无法通过 functions.php 修改版本号，文件名已改为
   responsive-fix-v2.css —— 文件名不同即为新 URL，
   浏览器必然重新下载，不受旧 ver= 参数与 12 小时缓存影响。

   安装位置（与原文件同一目录）：
   /wp-content/themes/yckk-theme/assets/images/

   ============================================================ */

/* ============ 1. Logo（裁剪右侧黄色文字，仅保留图标+品牌字） ============ */
.headerArea .logo {
  width: 180px !important;
  max-width: 180px !important;
  overflow: hidden !important;
  height: auto !important;
  line-height: 1 !important;
}
.headerArea .logo img {
  display: block !important;
  height: 61px !important;
  width: 449px !important;
  max-width: none !important;
}
@media (max-width: 480px) {
  .headerArea .logo {
    width: 150px !important;
    max-width: 150px !important;
  }
}
@media (min-width: 993px) {
  .headerArea .logo {
    width: 250px !important;
    max-width: 250px !important;
  }
}

/* ============ 2. 页脚移动端布局 ============ */
@media (max-width: 992px) {
  .footerT .navB {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  .footerT .navB dl {
    float: none !important;
    width: 48% !important;
    padding-left: 0 !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
  }
  .footerT .navB dl dt {
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    color: #fff !important;
    position: relative !important;
  }
  .footerT .navB dl dt::after {
    width: 30px !important;
    height: 2px !important;
    background: #01913a !important;
    bottom: 0 !important;
    left: 0 !important;
  }
  .footerT .navB dl dd {
    line-height: 1.8 !important;
    font-size: 12px !important;
    color: #999 !important;
  }
  .footerT .navB dl dd a {
    color: #999 !important;
    display: block !important;
    padding: 2px 0 !important;
  }
  .footerT .navB dl dd a:hover {
    color: #01913a !important;
  }
  .footerT .navB dl:nth-child(5) {
    width: 100% !important;
    margin-top: 10px !important;
  }
}
@media (max-width: 480px) {
  .footerT .navB dl {
    width: 100% !important;
  }
}

/* ============ 3. 底部固定栏遮挡 ============
   原 body{padding-bottom:120px} 已移除，改由第 10 节统一治理。 */

/* ============ 4. 资讯列表标题（单行省略） ============ */
.news-list li {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 !important;
  border-bottom: 1px solid #f0f0f0 !important;
  width: 100% !important;
  box-sizing: border-box;
}
.news-list li a {
  flex: 1 1 auto;
  min-width: 0;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.6 !important;
  font-size: 13px !important;
  max-width: 100% !important;
}
.news-list li .news-date {
  flex: 0 0 auto;
  margin-left: 12px !important;
  font-size: 12px !important;
  color: #999 !important;
  white-space: nowrap;
}

/* ============ 5. 页脚版权文字 ============ */
@media (max-width: 992px) {
  .footer .copyright,
  .footerT .copyright,
  .footer-bottom {
    font-size: 11px !important;
    line-height: 1.6 !important;
    padding: 10px 0 !important;
    text-align: center !important;
  }
  .footer .copyright a,
  .footerT .copyright a {
    display: inline !important;
    margin: 0 4px !important;
  }
}

/* ============ 6. 服务卡片描述文字 ============ */
@media (max-width: 992px) {
  .service-card .desc,
  .content02 .card .desc {
    display: block !important;
    overflow: visible !important;
    line-height: 1.6 !important;
    font-size: 13px !important;
  }
}

/* ============ 7. 表单输入框 ============ */
@media (max-width: 992px) {
  .contact-form input,
  .contact-form textarea,
  .message-form input,
  .message-form textarea {
    margin-bottom: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ============ 8. 分类标签 ============ */
@media (max-width: 992px) {
  .train-tags a,
  .tag-list a,
  .category-tags a {
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   10. 底部预留统一治理
   ------------------------------------------------------------
   页面内联 <style> 里有 13 条 body{padding-bottom:70px !important}，
   且写在 </body> 之前（比本文件靠后）。同优先级 + 同 !important 时
   后加载者胜出，因此单靠文件末尾的 !important 压不住。

   解法：改用 html body 组合选择器，特异度 (0,0,2) 高于单元素
   (0,0,1)，与加载顺序无关，必然胜出。
   ============================================================ */

@media (max-width: 992px) {
  /* 固定条 52px + iPhone 安全区 */
  html body {
    padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* 内容区冗余留白归零（原被内联写了 9 次 90px） */
  html body .content04,
  html body .content05 {
    padding-bottom: 20px !important;
  }
  /* 固定条避开 Home 指示条 */
  html body .yckk-m-callbar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* 悬浮按钮组同步上移 */
  html body .yckk-float {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  html body .yckk-float-panel {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   12. 移动端横向溢出修复【本次核心】
   ------------------------------------------------------------
   实测截图确认：页面「错位」的真正原因是横向溢出，
   而非底部留白。三个溢出源：

   1. ONLINE SHOP 装饰水印（主因）
      .shop-main-title 内联 style 的 72px 巨型英文，
      white-space:nowrap + 绝对定位居中，
      390px 屏上估算宽 551px，超出视口 181px，
      把整个页面撑宽 → 视觉上就是「整体错位」。

   2. 数据统计条第 4 项被截断
      .content01 ul 为 repeat(4,1fr)，4 列等分每列仅 92.5px，
      「结业贴膜技术人员」7 个汉字需要 77px，放不下被裁。

   3. 服务卡片 2 列过窄
      .content02 .con02C 移动端 2 列，扣 padding 后可用 154px，
      12px 字体每行仅 12 个汉字 → 文字挤成竖排。

   ⚠️ 本节同样使用 html body 提升特异度，压过内联样式。
   ⚠️ 必须位于文件末尾。
   ============================================================ */

/* --- 12.1 统计条：4 列 → 2 列，彻底消除截断 --- */
@media (max-width: 992px) {
  html body .content01 ul {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 6px !important;
    padding: 0 4px !important;
  }
  html body .content01 ul li {
    min-width: 0 !important;
  }
  html body .content01 ul li .round {
    font-size: 12px !important;
  }
  html body .content01 ul li .cn {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }
  html body .content01 ul li .en {
    font-size: 8px !important;
  }
}

/* --- 12.2 72px 装饰水印 → 26px + overflow 裁切，双重保险 --- */
@media (max-width: 992px) {
  html body .shop-main-title,
  html body .train-main-title,
  html body .content02 .shop-main-title {
    overflow: hidden !important;
  }
  /* 匹配内联 style 里带 72px 的那个 div */
  html body .shop-main-title div[style*="72px"] {
    font-size: 26px !important;
    letter-spacing: 2px !important;
  }
  /* 课程区同类水印 */
  html body .train-main-title .en-bg {
    font-size: 30px !important;
    letter-spacing: 2px !important;
  }
  /* 若还有其他超大装饰字，统一压制 */
  html body [style*="font-size:72px"] {
    font-size: 26px !important;
    letter-spacing: 2px !important;
  }
  html body [style*="font-size:60px"] {
    font-size: 24px !important;
  }
}

/* --- 12.3 服务卡片：2 列 → 单列，文字恢复正常阅读 --- */
@media (max-width: 992px) {
  html body .content02 .con02C,
  html body .content02 .con02C ul {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  html body .content02 .con02C li {
    min-width: 0 !important;
  }
  html body .content02 .con02C li .content,
  html body .content02 .con02C li p {
    line-height: 1.7 !important;
    word-break: break-word;
  }
}

/* --- 12.4 全局兜底：任何意外宽元素都不许撑破视口 --- */
@media (max-width: 992px) {
  html body .g-in,
  html body .container,
  html body .mainWrap {
    max-width: 100% !important;
    overflow-x: hidden;
  }
  /* 兜底：禁止超长英文/网址撑破布局 */
  html body h1,
  html body h2,
  html body h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}