/* 加密货币价格动态更新动画 */

/* 实时指示器闪烁动画 */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

/* 价格变化脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 价格上涨动画 */
@keyframes price-up {
    0% {
        color: inherit;
        transform: scale(1);
    }
    50% {
        color: #6FFF74;
        transform: scale(1.1);
    }
    100% {
        color: #6FFF74;
        transform: scale(1);
    }
}

/* 价格下跌动画 */
@keyframes price-down {
    0% {
        color: inherit;
        transform: scale(1);
    }
    50% {
        color: #FF6B6B;
        transform: scale(1.1);
    }
    100% {
        color: #FF6B6B;
        transform: scale(1);
    }
}

/* 加载状态样式 */
.price-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.price-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #02EBFD;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 旋转动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 价格更新成功闪光效果 */
.price-updated {
    animation: flash 0.5s ease-in-out;
}

@keyframes flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(2, 235, 253, 0.1);
    }
}

/* 实时状态指示器样式 */
.price-status-indicator {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-top: 8px;
}

.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6FFF74;
    border-radius: 50%;
    animation: blink 2s infinite;
    margin-left: 6px;
}

/* 连接状态指示 */
.status-online .live-indicator {
    background: #6FFF74;
    animation: blink 2s infinite;
}

.status-offline .live-indicator {
    background: #FF6B6B;
    animation: none;
}

.status-loading .live-indicator {
    background: #FFD700;
    animation: pulse 1s infinite;
}

/* 价格变化指示器 */
.price-change-up {
    color: #6FFF74 !important;
    animation: price-up 1s ease-in-out;
}

.price-change-down {
    color: #FF6B6B !important;
    animation: price-down 1s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .price-status-indicator {
        font-size: 10px;
    }
    
    .live-indicator {
        width: 6px;
        height: 6px;
    }
}

/* 暗色主题优化 */
@media (prefers-color-scheme: dark) {
    .price-loading::after {
        border-color: #02EBFD;
        border-top-color: transparent;
    }
}

/* 打印样式 */
@media print {
    .price-status-indicator,
    .live-indicator,
    .price-loading::after {
        display: none;
    }
}

/* 无障碍访问优化 */
@media (prefers-reduced-motion: reduce) {
    .live-indicator,
    .price-loading::after {
        animation: none;
    }
    
    .price-change-up,
    .price-change-down,
    .price-updated {
        animation: none;
    }
}

/* 高对比度模式优化 */
@media (prefers-contrast: high) {
    .live-indicator {
        border: 1px solid currentColor;
    }
    
    .price-change-up {
        color: #00FF00 !important;
    }
    
    .price-change-down {
        color: #FF0000 !important;
    }
} 