:root {
    --bg: #0f1419;
    --panel: #171d26;
    --panel-border: #243041;
    --text: #e8edf5;
    --muted: #8b98a9;
    --in: #22c55e;
    --out: #ef4444;
    --accent: #3b82f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #0b1015 0%, #121821 100%);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.status-panel {
    text-align: right;
}

.status-text {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    display: inline-block;
}

.status-text.trading {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.status-text.closed {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.updated-at {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs {
    display: inline-flex;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 4px;
}

.tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.tab.active {
    background: var(--accent);
    color: #fff;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.limit-label {
    color: var(--muted);
    font-size: 14px;
}

.limit-label select,
.btn {
    border: 1px solid var(--panel-border);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}

.btn {
    cursor: pointer;
}

.btn:hover,
.tab:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    color: #cbd5e1;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #bfdbfe;
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
}

.card.full {
    margin-bottom: 0;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.card-head h2 {
    margin: 0;
    font-size: 18px;
}

.tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
}

.tag-in {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.tag-out {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.hint {
    color: var(--muted);
    font-size: 12px;
}

.chart {
    width: 100%;
    height: 420px;
}

.chart-large {
    height: 520px;
}

@media (max-width: 960px) {
    .header,
    .toolbar,
    .card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-panel {
        text-align: left;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .chart {
        height: 360px;
    }

    .chart-large {
        height: 420px;
    }
}
