/* 简化加载动画 v2.0 - 优化版 */

/* 主加载器 */
#loadingSpinner {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
}

#loadingSpinner .spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 123, 255, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
}

#loadingSpinner p {
    margin-top: 12px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

/* 预览区加载器 */
#preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    min-height: 200px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
}

#preview-loading .preview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 123, 255, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
}

#preview-loading p {
    margin-top: 16px;
    color: #495057;
    font-size: 16px;
    font-weight: 500;
}

/* 生成状态指示 */
.generating-status {
    margin-top: 12px;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.generating-status.active {
    color: #007bff;
}

.generating-status.success {
    color: #28a745;
}

.generating-status.error {
    color: #dc3545;
}

/* 加载动画 */
@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 淡入效果 */
.loading-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.loading-fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 小型加载器 */
.loading-mini {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 123, 255, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* 按钮内加载器 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

.btn-loading .btn-text {
    opacity: 0.6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #loadingSpinner .spinner,
    #preview-loading .preview-spinner {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    #preview-loading {
        height: 150px;
        min-height: 150px;
    }
    
    #preview-loading p {
        font-size: 14px;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    #loadingSpinner .spinner,
    #preview-loading .preview-spinner,
    .loading-mini,
    .btn-loading::after {
        animation: none;
        border-top-color: transparent;
    }
    
    .loading-fade-in,
    .loading-fade-out {
        animation: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    #loadingSpinner .spinner,
    #preview-loading .preview-spinner,
    .loading-mini {
        border-color: currentColor;
        border-top-color: transparent;
    }
}

/* 优化版标记 2025-06-25 */
/* 科技感星光进度条样式 */
.tech-progress-container {
    margin: 15px 0;
    position: relative;
}

.tech-progress-track {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.tech-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 123, 255, 0.8) 0%, 
        rgba(0, 191, 255, 1) 50%, 
        rgba(135, 206, 250, 0.8) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
}

.starlight-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: starlight 2s infinite;
}

@keyframes starlight {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.tech-progress-text {
    text-align: center;
    margin-top: 8px;
    color: #007bff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}