/**
 * 高级动态特效库
 */

/* 数据更新脉冲动画 */
@keyframes dataPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.data-pulse {
    animation: dataPulse 2s ease-in-out;
}

/* 卡片光影扫描效果 */
.premium-card,
.premium-stat-card,
.dashboard-card {
    position: relative;
    overflow: hidden;
}

.premium-card::before,
.premium-stat-card::before,
.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(52, 211, 153, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: cardShine 3s infinite;
}

@keyframes cardShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 鼠标跟随光效 */
.premium-card:hover::after,
.premium-stat-card:hover::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.3) 0%, transparent 70%);
    pointer-events: none;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* 波纹扩散效果 */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.6);
    width: 20px;
    height: 20px;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* 渐入动画 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-scale {
    animation: fadeInScale 0.5s ease;
}

/* 数字跳动效果 */
@keyframes numberBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.number-bounce {
    animation: numberBounce 0.5s ease;
}

/* 状态指示器呼吸动画 */
@keyframes breathe {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.status-indicator {
    animation: breathe 2s ease-in-out infinite;
}

/* 边框流光效果 */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(52, 211, 153, 0.3);
        box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
    }
    50% {
        border-color: rgba(59, 130, 246, 0.5);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }
}

.border-glow {
    animation: borderGlow 3s ease-in-out infinite;
}

/* 文字闪烁渐变 */
@keyframes textGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.text-gradient-animate {
    background: linear-gradient(90deg, #34d399, #3b82f6, #a78bfa, #34d399);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 3s linear infinite;
}

/* 悬浮上下浮动 */
@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: floatUpDown 3s ease-in-out infinite;
}

/* 旋转脉冲 */
@keyframes rotatePulse {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.rotate-pulse {
    animation: rotatePulse 4s ease-in-out infinite;
}

/* 骨架屏加载动画 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* 进入视口动画 */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slideInFromBottom 0.6s ease;
}

/* 数据流效果 */
@keyframes dataFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.data-flow-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        #34d399,
        transparent
    );
    animation: dataFlow 3s linear infinite;
}

/* 价格变化闪烁 */
@keyframes priceFlash {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(52, 211, 153, 0.2);
    }
}

.price-flash-up {
    animation: priceFlash 0.5s ease;
}

.price-flash-down {
    animation: priceFlash 0.5s ease;
    background: rgba(248, 113, 113, 0.2);
}

/* Logo呼吸光晕增强 */
@keyframes logoGlow {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(52, 211, 153, 0.5),
            0 0 10px rgba(52, 211, 153, 0.3),
            0 0 15px rgba(52, 211, 153, 0.1);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(52, 211, 153, 0.8),
            0 0 20px rgba(52, 211, 153, 0.5),
            0 0 30px rgba(52, 211, 153, 0.3);
    }
}

.premium-logo-icon {
    animation: logoGlow 2s ease-in-out infinite;
}

/* 按钮点击波纹 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: transform 0.5s ease;
}

.btn-ripple:active::after {
    transform: translate(-50%, -50%) scale(2);
    transition: transform 0s;
}
