/* ==========================================================================
   Evertac 官网 · 移动端自适应共享样式
   仅在 ≤860px 生效，通过 !important 覆盖内联样式；桌面端完全不受影响。
   （DOM 已将内联样式规范化为带空格形式，如 "repeat(3, 1fr)" / "1fr 1fr"，
     选择器据此匹配。）
   ========================================================================== */

/* dc-import 的 .sc-host 包裹层默认是 block（仅与头部等高），会成为 sticky 的定位父级
   导致头部随页面滚走。改为 display:contents 让头部相对整页根容器吸顶。全宽度生效。 */
.sc-host[data-sc-name="SiteHeader"] { display: contents; }
.sc-host[data-sc-name="EN-SiteHeader"] { display: contents; }

/* ---------- 平板/手机通用（≤860px） ---------- */
@media (max-width: 860px) {

  /* 允许所有固定最小宽度的整页容器回流，消除横向滚动 */
  [data-screen-label] { min-width: 0 !important; }
  [style*="min-width: 1200px"],
  [style*="min-width: 1280px"],
  [style*="min-width: 1120px"] { min-width: 0 !important; }

  /* 容器左右内边距收窄 */
  [style*="padding: 0px 32px"] { padding-left: 20px !important; padding-right: 20px !important; }

  /* 所有网格在移动端统一收敛为单列（最稳妥，覆盖各类分栏 / 流程图 / 页脚） */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns"] > * { min-width: 0 !important; }

  /* 顶部数据条（display:flex;gap:0 的均分条）→ 2×2 换行 */
  [style*="display: flex"][style*="gap: 0px"] { flex-wrap: wrap !important; }
  [style*="display: flex"][style*="gap: 0px"] > * { flex: 1 1 42% !important; box-sizing: border-box; }

  /* 居中大图（产品主图）缩放适配窄屏 */
  img[style*="translate(-50%, -50%)"] { max-width: 86% !important; height: auto !important; }

  /* 各内容区块裁剪横向溢出（装饰性大图 / 水印背景，不影响纵向内容） */
  [data-screen-label] { overflow-x: clip; }

  /* 页尾行动区（CTA）：文案与按钮上下堆叠，按钮行可换行 */
  section#contact > div[style*="display: flex"] { flex-direction: column !important; align-items: flex-start !important; gap: 24px !important; }
  section#contact [style*="display: flex"] { flex-wrap: wrap !important; }
  section#contact [style*="flex: none"] { flex: 0 1 auto !important; max-width: 100%; }

  /* 页脚底栏 flex 换行 */
  footer [style*="display: flex"] { flex-wrap: wrap !important; row-gap: 12px; }
  .evt-footer-col { padding-top: 0 !important; }

  /* 页脚四栏链接：移动端 Logo/联系块整行，四个链接栏 2×2（覆盖上面的单列通用规则） */
  footer .evt-footer-grid { grid-template-columns: 1fr 1fr !important; gap: 28px 24px !important; }
  footer .evt-footer-grid > *:first-child { grid-column: 1 / -1 !important; }

  /* 中文页脚网站导航：五列折叠为上下排列 */
  footer .evt-footer-nav { grid-template-columns: 1fr !important; gap: 32px !important; padding-top: 48px !important; }
  footer .evt-footer-info { flex-direction: column !important; gap: 24px !important; }
  footer .evt-footer-info > div:last-child { grid-template-columns: 1fr !important; }
  .evt-sitemap-cols { columns: 1 !important; }

  /* 标签 / 筛选行：换行，避免被裁剪后无法点击 */
  .evt-tabrow { flex-wrap: wrap !important; row-gap: 2px; }

  /* 区块标题在移动端缩放（桌面内联 38–40px 在手机上过大、且比首屏标题还大） */
  h2 { font-size: 30px !important; line-height: 1.3 !important; }
  h3 { line-height: 1.32 !important; }

  /* 首页顶部工具条：缩小间距，长标语在窄屏隐藏 */
  .evt-topbar-tagline { font-size: 12px !important; }

  /* 大段落纵向留白压缩 */
  [style*="padding: 96px 0px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 88px 0px"] { padding-top: 52px !important; padding-bottom: 52px !important; }
  [style*="padding: 80px 0px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  [style*="padding: 72px 0px"] { padding-top: 44px !important; padding-bottom: 44px !important; }

  /* ---------- 共享导航（SiteHeader） ---------- */
  .evt-desk-nav { display: none !important; }
  .evt-desk-cta { display: none !important; }
  .evt-burger   { display: flex !important; }
}

/* 汉堡按钮：桌面端隐藏（内联 display:none 已处理），此处仅保证移动端布局 */
.evt-burger { align-items: center; justify-content: center; }

/* 移动端下拉面板：桌面端强制隐藏，移动端由脚本控制 display */
@media (min-width: 861px) {
  .evt-mpanel { display: none !important; }
}

/* ---------- 宽幅示意图（≤860px） ----------
   线性长条图（隧道纵剖、航站楼覆盖带、厂区天际线）：横向可滑动查看，
   容器右侧渐隐提示可继续滑动；touch-action 限制为横向，避免抢纵向滚动。 */
@media (max-width: 860px) {
  .evt-wide-scroll { position: relative; }
  .evt-wide-scroll > .evt-wide-scroll-inner {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  .evt-wide-scroll > .evt-wide-scroll-inner::-webkit-scrollbar { display: none; }
  .evt-wide-scroll > .evt-wide-scroll-inner > img { min-width: 720px !important; width: 720px !important; }
  .evt-wide-scroll::after {
    content: "";
    position: absolute; top: 0; right: 0; bottom: 0; width: 46px;
    background: linear-gradient(to left, rgba(10,26,34,.55), rgba(10,26,34,0));
    pointer-events: none; border-radius: 0 8px 8px 0;
  }
  .evt-wide-scroll[data-light]::after {
    background: linear-gradient(to left, rgba(255,255,255,.92), rgba(255,255,255,0));
  }
  .evt-wide-hint { display: block !important; }
}
.evt-wide-hint { display: none; }

/* 防爆链条：移动端每节整行、箭头转向下方 */
@media (max-width: 860px) {
  .evt-chain > * { flex: 1 1 100% !important; flex-direction: column !important; }
  .evt-chain-arrow { width: 100% !important; transform: rotate(90deg); padding: 6px 0 !important; }
}

/* 部署动画舞台：移动端浮层收敛，避免遮住底图 */
@media (max-width: 860px) {
  .evt-stage-panel { display: none !important; }
  .evt-stage-note { flex-direction: column !important; gap: 6px !important; padding: 14px 16px 16px !important; }
}

/* ---------- 手机窄屏进一步收敛（≤560px） ---------- */
@media (max-width: 560px) {
  /* 超大标题降级，避免撑破窄屏 */
  .evt-hero-h1 { font-size: 32px !important; line-height: 1.25 !important; }
  h1 { word-break: break-word; }
  /* 区块标题进一步收敛，保持低于首屏标题的层级 */
  h2 { font-size: 25px !important; }
  /* 顶部工具条长标语隐藏，仅保留操作链接 */
  .evt-topbar-tagline { display: none !important; }
  .evt-topbar-actions { gap: 18px !important; }
  /* 主视觉按钮堆叠、通栏 */
  .evt-hero-cta { flex-direction: column !important; align-items: stretch !important; }
  .evt-hero-cta > a { text-align: center; }
}
