/* Binance Inspired Style System */
:root {
    --bg-main: #0b0e11;
    --bg-card: #1e2329;
    --bg-input: #2b3139;
    --yellow: #F3BA2F;
    --yellow-hover: #fcd535;
    --text-primary: #eaecef;
    --text-secondary: #b7bdc6;
    --green: #02c076;
    --red: #cf304a;
    --border: #474d57;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: "BinancePlex", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    justify-content: center;
    /* 全局居中 */
}

.main-container {
    width: 100%;
    max-width: 1280px;
    /* 锁定黄金宽度，防止宽屏溢出 */
    padding: 20px;
    box-sizing: border-box;
}

/* Header & Stat Card */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.title-group h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.title-group .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.total-pnl-card {
    background: var(--bg-card);
    padding: 12px 32px;
    border-radius: 8px;
    text-align: right;
    border: 1px solid var(--border);
}

.pnl-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.pnl-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Settings Bar */
.settings-bar {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-end;
    border: 1px solid var(--border);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    color: var(--text-secondary);
}

.input-group input {
    background: var(--bg-input);
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 10px;
    border-radius: 4px;
    width: 80px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--yellow);
}

.btn-primary {
    background: var(--yellow);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--yellow-hover);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    font-weight: 500;
}

.btn-danger:hover {
    background: rgba(207, 48, 74, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border);
}

.chart-container {
    grid-column: span 8;
    height: 400px;
    padding: 24px;
    box-sizing: border-box;
    overflow: hidden;
    /* 防止 canvas 自行溢出 */
}

.right-column {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Console Style */
.console-box {
    background: #161a1e;
    border-radius: 4px;
    padding: 12px;
    height: 180px;
    overflow-y: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    color: #4ade80;
    border: 1px solid var(--border);
}

.console-box div {
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

/* Table Style */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 8px;
    font-size: 14px;
    border-bottom: 1px solid #2b3139;
    white-space: nowrap;
    /* 默认不换行 */
}

/* 专门优化 AI 研判这最后一列：允许它自然换行，但不撑破表格 */
td.reason-cell {
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    /* 限制由于宽屏带来的无限宽 */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.indicator-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
}

.bottom-full-card {
    grid-column: span 12;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}