/* ==========================================================================
   hero-full.css
   首页第一屏五张全幅图片轮播、三秒进度线与底部四项业务入口。
   控制区域：.hero-stage / .hero-full / .hero-full__carousel / .business-entry。
   关键布局：手机/平板按宽度自然 16:9；电脑端高度先由自身宽度按 16:9 推导，
             再用 max-height 限制为「视口高度 - 导航 - 业务带 - 1px」，
             并设 min-height 保底（极矮窗口改为纵向滚动）。
             这样进度线和四项业务入口尽量留在首屏内，上下裁切受控。
             四项业务入口紧接轮播下方。
   图片规则：assets/images/hero-full/hero-01.webp … hero-05.webp，
             推荐 2560×1440（16:9），最低 1920×1080。
             固定路径，直接覆盖同名文件即可换图，不需要修改代码。
   修改注意：轮播间隔在 index.html 的 data-interval；进度线时长由 JS 写入 CSS 变量。
             图片使用 cover 铺满 16:9 容器，不拉伸、不使用模糊背景补边。
             轮播只自动播放，没有箭头、点击、键盘和滑动切换。
             不要加入滚轮劫持或强制整屏滚动。
   ========================================================================== */

/* 第一屏骨架：轮播按固定比例决定高度，业务入口紧接其下。
   不再用 100vh/100svh 强制轮播占满首屏；仅在电脑端用于计算首屏可用高度。 */
.hero-stage {
  display: flex;
  flex-direction: column;
  background: var(--brand-950);
}

/* 轮播容器：手机/平板按宽度自然 16:9；
   电脑端在下方 @media (min-width:981px) 再按首屏可用高度限制。
   16:9 是“上传图片标准”，电脑显示容器可以因首屏高度而适当缩短。 */
.hero-full {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--brand-950);
  color: #fff;
  isolation: isolate;
}

.hero-full__carousel {
  position: absolute;
  inset: 0;
  right: auto;
  left: 50%;
  z-index: 1;
  width: var(--hero-content-width, 100%);
  transform: translateX(-50%);
  --hero-slide-duration: 3000ms;
  touch-action: pan-y;
  animation: heroFullIn 0.5s var(--ease) both;
}

.hero-full__slides {
  position: absolute;
  inset: 0;
}

.hero-full__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  background: var(--brand-950);
  transition: opacity 0.55s var(--ease), visibility 0s linear 0.55s;
}

.hero-full__slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s var(--ease), visibility 0s;
}

/* 图片未上传时的中性占位，不冒充真实产品 */
.hero-full__placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 90px 24px 120px;
  background:
    radial-gradient(circle at 72% 30%, rgba(69, 213, 201, 0.12), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(10, 127, 123, 0.18), transparent 32%),
    linear-gradient(150deg, #0b565b 0%, #042f35 72%);
}

.hero-full__placeholder::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(69, 213, 201, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 213, 201, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
  pointer-events: none;
}

.hero-full__placeholder-label {
  padding: 5px 12px;
  border: 1px solid rgba(69, 213, 201, 0.24);
  border-radius: 999px;
  color: rgba(69, 213, 201, 0.66);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.hero-full__placeholder-note {
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  text-align: center;
}

/* 图片层 */
.hero-full__picture {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}

.hero-full__slide.has-media .hero-full__picture {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s var(--ease), visibility 0s;
}

.hero-full__slide.has-media .hero-full__placeholder {
  opacity: 0;
  visibility: hidden;
}

/* 图片铺满容器：比例一致时不裁切；比例不一致时只裁边缘，不拉伸。 */
.hero-full__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 底部五条进度线：只显示自动轮播进度，不可点击 */
.hero-full__footer {
  position: absolute;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  padding-inline: 18px;
  pointer-events: none;
}

.hero-full__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.hero-full__progress-item {
  width: clamp(55px, 5vw, 72px);
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.hero-full__progress-track {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  transition: background-color 0.25s var(--ease);
}

.hero-full__progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-400);
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-full__progress-item.is-active .hero-full__progress-track {
  background: rgba(255, 255, 255, 0.38);
}

.hero-full__progress-item.is-active .hero-full__progress-fill {
  animation: heroProgress var(--hero-slide-duration, 3000ms) linear forwards;
}

.hero-full__carousel.is-paused .hero-full__progress-item.is-active .hero-full__progress-fill {
  animation-play-state: paused;
}

@keyframes heroFullIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes heroProgress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* --------------------------------------------------------------------------
   第一屏底部核心业务入口：紧接轮播下方，不参与轮播高度计算
   -------------------------------------------------------------------------- */

.business-entry {
  display: flex;
  flex: 0 0 auto;
  min-height: 96px;
  border-top: 1px solid rgba(69, 213, 201, 0.16);
  background: #063b42;
  color: #fff;
}

.business-entry__inner {
  display: flex;
  width: 100%;
}

.business-entry__list {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-entry__item {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  transition: color 0.25s var(--ease);
}

.business-entry__item+.business-entry__item {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.business-entry__item::after {
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: 36px;
  height: 2px;
  background: var(--brand-400);
  content: "";
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease);
}

.business-entry__item:hover {
  color: #fff;
}

.business-entry__item:hover::after,
.business-entry__item:focus-visible::after,
.business-entry__item.is-active::after {
  transform: translateX(-50%) scaleX(1);
}

.business-entry__item:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: -2px;
}

.business-entry__item.is-active {
  color: var(--brand-400);
}

.business-entry__title {
  font-size: clamp(18px, 1.35vw, 21px);
  font-weight: 700;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   手机与窄屏
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .business-entry {
    flex: 0 0 auto;
    min-height: 0;
  }

  .hero-full__placeholder {
    padding: 0 20px 96px;
  }

  .hero-full__footer {
    bottom: max(12px, env(safe-area-inset-bottom));
    padding-inline: 14px;
  }

  .hero-full__progress {
    gap: 6px;
  }

  .hero-full__progress-item {
    width: 44px;
    height: 44px;
  }
}

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

  .hero-full__carousel,
  .hero-full__slide,
  .hero-full__picture,
  .hero-full__slide.is-active,
  .hero-full__slide.has-media .hero-full__picture {
    animation: none;
    transition: none;
  }

  .hero-full__slide.is-active.has-media .hero-full__img {
    transition: none;
  }

  .hero-full__progress-item.is-active .hero-full__progress-fill {
    animation: none;
    transform: scaleX(1);
  }

  .hero-full__progress-track {
    transition: none;
  }

  .business-entry__item,
  .business-entry__item::after {
    transition: none;
  }

  .business-entry__item:hover {
    transform: none;
  }
}

/* ==========================================================================
   桌面端首屏高度约束
   轮播显示高度 = min(按自身宽度推导的 16:9 高度, 首屏可用高度)，且不低于保底高度。
   首屏可用高度 = 视口高度 - 导航高度 - 四项业务带高度 - 1px 导航下边框。
   为什么不用 100vw 计算：Windows 等平台 100vw 含竖向滚动条宽度，
   会让容器比 16:9 略宽，造成本可避免的横向裁切（实测 1024×768、1080×845 约 1.4%–1.5%）。
   改用 aspect-ratio + max-height 后，高度直接由元素真实宽度推导，宽度变化连续、无断点跳变。
   min-height 是极矮窗口的保底：低于此高度时宁可页面纵向滚动，
   也不把宣传图压成缩略图（保底值只在视口高度 < 约 477px 时生效）。
   16:9 仍是上传图片标准；显示容器在电脑端允许上下裁切。
   ========================================================================== */
@media (min-width: 981px) {
  :root {
    --hero-band-h: 64px;
    --hero-min-h: 340px;
  }

  .hero-full {
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - var(--header-h) - var(--hero-band-h) - 1px);
    max-height: calc(100svh - var(--header-h) - var(--hero-band-h) - 1px);
    min-height: var(--hero-min-h);
  }

  .business-entry {
    flex: 0 0 auto;
    min-height: var(--hero-band-h);
  }

  .business-entry__item {
    padding: 10px 20px;
  }

  .business-entry__item::after {
    bottom: 10px;
  }

  .business-entry__title {
    font-size: clamp(15px, 1.15vw, 18px);
  }
}

/* ==========================================================================
   超宽屏（21:9 及以上）CSS 回退
   16:9 图片在 21:9/32:9 上如果强行全宽，会被上下裁掉 25% 以上。
   这里用一个无 JS 时的回退：按可用高度计算 16:9 内容宽度并居中。
   断点与 JS 保持一致（桌面端 981px 起才生效，此时 --hero-band-h 等变量才存在），
   避免平板/手机横屏误用电脑端的高度变量。
   实际的连续平滑过渡由 hero-full-carousel.js 的轻量 ResizeObserver 完成，
   避免在 21:9 临界点出现内容宽度突然跳变。普通 16:9 电脑不受影响。
   ========================================================================== */
@media (min-width: 981px) and (min-aspect-ratio: 21/9) {
  .hero-full__carousel {
    --hero-content-width: min(
      100%,
      calc((100svh - var(--header-h) - var(--hero-band-h) - 1px) * 16 / 9)
    );
  }
}