/* ===== 基础样式模块 ===== */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
}

/* 主容器 */
.trading-container {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

/* 颜色变量和通用样式 - TradingView标准配色 */
:root {
    --bg-primary: #0C0E16;     /* TradingView主背景 - 更深的背景 */
    --bg-secondary: #131722;   /* TradingView面板背景 - 调整为更协调的层次 */
    --bg-tertiary: #1E222D;    /* TradingView组件背景 - 调整层次关系 */
    --bg-quaternary: #2A2E39;  /* TradingView按钮背景 - 调整层次关系 */
    --border-primary: #1E222D; /* TradingView主边框 - 匹配新的层次 */
    --border-secondary: #2A2E39; /* TradingView次级边框 - 匹配新的层次 */
    --text-primary: #D1D4DC;   /* TradingView主文字 */
    --text-secondary: #B2B5BE; /* TradingView次级文字 */
    --text-muted: #787B86;     /* TradingView弱化文字 */
    --accent-blue: #2962FF;    /* TradingView标准蓝 */
    --accent-green: #4CAF50;   /* TradingView涨色绿 - 标准绿色 */
    --accent-red: #F23645;     /* TradingView跌色红 - 标准红色 */
    --accent-orange: #FF9800;  /* 保持橙色不变 */
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555A66;
}

/* 表格容器滚动条样式 */
.table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

/* 通用文本样式 */
.positive {
    color: var(--accent-green) !important;
}

.negative {
    color: var(--accent-red) !important;
}

.neutral {
    color: var(--text-secondary);
}

.price-positive {
    color: var(--accent-green) !important;
}

.price-negative {
    color: var(--accent-red) !important;
}

/* 方向样式 */
.direction-long {
    color: var(--accent-green);
    font-weight: 600;
}

.direction-short {
    color: var(--accent-red);
    font-weight: 600;
}

/* 字体家族 */
.mono-font {
    font-family: var(--font-mono);
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #787b86;
    font-size: 12px;
    padding: 20px;
    font-style: italic;
}

/* 动画定义 */
@keyframes pulse {
    0% { box-shadow: 0 1px 3px rgba(67, 160, 71, 0.2); }
    50% { box-shadow: 0 3px 12px rgba(67, 160, 71, 0.4); }
    100% { box-shadow: 0 1px 3px rgba(67, 160, 71, 0.2); }
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Flex 辅助类 */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-center {
    align-items: center;
    justify-content: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-1 {
    flex: 1;
}

/* 间距辅助类 */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }

/* 文本辅助类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-weight-normal { font-weight: normal; }
.font-weight-medium { font-weight: 500; }
.font-weight-semibold { font-weight: 600; }
.font-weight-bold { font-weight: 700; }

.text-uppercase { text-transform: uppercase; }
.letter-spacing { letter-spacing: 0.5px; }

/* 边框辅助类 */
.border { border: 1px solid var(--border-primary); }
.border-secondary { border: 1px solid var(--border-secondary); }
.border-radius { border-radius: 4px; }
.border-radius-small { border-radius: 2px; }
.border-radius-large { border-radius: 6px; }

/* 背景辅助类 */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-quaternary { background: var(--bg-quaternary); }