/* ============================================================
   整站动效 / 特效 · effects.css
   版本 2026-11-23 v1
   说明：依赖 index.js 中的 IntersectionObserver 滚动入场逻辑。
         所有入场元素默认 opacity:0，进入视口后通过 .in-view 触发。
   ============================================================ */

/* ---------- 入场动画状态 ----------
   安全兜底：仅当 body 有 .fx-ready（由 JS 成功注入）时才隐藏并运行动画。
   若 JS 未加载/异常，内容保持正常可见，不会"白屏"。 */
.fx {
  will-change: transform, opacity;
}
body.fx-ready .fx {
  opacity: 0;
}
body.fx-ready .fx-up    { transform: translateY(40px); }
body.fx-ready .fx-left  { transform: translateX(-48px); }
body.fx-ready .fx-right { transform: translateX(48px); }
body.fx-ready .fx-zoom  { transform: scale(.92); }
.fx.in-view {
  opacity: 1;
  animation: fx-float .8s cubic-bezier(.22,.61,.36,1) both;
}
body.fx-ready .fx.in-view { transform: none; }

/* 统一 keyframes（配合 .in-view 触发） */
@keyframes fx-float {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fx-float-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fx-slide-left {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fx-slide-right {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fx-zoom-in {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fx-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 方向专用：覆盖默认 float（仅在 fx-ready 下动画） */
body.fx-ready .fx-left.in-view  { animation-name: fx-slide-left; }
body.fx-ready .fx-right.in-view { animation-name: fx-slide-right; }
body.fx-ready .fx-zoom.in-view  { animation-name: fx-zoom-in; }
body.fx-ready .fx-fade.in-view  { animation-name: fx-fade-in; }

/* ---------- 入场延迟工具类 ---------- */
.d1 { animation-delay: .08s !important; }
.d2 { animation-delay: .16s !important; }
.d3 { animation-delay: .24s !important; }
.d4 { animation-delay: .32s !important; }
.d5 { animation-delay: .40s !important; }
.d6 { animation-delay: .48s !important; }
.d7 { animation-delay: .56s !important; }
.d8 { animation-delay: .64s !important; }

/* ---------- banner 标题文字逐行入场 ---------- */
.banner .content.is-active .title1,
.banner .content.is-active .title2,
.banner .content.is-active .title3 {
  animation: banner-text-in .9s cubic-bezier(.22,.61,.36,1) both;
}
.banner .content.is-active .title1 { animation-delay: .15s; }
.banner .content.is-active .title2 { animation-delay: .3s; }
.banner .content.is-active .title3 { animation-delay: .45s; }
@keyframes banner-text-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 标题区装饰线扫光 ---------- */
.mainSub {
  position: relative;
  overflow: visible;
}
.mainSub::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
  transform: translateX(-120%);
}
body.fx-ready .mainSub.shine::after {
  animation: shine-sweep 1.8s ease-in-out .4s infinite;
}
@keyframes shine-sweep {
  0%   { transform: translateX(-120%); }
  60%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

/* ---------- 卡片悬停上浮 + 阴影（通用） ---------- */
.hover-lift {
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s cubic-bezier(.22,.61,.36,1);
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

/* ---------- 图片缩放特效（案例/客户卡片） ---------- */
.img-zoom { overflow: hidden; }
.img-zoom img {
  transition: transform .65s cubic-bezier(.22,.61,.36,1);
}
.img-zoom:hover img { transform: scale(1.08); }

/* ---------- 按钮涟漪 / 箭头位移 ---------- */
.btn-arrow {
  transition: all .3s cubic-bezier(.22,.61,.36,1);
  position: relative;
}
.btn-arrow:hover {
  padding-right: 26px;
  background-position: calc(100% - 18px) center;
}
.moreBtn span,
.linkBtn span {
  display: inline-block;
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.moreBtn:hover span,
.linkBtn:hover span { transform: translateX(4px); }

/* ---------- 数字增长高亮脉冲 ---------- */
.about .contentMun .child .mun span {
  display: inline-block;
}
.mun-pulse {
  animation: mun-pulse 1.2s ease-out both;
}
@keyframes mun-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); color: #c40010; }
  100% { transform: scale(1); }
}

/* ---------- 客户 logo 滚动淡入 ---------- */
.customer .contents .content img {
  transition: filter .4s ease, opacity .4s ease, transform .4s ease;
}
.customer .contents .content img:hover {
  transform: translateY(-4px);
}

/* ---------- 呼吸灯（联系/咨询电话等强调） ---------- */
.breathe {
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ---------- 浮动元素（装饰性） ---------- */
.float-y {
  animation: float-y 5s ease-in-out infinite;
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---------- 页面首屏整体淡入 ---------- */
body.fx-ready .banner { animation: fx-fade-in .8s ease both; }

/* ---------- 滚动条渐隐（现代感） ---------- */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-thumb { background: #c9c9c9; border-radius: 5px; }
}

/* ---------- 动效性能保障：减少绘制开销 ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx, .fx.in-view,
  .banner .content.is-active .title1,
  .banner .content.is-active .title2,
  .banner .content.is-active .title3,
  .mainSub::after,
  .breathe, .float-y {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
