/* 性能优化样式 - 关键路径CSS */
/* 减少重绘和重排的优化样式 */

/* 优化粒子动画性能 */
.about-global-particles {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0 !important;
    overflow: hidden;
    opacity: 1;
    will-change: transform;
}

.about-global-particle {
    position: absolute;
    width: 8px; height: 8px; /* 减小粒子大小 */
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.1; /* 降低透明度 */
    animation: about-global-float 20s infinite ease-in-out; /* 延长动画时间 */
    will-change: transform, opacity;
}

.about-global-particle:nth-child(1) { left: 10vw; top: 20vh; animation-delay: 0s; }
.about-global-particle:nth-child(2) { left: 30vw; top: 60vh; animation-delay: 5s; }
.about-global-particle:nth-child(3) { left: 70vw; top: 40vh; animation-delay: 10s; }
.about-global-particle:nth-child(4) { left: 80vw; top: 80vh; animation-delay: 15s; }

@keyframes about-global-float {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        opacity: 0.1; 
    }
    50% { 
        transform: translateY(-40px) scale(1.2); /* 减少移动距离 */
        opacity: 0.15; 
    }
}

/* 优化动画性能 */
.home-hero-animate,
.home-section-animate {
    opacity: 0;
    transform: translateY(20px); /* 减少移动距离 */
    animation-duration: 0.6s; /* 缩短动画时间 */
    will-change: transform, opacity;
}

/* 使用transform3d强制硬件加速 */
.carousel-item img {
    transform: translateZ(0);
    will-change: transform;
}

/* 优化滚动性能 */
.main-header {
    transform: translateZ(0);
    will-change: transform;
    /* 确保页眉隐藏功能正常工作 */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* 减少不必要的阴影和模糊效果 */
.product-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* 简化阴影 */
}

/* 优化图片加载 */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 减少重绘的优化 */
.nav-link,
.contact-btn,
.btn-more {
    will-change: transform;
}

/* 移动端性能优化 */
@media (max-width: 768px) {
  /* 简化全局粒子动画 */
  .about-global-particle {
    animation-duration: 30s; /* 延长动画时间，减少CPU占用 */
    opacity: 0.05; /* 降低透明度 */
    }
    
  /* 简化页面进入动画 */
  .home-hero-animate {
    animation-duration: 0.4s; /* 缩短动画时间 */
  }
  
    .home-section-animate {
    animation-duration: 0.3s; /* 缩短动画时间 */
  }
  
  /* 优化卡片动画 */
  .product-card,
  .news-card {
    transition: transform 0.2s ease-out;
  }
  
  /* 简化hover效果 */
  .product-card:hover,
  .news-card:hover {
    transform: translateY(-2px);
  }
  
  /* 优化按钮动画 */
  .btn-more {
    transition: background 0.2s ease-out;
  }
  
  /* 减少阴影复杂度 */
  .product-card,
  .news-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
  /* 完全禁用粒子动画 */
  .about-global-particle {
    display: none;
  }
  
  /* 禁用所有hover效果 */
  .product-card:hover,
  .news-card:hover,
  .btn-more:hover {
    transform: none;
  }
  
  /* 简化所有过渡效果 */
  .product-card,
  .news-card,
  .btn-more {
    transition: none;
    }
} 