:root {
    /* Industrial Light Palette (Nof1 Inspired) - Smaller Version */
    --bg-app: #e4e4e7;       /* 整体背景（线条颜色） */
    
    /* Module Backgrounds - Differentiated */
    --bg-panel-main: #ffffff;   /* 核心数据区（中间） */
    --bg-panel-side: #f4f4f5;   /* 侧边栏（左侧） */
    --bg-panel-stream: #fafafa; /* 信息流（右侧） */
    
    --bg-card: #f4f4f5;      /* 内部卡片/表头 */
    --bg-input: #ffffff;     /* 输入框背景 */
    --bg-signal: #f0fdf4;    /* 信号日志背景 (Light) */
    
    /* Accents - Industrial Style */
    --accent-primary: #2563eb; /* Royal Blue */
    --accent-secondary: #64748b;
    --success: #059669;      /* Emerald Green */
    --danger: #dc2626;       /* Red */
    --warning: #d97706;
    
    /* Text - High Contrast & Sharp */
    --text-main: #09090b;    /* Almost Black */
    --text-muted: #52525b;   /* Zinc 600 */
    --text-dim: #a1a1aa;     /* Zinc 400 */
    
    /* Borders */
    --border-color: #e4e4e7; /* Zinc 200 */
    --border-strong: #d4d4d8; /* Zinc 300 */
    
    /* Layout */
    --header-height: 48px; /* Header height reverted */
    --radius: 0px; /* 去除圆角，强调工业感 */
    
    /* Fonts */
    --font-stack-chinese: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", "Noto Sans CJK SC", "Source Han Sans SC";
    --font-mono: 'JetBrains Mono', 'Fira Code', var(--font-stack-chinese), monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--font-stack-chinese), sans-serif;
}

/* Industrial Dark Palette */
html.dark {
    --bg-app: #000000;       /* 纯黑背景 */
    
    /* Module Backgrounds */
    --bg-panel-main: #09090b;   /* Zinc 950 */
    --bg-panel-side: #121214;   /* Almost Black */
    --bg-panel-stream: #0e0e10; /* Very Dark */
    
    --bg-card: #18181b;      /* Zinc 900 */
    --bg-input: #18181b;
    --bg-signal: rgba(16, 185, 129, 0.1); /* 信号日志背景 (Dark) */
    
    /* Accents - Adjusted for Dark Mode */
    --accent-primary: #3b82f6; /* Lighter Blue */
    --success: #10b981;      /* Bright Green */
    --danger: #ef4444;       /* Bright Red */
    --warning: #f59e0b;
    
    /* Text */
    --text-main: #f4f4f5;    /* Zinc 100 */
    --text-muted: #a1a1aa;   /* Zinc 400 */
    --text-dim: #52525b;     /* Zinc 600 */
    
    /* Borders */
    --border-color: #27272a; /* Zinc 800 */
    --border-strong: #3f3f46; /* Zinc 700 */
    
    /* Badge Backgrounds for Dark Mode */
    --bg-badge-success: rgba(16, 185, 129, 0.2);
    --bg-badge-danger: rgba(239, 68, 68, 0.2);
}

/* Dark Mode Specific Overrides - now handled by !important in base styles */

html.dark .kol-chip {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-dim);
}
html.dark .kol-chip:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
    background-color: var(--bg-input);
}
html.dark .kol-chip.active {
    background-color: rgba(59, 130, 246, 0.15); /* Subtle blue bg */
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}
html.dark .kol-chip.active .status-dot {
    background-color: var(--accent-primary);
    box-shadow: 0 0 4px var(--accent-primary);
}

/* Fix Percent badge in dark mode */
html.dark .percent {
    background-color: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: inherit;
}

/* Ensure text utilities use the brighter dark mode variables */
html.dark .text-green { color: var(--success) !important; }
html.dark .text-red { color: var(--danger) !important; }

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-panel-main); /* Change body background to main panel white */
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 12px; /* Base font size reduced to 12px */
    -webkit-font-smoothing: antialiased;
    height: 100%; /* Fixed height */
    overflow: hidden; /* No body scroll */
}

[v-cloak] { display: none; }

/* Scrollbar - Auto-hiding style (kept) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: transparent; /* Hidden by default */
    border-radius: 3px;
    transition: background-color 0.2s;
}
*:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15); /* Subtle visible */
}
*:hover::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3); /* Darker on interaction */
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--bg-panel-main);
    border-bottom: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px; /* Padding reduced */
    z-index: 10;
    position: sticky;
    top: 0;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.1rem; /* Brand font size reduced */
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.text-accent { color: var(--accent-primary); }

.status-bar {
    display: flex;
    gap: 16px; /* Gap reduced */
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem; /* Status text size reduced */
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 600;
}

.dot {
    width: 6px; /* Dot size reduced */
    height: 6px;
    background-color: var(--text-dim);
    transition: all 0.3s;
}
.dot.active {
    background-color: var(--success);
}

/* Main Grid */
.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr 340px; /* Column widths adjusted (left widened for KOL table) */
    gap: 1px; /* Sharp lines created by gap */
    padding: 0;
    background-color: var(--bg-panel-main); /* Changed to white */
    align-items: start;
    height: 100%; /* Full height */
    overflow: hidden; /* Clip content */
}

/* Columns */
.col-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-panel-stream); /* Match stream panel background */
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
}
.col-left::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.col-center {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    background-color: var(--bg-panel-main);
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

/* Hide scrollbar for WebKit browsers */
.col-center::-webkit-scrollbar {
    display: none;
}

.col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-panel-stream);
    height: 100%;
    overflow-y: auto; 
}

/* Modules */
.module {
    padding: 12px 16px; /* Padding reduced */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.module.collapsed {
    min-height: auto !important;
    padding-bottom: 8px;
}

/* Different Backgrounds for Sections (kept) */
.col-left .module { background-color: var(--bg-panel-stream); } /* Match stream panel background */
.col-center .module { background-color: var(--bg-panel-main); }
.col-right .module { background-color: var(--bg-panel-stream); }

.module-header {
    font-family: var(--font-mono);
    font-size: 0.7rem; /* Header font size reduced */
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px; /* Margin reduced */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Assets Module */
.assets-module { flex: 0 0 auto; }
.big-number {
    font-family: var(--font-mono);
    font-size: 1.8rem; /* Big number size reduced */
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    letter-spacing: -1px;
}
.big-number small {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 500;
}
.pnl-row {
    margin-top: 6px; /* Margin reduced */
    font-size: 0.85rem; /* PNL font size reduced */
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    font-weight: 600;
    font-family: var(--font-mono);
}
.percent { opacity: 1; background: #e4e4e7; padding: 1px 5px; font-size: 0.75rem;}

/* Risk Module */
.risk-module { flex: 0 0 auto; }
.control-item { margin-bottom: 12px; }
.control-item label {
    display: block;
    font-size: 0.7rem; /* Label font size reduced */
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px; /* Margin reduced */
    font-family: var(--font-mono);
}
.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 6px 10px; /* Padding reduced */
    transition: border-color 0.2s;
}
.input-group:focus-within { border-color: var(--text-main); }
.input-group input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    width: 100%;
    outline: none;
    font-weight: 600;
    font-size: 0.9rem; /* Input font size reduced */
}
select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 6px 10px; /* Padding reduced */
    outline: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem; /* Select font size reduced */
    font-family: var(--font-mono);
}
select:focus { border-color: var(--text-main); }

/* Logs Module */
.logs-module { flex: 1; min-height: 150px; }
.action-icon { cursor: pointer; color: var(--text-dim); transition: color 0.2s; font-size: 0.9rem;}
.action-icon:hover { color: var(--danger); }
.logs-list {
    max-height: 200px; /* Max height for scroll reduced */
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem; /* Log text size reduced */
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px;
}
.log-entry {
    margin-bottom: 4px; /* Margin reduced */
    display: flex;
    gap: 8px;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 4px;
}
.log-entry .time { color: var(--text-dim); min-width: 50px; }
.log-entry .level { font-weight: 700; min-width: 40px; }
.log-entry .level.info { color: var(--accent-primary); }
.log-entry .level.warning { color: var(--warning); }
.log-entry .level.error { color: var(--danger); }
.log-entry .msg { color: var(--text-main); word-break: break-all; }

/* KOL Module */
.kol-module { flex: 0 0 auto; }
.badge {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 1px 6px;
    font-size: 0.65rem; /* Badge font size reduced */
    font-weight: 700;
    color: var(--text-main);
}
.kol-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Gap reduced */
}
.kol-chip {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 4px 10px; /* Padding reduced */
    font-size: 0.75rem; /* Chip font size reduced */
    font-family: var(--font-mono);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 2px;
}
.kol-chip:hover { border-color: var(--text-main); color: var(--text-main); background: var(--bg-card); }
.kol-chip.active {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.05);
    color: var(--accent-primary);
}
.status-dot {
    width: 4px;
    height: 4px;
    background: var(--text-dim);
}
.kol-chip.active .status-dot { background: #fff; }

/* Tables */
.table-module {
    overflow: visible; /* Allow table to grow */
    min-height: 180px; /* Min height restored */
    display: flex;
    flex-direction: column;
}
.table-module.collapsed {
    min-height: auto;
}
.table-container { 
    margin: -12px -16px; /* Margin reduced */
    padding: 12px 16px; /* Padding reduced */
    overflow-x: auto; 
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem; /* Table font size reduced */
    font-family: var(--font-mono); 
}
.data-table th {
    text-align: center; /* All table headers centered by default */
    font-size: 0.65rem; /* Table header font size reduced */
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px; /* Padding reduced */
    border-bottom: 1px solid var(--border-strong);
    background: var(--bg-card);
}
/* Remove specific widths for generic table headers, let content define */
/* .data-table th:nth-child(1) { width: 18%; }
.data-table th:nth-child(2) { width: 15%; }
.data-table th:nth-child(3) { width: 10%; }
.data-table th:nth-child(4) { width: 8%; }
.data-table th:nth-child(5) { width: 15%; }
.data-table th:nth-child(6) { width: 14%; }
.data-table th:nth-child(7) { width: 20%; } */

/* Positions Table specific alignment and widths - all centered */
.positions-table th:nth-child(1),
.positions-table td:nth-child(1) { text-align: center !important; width: 15%; } /* Symbol */
.positions-table th:nth-child(2),
.positions-table td:nth-child(2) { text-align: center !important; width: 15%; } /* Source */
.positions-table th:nth-child(3),
.positions-table td:nth-child(3) { text-align: center !important; width: 8%; } /* Side */
.positions-table th:nth-child(4),
.positions-table td:nth-child(4) { text-align: center !important; width: 8%; } /* Size */
.positions-table th:nth-child(5),
.positions-table td:nth-child(5) { text-align: center !important; width: 10%; } /* Value */
.positions-table th:nth-child(6),
.positions-table td:nth-child(6) { text-align: center !important; width: 14%; } /* Entry */
.positions-table th:nth-child(7),
.positions-table td:nth-child(7) { text-align: center !important; width: 14%; } /* Mark */
.positions-table th:nth-child(8),
.positions-table td:nth-child(8) { text-align: center !important; width: 16%; } /* PNL */

.data-table td {
    text-align: center; /* All table cells centered by default */
    padding: 6px 12px; /* Padding reduced for tighter rows */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: normal;
    font-size: 0.8rem !important; /* Table cell font size reduced */
    height: 40px; /* Fixed height reduced for tighter rows */
    vertical-align: middle; /* Ensure content is centered vertically */
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card); }

/* Specific column alignment (override default center) */
.data-table .text-left { text-align: left !important; }
.data-table .text-center { text-align: center !important; }
.data-table .text-right { text-align: right !important; }

.font-bold { font-weight: 600 !important; }
/* Increase specificity to override .positions-table td:nth-child(1) */
.data-table tr td.empty-cell { 
    text-align: center !important; 
    color: var(--text-dim); 
    padding: 20px; 
    font-style: italic;
    font-family: var(--font-mono);
    font-size: 0.8rem !important; /* Empty cell font size reduced */
}

.leverage-badge {
    font-size: 0.65rem; /* Leverage badge font size reduced */
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 1px 4px;
    margin-left: 4px;
    font-weight: 600;
}
.side-badge {
    display: inline-block;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 2px;
}
.side-badge.long { background: rgba(16, 185, 129, 0.2) !important; color: var(--success) !important; border: 1px solid rgba(16, 185, 129, 0.4) !important; }
.side-badge.short { background: rgba(239, 68, 68, 0.2) !important; color: var(--danger) !important; border: 1px solid rgba(239, 68, 68, 0.4) !important; }

.text-right { text-align: right; }
.roe { 
    display: block; 
    font-size: 0.7rem; /* ROE font size reduced */
    opacity: 0.7; 
    font-family: var(--font-mono); 
    margin-top: 2px;
}
.status-badge {
    font-size: 0.7rem; /* Status badge font size reduced */
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 2px 6px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Order Type Badges */
.type-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    font-weight: 600;
    border-radius: 2px;
    border: 1px solid transparent;
}
.badge-success { background: rgba(16, 185, 129, 0.2) !important; color: var(--success) !important; border-color: rgba(16, 185, 129, 0.4) !important; }
.badge-danger { background: rgba(239, 68, 68, 0.2) !important; color: var(--danger) !important; border-color: rgba(239, 68, 68, 0.4) !important; }
.badge-warning { background: rgba(245, 158, 11, 0.2) !important; color: var(--warning) !important; border-color: rgba(245, 158, 11, 0.4) !important; }
.badge-primary { background: rgba(59, 130, 246, 0.2) !important; color: var(--accent-primary) !important; border-color: rgba(59, 130, 246, 0.4) !important; }
.badge-default { background: var(--bg-input); color: var(--text-muted); border-color: var(--border-strong); }

/* Time Range Selector */
.range-btn {
    font-size: 0.65rem;
    padding: 2px 6px;
    cursor: pointer;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-mono);
}
.range-btn:hover {
    color: var(--text-main);
}
.range-btn.active {
    background: var(--bg-input);
    border-color: var(--border-strong);
    color: var(--text-main);
}

/* Stream Module */
.stream-module { flex: 1; background-color: var(--bg-panel-stream); border: none; display: flex; flex-direction: column; overflow: hidden;} /* Border removed for stream module, now handled by grid gap */
.stream-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.stream-placeholder { color: var(--text-dim); font-family: var(--font-mono); padding: 20px; text-align: center; margin-top: 20px;}

.stream-log-entry {
    padding: 10px 14px; /* Padding reduced */
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem; /* Stream entry font size reduced */
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stream-log-entry:hover { background: var(--bg-card); }

.stream-log-entry.is-signal {
    background: var(--bg-signal);
    border-left: 4px solid var(--success);
    padding-left: 10px;
}

.stream-log-entry.is-action {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--success);
    padding-left: 10px;
}

.log-line-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
}
.log-time { color: var(--text-dim); font-size: 0.65rem; }
.log-source {
    color: var(--text-main);
    font-weight: 600;
    background: var(--bg-input);
    padding: 1px 3px; /* Reduced horizontal padding */
    border-radius: 3px;
    font-size: 0.7rem;
}
.signal-tag {
    background: var(--success);
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}
.action-tag {
    background: #10b981;
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}
.non-signal-tag {
    background: var(--text-dim);
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}
.duplicate-tag {
    background: var(--warning);
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}

.log-content {
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
    font-family: var(--font-sans);
}

.mini-signal-block {
    display: flex;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 600;
    background: rgba(255,255,255,0.5);
    padding: 3px 6px;
    border-radius: 3px;
    width: fit-content;
}

/* Utilities (kept) */
.text-green, .text-success { color: var(--success) !important; }
.text-red, .text-danger { color: var(--danger) !important; }

/* Responsive */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
        display: flex;
        flex-direction: column;
    }
    .col-left, .col-center, .col-right { height: auto; width: 100%; }
    /* Reorder: Left (Info) -> Center (Trading) -> Right (Stream) */
    .col-left { order: 1; }
    .col-center { order: 2; }
    .col-right { order: 3; position: static; height: 500px; overflow: hidden; } 
    
    .logs-module { max-height: 300px; }
    body { overflow: auto; }
}

@media (max-width: 768px) {
    /* Reset body scroll for mobile */
    body {
        height: auto;
        overflow: auto;
    }

    .app-container {
        height: auto;
        overflow: visible;
        min-height: 100vh;
    }

    /* Layout: Stack everything vertically */
    .main-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 8px;
        height: auto;
        overflow: visible;
    }

    .col-left, .col-center, .col-right {
        width: 100%;
        height: auto;
        order: unset; /* Let DOM order dictate (Left -> Center -> Right) */
    }

    /* 手机端时间选择器保持一行 */
    .assets-module .module-header {
        flex-wrap: nowrap !important;
    }
    .time-selector {
        flex-shrink: 0;
    }
    .time-selector .range-btn {
        font-size: 0.6rem;
        padding: 2px 4px;
    }

    /* Header: Compact horizontal layout */
    .header {
        height: auto;
        padding: 10px 12px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .brand {
        font-size: 0.95rem;
        flex: 1;
        min-width: auto;
    }

    .status-bar {
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .status-item {
        font-size: 0.7rem;
        gap: 4px;
    }

    .status-item .label {
        display: none; /* Hide labels like "TELEGRAM" */
    }

    .status-item.time {
        display: none; /* Hide time on mobile to save space */
    }

    /* Modules: Mobile padding */
    .module {
        padding: 10px;
    }

    /* Tables: Force horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
    }

    .data-table {
        min-width: 580px; /* Reduced min-width for better mobile scroll */
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 0.75rem !important;
    }

    /* Module Header: Wrap content */
    .module-header {
        flex-wrap: wrap;
        gap: 6px;
        height: auto;
        align-items: center;
        font-size: 0.65rem;
    }

    /* Module Header Pagination - 移动端优化 */
    .pagination-controls {
        gap: 6px;
        font-size: 0.65rem;
    }

    .pagination-controls select {
        padding: 2px 4px;
        font-size: 0.6rem;
    }

    .pagination-controls button {
        padding: 2px 5px;
        font-size: 0.6rem;
    }

    .pagination-controls .page-info {
        min-width: 36px;
        font-size: 0.6rem;
    }

    .pagination-controls .page-buttons {
        gap: 3px;
    }

    .header-stats {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding-top: 6px;
        border-top: 1px solid var(--border-color);
        margin-top: 4px;
        font-size: 0.65rem !important;
        flex-wrap: wrap;
    }

    /* Typography tweaks */
    body {
        font-size: 12px;
    }

    .big-number {
        font-size: 1.4rem;
    }

    .big-number small {
        font-size: 0.75rem;
    }

    /* Side Badge - 做多/做空 显示优化 */
    .side-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        font-weight: 700;
        white-space: nowrap;
        min-width: 40px;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Type Badge - 入场/止损/止盈/止盈止损 显示优化 */
    .type-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
        white-space: nowrap;
        min-width: 42px;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Status Badge - 持仓中/待成交/已平仓 */
    .status-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
        white-space: nowrap;
        min-width: 48px;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Leverage Badge */
    .leverage-badge {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    /* KOL Grid - 更紧凑 */
    .kol-grid {
        gap: 4px;
    }

    .kol-chip {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .kol-chip img {
        width: 16px !important;
        height: 16px !important;
    }

    /* Rankings Module */
    .rankings-module .ranking-item {
        font-size: 0.75rem;
        padding: 5px 0;
    }

    /* Signal Stream - 更紧凑 */
    .stream-log-entry {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .log-source {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .signal-tag, .action-tag, .non-signal-tag, .duplicate-tag {
        font-size: 0.55rem;
        padding: 1px 3px;
    }

    /* Signal Details Block */
    .signal-details {
        padding: 6px 8px !important;
        font-size: 0.7rem;
    }

    /* Trade Details Expansion */
    .data-table tr td[colspan="8"] table {
        min-width: 500px;
    }

    .data-table tr td[colspan="8"] table th,
    .data-table tr td[colspan="8"] table td {
        padding: 4px 6px;
        font-size: 0.7rem !important;
    }

    /* PNL Row */
    .pnl-row {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .percent {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    /* ROE Display */
    .roe {
        font-size: 0.65rem;
    }

    /* Account Select */
    .account-select {
        font-size: 0.7rem !important;
        max-width: 150px;
    }

    /* Time Range Buttons */
    .time-selector .range-btn {
        font-size: 0.6rem;
        padding: 2px 4px;
    }

    /* Stream Module Height */
    .col-right {
        max-height: 400px;
        overflow: hidden;
    }

    .stream-feed {
        max-height: 350px;
    }
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    padding: 10px 12px;
    font-size: 0.75rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: var(--font-mono);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-input);
}

.dropdown-item.danger:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Pagination Controls - 分页控件样式 */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: normal;
}

.pagination-controls select {
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: normal;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
}

.pagination-controls .page-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-controls button {
    padding: 2px 6px;
    font-size: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-main);
    transition: opacity 0.2s;
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-controls .page-info {
    color: var(--text-muted);
    min-width: 50px;
    text-align: center;
}

@media (max-width: 480px) {
    .main-grid {
        padding: 6px;
        gap: 8px;
    }

    .header {
        padding: 8px 10px;
    }

    .brand {
        font-size: 0.85rem;
    }

    .brand i {
        display: none; /* Hide brand icon on very small screens */
    }

    .module {
        padding: 8px;
    }

    /* Big Number - 更紧凑 */
    .big-number {
        font-size: 1.2rem;
    }

    .big-number > div {
        font-size: 0.85rem !important;
    }

    /* Header Stats - 简化显示 */
    .header-stats {
        font-size: 0.6rem !important;
        gap: 6px;
    }

    .header-stats > span {
        white-space: nowrap;
    }

    /* Side Badge - 做多/做空 */
    .side-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
        min-width: 36px;
    }

    /* Type Badge - 入场/止损/止盈 */
    .type-badge {
        font-size: 0.55rem;
        padding: 2px 5px;
        min-width: 38px;
    }

    /* Status Badge - 持仓中/待成交/已平仓 */
    .status-badge {
        font-size: 0.55rem;
        padding: 2px 5px;
        min-width: 44px;
    }

    /* Tables */
    .data-table {
        min-width: 520px;
    }

    .data-table th,
    .data-table td {
        padding: 5px 6px;
        font-size: 0.7rem !important;
    }

    /* KOL Chips */
    .kol-chip {
        padding: 3px 6px;
        font-size: 0.65rem;
    }

    .kol-chip img {
        width: 14px !important;
        height: 14px !important;
    }

    /* Signal Stream */
    .stream-log-entry {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .log-content {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    /* Rankings */
    .rankings-module .ranking-item {
        font-size: 0.7rem;
    }

    .rankings-module .rank-stats {
        gap: 8px;
        font-size: 0.65rem;
    }

    /* Account Select */
    .account-select {
        max-width: 120px;
    }

    /* Badge optimizations */
    .badge {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .leverage-badge {
        font-size: 0.55rem;
        padding: 0px 2px;
        margin-left: 2px;
    }

    /* Stream max height */
    .col-right {
        max-height: 350px;
    }

    .stream-feed {
        max-height: 300px;
    }

    /* Signal Details */
    .signal-details {
        padding: 5px 6px !important;
        font-size: 0.65rem;
    }

    .signal-details > div {
        font-size: 0.65rem;
    }

    /* PNL Row */
    .pnl-row {
        font-size: 0.7rem;
    }

    /* Module Header Pagination - 超小屏幕 */
    .module-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .module-header > span:first-child {
        width: 100%;
    }

    /* 折叠模块的标题保持一行 */
    .module.collapsed .module-header {
        flex-direction: row;
        align-items: center !important;
        gap: 0;
    }

    /* 分页控件占满宽度，两端对齐 */
    .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* 隐藏页数选择器，只保留分页按钮 */
    .pagination-controls select {
        display: none;
    }

    .pagination-controls button {
        padding: 4px 10px;
        font-size: 0.65rem;
    }

    .pagination-controls .page-info {
        min-width: auto;
        flex: 1;
        text-align: center;
    }

    .pagination-controls .page-buttons {
        flex: 1;
        justify-content: center;
    }
}
