
/* ========================================
   好酷游官网 - 动画样式
   入场动画、过渡效果、关键帧定义
   ======================================== */

/* 滚动触发动画类 - 默认显示，JS增强时才隐藏 */
.animate-on-scroll {
  opacity: 1;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
}

/* 只有当JS成功加载时才应用初始隐藏状态 */
.js-enabled .animate-on-scroll {
  opacity: 0;
  -webkit-transform: translateY(30px);
  -ms-transform: translateY(30px);
  transform: translateY(30px);
  -webkit-transition: all 0.8s ease;
  -o-transition: all 0.8s ease;
  transition: all 0.8s ease;
}

.animate-on-scroll.animated,
.js-enabled .animate-on-scroll.animated {
  opacity: 1;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
}

.animate-slide-left {
  opacity: 1;
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
}

.js-enabled .animate-slide-left {
  opacity: 0;
  -webkit-transform: translateX(-50px);
  -ms-transform: translateX(-50px);
  transform: translateX(-50px);
  -webkit-transition: all 0.8s ease;
  -o-transition: all 0.8s ease;
  transition: all 0.8s ease;
}

.animate-slide-left.animated,
.js-enabled .animate-slide-left.animated {
  opacity: 1;
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
}

.animate-slide-right {
  opacity: 1;
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
}

.js-enabled .animate-slide-right {
  opacity: 0;
  -webkit-transform: translateX(50px);
  -ms-transform: translateX(50px);
  transform: translateX(50px);
  -webkit-transition: all 0.8s ease;
  -o-transition: all 0.8s ease;
  transition: all 0.8s ease;
}

.animate-slide-right.animated,
.js-enabled .animate-slide-right.animated {
  opacity: 1;
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
}

.animate-scale {
  opacity: 1;
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
}

.js-enabled .animate-scale {
  opacity: 0;
  -webkit-transform: scale(0.9);
  -ms-transform: scale(0.9);
  transform: scale(0.9);
  -webkit-transition: all 0.8s ease;
  -o-transition: all 0.8s ease;
  transition: all 0.8s ease;
}

.animate-scale.animated,
.js-enabled .animate-scale.animated {
  opacity: 1;
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
}

/* 入场动画 - 淡入上移 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 入场动画 - 淡入 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 入场动画 - 缩放淡入 */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 入场动画 - 从左滑入 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 入场动画 - 从右滑入 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 脉冲发光效果 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
  }
}

/* 霓虹闪烁 */
@keyframes neonFlicker {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* 浮动效果 */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 旋转效果 */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Hero 入场动画 */
.hero__content {
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero__title-main {
  animation: fadeInUp 1s ease-out 0.5s both;
}

.hero__title-sub {
  animation: fadeInUp 1s ease-out 0.7s both;
}

.hero__tagline {
  animation: fadeInUp 1s ease-out 0.9s both;
}

.hero__cta {
  animation: fadeInUp 1s ease-out 1.1s both, pulse 3s ease-in-out 2s infinite;
}

.hero__scroll {
  animation: fadeIn 1s ease-out 1.5s both;
}

/* 导航栏入场 */
.header {
  animation: fadeIn 0.5s ease-out;
}

/* 移动端菜单动画 */
.nav__menu.active .nav__item {
  animation: fadeInUp 0.4s ease-out both;
}

.nav__menu.active .nav__item:nth-child(1) { animation-delay: 0.1s; }
.nav__menu.active .nav__item:nth-child(2) { animation-delay: 0.2s; }
.nav__menu.active .nav__item:nth-child(3) { animation-delay: 0.3s; }
.nav__menu.active .nav__item:nth-child(4) { animation-delay: 0.4s; }


/* ======================================== 
   颜色渐变文字效果 (最高兼容性)
   使用 color + animation 实现，兼容所有浏览器
   ======================================== */
.glitch {
  position: relative;
  color: #fff;
  animation: colorShift 4s ease-in-out infinite;
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

@keyframes colorShift {
  0%, 100% {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 20px rgba(255,255,255,0.3);
  }
  25% {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0,212,255,0.8), 0 0 20px rgba(0,212,255,0.5), 0 0 30px rgba(0,212,255,0.3);
  }
  50% {
    color: #7c3aed;
    text-shadow: 0 0 10px rgba(124,58,237,0.8), 0 0 20px rgba(124,58,237,0.5), 0 0 30px rgba(124,58,237,0.3);
  }
  75% {
    color: #ff006e;
    text-shadow: 0 0 10px rgba(255,0,110,0.8), 0 0 20px rgba(255,0,110,0.5), 0 0 30px rgba(255,0,110,0.3);
  }
}

/* 备用：如果浏览器支持 background-clip，使用渐变效果 */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .glitch {
    background: linear-gradient(90deg, #fff 0%, #00d4ff 25%, #7c3aed 50%, #ff006e 75%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    text-shadow: none;
  }
  
  @keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
  }
}

/* ======================================== 
   打字机光标 
   ======================================== */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-start infinite;
  color: var(--color-primary);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ======================================== 
   流光边框 (Gradient Border Flow) 
   ======================================== */
@keyframes borderFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-text-flow {
  background-size: 200% auto;
  animation: borderFlow 3s linear infinite;
}

/* ======================================== 
   浮动动画 (Floating) 
   ======================================== */
.floating {
  animation: float 6s ease-in-out infinite;
}

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


/* 服务卡片悬停动画增强 */
.service__card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service__card:hover .service__icon {
  animation: float 2s ease-in-out infinite;
}

/* 统计数字动画 */
.stat__item {
  transition: all 0.3s ease;
}

.stat__item:hover {
  transform: translateY(-5px);
}

.stat__number {
  transition: all 0.3s ease;
}

/* 优势项悬停效果 */
.advantage__item {
  transition: all 0.3s ease;
}

.advantage__item:hover {
  transform: translateY(-5px);
}

.advantage__item:hover .advantage__icon {
  animation: float 2s ease-in-out infinite;
}

/* 联系卡片动画 */
.contact__item {
  transition: all 0.3s ease;
}

.contact__item:hover .contact__icon {
  animation: pulse 1.5s ease-in-out infinite;
}

/* 按钮悬停动画 */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
