/* ============================================
   Enhanced Animations for Allrun Group
   Lightweight and non-conflicting animations
   Theme color: #AE1819 (红色主题保持不变)
   ============================================ */

/* 使用CSS变量定义主题色，便于统一管理 */
:root {
    --allrun-red: #AE1819;
    --allrun-dark-blue: #051c35;
    --allrun-light-text: #fff;
    --allrun-dark-text: #4A5159;
}

/* ======= 1. 轻量级卡片悬停效果 (不影响布局) ======= */
.category-box, .feature-box, .themes-box, .news-box {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform;
}

.category-box:hover, .feature-box:hover, .themes-box:hover, .news-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(174, 24, 25, 0.15);
}

/* 卡片图片放大效果 */
.category-box .thumb img, 
.feature-box .thumb img, 
.themes-box .thumb img {
    transition: transform 0.6s ease;
}

.category-box:hover .thumb img, 
.feature-box:hover .thumb img, 
.themes-box:hover .thumb img {
    transform: scale(1.05);
}

/* ======= 2. 按钮增强效果 (保持红色主题) ======= */
.main-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(174, 24, 25, 0.25);
}

/* 按钮光晕效果 */
.main-btn::after {
    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 0.5s ease;
}

.main-btn:hover::after {
    left: 100%;
}

/* ======= 3. 轮播图增强效果 ======= */
.owl-carousel .owl-item {
    transition: opacity 0.3s ease;
}

.owl-carousel .owl-item.active {
    opacity: 1;
}

.owl-carousel .owl-item:not(.active) {
    opacity: 0.7;
}

/* 轮播图项悬停效果 */
.totalfetaure .feature-box:hover,
.totalpartner .single:hover {
    transform: scale(1.02);
}

/* ======= 4. 导航菜单效果 ======= */
.primary-menu > li > a {
    position: relative;
    transition: color 0.3s ease;
}

.primary-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--allrun-red);
    transition: width 0.3s ease;
}

.primary-menu > li:hover > a::after,
.primary-menu > li.current > a::after {
    width: 100%;
}

/* ======= 5. 数字/图标浮动效果 ======= */
.man-pic {
    animation: gentle-float 6s ease-in-out infinite;
}

.man-pic.pic-1 { animation-delay: 0s; }
.man-pic.pic-2 { animation-delay: 1s; }
.man-pic.pic-3 { animation-delay: 2s; }
.man-pic.pic-4 { animation-delay: 3s; }
.man-pic.pic-5 { animation-delay: 4s; }
.man-pic.pic-6 { animation-delay: 5s; }

@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ======= 6. 合作伙伴logo效果 ======= */
.totalpartner .single {
    transition: all 0.4s ease;
    padding: 10px;
}

.totalpartner .single:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.totalpartner .single img {
    transition: filter 0.3s ease;
}

.totalpartner .single:hover img {
    filter: brightness(1.1);
}

/* ======= 7. 页脚链接效果 ======= */
.footer-list li a {
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-list li a:hover {
    color: var(--allrun-red);
    transform: translateX(5px);
}

.footer-list li a::before {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 5px;
}

.footer-list li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* ======= 8. 预加载动画增强 ======= */
.loader-ring {
    border-top-color: var(--allrun-red);
}

#preloader {
    background: #fff;
}

.loader-logo img {
    animation: logo-breathe 2s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ======= 9. 滚动显示效果 (兼容现有wow.js) ======= */
.reveal-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 为现有wow元素添加额外效果 */
.wow.fadeInUp {
    transition-duration: 0.8s;
}

/* ======= 10. 粘性头部效果 ======= */
.sticky-header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.sticky-header.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ======= 11. 表单元素效果 ======= */
input, textarea, select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--allrun-red);
    box-shadow: 0 0 0 3px rgba(174, 24, 25, 0.1);
    outline: none;
}

/* ======= 12. 响应式调整 ======= */
@media (max-width: 768px) {
    .category-box:hover, .feature-box:hover, .themes-box:hover {
        transform: translateY(-3px);
    }
    
    .man-pic {
        animation-duration: 8s;
    }
    
    .totalpartner .single:hover {
        transform: translateY(-3px);
    }
}

/* ======= 13. 性能优化 ======= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .man-pic {
        animation: none;
    }
}

/* ======= 14. 打印样式优化 ======= */
@media print {
    .category-box, .feature-box, .themes-box {
        box-shadow: none !important;
        transform: none !important;
    }
}