/* ═══════════════════════════════════════════════
   田乙策略 3.0 - 玻璃态高级UI
   半透明 · 毛玻璃 · 清新 · 暗色背景
   ═══════════════════════════════════════════════ */

/* ─── CSS 变量 ─────────────────────────── */
:root {
    --glass-bg: rgba(12, 16, 28, 0.65);
    --glass-bg-light: rgba(18, 22, 38, 0.55);
    --glass-bg-card: rgba(14, 18, 32, 0.7);
    --glass-bg-input: rgba(8, 10, 20, 0.55);
    --glass-blur: 14px;
    --glass-border: rgba(201, 160, 58, 0.18);
    --glass-border-light: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(201, 160, 58, 0.45);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
    --glass-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);

    --gold: #d4a843;
    --gold-light: #f0d078;
    --gold-dark: #a07828;
    --gold-glow: 0 0 20px rgba(212, 168, 67, 0.2);
    --gold-glow-strong: 0 0 30px rgba(212, 168, 67, 0.35);
    --gold-grad: linear-gradient(135deg, #b8860b 0%, #d4a843 30%, #f0d078 60%, #c9a03a 100%);
    --gold-grad-btn: linear-gradient(135deg, #a07828, #d4a843, #e8c860);

    --text-primary: #e8e0d0;
    --text-secondary: #a09880;
    --text-muted: #6a6258;
    --green: #4caf50;
    --green-glow: rgba(76, 175, 80, 0.25);
    --red: #f44336;
    --red-glow: rgba(244, 67, 54, 0.2);
    --blue: #42a5f5;
    --orange: #ff9800;

    --sidebar-width: 210px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    --bg-deep: #06080f;
    --bg-mid: #0a0d18;

    /* 清新风格扩展变量 (v3.0) */
    --card-bg: rgba(14, 18, 32, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --panel-header-bg: rgba(255, 255, 255, 0.02);
    --table-header-bg: rgba(255, 255, 255, 0.04);
    --badge-bg: rgba(255, 255, 255, 0.06);
    --cyan: #00c8c8;
    --cyan-glow: rgba(0, 200, 200, 0.15);
}

/* ─── 全局重置 ─────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    color: var(--text-primary);
}

/* ─── 动态暗色背景 ──────────────────────── */
body {
    background: var(--bg-deep);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(212, 168, 67, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 80% 80%, rgba(212, 168, 67, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(30, 40, 70, 0.3) 0%, transparent 70%),
        linear-gradient(180deg, #06080f 0%, #0a0d18 40%, #0d1020 100%);
    z-index: -2;
}

/* 网格纹理 */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center center;
    z-index: -1;
    pointer-events: none;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--gold-light); }

/* ─── 滚动条 ────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(201, 160, 58, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(201, 160, 58, 0.4); }

/* ─── 布局 ─────────────────────────────── */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════
   侧边栏 · 玻璃态
   ═══════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 22px 16px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border-light);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logo-icon { font-size: 28px; filter: drop-shadow(0 0 8px rgba(212,168,67,0.3)); }

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-size: 10px;
    font-weight: 700;
    background: var(--gold-grad);
    color: #1a1a1a;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: super;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all 0.25s;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(212, 168, 67, 0.08);
    color: var(--text-primary);
    border-color: rgba(212, 168, 67, 0.15);
}

.nav-item.active {
    background: rgba(212, 168, 67, 0.12);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.25);
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.08);
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    transition: transform 0.2s;
}
.notification-bell:hover { transform: scale(1.1); }
.bell-icon { display: block; }
.bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
    font-weight: bold;
    box-shadow: 0 0 8px var(--red-glow);
}

.user-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.username { font-size: 13px; color: var(--text-primary); }
.logout-link { font-size: 11px; color: var(--text-muted); }
.logout-link:hover { color: var(--red); }

/* 有效期徽章 */
.expiry-info { margin-top: 2px; }
.expiry-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.expiry-badge.permanent {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.expiry-badge.active {
    background: rgba(66, 165, 245, 0.12);
    color: #42a5f5;
    border: 1px solid rgba(66, 165, 245, 0.25);
}
.expiry-badge.warning {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.35);
    animation: pulse-warning 2s infinite;
}
.expiry-badge.expired {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}
@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════
   通知面板 · 玻璃态
   ═══════════════════════════════════════════════ */
.notification-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 199;
}
.notification-backdrop.show { display: block; }

.notification-panel {
    position: fixed;
    top: 0; left: 0;
    width: 350px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.6);
}
.notification-panel.show { transform: translateX(0); }

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    border-bottom: 1px solid var(--glass-border-light);
    font-weight: 600;
}
.notif-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.notif-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.1); }

.notification-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    font-size: 13px;
    border-left: 3px solid transparent;
    background: var(--glass-bg-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.notif-item.unread { background: rgba(212, 168, 67, 0.08); }
.notif-item.type-success { border-left-color: var(--green); }
.notif-item.type-warning { border-left-color: var(--orange); }
.notif-item.type-danger { border-left-color: var(--red); }
.notif-item.type-info { border-left-color: var(--blue); }
.notif-time { font-size: 11px; color: var(--text-muted); display: block; margin-top: 4px; }
.notif-empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }

/* ═══════════════════════════════════════════════
   主内容区
   ═══════════════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}

/* ═══════════════════════════════════════════════
   状态栏 · 玻璃态
   ═══════════════════════════════════════════════ */
.status-bar {
    padding: 8px 22px;
    border-bottom: 1px solid var(--glass-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.status-message { flex: 1; }

.status-source {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 16px;
    padding: 3px 12px;
    border-radius: 12px;
    background: var(--glass-bg-input);
    border: 1px solid var(--glass-border-light);
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.status-source.source-ok {
    color: var(--green);
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.2);
}
.status-source.source-error {
    color: var(--red);
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.2);
}

.status-time { color: var(--text-muted); font-size: 12px; margin-left: 16px; }

.status-info { border-left: 3px solid var(--blue); }
.status-success { border-left: 3px solid var(--green); }
.status-warning { border-left: 3px solid var(--orange); }
.status-danger { border-left: 3px solid var(--red); }

/* ═══════════════════════════════════════════════
   面板标题
   ═══════════════════════════════════════════════ */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border-light);
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}
.panel-icon { font-size: 22px; }

.badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.badge-sim {
    background: rgba(76, 175, 80, 0.12);
    color: var(--green);
    border: 1px solid rgba(76, 175, 80, 0.2);
}
.badge-real {
    background: rgba(212, 168, 67, 0.12);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.25);
}

.strategy-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
}
.status-running {
    background: var(--green);
    box-shadow: 0 0 10px var(--green-glow), 0 0 20px var(--green-glow);
    animation: pulse 1.5s infinite;
}
.status-paused {
    background: var(--orange);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}
.status-stopped { background: var(--text-muted); }

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green-glow); }
    50% { opacity: 0.4; box-shadow: 0 0 20px var(--green-glow); }
}
.strategy-status-text { font-size: 12px; color: var(--text-muted); }
.panel-time { font-size: 13px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   卡片 · 玻璃态核心
   ═══════════════════════════════════════════════ */
.card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--glass-shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--glass-border);
    box-shadow: var(--glass-shadow), var(--gold-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border-light);
    font-weight: 600;
    font-size: 15px;
}

.card-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: normal;
}

.settings-card { border-color: var(--glass-border); }

/* ═══════════════════════════════════════════════
   设置面板
   ═══════════════════════════════════════════════ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.setting-item { display: flex; flex-direction: column; gap: 6px; }
.setting-item label { font-size: 13px; color: var(--text-secondary); }

.setting-select {
    background: var(--glass-bg-input);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.setting-select:focus { border-color: var(--glass-border-hover); }

.setting-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gold-grad-btn);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--gold-dark);
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.4);
}
.setting-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.setting-actions { flex-direction: row; gap: 8px; align-items: flex-end; }

.strategy-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   按钮 · 玻璃态
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.btn:active { transform: translateY(2px); }

/* 金色主按钮 */
.btn-gold {
    background: var(--gold-grad-btn);
    color: #1a1200;
    border-color: var(--gold-dark);
    box-shadow: 0 3px 0 rgba(160, 120, 40, 0.5), 0 0 16px rgba(212, 168, 67, 0.2);
}
.btn-gold:hover {
    filter: brightness(1.15);
    box-shadow: 0 2px 0 rgba(160, 120, 40, 0.5), 0 0 24px rgba(212, 168, 67, 0.35);
}
.btn-gold:active { box-shadow: 0 1px 0 rgba(160, 120, 40, 0.5); }

/* 绿色按钮 */
.btn-success {
    background: rgba(46, 125, 50, 0.7);
    color: #fff;
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 0 3px 0 rgba(30, 100, 35, 0.5), 0 0 12px rgba(76, 175, 80, 0.15);
}
.btn-success:hover { background: rgba(56, 142, 60, 0.8); box-shadow: 0 2px 0 rgba(30, 100, 35, 0.5), 0 0 20px rgba(76, 175, 80, 0.3); }

.btn-warning {
    background: rgba(230, 137, 0, 0.6);
    color: #fff;
    border-color: rgba(255, 152, 0, 0.4);
    box-shadow: 0 3px 0 rgba(180, 100, 0, 0.5);
}
.btn-warning:hover { background: rgba(245, 150, 10, 0.7); }

.btn-danger {
    background: rgba(198, 40, 40, 0.65);
    color: #fff;
    border-color: rgba(244, 67, 54, 0.35);
    box-shadow: 0 3px 0 rgba(150, 30, 30, 0.5);
}
.btn-danger:hover { background: rgba(220, 50, 50, 0.75); box-shadow: 0 2px 0 rgba(150, 30, 30, 0.5), 0 0 16px var(--red-glow); }

.btn-info {
    background: rgba(21, 101, 192, 0.6);
    color: #fff;
    border-color: rgba(66, 165, 245, 0.35);
    box-shadow: 0 3px 0 rgba(15, 70, 140, 0.5);
}
.btn-info:hover { background: rgba(30, 120, 220, 0.7); }

.btn-outline {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    border-color: var(--glass-border-light);
}
.btn-outline:hover { border-color: var(--glass-border); background: rgba(255,255,255,0.06); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ═══════════════════════════════════════════════
   概览卡片
   ═══════════════════════════════════════════════ */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.oc-item {
    background: var(--glass-bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: all 0.3s;
}
.oc-item:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-sm), var(--gold-glow);
    transform: translateY(-1px);
}
.oc-icon { font-size: 22px; margin-bottom: 4px; }
.oc-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.oc-value {
    font-size: 16px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

/* ═══════════════════════════════════════════════
   价格跳动条
   ═══════════════════════════════════════════════ */
.price-tickers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.ticker-item {
    background: var(--glass-bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s;
}
.ticker-item:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-sm);
}
.ticker-symbol { font-weight: 700; font-size: 15px; color: var(--text-primary); min-width: 100px; }
.ticker-price {
    font-size: 18px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
}
.ticker-change {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}
.ticker-up { color: var(--green); background: rgba(76, 175, 80, 0.1); }
.ticker-down { color: var(--red); background: rgba(244, 67, 54, 0.1); }

/* ═══════════════════════════════════════════════
   仓位卡片（双栏）
   ═══════════════════════════════════════════════ */
.position-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.position-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.3s;
}
.position-card:hover { box-shadow: var(--glass-shadow-sm), var(--gold-glow); }
.position-long { border-top: 3px solid var(--green); }
.position-short { border-top: 3px solid var(--red); }

.pos-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border-light);
}
.pos-badge { font-weight: 700; font-size: 14px; }
.pos-badge-long { color: var(--green); }
.pos-badge-short { color: var(--red); }

.pos-martin-badge {
    font-size: 11px;
    background: rgba(255, 152, 0, 0.12);
    color: var(--orange);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 152, 0, 0.25);
    display: inline-flex;
    align-items: center;
}

.pos-card-body { display: flex; flex-direction: column; gap: 6px; }
.pos-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.pos-row:last-child { border-bottom: none; }

.pos-row-highlight {
    background: rgba(212, 168, 67, 0.08);
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
}
.pos-row-highlight .pos-label { color: var(--gold); font-weight: 600; }

.pos-label { font-size: 12px; color: var(--text-secondary); }
.pos-value { font-size: 13px; font-weight: 600; font-family: 'SF Mono', 'Consolas', 'Monaco', monospace; }

/* ═══════════════════════════════════════════════
   马丁轮次总览卡片
   ═══════════════════════════════════════════════ */
.cycle-card {
    background: linear-gradient(135deg, rgba(20, 22, 45, 0.7) 0%, rgba(16, 18, 40, 0.8) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.06);
}

.cycle-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border-light);
    font-weight: 600;
    font-size: 15px;
}
.cycle-card-hint { font-size: 11px; color: var(--text-muted); font-weight: normal; }

.cycle-sections { display: flex; flex-direction: column; gap: 0; }
.cycle-section { padding: 10px 0; }
.cycle-dir-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cycle-dir-label { font-weight: 700; font-size: 14px; }
.cycle-section-long .cycle-dir-label { color: var(--green); }
.cycle-section-short .cycle-dir-label { color: var(--red); }

.cycle-martin-badge {
    font-size: 11px;
    background: rgba(255, 152, 0, 0.12);
    color: var(--orange);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 152, 0, 0.25);
}
.cycle-divider { height: 1px; background: rgba(255,255,255,0.04); margin: 0; }

.cycle-stats { display: flex; flex-direction: column; gap: 6px; }
.cycle-stat {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.cs-label { font-size: 12px; color: var(--text-muted); }
.cs-value { font-size: 15px; font-weight: 700; font-family: 'Courier New', monospace; }

.cycle-stat-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    margin: 2px 0;
}
.cycle-stat-main {
    background: rgba(212, 168, 67, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.15);
}
.cycle-stat-main .cs-label { color: var(--gold); }
.cycle-stat-main .cs-value { font-size: 16px; }
.cs-value-lg { font-size: 18px !important; }
.cycle-stat-muted { background: transparent; padding: 2px 12px; }
.cycle-stat-muted .cs-label { font-size: 10px; color: rgba(255,255,255,0.25); }

/* ═══════════════════════════════════════════════
   表格
   ═══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid rgba(212, 168, 67, 0.3);
    color: var(--gold);
    font-weight: 600;
    white-space: nowrap;
}
.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--glass-border-light);
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(212, 168, 67, 0.04); }

.table-empty {
    text-align: center !important;
    color: var(--text-muted);
    padding: 30px !important;
    font-family: inherit !important;
}

/* 方向标签 */
.dir-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}
.dir-long { color: var(--green); background: rgba(76, 175, 80, 0.1); }
.dir-short { color: var(--red); background: rgba(244, 67, 54, 0.1); }

.text-profit { color: var(--green); }
.text-loss { color: var(--red); }
.text-muted { color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   Toggle 开关
   ═══════════════════════════════════════════════ */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--glass-bg-input);
    border: 1px solid var(--glass-border-light);
    border-radius: 13px;
    transition: all 0.3s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: rgba(168, 120, 40, 0.6);
    border-color: rgba(212, 168, 67, 0.5);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: var(--gold-light);
}

/* ═══════════════════════════════════════════════
   设置面板
   ═══════════════════════════════════════════════ */
.settings-panel { display: flex; flex-direction: column; gap: 22px; }
.settings-section h4 {
    color: var(--gold);
    font-size: 14px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border-light);
}

.settings-grid-vertical { display: flex; flex-direction: column; gap: 14px; }
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.setting-label-group { flex: 1; }
.setting-label-group label { font-weight: 600; font-size: 14px; display: block; }
.setting-desc { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

.setting-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}
.setting-slider-group .setting-slider { flex: 1; }
.slider-value {
    font-weight: 700;
    color: var(--gold);
    min-width: 45px;
    text-align: right;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border-light);
}

/* ═══════════════════════════════════════════════
   API 配置表单
   ═══════════════════════════════════════════════ */
.api-config-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text-secondary); }

.form-input {
    background: var(--glass-bg-input);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--glass-border-hover); }
.form-input::placeholder { color: var(--text-muted); }

.api-buttons { display: flex; gap: 10px; }

.api-test-result {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.api-test-result.success {
    display: block;
    background: rgba(76, 175, 80, 0.1);
    color: var(--green);
    border: 1px solid rgba(76, 175, 80, 0.25);
}
.api-test-result.error {
    display: block;
    background: rgba(244, 67, 54, 0.1);
    color: var(--red);
    border: 1px solid rgba(244, 67, 54, 0.25);
}

/* ═══════════════════════════════════════════════
   信息框
   ═══════════════════════════════════════════════ */
.info-box {
    padding: 14px;
    background: var(--glass-bg-input);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--glass-border);
    font-size: 13px;
    line-height: 1.7;
}
.info-box h4, .info-box h5 { color: var(--gold); margin-bottom: 8px; margin-top: 12px; }
.info-box h4:first-child, .info-box h5:first-child { margin-top: 0; }
.info-box ul, .info-box ol { padding-left: 20px; }
.info-box li { margin-bottom: 4px; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════
   日志容器
   ═══════════════════════════════════════════════ */
.log-container {
    max-height: 70vh;
    overflow-y: auto;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}
.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--glass-border-light);
    border-left: 3px solid transparent;
}
.log-entry:hover { background: rgba(255,255,255,0.02); }
.log-success { border-left-color: var(--green); }
.log-warning { border-left-color: var(--orange); }
.log-danger { border-left-color: var(--red); }
.log-info { border-left-color: var(--blue); }
.log-time { color: var(--text-muted); font-size: 12px; min-width: 140px; }
.log-icon { font-size: 14px; width: 20px; text-align: center; }
.log-msg { flex: 1; color: var(--text-primary); }
.log-empty { text-align: center; color: var(--text-muted); padding: 40px; }

/* ═══════════════════════════════════════════════
   登录页 · 玻璃态
   ═══════════════════════════════════════════════ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--bg-deep);
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { font-size: 52px; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 12px rgba(212,168,67,0.3)); }
.login-logo h1 {
    font-size: 30px;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

.login-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--glass-shadow), 0 0 40px rgba(212, 168, 67, 0.06);
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border-light);
}
.login-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.login-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.login-tab:hover { color: var(--text-primary); }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 13px; color: var(--text-secondary); }
.login-form input {
    background: var(--glass-bg-input);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--glass-border-hover); }

.login-btn {
    padding: 12px;
    background: var(--gold-grad-btn);
    color: #1a1200;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 3px 0 rgba(160, 120, 40, 0.5), 0 0 16px rgba(212, 168, 67, 0.2);
    transition: all 0.2s;
}
.login-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(160, 120, 40, 0.5); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-message {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.login-message.success { background: rgba(76, 175, 80, 0.1); color: var(--green); }
.login-message.error { background: rgba(244, 67, 54, 0.1); color: var(--red); }

.login-info { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.login-info-section {
    background: var(--glass-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 12px;
}
.login-info-section h4 { color: var(--gold); margin-bottom: 10px; font-size: 13px; }
.login-info-section.warning h4 { color: var(--red); }
.login-info-section ul { padding-left: 16px; }
.login-info-section li { color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }

/* ═══════════════════════════════════════════════
   风险弹窗 · 玻璃态
   ═══════════════════════════════════════════════ */
.risk-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.risk-modal-content {
    background: var(--glass-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 60px rgba(212, 168, 67, 0.2);
}
.risk-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border-light);
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
}
.risk-modal-body { padding: 20px; max-height: 50vh; overflow-y: auto; }
.risk-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.risk-modal-body h3 { text-align: center; color: var(--red); margin-bottom: 14px; }
.risk-modal-body p { color: var(--text-secondary); font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.risk-modal-body ul { padding-left: 20px; margin-bottom: 14px; }
.risk-modal-body li { color: var(--text-secondary); font-size: 13px; margin-bottom: 6px; }
.risk-bold { font-weight: 700; color: var(--red) !important; }

.risk-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--glass-border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.risk-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.risk-btn.confirm {
    background: var(--gold-grad-btn);
    color: #1a1200;
    border-color: var(--gold-dark);
}
.risk-btn.cancel {
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    border-color: var(--glass-border-light);
}
.risk-btn.cancel:hover { color: var(--text-primary); }

/* ═══════════════════════════════════════════════
   响应式：平板 + 手机端
   ═══════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .overview-cards { grid-template-columns: repeat(3, 1fr); }
    .settings-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    html, body { overflow-x: hidden; font-size: 15px; }

    .sidebar { display: none; }

    .main-content {
        width: 100%;
        margin-bottom: 60px;
    }

    .content-area { padding: 10px 12px; }

    .status-bar {
        padding: 6px 12px;
        font-size: 12px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .status-source, .status-time { font-size: 11px; margin-left: 8px; }

    .panel-header { flex-wrap: wrap; gap: 8px; }
    .panel-title { font-size: 16px; }
    .panel-time { font-size: 12px; }

    .overview-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .oc-item { padding: 10px 8px; }
    .oc-icon { font-size: 18px; }
    .oc-label { font-size: 11px; }
    .oc-value { font-size: 14px; }

    .price-tickers { grid-template-columns: 1fr; gap: 6px; }
    .ticker-item { padding: 10px 12px; }
    .ticker-symbol { font-size: 14px; min-width: 90px; }
    .ticker-price { font-size: 16px; }

    .position-row { grid-template-columns: 1fr; gap: 8px; }

    .settings-grid { grid-template-columns: 1fr; gap: 12px; }
    .setting-actions { flex-direction: row; }

    .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .setting-slider-group { width: 100%; }

    .strategy-buttons { flex-wrap: wrap; gap: 8px; }
    .strategy-buttons .btn { flex: 1; min-width: 100px; justify-content: center; padding: 10px 12px; font-size: 13px; }

    .cycle-stat { padding: 6px 8px; }
    .cs-label { font-size: 11px; }
    .cs-value { font-size: 13px; }
    .cs-value-lg { font-size: 16px !important; }

    .pos-card-header { flex-wrap: wrap; gap: 6px; }
    .pos-label { font-size: 12px; }
    .pos-value { font-size: 13px; }

    .data-table { font-size: 11px; }
    .data-table th, .data-table td { padding: 7px 6px; white-space: nowrap; }

    .login-container { max-width: 100%; padding: 12px; }
    .login-card { padding: 20px 16px; }
    .login-logo h1 { font-size: 24px; }
    .login-info { grid-template-columns: 1fr; }

    .settings-actions { flex-wrap: wrap; }
    .settings-actions .btn { flex: 1; }

    .form-row { grid-template-columns: 1fr; }
    .notification-panel { width: 100vw; }
    .risk-modal-content { width: 95%; max-height: 80vh; }
}

@media (max-width: 480px) {
    .content-area { padding: 8px 8px; }

    .overview-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .oc-item { padding: 8px 4px; }
    .oc-icon { font-size: 16px; }
    .oc-label { font-size: 10px; }
    .oc-value { font-size: 11px; }

    .strategy-buttons .btn { min-width: 80px; padding: 10px 6px; font-size: 12px; gap: 4px; }
    .pos-row-highlight { padding-left: 4px; padding-right: 4px; }

    /* 交易表格卡片化 */
    .data-table thead { display: none; }
    .data-table tbody tr {
        display: block;
        margin-bottom: 8px;
        border: 1px solid var(--glass-border-light);
        border-radius: var(--radius);
        padding: 8px;
        background: var(--glass-bg-light);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid rgba(255,255,255,0.03);
        font-size: 12px;
        white-space: normal;
    }
    .data-table tbody td:last-child { border-bottom: none; }
    .data-table tbody td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 11px;
        margin-right: 8px;
        white-space: nowrap;
    }
    .table-empty { display: block !important; text-align: center !important; }
}

/* ═══════════════════════════════════════════════
   移动端底部导航栏 · 玻璃态
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border);
        z-index: 500;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        padding: 4px 12px;
        border-radius: var(--radius-sm);
        transition: all 0.2s;
    }
    .mobile-nav-item.active { color: var(--gold); }
    .mobile-nav-icon { font-size: 20px; }
    .mobile-nav-label { font-weight: 500; }

    .main-content { padding-bottom: 8px; }
}

@media (min-width: 769px) { .mobile-nav { display: none; } }

/* ═══════════════════════════════════════════════
   Gate 趋势下单 - 科技风格 · Cyber/Tech Theme
   主色调：霓虹青 #00e6e6 · 暗海军蓝 #0a0f1e
   ═══════════════════════════════════════════════ */

/* ─── Gate 页面背景覆盖 ──────────────────── */
.gate-page body,
body:has(.gate-panel-header)::before {
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 230, 230, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 80% 80%, rgba(0, 180, 220, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(10, 20, 50, 0.5) 0%, transparent 70%),
        linear-gradient(180deg, #080c18 0%, #0a0f1e 40%, #0c1224 100%) !important;
}

body:has(.gate-panel-header)::after {
    background-image:
        linear-gradient(rgba(0,230,230,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,230,230,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ─── Gate 面板头部 ──────────────────────── */
.gate-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 16px;
    border-bottom: 1px solid rgba(0, 230, 230, 0.12);
    margin-bottom: 16px;
}

.gate-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #c8d6e5;
}

.gate-panel-icon {
    font-size: 1.3em;
    filter: drop-shadow(0 0 6px rgba(0, 230, 230, 0.5));
}

.gate-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.15em;
    border: 1px solid #00e6e6;
    color: #00e6e6;
    background: rgba(0, 230, 230, 0.06);
    border-radius: 3px;
    text-shadow: 0 0 8px rgba(0, 230, 230, 0.4);
}

.gate-status-light {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    margin-left: 4px;
}

.gate-status-light.status-running {
    background: #00e6e6;
    box-shadow: 0 0 8px #00e6e6, 0 0 16px rgba(0, 230, 230, 0.4);
}

.gate-status-light.status-paused {
    background: #ff9800;
    box-shadow: 0 0 8px #ff9800;
}

.gate-status-light.status-stopped { background: #555; }

.gate-status-text {
    font-size: 0.75em;
    color: #678;
}

.gate-panel-time {
    font-size: 0.8em;
    color: #567;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ─── Gate 卡片 ──────────────────────────── */
.gate-card {
    background: rgba(10, 16, 30, 0.8);
    border: 1px solid rgba(0, 230, 230, 0.1);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.gate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 230, 230, 0.3), transparent);
    opacity: 0.6;
}

.gate-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: #8ab4c8;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.gate-header-icon {
    color: #00e6e6;
    font-size: 1.1em;
}

.gate-card-hint {
    font-size: 0.72em;
    color: #456;
    margin-left: auto;
}

/* ─── Gate 策略控制 ──────────────────────── */
.gate-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.gate-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gate-setting label {
    font-size: 0.78em;
    color: #678;
    letter-spacing: 0.3px;
}

.gate-val {
    color: #00e6e6;
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.gate-select {
    background: rgba(8, 12, 24, 0.8);
    border: 1px solid rgba(0, 230, 230, 0.15);
    color: #a8c8d8;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.gate-select:focus {
    outline: none;
    border-color: #00e6e6;
    box-shadow: 0 0 10px rgba(0, 230, 230, 0.1);
}

.gate-symbol-fixed {
    padding: 9px 14px;
    color: #00e6e6;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    font-size: 0.95em;
    background: rgba(0, 230, 230, 0.04);
    border: 1px solid rgba(0, 230, 230, 0.15);
    border-radius: 4px;
    text-shadow: 0 0 8px rgba(0, 230, 230, 0.3);
}

.gate-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(0, 230, 230, 0.15), rgba(0, 230, 230, 0.35));
    outline: none;
    margin-top: 4px;
}

.gate-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #0a1628;
    border: 2px solid #00e6e6;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 230, 230, 0.3);
    rotate: 45deg;
}

.gate-setting-actions {
    justify-content: flex-end;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.gate-strategy-btns {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 230, 230, 0.08);
    flex-wrap: wrap;
}

/* ─── Gate 按钮 ──────────────────────────── */
.gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    text-transform: uppercase;
}

.gate-btn-primary {
    background: rgba(0, 230, 230, 0.08);
    border-color: rgba(0, 230, 230, 0.3);
    color: #00e6e6;
}
.gate-btn-primary:hover {
    background: rgba(0, 230, 230, 0.15);
    box-shadow: 0 0 16px rgba(0, 230, 230, 0.15);
}

.gate-btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: #8ab4c8;
}
.gate-btn-outline:hover { border-color: rgba(255, 255, 255, 0.2); color: #c8d6e5; }

.gate-btn-start {
    background: rgba(0, 230, 230, 0.1);
    border-color: #00e6e6;
    color: #00e6e6;
}
.gate-btn-start:hover {
    background: rgba(0, 230, 230, 0.2);
    box-shadow: 0 0 20px rgba(0, 230, 230, 0.2);
}

.gate-btn-pause {
    background: rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
    color: #ff9800;
}

.gate-btn-resume {
    background: rgba(0, 230, 230, 0.08);
    border-color: rgba(0, 230, 230, 0.3);
    color: #00e6e6;
}

.gate-btn-stop {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #8ab4c8;
}

.gate-btn-danger {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.25);
    color: #f44336;
}
.gate-btn-danger:hover { background: rgba(244, 67, 54, 0.15); }

.gate-btn-danger-s {
    background: transparent;
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #f44336;
    padding: 4px 12px;
    font-size: 0.75em;
    border-radius: 3px;
    cursor: pointer;
}

/* ─── Gate 概览卡片 ──────────────────────── */
.gate-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.gate-ov-card {
    background: rgba(10, 16, 30, 0.7);
    border: 1px solid rgba(0, 230, 230, 0.08);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.gate-ov-card:hover {
    border-color: rgba(0, 230, 230, 0.2);
    box-shadow: 0 0 24px rgba(0, 230, 230, 0.05);
}

.gate-ov-ring {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 6px;
}

.gate-ov-ring svg {
    width: 100%;
    height: 100%;
}

.gate-ov-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75em;
    font-weight: 700;
    color: #00e6e6;
    font-family: 'Consolas', monospace;
    text-shadow: 0 0 8px rgba(0, 230, 230, 0.4);
}

.gate-ov-value {
    font-size: 1.4em;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #c8d6e5;
    margin-bottom: 4px;
}

.gate-ov-value.gate-profit { color: #00e6e6; text-shadow: 0 0 10px rgba(0, 230, 230, 0.3); }
.gate-ov-value.gate-loss { color: #f44336; text-shadow: 0 0 10px rgba(244, 67, 54, 0.3); }
.gate-ov-pos { color: #00e6e6; }

.gate-ov-label {
    font-size: 0.72em;
    color: #567;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.gate-ov-sub {
    font-size: 0.7em;
    color: #456;
    margin-top: 2px;
}

.gate-ov-sub.gate-connected { color: #00e6e6; }
.gate-ov-sub.gate-disconnected { color: #f44336; }

/* ─── Gate 行情报价 ──────────────────────── */
.gate-tickers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

@media (min-width: 769px) {
    .gate-tickers { grid-template-columns: repeat(2, 1fr); }
}

.gate-ticker {
    background: rgba(10, 16, 30, 0.6);
    border: 1px solid rgba(0, 230, 230, 0.06);
    border-left: 2px solid rgba(0, 230, 230, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    transition: border-color 0.3s;
}

.gate-ticker:hover { border-left-color: #00e6e6; }

.gate-ticker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.gate-ticker-symbol {
    font-size: 0.8em;
    font-weight: 600;
    color: #8ab4c8;
}

.gate-ticker-source {
    font-size: 0.6em;
    color: #345;
    padding: 1px 6px;
    border: 1px solid rgba(0, 230, 230, 0.15);
    border-radius: 2px;
}

.gate-ticker-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.gate-ticker-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #c8d6e5;
    font-family: 'Consolas', monospace;
}

.gate-ticker-change {
    font-size: 0.75em;
    font-family: 'Consolas', monospace;
}

/* ─── Gate 信号面板 ──────────────────────── */
.gate-signal-card { border-left: 2px solid rgba(0, 230, 230, 0.2); }

.gate-signal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.gate-signal-item {
    text-align: center;
    padding: 10px;
    background: rgba(0, 230, 230, 0.02);
    border-radius: 4px;
    border: 1px solid rgba(0, 230, 230, 0.05);
}

.gate-signal-dir {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Consolas', monospace;
}

.gate-signal-dir.gate-long {
    color: #00e6e6;
    text-shadow: 0 0 10px rgba(0, 230, 230, 0.4);
}

.gate-signal-dir.gate-short {
    color: #f44336;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.4);
}

.gate-signal-val {
    font-size: 1.1em;
    font-weight: 700;
    color: #c8d6e5;
    margin-bottom: 4px;
    font-family: 'Consolas', monospace;
}

.gate-signal-label {
    font-size: 0.7em;
    color: #567;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ─── Gate 数据表格 ──────────────────────── */
.gate-table-wrap {
    overflow-x: auto;
}

.gate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82em;
}

.gate-table thead th {
    background: rgba(0, 230, 230, 0.04);
    color: #567;
    font-weight: 500;
    padding: 10px 8px;
    text-align: left;
    font-size: 0.75em;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 230, 230, 0.08);
}

.gate-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(0, 230, 230, 0.03);
    color: #8ab4c8;
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
}

.gate-table tbody tr:hover {
    background: rgba(0, 230, 230, 0.02);
}

.gate-table-empty {
    text-align: center !important;
    color: #456 !important;
    padding: 30px 8px !important;
    font-family: inherit !important;
}

.gate-dir-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 3px;
    font-family: inherit;
}

.gate-dir-long {
    background: rgba(0, 230, 230, 0.1);
    color: #00e6e6;
    border: 1px solid rgba(0, 230, 230, 0.25);
}

.gate-dir-short {
    background: rgba(244, 67, 54, 0.08);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.gate-profit { color: #00e6e6 !important; }
.gate-loss { color: #f44336 !important; }

/* ─── Gate API 配置 ──────────────────────── */
.gate-api-card { border-left: 2px solid rgba(0, 230, 230, 0.15); }

.gate-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.gate-form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gate-form-group label {
    font-size: 0.75em;
    color: #567;
    letter-spacing: 0.3px;
}

.gate-input {
    background: rgba(8, 12, 24, 0.7);
    border: 1px solid rgba(0, 230, 230, 0.12);
    color: #a8c8d8;
    padding: 9px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Consolas', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-input:focus {
    outline: none;
    border-color: #00e6e6;
    box-shadow: 0 0 12px rgba(0, 230, 230, 0.08);
}

.gate-input::placeholder { color: #345; }

.gate-api-btns {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.gate-api-result {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 0.78em;
    font-family: 'Consolas', monospace;
}

.gate-api-result.gate-api-success {
    background: rgba(0, 230, 230, 0.06);
    border: 1px solid rgba(0, 230, 230, 0.15);
    color: #00e6e6;
}

.gate-api-result.gate-api-error {
    background: rgba(244, 67, 54, 0.06);
    border: 1px solid rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.gate-api-connected { text-align: center; padding: 10px 0; }

.gate-connected-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #00e6e6;
    font-size: 0.9em;
}

.gate-connected-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e6e6;
    box-shadow: 0 0 8px #00e6e6;
}

/* ─── Gate 模拟盘 [PAPER_TRADING] ─────────── */

.paper-mode-toggle {
    display: flex;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 230, 230, 0.15);
}

.paper-mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: rgba(10, 16, 30, 0.6);
    color: #567;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.paper-mode-btn.active {
    background: rgba(0, 230, 230, 0.12);
    color: #00e6e6;
    font-weight: 600;
}

.paper-mode-btn:hover:not(.active) {
    color: #8ab4c8;
}

.paper-balance-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.paper-mode-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    font-family: inherit;
}

.paper-mode-badge.live {
    background: rgba(0, 230, 230, 0.08);
    color: #00e6e6;
    border: 1px solid rgba(0, 230, 230, 0.2);
}

.paper-mode-badge.paper {
    background: rgba(212, 168, 67, 0.08);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

/* ─── Gate 响应式 ────────────────────────── */
@media (max-width: 768px) {
    .gate-overview { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gate-tickers { grid-template-columns: 1fr; }
    .gate-signal-grid { grid-template-columns: repeat(2, 1fr); }
    .gate-control-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .gate-overview { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .gate-ov-card { padding: 10px 8px; }
    .gate-ov-value { font-size: 1.1em; }
    .gate-ov-label { font-size: 0.65em; }
    .gate-control-grid { grid-template-columns: 1fr; }
    .gate-signal-grid { grid-template-columns: 1fr 1fr; }
    .gate-strategy-btns .gate-btn { flex: 1; min-width: 100px; justify-content: center; font-size: 0.75em; }
    .gate-panel-title { font-size: 0.95em; }
    .gate-badge { font-size: 0.5em; }

    .gate-table thead { display: none; }
    .gate-table tbody tr {
        display: block;
        margin-bottom: 8px;
        border: 1px solid rgba(0, 230, 230, 0.08);
        border-radius: 4px;
        padding: 8px;
        background: rgba(10, 16, 30, 0.5);
    }
    .gate-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid rgba(0, 230, 230, 0.03);
        font-size: 0.78em;
    }
    .gate-table tbody td:last-child { border-bottom: none; }
}

/* ═══ 盈利变动账单 ═══ */
.ledger-table-wrap {
    overflow-x: auto;
    max-height: 320px;
    overflow-y: auto;
}
#ledgerTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82em;
}
#ledgerTable thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
#ledgerTable thead th {
    background: rgba(30, 41, 59, 0.95);
    color: #94a3b8;
    font-weight: 500;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.85em;
}
#ledgerTable tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    color: #c9d1d9;
}
#ledgerTable tbody tr:hover {
    background: rgba(30, 41, 59, 0.3);
}
.ledger-time {
    color: #8b949e;
    font-size: 0.85em;
    white-space: nowrap;
}
.ledger-bal {
    color: #e6edf3;
    font-weight: 500;
}
.ledger-desc {
    color: #8b949e;
    font-size: 0.85em;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ledger-desc { max-width: 100px; }
    #ledgerTable { font-size: 0.72em; }
    #ledgerTable thead th,
    #ledgerTable tbody td { padding: 5px 6px; }
}

/* ═══ 盈亏变动弹窗 ═══ */
.oc-clickable {
    cursor: pointer;
    transition: background 0.2s;
}
.oc-clickable:hover {
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
}

.pnl-modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.pnl-modal {
    background: #161b22;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    max-height: 70vh;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.pnl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 1.05em;
    font-weight: 600;
    color: #e6edf3;
}
.pnl-modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.pnl-modal-close:hover { color: #e6edf3; }
.pnl-modal-body {
    padding: 12px 16px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .pnl-modal { width: 95%; max-height: 80vh; }
    .pnl-modal-header { font-size: 0.95em; padding: 12px 14px; }
    .pnl-modal-body { padding: 8px 10px; }
}
