/* ==================== 像素风格加载遮罩 ==================== */

/* 全屏遮罩 - 完全不透明 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e27;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
    cursor: default !important; /* 显示默认鼠标 */
}

/* 加载遮罩内的所有元素显示鼠标 */
.loading-overlay * {
    cursor: default !important;
}

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

/* 加载容器 */
.loading-container {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

/* Logo样式 */
.loading-logo {
    font-family: 'Zpix', 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3rem;
    text-shadow: 0 0 30px rgba(0, 255, 249, 0.5);
    animation: pixelPulse 2s ease-in-out infinite;
    letter-spacing: 4px;
}

@keyframes pixelPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

/* 加载文字 */
.loading-text {
    font-family: 'Zpix', 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: var(--neon-cyan);
    margin-bottom: 2rem;
    letter-spacing: 2px;
    animation: textBlink 1.5s ease-in-out infinite;
}

@keyframes textBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 像素风格进度条容器 */
.pixel-progress-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid var(--neon-cyan);
    box-shadow:
        0 0 20px rgba(0, 255, 249, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-bottom: 1.5rem;
    image-rendering: pixelated;
}

/* 进度条填充 */
.pixel-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        var(--neon-cyan) 0%,
        var(--neon-magenta) 50%,
        var(--neon-purple) 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 249, 0.5);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 249, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 249, 0.8);
    }
}

/* 像素分段 */
.pixel-progress-segments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
}

.pixel-progress-segments span {
    flex: 1;
    border-right: 2px solid rgba(0, 255, 249, 0.2);
}

.pixel-progress-segments span:last-child {
    border-right: none;
}

/* 百分比显示 */
.loading-percentage {
    font-family: 'Zpix', 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--neon-cyan);
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(0, 255, 249, 0.8);
}

/* 像素方块动画背景 */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(0, 255, 249, 0.05) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(191, 0, 255, 0.05) 20px);
    animation: pixelMove 20s linear infinite;
    pointer-events: none;
}

@keyframes pixelMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(20px, 20px);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .loading-logo {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .loading-text {
        font-size: 1rem;
    }

    .pixel-progress-bar {
        height: 30px;
    }

    .loading-percentage {
        font-size: 1.5rem;
    }
}
