/* ==========================================================================
   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; }
  /* 小单元多列网格（图标 + 短标签、短卡片）不压成单列：6–8 列 → 3 列，5 列 → 2 列 */
  [style*="grid-template-columns"][style*="repeat(6, 1fr)"],
  [style*="grid-template-columns"][style*="repeat(7, 1fr)"],
  [style*="grid-template-columns"][style*="repeat(8, 1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 22px !important; }
  /* DMR 数字基站「机柜组成」：左机柜 / 右说明按比例缩窄，行高对齐 */
  .evt-rack { gap: 12px !important; justify-content: flex-start !important; }
  .evt-rack-units { width: 46% !important; flex: 0 0 46% !important; padding: 10px 8px !important; box-sizing: border-box; }
  .evt-rack-units > * { padding: 0 8px !important; gap: 6px !important; }
  .evt-rack-units > * > * { min-width: 0; font-size: 12.5px !important; }
  .evt-rack-units > * > :first-child { width: 18px !important; font-size: 11px !important; }
  .evt-rack-units > * > :nth-child(2) { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .evt-rack-units > * > :last-child:not(:nth-child(2)) { display: none !important; }
  .evt-rack-desc { width: auto !important; flex: 1 1 0 !important; min-width: 0; padding: 12px 0 !important; }
  .evt-rack-desc p { font-size: 12.5px !important; line-height: 1.45 !important; }

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

  /* 通用：区块标题行（左标题 / 右副标题或链接）与横向提示条 → 上下堆叠，避免右侧文字被挤成竖排或溢出 */
  [style*="justify-content: space-between"][style*="align-items: flex-end"],
  [style*="justify-content: space-between"][style*="gap: 32px"],
  [style*="justify-content: space-between"][style*="gap: 36px"],
  [style*="justify-content: space-between"][style*="gap: 40px"],
  [style*="justify-content: space-between"][style*="gap: 48px"] { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; }
  [style*="text-align: right"] { text-align: left !important; }
  .evt-cap-link { position: static !important; display: inline-block; margin-top: 20px; }
  /* 首页「能力框架」阶梯：去掉桌面端阶梯高度留白，改为逐级右移的台阶，从下往上读为一层层升级 */
  .evt-cap-steps { margin-top: 32px !important; display: flex !important; flex-direction: column-reverse; gap: 10px; border-bottom: 0 !important; }
  .evt-cap-step { min-height: 0 !important; padding: 20px 20px 22px !important; border-left: 0 !important; }
  .evt-cap-step:nth-child(2) { margin-left: 14px; }
  .evt-cap-step:nth-child(3) { margin-left: 28px; }
  .evt-cap-step:nth-child(4) { margin-left: 42px; }
  .evt-cap-step > div:nth-of-type(4) { font-size: 20px !important; margin-top: 10px !important; }
  .evt-cap-step > p { font-size: 14px !important; margin-top: 8px !important; }
  .evt-cap-steplabels { display: none !important; }
  p[style*="text-align: right"] br { display: none; }
  [style*="justify-content: space-between"] > [style*="max-width"] { max-width: none !important; }
  [style*="justify-content: space-between"] [style*="flex: none"] { flex: 0 1 auto !important; max-width: 100%; }
  /* 通用：横向串联多列阶段的 2px 连接线，单列后无意义 → 隐藏 */
  [style*="position: absolute"][style*="height: 2px"][style*="left: 0px"][style*="right: 0px"]:not(.evt-lc-line) { display: none !important; }

  /* 首页首屏数据条：2×2，数字在上、说明在下，不再竖排挤压 */
  .evt-hero-stats { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 14px 0 !important; padding: 14px 20px !important; }
  .evt-hero-stat { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; padding-left: 14px !important; min-width: 0 !important; }
  .evt-hero-stat > * { white-space: nowrap; font-size: 13px; }
  .evt-hero-stat > span:first-child { font-size: 22px !important; }

  /* 首页三条产品线卡片：图片在上完整显示，文字在下常显（手机无悬停） */
  .evt-pl-card { min-height: 0 !important; display: flex !important; flex-direction: column !important; }
  .evt-pl-img { position: relative !important; height: 240px !important; object-fit: contain !important; object-position: center !important; -webkit-mask-image: none !important; mask-image: none !important; }
  .evt-pl-img[style*="object-fit: cover"] { object-fit: cover !important; object-position: center 30% !important; }
  .evt-pl-shade { display: none !important; }
  .evt-pl-body { min-height: 0 !important; background: #0E2430; padding: 22px 22px 26px !important; }
  .evt-pl-reveal { max-height: none !important; opacity: 1 !important; }

  /* 首页「全生命周期」：标题堆叠、四阶段改竖向时间轴（图标在左） */
  .evt-lc-head { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; }
  .evt-lc-head h2 { font-size: 26px !important; line-height: 1.4 !important; }
  .evt-lc-sub { text-align: left !important; max-width: none !important; font-size: 15px !important; }
  .evt-lc-sub br { display: none; }
  .evt-lc-line { left: 23px !important; right: auto !important; top: 24px !important; bottom: 24px !important; width: 2px !important; height: auto !important; }
  .evt-lc-grid { gap: 26px !important; }
  .evt-lc-item { padding: 0 0 0 66px !important; min-height: 48px; }
  .evt-lc-icon { position: absolute !important; left: 0; top: 0; width: 48px !important; height: 48px !important; }
  .evt-lc-stage { margin-top: 2px !important; }
  .evt-lc-bar { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; padding: 20px !important; }

  /* 首页资质条：说明在上一行，认证徽章自动换行 */
  .evt-cert-bar { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; padding: 20px !important; }
  .evt-cert-label { flex-wrap: wrap; gap: 8px 14px !important; }
  .evt-cert-label > span { white-space: nowrap; }
  .evt-cert-list { flex-wrap: wrap !important; gap: 10px !important; width: 100%; }
  .evt-cert-list > * { flex: 0 0 auto !important; min-width: 0 !important; width: auto !important; height: auto !important; padding: 8px 14px !important; }

  /* 智能建筑「多网融合」：手机改垂直列表，图在左、说明在右；横向网络轴隐藏（每个岗位已标注所用网络） */
  .evt-net-bands { display: none !important; }
  .evt-net-axis { display: none !important; }
  .evt-net-roles { grid-template-columns: 1fr !important; gap: 22px !important; margin-top: 0 !important; }
  .evt-net-roles > * { display: grid !important; grid-template-columns: 120px 1fr; column-gap: 16px; align-items: center !important; text-align: left !important; }
  .evt-net-roles > * > .evt-net-role-img { grid-row: 1 / span 3; width: 120px !important; height: 110px !important; }
  .evt-net-roles > * > div { margin-top: 0 !important; justify-content: flex-start; }
  .evt-net-roles > * > div:nth-of-type(2) { margin-top: 6px !important; font-size: 16px !important; }
  .evt-net-roles > * > p { margin: 4px 0 0 !important; max-width: none !important; font-size: 13.5px !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; }
  /* 其余 60–120px 的区块上下留白统一压缩 */
  section[style*="padding: 6"][style*="px 0px"], section[style*="padding: 7"][style*="px 0px"],
  section[style*="padding: 8"][style*="px 0px"], section[style*="padding: 9"][style*="px 0px"],
  section[style*="padding: 1"][style*="px 0px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  /* 堆叠后的提示条内边距收窄 */
  [style*="justify-content: space-between"][style*="padding: 24px 30px"],
  [style*="justify-content: space-between"][style*="padding: 26px 32px"] { padding: 18px 18px !important; }

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

/* 汉堡按钮：桌面端隐藏（内联 display:none 已处理），此处仅保证移动端布局 */
/* 平板宽度（861–1100px）放不下八个导航项 + 联系按钮，同样改用汉堡菜单 */
@media (min-width: 861px) and (max-width: 1100px) {
  [data-screen-label], [style*="min-width: 1200px"], [style*="min-width: 1280px"], [style*="min-width: 1120px"] { min-width: 0 !important; }
  [data-screen-label] { overflow-x: clip; }
  .evt-desk-nav { display: none !important; }
  .evt-desk-cta { display: none !important; }
  .evt-burger   { display: flex !important; }
}
.evt-burger { align-items: center; justify-content: center; }

/* 移动端下拉面板：桌面端强制隐藏，移动端由脚本控制 display */
@media (min-width: 1101px) {
  .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; }
}
