/**
 * SaAiLoading — AI / Tab 步骤加载骨架样式
 * 页面作用域微调（如 .plate-research-tab-panel）仍可写在业务 CSS。
 */

/* —— 独立 AI 加载（大弹层） —— */
.ai-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    min-height: 400px;
}

.ai-loading-animation {
    margin-bottom: 30px;
}

.ai-loading-icon {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-loading-icon i {
    font-size: 3rem;
    color: #667eea;
    z-index: 2;
    animation: saAiPulse 2s ease-in-out infinite;
}

.ai-loading-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    animation: saAiPulseRing 2s ease-in-out infinite;
}

@keyframes saAiPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes saAiPulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ai-loading-content {
    text-align: center;
    max-width: 500px;
}

.ai-loading-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a56a7;
    margin-bottom: 16px;
}

.ai-loading-step {
    font-size: 1rem;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 20px;
    min-height: 24px;
}

.ai-loading-progress {
    width: 100%;
    height: 6px;
    background: #e1e4e8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 30px;
}

.ai-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    animation: saAiProgressShimmer 2s infinite;
}

@keyframes saAiProgressShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.ai-loading-tips {
    margin-top: 30px;
    text-align: left;
}

.ai-loading-tips p {
    font-size: 0.85rem;
    color: #666;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-loading-tips i {
    color: #667eea;
    width: 16px;
}

/* —— Tab 内嵌加载态 —— */
.pr-tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 36px 20px 40px;
    min-height: 220px;
    text-align: center;
}
.pr-tab-loading-visual {
    flex-shrink: 0;
}
.pr-tab-loading-ring {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 4px 14px rgba(26, 86, 167, 0.08);
}
.pr-tab-loading-ring i {
    font-size: 1.35rem;
    color: #1a56a7;
    z-index: 2;
    animation: saPrTabIconPulse 2s ease-in-out infinite;
}
.pr-tab-loading--logic .pr-tab-loading-ring i { color: #0d9488; }
.pr-tab-loading--stocks .pr-tab-loading-ring i { color: #1a56a7; }
.pr-tab-loading--timeline .pr-tab-loading-ring i { color: #7c3aed; }
.pr-tab-loading-ring-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(26, 86, 167, 0.2);
    animation: saPrTabRingPulse 2s ease-out infinite;
}
.pr-tab-loading--logic .pr-tab-loading-ring-pulse { border-color: rgba(13, 148, 136, 0.25); }
.pr-tab-loading--timeline .pr-tab-loading-ring-pulse { border-color: rgba(124, 58, 237, 0.22); }
@keyframes saPrTabIconPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.88; }
}
@keyframes saPrTabRingPulse {
    0% { transform: scale(0.92); opacity: 0.9; }
    100% { transform: scale(1.28); opacity: 0; }
}
.pr-tab-loading-body {
    width: 100%;
    max-width: 360px;
}
.pr-tab-loading-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.01em;
}
.pr-tab-loading-step {
    margin: 0 0 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    min-height: 1.25em;
    transition: opacity 0.25s ease;
}
.pr-tab-loading-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}
.pr-tab-loading-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1a56a7 0%, #0d9488 55%, #7c3aed 100%);
    background-size: 200% 100%;
    transition: width 0.45s ease;
    animation: saPrTabProgressShimmer 2.2s linear infinite;
}
@keyframes saPrTabProgressShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.pr-tab-loading-tips {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}
.pr-tab-loading-tips li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0 0;
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.45;
}
.pr-tab-loading-tips i {
    margin-top: 2px;
    color: #94a3b8;
    width: 14px;
    flex-shrink: 0;
}
.pr-tab-loading--skeleton {
    padding: 28px 18px 32px;
    min-height: 200px;
}
.pr-tab-loading-skeleton {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pr-skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e8eef5 45%, #f8fafc 55%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: saPrSkeletonShimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
.pr-skeleton-bar {
    height: 12px;
}
.pr-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    height: 48px;
    padding: 0;
    background: transparent;
    animation: none;
}
.pr-skeleton-grid span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e8eef5 45%, #f8fafc 55%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: saPrSkeletonShimmer 1.4s ease-in-out infinite;
}
.pr-skeleton-grid span:nth-child(2) { animation-delay: 0.12s; }
.pr-skeleton-grid span:nth-child(3) { animation-delay: 0.24s; }
.pr-skeleton-grid span:nth-child(4) { animation-delay: 0.36s; }
@keyframes saPrSkeletonShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.pr-tab-loading-caption {
    margin: 14px 0 0;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}
.pr-tab-loading--fallback {
    color: #64748b;
    font-size: 0.86rem;
    gap: 10px;
}

@media (max-width: 768px) {
    .pr-tab-loading {
        padding: 24px 14px 28px;
        min-height: 180px;
        gap: 12px;
    }
    .pr-tab-loading-ring {
        width: 48px;
        height: 48px;
    }
    .pr-tab-loading-ring i {
        font-size: 1.15rem;
    }
    .pr-tab-loading-title {
        font-size: 0.88rem;
    }
    .pr-tab-loading-step,
    .pr-tab-loading-caption {
        font-size: 0.78rem;
    }
    .pr-tab-loading-tips li {
        font-size: 0.7rem;
    }
}
