/* 加载进度指示器样式 */
.initial-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.initial-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.progress-section {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.progress-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.current-step {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 500;
}

.loading-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-item.completed:not(:last-child)::after {
    background-color: var(--success-color);
}

.step-item.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--success-color) 50%, var(--border-color) 50%);
}

.step-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-item.completed .step-circle {
    background-color: var(--success-color);
    color: white;
}

.step-item.active .step-circle {
    background-color: var(--primary-color);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0); }
}

.step-number {
    font-size: 12px;
    font-weight: 600;
}

.step-item.completed .step-number::before {
    content: '✓';
    font-size: 14px;
}

.step-item.completed .step-number {
    display: none;
}

.step-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    max-width: 60px;
}

.step-item.completed .step-label {
    color: var(--success-color);
    font-weight: 500;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loading-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .loading-title {
        font-size: 20px;
    }
    
    .loading-steps {
        padding: 0 5px;
    }
    
    .step-circle {
        width: 20px;
        height: 20px;
    }
    
    .step-number {
        font-size: 10px;
    }
    
    .step-label {
        font-size: 10px;
        max-width: 50px;
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 25px 15px;
        margin: 15px;
    }
    
    .loading-title {
        font-size: 18px;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .loading-steps {
        padding: 0;
    }
    
    .step-circle {
        width: 18px;
        height: 18px;
    }
    
    .step-label {
        font-size: 9px;
        max-width: 40px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .loading-container {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .loading-title {
        color: #ffffff;
    }
    
    .loading-subtitle {
        color: #cccccc;
    }
    
    .current-step {
        color: #ffffff;
    }
    
    .progress-info {
        color: #cccccc;
    }
    
    .step-label {
        color: #cccccc;
    }
    
    .step-item.completed .step-label {
        color: var(--success-color);
    }
    
    .step-item.active .step-label {
        color: var(--primary-color);
    }
}

/* 动画增强 */
.loading-container {
    animation: slideInUp 0.5s ease-out;
}

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

/* 加载完成动画 */
.loading-complete {
    animation: loadingComplete 0.5s ease-out forwards;
}

@keyframes loadingComplete {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}
