:root {
    --ink: #172033;
    --muted: #718096;
    --line: #e8edf3;
    --table-line: #d9dee7;
    --paper: #ffffff;
    --canvas: #f5f7fa;
    --brand: #009688;
    --brand-dark: #007d71;
    --success: #0c9b65;
    --danger-bg: #e74c3c;
    --danger-ink: #000000;
    --blue-bg: #1abc9c;
    --blue-ink: #000000;
    --shadow: 0 10px 34px rgba(23, 32, 51, .07);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
button, input { font-family: inherit; }

.topbar {
    height: 66px;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 34px;
    background: #111827;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand-mark {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--brand); font-size: 23px;
}
.main-nav { display: flex; align-items: stretch; height: 100%; flex: 1; }
.main-nav a {
    position: relative; display: flex; align-items: center; padding: 0 18px;
    color: #aeb8c8; font-size: 14px; transition: .2s ease;
}
.main-nav a:hover, .main-nav a.active { color: #fff; }
.main-nav a.active::after {
    content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px;
    background: #4f8cff; border-radius: 3px 3px 0 0;
}
.account-area { display: flex; align-items: center; gap: 14px; }
.account-area form { margin: 0; }
.account-name { color: #dce3ed; font-size: 13px; }
.link-button { padding: 4px 0; border: 0; background: none; color: #8fb5ff; cursor: pointer; }
.theme-picker { display: inline-flex; align-items: center; gap: 6px; color: #aeb8c8; font-size: 12px; white-space: nowrap; }
.theme-select { height: 30px; padding: 0 26px 0 9px; border: 1px solid #38465a; border-radius: 7px; outline: 0; background: #1c2636; color: #e6edf7; cursor: pointer; }
.theme-select:focus { border-color: #6298ff; box-shadow: 0 0 0 2px rgba(98,152,255,.16); }

.page-container { width: min(1680px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 56px; }
.narrow-container { width: min(960px, calc(100% - 48px)); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 4px 0 8px; font-size: 27px; line-height: 1.2; font-weight: 700; letter-spacing: -.3px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: 1.5px; }
.status-card { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.status-card strong, .status-card small { display: block; }
.status-card strong { font-size: 13px; }
.status-card strong.has-errors { color: #d92d20; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.status-card small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.12); }
.live-dot.ok { background: #12b76a; box-shadow: 0 0 0 5px rgba(18,183,106,.12); }
.live-dot.bad { background: #f04438; box-shadow: 0 0 0 5px rgba(240,68,56,.12); }
.market-error-list { min-width: 320px; max-height: 360px; padding: 10px 16px 14px; overflow-y: auto; }
.market-error-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; border-bottom: 1px solid #eef1f5; line-height: 20px; }
.market-error-item:last-child { border-bottom: 0; }
.market-error-item strong { flex: 0 0 72px; color: #1f2937; }
.market-error-item span { color: #667085; word-break: break-word; }
html[data-theme="dark"] .status-card strong.has-errors { color: #ff7770; }

.filter-card, .table-card, .simple-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.filter-card { margin-bottom: 18px; padding: 18px 20px; }
.filter-main { display: flex; align-items: flex-end; gap: 14px; }
.field-group { min-width: 170px; }
.field-group.wide-field { flex: 1; min-width: 230px; }
.field-group.refresh-field { min-width: 145px; }
.field-group.toggle-field { min-width: 130px; }
.field-group label { display: block; margin-bottom: 7px; color: #526075; font-size: 12px; font-weight: 700; }
.field-group .layui-input { height: 38px; border-color: #dfe5ec; border-radius: 7px; }
.field-group .layui-input:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(23,107,255,.08); }
.filter-actions { display: flex; gap: 7px; padding-bottom: 1px; }
.primary-button { background: var(--brand); border-radius: 7px; }
.primary-button:hover { background: var(--brand-dark); }
.filter-actions .layui-btn { height: 38px; line-height: 38px; }
.filter-toggle { display: flex !important; align-items: center; gap: 7px; height: 38px; margin: 0 !important; padding: 0 11px; border: 1px solid #dfe5ec; border-radius: 7px; background: #f9fafb; cursor: pointer; white-space: nowrap; }
.filter-toggle input { accent-color: var(--brand); }
.filter-toggle-disabled { justify-content: center; color: #98a2b3; cursor: not-allowed; }
.pause-button.paused { border-color: #f5b8b3; background: #fff1f0; color: #b42318; }
.exchange-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.exchange-filter-row.single-row { grid-template-columns: 1fr; }
.exchange-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; }
.exchange-title { margin-right: 3px; color: #475467; font-size: 12px; font-weight: 700; }
.exchange-filter label { display: inline-flex; align-items: center; gap: 5px; color: #667085; font-size: 12px; cursor: pointer; }
.exchange-filter input { accent-color: var(--brand); }

.table-card { overflow: hidden; padding: 0 16px 14px; }
.table-legend { display: flex; align-items: center; gap: 20px; min-height: 48px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: #667085; font-size: 12px; }
.legend-box { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border-radius: 3px; vertical-align: -2px; }
.legend-box.level-high { background: var(--danger-bg); border: 1px solid #f8b4b0; }
.legend-box.level-mid { background: var(--blue-bg); border: 1px solid #a9cdfc; }
.legend-note { margin-left: auto; color: #98a2b3; }
.layui-table-view { margin: 0; border: 0; }
.layui-table-header { border-width: 0 0 1px !important; border-color: var(--table-line) !important; }
.layui-table th { font-size: 12px; color: #526075; font-weight: 700; text-align: center; }
.layui-table th,
.layui-table td { border-color: var(--table-line) !important; }
.layui-table td { text-align: center; }
.table-card .layui-table-page { border-top-color: var(--table-line) !important; }
.layui-table-cell { height: auto; min-height: 26px; line-height: 18px; padding: 4px 8px; text-align: center; }
.favorite-button { display: block; margin: 0 auto; padding: 0; border: 0; background: none; color: #a8b0be; font-size: 25px; cursor: pointer; line-height: 1; }
.favorite-button.active { color: #ff0000; filter: drop-shadow(0 2px 4px rgba(255,0,0,.22)); }
.layui-table-main td[data-field="symbol"], .layui-table-main td[data-field="symbol"] .layui-table-cell { cursor: copy; }
.symbol-cell { display: flex; align-items: center; justify-content: center; min-height: 24px; }
.copy-symbol { padding: 0; border: 0; background: none; color: #152238; font-size: 13px; font-weight: 700; cursor: copy; }
.copy-symbol:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.spread-value { color: #d92d20; font-weight: 700; }
.exchange-pill { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #f0f4f9; color: #344054; font-size: 12px; font-weight: 700; }
.exchange-cell { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.exchange-trade-link { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 24px; color: inherit; text-decoration: none; cursor: pointer; }
.exchange-trade-link:hover .exchange-pill { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.margin-badge { display: inline-block; padding: 1px 4px; border: 1px solid #b7ddc9; border-radius: 4px; background: #edf9f2; color: #087a50; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; white-space: nowrap; }
.legend-margin { margin-right: 4px; vertical-align: 1px; }
.price-value { font-variant-numeric: tabular-nums; color: #253247; }
.qty-box { padding: 4px 8px; border-radius: 0; font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 400; }
.qty-box.level-high { background: var(--danger-bg); color: var(--danger-ink); }
.qty-box.level-mid { background: var(--blue-bg); color: var(--blue-ink); }
.layui-table-main td.qty-level-high { border-color: #fff !important; background: var(--danger-bg) !important; color: #000 !important; }
.layui-table-main td.qty-level-mid { border-color: #fff !important; background: var(--blue-bg) !important; color: #000 !important; }
.layui-table-main td.qty-level-high .qty-box,
.layui-table-main td.qty-level-mid .qty-box { min-height: 100%; background: transparent; color: #000; }
.qty-box small { display: block; margin-top: 1px; opacity: .78; font-size: 10px; }
.note-input { width: 100%; height: 24px; padding: 2px 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #101828; font-weight: 700; text-align: center; }
.note-input::placeholder { color: #c8cfd9; font-weight: 400; opacity: 1; }
.note-input::-webkit-input-placeholder { color: #c8cfd9; font-weight: 400; opacity: 1; }
.note-input::-moz-placeholder { color: #c8cfd9; font-weight: 400; opacity: 1; }
.note-input:-ms-input-placeholder { color: #c8cfd9; font-weight: 400; }
.note-input:hover { border-color: #d8e0e9; background: #fff; }
.note-input:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 2px rgba(23,107,255,.08); }
.delay { font-variant-numeric: tabular-nums; color: #667085; }
.delay.stale { color: #d92d20; font-weight: 700; }
.transfer-channel { display: inline-flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; font-size: 11px; line-height: 16px; white-space: nowrap; }
.transfer-channel i { display: inline-flex; flex: 0 0 17px; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; font-style: normal; font-weight: 700; }
.transfer-channel span { overflow: hidden; text-overflow: ellipsis; }
.transfer-ok { color: #087a50; }
.transfer-ok i, .transfer-legend.ok { background: #e8f7f0; color: #087a50; }
.transfer-unknown, .transfer-locked { color: #7b8493; }
.transfer-unknown i, .transfer-locked i, .transfer-legend.locked { background: #eef2f6; color: #667085; }
.transfer-withdraw_closed, .transfer-deposit_closed, .transfer-no_common, .transfer-contract_mismatch { color: #b42318; }
.transfer-withdraw_closed i, .transfer-deposit_closed i, .transfer-no_common i, .transfer-contract_mismatch i { background: #feeceb; color: #b42318; }
.transfer-legend { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-right: 4px; border-radius: 50%; font-style: normal; font-weight: 700; }
.row-actions { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.row-actions button { padding: 2px 0; border: 0; background: none; color: var(--brand); font-size: 11px; cursor: pointer; }
.row-actions button.permanent-block { color: #d92d20; }
.row-actions button:disabled { color: #a8b0be; cursor: wait; }
.spotarb-live-none { margin-top: -1px; }

.simple-card { padding: 20px; }
.empty-state { padding: 65px 20px; text-align: center; color: var(--muted); }
.empty-state > span { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: #e9f8f1; color: var(--success); font-size: 22px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0; }
.block-list { display: grid; gap: 10px; }
.block-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.block-item strong, .block-item small { display: block; }
.block-route { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; color: #344054; font-size: 13px; font-weight: 700; }
.block-route b { color: var(--brand); font-size: 15px; }
.legacy-route { color: #b54708; }
.block-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.add-user-card { margin-bottom: 18px; }
.password-card { width: min(520px, 100%); padding: 24px; }
.password-form .field-group { width: 100%; margin-bottom: 17px; }
.password-form .layui-input { height: 40px; }
.password-actions { display: flex; align-items: center; gap: 9px; padding-top: 3px; }
.password-actions .layui-btn { height: 38px; line-height: 38px; margin: 0; }
.is-hidden { display: none; }
.inline-form { display: flex; align-items: flex-end; gap: 14px; }
.inline-form .field-group { flex: 1; }
.inline-form .user-type-select { display: block; width: 100%; height: 38px; padding: 0 30px 0 10px; cursor: pointer; }
.inline-form .layui-btn { height: 38px; line-height: 38px; }
.user-table { margin: 0; }
.user-table th { color: #526075; }
.role-badge, .status-badge { display: inline-block; padding: 3px 8px; border-radius: 99px; background: #eef2f6; color: #526075; font-size: 11px; }
.role-badge.admin { background: #eee8ff; color: #6938ef; }
.membership-badge { display: inline-block; padding: 3px 8px; border-radius: 99px; background: #eef2f6; color: #526075; font-size: 11px; }
.membership-badge.premium { background: #e9f8f1; color: #087a50; }
.membership-level, .user-type, .membership-expiry { min-width: 112px; height: 32px !important; padding: 0 8px; border: 1px solid #dfe5ec; border-radius: 2px; background: var(--paper); color: var(--ink); }
.membership-expiry { min-width: 142px; }
.status-badge.enabled { background: #e8f7f0; color: #087a50; }
.status-badge.disabled { background: #feeceb; color: #b42318; }
.muted { color: #98a2b3; }

.login-page { min-height: 100vh; background: radial-gradient(circle at 18% 12%, #dff7f3 0, transparent 34%), linear-gradient(135deg, #f7fafc, #e9eff6); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-theme-picker { position: fixed; top: 22px; right: 24px; z-index: 2; }
.login-card { width: min(410px, 100%); padding: 40px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 26px 80px rgba(0,0,0,.32); }
.login-logo { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 14px; background: var(--brand); color: #fff; font-size: 30px; box-shadow: 0 10px 25px rgba(23,107,255,.25); }
.login-card h1 { margin: 0; text-align: center; font-size: 24px; }
.login-subtitle { margin: 8px 0 28px; text-align: center; color: var(--muted); font-size: 13px; }
.login-label { display: block; margin-bottom: 7px; color: #475467; font-size: 13px; font-weight: 700; }
.login-form .layui-input { height: 43px; border-radius: 8px; }
.login-remember { display: flex; align-items: center; gap: 7px; min-height: 26px; margin: -2px 0 8px; color: #475467; font-size: 13px; cursor: pointer; user-select: none; }
.login-remember input { display: inline-block !important; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.login-remember small { margin-left: auto; color: var(--muted); font-size: 11px; }
.login-form .primary-button { height: 44px; line-height: 44px; margin-top: 8px; }
.form-error { margin-bottom: 18px; padding: 10px 12px; border: 1px solid #f8b4b0; border-radius: 7px; background: #fff2f1; color: #b42318; font-size: 12px; }

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e7edf6;
    --muted: #91a0b5;
    --line: #273449;
    --table-line: #334158;
    --paper: #141d2c;
    --canvas: #0b1220;
    --brand: #16baaa;
    --brand-dark: #0ea394;
    --success: #35d399;
    --danger-bg: #e74c3c;
    --danger-ink: #000000;
    --blue-bg: #1abc9c;
    --blue-ink: #000000;
    --shadow: 0 12px 38px rgba(0, 0, 0, .24);
}
html[data-theme="dark"] .topbar { background: #080e19; border-bottom: 1px solid #1e2a3d; }
html[data-theme="dark"] .field-group label,
html[data-theme="dark"] .exchange-title,
html[data-theme="dark"] .layui-table th,
html[data-theme="dark"] .user-table th,
html[data-theme="dark"] .login-label { color: #aab7ca; }
html[data-theme="dark"] .field-group .layui-input,
html[data-theme="dark"] .login-form .layui-input {
    border-color: #334158;
    background: #101827;
    color: #e7edf6;
}
html[data-theme="dark"] .layui-input::placeholder { color: #64748b; }
html[data-theme="dark"] .filter-toggle { border-color: #334158; background: #101827; color: #c4cfdd; }
html[data-theme="dark"] .filter-toggle-disabled { color: #64748b; }
html[data-theme="dark"] .pause-button.paused { border-color: #6b3439; background: #351d23; color: #ff9b96; }
html[data-theme="dark"] .exchange-filter label,
html[data-theme="dark"] .table-legend { color: #97a6ba; }
html[data-theme="dark"] .legend-note,
html[data-theme="dark"] .muted { color: #718096; }
html[data-theme="dark"] .layui-table-view,
html[data-theme="dark"] .layui-table,
html[data-theme="dark"] .layui-table-header,
html[data-theme="dark"] .layui-table-body,
html[data-theme="dark"] .layui-table-main,
html[data-theme="dark"] .layui-table-page {
    border-color: #273449 !important;
    background: #141d2c !important;
    color: #dce5f1;
}
html[data-theme="dark"] .layui-table thead tr,
html[data-theme="dark"] .layui-table-header table,
html[data-theme="dark"] .layui-table-header th { background: #182335 !important; }
html[data-theme="dark"] .layui-table tbody tr { background: #141d2c; color: #dce5f1; }
html[data-theme="dark"] .layui-table tbody tr:hover,
html[data-theme="dark"] .layui-table-hover { background: #1a273a !important; }
html[data-theme="dark"] .layui-table th,
html[data-theme="dark"] .layui-table td { border-color: var(--table-line) !important; }
html[data-theme="dark"] .layui-table-main td.qty-level-high,
html[data-theme="dark"] .layui-table-main td.qty-level-mid { border-color: #fff !important; }
html[data-theme="dark"] .layui-table-page { border-top-color: #273449 !important; }
html[data-theme="dark"] .layui-laypage a,
html[data-theme="dark"] .layui-laypage span,
html[data-theme="dark"] .layui-laypage button,
html[data-theme="dark"] .layui-laypage input,
html[data-theme="dark"] .layui-laypage select {
    border-color: #334158 !important;
    background: #101827 !important;
    color: #aebcd0 !important;
}
html[data-theme="dark"] .layui-laypage .layui-laypage-curr .layui-laypage-em { background: var(--brand); }
html[data-theme="dark"] .layui-btn-primary { border-color: #3a4960; background: #172234; color: #c8d3e2; }
html[data-theme="dark"] .copy-symbol { color: #e4ebf5; }
html[data-theme="dark"] .spread-value { color: #ff7770; }
html[data-theme="dark"] .exchange-pill { background: #223047; color: #d6e0ed; }
html[data-theme="dark"] .margin-badge { border-color: #27654f; background: #153a30; color: #66e0b2; }
html[data-theme="dark"] .price-value { color: #d7e1ee; }
html[data-theme="dark"] .note-input { color: #f1f5f9; }
html[data-theme="dark"] .note-input::placeholder,
html[data-theme="dark"] .note-input::-webkit-input-placeholder,
html[data-theme="dark"] .note-input::-moz-placeholder { color: #56657a; }
html[data-theme="dark"] .note-input:hover,
html[data-theme="dark"] .note-input:focus { border-color: #3e506b; background: #0f1827; }
html[data-theme="dark"] .delay { color: #93a4ba; }
html[data-theme="dark"] .transfer-ok { color: #66e0b2; }
html[data-theme="dark"] .transfer-ok i, html[data-theme="dark"] .transfer-legend.ok { background: #153a30; color: #66e0b2; }
html[data-theme="dark"] .transfer-unknown, html[data-theme="dark"] .transfer-locked { color: #91a0b5; }
html[data-theme="dark"] .transfer-unknown i, html[data-theme="dark"] .transfer-locked i, html[data-theme="dark"] .transfer-legend.locked { background: #26334a; color: #b9c6d8; }
html[data-theme="dark"] .transfer-withdraw_closed, html[data-theme="dark"] .transfer-deposit_closed, html[data-theme="dark"] .transfer-no_common, html[data-theme="dark"] .transfer-contract_mismatch { color: #ff9690; }
html[data-theme="dark"] .transfer-withdraw_closed i, html[data-theme="dark"] .transfer-deposit_closed i, html[data-theme="dark"] .transfer-no_common i, html[data-theme="dark"] .transfer-contract_mismatch i { background: #4a2229; color: #ff9690; }
html[data-theme="dark"] .empty-state > span { background: #153a30; }
html[data-theme="dark"] .block-item { background: #111a29; }
html[data-theme="dark"] .password-card { background: #141d2c; }
html[data-theme="dark"] .block-route { color: #c8d3e2; }
html[data-theme="dark"] .legacy-route { color: #fdbd74; }
html[data-theme="dark"] .role-badge,
html[data-theme="dark"] .status-badge { background: #26334a; color: #b9c6d8; }
html[data-theme="dark"] .role-badge.admin { background: #352b59; color: #c5b5ff; }
html[data-theme="dark"] .status-badge.enabled { background: #153a30; color: #66e0b2; }
html[data-theme="dark"] .status-badge.disabled { background: #4a2229; color: #ff9690; }
html[data-theme="dark"] .membership-badge { background: #26334a; color: #b9c6d8; }
html[data-theme="dark"] .membership-badge.premium { background: #153a30; color: #66e0b2; }
html[data-theme="dark"] .membership-level,
html[data-theme="dark"] .user-type,
html[data-theme="dark"] .membership-expiry { border-color: #334158; background: #101827; color: #e7edf6; }
html[data-theme="dark"] .login-page { background: radial-gradient(circle at 20% 10%, #1d3765 0, transparent 35%), linear-gradient(135deg, #070c15, #111b2d); }
html[data-theme="dark"] .login-card { border-color: #28354a; background: rgba(20,29,44,.98); }
html[data-theme="dark"] .login-remember { color: #c4cfdd; }
html[data-theme="dark"] .form-error { border-color: #6b3439; background: #351d23; color: #ff9b96; }
html[data-theme="dark"] .layui-layer { background: #172234; color: #e2e8f0; }
html[data-theme="dark"] .layui-layer-msg { border-color: #334158; box-shadow: 0 8px 28px rgba(0,0,0,.35); }

/* Layui 管理台布局 */
.admin-sidebar {
    position: fixed !important;
    z-index: 1002;
    top: 0 !important;
    bottom: 0 !important;
    left: 0;
    width: 170px !important;
    overflow: hidden;
    background: #20222a !important;
    transition: transform .2s ease;
}
.admin-sidebar .layui-side-scroll { width: 190px; padding-bottom: 24px; }
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 170px;
    height: 60px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #191b22;
    color: #f1f3f6;
    font-size: 15px;
}
.sidebar-brand .brand-mark { width: 30px; height: 30px; border-radius: 3px; background: #009688; font-size: 20px; }
.sidebar-nav,
.sidebar-nav.layui-nav-tree { width: 170px; padding: 10px 0; background: transparent; }
.sidebar-nav .layui-nav-item > a { height: 46px; line-height: 46px; padding: 0 18px; color: #c2c2c2; }
.sidebar-nav .layui-nav-child { padding: 0; background: #16181d !important; }
.sidebar-nav .layui-nav-child dd a { height: 42px; line-height: 42px; padding-left: 45px; color: #aeb3be; }
.sidebar-nav .layui-nav-child dd.layui-this,
.sidebar-nav .layui-nav-child dd.layui-this a { background: #009688 !important; color: #fff; }
.sidebar-nav .layui-nav-more { right: 16px; }
.nav-icon { display: inline-block; width: 23px; color: #8d97a6; font-size: 15px; }

.admin-header.topbar {
    position: fixed;
    z-index: 1001;
    top: 0;
    right: 0;
    left: 170px;
    height: 60px;
    gap: 18px;
    padding: 0 20px;
    border-bottom: 1px solid #252b36;
    background: #191b22;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: left .2s ease;
}
.sidebar-toggle { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #c7ccd5; font-size: 20px; cursor: pointer; }
.sidebar-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.header-title { display: flex; align-items: baseline; gap: 11px; min-width: 220px; }
.header-title strong { color: #f1f3f6; font-size: 15px; }
.header-title span { color: #8e96a3; font-size: 12px; }
.header-market-strip { display: flex; align-self: stretch; gap: 0; margin-left: 12px; }
.header-market-strip > span { display: flex; align-items: center; gap: 9px; padding: 0 16px; border-left: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.header-market-strip b { color: #e3e7ed; font-size: 13px; }
.header-market-strip em { min-width: 74px; color: #31c9a9; font-size: 15px; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.header-market-strip small { font-size: 11px; font-variant-numeric: tabular-nums; }
.ticker-change { min-width: 55px; color: #9aa4b2; }
.ticker-change.up { color: #31c9a9; }
.ticker-change.down { color: #ff7770; }
.ticker-change.flat { color: #aeb8c8; }
.header-market-strip > .ticker-source { gap: 6px; padding-right: 8px; color: #8e96a3; }
.ticker-state { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.ticker-state.live { background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.14); }
.ticker-state.offline { background: #f04438; box-shadow: 0 0 0 3px rgba(240,68,56,.13); }
.admin-header .account-area { margin-left: auto; }

.app-page .page-container {
    width: auto;
    max-width: none;
    margin: 0 0 0 170px;
    padding: 76px 18px 34px;
    transition: margin-left .2s ease;
}
.app-page .narrow-container { width: auto; max-width: none; }
.sidebar-collapsed .admin-sidebar { transform: translateX(-170px); }
.sidebar-collapsed .admin-header { left: 0; }
.sidebar-collapsed .page-container { margin-left: 0; }

.market-notice {
    margin: -16px -18px 14px;
    padding: 8px 18px;
    border-bottom: 1px solid #e4c746;
    background: #fff3a6;
    color: #b45f06;
    text-align: center;
    font-size: 13px;
    line-height: 20px;
}
.market-page-heading { align-items: center; margin-bottom: 12px; }
.market-page-heading .eyebrow { display: none; }
.market-page-heading h1 { margin: 0 0 3px; font-size: 18px; font-weight: 600; }
.market-page-heading p { font-size: 12px; }
.market-page-heading .status-card { min-width: 215px; padding: 7px 11px; border-radius: 2px; box-shadow: none; }

.filter-card,
.table-card,
.simple-card { border-radius: 2px; box-shadow: none; }
.filter-card { margin-bottom: 12px; padding: 12px 14px; }
.filter-main { gap: 10px; }
.field-group { min-width: 135px; }
.field-group.wide-field { min-width: 190px; }
.field-group.refresh-field { min-width: 125px; }
.field-group.toggle-field { min-width: 120px; }
.field-group label { margin-bottom: 5px; font-weight: 400; }
.field-group .layui-input { height: 34px; border-radius: 2px; }
.filter-toggle { height: 34px; border-radius: 2px; }
.filter-actions .layui-btn { height: 34px; line-height: 34px; border-radius: 2px; }
.primary-button { border-radius: 2px; }
.exchange-filter-row { margin-top: 11px; padding-top: 10px; }
.exchange-filter { gap: 6px 12px; }

.table-card { padding: 0; }
.table-legend { min-height: 39px; padding: 7px 14px; gap: 18px; }
.table-card .layui-table-view { border: 0; }
.layui-table th { background: #f2f2f2; font-weight: 400; }
.layui-table-cell { min-height: 24px; padding: 3px 8px; }
.layui-table-main td[data-field="buy_qty"] .layui-table-cell,
.layui-table-main td[data-field="sell_qty"] .layui-table-cell { height: 100%; padding: 0; }
.layui-table-main td.qty-level-high,
.layui-table-main td.qty-level-mid { padding-top: 0 !important; padding-bottom: 0 !important; }
.qty-box { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 30px; margin: 0; padding: 3px 8px; border-radius: 0; text-align: center; }
.favorite-button { font-size: 25px; }
.copy-symbol { color: #007d71; }
.exchange-pill { padding: 2px 6px; border-radius: 2px; background: transparent; font-weight: 700; }
.margin-badge { border-radius: 2px; }
.note-input { border-radius: 2px; }
.row-actions { gap: 8px; }
.row-actions button { padding: 2px 3px; }
.simple-card { padding: 14px; }
.block-item { border-radius: 2px; }

html[data-theme="dark"] .market-notice { border-color: #6b5d20; background: #403816; color: #f2c96d; }
html[data-theme="dark"] .layui-table th { background: #182335 !important; }
html[data-theme="dark"] .copy-symbol { color: #7edbd1; }
html[data-theme="dark"] .exchange-pill { background: transparent; }

@media (max-width: 960px) {
    .admin-sidebar { transform: translateX(-170px); box-shadow: 6px 0 24px rgba(0,0,0,.28); }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-header.topbar { left: 0; height: 60px; padding: 0 12px; flex-wrap: nowrap; }
    .app-page .page-container { margin-left: 0; padding: 74px 12px 28px; }
    .header-market-strip { display: none; }
    .header-title { min-width: 0; }
    .header-title span { display: none; }
    .filter-main { flex-wrap: wrap; }
    .field-group, .field-group.wide-field { flex: 1 1 200px; }
    .exchange-filter-row { grid-template-columns: 1fr; }
    .table-card { overflow-x: auto; }
    .table-card > .layui-table-view { min-width: 1540px; }
}

@media (max-width: 620px) {
    .admin-header .account-name { display: none; }
    .admin-header .theme-picker > span { display: none; }
    .admin-header .account-area { gap: 8px; }
    .theme-select { width: 65px; padding-left: 6px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .status-card { width: 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .layui-btn { flex: 1; }
    .table-legend { align-items: flex-start; flex-direction: column; gap: 6px; }
    .legend-note { margin-left: 0; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form .field-group { width: 100%; }
    .password-card { width: 100%; }
    .table-responsive { overflow-x: auto; }
    .user-table { min-width: 760px; }
    .login-card { padding: 30px 24px; }
    .market-notice { margin-top: -14px; }
}

/* 汇率对冲：延续 Layui 管理台的浅色、紧凑和低学习成本布局。 */
.compact-heading { align-items: center; margin-bottom: 14px; }
.compact-heading h1 { margin-bottom: 5px; font-size: 21px; }
.rate-page { padding-bottom: 44px !important; }
.rate-explain-card { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; padding: 12px 15px; border-color: #d9eee9; background: #f4fbf9; }
.rate-explain-icon { display: grid; flex: 0 0 42px; place-items: center; height: 34px; border-radius: 2px; background: #009688; color: #fff; font-size: 12px; font-weight: 700; }
.rate-explain-card strong { display: block; margin-bottom: 3px; color: #176b61; font-size: 13px; }
.rate-explain-card p { margin: 0; color: #5c716e; font-size: 12px; line-height: 19px; }
.rate-query-card { padding: 11px 14px; }
.rate-query-form { display: flex; align-items: flex-end; gap: 10px; }
.rate-query-form .field-group { flex: 0 0 180px; }
.rate-query-form .layui-input { text-transform: uppercase; font-weight: 700; }
.rate-divider { padding-bottom: 7px; color: #98a2b3; font-size: 19px; }
.rate-query-actions { display: flex; align-items: center; gap: 7px; }
.rate-query-actions .layui-btn { margin: 0; white-space: nowrap; }
.rate-search-button { height: 34px; line-height: 34px; }
.rate-copy-button { height: 34px; line-height: 32px; }
.rate-periods { display: inline-flex; align-items: center; margin-left: auto; overflow: hidden; border: 1px solid #d8dee8; border-radius: 2px; }
.period-button { min-width: 58px; height: 32px; padding: 0 13px; border: 0; border-left: 1px solid #e6eaf0; background: #fff; color: #526075; cursor: pointer; }
.period-button:first-child { border-left: 0; }
.period-button:hover { background: #f4f8fa; color: #009688; }
.period-button.active { background: #009688; color: #fff; }

.rate-chart-card { margin-top: 12px; overflow: hidden; border: 1px solid #dfe5ec; border-radius: 2px; background: var(--paper); }
.chart-card-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 82px; padding: 13px 18px 11px; border-bottom: 1px solid var(--line); }
.chart-kicker { color: #7b8da5; font-size: 10px; letter-spacing: 1.5px; }
.chart-card-header h2 { margin: 4px 0 3px; color: var(--ink); font-size: 17px; line-height: 23px; }
.chart-card-header p { margin: 0; color: var(--muted); font-size: 11px; }
.chart-summary { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px 22px; color: #667085; font-size: 11px; }
.chart-summary b { margin-left: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.positive-color { color: #009688 !important; }
.negative-color { color: #e74c3c !important; }
.rate-chart { position: relative; width: 100%; height: 310px; overflow: hidden; background: var(--paper); }
.chart-loading, .chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 12px; }
.rate-chart-svg { display: block; width: 100%; height: 100%; }
.chart-grid { stroke: #e7ecf2; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: #8491a4; font-size: 10px; font-family: "Microsoft YaHei", Arial, sans-serif; }
.chart-series { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-reference { stroke: #e74c3c; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-reference-label { fill: #d94133; font-size: 10px; font-family: "Microsoft YaHei", Arial, sans-serif; }
.chart-extrema-point { fill: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-extrema-point.high { stroke: #e74c3c; }
.chart-extrema-point.low { stroke: #009688; }
.chart-extrema-label { font-size: 10px; font-weight: 700; font-family: "Microsoft YaHei", Arial, sans-serif; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.chart-extrema-label.high { fill: #e74c3c; }
.chart-extrema-label.low { fill: #009688; }
.chart-cursor { display: none; stroke: #667085; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-tooltip { position: absolute; z-index: 3; display: none; min-width: 168px; padding: 9px 11px; border: 1px solid #d9e1ea; border-radius: 3px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(16,24,40,.13); color: #344054; pointer-events: none; }
.chart-tooltip strong { display: block; margin-bottom: 5px; color: #667085; font-size: 10px; }
.chart-tooltip span { display: flex; align-items: center; gap: 6px; min-width: 145px; line-height: 21px; font-size: 11px; }
.chart-tooltip span i { width: 7px; height: 7px; border-radius: 50%; }
.chart-tooltip span b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tooltip span.tooltip-deviation { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.chart-tooltip span.tooltip-deviation i { background: transparent; }
.chart-card-footer { display: flex; align-items: center; gap: 7px; min-height: 35px; padding: 6px 18px; border-top: 1px solid var(--line); color: #667085; font-size: 10px; }
.legend-line { display: inline-block; width: 18px; height: 2px; margin-left: 11px; background: #1e9fff; }
.legend-line:first-child { margin-left: 0; }
.midline-line { background: #e74c3c; }
.asset-a-line { background: #16b8c9; }
.asset-b-line { background: #ff5a78; }
.chart-footnote { margin-left: auto; color: #98a2b3; }

.rate-table-card { min-height: 0; }
.rate-pair-name { color: #007d71; letter-spacing: .3px; }
.square-tip { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; border-left: 3px solid #009688; color: #667085; }
.square-tip strong { color: #176b61; }
.recommendation-status-card { min-width: 250px; padding: 9px 13px; border-radius: 2px; box-shadow: none; }
.recommendation-rules { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; padding: 11px 14px; border-left: 3px solid #009688; color: #667085; font-size: 11px; }
.recommendation-rules strong { color: #176b61; }
.recommendation-rules span { white-space: nowrap; }
.recommendation-method-note { margin: -5px 2px 12px; color: #8a94a3; font-size: 10px; line-height: 18px; }
.recommendation-filter-card { padding: 10px 14px; }
.recommendation-scan-summary { margin-left: auto; color: #7b8493; font-size: 11px; }
.recommendation-table-card { min-height: 0; }
.recommendation-table-card .layui-table td .layui-table-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 56px;
    min-height: 56px;
    line-height: 18px;
    overflow: hidden;
}
.recommendation-table-card .layui-table td .layui-btn { flex: 0 0 auto; }
.recommendation-table-card .layui-table td .layui-btn + .layui-btn { margin: 3px 0 0; }
.recommendation-table-card b { font-size: 11px; font-weight: 700; }
.recommendation-sub { display: block; margin-top: 2px; color: #7b8493; font-size: 10px; font-style: normal; white-space: nowrap; }
.recommendation-sub em { font-style: normal; }
.recommendation-score { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid #1abc9c; border-radius: 50%; background: #eaf9f6; color: #087a6d; font-size: 15px; font-weight: 700; }
.recommendation-table-card .recommendation-live-value { font-size: 15px; font-weight: 700; }
.direction-badge { display: inline-block; padding: 2px 7px; border: 1px solid; border-radius: 2px; font-size: 11px; font-weight: 700; }
.direction-badge.high { border-color: #f1b4ae; background: #fff4f2; color: #c8372b; }
.direction-badge.low { border-color: #9ddfd5; background: #edfaf7; color: #087a6d; }
.login-page .login-theme-picker { color: #526075; }
.login-page .login-theme-picker .theme-select { border-color: #cfd8e3; background: #fff; color: #344054; }

html[data-theme="dark"] .rate-explain-card { border-color: #28554e; background: #122d29; }
html[data-theme="dark"] .rate-explain-card strong { color: #73dbcc; }
html[data-theme="dark"] .rate-explain-card p { color: #9bb9b4; }
html[data-theme="dark"] .period-button { border-color: #334158; background: #101827; color: #b9c6d8; }
html[data-theme="dark"] .period-button:hover { background: #172638; color: #73dbcc; }
html[data-theme="dark"] .period-button.active { background: #009688; color: #fff; }
html[data-theme="dark"] .rate-periods, html[data-theme="dark"] .rate-chart-card { border-color: #2b394e; }
html[data-theme="dark"] .chart-grid { stroke: #334158; }
html[data-theme="dark"] .chart-axis-label { fill: #7f90a7; }
html[data-theme="dark"] .chart-tooltip { border-color: #3a4960; background: rgba(17,26,41,.97); color: #c8d3e2; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
html[data-theme="dark"] .rate-pair-name { color: #73dbcc; }
html[data-theme="dark"] .square-tip strong { color: #73dbcc; }
html[data-theme="dark"] .recommendation-rules strong { color: #73dbcc; }
html[data-theme="dark"] .recommendation-score { border-color: #1abc9c; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .direction-badge.high { border-color: #6e3337; background: #3c2026; color: #ff9690; }
html[data-theme="dark"] .direction-badge.low { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .login-page .login-theme-picker { color: #aeb8c8; }
html[data-theme="dark"] .login-page .login-theme-picker .theme-select { border-color: #38465a; background: #1c2636; color: #e6edf7; }

/* 交易数据：表格信息密度与 Layui 管理台保持一致，实盘操作集中在 layer 弹窗。 */
.trading-page { padding-bottom: 42px !important; }
.security-tip, .strategy-tip { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 11px 14px; border-left: 3px solid #009688; color: #667085; font-size: 12px; }
.security-tip strong, .strategy-tip strong { flex: 0 0 auto; color: #176b61; }
.trading-table-card { min-height: 260px; }
.trading-table-card .layui-table-cell { min-height: 36px; height: auto; line-height: 18px; white-space: normal; }
.position-history-filter { margin-bottom: 10px; }
.position-history-filter .field-group { min-width: 170px; }
.position-history-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.position-history-summary > div { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); background: var(--paper); }
.position-history-summary span { display: block; overflow: hidden; margin-bottom: 4px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.position-history-summary strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.position-history-summary small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.strategy-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 320px)); align-items: stretch; gap: 12px; min-height: 180px; }
.strategy-cards-loading, .strategy-cards-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 180px; border: 1px solid var(--line); background: var(--paper); color: #7b8493; }
.strategy-cards-loading i { margin-right: 7px; color: #009688; }
.strategy-card { display: flex; overflow: hidden; flex-direction: column; height: 100%; border: 1px solid #dfe5ec; border-top: 3px solid #1abc9c; border-radius: 7px; background: #fff; box-shadow: 0 4px 14px rgba(31,45,61,.07); color: #344054; transition: border-color .15s ease, box-shadow .15s ease; }
.strategy-card:hover { border-color: #b9dcd6; box-shadow: 0 7px 20px rgba(31,45,61,.11); }
.strategy-card.status-paused { border-top-color: #98a2b3; }
.strategy-card.status-entering, .strategy-card.status-closing { border-top-color: #e6a23c; }
.strategy-card.status-error { border-top-color: #e74c3c; }
.strategy-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 11px 12px 9px; border-bottom: 1px solid #edf0f4; background: #fafbfc; }
.strategy-card-header strong, .strategy-card-header small { display: block; }
.strategy-card-header strong { color: #172033; font-size: 14px; letter-spacing: .2px; }
.strategy-pair-link { display: inline-block; text-decoration: none; }
.strategy-pair-link:hover strong { color: #009688; text-decoration: underline; text-underline-offset: 3px; }
.strategy-card-header small { margin-top: 2px; color: #8a94a3; font-size: 10px; }
.strategy-card-quote { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1px; border-bottom: 1px solid #edf0f4; background: #edf0f4; }
.strategy-card-quote > div { padding: 8px 11px; background: #fff; }
.strategy-card-quote span, .strategy-card-quote b { display: block; }
.strategy-card-quote span { margin-bottom: 2px; color: #8a94a3; font-size: 10px; }
.strategy-card-quote b { overflow: hidden; color: #087a6d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strategy-card-direction-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 11px; border-bottom: 1px solid #edf0f4; color: #7b8493; font-size: 10px; }
.strategy-card-direction-row > span:last-child { white-space: nowrap; }
.strategy-card-direction { display: inline-block; padding: 2px 6px; border: 1px solid; border-radius: 3px; font-weight: 700; }
.strategy-card-direction.high { border-color: #f2b8b2; background: #fff4f2; color: #c8372b; }
.strategy-card-direction.low { border-color: #9ddfd5; background: #edfaf7; color: #087a6d; }
.strategy-card-stage-pair { display: grid; flex: 1 0 auto; grid-template-columns: 1fr 1fr; align-items: stretch; border-bottom: 1px solid #edf0f4; }
.strategy-card-stage { min-width: 0; padding: 7px 8px 6px; }
.strategy-card-stage + .strategy-card-stage { border-left: 1px solid #edf0f4; }
.strategy-card-stage label { display: block; margin-bottom: 4px; color: #667085; font-size: 10px; }
.strategy-card-stage > div { display: grid; gap: 3px; min-height: 21px; }
.strategy-stage-line { display: grid; grid-template-columns: 21px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 3px; min-height: 21px; padding: 2px 4px; border: 1px solid #cce7e2; border-radius: 3px; background: #f4fbf9; color: #16786d; font-size: 9px; line-height: 15px; }
.strategy-stage-line b { font-size: 9px; }
.strategy-stage-line span { text-align: center; font-variant-numeric: tabular-nums; }
.strategy-stage-line em { overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-variant-numeric: tabular-nums; }
.strategy-stage-line.exit { border-color: #f0d0d3; background: #fff7f8; color: #ba4050; }
.strategy-stage-line.completed { border-color: #1abc9c; background: #dff6f1; font-weight: 700; }
.strategy-stage-line.exit.completed { border-color: #e67d8b; background: #fdecef; }
.strategy-stage-chip { display: inline-block; padding: 2px 5px; border: 1px solid #cce7e2; border-radius: 3px; background: #f4fbf9; color: #16786d; font-size: 9px; line-height: 15px; white-space: nowrap; }
.strategy-stage-chip.exit { border-color: #f0d0d3; background: #fff7f8; color: #ba4050; }
.strategy-stage-chip.completed { border-color: #1abc9c; background: #dff6f1; font-weight: 700; }
.strategy-stage-chip.exit.completed { border-color: #e67d8b; background: #fdecef; }
.strategy-card-evaluation { padding: 7px 11px; border-bottom: 1px solid #dce6ef; background: #f6f9fc; }
.strategy-card-evaluation > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #526075; font-size: 10px; }
.strategy-card-evaluation > div span { font-weight: 700; }
.strategy-card-evaluation time { color: #7b8493; font-size: 9px; font-variant-numeric: tabular-nums; }
.strategy-card-evaluation p { margin: 5px 0 3px; color: #176b61; font-size: 10px; line-height: 16px; overflow-wrap: anywhere; }
.strategy-card-evaluation small { display: block; color: #7b8493; font-size: 9px; line-height: 14px; font-variant-numeric: tabular-nums; }
.strategy-card-funding { position: relative; padding: 7px 11px; border-bottom: 1px solid #edf0f4; background: #fbfdfd; }
.strategy-card-funding > div { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: #667085; font-size: 10px; }
.strategy-card-funding > div strong { color: #344054; font-size: 10px; white-space: nowrap; }
.strategy-card-funding > small { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 4px; padding-right: 74px; color: #7b8493; font-size: 9px; }
.strategy-card-funding > small > span:last-child { text-align: right; }
.strategy-card-funding time { position: absolute; right: 11px; bottom: 7px; color: #087a6d; font-size: 9px; font-style: normal; font-variant-numeric: tabular-nums; }
.strategy-card-metrics { margin: 7px 11px 8px; padding-top: 5px; border-top: 1px solid #edf0f4; }
.strategy-card-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 25px; border-bottom: 1px dashed #edf0f4; font-size: 10px; }
.strategy-card-metrics dt { color: #7b8493; }
.strategy-card-metrics dd { margin: 0; color: #344054; text-align: right; font-variant-numeric: tabular-nums; }
.strategy-card-error { overflow: hidden; margin: 0 11px 8px; padding: 5px 7px; border-left: 2px solid #e74c3c; background: #fff4f2; color: #c8372b; font-size: 9px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.strategy-card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 9px 10px 10px; border-top: 1px solid #edf0f4; background: #fafbfc; }
.strategy-card-button { height: 28px; border: 1px solid #ccd5df; border-radius: 4px; background: #fff; color: #526075; font-size: 10px; cursor: pointer; }
.strategy-card-button:hover { border-color: #1abc9c; color: #087a6d; }
.strategy-card-button.edit, .strategy-card-button.resume { border-color: #69cbbb; color: #087a6d; }
.strategy-card-button.danger { border-color: #efb6b2; color: #c8372b; }
.strategy-card-button:disabled { border-color: #e2e7ed; background: #f3f5f7; color: #a8b0bc; cursor: not-allowed; }
.cell-sub { display: block; margin-top: 2px; color: #7b8493; font-size: 10px; line-height: 15px; white-space: normal; }
.position-table-sub { font-size: inherit; line-height: inherit; }
.muted-text { color: #98a2b3; }
.error-text { color: #d94b40 !important; }
.point-red { color: #e74c3c; }
.mode-badge, .status-badge, .strategy-status { display: inline-block; padding: 2px 7px; border-radius: 2px; font-size: 11px; line-height: 18px; }
.mode-badge { border: 1px solid #9edfd5; background: #edfaf7; color: #087a6d; }
.status-badge.running, .strategy-status.monitoring { background: #e9f8f1; color: #087a50; }
.strategy-status.holding { background: #e74c3c; color: #fff; }
.status-badge.waiting, .strategy-status.paused { background: #f1f3f6; color: #667085; }
.status-badge.error, .strategy-status.error { background: #fff0ef; color: #c8372b; }
.strategy-status.entering, .strategy-status.closing { background: #fff7e6; color: #ad6800; }
.layer-form { box-sizing: border-box; padding: 18px 22px 8px; color: #344054; }
.layer-form > label, .layer-grid label { display: block; margin: 12px 0 5px; color: #526075; font-size: 12px; }
.layer-form .layui-input { height: 34px; border-color: #dfe5ec; }
.layer-form-note { padding: 10px 12px; border-left: 3px solid #009688; background: #f4fbf9; color: #526075; font-size: 12px; line-height: 19px; }
.layer-form-note.warning-note { border-left-color: #e6a23c; background: #fffaf0; }
.layer-confirm { display: flex !important; align-items: flex-start; gap: 7px; margin: 16px 0 4px !important; line-height: 19px; cursor: pointer; }
.layer-confirm input { margin-top: 3px; }
.layer-grid { display: grid; gap: 0 14px; }
.layer-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.strategy-editor-layer { display: flex !important; overflow: hidden; flex-direction: column; }
.strategy-editor-layer .layui-layer-title { flex: 0 0 42px; box-sizing: border-box; }
.strategy-editor-layer .layui-layer-content { flex: 1 1 0; overflow-y: auto; min-height: 0; height: auto !important; -webkit-overflow-scrolling: touch; }
.strategy-editor-layer .layui-layer-btn { position: static; display: flex; flex: 0 0 auto; justify-content: flex-end; box-sizing: border-box; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.strategy-editor-layer .layui-layer-btn a { min-width: 88px; margin-top: 0; text-align: center; }
.strategy-editor-layer .strategy-layer-form { padding-bottom: 10px; }
.strategy-field-hint { margin-left: 6px; color: #98a2b3; font-size: 10px; font-weight: 400; }
.upper-input { text-transform: uppercase; }
.strategy-pair-label-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.layer-grid .strategy-pair-label-row > label { margin-right: 0; }
.strategy-pair-paste-button { height: 25px; margin: 8px 0 4px; padding: 0 9px; border: 1px solid #9edfd5; border-radius: 2px; background: #f4fbf9; color: #087a6d; font-size: 11px; line-height: 23px; cursor: pointer; }
.strategy-pair-paste-button:hover { border-color: #009688; background: #e9f8f5; color: #006b61; }
.strategy-pair-paste-layer .layui-layer-content { overflow: visible; }
.strategy-pair-paste-layer .layui-layer-btn { position: static; display: flex; justify-content: flex-end; box-sizing: border-box; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.strategy-pair-paste-layer .layui-layer-btn a { min-width: 88px; margin-top: 0; text-align: center; }
.strategy-pair-paste-form { padding: 16px 18px 14px; }
.strategy-pair-paste-form label { display: block; margin-bottom: 7px; color: #526075; font-size: 12px; }
.strategy-pair-paste-form .layui-input { height: 38px; border-color: #dfe5ec; font-weight: 700; }
.strategy-pair-paste-form p { margin: 8px 0 0; color: #7b8493; font-size: 10px; line-height: 17px; }
.strategy-level-title { margin: 17px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #edf0f4; color: #176b61; font-weight: 700; }
.strategy-level-title small { margin-left: 7px; color: #98a2b3; font-weight: 400; }
.strategy-level-grid { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 7px 10px; }
.strategy-level-grid b { color: #009688; text-align: center; }
.strategy-level-grid span { color: #98a2b3; font-size: 11px; }
.exits-grid { grid-template-columns: 38px minmax(0, 1fr) 70px; }
.server-ip-value { display: inline-block; margin: 0 3px; padding: 1px 7px; border: 1px solid #9ddfd5; background: #edfaf7; color: #087a6d; font-weight: 700; }
.strategy-leverage-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.layer-grid .strategy-leverage-choice { position: relative; margin: 0; cursor: pointer; }
.strategy-leverage-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.strategy-leverage-choice span { display: flex; align-items: center; justify-content: center; height: 34px; border: 1px solid #dfe5ec; background: #fff; color: #526075; font-size: 12px; transition: .15s ease; }
.strategy-leverage-choice:hover span { border-color: #7bcfc3; color: #087a6d; }
.strategy-leverage-choice input:checked + span { border-color: #009688; background: #e9f8f5; color: #007d71; font-weight: 700; box-shadow: inset 0 0 0 1px #009688; }
.strategy-leverage-choice.high-risk span { color: #c8372b; }
.strategy-leverage-choice.high-risk input:checked + span { border-color: #e6a23c; background: #fff7e6; color: #b35b00; box-shadow: inset 0 0 0 1px #e6a23c; }
.strategy-midline-preview { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(185px, auto) minmax(170px, 1fr) minmax(330px, auto); align-items: center; gap: 18px; min-height: 48px; margin-top: 14px; padding: 9px 12px; border: 1px solid #d9eee9; border-left: 3px solid #009688; background: #f4fbf9; }
.strategy-deviation-primary { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.strategy-deviation-primary span { color: #526075; font-size: 12px; white-space: nowrap; }
.strategy-deviation-primary strong { color: #e74c3c; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.strategy-reference-values { display: flex; align-items: baseline; justify-content: flex-end; gap: 24px; min-width: 0; color: #171c26; font-size: 13px; }
.strategy-reference-values span { white-space: nowrap; }
.strategy-reference-values b { margin-left: 7px; color: #171c26; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.strategy-midline-preview > small { color: #7b8493; font-size: 11px; text-align: center; }
.strategy-direction-hint { margin: 14px 0 8px; padding: 8px 11px; border: 1px solid #d9eee9; background: #f4fbf9; color: #526075; font-size: 11px; line-height: 18px; }
.strategy-stage-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.strategy-stage-panel { overflow: hidden; border: 1px solid #dfe5ec; border-radius: 3px; background: #fff; }
.strategy-stage-heading, .strategy-stage-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1.08fr); align-items: center; gap: 10px; padding: 8px; }
.strategy-stage-heading { min-height: 20px; border-bottom: 1px solid #dfe5ec; background: #f7f9fb; color: #526075; font-size: 10px; }
.strategy-stage-row + .strategy-stage-row { border-top: 1px solid #edf0f4; }
.strategy-stage-row b { color: #008f82; font-size: 12px; white-space: nowrap; }
.exit-stage-panel .strategy-stage-row b { color: #d94355; }
.strategy-value-input { position: relative; display: block; margin: 0 !important; }
.strategy-value-input .layui-input { width: 100%; padding-right: 28px; }
.strategy-value-input i { position: absolute; top: 0; right: 10px; color: #7b8493; font-size: 11px; font-style: normal; line-height: 34px; pointer-events: none; }
.strategy-setting-input { position: relative; display: block; margin: 0 !important; }
.strategy-setting-input .layui-input { padding-right: 30px; }
.strategy-setting-input i { position: absolute; top: 0; right: 10px; color: #7b8493; font-size: 11px; font-style: normal; line-height: 34px; pointer-events: none; }
.strategy-stage-row.locked { background: #f6f7f9; opacity: .7; }
.strategy-stage-row.locked .layui-input { cursor: not-allowed; }
.strategy-manual-note { margin: 8px 1px 2px; color: #7b8493; font-size: 10px; line-height: 18px; }
.strategy-settings-form { padding-bottom: 16px; }
.strategy-setting-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px; border: 1px solid #dfe5ec; border-radius: 4px; background: #fff; }
.strategy-setting-item.vertical { align-items: flex-end; }
.strategy-setting-item strong { color: #172033; font-size: 13px; }
.strategy-setting-item p { margin: 5px 0 0; color: #7b8493; font-size: 11px; line-height: 18px; }
.strategy-setting-toggle { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; margin: 0 !important; color: #526075; font-size: 12px; cursor: pointer; white-space: nowrap; }
.strategy-setting-toggle input { display: inline-block; width: 17px; height: 17px; margin: 0; accent-color: #009688; cursor: pointer; }
.strategy-settings-number { position: relative; display: block; flex: 0 0 130px; margin: 0 !important; }
.strategy-settings-number .layui-input { padding-right: 32px; text-align: center; }
.strategy-settings-number i { position: absolute; top: 0; right: 10px; color: #7b8493; font-size: 11px; font-style: normal; line-height: 34px; pointer-events: none; }
.strategy-settings-current { margin: 12px 2px 0; color: #667085; font-size: 11px; }
.strategy-settings-current span { color: #087a6d; font-weight: 700; }
html[data-theme="dark"] .security-tip strong, html[data-theme="dark"] .strategy-tip strong,
html[data-theme="dark"] .strategy-level-title { color: #73dbcc; }
html[data-theme="dark"] .layer-form { color: #d6deea; }
html[data-theme="dark"] .layer-form > label, html[data-theme="dark"] .layer-grid label { color: #aeb8c8; }
html[data-theme="dark"] .layer-form .layui-input { border-color: #334158; background: #101827; color: #e7edf6; }
html[data-theme="dark"] .strategy-pair-paste-button { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .strategy-pair-paste-button:hover { border-color: #16baaa; background: #1a453e; color: #8cebdd; }
html[data-theme="dark"] .strategy-pair-paste-form label { color: #aeb8c8; }
html[data-theme="dark"] .strategy-pair-paste-form .layui-input { border-color: #334158; background: #101827; color: #e7edf6; }
html[data-theme="dark"] .strategy-pair-paste-form p { color: #91a0b5; }
html[data-theme="dark"] .layer-form-note { border-color: #28685e; background: #122d29; color: #9bb9b4; }
html[data-theme="dark"] .layer-form-note.warning-note { border-color: #805d20; background: #302817; color: #d5bd8d; }
html[data-theme="dark"] .mode-badge { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .status-badge.waiting, html[data-theme="dark"] .strategy-status.paused { background: #26334a; color: #b9c6d8; }
html[data-theme="dark"] .status-badge.error, html[data-theme="dark"] .strategy-status.error { background: #3c2026; color: #ff9690; }
html[data-theme="dark"] .strategy-level-title { border-color: #334158; }
html[data-theme="dark"] .server-ip-value { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .strategy-leverage-choice span { border-color: #334158; background: #101827; color: #b9c6d8; }
html[data-theme="dark"] .strategy-leverage-choice:hover span { border-color: #438b80; color: #73dbcc; }
html[data-theme="dark"] .strategy-leverage-choice input:checked + span { border-color: #16baaa; background: #153a34; color: #69dfcf; box-shadow: inset 0 0 0 1px #16baaa; }
html[data-theme="dark"] .strategy-leverage-choice.high-risk span { color: #ff9690; }
html[data-theme="dark"] .strategy-leverage-choice.high-risk input:checked + span { border-color: #b77b2d; background: #382916; color: #ffc46b; box-shadow: inset 0 0 0 1px #b77b2d; }
html[data-theme="dark"] .strategy-midline-preview { border-color: #28554e; border-left-color: #16baaa; background: #122d29; }
html[data-theme="dark"] .strategy-deviation-primary span { color: #aeb8c8; }
html[data-theme="dark"] .strategy-deviation-primary strong { color: #ff746d; }
html[data-theme="dark"] .strategy-reference-values, html[data-theme="dark"] .strategy-reference-values b { color: #edf3fa; }
html[data-theme="dark"] .strategy-midline-preview > small { color: #91a0b5; }
html[data-theme="dark"] .strategy-direction-hint { border-color: #28554e; background: #122d29; color: #9bb9b4; }
html[data-theme="dark"] .strategy-stage-panel { border-color: #334158; background: #101827; }
html[data-theme="dark"] .strategy-stage-heading { border-color: #334158; background: #172132; color: #9eacc0; }
html[data-theme="dark"] .strategy-stage-row + .strategy-stage-row { border-color: #26354a; }
html[data-theme="dark"] .strategy-stage-row b { color: #69dfcf; }
html[data-theme="dark"] .exit-stage-panel .strategy-stage-row b { color: #ff8998; }
html[data-theme="dark"] .strategy-value-input i, html[data-theme="dark"] .strategy-manual-note { color: #91a0b5; }
html[data-theme="dark"] .strategy-card { border-color: #334158; border-top-color: #1abc9c; background: #101827; box-shadow: 0 5px 18px rgba(0,0,0,.25); color: #d6deea; }
html[data-theme="dark"] .strategy-card-header, html[data-theme="dark"] .strategy-card-actions { border-color: #26354a; background: #172132; }
html[data-theme="dark"] .strategy-card-header strong { color: #edf3fa; }
html[data-theme="dark"] .strategy-card-quote, html[data-theme="dark"] .strategy-card-quote > div { border-color: #26354a; background: #101827; }
html[data-theme="dark"] .strategy-card-direction-row, html[data-theme="dark"] .strategy-card-metrics, html[data-theme="dark"] .strategy-card-metrics > div { border-color: #26354a; }
html[data-theme="dark"] .strategy-card-metrics dd { color: #d6deea; }
html[data-theme="dark"] .strategy-card-stage-pair, html[data-theme="dark"] .strategy-card-stage + .strategy-card-stage, html[data-theme="dark"] .strategy-card-funding { border-color: #26354a; }
html[data-theme="dark"] .strategy-card-funding { background: #111b2a; }
html[data-theme="dark"] .strategy-card-funding > div, html[data-theme="dark"] .strategy-card-funding > small { color: #9eacc0; }
html[data-theme="dark"] .strategy-card-funding > div strong { color: #d6deea; }
html[data-theme="dark"] .strategy-stage-line { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .strategy-stage-line.exit { border-color: #6e3337; background: #3c2026; color: #ff9690; }
html[data-theme="dark"] .strategy-stage-chip { border-color: #28685e; background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .strategy-stage-chip.exit { border-color: #6e3337; background: #3c2026; color: #ff9690; }
html[data-theme="dark"] .strategy-card-button { border-color: #42516a; background: #101827; color: #b9c6d8; }
html[data-theme="dark"] .strategy-setting-input i { color: #91a0b5; }
html[data-theme="dark"] .strategy-stage-row.locked { background: #172132; }
html[data-theme="dark"] .strategy-setting-item { border-color: #334158; background: #101827; }
html[data-theme="dark"] .strategy-setting-item strong { color: #edf3fa; }
html[data-theme="dark"] .strategy-setting-item p, html[data-theme="dark"] .strategy-setting-toggle, html[data-theme="dark"] .strategy-settings-current { color: #9eacc0; }
html[data-theme="dark"] .strategy-settings-current span { color: #69dfcf; }

@media (max-width: 1100px) {
    .rate-query-form { flex-wrap: wrap; }
    .rate-periods { margin-left: 0; }
    .chart-card-header { align-items: flex-start; flex-direction: column; }
    .chart-summary { justify-content: flex-start; }
    .strategy-stage-panels { grid-template-columns: 1fr; }
    .position-history-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .rate-query-form .field-group { flex: 1 1 120px; min-width: 120px; }
    .rate-divider { display: none; }
    .rate-query-actions { width: 100%; }
    .rate-query-actions .layui-btn { flex: 1; }
    .rate-search-button { width: auto; }
    .rate-periods { width: 100%; }
    .period-button { flex: 1; min-width: 0; padding: 0 5px; }
    .rate-explain-card { align-items: flex-start; }
    .rate-chart { height: 270px; overflow-x: auto; }
    .rate-chart-svg { min-width: 620px; }
    .chart-card-footer { flex-wrap: wrap; }
    .chart-footnote { width: 100%; margin-left: 0; }
    .square-tip { align-items: flex-start; flex-direction: column; gap: 4px; }
    .security-tip, .strategy-tip { align-items: flex-start; flex-direction: column; gap: 4px; }
    .layer-grid.two-columns { grid-template-columns: 1fr; }
    .strategy-leverage-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .strategy-midline-preview { grid-template-columns: 1fr; gap: 4px; }
    .strategy-reference-values { justify-content: flex-start; flex-wrap: wrap; gap: 4px 18px; }
    .strategy-midline-preview > small { text-align: left; }
    .strategy-stage-heading, .strategy-stage-row { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 7px 6px; }
    .strategy-stage-heading { font-size: 9px; }
    .strategy-card-grid { grid-template-columns: 1fr; }
    .strategy-card { width: 100%; max-width: none; }
    .strategy-setting-item, .strategy-setting-item.vertical { align-items: flex-start; flex-direction: column; gap: 10px; }
    .strategy-settings-number { flex-basis: auto; width: 150px; }
    .position-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .position-history-summary > div { padding: 9px 10px; }
    .position-history-summary strong { font-size: 14px; }
}
.heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mobile-data-panel { display: none; }
.hedge-mobile .desktop-data-panel { display: none; }
.hedge-mobile .mobile-data-panel { display: block; }
.mobile-data-list { display: grid; gap: 10px; }
.mobile-data-loading, .mobile-data-empty { padding: 46px 15px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); text-align: center; }
.mobile-data-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: 0 3px 12px rgba(23,32,51,.05); }
.mobile-data-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.mobile-data-card-header strong { color: var(--ink); font-size: 14px; }
.mobile-data-card-header small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.mobile-data-card-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 99px; background: #eaf8f5; color: #087a6d; font-size: 10px; }
.mobile-data-card-main { padding: 4px 11px; }
.mobile-data-row { display: grid; grid-template-columns: minmax(78px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 10px; min-height: 31px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 11px; line-height: 17px; }
.mobile-data-row:last-child { border-bottom: 0; }
.mobile-data-row > span:first-child { color: var(--muted); }
.mobile-data-row > span:last-child { overflow-wrap: anywhere; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.mobile-data-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.mobile-data-split > div { padding: 9px 10px; background: var(--paper); text-align: center; }
.mobile-data-split small, .mobile-data-split b, .mobile-data-split > div > span { display: block; }
.mobile-data-split small { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.mobile-data-split b { font-size: 12px; font-variant-numeric: tabular-nums; }
.mobile-data-card-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 7px; padding: 9px 10px; border-top: 1px solid var(--line); background: #fafbfc; }
.mobile-data-card-actions .layui-btn { height: 34px; margin: 0; padding: 0 8px; line-height: 34px; font-size: 11px; }
.mobile-data-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.mobile-data-pager span { color: var(--muted); font-size: 11px; }
.mobile-data-pager button { min-width: 78px; height: 34px; border: 1px solid #dfe5ec; border-radius: 3px; background: var(--paper); color: var(--ink); }
.mobile-data-pager button:disabled { opacity: .45; }
html[data-theme="dark"] .mobile-data-card-header, html[data-theme="dark"] .mobile-data-card-actions { background: #172132; }
html[data-theme="dark"] .mobile-data-card-badge { background: #153a34; color: #69dfcf; }
html[data-theme="dark"] .mobile-data-pager button { border-color: #334158; }

/* 对冲账号的手机入口：后端接口不变，只切换为触摸友好的展示层。 */
.hedge-mobile-nav { display: none; }
@media (max-width: 1200px) {
    .hedge-mobile { --mobile-nav-height: 58px; }
    .hedge-mobile .desktop-data-panel { display: none; }
    .hedge-mobile .mobile-data-panel { display: block; }
    .hedge-mobile .admin-header.topbar { height: 54px; padding: 0 9px; gap: 8px; }
    .hedge-mobile .sidebar-toggle { width: 34px; flex: 0 0 34px; }
    .hedge-mobile .header-title { flex: 1; min-width: 0; }
    .hedge-mobile .header-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
    .hedge-mobile .header-title span, .hedge-mobile .header-market-strip,
    .hedge-mobile .account-name { display: none; }
    .hedge-mobile .theme-picker > span { display: none; }
    .hedge-mobile .theme-select { width: 62px; padding: 0 18px 0 5px; }
    .hedge-mobile .account-area { margin-left: 0; }
    .hedge-mobile .link-button { min-width: 42px; min-height: 34px; }
    .hedge-mobile.app-page .page-container { margin-left: 0; padding: 66px 9px calc(var(--mobile-nav-height) + 20px); }
    .hedge-mobile .page-heading { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 11px; }
    .hedge-mobile .page-heading h1 { margin: 2px 0 4px; font-size: 20px; }
    .hedge-mobile .page-heading p { font-size: 11px; line-height: 18px; }
    .hedge-mobile .heading-actions { width: 100%; justify-content: space-between; gap: 7px; }
    .hedge-mobile .heading-actions .layui-btn { flex: 1; margin: 0; }
    .hedge-mobile .status-card { width: 100%; min-width: 0; padding: 8px 10px; }
    .hedge-mobile .simple-card { padding: 10px; }
    .hedge-mobile .security-tip, .hedge-mobile .strategy-tip,
    .hedge-mobile .square-tip, .hedge-mobile .rate-explain-card { font-size: 11px; line-height: 18px; }
    .hedge-mobile .filter-card { padding: 9px; }
    .hedge-mobile .filter-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .hedge-mobile .field-group, .hedge-mobile .field-group.wide-field { min-width: 0; width: auto; }
    .hedge-mobile .filter-actions { grid-column: 1 / -1; width: 100%; }
    .hedge-mobile .filter-actions .layui-btn { flex: 1; margin: 0; }
    .hedge-mobile .recommendation-scan-summary { grid-column: 1 / -1; }
    .hedge-mobile .recommendation-rules { display: flex; overflow-x: auto; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
    .hedge-mobile .recommendation-method-note { margin: 8px 0; font-size: 10px; line-height: 16px; }
    .hedge-mobile .rate-query-form { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
    .hedge-mobile .rate-query-form .field-group { min-width: 0; }
    .hedge-mobile .rate-query-actions, .hedge-mobile .rate-periods { grid-column: 1 / -1; width: 100%; }
    .hedge-mobile .chart-card { margin-top: 10px; }
    .hedge-mobile .chart-card-header { padding: 10px; }
    .hedge-mobile .chart-card-title h2 { font-size: 15px; }
    .hedge-mobile .chart-summary { gap: 7px 12px; padding: 8px 10px; font-size: 10px; }
    .hedge-mobile .rate-chart { height: 250px; }
    .hedge-mobile .rate-chart { overflow: hidden; }
    .hedge-mobile .rate-chart-svg { width: 100%; min-width: 0; }
    .hedge-mobile .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hedge-mobile .table-card > .layui-table-view { min-width: 720px; }
    .hedge-mobile .rate-table-card > .layui-table-view { min-width: 540px; }
    .hedge-mobile .recommendation-table-card > .layui-table-view { min-width: 980px; }
    .hedge-mobile .trading-table-card > .layui-table-view { min-width: 920px; }
    .hedge-mobile[data-page="hedge-positions"] .trading-table-card > .layui-table-view { min-width: 685px; }
    .hedge-mobile .table-legend { min-width: 100%; padding: 7px 9px; font-size: 10px; }
    .hedge-mobile .strategy-card-grid { grid-template-columns: 1fr; gap: 9px; }
    .hedge-mobile .strategy-card { width: 100%; max-width: none; }
    .hedge-mobile .strategy-card-header { padding: 10px; }
    .hedge-mobile .strategy-card-stage { padding: 7px 6px; }
    .hedge-mobile .strategy-card-funding { padding: 8px 9px; }
    .hedge-mobile .strategy-card-funding time { right: 9px; }
    .hedge-mobile .strategy-card-actions { position: sticky; bottom: var(--mobile-nav-height); }
    .hedge-mobile .strategy-card-button { min-height: 34px; font-size: 11px; }
    .hedge-mobile .layui-layer { max-width: calc(100vw - 12px) !important; left: 6px !important; }
    .hedge-mobile .layui-layer-content { max-height: calc(100vh - 145px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .hedge-mobile .layui-layer-page .layui-layer-btn { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; padding: 9px 10px; border-top: 1px solid var(--line); background: var(--paper); }
    .hedge-mobile .layui-layer-page .layui-layer-btn a { min-width: 88px; height: 36px; margin: 0 0 0 8px; line-height: 36px; }
    .hedge-mobile .layer-form { padding: 10px 10px 66px; }
    .hedge-mobile .strategy-editor-layer { position: fixed !important; top: 6px !important; bottom: 6px !important; bottom: calc(6px + env(safe-area-inset-bottom)) !important; display: flex !important; overflow: hidden; flex-direction: column; height: auto !important; max-height: none !important; }
    .hedge-mobile .strategy-editor-layer .layui-layer-title { flex: 0 0 42px; box-sizing: border-box; }
    .hedge-mobile .strategy-editor-layer .layui-layer-content { flex: 1 1 0; overflow-y: auto; min-height: 0; height: auto !important; max-height: none; -webkit-overflow-scrolling: touch; }
    .hedge-mobile .strategy-editor-layer .layui-layer-btn { position: static; display: flex; flex: 0 0 auto; justify-content: flex-end; box-sizing: border-box; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
    .hedge-mobile .strategy-editor-layer .layui-layer-btn a { flex: 1; box-sizing: border-box; margin: 0 0 0 8px; text-align: center; }
    .hedge-mobile .strategy-editor-layer .layui-layer-btn a:first-child { margin-left: 0; }
    .hedge-mobile .strategy-editor-layer .strategy-layer-form { padding-bottom: 10px; }
    .hedge-mobile .strategy-pair-paste-layer { top: 24px !important; right: 10px !important; left: 10px !important; width: auto !important; max-width: none !important; height: auto !important; }
    .hedge-mobile .strategy-pair-paste-layer .layui-layer-content { height: auto !important; max-height: none; overflow: visible; }
    .hedge-mobile .strategy-pair-paste-layer .layui-layer-btn { position: static; display: flex; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
    .hedge-mobile .strategy-pair-paste-layer .layui-layer-btn a { flex: 1; box-sizing: border-box; min-width: 0; margin: 0 0 0 8px; text-align: center; }
    .hedge-mobile .strategy-pair-paste-layer .layui-layer-btn a:first-child { margin-left: 0; }
    .hedge-mobile .strategy-pair-paste-form { padding: 13px 12px; }
    .hedge-mobile .layer-grid.two-columns, .hedge-mobile .strategy-stage-panels { grid-template-columns: 1fr; }
    .hedge-mobile .strategy-leverage-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hedge-mobile .strategy-stage-heading, .hedge-mobile .strategy-stage-row { grid-template-columns: 66px minmax(0, 1fr) minmax(0, 1fr); gap: 5px; padding: 6px 5px; }
    .hedge-mobile-nav { position: fixed; z-index: 1200; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(6, 1fr); height: var(--mobile-nav-height); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -5px 18px rgba(23,32,51,.09); backdrop-filter: blur(9px); }
    .hedge-mobile-nav a { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; color: #7b8493; font-size: 10px; }
    .hedge-mobile-nav a i { font-size: 17px; font-style: normal; line-height: 20px; }
    .hedge-mobile-nav a.active { color: #009688; font-weight: 700; }
    html[data-theme="dark"] .hedge-mobile-nav { border-color: #273449; background: rgba(16,24,39,.97); box-shadow: 0 -5px 18px rgba(0,0,0,.3); }
}

@media (max-width: 380px) {
    .hedge-mobile .strategy-stage-line { grid-template-columns: 19px minmax(0, .9fr) minmax(0, 1.1fr); padding: 2px; font-size: 8px; }
    .hedge-mobile .strategy-card-funding > small { padding-right: 0; flex-direction: column; align-items: flex-start; }
    .hedge-mobile .strategy-card-funding time { position: static; display: block; margin-top: 4px; }
}
