/* 图诺弗官网 - 动画效果样式 */

/* CSS变量定义 */
:root {
  /* 动画时长 */
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
  
  /* 缓动函数 */
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
}

/* 基础动画类 */
.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out-cubic) forwards;
}

.animate-slide-up {
  animation: slideUp var(--duration-normal) var(--ease-out-cubic) forwards;
}

.animate-slide-down {
  animation: slideDown var(--duration-normal) var(--ease-out-cubic) forwards;
}

.animate-scale-in {
  animation: scaleIn var(--duration-normal) var(--ease-bounce) forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 3s ease-in-out infinite 1.5s;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* 关键帧动画定义 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-8px);
  }
  70% {
    transform: translateY(-4px);
  }
  90% {
    transform: translateY(-2px);
  }
}

/* 渐变背景动画 */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* 摇摆动画 */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-2px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(2px);
  }
}

/* 交互动画类 */
.hover-lift {
  transition: transform var(--duration-normal) var(--ease-out-cubic),
              box-shadow var(--duration-normal) var(--ease-out-cubic);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform var(--duration-fast) var(--ease-out-cubic);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--duration-normal) var(--ease-out-cubic);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.hover-rotate {
  transition: transform var(--duration-normal) var(--ease-out-cubic);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* 按钮动画效果 */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out-cubic);
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--duration-slow) var(--ease-out-cubic);
}

.btn-animated:hover::before {
  left: 100%;
}

.btn-animated:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 卡片动画效果 */
.card-animated {
  transition: all var(--duration-normal) var(--ease-out-cubic);
  transform-origin: center;
}

.card-animated:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* 图标动画效果 */
.icon-animated {
  transition: all var(--duration-normal) var(--ease-out-cubic);
}

.icon-animated:hover {
  transform: scale(1.2) rotate(10deg);
  color: #2563eb;
}

/* 文字动画效果 */
.text-gradient {
  background: linear-gradient(135deg, #2563eb, #8b5cf6, #06b6d4);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
}

/* 加载动画 */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #2563eb;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: #2563eb;
  border-radius: 50%;
  animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 滚动触发动画 */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--ease-out-cubic);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 视差滚动效果 */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* 背景动画 */
.bg-animated {
  background: linear-gradient(135deg, #2563eb, #8b5cf6, #06b6d4);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* 边框动画 */
.border-animated {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #2563eb, #8b5cf6) border-box;
}

.border-animated::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6, #06b6d4);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-cubic);
}

.border-animated:hover::before {
  opacity: 1;
}

/* 响应式动画控制 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  .hover-lift:hover {
    transform: none;
  }
  
  .card-animated:hover {
    transform: none;
  }
  
  .btn-animated:hover {
    transform: none;
  }
}

/* 高性能动画 */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* 延迟动画类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-400 { animation-delay: 0.4s; }