/* ============================================================
   蝴蝶管家 官网 · 滚动 reveal 与特效
   （页面不再有进入时的加载动画：首屏内容直接渲染）
   ============================================================ */

/* ===================== 滚动 reveal ===================== */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.2, 0.8, 0.3, 1), transform 0.85s cubic-bezier(0.2, 0.8, 0.3, 1);
  will-change: opacity, transform;
}

.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* 首屏元素：更短的过渡，进页面立即呈现（滚动到的元素仍用上面 0.85s 的节奏） */
.has-js [data-reveal].is-instant {
  transition-duration: 0.26s;
}

body.is-ready .hero__title .line {
  animation: hero-line 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

body.is-ready .hero__title .line--accent {
  animation-delay: 0.08s;
}

/* ===================== 关键帧 ===================== */
@keyframes hero-line {
  from {
    opacity: 0.2;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(47, 208, 127, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(47, 208, 127, 0);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 122, 31, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 122, 31, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 122, 31, 0);
  }
}

@keyframes bar-grow {
  from {
    transform: scaleY(0.86);
  }
  to {
    transform: scaleY(1.04);
  }
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes shimmer {
  from {
    background-position: 220% 0;
  }
  to {
    background-position: -220% 0;
  }
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.float-card--a {
  animation: float-y 6s ease-in-out infinite;
}

.float-card--b {
  animation: float-y 7.4s ease-in-out 0.8s infinite;
}

.price-card__price strong.is-flipping {
  animation: price-flip 0.55s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes price-flip {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.94);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.bg-aurora__blob--a {
  animation: blob-a 22s ease-in-out infinite;
}

.bg-aurora__blob--b {
  animation: blob-b 26s ease-in-out infinite;
}

.bg-aurora__blob--c {
  animation: blob-c 30s ease-in-out infinite;
}

@keyframes blob-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-4%, 6%, 0) scale(1.1);
  }
}

@keyframes blob-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1.05);
  }
  50% {
    transform: translate3d(6%, -5%, 0) scale(0.95);
  }
}

@keyframes blob-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-7%, -6%, 0) scale(1.12);
  }
}

/* ===================== 无障碍：减少动效 ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
