/*
 * 英文站版式适配（D20 / I8）。
 * 仅在 lang=en 时由 common.html 加载（且须排在 page-*.css 之后）；选择器不加 [lang=en]。
 * 禁止改动 base.css / layout.css / page-*.css —— 保护中文 pixel-diff 基线。
 */

/* ---------- 1. 页头：英文导航更长，中间档再收一点 ---------- */
/* 停用 2026-09-01：双稿改造后不再有中间过渡档，见 docs/14。
   复活时把条件改回 (min-width: 769px) and (max-width: 1040px)。 */
@media not all {
  .site-header__inner { padding: 0 16px; }
  .site-nav > ul { gap: 12px; }
  .site-nav a { font-size: max(13px, calc(10px / var(--s))); }
  .site-lang {
    margin-left: 10px;
    margin-right: 0;
  }
}

/* 停用 2026-09-01：双稿改造后不再有中间过渡档，见 docs/14。
   复活时把条件改回 (min-width: 1041px) and (max-width: 1280px)。 */
@media not all {
  .site-nav > ul { gap: 18px; }
  .site-nav a { font-size: max(15px, calc(12px / var(--s))); }
  .site-lang {
    margin-left: 24px;
    margin-right: 10px;
  }
}

.site-nav__sub { min-width: 200px; }

/* ---------- 2. 首页 hero ---------- */

/* 英文标题比中文长得多：分成两行，收窄字号和安全区，并去掉中文副标题的大字距。
   这套规则只改变英文文本层，不动后台图片和中文像素基线。 */
.hero__title > span,
.hero__title > em {
  display: block;
  width: fit-content;
  max-width: 100%;
  text-wrap: balance;
}

.hero__title em::before {
  content: none;
}

html:not([data-layout="mobile"]) {
  .hero__copy {
    top: calc(178 * var(--u));
    width: calc(1040 * var(--u));
    max-width: calc(1040 * var(--u));
  }

  .hero__title {
    font-size: calc(50 * var(--u));
    line-height: 1.06;
  }

  .hero__sub {
    width: calc(920 * var(--u));
    max-width: 100%;
    margin-top: calc(20 * var(--u));
    font-size: calc(20 * var(--u));
    line-height: 1.35;
    letter-spacing: calc(1.4 * var(--u));
  }
}

html[data-layout="mobile"] {
  .hero__copy {
    top: calc(28 * var(--u));
    width: 62%;
    max-width: 62%;
  }

  .hero__title {
    font-size: 15px;
    line-height: 1.08;
  }

  .hero__sub {
    display: -webkit-box;
    max-width: 100%;
    margin-top: 6px;
    overflow: hidden;
    font-size: 9.5px;
    line-height: 1.3;
    letter-spacing: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* 能力项：允许换行，略缩字号 */
.hero__caps {
  /* 英文副标题更长；略放宽舞台栏，避免 scrollWidth 顶破固定列宽 */
  left: calc(48 * var(--u));
  width: calc(820 * var(--u));
  height: auto;
  overflow: visible;
}

.hero__caps li {
  overflow: visible;
}

.hero__caps b {
  font-size: calc(12 * var(--u));
  line-height: 1.15;
}

.hero__caps span {
  white-space: normal;
  font-size: calc(9.6 * var(--u));
  line-height: 1.2;
  max-width: 100%;
  padding-inline: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero__caps li + li::before {
  height: calc(110 * var(--u));
}

/* ---------- 3. 固定宽按钮：英文 CTA 允许撑开 ---------- */
.cta__btn,
.svc-overview__cta {
  width: auto;
  min-width: calc(222 * var(--u));
  max-width: 100%;
  padding-inline: calc(28 * var(--u));
  white-space: nowrap;
  box-sizing: border-box;
}

/* ---------- 4. 服务页 overview：英文正文更长，沿用双栏舞台并提高段高 ---------- */
.page-service .svc-overview {
  height: auto;
  min-height: 0;
  overflow-x: clip; /* 徽章负 left 不撑出横向滚动 */
  overflow-y: visible;
}

.svc-overview__inner {
  min-height: calc(1111 * var(--u));
  overflow-x: clip;
  overflow-y: visible;
}

.svc-overview__text {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  max-width: 100%;
  padding: 0;
  z-index: 2;
}

.svc-overview__body {
  font-size: 20px;
  line-height: 1.8;
}

.svc-overview__cta {
  display: inline-flex;
  align-items: center;
  height: calc(70 * var(--u));
}

.svc-overview__text h2 {
  font-size: calc(52 * var(--u));
  line-height: 1.23;
}

/* 服务 Tab：英文名远长于中文四字。跟中文同一套 --u，只把字号从 30 收到 22，
   禁止再写 clamp(vw)（会和舞台系数拆成两套）。 */
.svc-tabs a {
  min-width: 0; /* grid 子项默认 min-width:auto，长词会把列撑破 */
  font-size: calc(22 * var(--u));
  line-height: 1.25;
  padding-inline: calc(8 * var(--u));
  gap: calc(14 * var(--u));
  overflow: hidden;
}

.svc-tabs a > span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 中间档：再收一点字号，让正文与媒体舞台各守住自己的栏宽。 */
/* 停用 2026-09-01：双稿改造后不再有中间过渡档，见 docs/14。
   复活时把条件改回 (min-width: 769px) and (max-width: 1280px)。 */
@media not all {
  .svc-overview__inner {
    min-height: calc(1031 * var(--u));
  }

  .svc-overview__body {
    font-size: 18px;
    line-height: 32px;
  }

  .svc-overview__text h2 {
    font-size: 40px;
    line-height: 50px;
  }

  .svc-tabs a {
    font-size: calc(16 * var(--u));
    padding: calc(24 * var(--u)) calc(6 * var(--u)) calc(20 * var(--u));
  }
}

/* ---------- 5. about：缺 title_cn 后补一点内边距；年份轴按钮 ---------- */
.about-culture__grid li:not(.about-culture__mark) {
  padding-bottom: 8px;
}

.about-culture__body {
  margin-top: 12px;
}

.about-milestone__tab {
  padding-inline: 10px;
}

.about-milestone__panel h3 {
  letter-spacing: 0.02em;
}

/* ---------- 6. 首页服务网络的移动排布（≤639）：
   page-home.css 给两组数字标签设了 nowrap，英文标签比中文长，
   会把固定网格列顶宽（375 下整页撑到 441px）---------- */
html[data-layout="mobile"] {
  .network__major span,
  .network__minor span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* 标签换行后 105/135/75 三档（按中文标签定的）太紧，会把 80,000 m² 拆行；
     英文改等分三列，数值本身不断行。
     宽度跟中文一样封顶 375*--m。zoom 后布局宽锁 375，--m 恒等于 1px。 */
  .network__minor {
    grid-template-columns: repeat(3, 1fr);
    width: min(100%, calc(375 * var(--m)));
    padding-inline: 16px;
  }

  /* 列间距做在 li 内边距上而不是 grid gap：li 的 border-top 是成稿那条分隔线，
     用 gap 会把它切成三段。 */
  .network__minor li {
    padding-right: 10px;
  }

  .network__minor b {
    white-space: nowrap;
  }
}

/* ---------- 7. 首页主营业务五卡：英文更长；贴底排布（对齐中文下区）并加大字号 ---------- */
.biz__card a::after {
  background: linear-gradient(
    180deg,
    rgba(5, 32, 84, 0) 28%,
    rgba(5, 32, 84, .45) 52%,
    rgba(5, 32, 84, .9) 100%
  );
}

.biz__copy {
  /* 五卡共用同一标题顶线；不再贴底随摘要长短错位 */
  top: 40%;
  bottom: 4%;
  left: 9.94%;
  right: 9.94%;
}

.biz__name {
  font-size: 8.13cqw;          /* ≈27/332，与中文同级 */
  line-height: 1.1;
  /* 单行标题（Life Sciences 等）占满两行高，绿条与长标题齐平 */
  min-height: 2.2em;
}

.biz__rule {
  margin-top: 3.9cqw;          /* ≈13 */
}

.biz__summary {
  margin-top: 4.5cqw;          /* ≈15 */
  font-size: 4.82cqw;          /* ≈16/332 */
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

html[data-layout="mobile"] {
  .biz__copy {
    top: 14%;
    bottom: 6%;
    left: 9.57%;
    right: 4%;
  }

  .biz__name {
    font-size: 5.8cqw;         /* ≈20/345 */
    line-height: 1.12;
    min-height: 2.24em;
  }

  .biz__rule {
    margin-top: 2.3cqw;
  }

  .biz__summary {
    margin-top: 2.6cqw;
    font-size: 3.77cqw;        /* ≈13/345 */
    line-height: 1.35;
    -webkit-line-clamp: 3;
  }

  /* 英文服务正文不能沿用桌面 20/36 字号和 1111u 固定舞台，否则长文会越出容器。
     移动端让文案参与正常流，媒体组合在其后保留一个独立的固定舞台。 */
  .page-service .svc-overview {
    min-height: 0;
    overflow: visible;
  }

  .page-service .svc-overview__inner {
    min-height: 0;
    width: 100%;
    max-width: 100%;
    padding: 20px 25px 18px;
    overflow: visible;
    box-sizing: border-box;
  }

  .page-service .svc-overview__text {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    max-width: 100%;
    min-height: 0;
  }

  .page-service .svc-overview__text h2 {
    font-size: 24px;
    line-height: 30px;
  }

  .page-service .svc-overview__body {
    display: block;
    width: auto;
    max-width: 325px;
    box-sizing: border-box;
    margin-top: 14px;
    padding-bottom: 0;
    font-size: 13px;
    line-height: 22px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  .page-service .svc-overview__cta {
    position: static;
    width: auto;
    min-width: 0;
    height: 42px;
    margin: 16px 0 0;
    padding-inline: 18px;
    font-size: 14px;
    font-weight: 400;
  }

  /* 白条按稿只有 71 高，中文 4 字标签正好一行；英文名长得多，沿用桌面那份
     clamp(14px…) + 14 缝会算出 3 行 52.5 的文字块，塞不进 15 的余量里被裁成半个词，
     选中格又是 overflow: visible，多出来的行会掉到白条外面。
     这里按 71 的余量重排：10 上 + 24 图标 + 5 缝 + 两行 10/1.2 + 8 下 = 71，
     格宽放到 116，第二行末尾用 line-clamp 收省略号。 */
  .svc-tabs a {
    flex: 0 0 calc(116 * var(--u));
    gap: calc(5 * var(--u));
    padding: calc(10 * var(--u)) calc(6 * var(--u)) calc(8 * var(--u));
    font-size: calc(10 * var(--u));
    line-height: 1.2;
  }

  /* 夹到两行：不能用 -webkit-line-clamp —— 这个 span 是列向 flex 的子项，
     display: -webkit-box 会被 blockify 成 flow-root，clamp 直接失效（实测 computed
     display 就是 flow-root）。改用 max-height 硬裁，24 = 两行 10/1.2。 */
  .svc-tabs a > span:last-child {
    max-height: calc(24 * var(--u));
    overflow: hidden;
  }

  /* 英文版把左栏文案放回文档流，媒体舞台跟在正文后面而不是绝对定位到段中。
     中文那份的 left/top/transform 必须一并清掉，否则 position: relative 下
     它们变成相对位移，整组会被推到右下角。
     圆/徽标/竖图不再在这里单独摆位——中文那份已按舞台盒的百分比定位，跟着盒子走。 */
  .page-service .svc-overview__media {
    position: relative;
    left: auto;
    top: auto;
    width: min(328px, 100%);
    height: 224px;
    margin: 12px auto 0;
    transform: none;
    overflow: visible;
  }
}

/* ---------- 8. 订单查询 chips：Remove 比"移除"宽，四列里要给单号留够位置 ---------- */
html:not([data-layout="mobile"]) {
  .order-query__chips .waybill__chip {
    gap: 6px;
    padding-left: 10px;
    font-size: calc(13px * var(--type-boost));
  }

  .order-query__chips .waybill__chip button {
    padding: 0 8px;
    font-size: calc(12px * var(--type-boost));
  }
}
