/**
 * 加载动画样式
 * 用于整个网站的加载状态显示
 */

/* 加载动画容器 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-height: 200px;
    color: #1976d2;
    z-index: 1000; /* 提高z-index确保在最上层 */
    padding: 2rem;
    text-align: center;
    background-color: transparent;
}

/* 加载旋转器 */
.loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    border: 4px solid rgba(25, 118, 210, 0.1);
    border-left-color: #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001; /* 确保在父容器之上 */
}

/* 加载文本 */
.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1976d2;
    margin-top: 0.5rem;
    animation: pulse 1.5s infinite ease-in-out;
    z-index: 1001; /* 确保在父容器之上 */
    position: relative;
}

/* 旋转动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 脉冲动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡出动画 */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 级联加载动画 */
.cascade-item {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为级联项添加不同的延迟 */
.cascade-item:nth-child(1) { animation-delay: 0.1s; }
.cascade-item:nth-child(2) { animation-delay: 0.2s; }
.cascade-item:nth-child(3) { animation-delay: 0.3s; }
.cascade-item:nth-child(4) { animation-delay: 0.4s; }
.cascade-item:nth-child(5) { animation-delay: 0.5s; }
.cascade-item:nth-child(6) { animation-delay: 0.6s; }
.cascade-item:nth-child(n+7) { animation-delay: 0.7s; }

/* 错误状态样式 */
.loading-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #757575;
    background-color: #f9f9f9;
    border-radius: 12px;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    z-index: 900; /* 提高z-index但保持在loading下方 */
}

.loading-error:before {
    content: '⚠️';
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #757575;
    background-color: #f9f9f9;
    border-radius: 12px;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    z-index: 900; /* 提高z-index但保持在loading下方 */
}

.empty-state:before {
    content: '🔍';
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* 状态点动画 */
@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.status-online {
    animation: statusPulse 2s infinite;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-error,
    .empty-state {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
    
    .loading-error:before,
    .empty-state:before {
        font-size: 2rem;
    }
} 