/**
 * AI智能特效样式库
 * 用于提升PC端页面的精致度和高端感
 * 包含：AI脉冲、打字机、数据流、智能指示器、3D卡片等特效
 */

/* ==================== AI脉冲效果 ==================== */
.ai-pulse {
    animation: aiPulse 1.5s ease-in-out infinite;
}

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

/* AI徽章脉冲光晕 */
.ai-badge-glow {
    position: relative;
    animation: aiPulse 2s ease-in-out infinite;
}

.ai-badge-glow::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: inherit;
    opacity: 0.3;
    filter: blur(8px);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ==================== 打字机效果 ==================== */
.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    /* 移除了光标效果：border-right: 3px solid #22c55e; */
    animation: typing 3s steps(40) 1s forwards;
    /* 移除了光标闪烁动画：blink-caret 0.75s step-end infinite; */
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 光标闪烁动画已禁用 */
/* @keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #22c55e; }
} */

/* 打字完成后移除光标 */
.typing-done {
    border-right: none;
}

/* ==================== 数据流动效果 ==================== */
.data-flow {
    position: relative;
    overflow: hidden;
}

.data-flow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(34, 197, 94, 0.3),
        transparent);
    animation: dataFlow 3s infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes dataFlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 数据流 - 蓝色变体（用于AI相关） */
.data-flow-blue::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(59, 130, 246, 0.3),
        transparent);
}

/* 数据流 - 金色变体（用于推荐） */
.data-flow-gold::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(251, 191, 36, 0.3),
        transparent);
}

/* ==================== 智能指示器 ==================== */
.smart-indicator {
    position: relative;
}

.smart-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: smartBlink 1s infinite;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

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

/* 智能指示器 - 大号版本 */
.smart-indicator-lg::after {
    width: 12px;
    height: 12px;
    top: -4px;
    right: -4px;
}

/* ==================== 3D卡片效果 ==================== */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 3D卡片 - 轻微版本 */
.card-3d-subtle:hover {
    transform: rotateY(3deg) rotateX(3deg) translateZ(5px);
}

/* ==================== 浮动粒子/元素 ==================== */
.float-particle {
    animation: floatParticle 6s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    33% {
        transform: translateY(-20px) translateX(10px);
    }
    66% {
        transform: translateY(-10px) translateX(-10px);
    }
}

/* 浮动元素 - 延迟变体 */
.float-particle-delay-1 {
    animation-delay: 1s;
}

.float-particle-delay-2 {
    animation-delay: 2s;
}

.float-particle-delay-3 {
    animation-delay: 3s;
}

/* ==================== 光泽扫过效果 ==================== */
.premium-shine {
    position: relative;
    overflow: hidden;
}

.premium-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    transform: skewX(-25deg);
    animation: shine 8s ease-in-out infinite;
}

@keyframes shine {
    0% { left: -60%; }
    20% { left: 120%; }
    100% { left: 120%; }
}

/* ==================== 渐变文字 ==================== */
.gradient-text {
    background: linear-gradient(135deg, #22c55e 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-ai {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 毛玻璃增强效果 ==================== */
.glass-effect-premium {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-effect-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== 按压反馈效果 ==================== */
.press-feedback {
    transition: transform 0.1s ease;
}

.press-feedback:active {
    transform: scale(0.95);
}

/* ==================== 悬停发光效果 ==================== */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.hover-glow-blue:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.hover-glow-gold:hover {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

/* ==================== 数字滚动动画 ==================== */
.number-roll {
    animation: numberRoll 0.5s ease-out;
}

@keyframes numberRoll {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 进度条动画 ==================== */
.progress-animate {
    animation: progressGrow 1.5s ease-out forwards;
}

@keyframes progressGrow {
    from { width: 0; }
    to { width: var(--progress-width); }
}

/* ==================== AI对话气泡 ==================== */
.ai-bubble {
    position: relative;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 1rem;
    border: 2px solid #86efac;
    animation: bubbleIn 0.3s ease-out;
}

.ai-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 20px;
    height: 20px;
    background: inherit;
    border-right: 2px solid #86efac;
    border-bottom: 2px solid #86efac;
    transform: rotate(45deg);
}

@keyframes bubbleIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== 匹配度指示器 ==================== */
.match-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #f59e0b 100%);
    border-radius: 9999px;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    animation: matchPulse 2s ease-in-out infinite;
}

@keyframes matchPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(251, 191, 36, 0);
    }
}

/* ==================== 滑入动画 ==================== */
.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 旋转光圈效果 ==================== */
.rotate-ring {
    position: relative;
}

.rotate-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: conic-gradient(
        transparent,
        rgba(34, 197, 94, 0.5),
        transparent
    );
    border-radius: inherit;
    animation: rotateRing 3s linear infinite;
}

@keyframes rotateRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
    /* 移动端减少动画强度 */
    .card-3d:hover {
        transform: rotateY(2deg) rotateX(2deg) translateZ(5px);
    }

    .ai-pulse {
        animation-duration: 2s;
    }

    .premium-shine::after {
        animation-duration: 10s;
    }
}

/* ==================== 性能优化 ==================== */
/* 使用will-change提示浏览器优化 */
.ai-pulse,
.card-3d,
.float-particle,
.data-flow::before {
    will-change: transform, opacity;
}

/* 减少重绘 */
.typing-animation,
.smart-indicator::after,
.premium-shine::after {
    will-change: width, opacity, left;
}
