/*
 * 三元风控后台视觉样式。
 * 颜色、间距、圆角统一定义为变量，后期换肤时优先修改这里，避免全文件搜索替换。
 */
:root {
    --ink: #17202a;
    --muted: #718096;
    --line: #e4e9ef;
    --canvas: #f2f5f7;
    --card: #ffffff;
    --nav: #101e26;
    --nav-soft: #19313a;
    --accent: #ef6c45;
    --accent-dark: #d95631;
    --teal: #267c75;
    --success: #1c8b66;
    --warning: #c7812a;
    --danger: #c94444;
    --shadow: 0 18px 50px rgba(25, 43, 51, .10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.align-right { text-align: right !important; }
.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
}

/* 登录页：左右分栏仅在桌面展示，移动端保留紧凑登录卡片。 */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); background: #f7f8f8; }
.login-art {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 9vw;
    color: #f8f4ed;
    background:
        radial-gradient(circle at 16% 24%, rgba(239,108,69,.25), transparent 30%),
        radial-gradient(circle at 85% 82%, rgba(54,139,129,.25), transparent 35%),
        linear-gradient(145deg, #102129 0%, #172f38 55%, #0d1a20 100%);
}
.login-art::before, .login-art::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
}
.login-art::before { top: -170px; right: -120px; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.login-art::after { bottom: -210px; left: -100px; box-shadow: 0 0 0 65px rgba(255,255,255,.025); }
.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--accent);
    border-radius: 11px;
    font: 800 20px/1 Georgia, serif;
    box-shadow: 0 8px 22px rgba(239,108,69,.3);
}
.brand-mark--large { width: 56px; height: 56px; margin-bottom: 42px; border-radius: 16px; font-size: 30px; }
.login-art h1 { position: relative; z-index: 1; margin: 6px 0 24px; font-size: clamp(38px, 4vw, 64px); line-height: 1.16; letter-spacing: -.04em; }
.login-intro { max-width: 580px; margin: 0; color: #abc0c7; font-size: 16px; line-height: 1.8; }
.frequency-strip { display: flex; gap: 10px; margin-top: 52px; }
.frequency-strip span { padding: 10px 15px; color: #a9bdc4; border: 1px solid rgba(255,255,255,.12); border-radius: 99px; background: rgba(255,255,255,.035); }
.frequency-strip b { margin-right: 7px; color: #fff; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(100%, 420px); }
.login-card h2 { margin: 4px 0 10px; font-size: 34px; letter-spacing: -.035em; }
.login-card > .muted { margin-bottom: 34px; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 40px; font-weight: 800; font-size: 18px; }
.login-hint { margin: 24px 0 0; text-align: center; color: #95a0aa; font-size: 12px; }

/* 表单组件。 */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span { color: #3c4b57; font-size: 13px; font-weight: 700; }
.field em { color: var(--accent); font-style: normal; }
.field small, .switch-row small { color: #94a0aa; font-size: 11px; line-height: 1.5; }
.field input, .field textarea, .field select {
    width: 100%;
    color: var(--ink);
    background: #fff;
    border: 1px solid #dbe2e7;
    border-radius: 11px;
    outline: 0;
    transition: border-color .18s, box-shadow .18s;
}
.field input, .field select { height: 46px; padding: 0 14px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #718096 50%), linear-gradient(135deg, #718096 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { min-height: 80px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(38,124,117,.1); }
.field input:disabled { color: #89939b; background: #f3f5f6; }
.config-field textarea { color: #2f3b43; background: #f8fafb; font: 12px/1.55 Consolas, "SFMono-Regular", monospace; tab-size: 2; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid--three { grid-template-columns: 1fr 1.3fr .7fr; }
.field--full { grid-column: 1 / -1; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 4px 0 20px; padding: 14px 16px; background: #f6f8f9; border-radius: 12px; }
.switch-row > span { display: flex; flex-direction: column; gap: 4px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 44px; height: 24px; flex: 0 0 auto; background: #cbd3d8; border-radius: 99px; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch-row input:checked + i { background: var(--teal); }
.switch-row input:checked + i::after { transform: translateX(20px); }

/* 基础计划结构化表单：内部仍保存分区配置，但管理员只接触业务字段和明确单位。 */
.inherited-config { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 18px; padding: 15px 17px; color: #315d59; background: #eaf4f2; border: 1px solid #d1e7e2; border-radius: 12px; }
.inherited-config span { align-self: center; font-size: 11px; font-weight: 800; }
.inherited-config strong { font-size: 14px; }
.inherited-config small { grid-column: 2; color: #718d89; font-size: 10px; }
.config-sections { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; }
.config-section { padding: 20px; background: #f9fbfb; border: 1px solid var(--line); border-radius: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid #e5ebed; }
.section-title > div { display: flex; align-items: center; gap: 10px; }
.section-title > div > span { width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--teal); border-radius: 8px; font-size: 10px; font-weight: 800; }
.section-title h4 { margin: 0; color: #26363e; font-size: 16px; }
.section-title small { color: #8b989f; font-size: 10px; text-align: right; }
.sub-config { margin-top: 14px; padding: 16px; background: #fff; border: 1px solid #e4eaed; border-radius: 11px; }
.sub-config .field:last-child { margin-bottom: 0; }
.nested-config { margin-top: 12px; background: #f8fafb; }
.sub-config h5 { margin: 4px 0 15px; color: #52616a; font-size: 12px; }
.mode-card { margin-top: 10px; padding: 14px 16px; background: #fff; border: 1px solid #e3e9ec; border-radius: 12px; }
.mode-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mode-head > div { display: flex; flex-direction: column; gap: 4px; }
.mode-head strong { color: #34434b; font-size: 13px; }
.mode-head small { color: #929da5; font-size: 10px; }
.compact-field { width: min(100%, 430px); margin-bottom: 0; }
.input-unit { width: 100%; display: flex; align-items: stretch; }
.field .input-unit input { width: auto; min-width: 0; flex: 1; border-radius: 11px 0 0 11px; }
.input-unit > span { display: flex; align-items: center; padding: 0 12px; color: #65747d; background: #edf1f3; border: 1px solid #dbe2e7; border-left: 0; border-radius: 0 11px 11px 0; font-size: 10px; white-space: nowrap; }
.inherited-value { min-height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 7px 14px; color: #41535c; background: #f3f6f7; border: 1px solid #dbe2e7; border-radius: 11px; }
.inherited-value strong { font-size: 12px; }
.inherited-value small { color: #87949b; font-size: 10px; }
.hedge-strategy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.hedge-strategy-option { position: relative; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px; color: #40515b; background: #fff; border: 1px solid #dbe3e6; border-radius: 11px; cursor: pointer; transition: border-color .16s, box-shadow .16s, background .16s; }
.hedge-strategy-option:hover { border-color: #9ccdc7; background: #fbfefd; }
.hedge-strategy-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }
.hedge-strategy-option:has(input:checked) { border-color: #69b3aa; background: #edf8f6; box-shadow: inset 0 0 0 1px #69b3aa; }
.hedge-strategy-option__content { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hedge-strategy-option__content strong { overflow: hidden; color: #23323a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hedge-strategy-option__content small { color: #839198; font-size: 10px; line-height: 1.45; }
.hedge-strategy-option em { padding: 4px 7px; color: #20756d; background: #e2f2ef; border-radius: 99px; font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.hedge-strategy-option.is-disabled { cursor: not-allowed; opacity: .68; }
.hedge-strategy-option.is-disabled em { color: #936828; background: #fff1d7; }
.hedge-condition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hedge-condition-grid .mode-card { min-width: 0; }
.instrument-picker { position: relative; }
.instrument-picker__trigger { width: 100%; height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #dbe2e7; border-radius: 11px; font-size: 12px; text-align: left; }
.instrument-picker__trigger:hover, .instrument-picker.is-open .instrument-picker__trigger { border-color: var(--teal); }
.instrument-picker.is-open .instrument-picker__trigger { box-shadow: 0 0 0 3px rgba(38,124,117,.1); }
.instrument-picker__trigger i { width: 7px; height: 7px; flex: 0 0 auto; border-right: 2px solid #718096; border-bottom: 2px solid #718096; transform: rotate(45deg) translateY(-2px); transition: transform .16s; }
.instrument-picker.is-open .instrument-picker__trigger i { transform: rotate(225deg) translate(-2px, -2px); }
.instrument-picker__dropdown { position: absolute; z-index: 40; top: 52px; left: 0; width: 100%; padding: 10px; background: #fff; border: 1px solid #dbe2e7; border-radius: 12px; box-shadow: 0 14px 34px rgba(25,43,51,.16); }
.field .instrument-picker__search { height: 38px; margin-bottom: 8px; border-radius: 8px; font-size: 11px; }
.instrument-picker__options { max-height: 230px; overflow-y: auto; }
.instrument-option { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background .14s; }
.instrument-option:hover { background: #f1f7f6; }
.instrument-option input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--teal); }
.instrument-option__name { min-width: 0; flex: 1; color: #45545d; font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instrument-option__badge { padding: 3px 6px; color: #9a6a2c; background: #fff3db; border-radius: 99px; font-size: 9px; font-weight: 750; }
.instrument-option.is-removed { cursor: not-allowed; opacity: .45; }
.instrument-picker__empty { margin: 6px 4px 2px; padding: 12px; color: #8b989f; background: #f6f8f9; border-radius: 8px; font-size: 10px; text-align: center; }
.instrument-picker__selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cycle-picker__dropdown { padding: 13px; }
.cycle-picker__options { gap: 8px; }
.cycle-picker__options label span { min-width: 48px; justify-content: center; }
.instrument-selected-tag { min-height: 28px; display: inline-flex; align-items: center; gap: 7px; padding: 0 8px 0 10px; color: #226c65; background: #e7f3f1; border: 1px solid #bee0da; border-radius: 8px; font-size: 10px; font-weight: 750; }
.instrument-selected-tag.is-historical { color: #8a6228; background: #fff4df; border-color: #ecd5a8; }
.instrument-selected-tag button { width: 18px; height: 18px; display: grid; place-items: center; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 50%; font-size: 15px; line-height: 1; }
.instrument-selected-tag button:hover { background: rgba(0,0,0,.07); }
.option-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.option-chips label { position: relative; cursor: pointer; }
.option-chips input { position: absolute; opacity: 0; pointer-events: none; }
.option-chips span { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; color: #607079; background: #fff; border: 1px solid #dbe3e6; border-radius: 9px; font-size: 11px; font-weight: 700; transition: .16s; }
.option-chips input:checked + span { color: #1d6e66; background: #e6f3f0; border-color: #8fc8c0; box-shadow: inset 0 0 0 1px #8fc8c0; }
.option-chips input:disabled + span { cursor: not-allowed; opacity: .48; }
.signal-catalog__status { display: flex; align-items: center; gap: 8px; }
.signal-catalog__status small.is-error { color: var(--danger); }
.signal-channel-plans { display: grid; gap: 10px; margin-top: 12px; }
.signal-channel-plan-row { padding: 13px; background: #fff; border: 1px solid #dfe7e9; border-radius: 11px; }
.signal-channel-plan-row__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.signal-channel-plan-row__head strong { color: #34434b; font-size: 12px; }
.signal-channel-plan-row__head small { color: #849198; font-size: 10px; }
.signal-channel-plan-row .option-chips span { min-height: 31px; }
.signal-channel-plan-row.is-historical { background: #fffaf0; border-color: #ead5ab; }
/* B反向止盈嵌套较深，允许网格字段收缩，避免窄屏被输入框最小宽度撑开。 */
#hedge-b-reverse-picker .field,
#hedge-b-reverse-picker .signal-channel-plan-row { min-width: 0; }
.inline-check { min-height: 40px; display: flex; align-items: center; gap: 8px; color: #52616a; font-size: 11px; font-weight: 700; }
.inline-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.mini-switch { display: inline-flex; align-items: center; gap: 8px; color: #65747d; cursor: pointer; font-size: 10px; font-weight: 700; }
.mini-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mini-switch i { position: relative; width: 38px; height: 21px; background: #cbd3d8; border-radius: 99px; transition: .18s; }
.mini-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .18s; }
.mini-switch input:checked + i { background: var(--teal); }
.mini-switch input:checked + i::after { transform: translateX(17px); }
.config-note { margin: 12px 0 0; padding: 10px 12px; color: #62717a; background: #eef3f4; border-radius: 8px; font-size: 10px; line-height: 1.6; }
.config-note--warning { margin: 0; color: #8a6228; background: #fff4df; }

/* 按钮与状态标签。 */
.button { min-height: 40px; padding: 0 17px; border: 0; border-radius: 10px; font-weight: 750; transition: transform .12s, background .18s, opacity .18s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button--wide { width: 100%; min-height: 48px; }
.button--primary { color: #fff; background: var(--accent); box-shadow: 0 8px 18px rgba(239,108,69,.2); }
.button--primary:hover { background: var(--accent-dark); }
.button--ghost { color: #43515b; background: #edf1f3; }
.button--ghost:hover { background: #e2e8eb; }
.button--danger { color: #fff; background: var(--danger); }
.button--small { min-height: 32px; padding: 0 12px; font-size: 12px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; color: #64737d; background: transparent; border: 1px solid var(--line); border-radius: 10px; font-size: 19px; }
.icon-button:hover { color: var(--ink); background: #f3f6f7; }
.text-button { padding: 5px 7px; color: var(--teal); background: none; border: 0; font-size: 12px; font-weight: 750; }
.text-button:disabled { cursor: not-allowed; opacity: .5; }
.text-button--danger { color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge--published, .badge--enabled { color: #167256; background: #e4f5ee; }
.badge--draft { color: #9a681f; background: #fff2d9; }
.badge--disabled { color: #65727a; background: #edf0f2; }
.badge--pending { color: #a54b2e; background: #fdebe4; }
.channel-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.channel-tag { padding: 3px 6px; color: #46606a; background: #edf3f4; border-radius: 5px; font: 700 10px/1.2 monospace; }

/* 后台主体布局。 */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #dce7e8; background: var(--nav); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 32px; }
.sidebar-brand div { display: flex; flex-direction: column; gap: 2px; }
.sidebar-brand strong { color: #fff; font-size: 16px; }
.sidebar-brand small { color: #72909a; font-size: 11px; }
.sidebar-nav { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 6px; overflow-y: auto; scrollbar-width: thin; }
.sidebar-nav > .nav-item, .contract-nav-group { flex-shrink: 0; }
/* 原生details提供键盘展开与可访问状态；子菜单不改变现有权限控制。 */
.contract-nav-toggle { list-style: none; cursor: pointer; user-select: none; }
.contract-nav-toggle::-webkit-details-marker { display: none; }
.contract-nav-toggle::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.contract-nav-group[open] > .contract-nav-toggle::after { transform: rotate(45deg); }
.contract-nav-group.has-active-child > .contract-nav-toggle { color: #fff; }
.contract-nav-group:not([open]).has-active-child > .contract-nav-toggle { background: var(--nav-soft); }
.contract-nav-submenu { display: flex; flex-direction: column; gap: 4px; margin: 5px 0 7px 20px; padding-left: 9px; border-left: 1px solid rgba(255,255,255,.12); }
.contract-nav-submenu .nav-item { height: 40px; padding-inline: 9px; font-size: 12px; }
.contract-nav-submenu .nav-icon { font-size: 16px; }

/* 现货三个子页复用合约卡片和筛选组件，局部样式不影响原合约表单。 */
.spot-toolbar, .spot-model-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.spot-toolbar p { margin: 7px 0; }
.spot-toolbar .actions { flex-wrap: wrap; }
.spot-model-tabs { justify-content: flex-start; }
.spot-model-tabs .is-selected { color: #1d6e66; background: #e6f3f0; border-color: #8fc8c0; }
.spot-card { margin-bottom: 20px; padding: 22px; min-width: 0; }
.spot-card .card-header { padding: 0 0 18px; flex-wrap: wrap; gap: 12px; }
.spot-card h3, .spot-card h4 { margin-top: 0; }
.spot-card h4 { margin-bottom: 8px; }
.spot-box { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; min-width: 0; }
.spot-box > summary { cursor: pointer; font-weight: 600; padding: 6px 0; overflow-wrap: anywhere; }
.spot-box > summary .badge { margin-left: 10px; }
.spot-box > legend { color: #34434b; font-size: 13px; font-weight: 700; padding-inline: 7px; }
.spot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 16px; }
.spot-check { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0; }
.spot-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.spot-filter .form-grid, .spot-filter .field, .spot-card .field { min-width: 0; }
/* 模型的四项条件都归属频道卡片，间距和边界不影响其他筛选页面。 */
.spot-model-channel .spot-channel-label { display:block; margin:12px 0 8px; color:#576c76; font-size:12px; }
.spot-model-channel .spot-channel-fields { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.spot-card .field input, .spot-card .field select, .spot-profile-select select { width: 100%; max-width: 100%; }
.spot-profile-select { max-width: 360px; margin-bottom: 18px; }
.spot-unit-summary { display: grid; gap: 5px; color: #60717b; font-size: 11px; white-space: nowrap; }
.spot-plans-table { min-width: 880px; }
.spot-plan-editor .plan-editor-card, .spot-plan-editor .config-section { min-width: 0; }
.spot-plan-editor .form-grid, .spot-plan-editor .field { min-width: 0; }
.spot-plan-editor .field input, .spot-plan-editor .field select { max-width: 100%; }
.spot-plan-editor .mode-card + .mode-card { margin-top: 14px; }
.spot-plan-editor .plan-editor-actions { border-radius: 0 0 var(--radius) var(--radius); }
.spot-plan-editor .plan-toolbar .plan-strategy-options { flex-shrink: 0; }
.spot-plan-editor .plan-toolbar p { line-height: 1.6; }
.spot-picker { border: 1px solid #dbe3e6; border-radius: 9px; background: #fff; padding: 11px; }
.spot-picker > summary { cursor: pointer; overflow-wrap: anywhere; }
.spot-picker[open] > .field { margin-top: 14px; }
.spot-filter .signal-catalog__status { flex-wrap: wrap; overflow-wrap: anywhere; }
.spot-filter .signal-catalog__status .button { min-height: 30px; padding: 5px 10px; }
.spot-instrument-picker > summary { list-style: none; cursor: pointer; }
.spot-instrument-picker > summary::-webkit-details-marker { display: none; }
.spot-instrument-picker[open] > summary { border-color: var(--teal); }
.spot-instrument-picker[open] > summary i { transform: rotate(225deg) translate(-2px, -2px); }
.spot-instrument-picker .instrument-option input { width: 16px; height: 16px; }
.spot-instrument-picker .instrument-option__badge { flex-shrink: 0; }
.spot-instrument-picker .instrument-option__name { flex: 0 1 auto; }
.spot-instrument-picker .spot-instrument-category { color: var(--teal); background: #e8f4f1; }
.spot-instrument-picker .spot-instrument-category.is-uncategorized { color: #849099; background: #f1f4f6; }
.spot-filter .option-chips input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 700px) {
    .spot-card, .spot-box { padding: 14px; }
    .spot-filter .form-grid { grid-template-columns: minmax(0, 1fr); }
    .spot-toolbar > div, .spot-toolbar > .actions { width: 100%; }
    .spot-plan-editor .plan-editor-actions { bottom: 66px; flex-wrap: wrap; }
    .spot-plan-editor .plan-toolbar > .plan-strategy-picker { width: 100%; }
    .spot-card .signal-channel-plan-row__head { align-items: flex-start; flex-direction: column; gap: 5px; }
}
.nav-item { width: 100%; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: #89a3aa; background: transparent; border: 0; border-radius: 11px; font-weight: 700; text-align: left; }
.nav-item:hover { color: #dce7e8; background: rgba(255,255,255,.04); }
.nav-item.is-active { color: #fff; background: var(--nav-soft); }
.nav-icon { width: 22px; color: var(--accent); font-size: 20px; text-align: center; }
.sidebar-foot { display: grid; grid-template-columns: 36px 1fr 32px; align-items: center; gap: 10px; margin-top: auto; padding: 16px 7px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: #2a5d61; border-radius: 10px; font-weight: 800; }
.sidebar-user { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user strong { overflow: hidden; color: #e8efef; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #67858e; font-size: 10px; }
.sidebar-foot .icon-button { width: 32px; height: 32px; color: #79929a; border-color: transparent; }
.workspace { min-width: 0; padding: 0 38px 50px; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h2 { margin: 5px 0 0; font-size: 26px; letter-spacing: -.035em; }
.breadcrumb { margin: 0; color: #89949d; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: #54706b; background: #e7f2ef; border-radius: 99px; font-size: 11px; font-weight: 700; }
.status-pill i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(28,139,102,.1); }

/* 自动退出中心环境横幅：正式资金和阻断状态使用红色，不与普通运行指标混淆。 */
.environment-banner { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(260px,1.2fr); gap:16px; margin-bottom:18px; padding:18px 20px; border:1px solid #c7ddd7; border-radius:18px; background:#f4faf8; }
.environment-banner__identity,.environment-banner__activity { display:grid; gap:6px; min-width:0; }
.environment-banner span { color:var(--muted); font-size:11px; }
.environment-banner strong { color:#1d4d42; font-size:15px; overflow-wrap:anywhere; }
.environment-banner small { color:#617c75; font-size:11px; }
.environment-banner.is-production { border-color:#efb7bd; background:#fff4f5; }
.environment-banner.is-production strong { color:var(--danger); }
.environment-banner.is-blocked { border-color:#e8aab2; box-shadow:inset 4px 0 0 var(--danger); }
.environment-banner>p { grid-column:1/-1; margin:0; padding-top:12px; border-top:1px solid rgba(140,80,90,.16); color:var(--danger); font-size:12px; font-weight:700; }
@media(max-width:720px){.environment-banner{grid-template-columns:1fr}}
.view-panel { max-width: 1380px; margin: 0 auto; }
.hero-card { min-height: 164px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 32px 36px; color: #f3f7f7; background: linear-gradient(120deg, #19353d, #234b4e); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card--compact { min-height: 140px; }
.hero-card--instrument { background: linear-gradient(120deg, #19353d, #28534f); }
.hero-card--plans { background: linear-gradient(120deg, #25353f, #3d6268); }
.hero-card--members { background: linear-gradient(120deg, #18323d, #31565b); }
.hero-card--signals { background: linear-gradient(120deg, #30264a, #5c4777); }
.hero-card--take-profit { background: linear-gradient(120deg, #173f3b, #286a5e); }
.hero-card--add-position { background: linear-gradient(120deg, #3c2d20, #8a5a2f); }
.hero-card--system-settings { background: linear-gradient(120deg, #3b315a, #65548a); }
.take-profit-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.filter-bar--take-profit { grid-template-columns: minmax(210px, 1.3fr) minmax(180px, 1fr) 160px auto; }
.take-profit-price-stack { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.take-profit-price-stack small { color: var(--muted); }
.filter-bar--add-position { grid-template-columns: minmax(190px, 1.25fr) minmax(165px, 1fr) 105px 150px 130px auto; }
.add-position-price-stack { display: grid; gap: 3px; min-width: 145px; font-variant-numeric: tabular-nums; }
.add-position-price-stack small { color: var(--muted); overflow-wrap: anywhere; }
.add-position-detail { max-height: 90vh; overflow-y: auto; }
.add-position-detail h4 { margin-top: 22px; }
.add-position-detail .table-wrap { overflow-x: auto; }
.add-position-parameter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.add-position-parameter-grid .member-summary-item { min-width: 0; }
#add-position-view .signal-health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#add-position-view .metric-card small { display: block; margin-top: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.system-settings-grid { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(580px, 1.4fr); gap: 18px; }
.manual-risk-form { align-self: start; overflow: visible; }
.manual-risk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 22px 24px 8px; }
.manual-risk-fields textarea { width: 100%; resize: vertical; }
.manual-risk-rules { display: grid; gap: 6px; margin: 15px 24px; padding: 14px 16px; color: #715222; background: #fff7e8; border: 1px solid #efddb7; border-radius: 11px; font-size: 11px; line-height: 1.55; }
.manual-risk-rules strong { color: #4e3b1c; }
.manual-risk-actions { display: flex; justify-content: flex-end; padding: 4px 24px 22px; }
.manual-risk-history { min-width: 0; }
.manual-risk-history .table-wrap { max-height: 570px; }
.manual-risk-history th { position: sticky; z-index: 1; top: 0; }
.manual-risk-values { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.manual-risk-values strong { color: #27353d; }
.manual-risk-values span { color: var(--muted); }
.manual-risk-reason { min-width: 180px; max-width: 300px; white-space: normal; line-height: 1.5; }
.metric-time { font-size: 17px !important; letter-spacing: 0 !important; }
.signal-health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-bar--signals { grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1fr) 120px 150px auto; }
.signal-detail { display: flex; flex-direction: column; gap: 16px; }
.signal-decision-table { max-height: 350px; border: 1px solid var(--line); border-radius: 12px; }
.signal-raw { padding: 13px 15px; background: #f7f9f9; border: 1px solid #e7ecee; border-radius: 11px; }
.signal-raw summary { cursor: pointer; color: var(--teal); font-size: 11px; font-weight: 750; }
.signal-raw pre { max-height: 260px; overflow: auto; color: #34424b; font-size: 10px; white-space: pre-wrap; word-break: break-all; }
.hero-card h3 { margin: 2px 0 9px; font-size: 27px; letter-spacing: -.025em; }
.hero-card p:last-child { max-width: 620px; margin: 0; color: #a7c1c4; line-height: 1.65; }
.hero-card--instrument p:not(.eyebrow) { max-width: 680px; margin: 0; color: #a7c1c4; line-height: 1.65; }
.hero-meta { display: block; margin-top: 13px; color: #7fa5a5; font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.metric-card { padding: 21px 23px; background: var(--card); border: 1px solid rgba(221,228,232,.8); border-radius: 15px; box-shadow: 0 6px 20px rgba(25,43,51,.04); }
.metric-card span { display: block; color: #65737d; font-size: 12px; font-weight: 700; }
.metric-card strong { display: inline-block; margin: 8px 10px 0 0; font-size: 30px; letter-spacing: -.04em; }
.metric-card small { color: #9aa4ac; }
.data-card { margin-top: 18px; background: var(--card); border: 1px solid rgba(221,228,232,.85); border-radius: var(--radius); box-shadow: 0 10px 34px rgba(25,43,51,.055); overflow: hidden; }
.filter-bar { display: grid; grid-template-columns: minmax(190px, 1.6fr) repeat(3, minmax(125px, .7fr)) auto; align-items: end; gap: 11px; padding: 18px; border-bottom: 1px solid var(--line); background: #fafcfc; }
.filter-bar--plans { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.filter-bar--plans p { margin: 0; color: var(--muted); font-size: 12px; }
.plan-strategy-picker { min-width: 0; display: flex; align-items: center; gap: 12px; }
.plan-strategy-picker__label { flex: 0 0 auto; color: #596873; font-size: 12px; font-weight: 750; }
.plan-strategy-options { min-width: 0; display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: #edf2f6; border-radius: 12px; scrollbar-width: thin; }
.plan-strategy-option { flex: 0 0 auto; min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; color: #52646f; background: transparent; border: 0; border-radius: 9px; font-size: 12px; font-weight: 800; white-space: nowrap; transition: color .16s, background .16s, box-shadow .16s; }
.plan-strategy-option:hover { color: var(--ink); background: rgba(255,255,255,.66); }
.plan-strategy-option.is-active { color: #fff; background: #173c45; box-shadow: 0 4px 10px rgba(23,60,69,.2); }
.plan-strategy-option__pending { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; color: #a54a22; background: #fff0e7; border: 1px solid #f2c3ad; border-radius: 999px; font-size: 9px; font-weight: 850; line-height: 1; }
.plan-strategy-option.is-active .plan-strategy-option__pending { color: #8c3b1c; background: #fff; border-color: #ffd0bb; }
.plan-strategy-options__empty { min-height: 36px; display: inline-flex; align-items: center; padding: 0 13px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filter-field { margin: 0; }
.filter-field input, .filter-field select { height: 40px; background-color: #fff; font-size: 12px; }
.filter-actions { display: flex; gap: 7px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.card-heading h3 { margin: 0 0 5px; font-size: 17px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 12px; }

/* 数据表格。 */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: middle; }
th { color: #89949d; background: #fafbfb; font-size: 10px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
td { color: #46535c; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdfd; }
.primary-cell { display: flex; flex-direction: column; gap: 4px; }
.primary-cell strong { color: #1d2a32; font-size: 13px; }
.primary-cell small { max-width: 340px; overflow: hidden; color: #929da5; text-overflow: ellipsis; white-space: nowrap; }
.price-cell { min-width: 132px; display: flex; flex-direction: column; gap: 4px; cursor: help; }
.price-cell strong { color: #27353d; font-size: 13px; font-variant-numeric: tabular-nums; }
.price-cell small { color: #87939b; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-cell.is-up small { color: var(--success); }
.price-cell.is-down small { color: var(--danger); }
.price-cell.is-loading strong, .price-cell.is-unavailable strong { color: #9aa4ac; font-size: 11px; font-weight: 600; }
.actions { display: flex; justify-content: flex-end; gap: 2px; white-space: nowrap; }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--teal); background: #e8f1f0; border-radius: 14px; font-size: 25px; }
.empty-state h4 { margin: 0 0 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination div { display: flex; gap: 7px; }
.audit-detail summary { cursor: pointer; color: var(--teal); font-weight: 700; }
.audit-detail pre { max-width: 520px; max-height: 240px; overflow: auto; padding: 10px; color: #34424b; background: #f3f6f7; border-radius: 8px; font-size: 10px; }

/* 会员管理：详情表格保留本地持仓骨架，实时数据未知时绝不以0伪装。 */
.filter-bar--members { grid-template-columns: minmax(220px, 1.5fr) minmax(145px, .7fr) minmax(145px, .7fr) auto; }
.filter-bar--members .filter-actions { flex-wrap: wrap; }
.member-detail { display: flex; flex-direction: column; gap: 16px; }
.member-detail .modal-head { margin-bottom: 2px; }
.member-detail__summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.member-limit-control { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 10px; padding: 13px 15px; background: #f7f9f9; border: 1px solid #e7ecee; border-radius: 11px; }
.member-limit-control input { max-width: 220px; }
.member-limit-control small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.5; }
.member-password-control { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 10px; padding: 13px 15px; background: #f7f9f9; border: 1px solid #e7ecee; border-radius: 11px; }
.member-password-copy { display: grid; align-self: center; gap: 5px; }
.member-password-copy strong { font-size: 13px; }
.member-password-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.member-summary-item { min-width: 0; padding: 13px 15px; background: #f6f8f9; border: 1px solid #e8edef; border-radius: 11px; }
.member-summary-item span { display: block; margin-bottom: 6px; color: #87939b; font-size: 10px; font-weight: 750; }
.member-summary-item strong { display: block; overflow: hidden; color: #26343c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.member-runtime-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px; color: #eff7f6; background: linear-gradient(120deg, #216d68, #2a8580); border-radius: 13px; }
.member-runtime-head > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.member-runtime-head span { color: #bfe1dd; font-size: 11px; font-weight: 750; }
.member-runtime-head small { color: #c9e2df; font-size: 10px; }
.member-pnl { color: #fff; font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.member-pnl.is-profit { color: #baf3d8; }
.member-pnl.is-loss { color: #ffd0c8; }
.member-pnl.is-unknown { color: #d6e4e4; }
.member-runtime-actions { display: flex; align-items: center; gap: 10px; }
.member-runtime-actions .button { color: #e9f5f4; background: rgba(255,255,255,.13); }
.member-runtime-warning { padding: 11px 13px; color: #8a6228; background: #fff4df; border: 1px solid #ecd5a8; border-radius: 9px; font-size: 11px; line-height: 1.55; }
.member-runtime-table { max-height: 390px; border: 1px solid var(--line); border-radius: 12px; }
.member-runtime-table th { position: sticky; z-index: 1; top: 0; }
.member-table-message { padding: 34px 18px; color: var(--muted); text-align: center; }
.member-position-direction { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 750; }
.member-position-direction.is-long { color: var(--success); }
.member-position-direction.is-short { color: var(--danger); }
.member-position-pnl { display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.member-position-pnl.is-profit strong { color: var(--success); }
.member-position-pnl.is-loss strong { color: var(--danger); }
.member-position-pnl.is-unknown strong { color: #8d989f; }
.member-position-pnl small { color: #919ca3; }
.member-add-position { min-width: 220px; margin-top: 7px; color: #66757c; font-size: 10px; }
.member-add-position summary { color: #9a6c20; cursor: pointer; font-weight: 750; line-height: 1.45; white-space: normal; }
.member-add-position__details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 9px; margin-top: 7px; padding: 8px; background: #fff8e9; border: 1px solid #f0dfbb; border-radius: 7px; }
.member-add-position__details span { min-width: 0; overflow-wrap: anywhere; }
.member-add-position__details strong { color: #3e4b52; font-weight: 700; }
.member-add-position__details .is-warning { grid-column: 1 / -1; color: var(--danger); }
.member-risk-list { margin: 17px 0; padding: 14px 14px 14px 34px; color: #5c6870; background: #f7f9f9; border: 1px solid #e7ecee; border-radius: 11px; font-size: 12px; line-height: 1.75; }
.member-confirm-error { margin: 12px 0 0; padding: 10px 12px; color: #9d3535; background: #fdecec; border-radius: 8px; font-size: 11px; }

/* 弹窗。 */
.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,20,25,.62); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(100%, 760px); max-height: calc(100vh - 48px); overflow-y: auto; padding: 26px; background: #fff; border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.26); }
.modal-card--small { width: min(100%, 440px); }
.modal-card--medium { width: min(100%, 720px); }
.modal-card--wide { width: min(100%, 1120px); }
.modal-card--scroll { padding-bottom: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.modal-head h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.modal-head p:last-child { margin: 7px 0 0; }
.modal-close { width: 34px; height: 34px; flex: 0 0 auto; color: #839098; background: #f0f3f4; border: 0; border-radius: 9px; font-size: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 9px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-actions--sticky { position: sticky; bottom: 0; margin: 0 -26px; padding: 16px 26px; background: rgba(255,255,255,.96); box-shadow: 0 -8px 20px rgba(255,255,255,.9); }
.plan-editor { margin-top: 18px; }
.plan-editor-card { width: 100%; padding: 26px 26px 0; background: #fff; border: 1px solid rgba(221,228,232,.85); border-radius: var(--radius); box-shadow: 0 10px 34px rgba(25,43,51,.055); }
.plan-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 -26px 24px; padding: 0 26px 20px; border-bottom: 1px solid var(--line); }
.plan-editor-head h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.plan-section-tabs { position: sticky; z-index: 11; top: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 0 0 22px; padding: 8px 0 12px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.plan-section-tab { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #60717b; background: #fbfcfc; border: 1px solid #d7dfe2; border-radius: 9px; font-size: 12px; text-align: left; transition: color .16s, border-color .16s, background .16s; }
.plan-section-tab span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: #617782; background: #eef2f4; border-radius: 50%; font-size: 10px; font-weight: 850; }
.plan-section-tab strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-section-tab:hover { color: var(--ink); border-color: #c5d0d4; background: #fff; }
.plan-section-tab.is-active { color: var(--accent-dark); border-color: var(--accent); background: #fff8f4; }
.plan-section-tab.is-active span { color: #fff; background: var(--accent); }
.plan-editor-basic { padding: 20px; background: #f9fbfb; border: 1px solid var(--line); border-radius: 14px; }
.plan-editor-actions { position: sticky; z-index: 12; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; margin: 24px -26px 0; padding: 16px 26px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -8px 20px rgba(31,49,57,.06); backdrop-filter: blur(8px); }
.plan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 13px 15px; background: #f5f8f8; border-radius: 11px; }
.plan-toolbar p { margin: 0; color: #718087; font-size: 12px; }
.plan-table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.notice { padding: 12px 14px; color: #8b5920; background: #fff3dc; border: 1px solid #f3dba9; border-radius: 10px; line-height: 1.55; }
.confirm-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 16px; color: #fff; background: var(--danger); border-radius: 14px; font-size: 24px; font-weight: 900; }

/* 轻提示。 */
.toast { position: fixed; z-index: 100; top: 24px; left: 50%; transform: translate(-50%, -20px); max-width: min(90vw, 520px); padding: 12px 17px; color: #fff; background: #22343b; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--danger); }

/* 窄屏适配。 */
@media (max-width: 980px) {
    .login-screen { grid-template-columns: 1fr; }
    .login-art { display: none; }
    .mobile-brand { display: flex; }
    .admin-shell { grid-template-columns: 78px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .sidebar-brand { justify-content: center; padding-inline: 0; }
    .sidebar-brand div, .nav-item span:last-child, .sidebar-user { display: none; }
    .nav-item { justify-content: center; padding: 0; }
    .contract-nav-toggle::after { display: none; }
    .contract-nav-submenu { margin-left: 0; padding-left: 0; border-left: 0; }
    .contract-nav-submenu .nav-item { padding-inline: 0; }
    .sidebar-foot { grid-template-columns: 1fr; justify-items: center; }
    .sidebar-foot .icon-button { display: none; }
    .workspace { padding-inline: 22px; }
    .config-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: repeat(2, 1fr); }
    .member-detail__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .signal-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-settings-grid { grid-template-columns: 1fr; }
    .filter-actions { grid-column: 1 / -1; }
    .plan-section-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .login-panel { padding: 28px; }
    .admin-shell { display: block; }
    .sidebar { position: fixed; z-index: 30; top: auto; bottom: 0; width: 100%; height: 66px; flex-direction: row; align-items: center; padding: 8px 14px; }
    .sidebar-brand, .sidebar-foot { display: none; }
    .sidebar-nav { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; }
    .sidebar-nav > .nav-item, .sidebar-nav > .contract-nav-group { flex: 0 0 auto; width: auto; }
    .sidebar-nav > .nav-item, .contract-nav-toggle { padding-inline: 10px; white-space: nowrap; }
    .contract-nav-submenu { position: fixed; left: 14px; right: 14px; bottom: 74px; z-index: 31; max-height: min(60vh, 340px); margin: 0; padding: 10px; overflow-y: auto; background: var(--nav); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
    .contract-nav-submenu .nav-item { width: 100%; min-height: 42px; flex: 0 0 auto; justify-content: flex-start; padding-inline: 12px; }
    .nav-item { flex: 1; height: 50px; gap: 7px; }
    .nav-item span:last-child { display: inline; }
    .workspace { padding: 0 14px 90px; }
    .topbar { min-height: 88px; }
    .status-pill { display: none; }
    .hero-card { align-items: flex-start; flex-direction: column; padding: 25px; }
    .metric-grid, .form-grid, .form-grid--three, .filter-bar { grid-template-columns: 1fr; }
    .field--full { grid-column: auto; }
    .metric-grid { gap: 9px; }
    .filter-actions { grid-column: auto; }
    .plan-strategy-picker { align-items: flex-start; flex-direction: column; gap: 8px; }
    .plan-strategy-options { width: 100%; }
    .metric-card { padding: 16px 18px; }
    .modal { padding: 0; align-items: end; }
    .modal-card { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
    .plan-editor-card { padding: 20px 18px 0; }
    .plan-editor-head { align-items: stretch; flex-direction: column; margin: 0 -18px 20px; padding: 0 18px 18px; }
    .plan-editor-head .button { width: 100%; }
    .plan-section-tab { padding-inline: 10px; }
    .plan-editor-basic { padding: 16px; }
    .plan-editor-actions { margin-inline: -18px; padding-inline: 18px; }
    .hedge-strategy-options { grid-template-columns: 1fr; }
    .hedge-condition-grid { grid-template-columns: 1fr; }
    .member-detail__summary { grid-template-columns: 1fr 1fr; }
    .filter-bar--signals { grid-template-columns: 1fr; }
    .member-limit-control { grid-template-columns: 1fr; align-items: stretch; }
    .member-limit-control input { max-width: none; }
    .member-limit-control small { grid-column: 1; }
    .member-password-control { grid-template-columns: 1fr; align-items: stretch; }
    .member-runtime-head { align-items: flex-start; flex-direction: column; }
    .member-runtime-actions { width: 100%; justify-content: space-between; }
    .plan-toolbar { align-items: flex-start; flex-direction: column; }
    .section-title, .mode-head { align-items: flex-start; }
    .section-title { flex-direction: column; }
    .section-title small { text-align: left; }
    .inherited-config { grid-template-columns: 1fr; }
    .manual-risk-fields { grid-template-columns: 1fr; padding-inline: 18px; }
    .manual-risk-rules { margin-inline: 18px; }
    .manual-risk-actions { padding-inline: 18px; }
    .inherited-config small { grid-column: 1; }
    .config-section { padding: 16px; }
}
/* 止盈详情只读诊断区：低价币完整精度允许折行，宽表在小屏局部滚动。 */
/* 交易记录沿用后台筛选栏与表格；订单号、低价币精度在局部折行，不撑开整个页面。 */
.filter-bar--trade-records { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.filter-bar--trade-records .filter-actions { align-self: end; }
.trade-records-table { min-width: 1180px; }
.trade-records-table td { max-width: 235px; overflow-wrap: anywhere; }
.trade-records-table th:last-child, .trade-records-table td:last-child { position: sticky; right: 0; min-width: 82px; background: #fff; box-shadow: -4px 0 8px rgba(24, 48, 61, .04); }
.trade-records-table th:last-child { background: #fafcfc; }
.trade-records-table small { display: block; margin-top: 5px; color: var(--text-muted, #64748b); }
.trade-records-detail { width: min(1080px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; }
.trade-records-detail h4 { margin: 24px 0 12px; }
.trade-records-detail .table-wrap { overflow-x: auto; }
.trade-records-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trade-records-facts div { padding: 12px; background: #f5f8fa; border-radius: 8px; overflow-wrap: anywhere; }
.trade-records-facts span { display: block; color: #64748b; font-size: 12px; margin-bottom: 7px; }
.trade-records-facts strong { font-weight: 500; }
@media (max-width: 1000px) {
    .filter-bar--trade-records, .trade-records-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .filter-bar--trade-records, .trade-records-facts { grid-template-columns: 1fr; }
}
.take-profit-risk-summary { display: grid; gap: 4px; min-width: 150px; overflow-wrap: anywhere; font-size: 12px; }
.take-profit-detail { max-height: 90vh; overflow-y: auto; }
.take-profit-detail .table-wrap { overflow-x: auto; }
.take-profit-detail h4 { margin-top: 22px; }
#take-profit-view .signal-health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#take-profit-view .metric-card small { display: block; margin-top: 8px; line-height: 1.5; overflow-wrap: anywhere; }
#take-profit-view .filter-bar--take-profit { grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) 130px auto; }
#take-profit-view .filter-actions .button { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1200px) {
    #take-profit-view .signal-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #take-profit-view .filter-bar--take-profit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #take-profit-view .filter-actions { grid-column: 1 / -1; }
    #add-position-view .signal-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #add-position-view .filter-bar--add-position { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #add-position-view .filter-actions { grid-column: 1 / -1; }
    .add-position-parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    #take-profit-view .filter-bar--take-profit { grid-template-columns: 1fr; }
    #add-position-view .filter-bar--add-position { grid-template-columns: 1fr; }
    .add-position-parameter-grid { grid-template-columns: 1fr; }
}

/* 现货运营页复用后台表格，长编号和日志不撑破手机视口。 */
.ops-block { display:block; margin-top:5px; color:var(--muted); font-size:11px; }
#spot-operations-root { min-width:0; }
#spot-operations-root td { max-width:320px; overflow-wrap:anywhere; }
#spot-operations-root td .text-button { white-space:nowrap; }
#spot-operations-root .table-wrap { max-width:100%; overflow:auto; }
#spot-operations-root .filter-bar { flex-wrap:wrap; }
.ops-overlay { position:fixed; inset:0; z-index:110; background:#0009; display:grid; place-items:center; padding:20px; }
.ops-dialog { width:min(100%,720px); max-height:90dvh; overflow:auto; }
.ops-dialog dl { display:grid; gap:13px; }
.ops-dialog dl>div { display:flex; justify-content:space-between; gap:20px; font-size:13px; }
.ops-dialog dt { color:var(--muted); flex-shrink:0; }
.ops-dialog dd { margin:0; text-align:right; overflow-wrap:anywhere; }
@media(max-width:600px) { #spot-operations-root .filter-bar { display:grid; grid-template-columns:1fr; } .ops-dialog{padding:18px;} }

/* 持仓操作抽屉保留左侧列表，标题与会员身份在操作确认时仍可见。 */
.position-preview-drawer { position:fixed; inset:0 0 0 auto; margin:0; padding:0; border:0;
    width:min(100%, 560px); max-width:none; height:100dvh; max-height:none; color:var(--ink);
    background:#fff; box-shadow:-14px 0 38px #10252a33; }
.position-preview-drawer::backdrop { background:#11262d38; }
.position-preview-header { position:sticky; top:0; z-index:1; background:#fff; border-bottom:1px solid var(--line);
    display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 24px; }
.position-preview-header h3, .position-preview-section h4 { margin:0; }
.position-preview-body { display:grid; gap:18px; padding:20px 24px 30px; }
.position-preview-identity { display:grid; justify-items:start; gap:7px; padding:14px; background:#f1f5f6; border-radius:10px; overflow-wrap:anywhere; }
.position-preview-identity small, .position-preview-metrics span, .position-preview-section h4 small, .position-preview-scope small { color:var(--muted); }
.position-preview-metrics, .position-preview-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.position-preview-metrics { padding:4px 0 12px; border-bottom:1px solid var(--line); }
.position-preview-metrics > div { display:grid; gap:5px; align-content:start; }
.position-preview-metrics strong { font-size:19px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.position-preview-funds { display:grid; gap:10px; padding:12px; background:#f6f8fa; border:1px solid var(--line); border-radius:10px; }
.position-preview-funds-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.position-preview-funds-heading h4 { margin:0; }
.position-preview-funds-heading small, .position-preview-funds-grid span, .position-preview-funds-message { color:var(--muted); }
.position-preview-funds-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.position-preview-funds-grid > div { display:grid; gap:4px; align-content:start; }
.position-preview-funds-grid strong { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.position-preview-units { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.position-preview-section { display:grid; gap:12px; }
.position-preview-controls { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.position-preview-control { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:8px; padding:9px 11px; }
.position-preview-control + .position-preview-control { border-top:1px solid var(--line); }
.position-preview-scope { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
    background:#f1f5f6; border-radius:10px; padding:12px; }
.position-preview-scope small { display:block; margin-top:4px; }
#spot-operations-root .is-position-selected { background:#fff1e9; }
@media (max-width:560px) {
    .position-preview-header { padding:14px 16px; }
    .position-preview-body { padding:16px; }
    .position-preview-metrics strong { font-size:16px; }
    .position-preview-control { gap:6px; padding:8px; }
    .position-preview-funds-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* 合约频道筛选按整组显示，沿用原有chips和交易对选择器。 */
.contract-channel-filter { min-width: 0; }
.cf-conditions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cf-picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.cf-picker > summary { cursor: pointer; overflow-wrap: anywhere; }
.cf-picker > .option-chips { margin-top: 10px; }
.cf-channel { min-width: 0; }
.cf-picker .instrument-picker__options { max-height: 280px; overflow-y: auto; }
.cf-picker .instrument-option[hidden] { display: none; }

/* 小屏下允许嵌套网格与输入单位栏收缩，避免智能补仓金额栏撑出页面。 */
.plan-editor .form-grid, .plan-editor .field, #hedge-strategy-form .form-grid, #hedge-strategy-form .field { min-width: 0; }
