/* 双向流新风系统动画样式 */

/* 空气粒子动画 */
.air-particles {
    position: relative;
    width: 100px;
    height: 60px;
    margin: 10px auto;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0.8;
}

/* 冷空气粒子 - 蓝色 */
.cold-air .particle {
    background: #3498db;
    animation: coldAirFlow 3s infinite linear;
}

.cold-air .particle:nth-child(1) { animation-delay: 0s; }
.cold-air .particle:nth-child(2) { animation-delay: 0.6s; }
.cold-air .particle:nth-child(3) { animation-delay: 1.2s; }
.cold-air .particle:nth-child(4) { animation-delay: 1.8s; }
.cold-air .particle:nth-child(5) { animation-delay: 2.4s; }

/* 暖空气粒子 - 红色 */
.warm-air .particle {
    background: #e74c3c;
    animation: warmAirFlow 3s infinite linear;
}

.warm-air .particle:nth-child(1) { animation-delay: 0s; }
.warm-air .particle:nth-child(2) { animation-delay: 0.6s; }
.warm-air .particle:nth-child(3) { animation-delay: 1.2s; }
.warm-air .particle:nth-child(4) { animation-delay: 1.8s; }
.warm-air .particle:nth-child(5) { animation-delay: 2.4s; }

/* 处理后空气粒子 - 绿色 */
.treated .particle {
    background: #27ae60;
    animation: treatedAirFlow 3s infinite linear;
}

.treated .particle:nth-child(1) { animation-delay: 0s; }
.treated .particle:nth-child(2) { animation-delay: 0.6s; }
.treated .particle:nth-child(3) { animation-delay: 1.2s; }
.treated .particle:nth-child(4) { animation-delay: 1.8s; }
.treated .particle:nth-child(5) { animation-delay: 2.4s; }

/* 排出空气粒子 - 灰色 */
.exhaust .particle {
    background: #95a5a6;
    animation: exhaustAirFlow 3s infinite linear;
}

.exhaust .particle:nth-child(1) { animation-delay: 0s; }
.exhaust .particle:nth-child(2) { animation-delay: 0.6s; }
.exhaust .particle:nth-child(3) { animation-delay: 1.2s; }
.exhaust .particle:nth-child(4) { animation-delay: 1.8s; }
.exhaust .particle:nth-child(5) { animation-delay: 2.4s; }

/* 空气流动动画关键帧 */
@keyframes coldAirFlow {
    0% { 
        transform: translateX(-20px) translateY(0px);
        opacity: 0;
    }
    20% { 
        opacity: 1;
    }
    80% { 
        opacity: 1;
    }
    100% { 
        transform: translateX(120px) translateY(0px);
        opacity: 0;
    }
}

@keyframes warmAirFlow {
    0% { 
        transform: translateX(120px) translateY(0px);
        opacity: 0;
    }
    20% { 
        opacity: 1;
    }
    80% { 
        opacity: 1;
    }
    100% { 
        transform: translateX(-20px) translateY(0px);
        opacity: 0;
    }
}

@keyframes treatedAirFlow {
    0% { 
        transform: translateX(-20px) translateY(0px);
        opacity: 0;
    }
    20% { 
        opacity: 1;
    }
    80% { 
        opacity: 1;
    }
    100% { 
        transform: translateX(120px) translateY(0px);
        opacity: 0;
    }
}

@keyframes exhaustAirFlow {
    0% { 
        transform: translateX(120px) translateY(0px);
        opacity: 0;
    }
    20% { 
        opacity: 1;
    }
    80% { 
        opacity: 1;
    }
    100% { 
        transform: translateX(-20px) translateY(0px);
        opacity: 0;
    }
}

/* 风机叶片旋转动画 */
.fan-blades {
    animation: fanRotation 1s infinite linear;
}

.supply-fan .fan-blades {
    animation-direction: normal;
}

.exhaust-fan .fan-blades {
    animation-direction: reverse;
}

@keyframes fanRotation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 热交换器热量传递动画 */
.heat-transfer-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.heat-wave {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #f39c12, transparent);
    border-radius: 50%;
    opacity: 0;
    animation: heatTransfer 2s infinite ease-in-out;
}

.heat-wave:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.heat-wave:nth-child(2) {
    top: 50%;
    left: 50%;
    animation-delay: 0.7s;
}

.heat-wave:nth-child(3) {
    top: 80%;
    left: 80%;
    animation-delay: 1.4s;
}

@keyframes heatTransfer {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 热交换器板片发光效果 */
.heat-exchanger {
    position: relative;
    overflow: visible;
}

.heat-exchanger::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #f39c12, #e67e22, #d35400, #f39c12);
    border-radius: 15px;
    opacity: 0.3;
    animation: heatGlow 3s infinite ease-in-out;
    z-index: -1;
}

@keyframes heatGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* 过滤器工作指示 */
.filter {
    position: relative;
    overflow: visible;
}

.filter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.3), transparent);
    animation: filterWork 2s infinite ease-in-out;
}

@keyframes filterWork {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* 气流方向箭头 */
.airflow-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.arrow {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
    animation: arrowFlow 2s infinite ease-in-out;
}

.inlet-arrow {
    top: 30%;
    left: 15%;
    color: #3498db;
}

.supply-arrow {
    top: 30%;
    right: 15%;
    color: #27ae60;
}

.return-arrow {
    bottom: 30%;
    right: 15%;
    color: #e74c3c;
}

.exhaust-arrow {
    bottom: 30%;
    left: 15%;
    color: #95a5a6;
}

@keyframes arrowFlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 温度标签动画 */
.temperature-label {
    animation: temperaturePulse 3s infinite ease-in-out;
}

@keyframes temperaturePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
}

.temperature-label.warm {
    animation-name: warmTemperaturePulse;
}

@keyframes warmTemperaturePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

.temperature-label.treated {
    animation-name: treatedTemperaturePulse;
}

@keyframes treatedTemperaturePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
}

.temperature-label.exhaust {
    animation-name: exhaustTemperaturePulse;
}

@keyframes exhaustTemperaturePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(149, 165, 166, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(149, 165, 166, 0);
    }
}

/* 效率显示动画 */
.efficiency-display {
    animation: efficiencyBlink 4s infinite ease-in-out;
}

@keyframes efficiencyBlink {
    0%, 90%, 100% {
        opacity: 1;
        color: #e67e22;
    }
    95% {
        opacity: 0.5;
        color: #f39c12;
    }
}

/* 演示容器整体动画 */
.demo-container {
    animation: containerBreath 6s infinite ease-in-out;
}

@keyframes containerBreath {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 15px 40px rgba(52, 152, 219, 0.15);
    }
}

/* 工作原理说明项动画 */
.explanation-item {
    animation: explanationFadeIn 0.8s ease-out;
    animation-fill-mode: both;
}

.explanation-item:nth-child(1) { animation-delay: 0.2s; }
.explanation-item:nth-child(2) { animation-delay: 0.4s; }
.explanation-item:nth-child(3) { animation-delay: 0.6s; }
.explanation-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes explanationFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 步骤编号动画 */
.step-number {
    animation: stepNumberPulse 2s infinite ease-in-out;
}

.explanation-item:nth-child(1) .step-number { animation-delay: 0s; }
.explanation-item:nth-child(2) .step-number { animation-delay: 0.5s; }
.explanation-item:nth-child(3) .step-number { animation-delay: 1s; }
.explanation-item:nth-child(4) .step-number { animation-delay: 1.5s; }

@keyframes stepNumberPulse {
    0%, 70%, 100% {
        transform: scale(1);
        background: #3498db;
    }
    35% {
        transform: scale(1.1);
        background: #2980b9;
    }
}

/* 响应式动画调整 */
@media (max-width: 768px) {
    .air-particles {
        width: 80px;
        height: 50px;
    }
    
    .particle {
        width: 4px;
        height: 4px;
    }
    
    .arrow {
        font-size: 18px;
    }
    
    .heat-wave {
        width: 3px;
        height: 3px;
    }
}

/* 暂停动画的控制类 */
.demo-container.paused * {
    animation-play-state: paused;
}

/* 鼠标悬停时的交互效果 */
.demo-container:hover .fan-blades {
    animation-duration: 0.5s;
}

.demo-container:hover .heat-wave {
    animation-duration: 1s;
}

.demo-container:hover .particle {
    animation-duration: 2s;
}