/* 加载动画覆盖层 */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

/* 加载动画主体 */
.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

/* 旋转圆环 */
.loader-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

/* 加载文字 */
.loader-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, 
        var(--primary-color), 
        var(--accent-color), 
        var(--name-color),
        var(--primary-color));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    animation: 
        fadeIn 0.8s ease-out forwards 0.1s,
        colorShift 4s linear infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.loader-text::after {
    content: '...';
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* 加载进度 */
.loader-progress {
    width: 120px;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease-out;
}

/* 加载完成后隐藏 */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* 旋转动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 加载超时处理 */
.loader-skip {
    position: absolute;
    bottom: 30px;
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--primary-color);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.loader-skip.show {
    opacity: 1;
}

.loader-skip:hover {
    background-color: var(--accent-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loader {
        width: 60px;
        height: 60px;
    }
    
    .loader-ring {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }
    
    .loader-text {
        font-size: 14px;
    }
    
    .loader-progress {
        width: 100px;
    }
}