/* 俯视图双向流新风系统样式 */

/* 空气区域样式 */
.air-zone {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.air-zone:hover {
    transform: scale(1.05);
}

.zone-header {
    text-align: center;
    margin-bottom: 15px;
}

.zone-header h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2c3436;
    font-weight: bold;
}

/* 空气质量指示 */
.air-quality {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.air-quality .temp {
    font-size: 18px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
}

.air-quality .pm25 {
    font-size: 12px;
    opacity: 0.8;
}

.air-quality.poor .temp {
    background: #74b9ff;
    color: white;
}

.air-quality.good .temp {
    background: #fd79a8;
    color: white;
}

.air-quality.excellent .temp {
    background: #00b894;
    color: white;
}

/* 空气流动可视化 */
.air-flow-visual {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.flow-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.flow-particles::before,
.flow-particles::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleMove 3s ease-in-out infinite;
}

.flow-particles::before {
    animation-delay: 0s;
    top: 20px;
}

.flow-particles::after {
    animation-delay: 1.5s;
    top: 50px;
}

/* 不同区域的粒子颜色 */
.fresh-air-in .flow-particles::before,
.fresh-air-in .flow-particles::after {
    background: #74b9ff;
    box-shadow: 0 0 10px #74b9ff;
}

.return-air .flow-particles::before,
.return-air .flow-particles::after {
    background: #fd79a8;
    box-shadow: 0 0 10px #fd79a8;
}

.supply-air .flow-particles::before,
.supply-air .flow-particles::after {
    background: #00b894;
    box-shadow: 0 0 10px #00b894;
}

.exhaust-air-out .flow-particles::before,
.exhaust-air-out .flow-particles::after {
    background: #95a5a6;
    box-shadow: 0 0 10px #95a5a6;
}

.flow-direction {
    font-size: 24px;
    font-weight: bold;
    color: #2c3436;
    animation: directionPulse 2s ease-in-out infinite;
}

/* 热交换器单元 */
.heat-exchanger-unit {
    background: linear-gradient(135deg, #2d3436, #636e72);
    border-radius: 20px;
    padding: 30px;
    color: white;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.unit-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
    color: white;
}

/* 十字交叉热交换芯体 */
.cross-flow-core {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
}

/* 新风通道 (水平) */
.fresh-air-channel {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    transform: translateY(-50%);
    background: rgba(116, 185, 255, 0.3);
    border-radius: 20px;
    border: 2px solid #74b9ff;
}

/* 排风通道 (垂直) */
.exhaust-air-channel {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 40px;
    transform: translateX(-50%);
    background: rgba(253, 121, 168, 0.3);
    border-radius: 20px;
    border: 2px solid #fd79a8;
}

.channel-flow {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    position: relative;
    overflow: hidden;
}

.fresh-flow-h {
    background: linear-gradient(90deg, 
        rgba(116, 185, 255, 0.8) 0%, 
        rgba(0, 184, 148, 0.8) 100%);
    animation: flowHorizontal 3s ease-in-out infinite;
}

.exhaust-flow-v {
    background: linear-gradient(180deg, 
        rgba(253, 121, 168, 0.8) 0%, 
        rgba(149, 165, 166, 0.8) 100%);
    animation: flowVertical 3s ease-in-out infinite;
}

.channel-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #2c3436;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
}

/* 热交换矩阵 */
.heat-exchange-matrix {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e17055, #d63031);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    width: 60px;
    height: 60px;
}

.grid-cell {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    animation: cellPulse 2s ease-in-out infinite;
}

.grid-cell:nth-child(odd) {
    animation-delay: 0.5s;
}

.heat-transfer-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: waveExpand 3s ease-out infinite;
}

.wave:nth-child(2) { animation-delay: 1s; }
.wave:nth-child(3) { animation-delay: 2s; }

/* 效率徽章 */
.efficiency-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #00b894;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.efficiency-value {
    display: block;
    font-size: 16px;
    font-weight: bold;
}

.efficiency-label {
    display: block;
    font-size: 8px;
    opacity: 0.9;
}

/* 风机组件 */
.fan-units {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.supply-fan,
.exhaust-fan {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 10px;
    min-width: 80px;
}

.fan-icon {
    font-size: 24px;
    margin-bottom: 5px;
    animation: rotate 2s linear infinite;
}

.fan-label {
    font-size: 10px;
    text-align: center;
}

/* 过滤器组件 */
.filter-units {
    display: flex;
    justify-content: space-between;
}

.pre-filter,
.hepa-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 10px;
    min-width: 80px;
}

.filter-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

.filter-label {
    font-size: 10px;
    text-align: center;
}

/* 管道系统 */
.duct-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.duct {
    position: absolute;
    background: rgba(108, 117, 125, 0.4);
    border-radius: 10px;
}

/* 新风管道 (水平，从左到中) */
.fresh-duct {
    top: 50%;
    left: 16.66%;
    width: 33.33%;
    height: 20px;
    transform: translateY(-50%);
}

/* 送风管道 (垂直，从中到下) */
.supply-duct {
    left: 50%;
    top: 66.66%;
    width: 20px;
    height: 16.66%;
    transform: translateX(-50%);
}

/* 回风管道 (垂直，从上到中) */
.return-duct {
    left: 50%;
    top: 16.66%;
    width: 20px;
    height: 16.66%;
    transform: translateX(-50%);
}

/* 排风管道 (水平，从中到右) */
.exhaust-duct {
    top: 50%;
    right: 16.66%;
    width: 33.33%;
    height: 20px;
    transform: translateY(-50%);
}

.duct-flow {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    position: relative;
    overflow: hidden;
}

/* 动画流动效果 */
.animated-flow-right {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(116, 185, 255, 0.8) 50%, 
        transparent 100%);
    animation: flowRight 2s ease-in-out infinite;
}

.animated-flow-up {
    background: linear-gradient(0deg, 
        transparent 0%, 
        rgba(0, 184, 148, 0.8) 50%, 
        transparent 100%);
    animation: flowUp 2s ease-in-out infinite;
}

.animated-flow-down {
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(253, 121, 168, 0.8) 50%, 
        transparent 100%);
    animation: flowDown 2s ease-in-out infinite;
}

.animated-flow-left {
    background: linear-gradient(270deg, 
        transparent 0%, 
        rgba(149, 165, 166, 0.8) 50%, 
        transparent 100%);
    animation: flowLeft 2s ease-in-out infinite;
}

/* 动画定义 */
@keyframes particleMove {
    0% { transform: translateX(-20px); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(120px); opacity: 0; }
}

@keyframes directionPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes flowHorizontal {
    0% { background-position: -100px 0; }
    100% { background-position: 100px 0; }
}

@keyframes flowVertical {
    0% { background-position: 0 -100px; }
    100% { background-position: 0 100px; }
}

@keyframes cellPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes waveExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes flowRight {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

@keyframes flowUp {
    0% { background-position: 0 200px; }
    100% { background-position: 0 -200px; }
}

@keyframes flowDown {
    0% { background-position: 0 -200px; }
    100% { background-position: 0 200px; }
}

@keyframes flowLeft {
    0% { background-position: 200px 0; }
    100% { background-position: -200px 0; }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .top-view-layout {
        grid-template-columns: 1fr 1.5fr 1fr;
        gap: 15px;
    }
    
    .air-zone {
        padding: 15px;
    }
    
    .heat-exchanger-unit {
        padding: 20px;
    }
    
    .cross-flow-core {
        height: 150px;
    }
}

@media (max-width: 768px) {
    .system-diagram {
        height: 500px;
        padding: 20px;
    }
    
    .top-view-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas: 
            "heat-exchanger"
            "outdoor-fresh"
            "indoor-return"
            "indoor-supply"
            "outdoor-exhaust";
        gap: 10px;
    }
    
    .air-zone {
        padding: 10px;
    }
    
    .zone-header h4 {
        font-size: 14px;
    }
    
    .air-quality .temp {
        font-size: 14px;
    }
}

/* 减少动画以提高性能 */
@media (prefers-reduced-motion: reduce) {
    .flow-particles::before,
    .flow-particles::after,
    .flow-direction,
    .fresh-flow-h,
    .exhaust-flow-v,
    .grid-cell,
    .wave,
    .efficiency-badge,
    .fan-icon,
    .animated-flow-right,
    .animated-flow-up,
    .animated-flow-down,
    .animated-flow-left {
        animation: none;
    }
}