/* ========================================
   Alpha Arena Style for NewTradingBot
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --border: #000000;
    --text: #000000;
    --text-muted: #4b5563;
    --positive: #059669;
    --negative: #dc2626;
    --accent: #2563eb;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    --glow: 0 0 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 3px solid var(--border);
    padding: 20px 30px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.v-tag {
    font-size: 12px;
    background: #000;
    color: #fff;
    padding: 2px 6px;
    vertical-align: middle;
}

.status-badge {
    color: var(--positive);
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--positive);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--positive);
    animation: blink 2s infinite;
}

@keyframes blink {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

.header-group {
    display: flex;
    align-items: center;
}

.symbol-tag {
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 10px;
}

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

.nav-btn {
    background: transparent;
    border: 2px solid #ddd;
    padding: 6px 18px;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    font-size: 12px;
}

.nav-btn:hover {
    border-color: #000;
    background: rgba(0, 0, 0, 0.05);
}

.nav-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: scan 3s infinite;
}

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

    100% {
        left: 100%;
    }
}

.time-display {
    font-weight: 700;
    font-size: 18px;
    border: 2px solid var(--border);
    padding: 5px 15px;
}

/* Ticker */
.ticker-bar {
    display: flex;
    background: var(--card-bg);
    border: 3px solid var(--border);
    padding: 20px 30px;
    margin-bottom: 20px;
    gap: 40px;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ticker-symbol {
    font-weight: 400;
    color: var(--text-muted);
}

.ticker-price {
    font-size: 28px;
    font-weight: 700;
}

/* Grid & Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 24px;
    align-items: stretch;
    /* 让左右高度一致 */
}

.dashboard-grid.single-col {
    grid-template-columns: 1fr;
}

.card {
    background: var(--card-bg);
    border: 3px solid var(--border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 #000;
    transition: all 0.2s;
}

.card-header {
    background: #000;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 14px;
    margin: 0;
    letter-spacing: 1px;
}

/* Decision Engine */
.decision-content {
    padding: 30px;
}

.decision-main {
    border: 2px solid #eee;
    padding: 12px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.decision-value {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.price-up {
    animation: flash-green 1s;
}

.price-down {
    animation: flash-red 1s;
}

@keyframes flash-green {
    0% {
        background: rgba(16, 185, 129, 0.2);
    }

    100% {
        background: transparent;
    }
}

@keyframes flash-red {
    0% {
        background: rgba(239, 68, 68, 0.2);
    }

    100% {
        background: transparent;
    }
}

/* Confidence Gauge */
.confidence-container {
    margin-top: 15px;
}

.confidence-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border: 1px solid #000;
}

.confidence-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 1s ease-out;
}



.decision-value.long {
    color: var(--positive);
}

.decision-value.short {
    color: var(--negative);
}

.decision-reasoning {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.decision-reasoning h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.decision-reasoning p {
    font-size: 14px;
    white-space: pre-wrap;
}

/* Chain of Thought Formatting */
.cot-container {
    font-size: 13px;
    line-height: 1.6;
}

.cot-section {
    background: linear-gradient(90deg, #000 0%, #333 100%);
    color: #fff;
    padding: 6px 12px;
    margin: 10px 0 5px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 2px;
}

.cot-section:first-child {
    margin-top: 0;
}

.cot-text {
    color: var(--text);
    padding: 0 5px;
    margin: 0;
}

.cot-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Stats */
.stats-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    padding: 20px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 2px solid #eee;
}

tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

td {
    padding: 15px 20px;
    font-size: 13px;
    /* 稍微压缩一点字体以容纳更多列 */
    border-bottom: 1px solid #eee;
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

/* Equity Chart */
.equity-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Canvas 会自动填充容器 */
#equity-chart {
    width: 100%;
    height: 100%;
}

.equity-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.equity-stat {
    text-align: center;
}

.equity-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.equity-value {
    font-size: 18px;
    font-weight: 700;
}