/* 金融动画样式 */
/* Financial Animations Styles */

/* 资金曲线画布 */
.equity-curve-section {
    position: relative;
    padding: 3rem 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    overflow: hidden;
}

.equity-curve-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.curve-header {
    text-align: center;
    margin-bottom: 2rem;
}

.curve-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 0.5rem;
}

.curve-subtitle {
    color: var(--gray-text);
    font-size: 1.1rem;
}

#equity-curve-canvas {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* K线图容器 */
#kline-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    overflow: hidden;
    padding: 10px;
    min-height: 200px;
}

.kline-bar {
    position: absolute;
    width: 4%;
    height: 100%;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: all 0.3s ease;
}

.kline-shadow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: rgba(148, 163, 184, 0.6);
}

.kline-body {
    position: absolute;
    left: 10%;
    width: 80%;
    border-radius: 3px;
    transition: all 0.3s ease;
    min-height: 2px;
}

.kline-up {
    background: #10b981;
    border: 2px solid #059669;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}

.kline-down {
    background: #ef4444;
    border: 2px solid #dc2626;
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* 价格跳动效果 */
.price-item {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-text);
    transition: all 0.3s ease;
}

.price-up {
    color: #10b981;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.price-down {
    color: #ef4444;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* 涨跌榜 */
#gainers-losers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s ease;
}

.stock-name {
    font-weight: 600;
    color: var(--light-text);
}

.stock-change {
    font-weight: 700;
    font-size: 1.1rem;
}

.change-up {
    color: #10b981;
}

.change-down {
    color: #ef4444;
}

/* 交易信号 */
.trading-signal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.signal-pulse {
    animation: signalPulse 1s ease-out;
}

@keyframes signalPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* 策略对比图表 */
#strategy-comparison {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comparison-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    min-width: 120px;
    font-weight: 600;
    color: var(--light-text);
}

.bar-wrapper {
    flex: 1;
    position: relative;
    height: 40px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.bar-value {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--light-text);
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 市场情绪指示器 */
.sentiment-gauge {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 2rem auto;
}

.gauge-arc {
    width: 100%;
    height: 100%;
    border-radius: 200px 200px 0 0;
    background: linear-gradient(90deg, 
        #ef4444 0%, 
        #f59e0b 25%, 
        #10b981 50%, 
        #3b82f6 75%, 
        #667eea 100%
    );
    position: relative;
    overflow: hidden;
}

#sentiment-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 80px;
    background: white;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-45deg);
    transition: transform 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#sentiment-needle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid white;
}

/* 动画数字 */
.animated-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: inline-block;
    min-width: 150px;
}

/* 数据流动背景 */
.data-stream {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.data-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    animation: particleFloat 3s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* 响应式 */
@media (max-width: 968px) {
    .strategy-comparison-grid {
        grid-template-columns: 1fr !important;
    }
    
    .comparison-metrics {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    #equity-curve-canvas {
        height: 200px;
    }
    
    #kline-container {
        height: 150px;
    }
    
    .comparison-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bar-label {
        min-width: auto;
        width: 100%;
    }
    
    .bar-wrapper {
        width: 100%;
    }
    
    .sentiment-gauge {
        width: 150px;
        height: 75px;
    }
    
    .animated-number {
        font-size: 2rem;
    }
    
    .equity-curve-section {
        padding: 2rem 0;
    }
}

/* 特效：闪烁高亮 */
@keyframes highlight {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 1);
    }
}

.highlight-effect {
    animation: highlight 2s ease-in-out infinite;
}

/* 数据更新指示器 */
.update-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 8px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
