/*
 * 首页 Banner 文字与遮罩样式（2026-11 改版）
 * 只作用于首页轮播：所有选择器都以 .chb- 前缀的新类名开头，不影响站内其它元素。
 * 设计稿基准宽度 1920px；桌面端按 --chb-u（1 设计像素）等比缩放，≤1199px 单独设计移动端布局。
 */

@font-face {
  font-family: "CivenHeroInter";
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CivenHeroInter";
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CivenHeroInter";
  src: url("../fonts/inter-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.chb-hero {
  /*
   * 1 个设计像素。设计稿画布 1920×1000：按宽、高两者中较小的比例缩放，
   * 屏幕偏矮时整体等比缩小，避免文字过多的幻灯片顶到导航。最小 0.625px，最大 1.25px。
   */
  --chb-u: clamp(0.625px, min(0.052083vw, 0.1vh), 1.25px);
  --chb-header: max(5.2604vw, 63px);
  background: #07182c;
}

/* 新 Banner 使用自己的遮罩层，关闭原来的蓝色色块 */
.home-hero__slide.chb-slide::before {
  display: none;
}

.chb-slide {
  background-color: #07182c;
}

/* ---------- 背景图 ----------
 * 每张幻灯片两个图片块：
 * .chb-bg--pc  电脑端图片（后台字段 hdtp）：电脑、横屏设备显示
 * .chb-bg--m   手机端图片（后台字段 sjbannert）：竖屏手机 / 平板显示
 * 图片地址由模板写在 --bg 变量里，这里作为背景图显示：被 display:none 隐藏的那一张，浏览器不会下载。
 */
.chb-bg {
  position: absolute;
  inset: 0;
  display: block;
  background-image: var(--bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.chb-bg--m {
  display: none;
}

/* 横屏平板 / 手机：电脑图偏右显示，与原来的效果一致 */
@media (max-width: 1199px) {
  .chb-bg {
    background-position: 70% center;
  }
}

/* 竖屏手机 / 平板：隐藏电脑图，显示手机图（从顶部对齐，保留上部主体） */
@media (max-width: 1199px) and (orientation: portrait) {
  .chb-bg--pc {
    display: none;
  }

  .chb-bg--m {
    display: block;
    background-position: center bottom;
  }
}

/* ---------- 遮罩层 ---------- */
.chb-scrim,
.chb-tint,
.chb-vign {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 深海军蓝渐变：保证文字可读 */
.chb-scrim {
  background: linear-gradient(90deg,
      rgba(4, 13, 26, .95) 0%,
      rgba(4, 13, 26, .91) 30%,
      rgba(5, 18, 34, .78) 46%,
      rgba(6, 24, 44, .50) 60%,
      rgba(6, 24, 44, .16) 74%,
      rgba(6, 24, 44, 0) 86%);
}

/* 左侧品牌蓝微光 */
.chb-tint {
  background: radial-gradient(120% 140% at -8% 50%,
      rgba(11, 88, 173, .42) 0%,
      rgba(11, 88, 173, .14) 38%,
      rgba(11, 88, 173, 0) 62%);
}

/* 上下暗角 */
.chb-vign {
  background: linear-gradient(180deg,
      rgba(4, 14, 27, .34) 0%,
      rgba(4, 14, 27, 0) 26%,
      rgba(4, 14, 27, 0) 78%,
      rgba(4, 14, 27, .30) 100%);
}

/* ---------- 文字内容 ---------- */
.chb-content {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(168 * var(--chb-u));
  width: calc(1000 * var(--chb-u));
  color: #fff;
  font-family: "CivenHeroInter", "Inter", "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translateY(-50%);
}

.chb-eyebrow {
  display: flex;
  align-items: flex-start;
  gap: calc(18 * var(--chb-u));
  margin: 0;
  color: #9dc6f2;
  font-size: max(12px, calc(19 * var(--chb-u)));
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .20em;
  text-transform: uppercase;
}

.chb-eyebrow::before {
  flex: none;
  width: calc(44 * var(--chb-u));
  height: 2px;
  /* 与第一行文字的中线对齐（行高 1.4 → 0.7em） */
  margin-top: calc(.7em - 1px);
  content: "";
  background: #9dc6f2;
}

.home-hero .chb-title {
  margin: calc(34 * var(--chb-u)) 0 0;
  color: #fff;
  font-family: inherit;
  font-size: calc(72 * var(--chb-u));
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.016em;
  text-shadow: 0 2px 24px rgba(3, 10, 20, .45);
}

.chb-rule {
  display: block;
  width: calc(96 * var(--chb-u));
  height: 3px;
  margin-top: calc(36 * var(--chb-u));
  background: rgba(255, 255, 255, .55);
}

.chb-summary {
  max-width: max(420px, calc(660 * var(--chb-u)));
  margin: calc(30 * var(--chb-u)) 0 0;
  color: rgba(255, 255, 255, .80);
  font-size: max(15px, calc(23 * var(--chb-u)));
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: .004em;
  text-shadow: 0 1px 12px rgba(3, 10, 20, .55);
}

.chb-cta {
  display: inline-flex;
  align-items: center;
  gap: calc(14 * var(--chb-u));
  height: max(44px, calc(56 * var(--chb-u)));
  margin-top: calc(46 * var(--chb-u));
  padding: 0 max(24px, calc(34 * var(--chb-u)));
  color: #fff;
  font-size: max(12px, calc(15 * var(--chb-u)));
  font-weight: 600;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 999px;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.chb-cta svg {
  flex: none;
  width: max(14px, calc(16 * var(--chb-u)));
  height: max(14px, calc(16 * var(--chb-u)));
  transition: transform 200ms ease;
}

.chb-cta:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .85);
}

.chb-cta:hover svg {
  transform: translateX(3px);
}

.chb-cta:focus-visible {
  outline: 3px solid var(--focus, #ffbf47);
  outline-offset: 4px;
}

/* ---------- 桌面端（导航悬浮在 Banner 上方） ---------- */
@media (min-width: 1200px) {

  /*
   * 文字块限定在「导航下方 ~ 轮播圆点上方」的区域内垂直居中，
   * 标题较长、行数较多的幻灯片会自动上移，不会压到轮播圆点。
   */
  .chb-content {
    top: var(--chb-header);
    bottom: calc(5.2083vw + max(.5208vw, 9px) + 40 * var(--chb-u));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    justify-content: safe center;
    transform: none;
  }

  /* 轮播圆点与文字左对齐 */
  .chb-hero .home-hero__pagination {
    left: calc(168 * var(--chb-u));
  }
}

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

  /* 文字放到画面下方，上方露出产品图；遮罩改为自上而下加深 */
  .chb-scrim {
    background: linear-gradient(180deg,
        rgba(4, 13, 26, .32) 0%,
        rgba(4, 13, 26, .50) 24%,
        rgba(4, 13, 26, .80) 50%,
        rgba(4, 13, 26, .94) 100%);
        display: none;
  }

  .chb-tint {
    background: radial-gradient(140% 90% at 0% 100%,
        rgba(11, 88, 173, .40) 0%,
        rgba(11, 88, 173, .12) 45%,
        rgba(11, 88, 173, 0) 70%);
        display: none;
  }

  .chb-vign {
    background: linear-gradient(180deg, rgba(4, 14, 27, .28) 0%, rgba(4, 14, 27, 0) 22%);
    display: none;
  }

  .chb-content {
    top: auto;
    right: 24px;
    bottom: 92px;
    left: 24px;
    width: auto;
    max-width: 680px;
    transform: none;
  }

  .chb-eyebrow {
    gap: 12px;
    font-size: 13px;
    letter-spacing: .18em;
    /* 背景较亮时保证小标题可读 */
    text-shadow: 0 1px 8px rgba(3, 10, 20, .75);
  }

  .chb-eyebrow::before {
    width: 32px;
  }

  .home-hero .chb-title {
    margin-top: 18px;
    font-size: clamp(32px, 6.4vw, 52px);
    line-height: 1.14;
    letter-spacing: -.012em;
  }

  .chb-rule {
    width: 64px;
    height: 2px;
    margin-top: 22px;
  }

  .chb-summary {
    display: -webkit-box;
    max-width: 560px;
    margin-top: 18px;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.6;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .chb-cta {
    gap: 12px;
    height: 48px;
    margin-top: 28px;
    padding: 0 26px;
    font-size: 13px;
  }

  .chb-cta svg {
    width: 15px;
    height: 15px;
  }
}

/* ---------- 手机（≤600px） ---------- */
@media (max-width: 600px) {
  .chb-content {
    right: 20px;
    bottom: 350px;
    left: 20px;
  }

  .chb-hero .home-hero__pagination {
    left: 20px;
  }

  .chb-eyebrow {
    gap: 10px;
    font-size: 12px;
    letter-spacing: .16em;
  }

  .chb-eyebrow::before {
    width: 26px;
  }

  .home-hero .chb-title {
    margin-top: 14px;
    font-size: clamp(28px, 8.4vw, 38px);
    line-height: 1.16;
  }

  /* 手机上让标题自然换行，不使用桌面端的强制换行 */
  .chb-br {
    display: none;
  }

  .chb-rule {
    width: 52px;
    margin-top: 18px;
  }

  .chb-summary {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.58;
  }

  .chb-cta {
    height: 44px;
    margin-top: 24px;
    padding: 0 22px;
    font-size: 12px;
    letter-spacing: .1em;
  }
}

/* 屏幕较矮时（横屏手机、小屏机）压缩摘要行数 */
@media (max-width: 1199px) and (max-height: 640px) {
  .chb-content {
    bottom: 72px;
  }

  .home-hero .chb-title {
    font-size: clamp(26px, 5.2vw, 40px);
  }

  .chb-summary {
    -webkit-line-clamp: 3;
  }

  .chb-cta {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .chb-cta,
  .chb-cta svg {
    transition: none;
  }
}
