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

/* 全屏遮罩 - 完全不透明 */
.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: 650px;
    width: 90%;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Logo样式 */
.loading-logo {
    font-family: 'Zpix', 'Orbitron', sans-serif;
    font-size: 3.5rem;
    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: 4rem;
    text-shadow: 0 0 30px rgba(0, 255, 249, 0.5);
    animation: pixelPulse 2s ease-in-out infinite;
    letter-spacing: 6px;
}

@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: 0.75rem;
    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: 56px;
    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;
    z-index: 1;
}

/* 像素装饰元素 */
.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(0, 255, 249, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(191, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
    animation: glowPulse 4s ease-in-out infinite;
}

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

/* 像素装饰盒子 */
.pixel-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.pixel-box {
    position: absolute;
    background: rgba(0, 255, 249, 0.1);
    border: 2px solid rgba(0, 255, 249, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 249, 0.2);
    image-rendering: pixelated;
}

.pixel-box-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 15%;
    animation: pixelFloat1 6s ease-in-out infinite;
}

.pixel-box-2 {
    width: 60px;
    height: 60px;
    top: 20%;
    right: 20%;
    animation: pixelFloat2 8s ease-in-out infinite;
    border-color: rgba(191, 0, 255, 0.3);
    box-shadow: 0 0 20px rgba(191, 0, 255, 0.2);
    background: rgba(191, 0, 255, 0.1);
}

.pixel-box-3 {
    width: 50px;
    height: 50px;
    bottom: 25%;
    left: 10%;
    animation: pixelFloat3 7s ease-in-out infinite;
    border-color: rgba(255, 0, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
    background: rgba(255, 0, 255, 0.1);
}

.pixel-box-4 {
    width: 70px;
    height: 70px;
    bottom: 15%;
    right: 12%;
    animation: pixelFloat4 9s ease-in-out infinite;
}

.pixel-box-5 {
    width: 40px;
    height: 40px;
    top: 60%;
    left: 8%;
    animation: pixelFloat5 5s ease-in-out infinite;
    border-color: rgba(191, 0, 255, 0.3);
    box-shadow: 0 0 20px rgba(191, 0, 255, 0.2);
    background: rgba(191, 0, 255, 0.1);
}

.pixel-box-6 {
    width: 55px;
    height: 55px;
    top: 70%;
    right: 15%;
    animation: pixelFloat6 7.5s ease-in-out infinite;
    border-color: rgba(255, 0, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
    background: rgba(255, 0, 255, 0.1);
}

@keyframes pixelFloat1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(20px, -20px) rotate(180deg);
    }
}

@keyframes pixelFloat2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-25px, 25px) rotate(-180deg);
    }
}

@keyframes pixelFloat3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(15px, 15px) rotate(90deg);
    }
}

@keyframes pixelFloat4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-20px, -15px) rotate(-90deg);
    }
}

@keyframes pixelFloat5 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(10px, -10px) rotate(45deg);
    }
}

@keyframes pixelFloat6 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-15px, 10px) rotate(-45deg);
    }
}

@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;
    }
}
