/* ========================================
   墨韵幽境 — 加载体验
   ======================================== */

/* ── 骨架屏 ── */

.skeleton {
    background: linear-gradient(90deg, var(--parchment-faint) 0%, rgba(232, 220, 200, 0.06) 50%, var(--parchment-faint) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 3px; }
.skeleton-text-short { width: 60%; }
.skeleton-text-medium { width: 80%; }
.skeleton-text-full { width: 100%; }
.skeleton-title { height: 22px; width: 50%; margin-bottom: 16px; }
.skeleton-button { height: 44px; width: 120px; border-radius: 4px; }
.skeleton-card { height: 100px; border-radius: 8px; }

/* ── 加载点动画 ── */

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--amber);
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── 加载提示 ── */

.loading-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--overlay-heavy);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.loading-status {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-percent {
    color: var(--amber);
    font-weight: 500;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

/* ── 进度条 ── */

.progress-gradient {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-gradient .progress-fill {
    height: 100%;
    background: var(--amber);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ── 步骤进度 ── */

.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-progress-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-progress-item.active .step-progress-circle {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--ink-black);
}

.step-progress-item.completed .step-progress-circle {
    background: var(--jade);
    border-color: var(--jade);
    color: var(--ink-black);
}

.step-progress-line {
    width: 48px;
    height: 1px;
    background: var(--border);
    transition: background 0.3s ease;
}

.step-progress-item.completed + .step-progress-line {
    background: var(--jade);
}

/* ── 按钮加载状态 ── */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid var(--border);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: inkSpin 0.8s linear infinite;
    z-index: 1;
}

@keyframes inkSpin {
    to { transform: rotate(360deg); }
}

/* ── 内容加载过渡 ── */

.content-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.content-loaded {
    opacity: 1;
    pointer-events: auto;
}

.lazy-load {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.lazy-load.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ── 全屏加载 ── */

.fullscreen-loading {
    position: fixed;
    inset: 0;
    background: var(--ink-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}

.fullscreen-loading-text {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ── 加载超时 ── */

.loading-timeout {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--overlay-heavy);
    border: 1px solid var(--amber);
    border-radius: 4px;
    color: var(--amber);
    font-size: 13px;
    z-index: 1000;
}

.loading-finish {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
