/* ============================================
   电商运营数据分析知识网页 - AI分析 & 激活弹窗
   包含：AI智能分析卡片、结果面板、激活提示弹窗
   ============================================ */

/* ===== AI 智能分析卡片 ===== */
.ai-analyze-card {
    margin-top: 24px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fef3c7 100%);
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 12px;
    padding: 24px 28px;
}

.ai-analyze-card-inner {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ai-analyze-card-icon {
    font-size: 36px;
    flex-shrink: 0;
    color: #f97316;
}

.ai-analyze-card-text {
    flex: 1;
}

.ai-analyze-card-text h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #c2410c;
}

.ai-analyze-card-text p {
    margin: 0;
    font-size: 13px;
    color: #92400e;
    line-height: 1.4;
}

.ai-analyze-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.ai-analyze-btn:hover {
    background: linear-gradient(135deg, #d97706, #ea580c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.ai-analyze-btn:active {
    transform: translateY(0);
}

/* ============================================
   AI 智能分析结果面板
   ============================================ */
.ai-result-panel {
    background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fd 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}
.ai-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #93c5fd;
}
.ai-result-icon { font-size: 28px; }
.ai-result-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}
.ai-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #3b82f6;
}
.ai-section.ai-risk { border-left-color: #f59e0b; background: #fffbeb; }
.ai-section.ai-actions { border-left-color: #10b981; background: #ecfdf5; }
.ai-section.ai-raw { border-left-color: #6b7280; background: #f9fafb; }
.ai-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}
.ai-section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.ai-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}
.ai-list li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 4px;
}
.ai-action-list {
    margin: 0;
    padding-left: 20px;
}
.ai-action-list li {
    font-size: 14px;
    color: #065f46;
    line-height: 1.8;
    margin-bottom: 4px;
    font-weight: 500;
}
.ai-raw-text {
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
}
/* ===== 分步加载 + 骨架屏 ===== */
.ai-loading-wrap {
    padding: 28px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fd 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}
.ai-loading-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.ai-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: aiSpin 0.8s linear infinite;
    flex-shrink: 0;
}
.ai-loading-step {
    font-size: 15px;
    color: #4338ca;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-loading-step i { font-size: 18px; }
.ai-loading-text {
    transition: opacity 0.3s;
}
.ai-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-skeleton-bar {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: aiShimmer 1.5s ease-in-out infinite;
}
.ai-skeleton-bar.title { width: 40%; height: 18px; margin-bottom: 4px; }
.ai-skeleton-bar.long { width: 95%; }
.ai-skeleton-bar.medium { width: 70%; }
.ai-skeleton-bar.short { width: 45%; }
@keyframes aiSpin {
    to { transform: rotate(360deg); }
}
@keyframes aiShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 折叠交互 ===== */
.ai-collapsible .ai-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}
.ai-collapsible.expanded .ai-section-body {
    max-height: 600px;
    opacity: 1;
}
.ai-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-toggle:hover { color: #3b82f6; }
.ai-collapse-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 16px;
}
.ai-collapsible.expanded .ai-collapse-arrow {
    transform: rotate(90deg);
}

.ai-error {
    padding: 20px;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* AI 分析按钮 */
.ai-analyze-btn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.ai-analyze-btn:hover { background: linear-gradient(135deg, #d97706, #ea580c); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5); }
.ai-analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }


/* ============================================
   激活提示弹窗
   ============================================ */
.activation-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.activation-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.activation-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: activationSlideUp 0.3s ease-out;
}
@keyframes activationSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.activation-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.activation-close:hover { color: var(--text-primary); }
.activation-icon { text-align: center; font-size: 48px; margin-bottom: 12px; }
.activation-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 8px;
}
.activation-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}
.activation-levels {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.activation-level {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: border-color 0.2s;
}
.activation-level.active { border-color: #10b981; }
.activation-level.highlight { border-color: #6366f1; background: #f5f3ff; }
.level-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    background: #e2e8f0;
    color: var(--text-secondary);
}
.activation-level.active .level-badge { background: #d1fae5; color: #065f46; }
.activation-level.highlight .level-badge { background: #ede9fe; color: #5b21b6; }
.activation-level ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 13px;
    color: var(--text-secondary);
}
.activation-level li { padding: 3px 0; }
.activation-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.activation-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.activation-input:focus { border-color: #6366f1; }
.activation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.activation-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}
.activation-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.activation-btn-primary:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.activation-btn-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}
.activation-btn-secondary:hover { background: #e2e8f0; }
.activation-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}
.activation-msg {
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}
.activation-msg.success { color: #059669; }
.activation-msg.error { color: #dc2626; }

/* 淘宝购买按钮 */
.activation-buy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ff5000, #ff7a33);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(255, 80, 0, 0.3);
}
.activation-buy-link:hover {
    background: linear-gradient(135deg, #e64500, #ff6a1f);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 80, 0, 0.4);
    color: #fff;
    text-decoration: none;
}
.activation-buy-link:active {
    transform: translateY(0);
}
.activation-buy-link i {
    font-size: 18px;
}

/* 分隔线（已有激活码？） */
.activation-divider {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    color: var(--text-muted, #9ca3af);
    font-size: 12px;
}
.activation-divider::before,
.activation-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e5e7eb);
}
.activation-divider span {
    padding: 0 12px;
    white-space: nowrap;
}


/* ============================================
   付费功能按钮统一样式（PRO 角标 + 光效动画）
   适用于：导出PPTX、AI智能分析 等需要激活码的功能
   ============================================ */
.btn-premium {
    position: relative;
    background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(129, 140, 248, 0.3);
}
.btn-premium:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* VIP 角标 */
.btn-premium::after {
    content: 'VIP';
    position: absolute;
    top: -6px;
    right: -4px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.4;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.4);
    z-index: 1;
    pointer-events: none;
}

/* 光效扫过动画 */
.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: premiumShine 3s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes premiumShine {
    0%        { left: -100%; }
    50%, 100% { left: 100%; }
}

/* AI 分析按钮也添加 PRO 角标 */
.ai-analyze-btn {
    position: relative;
}
.ai-analyze-btn::after {
    content: 'SVIP';
    position: absolute;
    top: -6px;
    right: -4px;
    background: linear-gradient(135deg, #dc2626, #f97316);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.4;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4);
    z-index: 1;
    pointer-events: none;
}
.ai-analyze-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: premiumShine 3s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

/* 已激活用户：隐藏 PRO 角标，显示 ✓ 已解锁 */
body.user-premium .btn-premium::after,
body.user-premium .ai-analyze-btn::after {
    content: '✓';
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.4);
}

/* ===== AI 分析悬浮按钮（FAB） ===== */
.ai-fab-btn {
    position: fixed;
    bottom: 88px;
    right: 36px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-fab-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.58);
}
.ai-fab-btn:active {
    transform: translateY(0) scale(0.98);
}
.ai-fab-btn i {
    font-size: 18px;
    animation: aiFabIconPulse 2.2s ease-in-out infinite;
}
.ai-fab-btn.fab-enter {
    animation: aiFabSlideIn 0.4s ease forwards;
}
@keyframes aiFabSlideIn {
    from { transform: translateY(80px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
@keyframes aiFabIconPulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.85; }
}

/* ===== AI 功能标签（ai-analyze-card 内标签药丸） ===== */
.ai-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.ai-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(249,115,22,.12);
    color: #c2410c;
    border: 1px solid rgba(249,115,22,.25);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
