/* =========================================
   S2 Quant Terminal - 全局核心样式库 (v1.0)
   ========================================= */

:root {
    /* 深空弥散主色系 */
    --bg-deep: #050812;
    --panel-bg: rgba(11, 17, 32, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-hover-border: rgba(56, 189, 248, 0.3);
    
    /* 文字层级 */
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-soft: #CBD5E1;
    
    /* 情绪色板 */
    --primary: #38BDF8; 
    --green: #10B981;   
    --red: #F43F5E;     
    --amber: #FBBF24;
    --violet: #A78BFA;
    --yellow-btn: #FDE047;
    
    /* 字体族 */
    --mono: "JetBrains Mono", "Fira Code", monospace;
    --font-sans: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* 1. 极致深空背景与抗锯齿 (全局) */
body {
    margin: 0; 
    min-height: 100vh; 
    color: var(--text-main); 
    font-family: var(--font-sans);
    background: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 15% 30%, rgba(56, 189, 248, 0.08), transparent 30%),
        radial-gradient(circle at 85% 60%, rgba(167, 139, 250, 0.08), transparent 30%),
        linear-gradient(180deg, #08111F 0%, #070B14 42%, #050812 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. 隐形且优雅的滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* 3. 通用毛玻璃面板 (替代你后台的黑色方块) */
.s2-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 20px;
}

/* 4. 统一头部栏 (Topbar) */
.s2-topbar {
    position: sticky; top: 0; z-index: 50; 
    padding: 12px 20px;
    backdrop-filter: blur(24px) saturate(150%); 
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    background: rgba(5, 8, 18, 0.75);
    border-bottom: 1px solid var(--panel-border);
    display: flex; align-items: center; justify-content: space-between;
}

/* 5. 硅谷级量化数据表格 (专为 leaderboard/history/today 设计) */
.s2-table-wrapper {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
thead th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--panel-border);
    white-space: nowrap;
}
tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    vertical-align: middle;
}
tbody tr {
    transition: background-color 0.2s ease;
}
tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* 6. 统一的胶囊标签体系 (Direction & Status) */
.tag {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 10px; border-radius: 999px; 
    font-size: 12px; font-weight: 800; font-family: var(--mono);
}
.tag.call { color: #A7F3D0; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.tag.put { color: #FDA4AF; background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.3); }

/* 7. 字体原子类 (快速为表格数据上色) */
.font-mono { font-family: var(--mono); }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.text-primary { color: var(--primary) !important; }
.text-violet { color: var(--violet) !important; }
.font-bold { font-weight: 800 !important; }

/* 8. 极光渐变文本 (用于高胜率或高分异动) */
@keyframes aurora-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.aurora-text {
    background: linear-gradient(135deg, #efefbb, #e9c665, #e3a812, #efefbb); background-size: 200% auto;
    -webkit-background-clip: text; color: transparent; animation: aurora-shift 3s linear infinite;
    font-weight: 900;
}

/* 9. 移动端性能降级：低端安卓 backdrop-filter 可能掉帧，缩小模糊半径 */
@media (max-width: 768px) {
    .s2-panel { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    .s2-topbar { backdrop-filter: blur(12px) saturate(120%); -webkit-backdrop-filter: blur(12px) saturate(120%); }
}