/* ============================================================
   ai-deep.css - AI 深度解析等待体验样式
   设计目标：让买家在 2-5 分钟等待中始终保持期待感
   ============================================================ */

/* ========== 1. 顶层容器 ========== */
.ai-deep-wrap {
    position: relative;
    background:
        radial-gradient(ellipse at top, rgba(212,160,23,.08), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(192,57,43,.05), transparent 70%),
        linear-gradient(180deg, #fffdf8 0%, #faf3e3 100%);
    border: 1px solid #e8d5c0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

/* 角落云纹光晕 */
.ai-deep-wrap::before,
.ai-deep-wrap::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at center, rgba(212,160,23,.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.ai-deep-wrap::before { top: -50px; left: -50px; }
.ai-deep-wrap::after  { bottom: -50px; right: -50px; }

/* ========== 2. 顶部 Hero 区 ========== */
.ai-hero {
    position: relative;
    text-align: center;
    padding: 26px 20px 18px;
    background:
        linear-gradient(180deg, rgba(255,248,230,.6), transparent),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><path d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='%23d4a01710' stroke-width='1'/></svg>");
    border-bottom: 1px solid rgba(212,160,23,.25);
    z-index: 1;
}

.ai-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #8b5a2b;
    letter-spacing: 8px;
    margin-bottom: 6px;
    font-family: "Source Han Serif SC", "Songti SC", serif;
    text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.ai-hero-title .accent {
    color: #c0392b;
    margin: 0 4px;
}

.ai-hero-subtitle {
    font-size: 12px;
    color: #a08562;
    letter-spacing: 4px;
    font-weight: 500;
}
.ai-hero-subtitle::before,
.ai-hero-subtitle::after {
    content: '◆';
    margin: 0 10px;
    color: #d4a017;
    font-size: 9px;
    vertical-align: middle;
}

.ai-hero-deco {
    width: 60%;
    max-width: 280px;
    height: 12px;
    margin: 14px auto 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 12'><path d='M0 6 Q 70 -2, 140 6 T 280 6' fill='none' stroke='%23c0392b' stroke-width='1' opacity='0.5'/><circle cx='140' cy='6' r='2.5' fill='%23d4a017'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ========== 3. 八卦旋转加载器（核心吸睛元素） ========== */
.bagua-stage {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 18px auto 8px;
}

.bagua-loader {
    position: absolute;
    inset: 28px;
    border-radius: 50%;
    animation: baguaSpin 8s linear infinite;
    background: conic-gradient(
        from 0deg,
        #2c2416 0deg 45deg,
        #f5efe1 45deg 90deg,
        #2c2416 90deg 135deg,
        #f5efe1 135deg 180deg,
        #2c2416 180deg 225deg,
        #f5efe1 225deg 270deg,
        #2c2416 270deg 315deg,
        #f5efe1 315deg 360deg
    );
    box-shadow:
        0 0 0 2px #d4a017,
        0 0 24px rgba(212,160,23,.5),
        inset 0 0 10px rgba(0,0,0,.3);
}

.bagua-loader::after {
    content: '☯';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: #c0392b;
    text-shadow: 0 0 8px rgba(255,248,230,.9);
    animation: baguaCounterSpin 8s linear infinite;
}

.bagua-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,160,23,.28) 0%, transparent 60%);
    pointer-events: none;
    animation: baguaGlow 2.5s ease-in-out infinite;
}

@keyframes baguaSpin        { to { transform: rotate(360deg);  } }
@keyframes baguaCounterSpin { to { transform: rotate(-360deg); } }
@keyframes baguaGlow {
    0%,100% { opacity: .4; transform: scale(.92); }
    50%     { opacity: 1;  transform: scale(1.12); }
}

/* 完成状态隐藏八卦 */
.ai-deep-wrap.completed .bagua-stage { display: none; }

/* 完成状态显示绶带勾 */
.ai-done-seal {
    display: none;
    width: 80px;
    height: 80px;
    margin: 18px auto 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: #fff;
    font-size: 42px;
    line-height: 80px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(76,175,80,.35);
    animation: sealPop .6s cubic-bezier(.34,1.56,.64,1);
}
.ai-deep-wrap.completed .ai-done-seal { display: block; }

@keyframes sealPop {
    0%   { transform: scale(0);   opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}
/* ========== 4. 状态文案区 ========== */
.ai-status {
    text-align: center;
    padding: 0 20px 14px;
    position: relative;
    z-index: 1;
}

.ai-status-main {
    font-size: 15px;
    color: #8b5a2b;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.ai-status-main .dot-anim::after {
    content: '';
    display: inline-block;
    width: 18px;
    text-align: left;
    animation: dotAnim 1.4s steps(4) infinite;
}
@keyframes dotAnim {
    0%   { content: '';     }
    25%  { content: '.';    }
    50%  { content: '..';   }
    75%  { content: '...';  }
    100% { content: '';     }
}

.ai-status-sub {
    font-size: 12px;
    color: #a08562;
    line-height: 1.6;
}
.ai-status-sub strong {
    color: #c0392b;
    font-weight: 600;
}

/* ========== 5. 进度条 ========== */
.ai-progress {
    margin: 8px 24px 18px;
    position: relative;
    z-index: 1;
}

.ai-progress-bar {
    height: 8px;
    background: linear-gradient(180deg, #ede0c8, #f5e8d0);
    border-radius: 100px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(139,90,43,.2);
    position: relative;
}

.ai-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4a017 0%, #e8c547 50%, #c0392b 100%);
    border-radius: 100px;
    transition: width .6s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(212,160,23,.5);
}

/* 进度条流光 */
.ai-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,.5) 50%,
        transparent 100%);
    animation: progressShine 1.6s linear infinite;
}
@keyframes progressShine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%);  }
}

.ai-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: #a08562;
}
.ai-progress-percent {
    color: #c0392b;
    font-weight: 700;
    font-size: 13px;
    font-family: "Courier New", monospace;
}

/* ========== 6. 阶段步骤指示器 ========== */
.ai-steps {
    display: flex;
    justify-content: space-between;
    padding: 0 16px 18px;
    position: relative;
    z-index: 1;
    gap: 4px;
}

.ai-step {
    flex: 1;
    text-align: center;
    position: relative;
    opacity: .4;
    transition: opacity .4s, transform .4s;
}

.ai-step-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5efe1, #e8d5c0);
    border: 1.5px solid #c8b89c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #8b5a2b;
    transition: all .4s;
}

.ai-step-label {
    font-size: 10px;
    color: #8b5a2b;
    letter-spacing: 1px;
    line-height: 1.3;
}

/* 已完成步骤 */
.ai-step.done { opacity: 1; }
.ai-step.done .ai-step-icon {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-color: #2e7d32;
    color: #fff;
    box-shadow: 0 2px 6px rgba(76,175,80,.35);
}
.ai-step.done .ai-step-icon::before {
    content: '✓';
    font-size: 18px;
    font-weight: bold;
}
.ai-step.done .ai-step-icon .icon-text { display: none; }

/* 当前活跃步骤 */
.ai-step.active {
    opacity: 1;
    transform: translateY(-2px);
}
.ai-step.active .ai-step-icon {
    background: linear-gradient(135deg, #d4a017, #c0392b);
    border-color: #c0392b;
    color: #fff;
    box-shadow:
        0 2px 8px rgba(192,57,43,.4),
        0 0 0 3px rgba(212,160,23,.25);
    animation: stepPulse 1.6s ease-in-out infinite;
}
.ai-step.active .ai-step-label {
    color: #c0392b;
    font-weight: 700;
}

@keyframes stepPulse {
    0%,100% { box-shadow: 0 2px 8px rgba(192,57,43,.4), 0 0 0 3px rgba(212,160,23,.25); }
    50%     { box-shadow: 0 2px 8px rgba(192,57,43,.5), 0 0 0 7px rgba(212,160,23,.0);  }
}

/* 步骤之间的连接线 */
.ai-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    height: 2px;
    background: #e8d5c0;
    z-index: -1;
}
.ai-step.done:not(:last-child)::after {
    background: linear-gradient(90deg, #4caf50, #c8b89c);
}
/* ========== 7. 知识卡片轮播 ========== */
.ai-tips {
    margin: 0 16px 16px;
    background: linear-gradient(135deg, #fff9ec 0%, #fdf3d9 100%);
    border: 1px solid rgba(212,160,23,.3);
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(139,90,43,.06);
}

.ai-tips-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #8b5a2b;
    font-weight: 700;
    letter-spacing: 2px;
}
.ai-tips-header::before {
    content: '🏮';
    margin-right: 6px;
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(192,57,43,.3));
}
.ai-tips-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(212,160,23,.4), transparent);
    margin-left: 10px;
}

.ai-tips-stage {
    position: relative;
    min-height: 70px;
    overflow: hidden;
}

.ai-tip-card {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .6s, transform .6s;
    pointer-events: none;
}
.ai-tip-card.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ai-tip-title {
    font-size: 13px;
    color: #c0392b;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}
.ai-tip-title .tip-tag {
    display: inline-block;
    font-size: 10px;
    background: linear-gradient(135deg, #c0392b, #8b2419);
    color: #fff;
    padding: 2px 8px;
    border-radius: 100px;
    margin-right: 8px;
    letter-spacing: 1px;
    font-weight: 500;
}

.ai-tip-content {
    font-size: 12px;
    color: #6b4423;
    line-height: 1.7;
    text-align: justify;
}
.ai-tip-content em {
    color: #c0392b;
    font-style: normal;
    font-weight: 600;
}

/* 卡片切换指示点 */
.ai-tips-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.ai-tips-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e8d5c0;
    transition: all .3s;
    cursor: pointer;
}
.ai-tips-dot.active {
    width: 18px;
    border-radius: 100px;
    background: linear-gradient(90deg, #d4a017, #c0392b);
}

/* ========== 8. 大师寄语区 ========== */
.ai-quote {
    margin: 0 16px 16px;
    padding: 14px 18px;
    background:
        linear-gradient(135deg, rgba(44,36,22,.92), rgba(80,50,30,.88)),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><text x='5' y='30' font-size='28' fill='%23ffffff08'>福</text></svg>");
    border-radius: 10px;
    color: #f5e8d0;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(44,36,22,.25);
}

.ai-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 8px;
    font-size: 70px;
    color: rgba(212,160,23,.25);
    font-family: Georgia, serif;
    line-height: 1;
}

.ai-quote-text {
    font-size: 13px;
    line-height: 1.8;
    letter-spacing: 1px;
    position: relative;
    text-indent: 1.2em;
    font-family: "Source Han Serif SC", "Songti SC", serif;
}

.ai-quote-author {
    text-align: right;
    margin-top: 8px;
    font-size: 11px;
    color: #d4a017;
    letter-spacing: 2px;
}
.ai-quote-author::before {
    content: '—— ';
}

/* 微星点缀 */
.ai-quote-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.ai-quote-stars span {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #d4a017;
    border-radius: 50%;
    box-shadow: 0 0 4px #d4a017;
    animation: starTwinkle 3s ease-in-out infinite;
}
.ai-quote-stars span:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s;   }
.ai-quote-stars span:nth-child(2) { top: 60%; left: 85%; animation-delay: .8s;  }
.ai-quote-stars span:nth-child(3) { top: 80%; left: 30%; animation-delay: 1.6s; }
.ai-quote-stars span:nth-child(4) { top: 30%; left: 70%; animation-delay: 2.4s; }

@keyframes starTwinkle {
    0%,100% { opacity: .2; transform: scale(.8); }
    50%     { opacity: 1;  transform: scale(1.3); }
}
/* ========== 9. 完成态横幅 ========== */
.ai-complete-banner {
    display: none;
    margin: 0 16px 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fff5d6 0%, #ffe4a3 100%);
    border: 1px solid #d4a017;
    border-radius: 10px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 12px rgba(212,160,23,.25);
    animation: bannerSlide .6s ease-out;
}
.ai-deep-wrap.completed .ai-complete-banner { display: block; }

@keyframes bannerSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.ai-complete-title {
    font-size: 16px;
    font-weight: 700;
    color: #8b2419;
    letter-spacing: 4px;
    margin-bottom: 4px;
}
.ai-complete-title::before,
.ai-complete-title::after {
    content: '✦';
    color: #d4a017;
    margin: 0 8px;
}

.ai-complete-sub {
    font-size: 12px;
    color: #8b5a2b;
    letter-spacing: 1px;
}

/* ========== 10. 底部操作按钮 ========== */
.ai-actions {
    display: flex;
    gap: 10px;
    padding: 0 16px 18px;
    position: relative;
    z-index: 1;
}

.ai-btn {
    flex: 1;
    height: 42px;
    border-radius: 100px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.ai-btn-primary {
    background: linear-gradient(135deg, #c0392b 0%, #8b2419 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(192,57,43,.35);
}
.ai-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(192,57,43,.45);
}
.ai-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(192,57,43,.35);
}

.ai-btn-ghost {
    background: rgba(255,255,255,.7);
    color: #8b5a2b;
    border: 1px solid #d4a017;
}
.ai-btn-ghost:hover {
    background: #fff;
    border-color: #c0392b;
    color: #c0392b;
}

.ai-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}

/* 等待中隐藏查看按钮，完成后显示 */
.ai-deep-wrap:not(.completed) .ai-btn-view { display: none; }
.ai-deep-wrap.completed       .ai-btn-wait { display: none; }

/* ========== 11. 错误状态 ========== */
.ai-deep-wrap.error .bagua-stage      { display: none; }
.ai-deep-wrap.error .ai-progress      { display: none; }
.ai-deep-wrap.error .ai-steps         { display: none; }
.ai-deep-wrap.error .ai-tips          { display: none; }

.ai-error-box {
    display: none;
    margin: 18px 16px;
    padding: 18px;
    background: linear-gradient(135deg, #fff0f0, #ffe0e0);
    border: 1px solid #e74c3c;
    border-radius: 10px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.ai-deep-wrap.error .ai-error-box { display: block; }

.ai-error-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 28px;
    line-height: 50px;
}
.ai-error-title {
    font-size: 14px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 6px;
}
.ai-error-msg {
    font-size: 12px;
    color: #8b5a2b;
    line-height: 1.6;
    word-break: break-all;
}

/* ========== 12. 移动端响应式 ========== */
@media (max-width: 480px) {
    .ai-hero-title    { font-size: 19px; letter-spacing: 6px; }
    .ai-hero-subtitle { font-size: 11px; letter-spacing: 3px; }

    .bagua-stage      { width: 120px; height: 120px; margin-top: 14px; }
    .bagua-loader::after { font-size: 32px; }

    .ai-status-main   { font-size: 14px; }
    .ai-status-sub    { font-size: 11px; }

    .ai-step-icon     { width: 32px; height: 32px; font-size: 15px; }
    .ai-step-label    { font-size: 9px; }
    .ai-step:not(:last-child)::after { top: 16px; }

    .ai-tip-content   { font-size: 11px; line-height: 1.65; }
    .ai-quote-text    { font-size: 12px; }

    .ai-btn           { height: 40px; font-size: 13px; letter-spacing: 1px; }
}

@media (max-width: 360px) {
    .ai-hero-title    { font-size: 17px; letter-spacing: 4px; }
    .ai-steps         { padding: 0 8px 16px; }
    .ai-step-label    { font-size: 8px; letter-spacing: 0; }
}

/* ========== 13. 减弱动效（无障碍） ========== */
@media (prefers-reduced-motion: reduce) {
    .bagua-loader,
    .bagua-loader::after,
    .bagua-glow,
    .ai-progress-fill::after,
    .ai-step.active .ai-step-icon,
    .ai-quote-stars span {
        animation: none !important;
    }
    .ai-progress-fill,
    .ai-tip-card,
    .ai-step {
        transition: none !important;
    }
}

/* ========== 14. 打印样式（避免浪费墨水） ========== */
@media print {
    .ai-deep-wrap { display: none !important; }
}