/* ============================================================
   阶段 22 · 首页首屏（hero）
   ① 后台上传的背景图横向满屏铺底
   ② 深蓝 → 浅蓝渐变：未上传时作默认背景，上传后作叠加遮罩
   ③ 文字 / 按钮改成深色底上的白字配色
   ④ 右侧图片底边与背景底边对齐
   本文件只在 index.html / p.html 引入；site.css 一行未改。
   ============================================================ */

/* ---------- 1. 满屏背景 ---------- */
.hero{
  position:relative;
  isolation:isolate;          /* 背景层与内容层锁在同一个层叠上下文里 */
  padding-bottom:0;           /* 右侧图片底边要贴到背景底边 */
  border-bottom:0;            /* 原 1px 浅线会把图片和背景底边隔开 */
  background:linear-gradient(105deg,
    #062247 0%, #123C78 38%, #2E72BE 72%, #8FC6EC 100%);
}
.hero > .wrap{position:relative;z-index:1}

/* ---------- 2. 后台上传的背景图 ---------- */
.hero__bg{
  position:absolute;inset:0;z-index:0;
  overflow:hidden;pointer-events:none;
}
.hero__bgimg{
  width:100%;height:100%;display:block;
  object-fit:cover;object-position:center;
}
/* 深蓝→浅蓝叠加：左侧压深保证白字清晰，右侧让上传的图透出来。
   后台「背景压暗程度」= 0/1/2/3 分别对应下面四档透明度。 */
.hero__bg::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(105deg,
    rgba(6,34,71,.96) 0%, rgba(10,48,96,.88) 38%,
    rgba(24,78,142,.46) 72%, rgba(40,110,180,.10) 100%);
  opacity:var(--hero-shade,.8);
}
.hero--shade0 .hero__bg::after{opacity:0}
.hero--shade1 .hero__bg::after{opacity:.45}
.hero--shade2 .hero__bg::after{opacity:.8}
.hero--shade3 .hero__bg::after{opacity:1}

/* ---------- 3. 深色底上的文字与按钮 ---------- */
.hero .eyebrow{color:#8FD6E8}
.hero .hero__title{color:#FFFFFF}
.hero .hero__title em{color:#8FCAD0}
.hero .hero__en{color:rgba(255,255,255,.64)}
.hero .hero__lead{color:rgba(255,255,255,.85)}
.hero .hero__actions .btn--solid{
  background:#FFFFFF;border-color:#FFFFFF;color:#123C78;
}
.hero .hero__actions .btn--solid:hover{
  background:#E7F1FF;border-color:#E7F1FF;color:#0B2A54;
}
.hero .hero__actions .btn--ghost{
  background:transparent;border-color:rgba(255,255,255,.62);color:#FFFFFF;
}
.hero .hero__actions .btn--ghost:hover{
  background:rgba(255,255,255,.12);border-color:#FFFFFF;color:#FFFFFF;
}

/* ---------- 4. 右侧图片底边贴齐背景底边 ---------- */
/* site.css 原值是 margin:0 0 60px 0，图片下方留了 60px 白/底色；归零后
   align-self:end 让 figure 底边 == grid 行底 == .hero 底边（padding/border 均为 0）。 */
.hero .hero__figure{margin:0;align-self:end}

/* ---------- 5. 响应式：单列时图片在文字上方，整体压深保证白字可读 ---------- */
@media (max-width:980px){
  /* 单列时文字占满全宽，底部留一点呼吸位，别让次按钮贴着深色区域边缘 */
  .hero{
    padding-bottom:28px;
    background:linear-gradient(165deg,#062247 0%,#1A4E93 100%);
  }
  .hero__bg::after{
    background:linear-gradient(180deg,
      rgba(6,34,71,.90) 0%, rgba(10,48,96,.80) 100%);
  }
}

/* ---------- 6. 阶段24 · 右侧图片轮播 ----------
   所有 slide 叠在同一个 grid cell：容器高度仍由图片自身的 aspect-ratio 撑开，
   .hero__figure 依旧由 .hero__grid 的 align-items:end 控制底边位置。
   site.css 的 .hero__figure img 规则会作用到 .hero__slide img（后代选择器），
   轮播图因此自动继承原有的 width / aspect-ratio / object-fit。 */
.hero__slides{display:grid;position:relative}
.hero__slide{
  grid-area:1/1;position:relative;min-width:0;
  opacity:0;pointer-events:none;transition:opacity .8s var(--ease, ease);
}
.hero__slide.is-active{opacity:1;pointer-events:auto;z-index:1}
.hero__slide img{display:block}
.hero__slink{display:block}
/* 右下角指示点；左下角仍是原来的 .hero__badge 角标，互不遮挡 */
.hero__dots{
  position:absolute;right:16px;bottom:16px;z-index:3;
  display:flex;align-items:center;gap:8px;
}
.hero__dot{
  width:9px;height:9px;padding:0;border-radius:50%;
  border:1px solid rgba(255,255,255,.9);background:rgba(6,34,71,.28);
  cursor:pointer;transition:background .25s ease,transform .25s ease;
}
.hero__dot:hover{background:rgba(255,255,255,.65)}
.hero__dot.is-on{background:#FFFFFF;transform:scale(1.22)}
.hero__dot:focus-visible{outline:2px solid #8FD6E8;outline-offset:3px}
@media (max-width:980px){
  .hero__dots{right:14px;bottom:14px}
  /* site.css 在窄屏把 .hero__figure img 改成 4/3，轮播图沿用同一比例 */
  .hero__slide img{aspect-ratio:4/3}
}
@media (prefers-reduced-motion:reduce){
  .hero__slide{transition:none}
}

/* ---------- 7. 阶段24 · 右图底边改为与左侧按钮底边对齐 ----------
   阶段22 是「右图贴深色背景底边」；现在改成与左边两个按钮底边齐平。
   做法不靠测量：桌面双列把 grid 两端统一 align-items:end，
   再把原来挂在 .hero__copy 上的 70px 下内边距挪到 .hero 上 ——
   于是 copy 底边 == 按钮底边 == 右图底边，下方统一留 70px 深色背景。
   用 min-width:981px 限定，避免覆盖阶段22 在窄屏的 padding-bottom:28px。 */
@media (min-width:981px){
  .hero{padding-bottom:70px}
  .hero .hero__grid{align-items:end}
  .hero .hero__copy{padding-bottom:0}
  .hero .hero__figure{margin:0;align-self:end}
}


/* ---------- 8. 阶段25 · 离子消散切换（canvas 粒子层） ----------
   canvas 挂在 .hero__slides 内，绝对定位覆盖整个叠放网格；
   .hero__slides 本身已有 position:relative。z-index:2 高于 .is-active(1)、
   低于 .hero__dots(3)，所以粒子动画期间右下角圆点仍可点击。 */
.hero__fx{
  position:absolute;inset:0;width:100%;height:100%;
  z-index:2;pointer-events:none;display:block;
}
/* 动画期间禁止 CSS 淡入淡出：底层新图瞬间就位、由 canvas 上的旧图粒子遮挡，
   粒子散开后自然露出新图；聚合重组则让底层新图先隐身，由粒子拼出。 */
.hero__figure.is-fxing .hero__slide{transition:none}
.hero__figure.is-fxing .hero__slide.is-active{opacity:1}
.hero__figure.is-assembling .hero__slide.is-active{opacity:0}
@media (prefers-reduced-motion:reduce){
  .hero__fx{display:none}
}


/* ---------- 9. 阶段26 · 位移类切换（左右滑动 / 推入 / 缩放 / 擦除 / 3D 翻转） ----------
   只在动画期间由 JS 加 .is-moving：
   - overflow:hidden 把移出容器的旧图裁掉，避免页面上出现横向滚动条；
     动画结束 JS 立刻移除，所以阶段25 的粒子飘散出边界不受影响。
   - perspective 给 3D 翻转用；backface-visibility 防止翻到背面时透出文字。
   - 位移期间禁用指针事件，避免半途误点到链接。 */
.hero__figure.is-moving .hero__slides{overflow:hidden;perspective:1000px}
.hero__figure.is-moving .hero__slide{
  pointer-events:none;backface-visibility:hidden;
  will-change:transform,opacity,clip-path;
}
.hero__figure.is-moving .hero__slide.is-leaving{opacity:1;z-index:1}
/* 位移收尾保护（防「闪一下上一张」）：
   动画结束时旧图已经滑出容器，靠上面的 overflow:hidden 裁掉。但 JS 清空内联
   opacity / transition 后，.hero__slide 的 0.8s opacity 过渡会接手，把旧图从
   1 渐变到 0、transform 同时复位回原位 —— 视觉上就是旧图凭空回来又淡出。
   is-gone 只在收尾瞬间挂约 80ms：无过渡、强制归零，之后由 JS 摘掉。 */
.hero__slide.is-gone{transition:none !important;opacity:0 !important}


/* ---------- 10. 烟雾消散（阶段26 增补）----------
   烟雾复用第 8 节的 .hero__fx canvas 与 .is-fxing 机制：底层新图瞬间就位、
   canvas 贴旧图整图快照再用柔和波前溶解，露出新图；波前处叠雾幕、软云升腾、
   柔光微尘。色调 / 方向 / 浓度 / 上升速度 / 时长全部来自 blocks.js 的
   data-hero-* 参数，后台可改可试播。这里不需要额外视觉样式；系统开启
   「减少动效」时第 8 节的 .hero__fx{display:none} 已让动画自动退回纯淡入淡出。 */
