/* 階段載入樣式 */
.stage-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.stage-loading-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-modal {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 50px 60px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    animation: slideIn 0.5s ease;
}

.loading-mascot {
    width: 120px;
    height: auto;
    max-height: 120px;
    margin-bottom: 40px;
    animation: bounce 1.5s infinite;
    object-fit: contain;
}

@keyframes slideIn {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

.loading-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-percentage {
    font-size: 36px;
    color: #FF6B6B;
    font-weight: bold;
    margin-bottom: 30px;
}

.loading-progress-bar {
    width: 300px;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 40px;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.loading-stages {
    display: flex;
    gap: 40px;
}

.loading-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.loading-stage.active {
    opacity: 1;
}

.loading-stage.completed {
    opacity: 1;
}

.stage-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.loading-stage.active .stage-icon {
    background: #32CD32;
    animation: pulse 1.5s infinite;
}

.loading-stage.completed .stage-icon {
    background: #32CD32;
}

.loading-stage:not(.active):not(.completed) .stage-icon {
    background: rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(50, 205, 50, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(50, 205, 50, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(50, 205, 50, 0);
    }
}

.stage-label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.loading-connector {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    position: absolute;
    top: 25px;
    left: 50px;
}

.loading-stage.completed + .loading-stage::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: #32CD32;
    top: 25px;
    left: -40px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .loading-modal {
        padding: 35px 40px;
        max-width: 90%;
        margin: 20px;
    }
    
    .loading-mascot {
        width: 80px;
        height: auto;
        max-height: 80px;
        margin-bottom: 30px;
    }
    
    .loading-title {
        font-size: 20px;
    }
    
    .loading-percentage {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .loading-progress-bar {
        width: 250px;
        margin-bottom: 30px;
    }
    
    .loading-stages {
        gap: 25px;
    }
    
    .stage-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .stage-label {
        font-size: 12px;
    }
}