/* ========== 第七屏 howcan（完整可替换版） ========== */

/* 布局与尺寸（创建独立堆叠上下文，避免遮挡后续内容） */
.howcan {
  min-height: clamp(560px, 92svh, 980px);
  margin-bottom: clamp(9rem, 10vw, 12rem);
  display: grid;
  place-items: center;
  padding: 2rem;
  box-sizing: border-box;

  position: relative;
  overflow: hidden;

  /* 关键：新建堆叠上下文，防止内部绝对定位层盖住后续页面 */
  isolation: isolate;
  z-index: 0;
}

/* 内部容器（不改 HTML，JS 会给它加 .hc-box） */
.howcan>div {
  max-width: 1470px;
  width: 100%;
  text-align: center;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 12px;

  /* 内容层始终高于装饰层 */
  position: relative;
  z-index: 2;
}

/* 标题基础样式 */
.howcan h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.8;
  text-align: center;
  color: #4a9f94;
  margin: 0;

  /* 内容层 */
  position: relative;
  z-index: 2;
}

/* 响应式 */
@media (max-width: 768px) {
  .howcan {
    min-height: clamp(400px, 80svh, 700px);
    padding: 1rem;
  }

  .howcan>div {
    padding: clamp(1.5rem, 4vw, 2.5rem);
  }

  .howcan h2 {
    line-height: 1.6;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
}

/* 性能优化：JS 自动挂的 class */
.howcan>div.hc-box {
  will-change: opacity, transform, filter, clip-path;
}

.howcan h2.hc-title {
  will-change: opacity, transform, clip-path;
}

/* —— 回退初始态（无 GSAP 时）—— */
.howcan.__pending .hc-box {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  filter: blur(6px);
  clip-path: circle(0% at 50% 58%);
  transition:
    opacity .8s ease,
    transform .8s ease,
    filter .8s ease,
    clip-path 1s ease;
}

.howcan.__pending .hc-title {
  opacity: 0;
  transform: translateX(18px);
  clip-path: inset(0 100% 0 0);
  transition:
    opacity .6s ease .1s,
    transform .6s ease .1s,
    clip-path .9s ease .15s;
}

/* —— 可见态（无 GSAP 时）—— */
.howcan.__visible .hc-box {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  clip-path: circle(140% at 50% 58%);
}

.howcan.__visible .hc-title {
  opacity: 1;
  transform: translateX(0);
  /* clip-path: inset(0 0% 0 0); */
}

/* —— 纸面光晕叠加层（装饰层，低于内容） —— */
.howcan::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 420px at 50% 58%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(1200px 640px at 85% 75%, rgba(34, 108, 89, .08), transparent 62%);
  opacity: .0;
  transition: opacity .8s ease;

  /* 装饰层级：低于内容；不吃鼠标事件 */
  z-index: 1;
  pointer-events: none;
}

.howcan.__visible::before {
  opacity: .28;
}

/* —— 第六屏末尾“孢子”粒子（装饰层，低于内容） —— */
.mo-spores {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.mo-spore {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(34, 108, 89, .25);
  filter: blur(.5px);
  opacity: 0;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* ================== 标题逐字与高光（重点修复） ================== */

/* 1) 不再裁切，避免逐字上抬时出现横向被切一条的问题 */
.howcan .text7 {
  position: relative;
  display: inline-block;
  overflow: visible;
  /* 修复：原来容易写成 hidden */
  line-height: 1.45;
  /* 给上抬动画留余量 */
  z-index: 2;
  /* 内容层 */
}

/* 2) 逐字容器（JS 会把每个字符包成 .ch） */
.howcan .text7 .ch {
  display: inline-block;
  transform: translateY(0.9em);
  opacity: 0;
  will-change: transform, opacity;
}

/* 3) 空格稳定占位（JS 已把空格转为 NBSP 并加 .space） */
.howcan .text7 .ch.space {
  transform: none !important;
  opacity: 1 !important;
  display: inline-block;
  width: 0.33em;
  /* 不同字体下更稳，可按需微调 */
}

/* 4) 无 GSAP 的回退：根据 --i 做阶梯延迟 */
.howcan.__visible .text7 .ch {
  transform: translateY(0);
  opacity: 1;
  transition:
    transform .55s cubic-bezier(.22, .9, .2, 1),
    opacity .55s ease;
  transition-delay: calc(var(--i, 0) * 40ms + 80ms);
}

/* 5) 一次性高光（入场时触发 __shine） */
.howcan .text7::after {
  content: "";
  position: absolute;
  inset: 0 -8%;
  background: linear-gradient(75deg,
      transparent 0%,
      rgba(255, 255, 255, 0) 35%,
      rgba(255, 255, 255, .35) 50%,
      rgba(255, 255, 255, 0) 65%,
      transparent 100%);
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.howcan.__shine .text7::after {
  animation: text7Shine 900ms ease-out 120ms both;
}

@keyframes text7Shine {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }

  12% {
    opacity: .55;
  }

  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .howcan .text7 .ch {
    transform: none !important;
    opacity: 1 !important;
  }

  .howcan::before {
    opacity: .12 !important;
  }
}

/* =====（可选）若页面有固定背景层，建议放到更底层 ===== */
/* .bg-third{ position: fixed; inset: 0; z-index: -1; pointer-events: none; } */