/* ============================================================
   首屏 v2：左侧功能按钮 + 右侧效果图（悬停/聚焦切换）
   仅首页引用（web/index.html）
   - 不要写入 web/css/style.css（生成文件）
   - 独立新文件 URL，可绕开 custom.css 的 CDN 旧缓存
   ============================================================ */

.hero-v2 {
  background-color: #f5faff;
  background-image:
    radial-gradient(48% 62% at 88% -6%, rgba(111, 225, 243, 0.26) 0%, rgba(111, 225, 243, 0) 68%),
    radial-gradient(38% 50% at 0% 16%, rgba(4, 69, 243, 0.14) 0%, rgba(4, 69, 243, 0) 70%),
    radial-gradient(36% 46% at 74% 96%, rgba(30, 161, 241, 0.18) 0%, rgba(30, 161, 241, 0) 72%),
    linear-gradient(180deg, #f7fbff 0%, #f1f8ff 52%, #f5faff 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* 方案B：整组（文案 + 效果图）在首屏内上下居中。
     上下留白对称 + flex 居中，内容比视口高时自然撑开，顶部仍留出固定头部高度 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 158px;
  padding-bottom: 158px;
  min-height: 100vh;
  min-height: 100svh;
}

/* ============================================================
   版心对齐（2026-11-09）：首屏左区（主标题 / 副标题 / 功能按钮）
   与站点 .container 使用同一条左边界；宽屏不再把整组居中。
   基准宽度跟随 bootstrap 断点，改这里即可调整对齐线。
   ============================================================ */
.hero-v2 {
  --hero-container-w: 1320px;               /* >=1400px */
  --hero-right-pad: clamp(12px, 2vw, 28px); /* 右侧收紧，让效果图右出血 */
}

@media (max-width: 1399.98px) { .hero-v2 { --hero-container-w: 1140px; } }
@media (max-width: 1199.98px) { .hero-v2 { --hero-container-w: 960px;  } }
@media (max-width: 991.98px)  { .hero-v2 { --hero-container-w: 720px;  } }
@media (max-width: 767.98px)  { .hero-v2 { --hero-container-w: 540px;  } }
@media (max-width: 575.98px)  { .hero-v2 { --hero-container-w: 100%;   } }

.hero-v2 > .container {
  max-width: none;
  /* 版心居中偏移 + 容器自身 12px 内边距 = 与 .container 内容左边界严格一致 */
  padding-left: calc((100% - var(--hero-container-w)) / 2 + 12px);
  padding-right: var(--hero-right-pad);
}

.hero-v2-grid {
  display: grid;
  /* 左栏宽度跟着「整体比例」一起放大，否则按钮放大后会横向溢出 */
  grid-template-columns: minmax(0, min(calc(500px * var(--hero-fn-scale, 1)), 66%)) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
  /* 不再使用 1664 居中：宽度交给容器，整组左贴版心，效果图右出血 */
  max-width: none;
  margin-inline: 0;
}

.hero-v2-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(34px, 4vh, 56px);
  min-width: 0;
}

/* 左侧标题块：主标题 + 副标题，纯色 */
.hero-heading-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* 文字行撑满左栏，副标题才能正常换行；否则 flex-start 会按 max-content 排，移动端会溢出 */
.hero-heading-block > * {
  width: 100%;
  max-width: 100%;
}

/* 显式声明左对齐，避免以后父级 text-align 变化时被继承污染 */
.hero-heading-block,
.hero-heading-block > .hero-title-line {
  text-align: left;
}

.hero-v2 .hero-title-line {
  margin: 0;
  padding: 0;
  color: var(--hero-title-color, #0b0b0c);
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  letter-spacing: -0.02em;
  line-height: 1.05;
  white-space: normal;
}

.hero-banner.hero-v2 .hero-title-line {
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}

.hero-v2 .hero-title-line-1 {
  display: block;
  /* style.css 里 h1 有 font-size: ... !important，这里必须同样 !important 才能让后台字号生效 */
  font-size: clamp(56px, 7vw, 120px) !important;
  font-size: clamp(var(--hero-title-min, 40px), var(--hero-title-fluid, 11.111vw), var(--hero-title-size, 120px)) !important;
  font-weight: 900;
  line-height: 1.02;
}

.hero-v2 .hero-title-line-2 {
  display: block;
  margin-top: 24px;
  font-size: clamp(16px, 1.667vw, 24px) !important;
  font-size: clamp(var(--hero-subtitle-min, 16px), var(--hero-subtitle-fluid, 1.667vw), var(--hero-subtitle-size, 24px)) !important;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--hero-subtitle-color, #0b0b0c);
  overflow-wrap: anywhere;
}

.hero-fn-list {
  /* 尺寸 token：基准 px + 全局比例 --hero-fn-scale（后台「整体比例」，由 site-config.js 写到 .hero-banner 上）。
     改比例时下面所有尺寸一起乘，不会再出现「只放大文字」的情况。 */
  --fn: var(--hero-fn-scale, 1);
  --fn-h: 62px;
  --fn-icon: 46px;
  --fn-img: 30px;
  --fn-icon-radius: 13px;
  --fn-pad-y: 8px;
  --fn-pad-l: 8px;
  --fn-pad-r: 22px;
  --fn-pad-text-only: 20px;
  --fn-gap: 12px;
  --fn-text-gap: 3px;
  --fn-label: 18px;
  --fn-sub: 13px;
  --fn-row-gap: 12px;
  --fn-col-gap: 14px;

  display: grid;
  /* 两列都按内容宽度收缩：按钮不再撑满整格，右侧不留大片空白 */
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: start;
  gap: calc(var(--fn-row-gap) * var(--fn)) calc(var(--fn-col-gap) * var(--fn));
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-fn-list > li {
  display: flex;
  min-width: 0;
}

/* 后台约定用偶数个按钮；万一是奇数，最后一个横跨两列，避免单格悬空 */
.hero-fn-list > li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* 功能按钮：浅色渐变底 + 彩色图标块 + 主标题/副标题两行。
   高度、图标、字号、内边距、间距全部按 --fn 等比缩放，宽度由内容自然撑开。 */
.hero-fn-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--fn-gap) * var(--fn));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(var(--fn-h) * var(--fn));
  padding: calc(var(--fn-pad-y) * var(--fn)) calc(var(--fn-pad-r) * var(--fn)) calc(var(--fn-pad-y) * var(--fn)) calc(var(--fn-pad-l) * var(--fn));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--hero-pill-bg, #eef2ff);
  color: var(--hero-pill-text, #1b2030);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: calc(var(--fn-label) * var(--fn));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(0);
  box-shadow:
    0 calc(10px * var(--fn)) calc(22px * var(--fn)) calc(-14px * var(--fn)) rgba(24, 36, 84, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero-fn-pill.is-active {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 3px var(--hero-pill-ring, rgba(47, 85, 232, 0.28)),
    0 calc(14px * var(--fn)) calc(28px * var(--fn)) calc(-16px * var(--fn)) rgba(24, 36, 84, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 图标块：底板颜色取图标底色（缺省用按钮强调色），白色图标才能显出来 */
.hero-fn-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--fn-icon) * var(--fn));
  height: calc(var(--fn-icon) * var(--fn));
  border-radius: calc(var(--fn-icon-radius) * var(--fn));
  background: var(--hero-icon-bg, var(--hero-pill-accent, rgba(17, 24, 39, 0.88)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.hero-fn-icon img {
  display: block;
  width: calc(var(--fn-img) * var(--fn));
  height: calc(var(--fn-img) * var(--fn));
  object-fit: contain;
}

/* 没有独立图标时只显示文字，左侧内边距与右边缘对齐 */
.hero-fn-pill--text-only {
  padding-left: calc(var(--fn-pad-text-only) * var(--fn));
}

.hero-fn-text {
  display: flex;
  flex-direction: column;
  gap: calc(var(--fn-text-gap) * var(--fn));
  min-width: 0;
  text-align: left;
}

.hero-fn-label {
  color: inherit;
  font-size: calc(var(--fn-label) * var(--fn));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-fn-sub {
  color: inherit;
  font-size: calc(var(--fn-sub) * var(--fn));
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  opacity: 0.6;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: hover) and (pointer: fine) {
  .hero-fn-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow:
      0 calc(14px * var(--fn)) calc(26px * var(--fn)) calc(-14px * var(--fn)) rgba(24, 36, 84, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
    z-index: 3;
  }
}

.hero-fn-pill:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.14);
}

.hero-fn-pill:focus-visible {
  outline: 2px solid var(--hero-pill-accent, #111827);
  outline-offset: 3px;
}

/* 右侧效果图：双层 img 交叉淡入，避免切换时闪白 */
.hero-v2-showcase {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hero-v2-showcase::before {
  content: "";
  position: absolute;
  inset: 10% 6% 6%;
  border-radius: 32px;
  background: radial-gradient(58% 58% at 68% 18%, rgba(30, 161, 241, 0.16) 0%, rgba(30, 161, 241, 0) 72%);
  filter: blur(28px);
  pointer-events: none;
}

.hero-showcase {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  /* 宽度定尺寸：图宽最多 1100（上传基准宽），高度随图片比例自适应 */
  height: auto;
  max-width: 1100px;
  margin-inline: auto 0; /* 宽屏时效果图贴右（原为居中） */
}

.hero-showcase-img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
  transition: opacity 0.34s ease, transform 0.34s ease;
  filter: drop-shadow(0 26px 50px rgba(30, 40, 80, 0.16));
}

.hero-showcase-img.is-active {
  opacity: 1;
  transform: scale(1);
}

/* 左侧整体停用：藏掉按钮列，效果图铺满 */
.hero-v2.hero-v2-no-nav .hero-v2-grid {
  grid-template-columns: minmax(0, 1fr);
}

.hero-v2.hero-v2-no-nav .hero-v2-nav {
  display: none;
}


/* 中屏：收窄按钮列 */
@media (max-width: 1199.98px) {
  .hero-v2-grid {
    grid-template-columns: minmax(0, calc(460px * var(--hero-fn-scale, 1))) minmax(0, 1fr);
    gap: 36px;
  }

  .hero-fn-list {
    --fn-h: 58px;
    --fn-icon: 44px;
    --fn-img: 28px;
    --fn-icon-radius: 12.5px;
    --fn-pad-y: 7px;
    --fn-pad-l: 7px;
    --fn-pad-r: 20px;
    --fn-pad-text-only: 19px;
    --fn-gap: 11px;
    --fn-label: 17px;
    --fn-sub: 12.5px;
  }
}

/* 平板/手机：上下堆叠，按钮整行 */
@media (max-width: 991.98px) {
  .hero-v2 {
    padding-top: 132px;
    padding-bottom: 48px;
    min-height: auto;
  }

  /* 堆叠布局：左右留白对称，图为满宽 */
  .hero-v2 > .container {
    padding-right: calc((100% - var(--hero-container-w)) / 2 + 12px);
  }

  .hero-v2-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    min-height: 0;
  }

  .hero-v2-nav {
    order: 1;
    gap: 28px;
  }

  .hero-v2-showcase {
    order: 2;
  }

  .hero-fn-list {
    --fn-h: 54px;
    --fn-icon: 42px;
    --fn-img: 27px;
    --fn-icon-radius: 12px;
    --fn-pad-y: 7px;
    --fn-pad-l: 7px;
    --fn-pad-r: 18px;
    --fn-gap: 10px;
    --fn-label: 16.5px;
    --fn-sub: 12px;
    --fn-row-gap: 12px;
    --fn-col-gap: 14px;
  }

  .hero-fn-list > li {
    width: auto;
  }

  .hero-fn-pill {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .hero-fn-list {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(var(--fn-row-gap) * var(--fn));
    --fn-h: 56px;
    --fn-icon: 44px;
    --fn-img: 28px;
    --fn-gap: 11px;
    --fn-label: 17px;
    --fn-sub: 12.5px;
  }

  .hero-fn-pill {
    width: 100%;
  }

  .hero-v2-showcase::before {
    display: none;
  }
}

/* 无障碍：尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .hero-fn-pill,
  .hero-fn-pill:hover,
  .hero-fn-pill:active,
  .hero-showcase-img {
    transition: none;
  }

  .hero-fn-pill:hover,
  .hero-fn-pill:active {
    transform: none;
  }

  .hero-showcase-img {
    transform: none;
  }
}
