/* ===========================================================
   优网科技官网 · 移动端适配层（仅影响 ≤767px，PC 端零改动）
   目的：解决手机端横向溢出、固定 1200px 容器挤压、导航不可用、
        文案截断、底部条遮挡等问题
   =========================================================== */
@media (max-width: 767px) {

  /* ---------- 0. 基础：禁止横向溢出 ---------- */
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
  }
  img, video, iframe { max-width: 100% !important; }
  * { -webkit-tap-highlight-color: transparent; }

  /* ---------- 0.5 首屏横幅：手机上按横条比例，避免竖着被拉长 ---------- */
  .carousel-container,
  .carousel-container {
    height: 268px !important;
    min-height: 0 !important;
    max-height: 268px !important;
  }
  .carousel-slide { height: 268px !important; }
  /* 手机上只保留带文案的第一帧：后续帧是纯图，切过去标题和按钮会整体消失 */
  .carousel-slide:not(:first-of-type) { display: none !important; }
  .carousel-slide:first-of-type { opacity: 1 !important; transform: none !important; }
  /* 轨道是滑动式：必须复位，否则首帧被平移到屏幕外（表现为只剩深色底） */
  .carousel-track { transform: none !important; transition: none !important; }
  .carousel-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  h1, h2 {
    font-size: 26px !important;
    line-height: 1.24 !important;
    margin-bottom: 10px !important;
  }
  p { font-size: 13px !important; margin-bottom: 14px !important; }
  .px-8.md\:px-16 { padding-left: 18px !important; padding-right: 18px !important; }
  .px-8, .py-3 {
    padding-left: 18px !important;
    padding-right: 18px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    font-size: 13px !important;
  }

  /* ---------- 1. 顶部导航（浅色主题：白底深字） ---------- */
  #navbar {
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .05) !important;
    z-index: 70 !important; /* 高于底部咨询条(50)，菜单展开时不被压住 */
    /* 注意：这里不能用 backdrop-filter，它会成为子元素（移动菜单）的定位参照并裁剪掉菜单 */
  }
  #navbar, #navbar a, #navbar span, #navbar p, #navbar li, #navbar .text-white,
  #navbar .text-slate-300, #navbar .text-gray-300 {
    color: #1b2333 !important;
    -webkit-text-fill-color: #1b2333 !important;
  }
  #navbar > div {
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100% !important;
  }
  #navbar .flex.items-center.h-16,
  #navbar > div > .flex {
    height: 56px !important;
    gap: 8px !important;
  }
  /* logo 文字缩小，避免和菜单按钮抢空间 */
  #navbar .text-xl { font-size: 17px !important; line-height: 1.15 !important; }
  #navbar .text-xs { font-size: 11px !important; }
  /* 隐藏占位的运营位（手机上没空间） */
  #navbar .hidden.sm\:block { display: none !important; }

  /* 汉堡按钮：显眼、可点、固定在右侧 */
  #mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto !important;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f2f6fc;
    border: 1px solid rgba(16, 24, 40, .10);
    color: #1b2333 !important;
    z-index: 60;
  }
  /* 不依赖 FontAwesome：直接用 CSS 画三条横线，图标字体缺失也不会变成空方块 */
  #mobile-menu-btn i { display: none !important; }
  #mobile-menu-btn::after {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    background: #1b2333;
    box-shadow: 0 5px 0 #1b2333, 0 -5px 0 #1b2333;
  }
  #mobile-menu-btn:active { background: #e3ebf7; }

  /* 移动端抽屉：全屏滚动面板 */
  #mobile-menu {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 56px !important;
    bottom: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    backdrop-filter: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 96px !important;
    border-top: 1px solid #eef1f5 !important;
    z-index: 55 !important;
  }
  #mobile-menu > div { padding: 0 16px !important; }
  #mobile-menu a {
    display: block !important;
    padding: 12px 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border-bottom: 1px solid #f2f4f7;
  }
  #mobile-menu a:active { color: #2563eb !important; }
  /* 二级菜单：两列小字胶囊 */
  #mobile-menu .flex.flex-nowrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px 0 14px !important;
    border-bottom: 1px solid #f2f4f7;
    overflow: visible !important;
    white-space: normal !important;
  }
  #mobile-menu .flex.flex-nowrap a {
    border: 0 !important;
    background: #f6f8fb;
    border-radius: 8px;
    padding: 8px 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    white-space: normal !important;
    text-align: center;
  }

  /* ---------- 2. 通用固定宽度容器（核心问题根源） ---------- */
  .ui-page-center {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    height: auto !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .experience-item { overflow: hidden !important; max-width: 100% !important; }
  .ui-page-footer .experience-item::after { width: 100% !important; }

  /* ---------- 3. 信任条（2018年成立…）→ 单列清晰列表 ---------- */
  .experience-item .ui-page-center {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 12px 14px !important;
    align-items: center !important;
  }
  .experience-item .list {
    white-space: normal !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    line-height: 1.45 !important;
  }
  .experience-item .list .name {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    word-break: break-word;
  }
  .experience-item .icon {
    width: 18px !important;
    height: 18px !important;
    margin-right: 8px !important;
    flex: 0 0 auto;
  }
  /* 页脚深色那条：两列更紧凑 */
  .ui-page-footer .experience-item .ui-page-center {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 10px !important;
    align-items: center !important;
  }

  /* ---------- 4. 倒计时评估条（29:58 想要开发…）→ 纵向堆叠 ---------- */
  .assess-item {
    height: auto !important;
    padding: 16px 0 !important;
    background-size: cover !important;
  }
  .assess-item .ui-page-center {
    display: block !important;
    height: auto !important;
  }
  .assess-item .time-col {
    justify-content: flex-start !important;
  }
  .assess-item .time-col .num {
    width: 30px !important;
    height: 46px !important;
    font-size: 24px !important;
    border-radius: 5px;
  }
  .assess-item .time-col .symbol {
    font-size: 24px !important;
    margin: 0 5px !important;
  }
  .assess-item .ad-col {
    padding-right: 0 !important;
    margin-top: 14px !important;
  }
  .assess-item .ad-col .ad-title {
    font-size: 19px !important;
    line-height: 1.32 !important;
    white-space: normal !important;
  }
  .assess-item .ad-col .ad-desc {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-top: 6px !important;
    white-space: normal !important;
  }
  .assess-item .form-col {
    width: 100% !important;
    margin: 14px 0 0 !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }
  .assess-item .form-col > * { min-width: 0; }

  /* ---------- 5. 服务卡片：手机上单列 + 压到合理高度 ---------- */
  .service-card {
    width: 100% !important;
    min-width: 0 !important;
    height: 126px !important;
    min-height: 126px !important;
    max-height: 126px !important;
    display: flex !important;
    align-items: center !important;
  }
  .service-card > div:not(.absolute) {
    position: relative !important;
    z-index: 2;
    width: 100%;
    padding: 12px 12px !important;
  }
  /* 部分卡片配图偏浅，白字会糊：统一压一层遮罩，保证标题永远可读 */
  .service-card::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(120deg, rgba(0, 0, 0, .52) 0%, rgba(0, 0, 0, .26) 60%, rgba(0, 0, 0, .12) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  .service-card h3, .service-card .text-2xl, .service-card .text-xl {
    font-size: 15px !important;
    line-height: 1.28 !important;
    letter-spacing: 0;
  }
  .service-card p, .service-card .text-sm {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
  }
  .service-card h3, .service-card p { word-break: break-word; }
  #service-carousel {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 9px !important;
    flex-direction: row !important;
    width: 100% !important;
  }
  /* 第二组服务卡（PC 上是多列网格）同样两列 */
  #service-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 9px !important;
    width: 100% !important;
  }
  #service-carousel > *:empty { display: none !important; }
  [class*="min-h-"] { min-height: 0 !important; }
  /* 手机上不依赖 hover：凡 PC 靠悬停才浮现的内容一律常显 */
  [class*="group-hover:"],
  [class*="hover:opacity"],
  .opacity-0 {
    opacity: 1 !important;
    transform: none !important;
  }

  /* ---------- 6. 底部咨询条 / 客服浮窗：三者不再互相压叠 ---------- */
  body { padding-bottom: 104px !important; }

  /* 底部咨询条：贴边铺满，圆角收口 */
  #mobile-consult-bar {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 58px !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 10px !important;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .16) !important;
  }
  #mobile-consult-bar > * { min-width: 0; }

  /* 回到顶部：手机端去掉（手指滑一下就到顶），避免和咨询条打架 */
  #back-to-top { display: none !important; }

  /* 在线客服球：手机端隐藏，底部条的「在线咨询」已承担同一入口，避免浮窗压住正文 */
  #customerServiceBtn { display: none !important; }
  .side-consult-card, .side-consult-variant { display: none !important; }

  /* ---------- 7. 区块留白收紧，避免手机上过度空旷 ---------- */
  section.py-16 { padding-top: 40px !important; padding-bottom: 40px !important; }
  section.py-12 { padding-top: 30px !important; padding-bottom: 30px !important; }

  /* ---------- 8. 表格 / 富文本防溢出 ---------- */
  .prose, .article-content, .news-content, .content-body {
    overflow-x: auto;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  table { width: 100% !important; }
  table th, table td { padding: 8px !important; font-size: 13px !important; }

  /* ---------- 9. 页脚：浅色化 + 从"一大坨竖排"改成紧凑两列 ---------- */
  .ui-page-footer,
  .ui-page-footer-bg { background: #f6f8fc !important; }
  .ui-page-footer { color: #1b2333 !important; }
  .ui-page-footer .ui-page-center,
  .ui-page-footer .enterpriseInfo-item,
  .ui-page-footer .experience-item,
  .ui-page-footer .footer-nav,
  .ui-page-footer .enterprise-left,
  .ui-page-footer .enterprise-addr,
  .ui-page-footer .enterprise-qrcode,
  .ui-page-footer .copyright { background: transparent !important; }
  .ui-page-footer .enterprise-left *,
  .ui-page-footer .footer-nav *,
  .ui-page-footer .enterprise-addr *,
  .ui-page-footer .enterprise-qrcode *,
  .ui-page-footer .copyright *,
  .ui-page-footer .experience-item *,
  .ui-page-footer .list * {
    color: #1b2333 !important;
    -webkit-text-fill-color: #1b2333 !important;
  }
  /* 底部咨询条是橙色实底，必须保住白字 */
  #mobile-consult-bar,
  #mobile-consult-bar * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }
  .enterpriseInfo-item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 18px 14px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* 电话区：满宽，字号收敛 */
  .enterpriseInfo-item .enterprise-left {
    width: 100% !important;
    max-width: 100% !important;
  }
  .enterpriseInfo-item .enterprise-left > * { font-size: 13px !important; }
  .enterpriseInfo-item .enterprise-left .tel,
  .enterpriseInfo-item .enterprise-left .phone { font-size: 18px !important; letter-spacing: .5px; }
  /* 两个导航组并排，各占一半：从 132px 窄条变成可用列 */
  .enterpriseInfo-item .footer-nav {
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
    min-width: 0 !important;
  }
  .enterpriseInfo-item .footer-nav .title,
  .enterpriseInfo-item .footer-nav h4,
  .enterpriseInfo-item .footer-nav > :first-child {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  .enterpriseInfo-item .footer-nav a,
  .enterpriseInfo-item .footer-nav li,
  .enterpriseInfo-item .footer-nav .name {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.9 !important;
    white-space: normal !important;
    word-break: break-word !important;
    opacity: .86;
  }
  /* 地址：满宽 */
  .enterpriseInfo-item .enterprise-addr {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 12px !important;
    line-height: 1.7 !important;
  }
  /* 二维码：图 84px + 文字横排，省掉一大块空白 */
  .enterpriseInfo-item .enterprise-qrcode {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    height: auto !important;
  }
  .enterpriseInfo-item .enterprise-qrcode img {
    width: 84px !important;
    height: 84px !important;
    flex: 0 0 auto;
  }
  .enterpriseInfo-item .enterprise-qrcode > *:not(img) { font-size: 12px !important; line-height: 1.6 !important; }
  /* 版权行居中收窄 */
  .ui-page-footer .copyright {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    font-size: 11.5px !important;
    line-height: 1.8 !important;
    padding: 12px 10px 16px !important;
    opacity: .72;
  }
  .ui-page-footer .ui-page-footer-bg { min-height: 0 !important; }
  /* 二维码内部：图与文字横排 */
  .enterpriseInfo-item .enterprise-qrcode > div {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: left !important;
  }

  /* ---------- 10. 案例筛选按钮：三行堆叠 → 单行横滑 ---------- */
  .flex.flex-wrap.justify-center.gap-3.mb-8 {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .flex.flex-wrap.justify-center.gap-3.mb-8::-webkit-scrollbar { display: none; }
  .flex.flex-wrap.justify-center.gap-3.mb-8 > * { flex: 0 0 auto; }
  .flex.flex-wrap.justify-center.gap-3.mb-8 button,
  .flex.flex-wrap.justify-center.gap-3.mb-8 a {
    font-size: 12.5px !important;
    padding: 7px 14px !important;
    white-space: nowrap;
  }

  /* ---------- 11. 全站浅色化收尾 ---------- */
  /* 导航是 fixed(56px)，内容必须让出这段高度，否则首屏标题被标题栏压住 */
  body { padding-top: 56px !important; }
  /* 轮播左右箭头：手机用手指滑，箭头只会压住图片 */
  .carousel-prev, .carousel-next, .carousel-arrow,
  .swiper-button-prev, .swiper-button-next,
  [class*="carousel"] button[aria-label*="prev"],
  [class*="carousel"] button[aria-label*="next"] { display: none !important; }
  /* 页脚背景需要更高特异性才压得住原站的 footer 深色规则；
     用 background-image 叠一层，能盖掉任何 background-color */
  html body .ui-page-footer,
  html body .ui-page-footer .ui-page-footer-bg,
  html body .ui-page-footer .ui-page-center,
  html body .ui-page-footer .experience-item,
  html body .ui-page-footer .enterprise-contact,
  html body .ui-page-footer .enterpriseInfo-item,
  html body .ui-page-footer::before {
    background: #f6f8fc !important;
    background-color: #f6f8fc !important;
    background-image: none !important;
  }
  /* 电话/logo 区块的底色与整块保持一致（不留深色小方块） */
  html body .ui-page-footer .enterprise-contact { background: transparent !important; }
  /* 页脚 logo 是深底白字图，浅色页脚上会变成一块深色方块 → 手机端隐藏，页眉已有 logo */
  html body .ui-page-footer .enterprise-contact img,
  html body .ui-page-footer .logo { display: none !important; }
  /* 整页底色：原站 body 是深蓝 rgb(13,20,40)，手机上改成纯白 */
  html body,
  html body.font-sans {
    background: #ffffff !important;
    background-color: #ffffff !important;
  }

  /* 首屏：浅色图片上白字看不见 → 改成浅白蒙版 + 深色标题，整体明亮不压抑 */
  .carousel-slide::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .86) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  .carousel-slide h1, .carousel-slide h2, .carousel-slide p,
  .carousel-slide .text-white, .carousel-slide span {
    color: #18202f !important;
    -webkit-text-fill-color: #18202f !important;
    text-shadow: none !important;
    position: relative;
    z-index: 2;
  }
  /* 手机端不需要左右箭头 */
  .carousel-container button.absolute,
  .carousel-container .fa-chevron-left,
  .carousel-container .fa-chevron-right,
  .carousel-container .fa-long-arrow-left,
  .carousel-container .fa-long-arrow-right { display: none !important; }
}
