/* 基础动画关键帧 */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@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 fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 10px 0 rgba(139, 76, 252, 0.5);
    }
    50% {
        box-shadow: 0 0 25px 5px rgba(139, 76, 252, 0.7);
    }
    100% {
        box-shadow: 0 0 10px 0 rgba(139, 76, 252, 0.5);
    }
}

@keyframes spinAround {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@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 gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes blobMorph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* 应用动画 */
.phone-mockup {
    animation: float 6s ease-in-out infinite;
}

.blob {
    animation: blobMorph 8s ease-in-out infinite alternate;
}

.blob-1 {
    animation-delay: 0s;
}

.blob-2 {
    animation-delay: 1s;
}

.feature-icon {
    position: relative;
    overflow: hidden;
}

.feature-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmer 4s infinite;
    pointer-events: none;
}

.feature-card {
    transition: all 0.5s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

/* 渐变文字动画 */
.gradient-text {
    background-size: 200% auto;
    animation: gradientFlow 5s ease infinite;
}

/* 页面滚动出现动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* 菜单动画 */
.menu-toggle span:nth-child(1) {
    transition-delay: 0.1s;
}

.menu-toggle span:nth-child(2) {
    transition-delay: 0.2s;
}

.menu-toggle span:nth-child(3) {
    transition-delay: 0.3s;
}

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

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

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

/* 按钮悬停效果 */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after, .btn-secondary::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: all 0.5s ease;
}

.btn-primary:hover::after, .btn-secondary:hover::after {
    left: 100%;
}

/* 手机屏幕切换动画 */
.app-screen {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.app-screen.active {
    opacity: 1;
    transform: scale(1);
    position: relative;
}

/* 轮播动画 */
.carousel-dots .dot {
    position: relative;
}

.carousel-dots .dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.carousel-dots .dot.active::after {
    transform: scale(1);
}

/* Tab切换动画 */
.tab-pane {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-pane.active {
    opacity: 1;
    transform: translateY(0);
}

/* 页面滚动效果 */
.section-title {
    position: relative;
}

.section-title::after {
    transition: width 0.8s ease;
    width: 0;
}

.section-title.visible::after {
    width: 60px;
}

/* 滚动视差效果 */
.parallax {
    transition: transform 0.5s ease;
}

/* 图标脉动效果 */
.feature-icon {
    animation: pulse 5s infinite;
}

/* 手机模型光泽效果 */
.phone-reflection {
    display: none;
}

/* 入场动画 */
.hero-content {
    animation: fadeIn 0.8s ease forwards;
}

.hero-image {
    animation: fadeIn 0.8s ease 0.3s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.feature-card:nth-child(1) {
    animation: fadeIn 0.5s ease 0.1s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.feature-card:nth-child(2) {
    animation: fadeIn 0.5s ease 0.2s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.feature-card:nth-child(3) {
    animation: fadeIn 0.5s ease 0.3s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.feature-card:nth-child(4) {
    animation: fadeIn 0.5s ease 0.4s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* 设计卡片动画 */
.design-card {
    transition: all 0.3s ease;
}

.design-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* 下载按钮发光效果 */
.app-store-btn {
    position: relative;
}

.app-store-btn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: var(--gradient-1);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-store-btn:hover::before {
    opacity: 0.5;
    animation: pulse 2s infinite;
}

/* 增强卡片悬停效果 */
.feature-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-card:hover .feature-icon {
    animation: glowPulse 2s infinite;
}

/* 强化按钮动画效果 */
.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-5px) scale(1.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 强化菜单悬停效果 */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -8px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* 强化导航滚动效果 */
.glass-nav {
    transition: padding 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                background-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-nav.scrolled {
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* 新增视差滚动效果 */
.parallax-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 新增入场动画延迟 */
.stagger-delay > * {
    opacity: 0;
}

.stagger-delay > *:nth-child(1) {
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.1s;
}

.stagger-delay > *:nth-child(2) {
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.2s;
}

.stagger-delay > *:nth-child(3) {
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.3s;
}

.stagger-delay > *:nth-child(4) {
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.4s;
}

/* 新增平滑滚动效果 */
html {
    scroll-behavior: smooth;
}

/* 添加页面切换动画 */
@keyframes pageTransition {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

main section {
    animation: pageTransition 0.8s ease-out forwards;
}

/* 增强下载按钮动画 */
.download-button-container {
    position: relative;
    z-index: 5;
}

.download-button-container::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 76, 252, 0.2) 0%, rgba(139, 76, 252, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
}

/* 添加文字渐入效果 */
.section-subtitle, .download-content p {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

/* 确保下载区域不受动画效果影响 */
#download .download-content {
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
    animation: none !important;
}

#download .app-store-btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

#download .download-button-container {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

#download .app-info {
    opacity: 1 !important;
    visibility: visible !important;
}

#download .download-content p,
#download .download-content h2 {
    opacity: 1 !important;
    animation: none !important;
}

/* 下载区域动画 */
#download {
  position: relative;
  overflow: hidden;
}

#download::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 76, 252, 0.05) 0%,
    rgba(139, 76, 252, 0) 70%
  );
  animation: rotateGradient 20s linear infinite;
  z-index: 1;
}

@keyframes rotateGradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#download .download-content {
  animation: fadeInUp 1s ease-out;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#download .download-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(139, 76, 252, 0.15);
}

#download .app-store-btn {
  animation: pulseLight 3s infinite;
}

@keyframes pulseLight {
  0% {
    filter: drop-shadow(0 0 5px rgba(139, 76, 252, 0.1));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(139, 76, 252, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 5px rgba(139, 76, 252, 0.1));
  }
}

#download .app-info {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease-out forwards;
  animation-delay: 0.5s;
}

#download .info-item {
  transition: transform 0.3s ease;
}

#download .info-item:hover {
  transform: translateY(-5px);
}

/* 移动端优化的动画 */
@media (max-width: 768px) {
    /* 减少动画强度，提高性能 */
    .phone-mockup {
        animation: float 8s ease-in-out infinite;
        animation-duration: 8s; /* 降低动画频率 */
    }
    
    .blob {
        animation-duration: 12s; /* 降低动画频率 */
        opacity: 0.4; /* 降低不透明度 */
    }
    
    /* 减少或禁用某些可能导致性能问题的动画 */
    .feature-icon::after {
        animation-duration: 6s;
    }
    
    /* 优化过渡效果 */
    .fade-in, .fade-in-up, .fade-in-left, .fade-in-right {
        transition: all 0.4s ease;
    }
}

/* 针对低端设备的进一步优化 */
@media (max-width: 576px) {
    /* 可选择性地禁用某些动画以提高性能 */
    .blob {
        animation: none;
        opacity: 0.3;
    }
    
    /* 使用更轻量的动画 */
    @keyframes lightFloat {
        0% {
            transform: translateY(0px);
        }
        100% {
            transform: translateY(-5px);
        }
    }
    
    .phone-mockup {
        animation: lightFloat 4s ease-in-out infinite alternate;
    }
    
    /* 减少动画延迟 */
    .stagger-delay > *:nth-child(1) {
        transition-delay: 0.1s;
    }
    
    .stagger-delay > *:nth-child(2) {
        transition-delay: 0.2s;
    }
    
    .stagger-delay > *:nth-child(3) {
        transition-delay: 0.3s;
    }
    
    .stagger-delay > *:nth-child(4) {
        transition-delay: 0.4s;
    }
}

/* 针对触摸交互的动画 */
@keyframes touchPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
    }
}

.touch-active {
    animation: touchPulse 0.3s ease-out;
}

/* 优化移动端菜单动画 */
@media (max-width: 768px) {
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        transition: transform 0.3s ease;
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
        transition: transform 0.3s ease;
    }
    
    nav ul.active {
        animation: slideDownNav 0.3s ease forwards;
    }
    
    @keyframes slideDownNav {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
} 