/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0b0e11;
    --bg-secondary: #1e2329;
    --bg-card: #2b3139;
    --bg-hover: #363c45;
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --accent-yellow: #f0b90b;
    --accent-green: #0ecb81;
    --accent-red: #f6465d;
    --border-color: #2b3139;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
}

a {
    color: var(--accent-yellow);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ===== 登录/注册页面 ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b0e11 0%, #1a1e28 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-header h1 {
    font-size: 24px;
    color: var(--accent-yellow);
    margin-bottom: 8px;
}
.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

/* ===== 表单 ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.form-group input,
.form-group select {
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-yellow);
}
.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-primary {
    background: var(--accent-yellow);
    color: #0b0e11;
}
.btn-primary:hover {
    background: #d6a50a;
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--bg-hover);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}
.btn-danger {
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}
.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}
.btn-full {
    width: 100%;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 提示 ===== */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 4px;
}
.alert-error {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.3);
    color: var(--accent-red);
}
.alert-success {
    background: rgba(14, 203, 129, 0.1);
    border: 1px solid rgba(14, 203, 129, 0.3);
    color: var(--accent-green);
}
.alert-info {
    background: rgba(240, 185, 11, 0.08);
    border: 1px solid rgba(240, 185, 11, 0.2);
    color: var(--accent-yellow);
}

/* ===== 頂部导航 ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-left h2 {
    font-size: 18px;
    color: var(--accent-yellow);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-name {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== 仪表盘主布局 ===== */
.dashboard {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ===== 面板 ===== */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 12px;
}
.panel-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 2px;
}
.tab-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    background: var(--accent-yellow);
    color: #0b0e11;
    font-weight: 600;
}
.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-header h3 small {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}
.panel-header .icon {
    font-size: 18px;
}
.panel-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.update-time {
    color: var(--text-secondary);
    font-size: 11px;
}
.ticker-count {
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.panel-body::-webkit-scrollbar {
    width: 6px;
}
.panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.panel-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.panel-left {
    border-right: 1px solid var(--border-color);
}

/* ===== 左侧面板子标题 ===== */
.panel-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.collapsible-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    padding: 8px 14px 6px;
}
.collapsible-toggle:hover {
    color: var(--accent-yellow);
}
.collapsible-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.collapsible-body.open {
    max-height: 5000px;
}

/* ===== 行情搜索框 ===== */
.ticker-search {
    padding: 8px 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.ticker-search input {
    width: 100%;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.ticker-search input:focus {
    border-color: var(--accent-yellow);
}
.ticker-search input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===== 左侧：账户余额 ===== */
.balance-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.balance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 6px;
    transition: background 0.15s;
}
.balance-item:hover {
    background: var(--bg-hover);
}
.balance-asset {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}
.balance-asset .asset-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-yellow);
}
.balance-details {
    text-align: right;
}
.balance-total {
    font-weight: 600;
    font-size: 14px;
}
.balance-free {
    font-size: 12px;
    color: var(--text-secondary);
}
.balance-usd {
    font-size: 11px;
    color: var(--text-secondary);
}

.account-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
}
.summary-item {
    text-align: center;
    padding: 6px 0;
}
.summary-item .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
}
.summary-item .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== 右侧：行情列表 ===== */
.ticker-table {
    width: 100%;
    border-collapse: collapse;
}
.ticker-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    font-weight: 500;
}
.ticker-table th.center,
.ticker-table td.center {
    text-align: center;
}
.ticker-table th.right {
    text-align: right;
}
.ticker-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(43, 49, 57, 0.5);
    font-size: 13px;
    white-space: nowrap;
}
.ticker-table td.right {
    text-align: right;
}
.ticker-table tr {
    cursor: pointer;
    transition: background 0.15s;
}
.ticker-table tr:hover {
    background: var(--bg-hover);
}
.ticker-table .pinned-row {
    background: rgba(240, 185, 11, 0.06);
}
.ticker-table .pinned-row:hover {
    background: rgba(240, 185, 11, 0.12);
}
.ticker-table .symbol-name {
    font-weight: 600;
}
.ticker-table .price {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}
.change-positive {
    color: var(--accent-green);
}
.change-negative {
    color: var(--accent-red);
}
.change-zero {
    color: var(--text-secondary);
}
.volume-cell {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ===== 市场标签 ===== */
.tag-futures, .tag-spot {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    margin-right: 4px;
    vertical-align: middle;
}
.tag-futures {
    background: rgba(240, 185, 11, 0.15);
    color: var(--accent-yellow);
}
.tag-spot {
    background: rgba(14, 203, 129, 0.15);
    color: var(--accent-green);
}

/* ---- 多账号管理 ---- */
.key-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.key-account-item.active {
    border-color: var(--accent-yellow);
    background: rgba(240, 185, 11, 0.06);
}
.key-account-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.key-account-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.key-account-badge {
    font-size: 11px;
    color: var(--accent-yellow);
    font-weight: 600;
}
.key-account-actions {
    display: flex;
    gap: 6px;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h3 {
    font-size: 17px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover {
    color: var(--text-primary);
}
.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== 加载状态 ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.loading::after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    margin: 12px auto;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-yellow);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== K线图表按钮 ===== */
.btn-chart {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
    opacity: 0.6;
}
.btn-chart:hover {
    background: var(--bg-hover);
    opacity: 1;
}

/* ===== 自选按钮 ===== */
.btn-fav {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s;
    color: var(--accent-yellow);
    opacity: 1;
    text-shadow: 0 0 6px rgba(240, 185, 11, 0.5);
}
.btn-fav:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

/* ===== K线图表弹窗 ===== */
.chart-modal {
    max-width: 900px !important;
    width: 92% !important;
}
.chart-timeframes {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}
.tf-btn {
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.tf-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}
.tf-btn.active {
    background: var(--accent-yellow);
    color: #0b0e11;
    border-color: var(--accent-yellow);
    font-weight: 600;
}
.chart-body {
    padding: 12px 16px;
    min-height: 520px;
    position: relative;
}
#chartContainer {
    width: 100%;
    height: 500px;
    border-radius: 6px;
    overflow: hidden;
}

/* ===== 交易弹窗 ===== */
.trade-modal {
    max-width: 480px !important;
    width: 92% !important;
}
.trade-btn-buy {
    flex: 1;
    background: var(--accent-green);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.trade-btn-buy:hover { opacity: 0.85; }
.trade-btn-sell {
    flex: 1;
    background: var(--accent-red);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.trade-btn-sell:hover { opacity: 0.85; }
.trade-mode-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.trade-mode-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.trade-mode-btn.active {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    background: rgba(240, 185, 11, 0.1);
}
.trade-pos-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.price-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.price-input-group input {
    flex: 1;
}
.btn-price-now {
    white-space: nowrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--accent-yellow);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.btn-price-now:hover {
    background: var(--bg-hover);
    border-color: var(--accent-yellow);
}
.leverage-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.leverage-group input {
    width: 80px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    padding: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--accent-yellow);
}
.trade-type-group {
    display: flex;
    gap: 6px;
}
.trade-type-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.trade-type-btn.active {
    background: var(--accent-yellow);
    color: #0b0e11;
    font-weight: 600;
    border-color: var(--accent-yellow);
}
.trade-unit-toggle {
    float: right;
}
.unit-btn {
    padding: 2px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
}
.unit-btn:first-child { border-radius: 4px 0 0 4px; }
.unit-btn:last-child { border-radius: 0 4px 4px 0; }
.unit-btn.active {
    background: var(--accent-yellow);
    color: #0b0e11;
    font-weight: 600;
}
.trade-price-ref {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
}

/* ===== 交易按钮 ===== */
.btn-trade {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    opacity: 0.6;
}
.btn-trade:hover {
    background: var(--bg-hover);
    opacity: 1;
    transform: scale(1.15);
}
.fav-star {
    cursor: pointer;
    font-size: 15px;
    color: var(--accent-yellow);
    text-shadow: 0 0 4px rgba(240, 185, 11, 0.4);
    opacity: 0.7;
    transition: all 0.15s;
    margin-left: 2px;
}
.fav-star:hover {
    opacity: 1;
    transform: scale(1.2);
}

.chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 14, 17, 0.8);
    z-index: 10;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-state p {
    margin-bottom: 16px;
}

/* ===== 响应式 - 平板 ===== */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 360px 1fr;
    }
    .ticker-table th,
    .ticker-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* ===== 响应式 - 手机 ===== */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }
    .panel-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: none;
    }
    .panel-right {
        min-height: 60vh;
    }
    .panel-body {
        padding: 8px;
    }
    .panel-header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .panel-header h3 {
        font-size: 14px;
    }
    .panel-header-right {
        gap: 6px;
    }

    /* 顶部导航 */
    .topbar {
        padding: 10px 12px;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .topbar-left h2 {
        font-size: 15px;
    }
    .topbar-right .user-name {
        display: none;
    }
    .topbar-right .btn-outline {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* 行情表格 - 移动端自适应 */
    .ticker-table {
        font-size: 12px;
    }
    .ticker-table th,
    .ticker-table td {
        padding: 6px 6px;
        font-size: 11px;
    }
    .ticker-table td:nth-child(5),
    .ticker-table th:nth-child(5) {
        display: none;
    }
    .ticker-search input {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* 标签切换按钮 */
    .tab-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* 账户概要 */
    .account-summary {
        padding: 10px;
        gap: 6px;
        margin-bottom: 10px;
    }
    .summary-item .value {
        font-size: 14px;
    }
    .summary-item .label {
        font-size: 10px;
    }

    /* 余额列表 */
    .balance-item {
        padding: 8px 10px;
    }
    .balance-asset {
        font-size: 13px;
    }
    .balance-asset .asset-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .balance-total {
        font-size: 13px;
    }

    /* 弹窗 - 手机全屏 */
    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }
    .modal-overlay {
        align-items: flex-end;
        backdrop-filter: none;
    }
    @keyframes modalIn {
        from { transform: translateY(40px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .modal-header {
        padding: 16px 16px 0;
    }
    .modal-header h3 {
        font-size: 15px;
    }
    .modal-body {
        padding: 14px 16px;
        gap: 10px;
    }
    .modal-footer {
        padding: 12px 16px;
    }
    .chart-modal,
    .trade-modal,
    .orders-modal {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* K线图 */
    .chart-body {
        padding: 8px;
        min-height: 300px;
    }
    #chartContainer {
        height: 320px;
    }
    .chart-timeframes {
        padding: 8px 12px;
        gap: 3px;
    }
    .tf-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* 交易弹窗 */
    .trade-btn-buy,
    .trade-btn-sell {
        font-size: 13px;
        padding: 8px 12px;
    }
    .trade-mode-btn {
        font-size: 11px;
        padding: 6px 2px;
    }
    .trade-type-btn {
        font-size: 12px;
        padding: 6px;
    }
    .leverage-group input {
        width: 60px;
        font-size: 16px;
    }


    /* 现货挂单迷你卡片 */
    .order-mini-item {
        padding: 6px 10px;
    }
    .order-mini-symbol {
        font-size: 12px;
    }

    /* 挂单项 */
    .order-item {
        padding: 8px 10px;
    }
    .order-info {
        font-size: 12px;
    }

    /* 多账号管理 */
    .key-account-item {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* 底部留白 */
    .panel-body:last-child {
        padding-bottom: 40px;
    }
}

/* ===== 响应式 - 小屏手机 ===== */
@media (max-width: 420px) {
    .ticker-table th,
    .ticker-table td {
        padding: 5px 4px;
        font-size: 10px;
    }
    .ticker-table td:nth-child(3),
    .ticker-table th:nth-child(3) {
        display: none;
    }
    .tab-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    .topbar-left h2 {
        font-size: 13px;
    }
    .topbar-right .btn-outline {
        padding: 3px 8px;
        font-size: 10px;
    }
    .panel-header h3 {
        font-size: 12px;
    }
    .summary-item .value {
        font-size: 12px;
    }
}

/* ---- 右键菜单 ---- */
.context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    overflow: hidden;
    padding: 4px 0;
}
.context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}
.context-menu-item:hover {
    background: var(--bg-hover);
}
.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}
.trade-commission {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- 挂单弹窗 ---- */
.orders-modal {
    max-width: 520px !important;
    width: 94% !important;
}
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.order-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
}
.order-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.order-side {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}
.order-side-buy { background: rgba(14, 203, 129, 0.15); color: var(--accent-green); }
.order-side-sell { background: rgba(246, 70, 93, 0.15); color: var(--accent-red); }
.order-status {
    font-size: 11px;
    color: var(--accent-yellow);
    font-weight: 600;
}
.order-info {
    font-size: 13px;
    color: var(--text-primary);
    font-family: monospace;
    margin-bottom: 2px;
}
.order-time {
    font-size: 11px;
    color: var(--text-secondary);
}
.order-cancel-btn {
    margin-top: 8px;
    padding: 3px 12px;
    font-size: 11px;
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}
.order-cancel-btn:hover {
    opacity: 0.85;
}
.order-cancel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- 现货挂单迷你卡片 ---- */
.order-mini-item {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.order-mini-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.order-mini-symbol {
    font-weight: 700;
    font-size: 13px;
}
.order-mini-info {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ---- 按钮禁用状态 ---- */
.trade-btn-buy:disabled,
.trade-btn-sell:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
