/* 动画效果CSS文件 */

/* 标准动画类 */
.animate {
  opacity: 0;
  will-change: transform, opacity;
}

.animate.animated {
  opacity: 1;
}

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

.fadeIn {
  animation: fadeIn 0.8s ease-in-out forwards;
}

/* 向上滑动 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slideUp {
  animation: slideUp 0.8s ease-out forwards;
}

/* 向右滑动 */
@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slideRight {
  animation: slideRight 0.8s ease-out forwards;
}

/* 向左滑动 */
@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slideLeft {
  animation: slideLeft 0.8s ease-out forwards;
}

/* 缩放动画 */
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scaleUp {
  animation: scaleUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 脉冲动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

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

.shake {
  animation: shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

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

.rotate {
  animation: rotate 2s linear infinite;
}

/* 悬浮动画 */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

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

/* 闪光效果 */
@keyframes shine {
  from {
    background-position: -100% 0;
  }
  to {
    background-position: 200% 0;
  }
}

.shine {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.4) 50%, 
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shine 2s infinite;
}

/* 打字效果 */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

.typing {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary-color);
  animation: 
    typing 3.5s steps(40, end),
    blink-caret 0.75s step-end infinite;
}

/* 循环渐变背景 */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-bg {
  background: linear-gradient(-45deg, 
    var(--gradient-color-1), 
    var(--gradient-color-2), 
    var(--gradient-color-3), 
    var(--gradient-color-4));
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

/* 视差滚动效果 */
.parallax {
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

/* 滚动触发动画 */
.scroll-trigger {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.scroll-trigger.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 响应式动画调整 */
@media (prefers-reduced-motion: reduce) {
  .animate,
  .fadeIn,
  .slideUp,
  .slideRight,
  .slideLeft,
  .scaleUp,
  .pulse,
  .shake,
  .rotate,
  .float,
  .shine,
  .typing,
  .gradient-bg,
  .parallax,
  .scroll-trigger {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* 滚动显示动画，用于JavaScript触发 */
[data-animate] {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate="fade-in"] {
  transform: translateY(20px);
}

[data-animate="slide-right"] {
  transform: translateX(-50px);
}

[data-animate="slide-left"] {
  transform: translateX(50px);
}

[data-animate="scale-up"] {
  transform: scale(0.8);
}

[data-animate].in-view {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* 动画效果样式 */
:root {
  --animation-duration: 0.8s;
  --animation-delay-step: 0.1s;
}

/* 向下滑动 */
@keyframes slideDown {
  from {
    transform: translateY(-60px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slideDown {
  animation-name: slideDown;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 放大动画 */
@keyframes scaleDown {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

.scaleDown {
  animation-name: scaleDown;
  animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.rotateDown {
  animation-name: rotateDown;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 2s;
}

/* 动画类 */
.animate {
  animation-duration: var(--animation-duration);
  animation-fill-mode: both;
  opacity: 0;
}

/* 动画观察器 - 用于滚动触发动画 */
.animate.active {
  opacity: 1;
}

/* 循环延迟 */
.delay-0 {
  animation-delay: 0s;
}

.delay-1 {
  animation-delay: calc(var(--animation-delay-step) * 1);
}

.delay-2 {
  animation-delay: calc(var(--animation-delay-step) * 2);
}

.delay-3 {
  animation-delay: calc(var(--animation-delay-step) * 3);
}

.delay-4 {
  animation-delay: calc(var(--animation-delay-step) * 4);
}

.delay-5 {
  animation-delay: calc(var(--animation-delay-step) * 5);
}

/* 悬停动画 */
.hover-scale {
  transition: transform 0.3s ease;
}

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

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 特殊动画效果 - 打字机效果 */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from {
    border-right-color: rgba(0, 0, 0, 0.75);
  }
  to {
    border-right-color: transparent;
  }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid;
  width: 0;
  animation: 
    typewriter 2s steps(40, end) forwards,
    blinkCursor 0.75s step-end infinite;
}

/* 页面载入动画 */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.loaded {
  transform: translateY(-100%);
}

/* 动画定义 */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  60% {
    transform: translateY(-15px);
  }
}

.bounce {
  animation: bounce 2s infinite;
}

/* 延迟类 */
.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;
}

.delay-600 {
  animation-delay: 0.6s;
}

.delay-700 {
  animation-delay: 0.7s;
}

.delay-800 {
  animation-delay: 0.8s;
}

.delay-900 {
  animation-delay: 0.9s;
}

.delay-1000 {
  animation-delay: 1s;
}

/* 特定元素动画 */
.hero-title {
  animation: slideDown 1s ease forwards;
}

.hero-subtitle {
  animation: slideUp 1s 0.3s ease forwards;
  opacity: 0;
}

.hero-cta {
  animation: fadeIn 1s 0.6s ease forwards;
  opacity: 0;
}

.hero-image {
  animation: float 6s ease-in-out infinite;
}

.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.download-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.download-card.recommended {
  animation: pulse 2s infinite;
}

/* 移动端菜单动画 */
.menu-toggle {
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav {
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  nav {
    transform: translateX(-100%);
  }
  
  nav.active {
    transform: translateX(0);
  }
  
  nav ul li {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
  }
  
  nav.active ul li {
    opacity: 1;
    transform: translateX(0);
  }
  
  nav.active ul li:nth-child(1) {
    transition-delay: 0.1s;
  }
  
  nav.active ul li:nth-child(2) {
    transition-delay: 0.2s;
  }
  
  nav.active ul li:nth-child(3) {
    transition-delay: 0.3s;
  }
  
  nav.active ul li:nth-child(4) {
    transition-delay: 0.4s;
  }
  
  nav.active ul li:nth-child(5) {
    transition-delay: 0.5s;
  }
}

/* 滚动效果 */
header.scrolled {
  background-color: var(--white);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
}

/* 页面加载动画 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--light);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
} 