/* ==================== 骨架屏和加载状态 ==================== */

/* 骨架屏基础样式 */
.skeleton-loader {
    padding: 20px;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg,
            var(--bg-secondary, #f0f0f0) 0%,
            var(--bg-tertiary, #e0e0e0) 50%,
            var(--bg-secondary, #f0f0f0) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-item-small {
    height: 40px;
}

.skeleton-item-large {
    height: 80px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-text-medium {
    width: 80%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 暗色主题骨架屏 */
[data-theme="dark"] .skeleton-item {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
}

/* 进度指示器 */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-tertiary);
    z-index: 9999;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary-color) 0%,
            var(--accent-color, #764ba2) 100%);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* 加载动画 - 点状 */
.loading-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 加载动画 - 旋转 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* 加载状态容器 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 步骤进度指示器 */
.step-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin: 16px 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.step-item.completed .step-number {
    background: var(--color-success, #10b981);
    color: white;
}

.step-item.completed .step-number::before {
    content: '✓';
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step-divider {
    flex: 1;
    height: 2px;
    background: var(--bg-tertiary);
    position: relative;
}

.step-divider::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0;
}

.step-item.completed+.step-divider::after {
    width: 100%;
}

/* 脉冲加载动画 */
.pulse-loader {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.6;
    animation: pulse-scale 1.5s ease-in-out infinite;
}

@keyframes pulse-scale {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
}

/* 取消按钮 */
.cancel-button {
    margin-top: 16px;
    padding: 8px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .step-progress {
        flex-direction: column;
        gap: 16px;
    }

    .step-divider {
        width: 2px;
        height: 20px;
        flex: none;
    }

    .step-divider::after {
        width: 100%;
        height: 0;
        transition: height 0.3s ease;
    }

    .step-item.completed+.step-divider::after {
        height: 100%;
    }

    .step-label {
        white-space: normal;
    }
}