/* HZTC 首页动效增强包 v1.0.1：支持后台手动开关 */

body.hztc-motion-ready {
  --hztc-motion-red: #b50012;
  --hztc-motion-red2: #e30613;
  --hztc-motion-dark: #111217;
  --hztc-motion-shadow: 0 30px 90px rgba(20, 30, 45, 0.16);
  --hztc-motion-ease: cubic-bezier(.19, 1, .22, 1);
}

body.hztc-motion-ready .hztc-hero {
  isolation: isolate;
}

body.hztc-motion-ready .hztc-hero .hztc-container {
  position: relative;
  z-index: 1;
}

body.hztc-motion-ready .hztc-hero::before {
  content: "";
  position: absolute;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  right: 5vw;
  top: 10%;
  z-index: 0;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,.20), rgba(227,6,19,.10) 36%, transparent 68%);
  filter: blur(6px);
  opacity: .72;
  transform: translate3d(var(--hztc-parallax-x, 0), var(--hztc-parallax-y, 0), 0);
  transition: transform .35s ease-out;
  pointer-events: none;
}

/* 首屏文字分层飞入 */
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-eyebrow,
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero h1,
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-hero-copy,
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .wp-block-buttons,
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-pills {
  opacity: 0;
  transform: translate3d(-42px, 0, 0);
  filter: blur(8px);
  animation: hztcHeroTextIn .86s var(--hztc-motion-ease) forwards;
}

body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-eyebrow { animation-delay: .06s; }
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero h1 { animation-delay: .18s; }
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-hero-copy { animation-delay: .32s; }
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .wp-block-buttons { animation-delay: .46s; }
body.hztc-motion-ready.hztc-motion-hero-text-on .hztc-hero .hztc-pills { animation-delay: .58s; }

@keyframes hztcHeroTextIn {
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

/* 首屏图片飞入 + 轻微浮动 */
body.hztc-motion-ready.hztc-motion-hero-card-on .hztc-hero-card {
  opacity: 0;
  transform: translate3d(54px, 24px, 0) scale(.94) rotate(1.5deg);
  filter: blur(10px);
  animation: hztcHeroCardIn 1.06s var(--hztc-motion-ease) .26s forwards,
             hztcHeroFloat 6.8s ease-in-out 1.45s infinite;
  will-change: transform;
}

@keyframes hztcHeroCardIn {
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(0); filter: blur(0); }
}

@keyframes hztcHeroFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}

body.hztc-motion-ready.hztc-motion-hero-card-on .hztc-hero-card img {
  transform: scale(1.035);
  transition: transform .9s var(--hztc-motion-ease);
}

body.hztc-motion-ready.hztc-motion-hero-card-on .hztc-hero-card:hover img {
  transform: scale(1.095);
}

body.hztc-motion-ready .hztc-pills > * {
  transition: transform .28s ease, background .28s ease, border-color .28s ease;
}

body.hztc-motion-ready .hztc-pills > *:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.42);
}

/* 通用滚动入场 */
body.hztc-motion-ready.hztc-motion-reveal-on .hztc-motion-item {
  opacity: 0;
  transform: translate3d(0, 38px, 0);
  filter: blur(8px);
  transition: opacity .82s var(--hztc-motion-ease), transform .82s var(--hztc-motion-ease), filter .82s var(--hztc-motion-ease);
  transition-delay: var(--hztc-motion-delay, 0ms);
  will-change: opacity, transform, filter;
}

body.hztc-motion-ready.hztc-motion-reveal-on .hztc-motion-item.hztc-motion-left {
  transform: translate3d(-54px, 18px, 0);
}

body.hztc-motion-ready.hztc-motion-reveal-on .hztc-motion-item.hztc-motion-right {
  transform: translate3d(54px, 18px, 0);
}

body.hztc-motion-ready.hztc-motion-reveal-on .hztc-motion-item.hztc-motion-zoom {
  transform: translate3d(0, 32px, 0) scale(.94);
}

body.hztc-motion-ready.hztc-motion-reveal-on .hztc-motion-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* 数据区增强 */
body.hztc-motion-ready.hztc-motion-counter-on .hztc-stats {
  background: linear-gradient(90deg, rgba(181,0,18,.055), transparent 22%, transparent 78%, rgba(181,0,18,.055)), #fff;
}

body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat {
  position: relative;
  overflow: hidden;
}

body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat::before {
  content: "";
  position: absolute;
  inset: 12px 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(227,6,19,.08), rgba(255,255,255,0));
  opacity: 0;
  transform: scale(.92);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}

body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat.is-visible::before,
body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat:hover::before {
  opacity: 1;
  transform: scale(1);
}

body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat strong {
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  transition: transform .28s ease, text-shadow .28s ease;
}

body.hztc-motion-ready.hztc-motion-counter-on .hztc-stat:hover strong {
  transform: translateY(-2px) scale(1.03);
  text-shadow: 0 12px 28px rgba(181,0,18,.22);
}

/* 图片悬浮 */
body.hztc-motion-ready.hztc-motion-image-hover-on .hztc-image-frame {
  overflow: visible;
}

body.hztc-motion-ready.hztc-motion-image-hover-on .hztc-image-frame img {
  transition: transform .8s var(--hztc-motion-ease), box-shadow .8s var(--hztc-motion-ease);
}

body.hztc-motion-ready.hztc-motion-image-hover-on .hztc-image-frame.is-visible img,
body.hztc-motion-ready.hztc-motion-image-hover-on .hztc-image-frame:hover img {
  box-shadow: var(--hztc-motion-shadow);
}

body.hztc-motion-ready.hztc-motion-image-hover-on .hztc-image-frame:hover img {
  transform: translateY(-8px) scale(1.025);
}

/* 服务卡片和产品卡片增强 */
body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card,
body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-query-grid li {
  transform-style: preserve-3d;
  will-change: transform;
}

body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card:hover,
body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-query-grid li:hover {
  transform: translateY(-10px) scale(1.012);
}

body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card strong {
  display: inline-block;
  transition: transform .35s ease;
}

body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card:hover strong {
  transform: translateX(4px) scale(1.08);
}

body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-query-grid li img,
body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card img {
  transition: transform .7s var(--hztc-motion-ease);
}

body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-query-grid li:hover img,
body.hztc-motion-ready.hztc-motion-card-hover-on .hztc-feature-card:hover img {
  transform: scale(1.06);
}

/* CTA 流光 */
body.hztc-motion-ready.hztc-motion-cta-glow-on .hztc-cta {
  position: relative;
  overflow: hidden;
}

body.hztc-motion-ready.hztc-motion-cta-glow-on .hztc-cta::before {
  content: "";
  position: absolute;
  inset: -40% -15%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 45%, rgba(255,255,255,.08) 55%, transparent 70%);
  transform: translateX(-35%) rotate(6deg);
  animation: hztcCtaGlow 6.5s ease-in-out infinite;
  pointer-events: none;
}

body.hztc-motion-ready.hztc-motion-cta-glow-on .hztc-cta .hztc-container {
  position: relative;
  z-index: 1;
}

@keyframes hztcCtaGlow {
  0%, 35% { transform: translateX(-45%) rotate(6deg); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: translateX(45%) rotate(6deg); opacity: 0; }
}

@media (max-width: 767px) {
  body.hztc-motion-ready.hztc-motion-mobile-reduce-on .hztc-hero-card,
  body.hztc-motion-ready.hztc-motion-mobile-reduce-on .hztc-motion-item {
    animation-duration: .55s !important;
    transition-duration: .48s !important;
    filter: none !important;
  }

  body.hztc-motion-ready.hztc-motion-mobile-reduce-on .hztc-hero-card {
    animation-name: hztcHeroCardIn !important;
    animation-iteration-count: 1 !important;
  }

  body.hztc-motion-ready.hztc-motion-mobile-reduce-on .hztc-cta::before {
    animation: none !important;
    opacity: .18;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hztc-motion-ready *,
  body.hztc-motion-ready *::before,
  body.hztc-motion-ready *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
