/* 兼容与无障碍补丁：所有页面在 </head> 前引入，置于内联样式之后 */
/* 1. 无 JS 时内容必须可见（原 .reveal 默认 opacity:0 依赖滚动脚本） */
.reveal{opacity:1;transform:none}
.js .reveal{opacity:0;transform:translateY(28px)}
.js .reveal.in,
.js .reveal.is-visible,
.js .reveal.visible{opacity:1;transform:none}

/* 2. 移动导航收起时不可被 Tab 聚焦 */
@media (max-width:980px){
  .nav:not(.open){visibility:hidden;pointer-events:none}
  .nav.open{visibility:visible;pointer-events:auto}
}

/* 3. 键盘可见焦点（hover-only 入口同样可得焦点） */
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:2px solid #2f6fc0;outline-offset:3px;border-radius:3px
}
.prod-card:focus-within,.case-card:focus-within,.news-card:focus-within,.sol-card:focus-within{
  border-color:#2f6fc0
}

/* 4. 定性数据卡（替代无佐证数字） */
.as-num.stat-qual{font-size:clamp(26px,3.4vw,40px);font-weight:900;line-height:1.1;color:#164a8a;letter-spacing:1px}
.stat-qual{letter-spacing:1px}
.footer a,.foot-bottom a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.footer a:hover,.foot-bottom a:hover{color:#fff}

/* 5. 图片默认尺寸约束，减少布局偏移 */
img{max-width:100%;height:auto}

/* ==========================================================================
   6. 移动端体验增强（美观 / 触控 / 兼容 / 性能）
   集中管理、对现有页面 CSS 零侵入；仅作用于 ≤640px 手机宽度。
   ========================================================================== */
@media (max-width:640px){
  /* --- 6.1 触控与浏览器基础 --- */
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{
    -webkit-tap-highlight-color:transparent; /* 去除点击时的蓝色方块 */
    overscroll-behavior-y:contain;           /* 阻止下拉露出浏览器背景/回弹 */
  }
  /* 国旗备案等页脚链接：增加垂直点击区，不改变视觉尺寸 */
  .foot-bottom a,a[href^="tel:"],a[href^="mailto:"]{touch-action:manipulation}

  /* --- 6.2 安全区适配（刘海屏/手势条：env 不支持时为 0，安全降级） ---
     仅在页面确需贴底时使用，避免给整个页面加 padding 造成留白 */
  .header{padding-top:env(safe-area-inset-top,0px)}

  /* --- 6.3 触控目标放大：用伪元素扩展点击区，不影响排版与视觉 ---
     这些链接视觉高度 19-27px，直接改 height 会撑乱列表，故用 ::after
     绝对定位向外扩展命中区；父级需 position:relative 才生效。 */
  .news-link,.news-more,.prod-link,.view-all,.news-view-all,.case-view-all,
  .search-more,.foot-bottom a{position:relative}
  .news-link::after,.news-more::after,.prod-link::after,
  .view-all::after,.news-view-all::after,.case-view-all::after,
  .search-more::after{
    content:"";position:absolute;left:0;right:0;top:50%;
    height:44px;transform:translateY(-50%);
  }
  /* 表单输入/按钮最小触控高度 */
  input[type=text],input[type=tel],input[type=email],input[type=search],select{
    min-height:44px;font-size:16px; /* 16px 可避免 iOS Safari 聚焦时自动放大 */
  }
  textarea{font-size:16px}

  /* --- 6.4 轮播指示点：视觉保持小圆点，命中区放大 --- */
  .hero-dots button,.dots button,.carousel-dots button,.swiper-pagination-bullet,
  .hero-arrow,.banner-dots button{position:relative}
  .hero-dots button::after,.dots button::after,.carousel-dots button::after,
  .banner-dots button::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}

  /* --- 6.5 小字号可读性：正文类最小 12px（英文眉标/角标保留装饰性小字）--- */
  .prod-cat,.news-tag,.case-tag,.prod-price,.news-date,.news-meta,
  .case-client,.case-period,.sol-more{font-size:12px}

  /* --- 6.6 图片与滚动性能 --- */
  img{decoding:async}                 /* 异步解码，减少滚动掉帧 */
  .case-grid,.news-grid,.prod-grid{
    -webkit-overflow-scrolling:touch; /* 老 iOS 惯性滚动 */
  }

  /* --- 6.7 改善可读性排版 --- */
  p,li{line-height:1.75}
}

/* ==========================================================================
   7. 移动端统一体验层（全站通用 / 仅 ≤640px）
   --------------------------------------------------------------------------
   原则：用 :where()（特异度 0）建立「基线」，只补各页面尚未定义的属性，
        因此不会覆盖页面 CSS 里已精调的字号/间距（含刚优化的移动端产品列表）；
        交互反馈用足够特异度的 :active / :active 伪类增量叠加，统一按压与聚焦手感。
   ========================================================================== */
@media (max-width:640px){
  /* 7.1 字体类型统一：表单控件与按钮继承正文 Noto Sans SC，消除系统 Arial 回退 */
  :where(button,input,textarea,select){font-family:inherit}

  /* 7.2 标题行距与字重基线：统一层级观感，字号保留各页面已精调值 */
  :where(h1,h2,h3,h4,.sec-title,.ph-title,.d-title,.hero-title,.art-title,.nf-title){
    line-height:1.35;
    letter-spacing:.5px
  }

  /* 7.3 模块间距基线：页面已有的具体 padding 优先，产品列表区完全不受影响 */
  :where(.section){padding-top:44px;padding-bottom:44px}

  /* 7.4 按钮统一触控高度（排除已精调的搜索框按钮与产品卡内链接） */
  :where(.btn,.notice-btn,.form-submit,.yld-ok,.sm-cta,.cart-btn,.empty-btn){
    min-height:44px;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent
  }

  /* 7.5 表单控件统一触控与可读性 */
  :where(input,textarea,select){
    min-height:44px;
    font-size:16px;           /* 16px 避免 iOS Safari 聚焦自动缩放 */
    line-height:1.6;
    border-radius:8px;
    touch-action:manipulation
  }
  :where(input,textarea,select)::placeholder{font-size:14px;color:var(--gray-light)}

  /* 7.6 辅助文字可读性基线（英文眉标等装饰性小字保留原样） */
  :where(.form-tip,.form-error,.sec-kicker,.news-date,.news-meta,
         .case-client,.case-period,.cta-sub,.consult-sub){
    font-size:12px;
    line-height:1.55
  }

  /* 7.7 弹窗交互：关闭键与确认键触控放大（覆盖 lead-form 内联样式需更高层，见 JS 源头同步） */
  #siteModal .sm-cta{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  #siteModal .sm-x{width:40px;height:40px}
}

/* 7.8 按压与聚焦反馈：仅触屏/窄屏生效；放在 hover 取消规则之后，确保 :active 优先 */
@media (max-width:640px) and (hover:none){
  /* 取消桌面 hover 位移在触屏的粘滞，避免点按后按钮持续抬起 */
  .btn:hover,.btn-red:hover,.btn-line:hover,.btn-outline:hover,.btn-primary:hover,
  .notice-btn:hover,.prod-search-submit:hover{transform:none}
  /* 统一按压回弹 */
  .btn:active,.btn-red:active,.btn-line:active,.btn-outline:active,.btn-primary:active,
  .notice-btn:active,.form-submit:active,.prod-search-submit:active,.yld-ok:active,
  .sm-cta:active,.cart-btn:active,.empty-btn:active,.menu-btn:active,.tab-btn:active{
    transform:scale(.97);
    opacity:.88
  }
  /* 导航与菜单按压底色 */
  .nav a:active{background:rgba(10,58,120,.08);border-radius:6px}
  .menu-btn:active{background:var(--bg-navy)}
}

