/* 全局加载动画组件 */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-loader.show {
    display: flex;
    opacity: 1;
}

.loader-content {
    text-align: center;
    color: white;
}

/* 旋转太极图加载动画 */
.spinner-taiji {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    position: relative;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-taiji::before {
    content: '☯';
    font-size: 100px;
    display: block;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
}

/* 脉冲圆环加载器 */
.spinner-pulse {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

.spinner-pulse::before,
.spinner-pulse::after {
    content: '';
    position: absolute;
    border: 3px solid #D4AF37;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: pulse 1.5s ease-out infinite;
}

.spinner-pulse::after {
    animation-delay: 0.75s;
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* 三点跳动加载器 */
.spinner-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 0 auto 30px;
    height: 80px;
}

.spinner-dots .dot {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #D4AF37, #a47e3b);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.spinner-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.spinner-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    40% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }
}

/* 加载文字 */
.loader-text {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.loader-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
}

/* 进度条加载器 */
.loader-progress {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #D4AF37, #a47e3b, #D4AF37);
    background-size: 200% 100%;
    animation: progress 1.5s ease-in-out infinite;
    border-radius: 10px;
}

@keyframes progress {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }
    50% {
        width: 70%;
        background-position: 100% 50%;
    }
    100% {
        width: 100%;
        background-position: 0% 50%;
    }
}

/* 暗黑模式支持 */
body.dark-mode .global-loader {
    background: rgba(26, 26, 46, 0.95);
}

body.dark-mode .spinner-taiji::before {
    filter: drop-shadow(0 0 20px rgba(129, 199, 132, 0.8));
}

body.dark-mode .spinner-pulse::before,
body.dark-mode .spinner-pulse::after {
    border-color: #81c784;
}

body.dark-mode .spinner-dots .dot {
    background: linear-gradient(135deg, #81c784, #66bb6a);
}

body.dark-mode .loader-progress-bar {
    background: linear-gradient(90deg, #81c784, #66bb6a, #81c784);
}

/* 响应式 */
@media (max-width: 576px) {
    .spinner-taiji {
        width: 70px;
        height: 70px;
    }

    .spinner-taiji::before {
        font-size: 70px;
    }

    .loader-progress {
        width: 80%;
    }

    .loader-text {
        font-size: 16px;
    }
}
