/**
 * Site AOS (Animate On Scroll) Effects
 * 基于ATP Bio网站的动画效果设计
 */

/* 基础可见性控制 */
.site-aos-visible {
    opacity: 0;
    transition: all 0.4s ease-out;
}

@media screen and (max-width: 1024px) {
    .site-aos-visible {
        opacity: 1; /* 移动端直接显示，避免性能问题 */
    }
}

/* 淡入动画 */
.site-aos-fade-in {
    animation: siteAosFadeIn 0.4s ease-out forwards;
}

@keyframes siteAosFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 从左侧滑入 */
.site-aos-fade-in-left {
    animation: siteAosFadeInLeft 0.4s ease-out forwards;
}

@keyframes siteAosFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 从右侧滑入 */
.site-aos-fade-in-right {
    animation: siteAosFadeInRight 0.4s ease-out forwards;
    animation-delay: 0.1s;
}

@keyframes siteAosFadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 从下方滑入 */
.site-aos-fade-in-up {
    animation: siteAosFadeInUp 0.4s ease-out forwards;
}

@keyframes siteAosFadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 缩放动画 */
.site-aos-zoom-in {
    animation: siteAosZoomIn 0.4s ease-out forwards;
}

@keyframes siteAosZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 弹跳进入 - 左侧 */
.site-aos-bounce-in-left {
    animation: siteAosBounceInLeft 0.4s ease-out forwards;
}

@keyframes siteAosBounceInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    60% {
        opacity: 1;
        transform: translateX(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 弹跳进入 - 右侧 */
.site-aos-bounce-in-right {
    animation: siteAosBounceInRight 0.4s ease-out forwards;
    animation-delay: 0.15s;
}

@keyframes siteAosBounceInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    60% {
        opacity: 1;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 数字计数器动画 */
.site-aos-counter {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.site-aos-counter.site-aos-animate {
    opacity: 1;
}

/* 延迟动画类 */
.site-aos-delay-100 {
    animation-delay: 0.1s;
}

.site-aos-delay-200 {
    animation-delay: 0.2s;
}

.site-aos-delay-300 {
    animation-delay: 0.3s;
}

.site-aos-delay-400 {
    animation-delay: 0.4s;
}

.site-aos-delay-500 {
    animation-delay: 0.5s;
}

/* 特定区块的动画效果 */

/* 英雄区域 */
#main .hero-section .hero-title {
    opacity: 0;
    animation: siteAosBounceInLeft 1s ease-out 0.5s forwards;
}

#main .hero-section .hero-subtitle {
    opacity: 0;
    animation: siteAosFadeInUp 0.8s ease-out 0.8s forwards;
}

#main .hero-section .hero-description {
    opacity: 0;
    animation: siteAosFadeInUp 0.8s ease-out 1s forwards;
}

#main .hero-section .hero-buttons {
    opacity: 0;
    animation: siteAosFadeInUp 0.8s ease-out 1.2s forwards;
}

/* 第二板块动画 */
.index-part-2__manufacturer .index-part-2__description {
    opacity: 0;
}

.index-part-2__manufacturer .index-part-2__description.site-aos-animate {
    animation: siteAosBounceInLeft 0.8s ease-out forwards;
}

.index-part-2__multiple .index-part-2__description {
    opacity: 0;
}

.index-part-2__multiple .index-part-2__description.site-aos-animate {
    animation: siteAosBounceInRight 0.8s ease-out forwards;
}

/* 第三板块 - 配方网格 */
.index-part-3__item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.index-part-3__item.site-aos-animate {
    opacity: 1;
    transform: translateY(0);
}

.index-part-3__item:nth-child(1) { transition-delay: 0.1s; }
.index-part-3__item:nth-child(2) { transition-delay: 0.2s; }
.index-part-3__item:nth-child(3) { transition-delay: 0.3s; }
.index-part-3__item:nth-child(4) { transition-delay: 0.4s; }
.index-part-3__item:nth-child(5) { transition-delay: 0.5s; }
.index-part-3__item:nth-child(6) { transition-delay: 0.6s; }

/* 第四板块 - 认证标志 */
.index-part-4__cert-item {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease-out;
}

.index-part-4__cert-item.site-aos-animate {
    opacity: 1;
    transform: scale(1);
}

.index-part-4__cert-item:nth-child(1) { transition-delay: 0.1s; }
.index-part-4__cert-item:nth-child(2) { transition-delay: 0.2s; }
.index-part-4__cert-item:nth-child(3) { transition-delay: 0.3s; }
.index-part-4__cert-item:nth-child(4) { transition-delay: 0.4s; }
.index-part-4__cert-item:nth-child(5) { transition-delay: 0.5s; }

/* 统计数据动画 */
.index-part-4__stat-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.index-part-4__stat-item.site-aos-animate {
    opacity: 1;
    transform: translateY(0);
}

.index-part-4__stat-item:nth-child(1) { transition-delay: 0.1s; }
.index-part-4__stat-item:nth-child(2) { transition-delay: 0.2s; }
.index-part-4__stat-item:nth-child(3) { transition-delay: 0.3s; }
.index-part-4__stat-item:nth-child(4) { transition-delay: 0.4s; }
.index-part-4__stat-item:nth-child(5) { transition-delay: 0.5s; }
.index-part-4__stat-item:nth-child(6) { transition-delay: 0.6s; }

/* 新闻板块动画 */
.index-part-news__about-content {
    opacity: 0;
}

.index-part-news__about-content.site-aos-animate {
    animation: siteAosFadeInLeft 0.8s ease-out forwards;
}

.index-part-news__latest-content {
    opacity: 0;
}

.index-part-news__latest-content.site-aos-animate {
    animation: siteAosFadeInRight 0.8s ease-out forwards;
}

.index-part-news__item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.index-part-news__item.site-aos-animate {
    opacity: 1;
    transform: translateY(0);
}

.index-part-news__item:nth-child(1) { transition-delay: 0.1s; }
.index-part-news__item:nth-child(2) { transition-delay: 0.2s; }
.index-part-news__item:nth-child(3) { transition-delay: 0.3s; }

/* 移动端优化 */
@media screen and (max-width: 768px) {
    /* 移动端减少动画复杂度 */
    .site-aos-bounce-in-left,
    .site-aos-bounce-in-right {
        animation: siteAosFadeIn 0.6s ease-out forwards;
    }
    
    /* 减少延迟时间 */
    .site-aos-delay-100 { animation-delay: 0.05s; }
    .site-aos-delay-200 { animation-delay: 0.1s; }
    .site-aos-delay-300 { animation-delay: 0.15s; }
    .site-aos-delay-400 { animation-delay: 0.2s; }
    .site-aos-delay-500 { animation-delay: 0.25s; }
}
