/**
 * 页面过渡动画
 * 让页面切换更流畅自然
 */

/* 页面淡入动画 */
body {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 内容区域滑入动画 */
.container, .content-wrapper {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片淡入动画 */
.card, .product-card, .news-card {
    animation: cardFadeIn 0.4s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 图片加载占位符 */
img {
    background: linear-gradient(90deg, var(--gaming-black) 25%, var(--gaming-glass) 50%, var(--gaming-black) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[src] {
    animation: none;
    background: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 链接hover效果优化 */
a {
    transition: all 0.2s ease;
}

/* 按钮点击效果 */
.btn {
    transition: all 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* 导航栏过渡 */
.navbar {
    transition: all 0.3s ease;
}

/* 减少动画在低性能设备上的影响 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
