/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
}

.page-container {
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-nav {
    display: flex;
    gap: 15px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-bar .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.status-bar .status-dot.connected {
    background: #28a745;
    animation: none;
}

.status-bar .status-dot.error {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-bar .status-text {
    font-weight: 600;
    color: #333;
}

.status-bar .last-update {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

/* Ticker Tape */
.ticker-tape {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 200px;
}

.ticker-tape::before,
.ticker-tape::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 10;
    pointer-events: none;
}

.ticker-tape::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.ticker-tape::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.ticker-track {
    display: flex;
    align-items: center;
    padding: 20px 0;
    cursor: grab;
    user-select: none;
    will-change: transform;
}

.ticker-track.dragging {
    cursor: grabbing;
}

.ticker-tape-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 40px;
}

.ticker-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #bd9e56;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ticker-tape-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    width: 100%;
}

/* Ticker Item - TradingView Style */
.ticker-item {
    flex-shrink: 0;
    padding: 12px 20px;
    border-right: 1px solid #f0f0f0;
    min-width: 200px;
}

.tv-tape-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tv-tape-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tv-tape-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
    color: #666;
}

.tv-badge.up {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tv-badge.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tv-symbol {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
}

.tv-tape-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-price {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.tv-currency {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
}

.tv-change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

.tv-change.up {
    color: #22c55e;
}

.tv-change.down {
    color: #ef4444;
}

/* Sparkline */
.tv-spark-wrap {
    display: flex;
    align-items: center;
}

.tv-spark {
    display: block;
}

.tv-spark.is-hidden {
    display: none;
}

.tv-spark-skeleton {
    width: 56px;
    height: 28px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
    background-size: 200% 100%;
    animation: tv-spark-loading 1.2s ease-in-out infinite;
}

.tv-spark-skeleton.is-hidden {
    display: none;
}

@keyframes tv-spark-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px 20px;
    }

    .header-status {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .header-title {
        font-size: 20px;
        text-align: center;
    }

    .ticker-item {
        min-width: 160px;
        padding: 10px 15px;
    }

    .tv-symbol {
        font-size: 12px;
    }

    .tv-price {
        font-size: 13px;
    }
}
