/* ==========================================
   1. 全局变量与基础重置
   ========================================== */
:root { 
    --primary-color: #1677ff; 
    --success-color: #52c41a;
    --error-color: #ff4d4f;
    --warning-color: #faad14;
    --bg-color: #f0f2f5; 
    --sidebar-bg: #001529; 
    --shadow: 0 4px 12px rgba(0,0,0,0.08); 
}

.dividend-detection {
    padding: 14px 16px 16px;
}

.dividend-detection-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.dividend-detection-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #5f6b7a;
    font-size: 13px;
}

.dividend-detection-summary span {
    white-space: nowrap;
}

.dividend-detection-summary strong {
    color: #111827;
    font-weight: 800;
}

.dividend-detection-controlbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #e5eaf0;
    border-radius: 8px;
    background: #fbfdff;
}

.dividend-detection-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #5f6b7a;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.dividend-detection-checks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dividend-detection-checks label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.dividend-detection-checks input {
    margin: 0;
}

.dividend-detection-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.dividend-detection-actions button {
    height: 32px;
    white-space: nowrap;
}

.dividend-detection-table td small {
    display: block;
    margin-top: 2px;
    color: #8a94a3;
    font-size: 11px;
}

.dividend-detection-table td strong {
    display: block;
    color: #111827;
    font-weight: 850;
}

.dividend-detection-table table,
.dividend-history-table table {
    min-width: 1320px;
}

.dividend-detection-table th:nth-child(12),
.dividend-detection-table td:nth-child(12) {
    min-width: 170px;
    max-width: 260px;
}

.dividend-detection-table th:nth-child(13),
.dividend-detection-table td:nth-child(13) {
    width: 108px;
    min-width: 108px;
}

.dividend-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.dividend-status-pending {
    background: #fff1f0;
    color: #cf1322;
}

.dividend-status-completed {
    background: #f0f9eb;
    color: #237804;
}

.dividend-status-not-due {
    background: #eff6ff;
    color: #1d4ed8;
}

.dividend-status-manual {
    background: #fff7e6;
    color: #ad6800;
}

.dividend-detection-done {
    color: #7b8490;
    font-size: 12px;
    font-weight: 700;
}

.dividend-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 84px;
}

.dividend-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid #91caff;
    border-radius: 5px;
    background: #f0f7ff;
    color: #0958d9;
    font-size: 12px;
    font-weight: 750;
    line-height: 22px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dividend-action-btn:hover {
    background: #e6f4ff;
    border-color: #1677ff;
    color: #003eb3;
}

.dividend-action-done,
.dividend-action-disabled {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dividend-action-done {
    color: #237804;
}

* { box-sizing: border-box; }

body { 
    display: flex; 
    margin: 0; 
    background: var(--bg-color); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    min-height: 100vh; 
    overflow-x: hidden;
}

/* ==========================================
   2. 布局组件 (侧边栏与主主体)
   ========================================== */
.sidebar { 
    width: 220px; 
    background: var(--sidebar-bg); 
    color: white; 
    height: 100vh; 
    position: fixed; 
    z-index: 100; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar h2 { 
    font-size: 16px; 
    padding: 25px; 
    text-align: center; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    margin: 0; 
}

.sidebar nav .nav-link { 
    display: block;
    width: 100%; 
    padding: 10px 25px 10px 34px;
    background: transparent; 
    border: none; 
    color: #b8c1cc; 
    cursor: pointer; 
    text-align: left; 
    transition: all 0.3s;
    text-decoration: none;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.35;
}

.sidebar nav .nav-link:hover { 
    color: white; 
    background: rgba(255,255,255,0.1); 
}

.sidebar nav .nav-link.active {
    color: #fff;
    background: rgba(22, 119, 255, 0.28);
    border-left: 3px solid #1677ff;
    padding-left: 31px;
}

.sidebar nav .nav-link-fee-center,
.sidebar nav .nav-link-sim,
.sidebar nav .nav-link-logic-sim,
.sidebar nav .nav-link-live,
.sidebar nav .nav-link-data {
    color: #b8c1cc;
    font-weight: 400;
}

.sidebar nav .nav-link-fee-center.active,
.sidebar nav .nav-link-sim.active,
.sidebar nav .nav-link-logic-sim.active,
.sidebar nav .nav-link-live.active,
.sidebar nav .nav-link-data.active {
    color: #fff;
}

.nav-menu-group {
    border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-menu-group:first-child {
    border-top: 0;
}

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    color: #e6f4ff;
    font-size: 15px;
    letter-spacing: 0;
    font-weight: 700;
    border: 0;
    background: rgba(255,255,255,0.035);
    cursor: pointer;
    text-align: left;
}

.nav-group-title::after {
    content: '›';
    color: #8ba7c4;
    font-size: 18px;
    transition: transform 0.18s ease;
}

.nav-menu-group.open .nav-group-title::after {
    transform: rotate(90deg);
}

.nav-menu-items {
    display: none;
    padding: 4px 0 8px;
}

.nav-menu-group.open .nav-menu-items {
    display: block;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.sidebar-env-panel {
    display: none;
}

.main { 
    flex: 1; 
    margin-left: 220px; 
    padding: 32px; 
    width: calc(100% - 220px); 
    max-width: calc(100vw - 220px);
    overflow-x: hidden;
}

.oms-env-switch {
    width: 100%;
    border: 1px solid #91caff;
    border-radius: 8px;
    background: #e6f4ff;
    color: #0958d9;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
}

body.oms-env-test {
    --primary-color: #d48806;
    --bg-color: #fff8e6;
}

body.oms-env-test .oms-env-switch {
    border-color: #f5c542;
    background: #fff1b8;
    color: #873800;
}

body.oms-env-test .sidebar nav .nav-link.active {
    background: rgba(250, 173, 20, 0.28);
    border-left-color: #faad14;
}

.header-action { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 24px; 
}

/* ==========================================
   3. 通用 UI 元素 (按钮、表格、标签)
   ========================================== */
.btn-primary { 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    padding: 8px 18px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 14px; 
    transition: 0.2s; 
}

.btn-primary:hover { opacity: 0.8; }

.logic-help-link {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    color: #1677ff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.logic-help-link:hover {
    text-decoration: underline;
}

.page-subtitle {
    margin: 6px 0 0;
    color: #8c8c8c;
    font-size: 13px;
}

.btn-confirm { 
    background: var(--success-color); 
    color: white; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
}

/* 通用标签 Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: #e6f7ff;
    color: var(--primary-color);
    border: 1px solid #91d5ff;
}

/* 风险等级专属配色 (本次迭代新增) */
.badge-r1 { background: #f6ffed; color: #52c41a; border-color: #b7eb8f; } /* 低风险 */
.badge-r3 { background: #fff7e6; color: #fa8c16; border-color: #ffd591; } /* 中风险 */
.badge-r5 { background: #fff1f0; color: #f5222d; border-color: #ffa39e; } /* 高风险 */

/* 客户等级 S 级专属配色 */
.badge-s { background: #fff7e6; color: #fa8c16; border-color: #ffd591; font-weight: bold; }

/* 通用数据表格 */
.table-container { 
    background: white; 
    border-radius: 10px; 
    box-shadow: var(--shadow); 
    overflow: hidden; 
}

table { width: 100%; border-collapse: collapse; table-layout: fixed; }

th, td { 
    padding: 14px 16px; 
    border-bottom: 1px solid #f0f0f0; 
    text-align: left; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    vertical-align: middle;
}

th { background: #fafafa; font-size: 13px; color: #595959; }

/* 实盘管理 - 证券账户管理 */
.live-workbar {
    align-items: flex-start;
}

.live-header-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.live-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.live-summary-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 16px 18px;
    min-width: 0;
}

.live-summary-card span {
    display: block;
    color: #8c8c8c;
    font-size: 12px;
    margin-bottom: 8px;
}

.live-summary-card strong {
    display: block;
    color: #1f2933;
    font-size: 20px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-table-container {
    overflow-x: auto;
}

.live-security-account-table {
    min-width: 1320px;
    table-layout: fixed;
}

.live-security-account-table th,
.live-security-account-table td {
    font-size: 12px;
    white-space: normal;
    vertical-align: top;
}

.live-security-account-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #1d39c4;
    background: #f0f5ff;
    border-radius: 4px;
    padding: 2px 5px;
}

.live-security-account-table small {
    display: block;
    margin-top: 4px;
    color: #8c8c8c;
    line-height: 1.35;
}

.live-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.live-row-actions button {
    border: 1px solid #d9e6ff;
    background: #f7fbff;
    color: #1677ff;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.live-row-actions button:hover {
    border-color: #1677ff;
}

.live-status-active {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.live-status-disabled {
    background: #f5f5f5;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

.live-status-running {
    background: #e6f4ff;
    color: #0958d9;
    border: 1px solid #91caff;
}

.live-status-pending {
    background: #fffbe6;
    color: #d48806;
    border: 1px solid #ffe58f;
}

.live-status-danger {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}

.live-logic-card-list {
    display: block;
}

.live-account-modal {
    max-width: 860px;
}

.live-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.live-placeholder-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 18px 20px;
    border-top: 3px solid #1677ff;
}

.live-placeholder-card h4 {
    margin: 0 0 10px;
    color: #1f2933;
    font-size: 15px;
}

.live-placeholder-card p {
    margin: 0;
    color: #595959;
    font-size: 13px;
    line-height: 1.7;
}

.live-placeholder-card code,
.live-command-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f0f5ff;
    color: #1d39c4;
    border-radius: 4px;
    padding: 2px 5px;
}

.live-planning-table,
.live-command-table {
    min-width: 900px;
    table-layout: fixed;
}

.live-planning-table th,
.live-planning-table td,
.live-command-table th,
.live-command-table td {
    white-space: normal;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.6;
}

.live-command-table th:nth-child(1),
.live-command-table td:nth-child(1) {
    width: 150px;
}

.live-command-table th:nth-child(3),
.live-command-table td:nth-child(3) {
    width: 38%;
}

.live-command-param {
    padding: 2px 0;
    color: #434343;
}

.live-warning-box {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #8c6d1f;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

/* 模拟盘 - 通栏卡片与 Tab 子功能区 */
.sim-card-list { display: flex; flex-direction: column; gap: 16px; }

.sim-product-card {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    padding: 20px 24px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.sim-product-card:hover { box-shadow: 0 4px 16px rgba(22, 119, 255, 0.12); }
.sim-product-card.active {
    background: #f0f7ff;
    border-color: #91caff;
    box-shadow: 0 2px 12px rgba(22, 119, 255, 0.1);
}

.sim-card-main { flex: 1; min-width: 240px; }
.sim-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-card-meta {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr 1fr 0.95fr 1.1fr;
    gap: 8px 20px;
    font-size: 13px;
    color: #595959;
    align-items: start;
}

.sim-card-meta .sim-meta-item { min-width: 0; }
.sim-card-meta .sim-meta-error { grid-column: 1 / -1; }

.sim-card-meta .label { color: #8c8c8c; display: block; font-size: 12px; margin-bottom: 4px; }
.sim-card-meta .value {
    font-weight: 500;
    color: #262626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sim-card-meta .value code {
    font-size: 12px;
}
.sim-card-meta .value.return-up { color: #cf1322; font-weight: 700; }
.sim-card-meta .value.return-down { color: #389e0d; font-weight: 700; }
.return-up { color: #cf1322 !important; font-weight: 800; }
.return-down { color: #389e0d !important; font-weight: 800; }
.return-flat { color: #262626 !important; font-weight: 800; }

.sim-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sim-card-actions .btn-primary { padding: 6px 14px; font-size: 13px; }
.sim-btn-muted { background: #8c8c8c !important; }
.sim-btn-danger { background: #ff4d4f !important; }
.sim-btn-warning { background: #d48806 !important; }

.sim-empty-hint {
    text-align: center;
    padding: 48px 24px;
    color: #999;
    background: #fafafa;
    border-radius: 12px;
    border: 1px dashed #d9d9d9;
}

.sim-detail-panel {
    margin-top: 0;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.sim-detail-head { padding: 16px 24px 0; }
.sim-detail-head h4 { margin: 0; font-size: 16px; color: #262626; }

.sim-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.sim-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #595959;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.sim-tab:hover { color: var(--primary-color); }
.sim-tab.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
    background: #fff;
}

.sim-tab-pane { display: none; padding: 20px 24px 24px; }
.sim-tab-pane.active { display: block; }

.sim-tab-hint { color: #8c8c8c; font-size: 13px; margin: 0 0 16px 0; }

.sim-toolbar-btn { padding: 6px 12px !important; font-size: 13px !important; }

/* 模拟盘 - 收益率曲线 */
.sim-return-chart-wrap { height: 420px; padding: 12px 0 8px; }

/* 成交明细：与持仓列表一致的紧凑布局 */
.sim-orders-pane { padding: 8px 14px 10px !important; }
.sim-orders-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.sim-orders-toolbar label { font-size: 11px; color: #595959; }
.sim-order-month-input {
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}
.sim-orders-hint {
    color: #8c8c8c;
    font-size: 11px;
    margin-left: 4px;
}
.sim-pager-btn {
    padding: 2px 10px;
    font-size: 11px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    color: #262626;
}
.sim-pager-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.sim-orders-table-wrap { margin: 0; }
.sim-orders-table {
    table-layout: fixed;
    width: 100%;
    font-size: 12px;
}
.sim-orders-table th,
.sim-orders-table td {
    padding: 3px 6px;
    line-height: 1.35;
    vertical-align: middle;
}
.sim-orders-table th {
    font-size: 11px;
    font-weight: 600;
    color: #595959;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.sim-orders-table .col-time {
    width: 26%;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
}
.sim-orders-table .col-code { width: 16%; white-space: nowrap; }
.sim-orders-table .col-code code { font-size: 11px; }
.sim-orders-table .col-name { width: 22%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-orders-table .col-side { width: 10%; text-align: center; white-space: nowrap; }
.sim-orders-table .col-qty { width: 13%; text-align: right; white-space: nowrap; }
.sim-orders-table .col-price { width: 13%; text-align: right; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.sim-orders-empty { text-align: center; padding: 16px; color: #999; font-size: 12px; }

/* 持仓列表：紧凑布局 */
.sim-positions-pane { padding: 8px 14px 10px !important; }
.sim-positions-hint {
    color: #8c8c8c;
    font-size: 11px;
    margin: 0 0 6px 0;
    line-height: 1.4;
}
.sim-positions-table-wrap { margin: 0; overflow-x: auto; }
.sim-positions-table {
    table-layout: fixed;
    width: 100%;
    font-size: 12px;
}
.sim-positions-table th,
.sim-positions-table td {
    padding: 3px 6px;
    line-height: 1.35;
    vertical-align: middle;
}
.sim-positions-table th {
    font-size: 11px;
    font-weight: 600;
    color: #595959;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.sim-positions-table .col-name { width: 14%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-positions-table .col-code { width: 11%; white-space: nowrap; }
.sim-positions-table .col-code code { font-size: 11px; }
.sim-positions-table .col-qty { width: 8%; text-align: right; white-space: nowrap; }
.sim-positions-table .col-val { width: 11%; text-align: right; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.sim-positions-table .col-price { width: 9%; text-align: right; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.sim-positions-table .col-cost { width: 9%; text-align: right; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.sim-positions-table .col-pl-val { width: 11%; text-align: right; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.sim-positions-table .col-pl-ratio { width: 9%; text-align: right; white-space: nowrap; }
.sim-positions-table td.pl-bg-up { background: #fff1f0; }
.sim-positions-table td.pl-bg-down { background: #f6ffed; }
.sim-positions-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: #595959;
}
.sim-positions-pager button {
    padding: 2px 10px;
    font-size: 11px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    color: #262626;
}
.sim-positions-pager button:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.sim-positions-pager button:disabled { opacity: 0.45; cursor: not-allowed; }
.sim-positions-empty { text-align: center; padding: 16px; color: #999; font-size: 12px; }
.logic-position-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.logic-position-summary strong {
    color: #111827;
    font-size: 15px;
}

.logic-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.logic-section { min-width: 0; }
.logic-section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 0 10px; }
.logic-section-head h4 { margin: 0; font-size: 15px; color: #262626; }
.logic-section-head span { color: #8c8c8c; font-size: 12px; }
.logic-card-list { display: flex; flex-direction: column; gap: 12px; }
.logic-workbar {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
}
.logic-title-block h3 {
    margin-bottom: 6px;
}
.logic-page-subtitle {
    color: #7b8490;
    font-size: 13px;
    margin-bottom: 8px;
}
.logic-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.logic-auto-panel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 6px 0 10px;
    border: 1px solid #d6e4ff;
    border-radius: 6px;
    background: #f7fbff;
    color: #262626;
}
.logic-auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #262626;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.logic-auto-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}
.logic-auto-knob {
    position: relative;
    width: 30px;
    height: 16px;
    border-radius: 999px;
    background: #bfbfbf;
    transition: background 0.18s ease;
}
.logic-auto-knob:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.22);
    transition: transform 0.18s ease;
}
.logic-auto-toggle input:checked + .logic-auto-knob {
    background: #1677ff;
}
.logic-auto-toggle input:checked + .logic-auto-knob:before {
    transform: translateX(14px);
}
.logic-auto-status {
    min-width: 92px;
    color: #595959;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}
.logic-auto-now {
    height: 24px;
    padding: 0 9px;
    border: 0;
    border-radius: 4px;
    background: #e6f4ff;
    color: #0958d9;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.logic-auto-now:hover {
    background: #bae0ff;
}
.logic-test-banner {
    width: 100%;
    overflow: hidden;
    margin: 0 0 14px;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    background: #fff7d6;
    color: #ad6800;
    font-size: 16px;
    font-weight: 700;
    line-height: 44px;
}
.logic-test-marquee {
    display: inline-block;
    min-width: 100%;
    white-space: nowrap;
    animation: logic-test-marquee 36s linear infinite;
}
@keyframes logic-test-marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.logic-broker-group {
    background: #f4f8fb;
    border: 1px solid #c9dff2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(22, 119, 255, 0.05);
}
.logic-info-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}
.logic-broker-card {
    background: #eaf4ff;
    border: 0;
    border-bottom: 1px solid #c9dff2;
    border-radius: 0;
    cursor: default;
    padding: 18px 20px;
}
.logic-info-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.logic-child-list .logic-info-card.active {
    border-color: #faad14;
    border-left-color: #faad14;
    background: #fff7e6;
    box-shadow: 0 3px 12px rgba(250, 173, 20, 0.18);
}
.logic-child-list .logic-info-card.active .logic-row-title code {
    color: #ad6800;
    background: #fff1b8;
}
.logic-child-list {
    padding: 10px 14px 14px 32px;
    background: #f8fbfd;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.logic-child-list:before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 14px;
    width: 2px;
    background: #d9d9d9;
}
.logic-child-list .logic-info-card {
    min-height: 0;
    padding: 10px 12px;
    border-left: 3px solid #95de64;
    position: relative;
    align-items: center;
}
.logic-child-list .logic-info-card:before {
    content: "";
    position: absolute;
    left: -17px;
    top: 26px;
    width: 14px;
    height: 2px;
    background: #d9d9d9;
}
.logic-child-empty {
    color: #999;
    font-size: 13px;
    padding: 10px 0;
}
.logic-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.logic-row-title strong {
    font-size: 14px;
    color: #262626;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logic-row-title code {
    color: #1677ff;
    font-size: 12px;
    background: #eef6ff;
    padding: 2px 6px;
    border-radius: 4px;
}
.logic-child-list .logic-row-title {
    gap: 12px;
}
.logic-child-list .logic-row-title strong {
    font-size: 18px;
    font-weight: 700;
    max-width: 280px;
}
.logic-child-list .logic-row-title code {
    font-size: 18px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0;
}
.logic-run-at,
.logic-run-at-placeholder {
    width: 360px;
    flex: 0 0 360px;
}
.logic-run-at {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    color: #f5222d;
    flex-wrap: nowrap;
    white-space: nowrap;
    text-align: right;
}
.logic-run-at span {
    font-size: 14px;
    font-weight: 800;
    flex: 0 0 auto;
}
.logic-run-at strong {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}
.logic-run-at-anytime strong {
    font-size: 28px;
}
.logic-run-at-form {
    gap: 8px;
}
.logic-run-at-any {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #595959;
    font-size: 13px;
    font-weight: 600;
}
.logic-run-at-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.logic-run-at-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.logic-run-at-input-row input {
    flex: 1;
}
.logic-run-at-add,
.logic-run-at-remove {
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
}
.logic-run-at-add:disabled,
.logic-run-at-remove:disabled {
    color: #bfbfbf;
    cursor: not-allowed;
    background: #f5f5f5;
}
.logic-copy-btn {
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    line-height: 18px;
    cursor: pointer;
}
.logic-copy-btn:hover {
    border-color: #1677ff;
    color: #1677ff;
    background: #f0f7ff;
}
.logic-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 9px;
    color: #595959;
    font-size: 12px;
}
.logic-metric-strip {
    align-items: stretch;
}
.logic-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f7f9fc;
    border: 1px solid #edf1f7;
    white-space: nowrap;
}
.logic-metric em {
    color: #8c8c8c;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}
.logic-metric strong {
    color: #262626;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}
.logic-reset-modal-content {
    max-width: 820px;
    width: 92%;
}
.logic-reset-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 4px 0 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #fff7d6;
    color: #8c5b00;
    font-size: 12px;
    font-weight: 600;
}
.logic-reset-log {
    height: 420px;
    overflow: auto;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #111827;
    color: #d1d5db;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
}
.logic-reset-log-row {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.logic-reset-log-row.error {
    color: #fecaca;
}
.ledger-worker-page {
    max-width: 1680px;
    margin: 0 auto;
}
.ledger-worker-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ledger-worker-header {
    padding: 6px 0 10px;
}
.ledger-worker-header h3 {
    margin-bottom: 8px;
}
.ledger-worker-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #111827;
}
.ledger-worker-section-head strong {
    font-size: 15px;
}
.ledger-worker-section-head span {
    color: #64748b;
    font-size: 12px;
}
.ledger-worker-client-panel {
    min-height: 0;
}
.ledger-worker-client-card,
.ledger-worker-client-warning {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(320px, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
}
.ledger-worker-client-warning {
    grid-template-columns: minmax(220px, 1fr) auto;
}
.ledger-worker-client-card span,
.ledger-worker-client-warning span {
    display: block;
    margin-bottom: 4px;
    color: #a16207;
    font-size: 12px;
}
.ledger-worker-client-card strong,
.ledger-worker-client-warning strong {
    color: #78350f;
    font-size: 15px;
}
.ledger-worker-client-card small {
    display: block;
    margin-top: 4px;
    color: #92400e;
    font-size: 12px;
}
.ledger-worker-broker-select {
    width: 100%;
    height: 32px;
    border: 1px solid #f5d067;
    border-radius: 6px;
    background: #fff;
    color: #78350f;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
}
.ledger-worker-broker-error {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff1f2;
    color: #be123c;
    font-size: 12px;
}
.ledger-worker-client-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    white-space: nowrap;
}
.ledger-worker-command-details {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(245, 208, 103, 0.65);
    padding-top: 8px;
}
.ledger-worker-command-details summary {
    width: max-content;
    cursor: pointer;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    user-select: none;
}
.ledger-worker-command-details pre {
    margin: 0;
    margin-top: 8px;
    padding: 10px 12px;
    overflow: auto;
    max-height: 150px;
    border: 1px solid #f5d067;
    border-radius: 6px;
    background: #111827;
    color: #fef3c7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.55;
}
.ledger-worker-guide {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}
.ledger-worker-guide section {
    padding: 10px;
    border: 1px solid rgba(245, 208, 103, 0.7);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
}
.ledger-worker-guide h4 {
    margin: 0 0 6px;
    color: #78350f;
    font-size: 13px;
}
.ledger-worker-guide p {
    margin: 0 0 8px;
    color: #92400e;
    font-size: 12px;
    line-height: 1.6;
}
.ledger-worker-guide code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #fff7ed;
    color: #9a3412;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.ledger-worker-config-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
}
.ledger-worker-config-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}
.ledger-worker-config-grid input,
.ledger-worker-config-grid select {
    width: 100%;
    height: 32px;
    border: 1px solid #f5d067;
    border-radius: 6px;
    background: #fff;
    color: #78350f;
    padding: 0 8px;
    font-size: 13px;
}
.ledger-worker-custom-dsn {
    grid-column: 1 / -1;
}

.basic-index-header {
    align-items: flex-start;
    gap: 16px;
}

.basic-index-preview {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #f8fafc;
}

.basic-index-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.basic-index-preview-grid div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #edf1f7;
    border-radius: 6px;
    background: #fff;
}

.basic-index-preview-grid span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.basic-index-preview-grid strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ledger-worker-generator-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.ledger-worker-client-warning .btn-primary {
    justify-self: end;
}
.ledger-worker-main {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.ledger-worker-status-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.ledger-worker-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.ledger-worker-actions select {
    width: 130px;
    height: 30px;
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    background: #fff;
    color: #262626;
    padding: 0 8px;
    font-size: 12px;
}
.ledger-worker-actions .btn-primary {
    height: 30px;
    padding: 0 14px;
}
.ledger-worker-state-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    align-items: start;
}
.ledger-worker-state-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #8c8c8c;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.ledger-worker-state-card.online {
    border-left-color: #16a34a;
}
.ledger-worker-state-card.offline {
    border-left-color: #f97316;
}
.ledger-worker-state-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.ledger-worker-state-top strong {
    color: #111827;
    font-size: 15px;
}
.ledger-worker-state-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ledger-worker-state-top span,
.ledger-worker-state-badge {
    border-radius: 999px;
    padding: 2px 9px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}
.ledger-worker-state-card.online .online-badge,
.ledger-worker-state-card.online > .ledger-worker-state-top > span {
    background: #dcfce7;
    color: #166534;
}
.ledger-worker-state-card.offline .online-badge {
    background: #ffedd5;
    color: #9a3412;
}
.ledger-worker-state-card .work-badge,
.ledger-worker-state-card .work-normal {
    background: #dbeafe;
    color: #1d4ed8;
}
.ledger-worker-state-card .work-error {
    background: #fee2e2;
    color: #991b1b;
}
.ledger-worker-state-meta {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 7px 10px;
    font-size: 12px;
}
.ledger-worker-state-meta label {
    color: #6b7280;
}
.ledger-worker-state-meta b {
    color: #111827;
    font-weight: 700;
    word-break: break-word;
}
.ledger-worker-state-error {
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff1f0;
    color: #a8071a;
    font-size: 12px;
}
.ledger-worker-state-error strong,
.ledger-worker-state-error span {
    display: block;
}
.ledger-worker-error-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.ledger-worker-state-error strong {
    font-size: 13px;
    line-height: 1.45;
    min-width: 0;
}
.ledger-worker-state-error span {
    margin-top: 3px;
    color: #cf1322;
    opacity: 0.78;
}
.ledger-worker-error-head button {
    flex: 0 0 auto;
    border: 1px solid #ffccc7;
    border-radius: 999px;
    background: #fff;
    color: #a8071a;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    cursor: pointer;
}
.ledger-worker-error-head button:hover {
    border-color: #ff7875;
    background: #fff7f6;
}
.ledger-worker-empty {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #8c8c8c;
    text-align: center;
}
.ledger-worker-console-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.ledger-worker-console-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}
.ledger-worker-console-head strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
    color: #111827;
}
.ledger-worker-console-head span {
    display: block;
    color: #64748b;
    font-size: 12px;
}
.ledger-worker-console {
    height: clamp(560px, calc(100vh - 230px), 760px);
    overflow: auto;
    padding: 10px 12px;
    background: #0f172a;
    color: #dbeafe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.55;
}
.ledger-worker-log-row {
    display: grid;
    grid-template-columns: 148px 48px 150px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.ledger-worker-log-row > * {
    min-width: 0;
}
.ledger-worker-log-row span {
    color: #93c5fd;
}
.ledger-worker-log-row b {
    color: #bfdbfe;
}
.ledger-worker-log-row em {
    color: #fde68a;
    font-style: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ledger-worker-log-row strong {
    color: #e5e7eb;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
}
.ledger-worker-log-row small {
    grid-column: 4 / 5;
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    white-space: normal;
    word-break: break-word;
}
.ledger-worker-log-row.warn b,
.ledger-worker-log-row.warn strong {
    color: #fbbf24;
}
.ledger-worker-log-row.error b,
.ledger-worker-log-row.error strong {
    color: #fca5a5;
}
.qmt-gateway-console {
    height: clamp(600px, calc(100vh - 245px), 820px);
}
.qmt-gateway-log-row {
    grid-template-columns: 170px 72px 56px 170px minmax(0, 1fr);
}
.qmt-gateway-log-row span {
    color: #93c5fd;
}
.qmt-gateway-log-row i {
    color: #60a5fa;
    font-style: normal;
    font-weight: 700;
}
.qmt-gateway-log-row em {
    color: #a7f3d0;
}
.qmt-gateway-log-row strong {
    white-space: pre-wrap;
    word-break: break-word;
}
.qmt-gateway-command-panel {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.qmt-gateway-command-panel summary {
    cursor: pointer;
    padding: 12px 14px;
    color: #334155;
    font-weight: 700;
    background: #f8fafc;
}
.qmt-gateway-command-panel .table-container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
.ledger-worker-log-empty {
    padding: 22px;
    color: #94a3b8;
    text-align: center;
}

.qmt-worker-param-dict-btn {
    opacity: .82;
}

.qmt-worker-param-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3200;
    background: rgba(15, 23, 42, .48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.qmt-worker-param-modal {
    width: min(1180px, 96vw);
    max-height: 88vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .26);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.qmt-worker-param-modal-head,
.qmt-worker-param-modal-foot {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e8edf5;
}

.qmt-worker-param-modal-foot {
    border-top: 1px solid #e8edf5;
    border-bottom: none;
    justify-content: flex-end;
}

.qmt-worker-param-modal-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #13233a;
}

.qmt-worker-param-modal-head span {
    color: #7c8ca5;
    font-size: 13px;
}

.qmt-worker-param-modal-head button {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.qmt-worker-param-modal-body {
    padding: 18px 24px 24px;
    overflow: auto;
}

.qmt-worker-param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.qmt-worker-param-table th,
.qmt-worker-param-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
}

.qmt-worker-param-table th {
    color: #637083;
    font-weight: 700;
    background: #f8fafc;
    position: sticky;
    top: 0;
}

.qmt-worker-param-table code {
    font-family: Consolas, "SFMono-Regular", monospace;
    color: #0f766e;
    background: #ecfdf5;
    border-radius: 6px;
    padding: 2px 6px;
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .ledger-worker-main {
        grid-template-columns: 1fr;
    }
    .ledger-worker-state-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 420px));
    }
}
@media (max-width: 900px) {
    .ledger-worker-client-card,
    .ledger-worker-client-warning {
        grid-template-columns: 1fr;
    }
    .ledger-worker-client-actions,
    .ledger-worker-client-warning .btn-primary {
        justify-self: start;
        justify-content: flex-start;
    }
    .ledger-worker-console-head {
        align-items: stretch;
        flex-direction: column;
    }
    .ledger-worker-actions {
        justify-content: flex-start;
    }
    .ledger-worker-log-row {
        grid-template-columns: 140px 46px 1fr;
    }
    .ledger-worker-log-row strong,
    .ledger-worker-log-row small {
        grid-column: 1 / -1;
    }
    .ledger-worker-config-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
    .ledger-worker-generator-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 720px) {
    .ledger-worker-config-grid {
        grid-template-columns: 1fr;
    }
}
.logic-detail-panel {
    background: #fff;
    border: 1px solid #d9ead3;
    border-left: 3px solid #52c41a;
    border-radius: 6px;
    margin: -2px 0 8px 0;
    overflow: hidden;
}
.logic-detail-panel .sim-tab-pane,
.logic-detail-panel #logicTabContent {
    font-size: 12px;
}
.logic-detail-panel table th,
.logic-detail-panel table td {
    font-size: 12px;
    padding: 8px 10px;
}
.logic-detail-panel code {
    font-size: 11px;
}
.logic-detail-panel .sim-tab {
    font-size: 13px;
    padding: 10px 16px;
}
.logic-table-scroll {
    max-height: 360px;
    overflow: auto;
    border-top: 1px solid #f0f0f0;
}
.logic-table-scroll table {
    margin: 0;
}
.logic-pnl-ratio {
    margin-left: 6px;
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    opacity: .78;
}
.logic-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fafafa;
}
.logic-order-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 9px 12px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    color: #595959;
    font-size: 12px;
}
.logic-order-filter span {
    color: #262626;
    font-weight: 600;
}
.logic-order-filter label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 逻辑盘管理新版布局 */
.logic-card-list {
    gap: 18px;
}

.logic-broker-group {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.logic-broker-strip {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(560px, 2.2fr) auto;
    align-items: center;
    gap: 22px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.logic-broker-identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.logic-broker-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.logic-broker-title-row h4 {
    margin: 0;
    color: #1f2933;
    font-size: 18px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-broker-identity > span,
.logic-broker-identity small,
.logic-broker-metrics span {
    color: #7b8490;
    font-size: 12px;
}

.logic-broker-identity > strong {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-broker-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.logic-broker-metrics div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #edf1f7;
    border-radius: 6px;
    background: #f8fafc;
}

.logic-broker-metrics strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 15px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-broker-actions {
    display: flex;
    justify-content: flex-end;
}

.logic-child-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
    gap: 14px;
    padding-top: 14px;
}

.logic-child-grid .logic-child-empty {
    grid-column: 1 / -1;
    padding: 22px;
    background: #fff;
    border: 1px dashed #d9d9d9;
    border-radius: 10px;
    text-align: center;
}

.logic-account-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 198px;
    padding: 18px 18px 16px;
    border: 1px solid #e5eaf0;
    border-left: 4px solid #52c41a;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.logic-account-card:hover {
    border-color: #b9d7ff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.logic-account-card.active {
    border-color: #faad14;
    border-left-color: #faad14;
    background: #fffaf0;
    box-shadow: 0 8px 24px rgba(250, 173, 20, 0.16);
}

.logic-account-head {
    min-width: 0;
}

.logic-account-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.logic-account-title > strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    color: #1f2933;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.25;
    overflow: visible;
    white-space: nowrap;
}

.logic-account-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-strategy-note {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border: 1px solid #ffd591;
    border-radius: 50%;
    background: #fff7e6;
    color: #d46b08;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.logic-strategy-note.is-empty {
    border-color: #dce4ee;
    background: #f8fafc;
    color: #9aa4b2;
}

.logic-strategy-modal-open {
    overflow: hidden;
}

.logic-strategy-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, 0.38);
}

.logic-strategy-modal {
    width: min(720px, 100%);
    max-height: min(76vh, 680px);
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.logic-strategy-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #edf1f7;
    background: #f8fafc;
}

.logic-strategy-modal-head span {
    display: block;
    margin-bottom: 5px;
    color: #7b8490;
    font-size: 12px;
    font-weight: 750;
}

.logic-strategy-modal-head strong {
    display: block;
    color: #475569;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.25;
}

.logic-strategy-modal-head button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font-size: 24px;
    line-height: 30px;
    cursor: pointer;
}

.logic-strategy-modal-head button:hover {
    background: #e2e8f0;
    color: #334155;
}

.logic-strategy-modal-body {
    max-height: calc(min(76vh, 680px) - 76px);
    overflow: auto;
    padding: 20px 24px 24px;
    color: #1f2933;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.75;
    word-break: break-word;
    white-space: normal;
}

.logic-strategy-modal-body p {
    margin: 0 0 10px;
}

.logic-strategy-modal-body p:last-child,
.logic-strategy-modal-body ul:last-child,
.logic-strategy-modal-body ol:last-child {
    margin-bottom: 0;
}

.logic-strategy-modal-body ul,
.logic-strategy-modal-body ol {
    margin: 0 0 10px 22px;
    padding: 0;
}

.logic-strategy-modal-body code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    white-space: normal;
}

.logic-strategy-modal-body h1,
.logic-strategy-modal-body h2,
.logic-strategy-modal-body h3,
.logic-strategy-modal-body h4 {
    margin: 18px 0 8px;
    color: #1f2933;
    line-height: 1.35;
}

.logic-strategy-modal-body h1 { font-size: 20px; }
.logic-strategy-modal-body h2 { font-size: 18px; }
.logic-strategy-modal-body h3 { font-size: 16px; }
.logic-strategy-modal-body h4 { font-size: 14px; }

.logic-strategy-modal-body h1:first-child,
.logic-strategy-modal-body h2:first-child,
.logic-strategy-modal-body h3:first-child,
.logic-strategy-modal-body h4:first-child {
    margin-top: 0;
}

.logic-strategy-modal-body a,
.logic-markdown-preview a {
    color: #1677ff;
    text-decoration: none;
}

.logic-strategy-modal-body blockquote,
.logic-markdown-preview blockquote {
    margin: 0 0 10px;
    padding: 6px 12px;
    border-left: 3px solid #b8d8fb;
    background: #f7fbff;
    color: #5b6b7e;
}

.logic-strategy-modal-body pre,
.logic-markdown-preview pre {
    overflow: auto;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    line-height: 1.55;
    white-space: pre;
}

.logic-strategy-modal-body pre code,
.logic-markdown-preview pre code {
    padding: 0;
    background: transparent;
    font-size: 12px;
}

.logic-strategy-modal-body hr,
.logic-markdown-preview hr {
    height: 1px;
    margin: 14px 0;
    border: 0;
    background: #e5eaf0;
}

.logic-card-list,
.logic-broker-group,
.logic-child-grid,
.logic-info-card,
.logic-account-card,
.logic-account-title {
    overflow: visible;
}

.logic-account-card:hover,
.logic-account-card:focus-within {
    z-index: 20;
}

.logic-account-title > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

.logic-account-title code {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    padding: 4px 8px;
    border-radius: 6px;
    background: #eef6ff;
    color: #1677ff;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-account-title .logic-copy-btn,
.logic-account-title .badge {
    flex: 0 0 auto;
}

.logic-account-card .logic-run-at,
.logic-account-card .logic-run-at-placeholder {
    width: auto;
    flex: none;
}

.logic-account-card .logic-run-at {
    justify-content: flex-start;
    margin: 14px 0 14px;
    min-height: 30px;
    text-align: left;
    white-space: normal;
}

.logic-account-card .logic-run-at-placeholder {
    display: block;
    min-height: 44px;
}

.logic-account-card .logic-run-at span {
    font-size: 12px;
    letter-spacing: 0;
}

.logic-account-card .logic-run-at strong {
    font-size: 26px;
    line-height: 1.1;
    white-space: normal;
}

.logic-account-card .logic-run-at-anytime strong {
    font-size: 24px;
}

.logic-account-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 8px;
}

.logic-account-metrics div {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #edf1f7;
    border-radius: 6px;
    background: #f8fafc;
}

.logic-account-metrics span {
    display: block;
    margin-bottom: 5px;
    color: #7b8490;
    font-size: 12px;
    font-weight: 650;
}

.logic-account-metrics strong {
    display: block;
    color: #111827;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-account-submeta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #edf1f7;
}

.logic-account-submeta div {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #edf1f7;
    border-radius: 6px;
    background: #f8fafc;
}

.logic-account-submeta span {
    display: block;
    margin-bottom: 3px;
    color: #7b8490;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.1;
    white-space: nowrap;
}

.logic-account-submeta strong {
    display: block;
    min-width: 0;
    color: #111827;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-account-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.logic-detail-panel {
    margin: 18px 0 8px;
    border: 1px solid #dce4ee;
    border-left: 0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

.logic-detail-mode .logic-layout {
    display: none;
}

.logic-detail-mode .logic-card-list {
    display: none;
}

.logic-detail-mode .logic-section-head {
    display: none;
}

.logic-detail-mode .logic-detail-panel {
    display: block !important;
    margin-top: 2px;
}

.logic-detail-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 18px;
    align-items: start;
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f7;
    background: #f3f8ff;
}

.logic-detail-title {
    min-width: 0;
}

.logic-detail-title > span {
    display: block;
    margin-bottom: 7px;
    color: #7b8490;
    font-size: 12px;
    font-weight: 750;
}

.logic-detail-title > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.logic-detail-title strong {
    color: #111827;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.logic-detail-title code {
    padding: 4px 8px;
    border-radius: 6px;
    background: #e8f2ff;
    color: #1677ff;
    font-size: 16px;
    font-weight: 850;
}

.logic-detail-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #6b7280;
    font-size: 12px;
}

.logic-detail-meta span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.logic-detail-meta strong {
    color: #111827;
    font-weight: 800;
}

.logic-detail-close {
    grid-column: 2;
    grid-row: 1;
    border: 1px solid #bfd7ff;
    border-radius: 6px;
    background: #fff;
    color: #0958d9;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.logic-detail-close:hover {
    background: #e6f4ff;
    border-color: #91caff;
}

.logic-equity-panel {
    padding: 12px;
}

.logic-equity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.logic-equity-toolbar strong {
    display: block;
    color: #111827;
    font-size: 15px;
    margin-bottom: 4px;
}

.logic-equity-toolbar span {
    color: #6b7280;
    font-size: 12px;
}

.logic-equity-chart {
    height: 320px;
    padding: 10px;
    border: 1px solid #edf1f7;
    border-radius: 8px;
    background: #fff;
}

.logic-equity-table {
    margin-top: 12px;
}

.logic-equity-live-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid #ffd591;
    border-radius: 999px;
    background: #fff7e6;
    color: #d46b08;
    font-size: 11px;
    font-weight: 750;
}

.logic-section-head h4 {
    font-size: 18px;
    font-weight: 850;
}

.logic-section-head span {
    font-size: 13px;
}

@media (max-width: 1500px) {
    .logic-broker-strip {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .logic-broker-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 980px) {
    .logic-child-grid {
        grid-template-columns: 1fr;
    }

    .logic-broker-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logic-workbar {
        flex-direction: column;
    }

    .logic-header-tools {
        justify-content: flex-start;
    }
}

/* 逻辑盘布局二次收敛：分组、紧凑、无横向溢出 */
.logic-broker-group {
    position: relative;
    padding: 14px 14px 16px;
    background: #fff;
    border: 1px solid #dce4ee;
    border-left: 4px solid #1677ff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    overflow: visible;
}

.logic-broker-group.collapsed {
    padding-bottom: 13px;
}

.logic-broker-strip {
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
    gap: 18px;
    margin: -14px -14px 0;
    padding: 14px 16px 13px;
    background: #f3f8ff;
    border: 0;
    border-bottom: 1px solid #edf1f7;
    border-radius: 8px 8px 0 0;
    box-shadow: none;
}

.logic-broker-group.collapsed .logic-broker-strip {
    padding-top: 11px;
    padding-bottom: 10px;
}

.logic-broker-title-row h4 {
    font-size: 17px;
}

.logic-broker-metrics {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px 22px;
}

.logic-broker-metrics div {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.logic-broker-metrics strong {
    margin-top: 3px;
    font-size: 14px;
}

.logic-broker-metrics .logic-broker-position-usage {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 10px;
    min-width: 138px;
    height: 34px;
    margin-right: 28px;
    padding: 0 16px;
    border: 1px solid #ffd591;
    border-radius: 999px;
    background: #fff7e6;
    box-shadow: inset 0 0 0 1px rgba(250, 173, 20, 0.08);
    white-space: nowrap;
}

.logic-broker-metrics .logic-broker-position-usage span {
    color: #ad6800;
    font-size: 13px;
    font-weight: 800;
}

.logic-broker-metrics .logic-broker-position-usage strong {
    display: inline-flex;
    margin: 0;
    color: #ad4e00;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
}

.logic-broker-metrics .logic-broker-position-usage.warning {
    border-color: #ffa39e;
    background: #fff1f0;
}

.logic-broker-metrics .logic-broker-position-usage.warning span,
.logic-broker-metrics .logic-broker-position-usage.warning strong {
    color: #cf1322;
}

.logic-broker-metrics .logic-broker-position-usage.danger {
    border-color: #ff7875;
    background: #fff1f0;
    box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.08);
}

.logic-broker-metrics .logic-broker-position-usage.danger span,
.logic-broker-metrics .logic-broker-position-usage.danger strong {
    color: #cf1322;
}

.logic-broker-actions {
    align-items: center;
    gap: 8px;
}

.logic-broker-expand-btn {
    min-width: 52px;
}

.logic-broker-branch-label {
    display: inline-flex;
    align-items: center;
    margin: 11px 0 0 2px;
    color: #7b8490;
    font-size: 12px;
    font-weight: 700;
}

.logic-broker-branch-label:before {
    content: "";
    width: 18px;
    height: 1px;
    margin-right: 8px;
    background: #a6c8ff;
}

.logic-child-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 324px));
    justify-content: start;
    align-items: start;
    gap: 12px 14px;
    padding-top: 10px;
}

.logic-child-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
}

.logic-child-summary-grid .logic-child-empty {
    width: 100%;
}

.logic-account-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 7px;
    width: 250px;
    min-height: 58px;
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid #dce8f8;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    text-align: left;
}

.logic-account-summary:hover {
    border-color: #91caff;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.10);
}

.logic-account-summary-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
}

.logic-account-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.logic-account-summary-stats > div {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    white-space: nowrap;
}

.logic-account-summary-stats em {
    color: #7b8490;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.logic-pnl-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 21px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #111827;
    background: #f3f6fb;
    box-shadow: inset 0 0 0 1px #e5edf8;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.logic-pnl-pill.sim-profit {
    color: #cf1322;
    background: #fff1f0;
    box-shadow: inset 0 0 0 1px #ffccc7;
}

.logic-pnl-pill.sim-loss {
    color: #389e0d;
    background: #f0f9e8;
    box-shadow: inset 0 0 0 1px #b7eb8f;
}

.logic-account-card {
    min-height: 0;
    max-width: 324px;
    padding: 13px 13px 12px;
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: 0 1px 7px rgba(15, 23, 42, 0.05);
}

.logic-account-card:hover {
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
}

.logic-account-card.discarded,
.logic-account-summary.discarded {
    position: relative;
    overflow: hidden;
    border-color: #ffccc7;
    background: #fffafa;
}

.logic-account-card.discarded {
    opacity: 0.78;
}

.logic-account-card.discarded:after {
    content: "废弃";
    position: absolute;
    top: 20px;
    right: -48px;
    z-index: 4;
    width: 170px;
    padding: 6px 0;
    transform: rotate(42deg);
    background: #ff4d4f;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 10px rgba(207, 19, 34, 0.22);
    pointer-events: none;
}

.logic-account-summary.discarded:after {
    content: "废弃";
    position: absolute;
    top: 7px;
    right: -30px;
    z-index: 2;
    width: 100px;
    padding: 2px 0;
    transform: rotate(40deg);
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0.05em;
    pointer-events: none;
}

.logic-account-title {
    gap: 5px;
    padding-right: 32px;
}

.logic-account-title > strong {
    font-size: 16px;
    line-height: 1.2;
}

.logic-account-title code {
    font-size: 13px;
    padding: 3px 7px;
}

.logic-copy-btn {
    padding: 1px 6px;
    line-height: 17px;
}

.logic-account-card .logic-run-at {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    min-height: 14px;
    margin: 6px 0 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ff1f2f;
    text-align: left;
    white-space: nowrap;
}

.logic-account-card .logic-run-at-placeholder {
    min-height: 22px;
}

.logic-account-card .logic-run-at span {
    color: inherit;
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.02em;
}

.logic-account-card .logic-run-at strong,
.logic-account-card .logic-run-at-anytime strong {
    min-width: 0;
    color: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-account-card .logic-run-at-empty {
    color: #a7b0bd;
}

/* 逻辑盘容量总览与策略横向比较 */
.logic-card-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logic-capacity-overview,
.logic-compare-overview {
    min-width: 0;
}

.logic-capacity-strip {
    margin-bottom: 14px;
    padding: 0 0 12px;
    border-bottom: 1px solid #e8edf3;
}

.logic-capacity-section-head {
    margin-bottom: 10px;
}

.logic-capacity-strip-items {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
}

.logic-capacity-strip-updated {
    margin-left: auto;
    color: #a0aab6;
    font-size: 12px;
}

.logic-capacity-summary {
    display: grid;
    grid-template-columns: minmax(125px, 1fr) 268px auto;
    align-items: center;
    column-gap: 15px;
    min-width: 500px;
    min-height: 64px;
    padding: 9px 12px 9px 13px;
    border: 1px solid #e7edf4;
    border-radius: 5px;
    background: #fbfcfe;
    color: #718096;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color .15s ease, background .15s ease;
}

.logic-capacity-summary:hover,
.logic-capacity-summary.selected {
    border-color: #b9d7fb;
    background: #f5f9ff;
}

.logic-capacity-summary-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.logic-capacity-summary strong {
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-capacity-summary:hover strong,
.logic-capacity-summary.selected strong {
    color: #1677ff;
}

.logic-capacity-summary-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 14px;
    border-left: 1px dashed #d9e2ec;
}

.logic-capacity-summary-metric {
    display: grid;
    gap: 5px;
}

.logic-capacity-summary-metric + .logic-capacity-summary-metric {
    padding-left: 12px;
    border-left: 1px dashed #d9e2ec;
}

.logic-capacity-summary-metric-line {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    color: #8491a0;
    font-size: 11px;
    line-height: 14px;
    white-space: nowrap;
}

.logic-capacity-summary-metric-line em {
    color: #93a0af;
    font-style: normal;
}

.logic-capacity-summary-metric-line b {
    color: #526171;
    font-weight: 750;
}

.logic-capacity-summary-progress {
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: 3px;
    background: #e8eef5;
}

.logic-capacity-summary-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #42b814;
}

.logic-capacity-summary.watch .logic-capacity-summary-progress i {
    background: #e6a23c;
}

.logic-capacity-summary.tight .logic-capacity-summary-progress i {
    background: #e25a5a;
}

.logic-capacity-summary-available {
    padding-left: 14px;
    border-left: 1px dashed #d9e2ec;
    color: #718096;
    font-size: 11px;
    white-space: nowrap;
}

.logic-capacity-summary-warning,
.logic-capacity-summary-watch {
    font-size: 11px;
    font-weight: 800;
}

.logic-capacity-summary-warning {
    color: #cf1322;
}

.logic-capacity-summary-watch {
    color: #be7a11;
}

/* Legacy capacity table styles are retained for old pages; the strategy view uses the compact summary above. */
.logic-capacity-strip-legacy {
    margin-bottom: 14px;
    padding: 0 2px 10px;
    border-bottom: 1px solid #e8edf3;
    color: #718096;
    font-size: 12px;
    white-space: nowrap;
}

.logic-compare-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.logic-compare-section-head h4 {
    margin: 0 0 4px;
    color: #1f2933;
    font-size: 17px;
    font-weight: 800;
}

.logic-compare-section-head span,
.logic-compare-updated {
    color: #7b8490;
    font-size: 12px;
}

.logic-compare-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    background: #fff;
}

.logic-compare-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    table-layout: fixed;
}

.logic-capacity-table {
    min-width: 960px;
}

.logic-strategy-compare-table {
    min-width: 1360px;
}

.logic-compare-table th {
    padding: 11px 10px;
    border-bottom: 1px solid #e9eef4;
    background: #f7f9fc;
    color: #6b7787;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

.logic-compare-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f5;
    color: #1f2933;
    font-size: 13px;
    vertical-align: middle;
}

.logic-compare-table tbody tr:last-child td {
    border-bottom: 0;
}

.logic-capacity-row:hover,
.logic-compare-row:hover {
    background: #f6faff;
}

.logic-capacity-row.selected,
.logic-compare-row.active {
    background: #fffbe6;
}

.logic-capacity-name,
.logic-compare-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1677ff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.logic-capacity-name:hover,
.logic-compare-link:hover {
    color: #0958d9;
    text-decoration: underline;
}

.logic-capacity-row td > span:not(.logic-capacity-status),
.logic-compare-table td > span,
.logic-compare-broker > span {
    display: block;
    margin-top: 4px;
    color: #7b8490;
    font-size: 11px;
    white-space: nowrap;
}

.logic-capacity-sync strong,
.logic-capacity-sync span {
    display: block;
    white-space: nowrap;
}

.logic-capacity-sync span {
    margin-top: 4px;
    color: #7b8490;
    font-size: 11px;
}

.logic-capacity-metric {
    min-width: 160px;
}

.logic-capacity-metric > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    white-space: nowrap;
}

.logic-capacity-metric > div span {
    color: #7b8490;
    font-size: 11px;
}

.logic-capital-capacity-metric > div {
    display: block;
}

.logic-capital-capacity-metric > span {
    display: block;
    margin-top: 5px;
    color: #7b8490;
    font-size: 11px;
    white-space: nowrap;
}

.logic-capacity-meter {
    display: block;
    height: 5px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 3px;
    background: #eaf0f6;
}

.logic-capacity-meter b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #52c41a;
}

.logic-capacity-meter.watch b {
    background: #faad14;
}

.logic-capacity-meter.tight b {
    background: #ff4d4f;
}

.logic-capacity-meter.unknown b {
    background: #bfbfbf;
}

.logic-capacity-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    background: #f6ffed;
    color: #389e0d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.logic-capacity-row td > .logic-capacity-status {
    display: inline-flex;
    width: auto;
    margin-top: 0;
}

.logic-capacity-status.watch {
    border-color: #ffe58f;
    background: #fffbe6;
    color: #d48806;
}

.logic-capacity-status.tight {
    border-color: #ffccc7;
    background: #fff2f0;
    color: #cf1322;
}

.logic-capacity-status.unknown {
    border-color: #d9d9d9;
    background: #fafafa;
    color: #8c8c8c;
}

.logic-compare-list-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2px;
    margin-bottom: 10px;
}

.logic-compare-list-toolbar .logic-compare-section-head {
    margin: 0;
}

.logic-compare-controls,
.logic-compare-filter-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.logic-compare-filter-btn {
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #d8e2ef;
    border-radius: 5px;
    background: #fff;
    color: #526171;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.logic-compare-filter-btn:hover {
    border-color: #91caff;
    color: #1677ff;
}

.logic-compare-filter-btn.active {
    border-color: #1677ff;
    background: #eaf3ff;
    color: #0958d9;
}

.logic-compare-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #526171;
    font-size: 12px;
    white-space: nowrap;
}

.logic-compare-check input,
.logic-strategy-compare-table input[type="checkbox"] {
    accent-color: #1677ff;
    cursor: pointer;
}

.logic-compare-sort {
    cursor: pointer;
}

.logic-compare-sort:after {
    content: " ↕";
    color: #aab4c0;
    font-weight: 400;
}

.logic-compare-sort.active:after {
    content: " ↓";
    color: #1677ff;
    font-weight: 800;
}

.logic-compare-rank {
    color: #7b8490 !important;
    text-align: center;
}

.logic-compare-row {
    cursor: pointer;
}

.logic-compare-row.discarded {
    opacity: 0.72;
}

.logic-compare-strategy {
    min-width: 240px;
}

.logic-compare-strategy > strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    color: #1f2933;
    font-size: 14px;
    font-weight: 850;
}

.logic-compare-strategy > div {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #7b8490;
    font-size: 11px;
    flex-wrap: wrap;
}

.logic-compare-strategy code {
    color: #718096;
    font-size: 11px;
}

.logic-compare-tag {
    display: inline-flex !important;
    align-items: center;
    min-height: 18px;
    margin: 0 !important;
    padding: 1px 5px;
    border: 1px solid #dce5ef;
    border-radius: 3px;
    background: #f8fafc;
    color: #617084 !important;
    font-size: 10px !important;
    font-weight: 700;
}

.logic-compare-tag.discarded {
    border-color: #d9d9d9;
    background: #fafafa;
    color: #8c8c8c !important;
}

.logic-compare-runat {
    color: #a36216 !important;
    font-weight: 700;
}

.logic-compare-broker {
    min-width: 135px;
}

.logic-compare-table td > strong {
    display: block;
    color: #1f2933;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.logic-compare-table td > strong.sim-profit {
    color: #cf1322;
}

.logic-compare-table td > strong.sim-loss {
    color: #389e0d;
}

.logic-compare-trend {
    width: 118px;
}

.logic-compare-trend-hint {
    margin: 0 !important;
    color: #a1a9b3 !important;
    font-size: 11px !important;
}

.logic-mini-trend {
    display: block;
    width: 110px;
    height: 38px;
}

.logic-mini-trend-benchmark {
    fill: none;
    stroke: #9aa5b1;
    stroke-width: 1.25;
}

.logic-mini-trend-account {
    fill: none;
    stroke: #cf1322;
    stroke-width: 2;
}

.logic-mini-trend-account.negative {
    stroke: #389e0d;
}

.logic-compare-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logic-compare-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0 0 4px;
    border: 1px solid #dce5ef;
    border-radius: 4px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.logic-compare-more-btn:hover {
    border-color: #91caff;
    background: #f4f8fc;
    color: #1677ff;
}

.logic-compare-action-popover {
    position: fixed;
    z-index: 5000;
    width: 174px;
    padding: 5px;
    border: 1px solid #dce5ef;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

.logic-compare-action-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 8px 8px;
    border-bottom: 1px solid #edf1f5;
}

.logic-compare-action-title strong {
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-compare-action-title code {
    overflow: hidden;
    color: #8a97a8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logic-compare-action-popover button {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #3d4a5a;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.logic-compare-action-popover button:hover {
    background: #f4f8fc;
}

.logic-compare-action-popover button.warning {
    color: #d48806;
}

.logic-compare-action-popover button.danger {
    color: #cf1322;
}

.logic-compare-menu {
    position: relative;
}

.logic-compare-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #dce5ef;
    border-radius: 4px;
    color: #64748b;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    list-style: none;
}

.logic-compare-menu summary::-webkit-details-marker {
    display: none;
}

.logic-compare-menu > div {
    position: absolute;
    z-index: 40;
    right: 0;
    top: calc(100% + 5px);
    display: none;
    width: 112px;
    padding: 5px;
    border: 1px solid #dce5ef;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.logic-compare-menu[open] > div {
    display: block;
}

.logic-compare-menu button {
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #3d4a5a;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.logic-compare-menu button:hover {
    background: #f4f8fc;
}

.logic-compare-menu button.warning {
    color: #d48806;
}

.logic-compare-menu button.danger {
    color: #cf1322;
}

.logic-compare-group-row td {
    padding: 9px 10px;
    border-bottom: 1px solid #e9eef4;
    background: #f6f9fc;
    color: #718096;
    font-size: 12px;
}

.logic-compare-group-row strong {
    color: #3d4a5a;
    font-weight: 850;
}

.logic-compare-group-row span {
    margin-left: 8px;
}

.logic-compare-empty {
    padding: 30px !important;
    color: #94a0ad !important;
    text-align: center;
}

.logic-compare-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #dce8f8;
    border-radius: 7px;
    background: #f7fbff;
    color: #526171;
    font-size: 13px;
}

.logic-compare-selection-bar strong {
    color: #1677ff;
    font-size: 16px;
}

.logic-compare-selection-bar > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logic-compare-modal-backdrop {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.46);
}

.logic-compare-modal {
    width: min(900px, 100%);
    max-height: min(720px, 92vh);
    overflow: auto;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
}

.logic-compare-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.logic-compare-modal-head h3 {
    margin: 0 0 5px;
    color: #1f2933;
    font-size: 18px;
}

.logic-compare-modal-head span,
.logic-compare-modal-hint {
    color: #7b8490;
    font-size: 12px;
}

.logic-compare-modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 5px;
    background: #f4f6f8;
    color: #526171;
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.logic-compare-selected-list {
    display: flex;
    gap: 8px;
    margin: 18px 0 12px;
    flex-wrap: wrap;
}

.logic-compare-selected-list span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border: 1px solid #dce5ef;
    border-radius: 4px;
    background: #f8fafc;
    color: #415165;
    font-size: 12px;
}

.logic-compare-selected-list code {
    color: #7b8490;
    font-size: 11px;
}

.logic-compare-chart-wrap {
    position: relative;
    height: 360px;
}

.logic-compare-modal-hint {
    margin-top: 10px;
}

@media (max-width: 980px) {
    .logic-capacity-section-head {
        align-items: flex-start;
        flex-direction: row;
    }

    .logic-capacity-summary {
        grid-template-columns: minmax(125px, 1fr) 268px auto;
        min-width: min(500px, 100%);
    }

    .logic-compare-list-toolbar,
    .logic-compare-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .logic-compare-controls,
    .logic-compare-filter-group {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .logic-capacity-strip-updated {
        width: 100%;
        margin-left: 0;
    }

    .logic-capacity-summary {
        grid-template-columns: 1fr auto;
        row-gap: 7px;
    }

    .logic-capacity-summary-metrics {
        grid-column: 1 / -1;
    }
}

.logic-account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid #edf1f7;
}

.logic-account-metrics div {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.logic-account-metrics span {
    margin-bottom: 2px;
    color: #7b8490;
    font-size: 10px;
    font-weight: 700;
}

.logic-account-metrics strong {
    font-size: 13px;
    line-height: 1.2;
}

.logic-account-submeta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: auto;
    padding-top: 7px;
    color: #7b8490;
    font-size: 11px;
    line-height: 1.35;
    border-top: 1px solid #edf1f7;
}

.logic-account-submeta div {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.logic-account-submeta span {
    color: #7b8490;
    font-size: 11px;
    font-weight: 500;
}

.logic-account-submeta strong {
    color: #6b7280;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.logic-account-actions {
    display: none;
}

.logic-card-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.logic-card-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #6b7280;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.logic-card-menu summary::-webkit-details-marker {
    display: none;
}

.logic-card-menu summary:hover,
.logic-card-menu[open] summary {
    border-color: #dce4ee;
    background: #f8fafc;
    color: #111827;
}

.logic-card-menu-list {
    position: absolute;
    top: 30px;
    right: 0;
    min-width: 96px;
    padding: 5px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.logic-card-menu-list button {
    display: block;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #1f2933;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.logic-card-menu-list button:hover {
    background: #f0f7ff;
    color: #1677ff;
}

.logic-card-menu-list button.warning:hover {
    background: #fff7e6;
    color: #d48806;
}

.logic-card-menu-list button.danger:hover {
    background: #fff1f0;
    color: #ff4d4f;
}

.logic-section-head {
    margin-bottom: 8px;
}

@media (max-width: 1500px) {
    .logic-broker-strip {
        grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
    }
}

@media (max-width: 1180px) {
    .logic-broker-strip {
        grid-template-columns: 1fr auto;
    }

    .logic-broker-metrics {
        grid-column: 1 / -1;
        justify-content: flex-start;
        order: 3;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 20px;
    }

    .logic-broker-group {
        padding: 12px;
    }

    .logic-broker-strip {
        grid-template-columns: 1fr;
    }

    .logic-broker-actions,
    .logic-broker-metrics {
        justify-content: flex-start;
    }

    .logic-child-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .logic-account-card {
        max-width: none;
    }

    .logic-account-summary {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }

    .logic-account-summary-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .logic-account-summary-stats > div {
        justify-content: space-between;
    }
}

.logic-pl-row-up td {
    background: #f0f9f2;
}
.logic-pl-row-down td {
    background: #fff1f0;
}
.sim-profit {
    color: #cf1322;
}
.sim-loss {
    color: #389e0d;
}
.logic-account-metrics strong.sim-profit,
.logic-detail-meta strong.sim-profit,
td.sim-profit {
    color: #cf1322;
}
.logic-account-metrics strong.sim-loss,
.logic-detail-meta strong.sim-loss,
td.sim-loss {
    color: #389e0d;
}
.light-toast {
    position: fixed;
    top: 22%;
    left: 50%;
    z-index: 3000;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(38, 38, 38, 0.92);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    opacity: 0;
    transform: translate(-50%, -8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    text-align: center;
}
.light-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.logic-info-main { flex: 1; min-width: 0; }
.logic-info-main h4 { margin: 0 0 8px; font-size: 16px; color: #262626; }
.logic-id { color: #595959; font-size: 12px; margin-bottom: 10px; }
.logic-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}
.logic-meta-grid span { display: block; color: #8c8c8c; font-size: 11px; margin-bottom: 3px; }
.logic-meta-grid strong {
    display: block;
    color: #262626;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .logic-layout { grid-template-columns: 1fr; }
}

/* 表格内的次要文字信息 */
td small {
    display: block;
    color: #8c8c8c;
    line-height: 1.5;
}

/* ==========================================
   4. 仪表盘组件 (KPI 卡片与图表)
   ========================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }

.kpi-card { 
    background: white; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: var(--shadow); 
    border-top: 5px solid var(--primary-color); 
}

.kpi-card .label { color: #8c8c8c; font-size: 14px; margin-bottom: 8px; }
.kpi-card .value { font-size: 28px; font-weight: bold; color: #262626; }

.progress-bar { height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; width: 100px; }
.progress-fill { height: 100%; background: var(--primary-color); }

.chart-row { display: none; background: #fafafa; }
.chart-container { height: 350px; padding: 20px; width: 100%; position: relative; }

/* ==========================================
   5. 弹窗与表单 (Modal & Forms)
   ========================================== */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1000; 
    backdrop-filter: blur(2px); 
}

.modal-content { 
    background: white; 
    margin: 40px auto; 
    padding: 32px; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 650px; 
    position: relative; 
}

.logic-profile-modal {
    max-width: 820px;
    padding: 0;
    overflow: hidden;
}

#liveLogicCashTransferModal .logic-profile-modal {
    max-width: 960px;
}

.logic-profile-modal .close {
    top: 18px;
    right: 22px;
    z-index: 2;
}

.logic-modal-head {
    padding: 24px 30px 18px;
    border-bottom: 1px solid #edf1f7;
    background: #f6f9fc;
}

.logic-modal-head h2 {
    margin: 0;
    color: #111827;
    font-size: 21px;
}

.logic-modal-head p {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.logic-modal-section {
    padding: 18px 30px 0;
}

.logic-modal-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #1f2933;
    font-size: 14px;
    font-weight: 850;
}

.logic-modal-section h3:before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 999px;
    background: #1677ff;
}

.logic-profile-grid {
    margin-top: 0;
    gap: 14px 18px;
}

.cash-transfer-summary {
    margin: 18px 30px 0;
    padding: 16px 18px;
    border: 1px solid #e5edf7;
    border-radius: 12px;
    background: #fbfdff;
}

.cash-transfer-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #edf1f7;
}

.cash-transfer-title-row > div {
    min-width: 0;
}

.cash-transfer-label {
    display: block;
    margin-bottom: 4px;
    color: #7b8794;
    font-size: 12px;
    font-weight: 750;
}

.cash-transfer-title-row strong {
    display: inline-block;
    max-width: 430px;
    margin-right: 10px;
    color: #111827;
    font-size: 16px;
    line-height: 1.45;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cash-transfer-title-row code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 7px;
    background: #eaf3ff;
    color: #1677ff;
    font-size: 12px;
    font-weight: 800;
    vertical-align: middle;
}

.cash-transfer-action {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 850;
}

.cash-transfer-action.deposit {
    color: #1677ff;
    background: #eaf3ff;
}

.cash-transfer-action.withdraw {
    color: #b45309;
    background: #fff7ed;
}

.cash-transfer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cash-transfer-grid > div {
    min-width: 0;
    padding: 12px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #edf1f7;
}

.cash-transfer-grid span {
    display: block;
    margin-bottom: 6px;
    color: #7b8794;
    font-size: 12px;
    font-weight: 750;
}

.cash-transfer-grid strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cash-transfer-grid-wide {
    grid-column: span 2;
}

@media (max-width: 820px) {
    .cash-transfer-title-row {
        display: block;
    }

    .cash-transfer-action {
        display: inline-block;
        margin-top: 10px;
    }

    .cash-transfer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.logic-profile-run-at {
    margin: 0;
}

.logic-rich-editor {
    border: 1px solid #dce4ee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.logic-rich-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid #edf1f7;
    background: #f8fafc;
}

.logic-rich-toolbar button {
    min-width: 32px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #dce4ee;
    border-radius: 5px;
    background: #fff;
    color: #1f2933;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.logic-rich-toolbar button:hover {
    border-color: #91caff;
    background: #e6f4ff;
    color: #0958d9;
}

.logic-rich-area {
    min-height: 132px;
    max-height: 260px;
    overflow: auto;
    padding: 12px 14px;
    color: #1f2933;
    font-size: 13px;
    line-height: 1.7;
    outline: none;
}

.logic-rich-area:empty:before {
    content: attr(data-placeholder);
    color: #9aa4b2;
}

.logic-rich-area:focus {
    box-shadow: inset 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.logic-rich-area p {
    margin: 0 0 8px;
}

.logic-rich-area ul,
.logic-rich-area ol {
    margin: 0 0 8px 18px;
    padding: 0;
}

.logic-markdown-label {
    display: inline-block;
    margin-left: 6px;
    color: #8a97a6;
    font-size: 11px;
    font-weight: 650;
    vertical-align: 1px;
}

.logic-markdown-editor {
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
}

.logic-markdown-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #edf1f7;
    background: #f8fafc;
}

.logic-markdown-tools,
.logic-markdown-modes {
    display: flex;
    align-items: center;
    gap: 5px;
}

.logic-markdown-tools button,
.logic-markdown-modes button {
    height: 28px;
    padding: 0 9px;
    border: 1px solid #dce4ee;
    border-radius: 5px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.logic-markdown-tools button:hover,
.logic-markdown-modes button:hover {
    border-color: #91caff;
    background: #e6f4ff;
    color: #0958d9;
}

.logic-markdown-modes {
    gap: 0;
}

.logic-markdown-modes button {
    border-radius: 0;
}

.logic-markdown-modes button:first-child {
    border-radius: 5px 0 0 5px;
}

.logic-markdown-modes button:last-child {
    margin-left: -1px;
    border-radius: 0 5px 5px 0;
}

.logic-markdown-modes button.active {
    position: relative;
    z-index: 1;
    border-color: #1677ff;
    background: #e6f4ff;
    color: #0958d9;
}

.logic-markdown-area {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 168px;
    max-height: 310px;
    resize: vertical;
    padding: 13px 14px;
    border: 0;
    outline: 0;
    color: #1f2933;
    font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.logic-markdown-area:focus {
    box-shadow: inset 0 0 0 2px rgba(22, 119, 255, 0.14);
}

.logic-markdown-preview {
    min-height: 168px;
    max-height: 310px;
    overflow: auto;
    padding: 13px 14px;
    color: #1f2933;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
}

.logic-markdown-preview p {
    margin: 0 0 9px;
}

.logic-markdown-preview h1,
.logic-markdown-preview h2,
.logic-markdown-preview h3,
.logic-markdown-preview h4 {
    margin: 14px 0 7px;
    color: #1f2933;
    line-height: 1.35;
}

.logic-markdown-preview h1 { font-size: 19px; }
.logic-markdown-preview h2 { font-size: 17px; }
.logic-markdown-preview h3 { font-size: 15px; }
.logic-markdown-preview h4 { font-size: 14px; }

.logic-markdown-preview h1:first-child,
.logic-markdown-preview h2:first-child,
.logic-markdown-preview h3:first-child,
.logic-markdown-preview h4:first-child {
    margin-top: 0;
}

.logic-markdown-preview ul,
.logic-markdown-preview ol {
    margin: 0 0 9px 20px;
    padding: 0;
}

.logic-markdown-preview code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
}

.logic-markdown-empty {
    color: #9aa4b2;
}

.logic-profile-modal .modal-footer {
    padding: 18px 30px 24px;
    margin-top: 0;
    background: #fff;
}

.logic-manual-order-content {
    max-width: 760px;
    padding: 0;
    overflow: hidden;
}

.logic-manual-order-content .close {
    top: 18px;
    right: 22px;
    z-index: 2;
}

.logic-manual-head {
    padding: 24px 30px 18px;
    border-bottom: 1px solid #edf1f7;
    background: #f7fbff;
}

.logic-manual-head span {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: #e6f4ff;
    color: #0958d9;
    font-size: 12px;
    font-weight: 800;
}

.logic-manual-head h3 {
    margin: 10px 0 0;
    color: #111827;
    font-size: 21px;
}

.logic-manual-head p {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.logic-manual-form {
    display: grid;
    grid-template-columns: 150px 1fr 1fr 1fr;
    gap: 14px;
    padding: 22px 30px 16px;
    align-items: end;
}

.logic-manual-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
}

.logic-manual-form input {
    height: 38px;
    font-size: 14px;
}

.logic-manual-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-self: end;
}

.logic-manual-side label {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 38px;
    border: 1px solid #dce4ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #1f2933;
    cursor: pointer;
}

.logic-manual-side input {
    width: auto;
    height: auto;
    padding: 0;
}

.logic-manual-full {
    grid-column: 1 / -1;
}

.logic-manual-preview {
    display: grid;
    gap: 6px;
    margin: 0 30px 0;
    padding: 14px 16px;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2933;
    font-size: 13px;
    line-height: 1.55;
}

.logic-manual-preview strong {
    font-size: 14px;
}

.logic-manual-preview.ok {
    border-color: #b7eb8f;
    background: #f6ffed;
}

.logic-manual-preview.ok strong {
    color: #237804;
}

.logic-manual-preview.error {
    border-color: #ffccc7;
    background: #fff2f0;
}

.logic-manual-preview.error strong {
    color: #a8071a;
}

.logic-manual-preview.muted {
    color: #6b7280;
}

.logic-manual-order-content .modal-footer {
    padding: 18px 30px 24px;
    margin-top: 0;
    background: #fff;
}

@media (max-width: 820px) {
    .logic-manual-form {
        grid-template-columns: 1fr 1fr;
    }
    .logic-manual-side,
    .logic-manual-full {
        grid-column: 1 / -1;
    }
}

.close { 
    position: absolute; 
    right: 25px; top: 20px; 
    font-size: 24px; 
    cursor: pointer; 
    color: #999; 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-top: 15px; 
}

.item-full { grid-column: 1 / -1; }

.item label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 14px; 
    color: #333; 
    font-weight: 500; 
}

input, select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #d9d9d9; 
    border-radius: 4px; 
    font-size: 14px; 
    outline: none; 
    transition: 0.3s; 
}

input:focus, select:focus { 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 2px rgba(22,119,255,0.1); 
}

.item.logic-run-at-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.item.logic-run-at-form > label {
    margin-bottom: 0;
}
.item.logic-run-at-form .logic-run-at-any {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0;
}
.item.logic-run-at-form .logic-run-at-any input {
    width: auto;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* 只读或禁用状态 */
.bg-gray { background: #f5f5f5; cursor: not-allowed; color: #8c8c8c; }

.modal-footer { 
    text-align: right; 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid #f0f0f0; 
}

/* ==========================================
   6. 凭证打印 (Voucher & Print)
   ========================================== */
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-item { padding: 12px; border-bottom: 1px solid #f0f0f0; display: flex; flex-direction: column; }
.d-item strong { font-size: 12px; color: #8c8c8c; margin-bottom: 4px; font-weight: normal; }
.d-item span { font-size: 15px; color: #262626; }

@media print {
    body * { visibility: hidden; }
    #printableArea, #printableArea * { visibility: visible; }
    #printableArea { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 20px; }
    .no-print { display: none !important; }
}

/* ==========================================
   7. 业务特定微调 (认购与产品)
   ========================================== */

/* 认购类型小标签 */
.sub-type-tag {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #595959;
    border: 1px solid #d9d9d9;
    margin-top: 4px;
    display: inline-block;
}

/* 密集数字字段使用等宽字体增强阅读感 */
.font-mono {
    font-family: "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}


/* ==========================================
   8. 报告专用
   ========================================== */
.text-right { text-align: right !important; }

/* 报告专用：盈亏颜色增强 */
.up { color: #cf1322 !important; font-weight: bold; }
.down { color: #389e0d !important; font-weight: bold; }

/* 优化打印效果 */
@media print {
    /* 1. 强制横向 A4 */
    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    /* 2. 暴力隐藏 body 下的所有东西 */
    body * {
        visibility: hidden !important;
    }

    /* 3. 精准开启报告区域及其所有子元素 */
    #reportModal,
    #reportPrintArea,
    #reportPrintArea * {
        visibility: visible !important;
    }

    /* 4. 彻底剥离 Modal 的弹窗属性（消除灰色背景的关键） */
    #reportModal {
        display: block !important;
        position: absolute !important; /* 必须是 absolute */
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: white !important; /* 强制白底，消除灰色遮罩 */
        box-shadow: none !important;
    }

    #reportPrintArea {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 5. 修复表格展示不全：锁定宽度 */
    table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1px solid #000 !important;
    }

    th, td {
        border: 1px solid #eee !important;
        padding: 8px 5px !important;
        font-size: 10pt !important;
        word-break: break-all !important;
        white-space: normal !important;
    }

    /* 6. 强制渲染颜色（红绿盈亏） */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 7. 隐藏不需要在纸上出现的按钮 */
    .no-print, .close, .modal-footer {
        display: none !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}
/* 屏幕预览时的表格行高（不影响打印） */
#reportTableBody td {
    padding: 12px 8px;
    line-height: 1.6;
}



/* ==========================================
   9. 费用中心
   ========================================== */


/* 核心修复：限制费用页面的选择框宽度 */
#feeCustomerFilter {
    width: 280px;      /* 设定固定宽度 */
    max-width: 100%;   /* 适配移动端 */
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

/* 选择框获得焦点时变蓝（符合系统主题） */
#feeCustomerFilter:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* 让“收费中心”的复选框列保持窄小 */
#feeCenterTableBody td:first-child,
#fee-center-page th:first-child {
    width: 50px;
    text-align: center;
}

/* ==========================================
   10. 先胜数据地图
   ========================================== */
.data-page .header-action,
.data-header,
.data-map-header {
    margin-bottom: 18px;
}

.data-header,
.data-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.data-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.data-toolbar input,
.data-toolbar select,
.data-map-search {
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 12px;
    background: #fff;
    color: #262626;
    font-size: 13px;
}

.data-toolbar input {
    width: 300px;
}

.data-count {
    color: #8c8c8c;
    font-size: 12px;
    white-space: nowrap;
}

.data-table-container {
    max-height: calc(100vh - 160px);
    overflow: auto;
}

.data-dictionary-table {
    table-layout: auto;
}

.data-dictionary-table th:first-child,
.data-dictionary-table td:first-child {
    width: 220px;
}

.sw-industry-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sw-industry-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.sw-industry-table th,
.sw-industry-table td {
    padding: 12px 14px;
    font-size: 13px;
}

.sw-industry-table th:nth-child(1),
.sw-industry-table td:nth-child(1),
.sw-industry-table th:nth-child(4),
.sw-industry-table td:nth-child(4) {
    width: 150px;
}

.sw-industry-table th:nth-child(2),
.sw-industry-table td:nth-child(2) {
    width: 90px;
}

.sw-industry-table th:nth-child(5),
.sw-industry-table td:nth-child(5),
.sw-industry-table th:nth-child(6),
.sw-industry-table td:nth-child(6) {
    width: 130px;
}

.jq-doc-page {
    max-width: 760px;
    margin: 0;
    padding: 0;
    color: #555;
    background: transparent;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}

.jq-doc-section {
    margin: 0 0 34px;
    padding: 0;
}

.jq-doc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
}

.jq-doc-toolbar input,
.jq-doc-toolbar select {
    width: 260px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    background: #fff;
    color: #555;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    outline: none;
}

.jq-doc-toolbar select {
    width: 210px;
}

.jq-doc-toolbar input:focus,
.jq-doc-toolbar select:focus {
    border-color: #1f78d1;
}

.jq-doc-toolbar .data-count {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

.jq-doc-toolbar-wide {
    flex-wrap: wrap;
}

.jq-doc-section h3 {
    margin: 0 0 18px;
    color: #555;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

.jq-doc-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent;
    color: #555;
    table-layout: auto;
}

.jq-doc-table th,
.jq-doc-table td,
.factor-dictionary-table th,
.factor-dictionary-table td {
    padding: 5px 9px;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
    color: #555;
    background: transparent;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
}

.jq-doc-table th,
.factor-dictionary-table th {
    color: #333;
    font-weight: 600;
}

.jq-doc-table thead th,
.factor-dictionary-table thead th {
    position: static;
    z-index: auto;
    background: transparent;
}

.jq-doc-table tbody tr:hover,
.factor-dictionary-table tbody tr:hover {
    background: transparent;
}

.jq-doc-table code,
.factor-name-cell code {
    color: #555;
    background: transparent;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
}

.sw-industry-doc-page .jq-doc-table {
    min-width: 560px;
}

.sw-industry-doc-page .sw-industry-expired-row,
.sw-industry-doc-page .sw-industry-expired-row code,
.sw-industry-doc-page .sw-industry-expired-row strong {
    color: #555;
    background: transparent;
}

.factor-doc-page {
    max-width: 1160px;
}

.factor-doc-page .factor-dictionary-table {
    min-width: 1480px;
    table-layout: fixed;
}

.factor-col-code {
    width: 19%;
}

.factor-col-intro {
    width: 20%;
}

.factor-col-category {
    width: 7%;
}

.factor-col-category-intro {
    width: 15%;
}

.factor-col-description {
    width: 39%;
}

.factor-name-cell {
    display: block;
}

.factor-name-cell code {
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: normal;
}

.factor-intro-cell,
.factor-category-cell,
.factor-description-cell {
    color: #555;
    font-weight: 400;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.factor-description-cell {
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.api-doc-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin-top: 0;
}

.api-doc-toc {
    position: fixed;
    top: 32px;
    left: 252px;
    z-index: 20;
    width: 268px;
    padding: 14px 16px 14px 12px;
    border-right: 1px solid #e6edf5;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    max-height: calc(100vh - 64px);
    overflow: auto;
}

.api-doc-toc-title {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 800;
}

.api-doc-toc-group {
    margin-top: 16px;
}

.api-doc-toc-group > div {
    margin: 0 0 6px;
    color: #8090a5;
    font-size: 12px;
    font-weight: 800;
}

.api-doc-toc a {
    display: block;
    padding: 6px 8px;
    color: #4b5c73;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.35;
}

.api-doc-toc a:hover {
    color: #1677ff;
    background: #f0f7ff;
}

.api-doc-content {
    display: flex;
    flex-direction: column;
    grid-column: 2;
    gap: 0;
    min-width: 0;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    overflow: hidden;
}

.api-doc-overview,
.api-doc-section {
    padding: 28px 32px;
    border-bottom: 1px solid #edf2f7;
}

.api-doc-overview {
    overflow-x: auto;
}

.api-doc-section:last-child {
    border-bottom: 0;
}

.api-doc-overview h3,
.api-doc-section h3 {
    margin: 4px 0 8px;
    color: #172033;
    font-size: 22px;
    line-height: 1.3;
}

.api-doc-section h4 {
    margin: 22px 0 10px;
    color: #26364d;
    font-size: 15px;
}

.api-doc-overview p,
.api-doc-section p {
    color: #5f6f85;
    line-height: 1.7;
    margin: 8px 0;
    font-size: 14px;
}

.api-doc-module {
    color: #7d8ca1;
    font-size: 12px;
    font-weight: 800;
}

.api-doc-summary {
    max-width: 920px;
}

.api-doc-signature {
    margin: 16px 0 18px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #dde6f0;
    border-radius: 6px;
    color: #253247;
    overflow-x: auto;
}

.api-doc-signature code {
    font-size: 13px;
    line-height: 1.6;
    white-space: nowrap;
}

.api-doc-example-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    margin-top: 18px;
}

.api-doc-code-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #dde6f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.api-doc-code-title {
    padding: 9px 12px;
    border-bottom: 1px solid #dde6f0;
    color: #62748d;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
}

.api-doc-code-card pre {
    flex: 1;
    margin: 0;
    padding: 14px 16px;
    overflow: auto;
    color: #e8eef8;
    font-size: 12px;
    line-height: 1.6;
    min-height: 112px;
}

.api-doc-code-example pre {
    background: #111827;
}

.api-doc-code-response pre {
    background: #f6f9fc;
    color: #253247;
}

.api-doc-param-table,
.api-doc-index-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    overflow: hidden;
}

.api-doc-param-table th,
.api-doc-param-table td,
.api-doc-index-table th,
.api-doc-index-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf2f7;
    color: #42526a;
    font-size: 13px;
    line-height: 1.55;
    vertical-align: top;
}

.api-doc-param-table tr:last-child th,
.api-doc-param-table tr:last-child td,
.api-doc-index-table tr:last-child td {
    border-bottom: 0;
}

.api-doc-param-table th,
.api-doc-index-table th {
    color: #26364d;
    background: #f8fafc;
    font-weight: 800;
}

.api-doc-param-table th {
    width: 210px;
}

.api-doc-index-table {
    margin-top: 18px;
    min-width: 900px;
}

.api-doc-index-table th:nth-child(1),
.api-doc-index-table td:nth-child(1) {
    width: 150px;
}

.api-doc-index-table th:nth-child(2),
.api-doc-index-table td:nth-child(2) {
    width: 430px;
}

.api-doc-index-table td:nth-child(2) code {
    white-space: nowrap;
}

.api-doc-index-table a {
    color: #1677ff;
    text-decoration: none;
}

.api-doc-overview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.api-doc-count {
    min-width: 76px;
    color: #172033;
    font-size: 28px;
    font-weight: 800;
    text-align: right;
}

.api-doc-count span {
    margin-left: 4px;
    color: #8090a5;
    font-size: 13px;
}

.api-doc-version-card {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    margin-top: 18px;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fbfdff;
}

.api-doc-version-card > div {
    padding: 14px 16px;
    border-right: 1px solid #dbe5f0;
}

.api-doc-version-card span,
.api-doc-version-card strong {
    display: block;
}

.api-doc-version-card span {
    color: #7d8ca1;
    font-size: 12px;
    font-weight: 800;
}

.api-doc-version-card strong {
    margin-top: 5px;
    color: #172033;
    font-size: 18px;
}

.api-doc-version-card pre {
    min-width: 0;
    margin: 0;
    padding: 15px 16px;
    overflow: auto;
    background: #111827;
    color: #e8eef8;
    font-size: 12px;
    line-height: 1.7;
}

.api-doc-notes {
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 3px solid #1677ff;
    background: #f6faff;
}

.api-doc-notes p {
    margin: 4px 0;
}

.api-doc-related {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.api-doc-related span {
    color: #6f7f95;
    font-size: 12px;
    font-weight: 800;
}

.api-doc-related code,
.api-alpha-list code {
    padding: 3px 6px;
    border: 1px solid #dde6f0;
    border-radius: 5px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
}

.api-alpha-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .api-doc-example-grid {
        grid-template-columns: 1fr;
    }

    .api-doc-version-card {
        grid-template-columns: 1fr;
    }

    .api-doc-version-card > div {
        border-right: 0;
        border-bottom: 1px solid #dbe5f0;
    }
}

@media (max-width: 960px) {
    .api-doc-layout {
        grid-template-columns: 1fr;
    }

    .api-doc-toc {
        position: static;
        width: auto;
        max-height: none;
        padding: 12px;
        border: 1px solid #e6edf5;
        border-radius: 8px;
        background: #fff;
    }

    .api-doc-content {
        grid-column: auto;
    }

    .api-doc-overview,
    .api-doc-section {
        padding: 22px 18px;
    }
}

.data-map-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    height: calc(100vh - 150px);
    min-height: 620px;
    align-items: stretch;
}

.data-map-sidebar,
.data-map-detail {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.data-map-sidebar {
    padding: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-map-search-wrap {
    position: relative;
    flex: 0 0 auto;
}

.data-map-search {
    width: 100%;
    height: 34px;
    padding: 0 34px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #262626;
    font-size: 13px;
    line-height: 34px;
    outline: none;
    box-shadow: none;
}

.data-map-search:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.data-map-search-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c8c8c;
    cursor: pointer;
    font-size: 16px;
    line-height: 18px;
    padding: 0;
}

.data-map-search-clear:hover {
    color: #262626;
    background: #f0f0f0;
}

.data-map-count {
    flex: 0 0 auto;
    padding: 0 2px 4px;
}

.data-map-list {
    overflow: auto;
    padding-right: 4px;
}

.data-map-table-item {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    text-align: left;
    cursor: pointer;
}

.data-map-table-item strong,
.data-map-table-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-map-table-item strong {
    color: #262626;
    font-size: 13px;
}

.data-map-table-item span {
    margin-top: 4px;
    color: #8c8c8c;
    font-size: 12px;
}

.data-map-table-item:hover,
.data-map-table-item.active {
    background: #f0f7ff;
    border-color: #91caff;
}

.data-map-detail {
    padding: 18px;
    overflow: auto;
    min-height: 0;
    scroll-behavior: smooth;
}

.data-map-empty {
    color: #8c8c8c;
    padding: 48px;
    text-align: center;
}

.data-map-empty.small {
    padding: 18px 8px;
    font-size: 13px;
}

.data-map-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.data-map-detail-head h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.data-map-detail-head p {
    margin: 0;
    color: #8c8c8c;
    font-size: 13px;
}

.data-map-columns h4,
.data-map-sample h4 {
    margin: 18px 0 10px;
    color: #262626;
}

.data-map-columns h4 span,
.data-map-sample h4 span {
    color: #8c8c8c;
    font-size: 12px;
    font-weight: 400;
}

.data-map-inner-table,
.data-map-sample-scroll {
    max-width: 100%;
    overflow: auto;
    box-shadow: none;
    border: 1px solid #f0f0f0;
}

.data-map-inner-table table,
.data-map-sample-scroll table {
    table-layout: auto;
    min-width: 100%;
}

.data-map-inner-table th,
.data-map-inner-table td,
.data-map-sample-scroll th,
.data-map-sample-scroll td {
    padding: 9px 10px;
    font-size: 12px;
}

.data-map-sample-scroll {
    max-height: 420px;
}

.daily-ingest-page {
    background: #f5f7fb;
    min-height: calc(100vh - 40px);
}

.daily-ingest-shell {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.daily-ingest-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.daily-ingest-head h3 {
    margin: 0 0 6px;
    color: #172033;
    font-size: 24px;
}

.daily-ingest-head p {
    margin: 0;
    color: #667085;
    font-size: 13px;
}

.daily-ingest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.daily-ingest-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #526071;
    font-size: 12px;
}

.daily-ingest-actions input {
    border: 1px solid #d9e2ef;
    border-radius: 9px;
    padding: 8px 10px;
    color: #253044;
}

.daily-ingest-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.daily-ingest-summary-card {
    border: 1px solid #edf1f7;
    border-radius: 14px;
    padding: 12px 14px;
    background: #fbfdff;
}

.daily-ingest-summary-card span {
    display: block;
    color: #667085;
    font-size: 12px;
    margin-bottom: 4px;
}

.daily-ingest-summary-card strong {
    color: #172033;
    font-size: 18px;
}

.daily-ingest-summary-card.success strong {
    color: #238636;
}

.daily-ingest-summary-card.failed strong {
    color: #cf222e;
}

.daily-ingest-summary-card.today {
    background: #f7fbff;
    border-color: #dbeafe;
}

.daily-ingest-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin: 8px 0 10px;
    color: #667085;
    font-size: 12px;
}

.daily-ingest-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.daily-ingest-legend i {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.daily-ingest-legend i.success,
.daily-ingest-task-cell.success {
    background: #2da44e;
    border-color: #2a9146;
}

.daily-ingest-legend i.failed,
.daily-ingest-task-cell.failed {
    background: #cf222e;
    border-color: #b91c1c;
}

.daily-ingest-legend i.weekend,
.daily-ingest-task-cell.weekend {
    background: #ffffff;
    border-color: #d0d7de;
}

.daily-ingest-legend i.empty,
.daily-ingest-task-cell.empty {
    background: #eaeef2;
    border-color: #d8dee4;
}

.daily-ingest-status {
    color: #667085;
    font-size: 12px;
    margin-bottom: 12px;
}

.daily-ingest-heatmap {
    border: 1px solid #edf1f7;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    padding: 16px;
    overflow: hidden;
}

.daily-ingest-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 12px;
}

.daily-ingest-month-row,
.daily-ingest-date-row,
.daily-ingest-grid {
    display: grid;
    gap: 4px;
    width: max-content;
}

.daily-ingest-month-row {
    align-items: end;
    margin-bottom: 6px;
    min-height: 20px;
}

.daily-ingest-month-cell {
    color: #111827;
    font-size: 13px;
    white-space: nowrap;
}

.daily-ingest-date-row {
    margin-bottom: 7px;
}

.daily-ingest-date-cell {
    color: #9aa4b2;
    font-size: 10px;
    text-align: center;
}

.daily-ingest-date-cell.weekend {
    color: #c0c7d1;
}

.daily-ingest-grid {
    align-items: start;
}

.daily-ingest-day-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 18px;
}

.daily-ingest-task-cell {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    box-sizing: border-box;
    cursor: default;
    transition: box-shadow .12s ease, outline-color .12s ease;
}

.daily-ingest-task-cell:hover {
    z-index: 20;
    outline: 2px solid rgba(15, 23, 42, .28);
    outline-offset: 1px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
}

.daily-ingest-task-cell:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    transform: translateX(-50%);
    width: max-content;
    max-width: 220px;
    white-space: pre-line;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(17, 24, 39, .95);
    color: #fff;
    font-size: 10px;
    line-height: 1.38;
    font-weight: 400;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
    pointer-events: none;
}

.daily-ingest-task-cell:hover::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(17, 24, 39, .95);
    pointer-events: none;
}

.daily-ingest-empty {
    padding: 36px;
    text-align: center;
    color: #667085;
}

.daily-ingest-empty.error {
    color: #cf222e;
}

@media (max-width: 900px) {
    .daily-ingest-head {
        flex-direction: column;
    }

    .daily-ingest-actions {
        justify-content: flex-start;
    }
}

.null-cell {
    color: #bfbfbf;
    font-style: italic;
}

/* 拆合股处理 */
.stock-split-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.corporate-action-page-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
}

.corporate-action-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.corporate-action-tabs button {
    min-height: 42px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0 22px;
    background: #fff;
    color: #475569;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.corporate-action-tabs button:hover {
    color: #1d4ed8;
    border-color: #60a5fa;
    background: #eff6ff;
}

.corporate-action-tabs button.active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
    box-shadow: 0 2px 5px rgba(22, 119, 255, .2);
}

.corporate-action-panel {
    min-width: 0;
}

.dividend-section {
    border-top: 3px solid #16a34a;
}

.dividend-detection-section {
    border-top: 3px solid #16a34a;
}

.dividend-history-section {
    border-top: 3px solid #64748b;
}

.dividend-management-form {
    padding: 18px 20px 16px;
}

.dividend-form-grid {
    display: grid;
    grid-template-columns: minmax(160px, .9fr) minmax(230px, 1.35fr) minmax(180px, 1.05fr) minmax(150px, .8fr) 120px minmax(220px, 1.25fr);
    gap: 12px;
    align-items: end;
}

.dividend-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.dividend-form-grid select,
.dividend-form-grid input {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid #cfd9e6;
    border-radius: 6px;
    padding: 0 10px;
    background: #fff;
    color: #111827;
    font-size: 13px;
}

.dividend-form-grid select:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

.dividend-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.dividend-form-note {
    margin: 11px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.65;
}

.dividend-history {
    padding: 14px 16px 16px;
}

.dividend-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 12px;
}

.dividend-history-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-weight: 800;
    white-space: nowrap;
}

.dividend-history-toolbar select {
    height: 32px;
    min-width: 154px;
    border: 1px solid #cfd9e6;
    border-radius: 6px;
    padding: 0 9px;
    background: #fff;
    color: #111827;
    font-size: 12px;
}

.dividend-history-table {
    margin: 0;
}

.dividend-history-table th,
.dividend-history-table td {
    padding: 10px 12px;
    font-size: 12px;
    vertical-align: middle;
}

.dividend-history-table td small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.dividend-history-remark {
    max-width: 320px;
    color: #475569;
    white-space: normal;
}

.dividend-history-empty {
    margin: 0;
}

.stock-split-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .48);
}

.stock-split-modal {
    width: min(760px, 94vw);
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.stock-split-modal header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.stock-split-modal header span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.stock-split-modal header h3 {
    margin: 5px 0 0;
    color: #111827;
    font-size: 20px;
}

.stock-split-modal-close {
    border: 0;
    padding: 0;
    background: transparent;
    color: #64748b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.stock-split-modal-body {
    padding: 18px 20px;
}

.stock-split-modal footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
}

.dividend-confirm-account {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-left: 3px solid #16a34a;
    background: #f0fdf4;
}

.dividend-confirm-account strong {
    color: #14532d;
    font-size: 15px;
}

.dividend-confirm-account span {
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.stock-split-confirm-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stock-split-confirm-metrics > div {
    padding: 11px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fbfdff;
}

.stock-split-confirm-metrics span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.stock-split-confirm-metrics strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 16px;
}

.dividend-confirm-note,
.dividend-confirm-remark {
    margin: 14px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.65;
}

.dividend-confirm-note {
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    background: #f0fdf4;
}

@media (max-width: 1050px) {
    .dividend-form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .corporate-action-page-head {
        min-height: 40px;
    }

    .corporate-action-tabs {
        width: 100%;
    }

    .corporate-action-tabs button {
        flex: 1;
        min-height: 40px;
        padding: 0 10px;
        font-size: 15px;
    }

    .dividend-management-form {
        padding: 14px;
    }

    .dividend-history {
        padding: 14px;
    }

    .dividend-detection {
        padding: 12px;
    }

    .dividend-detection-controlbar {
        align-items: stretch;
        flex-direction: column;
    }

    .dividend-detection-filter,
    .dividend-detection-checks {
        width: 100%;
    }

    .dividend-detection-checks label {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .dividend-detection-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .dividend-detection-actions button {
        width: 100%;
    }

    .dividend-history-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dividend-form-grid,
    .stock-split-confirm-metrics {
        grid-template-columns: 1fr;
    }

    .stock-split-modal-backdrop {
        align-items: flex-end;
        padding: 12px;
    }

    .stock-split-modal {
        width: 100%;
        max-height: 92vh;
        overflow: auto;
    }
}

.stock-split-header {
    align-items: flex-start;
    margin-bottom: 2px;
}

.stock-split-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.stock-split-section-detect {
    border-top: 3px solid #1677ff;
}

.stock-split-section-manual {
    border-top: 3px solid #d97706;
}

.stock-split-section-history {
    border-top: 3px solid #64748b;
}

.stock-split-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
}

.stock-split-section-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}

.stock-split-section-kicker {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    margin: 0 !important;
    border-radius: 7px;
    background: #eff6ff;
    color: #1677ff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.stock-split-section-head strong {
    color: #111827;
    font-size: 17px;
}

.stock-split-section-head span {
    display: block;
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
}

.stock-split-detect-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    padding: 16px 16px 12px;
    background: #fff;
}

.stock-split-detect-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%);
}

.stock-split-detect-summary > div:first-child {
    min-width: 92px;
    padding-right: 12px;
    border-right: 1px solid #dbeafe;
}

.stock-split-detect-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stock-split-detect-summary strong {
    display: block;
    margin-top: 2px;
    color: #111827;
    font-size: 24px;
    line-height: 1;
}

.stock-split-detect-summary em {
    margin-left: auto;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
}

.stock-split-status-counts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stock-split-status-counts button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0 11px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.stock-split-status-counts button.active {
    border-color: #1677ff;
    background: #eff6ff;
    color: #1677ff;
}

.stock-split-status-counts b {
    color: inherit;
    font-size: 14px;
}

.stock-split-filterbar {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
}

.stock-split-filterbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stock-split-filterbar select {
    min-width: 120px;
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    padding: 0 8px;
    background: #fff;
    color: #111827;
    font-weight: 600;
}

.stock-split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 12px;
}

.stock-split-check-table {
    margin: 0 16px 16px;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}

.stock-split-check-table table {
    min-width: 1160px;
}

.stock-split-check-table th,
.stock-split-check-table td {
    font-size: 12px;
    vertical-align: middle;
}

.stock-split-check-table th {
    background: #f8fafc;
    color: #475569;
}

.stock-split-check-table tbody tr:hover td {
    background: #f8fbff;
}

.stock-split-empty-cell {
    padding: 22px !important;
    color: #64748b;
    text-align: center;
}

.stock-split-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.stock-split-status-pending {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.stock-split-status-processed {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #86efac;
}

.stock-split-status-ignored {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.stock-split-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stock-split-row-actions button {
    min-height: 26px;
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    padding: 3px 8px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.stock-split-row-actions button:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.stock-split-row-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.stock-split-manual-panel {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    margin: 16px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 48%);
}

.stock-split-manual-intro {
    padding: 4px 14px 4px 0;
    border-right: 1px solid #fed7aa;
}

.stock-split-manual-intro span {
    display: inline-flex;
    align-items: center;
    height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 900;
}

.stock-split-manual-intro strong {
    display: block;
    margin: 10px 0 6px;
    color: #111827;
    font-size: 18px;
}

.stock-split-manual-intro p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
}

.stock-split-manual-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(150px, 190px) 120px 120px minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.stock-split-manual-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stock-split-manual-grid input,
.stock-split-manual-grid select {
    height: 34px;
    border: 1px solid #d6deea;
    border-radius: 5px;
    padding: 0 9px;
    background: #fff;
    color: #111827;
    font-weight: 600;
}

.stock-split-manual-grid button {
    height: 34px;
    white-space: nowrap;
}

.stock-split-manual-tip {
    margin: -6px 16px 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #64748b;
    font-size: 12px;
}

.stock-split-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, 0.48);
}

.stock-split-confirm-modal {
    width: min(1180px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.stock-split-confirm-modal header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.stock-split-confirm-modal header span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stock-split-confirm-modal header strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 20px;
}

.stock-split-confirm-modal header button {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.stock-split-confirm-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.stock-split-confirm-summary div {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fbfdff;
}

.stock-split-confirm-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.stock-split-confirm-summary strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 15px;
}

.dividend-apply-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 20px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.dividend-apply-steps div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
}

.dividend-apply-steps span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.dividend-apply-steps strong {
    font-size: 13px;
}

.dividend-apply-steps .is-done strong {
    color: #237804;
}

.dividend-apply-steps .is-pending strong {
    color: #cf1322;
}

.dividend-apply-steps .is-skip strong {
    color: #64748b;
}

.dividend-action-preview {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(220px, 0.7fr);
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.dividend-action-hero,
.dividend-action-primary,
.dividend-action-grid div {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fbfdff;
}

.dividend-action-hero {
    min-height: 150px;
    padding: 18px;
}

.dividend-action-hero span,
.dividend-action-primary span,
.dividend-action-grid span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.dividend-action-hero strong {
    display: block;
    margin-top: 8px;
    color: #111827;
    font-size: 22px;
}

.dividend-action-hero p {
    margin: 12px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
}

.dividend-action-primary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 150px;
    padding: 18px;
}

.dividend-action-primary strong {
    display: block;
    margin-top: 8px;
    color: #111827;
    font-size: 28px;
    line-height: 1.2;
}

.dividend-action-primary small {
    display: block;
    margin-top: 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.dividend-action-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dividend-action-grid div {
    padding: 10px 12px;
}

.dividend-action-grid strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 15px;
}

.dividend-action-tax-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
}

.dividend-action-tax-card div {
    padding: 10px 12px;
    border: 1px solid #fee2e2;
    border-radius: 7px;
    background: #fff;
}

.dividend-action-tax-card span {
    display: block;
    color: #991b1b;
    font-size: 12px;
    font-weight: 850;
}

.dividend-action-tax-card strong {
    display: block;
    margin-top: 5px;
    color: #111827;
    font-size: 16px;
}

.dividend-action-tax-card small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.dividend-action-formula,
.dividend-action-warning {
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 12px;
    border-radius: 7px;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
}

.dividend-action-formula {
    border: 1px solid #dbeafe;
    background: #f8fbff;
}

.dividend-action-warning {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.stock-split-preview-table {
    flex: 1;
    margin: 0;
    overflow: auto;
    border-radius: 0;
    box-shadow: none;
}

.stock-split-preview-table table {
    min-width: 1060px;
}

.stock-split-preview-table th,
.stock-split-preview-table td {
    font-size: 12px;
}

.stock-split-confirm-modal footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.stock-split-balance-modal {
    width: min(760px, 96vw);
}

.stock-split-balance-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 20px 0;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-left: 4px solid #1677ff;
    border-radius: 7px;
    background: #f8fbff;
}

.stock-split-balance-action span {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.stock-split-balance-action strong {
    color: #0f172a;
    font-size: 18px;
}

.stock-split-balance-action.buy {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.stock-split-balance-action.sell {
    border-left-color: #166534;
    background: #f4fbf5;
}

.stock-split-balance-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stock-split-balance-warning {
    margin: 0 20px 14px;
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: 7px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
    line-height: 1.6;
}

.stock-split-balance-warning strong {
    display: block;
    color: #92400e;
}

.stock-split-balance-warning p {
    margin: 4px 0 0;
}

.stock-split-balance-tracking {
    margin: -2px 20px 12px;
    color: #64748b;
    font-size: 12px;
}

.stock-split-balance-log {
    flex: 1;
    min-height: 190px;
    max-height: 42vh;
    margin: 0 20px 14px;
    overflow: auto;
    border: 1px solid #dbe4f0;
    border-radius: 7px;
    background: #fbfdff;
}

.stock-split-balance-log div {
    display: grid;
    grid-template-columns: 150px 120px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e8eef6;
    color: #334155;
    font-size: 12px;
    line-height: 1.45;
}

.stock-split-balance-log div:last-child {
    border-bottom: 0;
}

.stock-split-balance-log time {
    color: #64748b;
    white-space: nowrap;
}

.stock-split-balance-log b {
    color: #1d4ed8;
    font-size: 11px;
}

.stock-split-balance-log p,
.stock-split-balance-error {
    margin: 14px;
    color: #64748b;
    font-size: 13px;
}

.stock-split-balance-error {
    margin: 0 20px 14px;
    color: #b91c1c;
}

.stock-split-balance-btn {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.stock-split-card {
    border: 1px solid #dbeafe;
    border-left: 4px solid #1677ff;
    border-radius: 8px;
    padding: 12px;
    background: #fbfdff;
}

.stock-split-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.stock-split-card-head strong {
    display: block;
    color: #111827;
    font-size: 16px;
}

.stock-split-card-head code {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1677ff;
    font-weight: 700;
}

.stock-split-card-head span {
    color: #64748b;
    font-size: 12px;
}

.stock-split-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stock-split-metrics div {
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
}

.stock-split-metrics span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.stock-split-metrics strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 14px;
}

.stock-split-form {
    display: grid;
    grid-template-columns: 90px auto 90px minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.stock-split-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
}

.stock-split-form input {
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    padding: 0 8px;
    background: #fff;
}

.stock-split-form em {
    align-self: center;
    color: #64748b;
    font-style: normal;
    font-weight: 700;
}

.stock-split-form button {
    height: 32px;
    white-space: nowrap;
}

.stock-split-warning,
.stock-split-error {
    margin: 10px 0 0;
    padding: 9px 10px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff1f2;
    color: #be123c;
    font-size: 12px;
}

.stock-split-error strong,
.stock-split-error span {
    display: block;
}

.stock-split-ok,
.stock-split-empty {
    margin: 16px;
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
}

.stock-split-ok strong {
    display: block;
    margin-bottom: 6px;
    color: #166534;
    font-size: 16px;
}

.stock-split-history-table {
    box-shadow: none;
    margin: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.stock-split-history-table table {
    min-width: 980px;
}

.stock-split-history-table th,
.stock-split-history-table td {
    font-size: 12px;
}

.stock-split-card .sim-profit,
.stock-split-card .sim-loss {
    font-weight: 800;
}

@media (max-width: 1100px) {
    .stock-split-detect-toolbar {
        grid-template-columns: 1fr;
    }

    .stock-split-manual-panel {
        grid-template-columns: 1fr;
    }

    .stock-split-manual-intro {
        padding: 0 0 12px;
        border-right: 0;
        border-bottom: 1px solid #fed7aa;
    }

    .stock-split-manual-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-split-manual-remark {
        grid-column: 1 / -1;
    }

    .stock-split-confirm-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================
   移动端：只保留逻辑盘管理与账本服务
   ========================================== */
.mobile-app-tabs {
    display: none;
}

@media (max-width: 760px) {
    body {
        display: block;
    }

    .mobile-app-tabs {
        position: fixed;
        inset: 0 0 auto;
        z-index: 220;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        height: 54px;
        padding: 6px 12px;
        border-bottom: 1px solid #dce6f3;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    }

    .mobile-app-tabs button {
        height: 38px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #64748b;
        font-size: 15px;
        font-weight: 800;
        cursor: pointer;
    }

    .mobile-app-tabs button.active {
        background: #eaf3ff;
        color: #0958d9;
    }

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        margin-left: 0;
        padding: 68px 12px 24px;
    }

    .logic-test-banner {
        margin-bottom: 12px;
        font-size: 13px;
        line-height: 36px;
    }

    .logic-workbar {
        justify-content: flex-end;
        gap: 0;
        margin-bottom: 12px;
    }

    .logic-title-block,
    .logic-header-tools > .btn-primary,
    .logic-broker-actions,
    .logic-card-menu,
    .logic-copy-btn,
    .logic-equity-toolbar > .btn-primary,
    #ledgerWorkerClientPanel {
        display: none !important;
    }

    .logic-header-tools {
        width: auto;
    }

    .logic-auto-panel {
        gap: 8px;
        min-width: 248px;
        padding: 5px 7px;
        border: 1px solid #dce6f3;
        border-radius: 7px;
        background: #fff;
    }

    .logic-auto-status {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logic-card-list {
        gap: 14px;
    }

    .logic-broker-group,
    .logic-broker-group.collapsed {
        padding: 0;
        overflow: hidden;
        border-radius: 9px;
    }

    .logic-broker-strip,
    .logic-broker-group.collapsed .logic-broker-strip {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        margin: 0;
        padding: 12px;
        border-radius: 0;
    }

    .logic-broker-identity {
        grid-column: 1;
        grid-row: 1;
        gap: 2px;
    }

    .logic-broker-title-row h4 {
        font-size: 15px;
    }

    .logic-broker-identity > span {
        display: none;
    }

    .logic-broker-identity > strong {
        font-size: 12px;
        font-weight: 700;
    }

    .logic-broker-actions {
        grid-column: 2;
        grid-row: 1;
        align-items: start;
        justify-content: flex-end;
        gap: 6px;
    }

    .logic-broker-actions .btn-primary {
        min-width: 46px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }

    .logic-broker-metrics {
        grid-column: 1 / -1;
        grid-row: 2;
        display: block;
        min-width: 0;
    }

    .logic-broker-metrics > div:not(.logic-broker-position-usage) {
        display: none;
    }

    .logic-broker-metrics .logic-broker-position-usage {
        width: fit-content;
        min-width: 0;
        height: 28px;
        margin: 0;
        padding: 0 10px;
        gap: 7px;
    }

    .logic-broker-metrics .logic-broker-position-usage span {
        font-size: 11px;
    }

    .logic-broker-metrics .logic-broker-position-usage strong {
        font-size: 15px;
    }

    .logic-child-summary-grid,
    .logic-child-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .logic-account-summary {
        width: 100%;
        min-height: 96px;
        padding: 13px 14px;
        gap: 10px;
        border-radius: 8px;
    }

    .logic-account-summary-name {
        font-size: 15px;
        font-weight: 850;
    }

    .logic-account-summary-stats {
        gap: 10px;
        padding-top: 9px;
        border-top: 1px solid #edf1f7;
    }

    .logic-account-summary-stats > div {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 5px;
    }

    .logic-account-summary-stats em {
        font-size: 11px;
    }

    .logic-pnl-pill {
        min-width: 70px;
        min-height: 23px;
        font-size: 14px;
    }

    .logic-account-card {
        width: 100%;
        max-width: none;
        min-height: 0;
        padding: 15px;
    }

    .logic-detail-panel {
        margin: 0;
        border-left: 3px solid #52c41a;
        border-radius: 8px;
    }

    .logic-detail-header {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .logic-detail-title strong {
        font-size: 18px;
    }

    .logic-detail-title code {
        font-size: 13px;
    }

    .logic-detail-close {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }

    .logic-detail-meta {
        gap: 7px 12px;
        font-size: 11px;
    }

    .sim-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .sim-tabs::-webkit-scrollbar {
        display: none;
    }

    .logic-detail-panel .table-container,
    .logic-detail-panel .sim-tab-pane {
        overflow-x: auto;
    }

    .logic-detail-panel table {
        min-width: 760px;
    }

    .ledger-worker-page {
        max-width: none;
    }

    .ledger-worker-shell {
        gap: 12px;
    }

    .ledger-worker-header {
        padding: 2px 0 4px;
    }

    .ledger-worker-header h3 {
        margin-bottom: 4px;
        font-size: 19px;
    }

    .ledger-worker-client-card,
    .ledger-worker-client-warning {
        gap: 10px;
        padding: 12px;
    }

    .ledger-worker-client-actions {
        width: 100%;
    }

    .ledger-worker-client-actions .btn-secondary {
        width: 100%;
    }

    .ledger-worker-command-details pre {
        max-height: 220px;
        font-size: 11px;
    }

    .ledger-worker-config-grid {
        grid-template-columns: 1fr;
    }

    .ledger-worker-main {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .ledger-worker-section-head {
        align-items: flex-start;
    }

    .ledger-worker-section-head span {
        max-width: 52%;
        text-align: right;
    }

    .ledger-worker-state-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ledger-worker-state-card {
        padding: 13px;
    }

    .ledger-worker-state-meta {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 8px 10px;
        font-size: 12px;
    }

    .ledger-worker-console-head {
        padding: 12px;
    }

    .ledger-worker-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .ledger-worker-actions select,
    .ledger-worker-actions .btn-primary {
        width: 100%;
    }

    .ledger-worker-actions .btn-primary {
        grid-column: 1 / -1;
        height: 34px;
    }

    .ledger-worker-console {
        height: 520px;
        padding: 8px 10px;
    }

    .ledger-worker-log-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 10px;
        padding: 10px 0;
    }

    .ledger-worker-log-row span {
        grid-column: 1;
        font-size: 11px;
    }

    .ledger-worker-log-row b {
        grid-column: 2;
        text-align: right;
        font-size: 11px;
    }

    .ledger-worker-log-row em,
    .ledger-worker-log-row strong,
    .ledger-worker-log-row small {
        grid-column: 1 / -1;
    }

    .ledger-worker-log-row em {
        margin-top: 2px;
        font-size: 11px;
    }

    .ledger-worker-log-row strong {
        font-size: 12px;
        line-height: 1.55;
    }
}

/* 实盘逻辑盘页：复刻模拟盘“容量概览 + 策略比较表格 + 详情页”的交互。 */
#live-logic-page #liveLogicAccountTable.live-logic-card-list {
    display: block;
    width: 100%;
}

#live-logic-page .live-logic-compare-overview {
    margin-top: 0;
}

#live-logic-page .live-security-capacity-summary {
    min-width: 420px;
    text-align: left;
}

#live-logic-page .live-logic-compare-table td:nth-child(2) {
    min-width: 260px;
}

#live-logic-page .live-logic-compare-row td strong {
    display: block;
}

#live-logic-page .live-logic-compare-row td > span,
#live-logic-page .live-logic-compare-row td > small,
#live-logic-page .live-logic-compare-row .logic-compare-broker > span {
    display: block;
    margin-top: 4px;
    color: #8b95a1;
    font-size: 12px;
}

#live-logic-page .logic-compare-strategy .logic-strategy-note {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

#live-logic-page .logic-compare-name {
    padding: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 14px;
    font-weight: 850;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}

#live-logic-page .logic-compare-name:hover {
    color: #1677ff;
}

#live-logic-page .logic-compare-subline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

#live-logic-page .logic-compare-subline code,
#live-logic-page .logic-compare-subline span,
#live-logic-page .logic-compare-subline button {
    margin-top: 0;
}

#live-logic-page .logic-run-at-inline {
    color: #b26a00 !important;
    font-weight: 800;
}

.live-security-account-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.live-security-account-row:hover {
    background: #f6faff;
}

.live-security-account-row.active {
    background: #eef6ff;
}

.live-security-detail-row > td {
    padding: 0 !important;
    background: #f4f7fb;
}

.live-security-detail-panel {
    display: block;
    margin: 0;
    border: 1px solid #d8e8ff;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    box-shadow: inset 0 1px 0 rgba(22, 119, 255, 0.08);
}

.live-security-detail-header {
    position: relative;
}

.live-security-actual-panel {
    margin: 0 18px 16px;
    padding: 14px;
    border: 1px solid #d8e8ff;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
}

.live-security-actual-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: #24405f;
    flex-wrap: wrap;
}

.live-security-actual-title strong {
    font-size: 15px;
}

.live-security-actual-title span {
    color: #60758f;
    font-size: 12px;
}

.live-security-actual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.live-security-actual-card {
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid rgba(30, 112, 205, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(20, 78, 138, 0.06);
}

.live-security-actual-card.primary {
    border-color: rgba(22, 119, 255, 0.28);
    background: #ffffff;
}

.live-security-actual-card span,
.live-security-actual-card small {
    display: block;
    color: #6a7d91;
    font-size: 12px;
}

.live-security-actual-card strong {
    display: block;
    margin: 5px 0 3px;
    color: #16324f;
    font-size: 16px;
}

.live-security-tabs {
    padding-left: 18px;
    background: #fff;
}

.live-security-tab-content {
    background: #fff;
}
