/* 全站滚动条：默认那套灰白宽条在深色界面上很扎眼。改成细的半透明滑块，
   悬停才提亮；不用 scrollbar-width:none 隐藏，滚动条本身是有用的位置提示。 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 142, 156, .38) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(132, 142, 156, .32);
  border-radius: 6px;
  /* 留出内缩边距，滑块不贴边，看着更轻 */
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(132, 142, 156, .62); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

:root {

  /* 数字专用字体。JetBrains Mono 的 0 中间自带一个点，而且关不掉：
     它的 zero 特性只能把点换成斜杠，何况 Google Fonts 会把 zero/ssXX/cvXX
     这类特性从 webfont 里剥掉，CSS 里根本调不动。所以数字改用 IBM Plex Sans
     的平头 0（站内正文本来就在用这套，无需多加一次字体请求），
     再配 tabular-nums 保证每位等宽，跳价时不会左右抖。 */
  --num-font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  --bg: #05070a;



  --bg-elev: #0e1319;



  --bg-elev2: #141a22;



  --border: #222a34;



  --text: #eaecef;



  --muted: #848e9c;



  --accent: #5a7fc4;



  /* 品牌色：比 --accent 亮一档，用于顶栏标题这类需要跳出来的地方
     （交易页的 --tp-accent 只在 .trade-stage 内有定义，顶栏取不到） */
  --brand: #6b9eff;



  --takeover: #a98cf5;   /* 「策略接管」专用的紫：和交给手动的黄、删除的红、盈亏的红绿都分开 */
  --strat-label: #ffa94d;   /* 交易页持仓表「策略」列的字色（橙）：和多空的红绿、按钮的蓝、接管的紫、交给手动的黄都分开 */
  --green: #2ebd85;



  --red: #f6465d;



  --green-bg: rgba(46, 189, 133, 0.12);



  --red-bg: rgba(246, 70, 93, 0.12);



  --radius: 12px;



  font-synthesis: none;



}







* { box-sizing: border-box; }







body {



  margin: 0;



  background: var(--bg);



  color: var(--text);



  font-family: "IBM Plex Sans", "Segoe UI", "Microsoft YaHei", sans-serif;



  font-size: 14px;



  line-height: 1.5;



}







.hidden { display: none !important; }



.muted { color: var(--muted); font-size: 12px; }







/* Top bar */



.topbar {



  display: flex; align-items: center; justify-content: space-between;



  padding: 7px 16px; background: var(--bg-elev); gap: 10px;



  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;



  flex-wrap: wrap;



}



.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }



/* favicon.svg 同款三根递增 K 线，标签页与页内顶栏用同一张图。
   该 SVG 内不要写中文注释：作为 <img> 加载时按 XML 严格解析，编码一错就整张变破图。 */
.logo { display: block; width: 26px; height: 26px; flex: none; }



.brand h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.02em;
}



.brand small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }



.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }



@media (max-width: 900px) { .brand small { display: none; } }



.autorefresh { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }







.badge {



  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;



  border: 1px solid var(--border);



}



.badge-muted { color: var(--muted); }



.badge-ok { color: var(--green); background: var(--green-bg); border-color: transparent; }



.badge-warn { color: var(--accent); background: rgba(90,127,196,.12); border-color: transparent; }



.badge-err { color: var(--red); background: var(--red-bg); border-color: transparent; }







.banner {



  margin: 16px 24px 0; padding: 12px 16px; border-radius: var(--radius);



  background: var(--red-bg); color: var(--red); border: 1px solid rgba(246,70,93,.3);



}







/* Layout */



/* 主区宽度：去掉 width:100%（会与左侧栏 margin-left 叠出横向滚动条） */

.layout {

  padding: 14px 20px 50px;

  max-width: 1920px;

  width: auto;

  box-sizing: border-box;

}



.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }



.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); gap: 18px; }



@media (max-width: 1000px) {



  .cards { grid-template-columns: repeat(2, 1fr); }



  .grid { grid-template-columns: 1fr; }



}







/* 当前账户汇总条：紧凑专业版信息条，分段 总账户 / 带单 / 资产汇总 */



.acct-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch;



  background: var(--bg-elev2); border: 1px solid var(--border); border-top: 2px solid var(--accent);



  border-radius: 10px; padding: 6px 10px; margin-bottom: 12px; overflow-x: auto; }



.acct-bar .acct-total { background: rgba(90,127,196, 0.10); }



.acct-bar .acct-total .stat-value { color: var(--accent); }



.acct-seg { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0;



  padding: 2px 10px; border-left: 3px solid var(--border); }



.acct-seg:first-child { border-left: none; }



#leadSeg { border-left-color: var(--accent); }



.acct-seg-title { font-size: 11px; color: var(--muted); font-weight: 600;



  display: flex; align-items: center; gap: 6px; }



.acct-seg-cards { display: flex; flex-wrap: wrap; gap: 6px; }



.acct-seg-cards .card.stat { background: var(--bg-elev); border: 1px solid var(--border);



  border-radius: 7px; padding: 3px 9px; min-width: 76px; }



.acct-seg-cards .stat-label { font-size: 10px; color: var(--muted); white-space: nowrap; margin-bottom: 1px; }



.acct-seg-cards .stat-value { font-size: 14px; }







/* ===== 交易页：专业版布局（大图表 + 右侧下单） ===== */



/* 交易主视野：图表 | 订单簿 | 下单（占满首屏，表格在下方） */
.trade-stage {
  --tp-bg: #161a1e;
  --tp-bg2: #1e2329;
  --tp-line: #2b3139;
  --tp-label: #9aa3af;
  --tp-text: #eaecef;
  --tp-buy: #0ecb81;
  --tp-sell: #f6465d;
  --tp-accent: #6b9eff;
  --tp-accent-soft: rgba(107, 158, 255, 0.14);
  --tp-accent-line: rgba(107, 158, 255, 0.38);

  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px 268px;
  gap: 8px;
  align-items: stretch;
  height: calc(100vh - 240px);
  min-height: 400px;
  max-height: 620px;
  margin-bottom: 12px;
}

.trade-chart-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 图表整列在交易/群控/对冲三页之间挪动（_mountTradeMarketHosts）。
   交易页它直接是 .trade-stage 的网格项，靠 align-items:stretch 拿到确定高度；
   挪进群控/对冲的槽位后却变成了 flex 项，flex 默认 0 1 auto = 按内容定高，
   而它的内容正是 LWC 画布——「容器高度 = 画布高度 = 容器高度」就此成环。
   画布只要在隐藏页签里被量成 0（跟单页、历史页会把图表连同 #tab-trade 一起
   display:none），整列就永远停在 0：从那两页切回群控时 K 线塌成顶部一条窄带。
   而先切到交易页再回来就正常，因为那一趟里容器有确定高度，画布长回去了——
   是碰巧好的，不是真好。槽位自己锁了高度（见 .gc-stage / .hg-stage），
   让这一列撑满它即可解环。 */
#gcChartSlot > .trade-chart-col,
#hgChartSlot > .trade-chart-col {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.trade-chart-col .chart-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
}

.trade-chart-col .chart-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.trade-chart-col .trade-chart {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

.trade-stage .trade-orderbook {
  min-height: 0;
  max-height: none;
  height: auto;
  margin: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.trade-ob-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  overflow: hidden;
  position: relative;
}
/* 勾上止盈/止损：盖住这一列的订单簿和最新成交，输入框挪到这里，下单栏保持原高度。
   从上到下：估算方向 + 开仓参考、触发类型、止盈 / 止损两张卡、盈亏比、说明（2026-11-13 改版） */
.order-tpsl-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 10px;
  background: var(--tp-bg, #161a1e);
  border: 1px solid var(--tp-line, #2b3139);
  border-radius: var(--radius, 12px);
  overflow: auto;
  overscroll-behavior: contain;
}
.order-tpsl-cover::-webkit-scrollbar { width: 6px; }
.order-tpsl-cover::-webkit-scrollbar-thumb { background: var(--tp-line, #2b3139); border-radius: 3px; }
.order-tpsl-cover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tp-line, #2b3139);
}
.order-tpsl-cover-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
#orderTpslCoverBody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* 估算方向和触发类型同一个排法：左边定宽标签，右边分段按钮 */
.otp-dir-row,
.order-tpsl-cover .order-wt-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0;
}
.otp-k,
.order-tpsl-cover .order-wt-label {
  flex: none;
  width: 52px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tp-label, #9aa3af);
}
.otp-dir-seg,
.order-tpsl-cover .order-wt-seg {
  display: inline-flex;
  padding: 2px;
  gap: 0;
  border-radius: 8px;
  border: 1px solid var(--tp-line, #2b3139);
  background: #0b0e11;
}
.otp-dir-btn,
.order-tpsl-cover .order-wt-seg .seg-btn {
  flex: none;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--tp-label, #9aa3af);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.otp-dir-btn:hover:not(.active),
.order-tpsl-cover .order-wt-seg .seg-btn:hover:not(.active) { color: var(--tp-text, #eaecef); }
.otp-dir-btn.active[data-otp-dir="BUY"] { background: var(--tp-buy, #0ecb81); color: #0b0e11; }
.otp-dir-btn.active[data-otp-dir="SELL"] { background: var(--tp-sell, #f6465d); color: #fff; }
.order-tpsl-cover .order-wt-seg .seg-btn.active { background: var(--tp-accent, #6b9eff); color: #0b0e11; }
.order-tpsl-cover .order-wt-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #6b7480;
}
.otp-ref {
  margin-top: -3px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tp-label, #9aa3af);
}
.otp-ref b {
  color: var(--tp-text, #eaecef);
  font-family: var(--num-font);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.otp-ref i { font-style: normal; color: #6b7480; }
.otp-ref .otp-seg { white-space: nowrap; }
.otp-ref b.otp-miss { color: #f0b90b; font-family: inherit; }
.otp-dot { margin: 0 5px; color: #4a525c; }
.order-tpsl-cover .order-tpsl-fields { margin-top: 0; }

.trade-form-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.trade-form-col .trade-side-card {
  margin: 0;
  flex-shrink: 0;
}

/* 主视野是固定高度（见 .trade-stage），下单卡片内容超高时必须自己滚动，
   否则会溢出这一栏、盖住下方的持仓/挂单表格。
   滚动只发生在字段区，卡片头（杠杆下拉）与提交按钮始终留在原位——
   杠杆弹层在卡片头里，不受滚动裁剪。 */
.trade-form-col .trade-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}
.trade-form-col .trade-panel > .card-head { flex: none; }
/* 下单内容包在 .trade-pane 里，不是卡片的直接子元素。勾上「止盈/止损」后多出来的
   输入框必须在这一栏内部消化：字段区缩小并滚动，按钮和钱包行留在原位。
   直接撑高卡片会溢出定高的 .trade-stage，盖住下面的持仓表。 */
.trade-form-col .trade-panel > .trade-pane[data-trade-pane="order"] {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .order-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .order-check,
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .order-tpsl,
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .trade-book-warn,
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .order-submit-row,
.trade-form-col .trade-panel .trade-pane[data-trade-pane="order"] > .trade-acct-row { flex: none; }
.trade-form-col .trade-panel .order-fields::-webkit-scrollbar { width: 6px; }
.trade-form-col .trade-panel .order-fields::-webkit-scrollbar-thumb {
  background: var(--tp-line, #2b3139);
  border-radius: 3px;
}

#tab-trade > .trade-tables {
  margin-top: 0;
}

@media (max-width: 1280px) {
  .trade-stage { grid-template-columns: minmax(0, 1fr) 280px 240px; }
}

@media (max-width: 1100px) {
  .trade-stage {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .trade-chart-col .trade-chart {
    height: 34vh !important;
    min-height: 260px !important;
  }
  .trade-vol-pane { height: 72px; }
  .trade-stage .trade-orderbook {
    height: auto;
    max-height: 220px;
    min-height: 180px;
    flex: 1 1 auto;
  }
  .trade-mkt-trades {
    max-height: 200px;
    min-height: 140px;
  }
}



.trade-side {

  --tp-bg: #161a1e;

  --tp-bg2: #1e2329;

  --tp-line: #2b3139;

  --tp-label: #9aa3af;

  --tp-text: #eaecef;

  --tp-buy: #0ecb81;

  --tp-sell: #f6465d;

  --tp-accent: #6b9eff;

  --tp-accent-soft: rgba(107, 158, 255, 0.14);

  --tp-accent-line: rgba(107, 158, 255, 0.38);

  display: flex; flex-direction: column; gap: 10px; min-width: 0;

}



.trade-side .card { margin-bottom: 0; }



.trade-panel {
  padding: 16px 16px 14px;
  background: var(--tp-bg);
  border: 1px solid var(--tp-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: visible;
}



.trade-panel-head { margin-bottom: 14px; }

.trade-panel-head h2 {

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 17px; font-weight: 700; letter-spacing: 0.08em;

  color: var(--tp-text);

}

.trade-panel-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
}

.lev-picker { position: relative; flex: none; }
.lev-picker-btn {
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--tp-line);
  background: var(--tp-bg2);
  color: var(--tp-text);
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lev-picker-btn:hover:not(:disabled) {
  border-color: var(--tp-accent);
  color: var(--tp-accent);
}
.lev-picker-btn:disabled { opacity: .45; cursor: not-allowed; }
.lev-picker-btn.is-open {
  border-color: var(--tp-accent);
  color: var(--tp-accent);
  background: var(--tp-accent-soft);
}
.lev-picker-pop {
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 40;
  width: 300px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--tp-line);
  background: #0f1318;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.lev-picker-pop.hidden { display: none; }
.lev-picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.lev-picker-label {
  font-size: 12px;
  color: var(--tp-label);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.lev-picker-val {
  font-family: var(--num-font);
  font-size: 16px;
  color: var(--tp-accent);
  font-variant-numeric: tabular-nums;
}
.lev-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lev-picker-row input[type=range] {
  flex: 1;
  min-width: 0;
  accent-color: var(--tp-accent);
  height: 4px;
}
.lev-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}



.trade-side-card {

  padding: 14px;

  background: var(--tp-bg);

  border: 1px solid var(--tp-line);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);

}

.trade-side-card .card-head { margin-bottom: 10px; }

.trade-side-card .card-head h2 {

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 13px; font-weight: 700; color: #cfd3da;

}

.trade-side-card .chip {

  background: var(--tp-bg2); border-color: var(--tp-line); color: var(--tp-text);

}

.trade-side-card .hint { color: var(--tp-label); }



.chart-section {
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #10151c 0%, #0b0e11 48%);
  border: 1px solid var(--border);
  overflow: hidden;
  font-family: "IBM Plex Sans", "Segoe UI", "Microsoft YaHei", sans-serif;
}



/* 委托单：止盈止损/条件单标记 */



.ord-tpsl { color: var(--accent); }

.ord-tp { color: #0ecb81; font-weight: 600; }

.ord-sl { color: #f6465d; font-weight: 600; }

.ord-actions { white-space: nowrap; }

.ord-actions .btn { margin-left: 4px; }

.ord-actions .btn:first-child { margin-left: 0; }



/* 当前委托 | 止盈止损 左右分栏 */

.ord-split {

  display: flex;

  gap: 14px;

  align-items: stretch;

  min-width: 0;

}

.ord-pane {

  flex: 1 1 0;

  min-width: 0;

}

.ord-pane-tpsl {

  flex: 0 1 42%;

  max-width: 48%;

  border-left: 1px solid var(--border);

  padding-left: 14px;

}

.ord-pane-head {

  font-size: 12px;

  font-weight: 600;

  color: var(--muted);

  margin: 0 0 8px;

  letter-spacing: 0.02em;

}

@media (max-width: 1100px) {

  .ord-split { flex-direction: column; }

  .ord-pane-tpsl {

    flex: 1 1 auto;

    max-width: none;

    border-left: none;

    border-top: 1px solid var(--border);

    padding-left: 0;

    padding-top: 12px;

  }

}



.ord-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px;



  font-size: 10px; line-height: 16px; color: var(--muted); background: var(--bg-elev2);



  border: 1px solid var(--border); vertical-align: middle; }



/* 合约价格（图表身份区） */
.chart-price-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  flex: none;
  min-width: 120px;
}




.chart-last-big {

  font-family: var(--num-font);

  font-size: 24px; font-weight: 700; color: var(--text);

  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;

}



.chart-last-big.num-pos { color: var(--green); }



.chart-last-big.num-neg { color: var(--red); }



.chart-chg-big {

  font-family: var(--num-font);

  font-size: 12px; font-weight: 600; color: var(--muted);

  font-variant-numeric: tabular-nums; margin-top: 2px;

}



.chart-chg-big.num-pos { color: var(--green); }



.chart-chg-big.num-neg { color: var(--red); }







/* 币安风格行情信息条 */



.market-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;



  flex: 1 1 auto; min-width: 0; }



.market-bar:empty { display: none; }



.market-bar .mkt-label {

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 11px; letter-spacing: 0.02em;

}



.market-bar .mkt-val {

  font-family: var(--num-font);

  font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums;

}







/* 周期 / 模式 / 图例：图表上方独立一行，不再压在 K 线上 */



.chart-meta-row {

  display: flex; align-items: center; justify-content: space-between;

  gap: 12px; flex-wrap: wrap;

  margin: 0 0 10px; padding: 8px 2px 2px;

}



.chart-controls-inline {

  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;

  position: static; pointer-events: auto;

}



.chart-controls-inline .seg {

  background: rgba(20, 26, 34, 0.92);

  border: 1px solid var(--border);

  border-radius: 9px; padding: 3px; margin: 0;

}



.chart-controls-inline .seg-btn {

  min-width: 40px; padding: 6px 10px; font-size: 12px;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-weight: 600; border-radius: 7px;

}



.chart-controls-inline .seg-btn.active {

  background: rgba(90,127,196, 0.16);

  color: var(--accent);

  border-color: transparent;

}



.chart-alert-btn {

  border-radius: 8px !important;

  padding: 6px 12px !important;

  font-size: 12px !important;

  font-weight: 600 !important;

}



.chart-ind-btn {
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.chart-ind-btn.active,
.ind-picker-btn.is-open {
  background: rgba(107, 158, 255, 0.18) !important;
  border-color: rgba(107, 158, 255, 0.55) !important;
  color: #cfe0ff !important;
}
.ind-picker { position: relative; flex: none; }
.ind-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--tp-line, #2b3139);
  background: #0f1318;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.ind-pop.hidden { display: none; }
.ind-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #eaecef;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.ind-row:hover { background: rgba(255, 255, 255, 0.04); }
.ind-row input { margin: 0; accent-color: #6b9eff; }



.chart-legend {

  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 11px; font-weight: 500; color: var(--muted);

  letter-spacing: 0.01em;

}



.chart-legend .cl-item {

  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;

  opacity: 0.92;

}



.chart-legend .cl-item i {

  display: inline-block; width: 22px; height: 2px;

  border: none; border-radius: 0;

  /* 长间隔虚线，接近币安 LargeDashed */

  background: repeating-linear-gradient(

    to right,

    currentColor 0 5px,

    transparent 5px 12px

  );

}

.chart-legend .cl-open { color: var(--accent); }

.chart-legend .cl-entry { color: #b7bdc6; }

.chart-legend .cl-limit { color: #0ecb81; }

.chart-legend .cl-limit-sell { color: #f6465d; }

.chart-legend .cl-sl { color: #f6465d; }

.chart-legend .cl-tp { color: #0ecb81; }

.chart-legend .cl-liq { color: #ff9f43; }

.chart-legend .cl-alert { color: #848e9c; }

.chart-legend .cl-draft { color: var(--accent); }

.chart-legend .cl-fill-buy,

.chart-legend .cl-fill-sell { gap: 4px; }

.chart-legend .cl-fill-buy { color: #0ecb81; }

.chart-legend .cl-fill-sell { color: #f6465d; }

.chart-legend .cl-fill-buy i,

.chart-legend .cl-fill-sell i {

  width: 0; height: 0; border: none; background: none;

  border-left: 4px solid transparent;

  border-right: 4px solid transparent;

}

.chart-legend .cl-fill-buy i {

  border-bottom: 7px solid #0ecb81;

}

.chart-legend .cl-fill-sell i {

  border-top: 7px solid #f6465d;

}



/* 图表画布 */



.chart-wrap {

  position: relative; width: 100%;

  border: 1px solid rgba(43, 49, 57, 0.85);

  border-radius: 10px;

  background: #0b0e11;

  overflow: hidden;

  /* K 线、成交量、持仓量上下排列，叠加层是绝对定位不参与排布 */

  display: flex;

  flex-direction: column;

}

/* 成交量独立成栏：定高，时间轴画在它下面，K 线那栏不再重复画 */

.trade-vol-pane {

  width: 100%;

  flex: 0 0 auto;

  /* 高度由 --vol-h 决定，拖动分隔条时 JS 改这个变量 */
  height: var(--vol-h, 96px);

  border-top: 1px solid rgba(43, 49, 57, 0.7);

}

/* 两栏之间的拖动条。做成绝对定位的窄条骑在边界线上，不占布局高度，
   否则插入一个 flex 项会把两栏挤开、和原来的 1px 分界线对不上。 */
.chart-split {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--vol-h, 96px);
  height: 9px;
  margin-bottom: -4px;
  z-index: 7;
  cursor: row-resize;
}
.chart-split::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 3px;
  width: 46px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background .12s;
}
.chart-split:hover::after,
.chart-split.is-dragging::after { background: rgba(107, 158, 255, 0.75); }
/* 拖动时锁掉整页选中与图表自身的鼠标响应，避免顺手选中文字或误拖图表 */
body.is-split-dragging { user-select: none; cursor: row-resize; }
body.is-split-dragging .trade-chart,
body.is-split-dragging .trade-vol-pane,
body.is-split-dragging .trade-oi-pane { pointer-events: none; }

.chart-wrap.tv-mode .chart-split { display: none; }

.chart-wrap.tv-mode .trade-vol-pane { display: none; }

/* 持仓量子图：独立于成交量栏之外的第三栏，默认隐藏，按钮切换显示。
   不与成交量栏共用高度变量——各自独立拖动，互不影响。 */
.trade-oi-pane {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  height: var(--oi-h, 96px);
  border-top: 1px solid rgba(43, 49, 57, 0.7);
}
.trade-oi-pane.hidden { display: none; }
.trade-oi-legend {
  position: absolute;
  left: 8px;
  top: 4px;
  z-index: 6;
  display: flex;
  gap: 14px;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.2;
  color: #9aa4b2;
}
.trade-oi-legend b { font-weight: 600; color: #eaecef; }
.oi-leg-qty b { color: #0a9660; }
.oi-leg-usdt b { color: #c4860a; }

/* 持仓量在成交量下面。K 线/成交量那条拖动条要抬到两栏之上。
   选择器必须排除持仓量自己的条：它也带 .chart-split，一起被抬走就会
   叠在成交量上沿，持仓量窗口上沿就没有可拖的线。 */
.chart-wrap.has-oi .chart-split:not(.chart-split-oi) {
  bottom: calc(var(--vol-h, 96px) + var(--oi-h, 96px));
}
.chart-wrap .chart-split.chart-split-oi {
  bottom: var(--oi-h, 96px);
  z-index: 12;
  height: 14px;
  margin-bottom: -7px;
}
.chart-wrap .chart-split.chart-split-oi::after {
  background: rgba(132, 142, 156, 0.45);
  width: 64px;
}
.chart-split-oi.hidden { display: none; }

body.is-split-oi-dragging { user-select: none; cursor: row-resize; }
body.is-split-oi-dragging .trade-chart,
body.is-split-oi-dragging .trade-vol-pane,
body.is-split-oi-dragging .trade-oi-pane { pointer-events: none; }

.chart-wrap.tv-mode .chart-split-oi,
.chart-wrap.tv-mode .trade-oi-pane { display: none; }

/* 挂单/止损数量：虚线左侧标签，点击撤单 */

.trade-order-overlay {

  position: absolute;

  inset: 0;

  z-index: 5;

  pointer-events: none;

  overflow: hidden;

}

.chart-wrap.tv-mode .trade-order-overlay { display: none; }

.trade-order-overlay .tol-tag {

  position: absolute;

  left: 72px;

  transform: translateY(-50%);

  display: inline-flex;

  align-items: center;

  gap: 8px;

  pointer-events: auto;

  margin: 0;

  padding: 2px 10px 2px 8px;

  border: 1px solid currentColor;

  border-radius: 2px;

  background: rgba(24, 26, 32, 0.92);

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 12px;

  font-weight: 500;

  line-height: 1.2;

  white-space: nowrap;

  user-select: none;

}

.trade-order-overlay .tol-tag:hover {

  background: rgba(36, 40, 48, 0.96);

}

/* 整个框都能上下拖动改价（数量那一格点击仍是改单，× 仍是撤单） */
.trade-order-overlay .tol-tag,
.trade-order-overlay .tol-tag .tol-qty,
.trade-order-overlay .tol-tag .tol-acc { cursor: ns-resize; touch-action: none; }
/* 框只有二十来像素高，上下各多给几像素好抓；z-index -1 压在内容下面，点数量、点 × 不受影响 */
.trade-order-overlay .tol-tag::before { content: ""; position: absolute; inset: -5px -3px; z-index: -1; }
.trade-order-overlay .tol-tag.tol-dragging {
  background: rgba(36, 40, 48, 0.98);
  box-shadow: 0 0 0 1px currentColor, 0 2px 8px rgba(0, 0, 0, 0.45);
}
/* 拖动时框里显示正在拖到的价 */
.trade-order-overlay .tol-px { display: none; }
.trade-order-overlay .tol-tag.tol-dragging .tol-px {
  display: inline;
  color: #eaecef;
  font-family: "BinancePlex", "JetBrains Mono", "IBM Plex Sans", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
body.is-order-dragging, body.is-order-dragging * { cursor: ns-resize !important; user-select: none; }

.trade-order-overlay .tol-kind { display: none; }

.trade-order-overlay .tol-qty {

  color: #eaecef;

  font-variant-numeric: tabular-nums;

  font-family: "BinancePlex", "JetBrains Mono", "IBM Plex Sans", monospace;

  font-weight: 500;

  font-size: 12px;

  cursor: pointer;

  text-decoration: underline;

  text-underline-offset: 2px;

  text-decoration-color: rgba(234, 236, 239, 0.35);

}

.trade-order-overlay .tol-qty:hover {

  text-decoration-color: currentColor;

  color: #fff;

}

/* 跨账户合计时贴在数量后面的「N户」，提示这不是单个账户的量 */
.trade-order-overlay .tol-acc {
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(240, 185, 11, .18);
  color: #f0b90b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
}

.trade-order-overlay .tol-x {

  margin-left: 18px;

  padding-left: 10px;

  border-left: 1px solid rgba(132, 142, 156, 0.45);

  color: #f6465d;

  opacity: 1;

  font-weight: 700;

  font-size: 20px;

  line-height: 1;

  cursor: pointer;

}

.trade-order-overlay .tol-tag:hover .tol-x { color: #ff5070; }

/* 成交箭头悬停数量提示 */



.trade-fill-marks {

  position: absolute;

  inset: 0;

  z-index: 4;

  pointer-events: none;

  width: 100%;

  height: 100%;

}

.chart-wrap.tv-mode .trade-fill-marks { display: none; }

.trade-fill-tip {

  position: absolute;

  z-index: 8;

  pointer-events: none;

  padding: 6px 10px;

  border-radius: 4px;

  background: rgba(24, 26, 32, 0.94);

  border: 1px solid rgba(132, 142, 156, 0.35);

  color: #eaecef;

  font-size: 13px;

  font-weight: 600;

  line-height: 1.35;

  white-space: nowrap;

  box-shadow: 0 2px 8px rgba(0,0,0,.35);

  transform: translate(-50%, -120%);

}

.trade-fill-tip .tft-buy { color: #0ecb81; }

.trade-fill-tip .tft-sell { color: #f6465d; }

.chart-wrap.tv-mode .trade-fill-tip { display: none; }







/* TradingView：隐藏原生周期段（TV 自带周期） */
.chart-meta-row.tv-mode .interval-seg,
.chart-toolbar.tv-mode .interval-seg { display: none; }

.chart-toolbar .interval-seg,
.chart-toolbar .chartmode-seg { margin: 0; gap: 3px; flex: none; }
.chart-toolbar .interval-seg .seg-btn,
.chart-toolbar .chartmode-seg .seg-btn {
  flex: none;
  padding: 4px 10px;
  font-size: 12px;
}
.chart-toolbar .chart-lev-btn { flex: none; margin-left: auto; }
.chart-toolbar .chart-alert-btn { flex: none; margin-left: 0; }
.chart-toolbar .chart-ind-btn { flex: none; margin-left: 0; }

/* 图表顶栏：上行行情，下行周期 */
.chart-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 0;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(43, 49, 57, 0.55);
}
.chart-quote-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.chart-ctrl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.chart-toolbar .market-bar {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  overflow: visible;
  gap: 8px 18px;
  padding-bottom: 0;
}
.chart-toolbar .chart-price-wrap {
  flex: none;
  margin-left: auto;
  min-width: 132px;
  text-align: right;
  align-items: flex-end;
}
.chart-toolbar .chart-sym-input {
  width: 128px;
  padding: 5px 10px 5px 28px;
  font-size: 12.5px;
  border-radius: 6px;
  flex: none;
}
.chart-toolbar .chart-last-big { font-size: 28px; }
.chart-toolbar .chart-chg-big { font-size: 13px; }
.chart-toolbar .mkt-item {
  padding-right: 18px;
  border-right: 1px solid rgba(43, 49, 57, 0.7);
}
.chart-toolbar .mkt-item:last-child {
  padding-right: 0;
  border-right: 0;
}
.chart-toolbar .mkt-label { font-size: 12px; color: #848e9c; }
.chart-toolbar .mkt-val {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .chart-quote-row { flex-wrap: wrap; }
  .chart-toolbar .market-bar { order: 3; width: 100%; flex: 1 1 100%; }
  .chart-toolbar .chart-price-wrap { margin-left: auto; }
}








/* 全屏图表：铺满并填充币安背景色 */



.chart-wrap:fullscreen { background: #0b0e11; border-radius: 0; }



.chart-wrap:fullscreen .trade-chart { height: 100vh; min-height: 0; }



/* 全屏时量柱那栏也放大些，比例才不至于被 K 线压扁 */

/* 全屏也沿用拖出来的高度，只兜一个下限，别把量柱压没 */

.chart-wrap:fullscreen .trade-vol-pane { min-height: 96px; }







/* 币安风格图表右键菜单 */



.chart-ctx-menu { position: fixed; z-index: 9999; min-width: 190px;



  background: #1e2329; border: 1px solid #2b3139; border-radius: 8px; padding: 4px;



  box-shadow: 0 10px 30px rgba(0, 0, 0, .55); font-size: 13px; color: var(--text);



  user-select: none; }



.chart-ctx-menu .ctx-item { padding: 8px 12px; border-radius: 5px; cursor: pointer; white-space: nowrap; }



.chart-ctx-menu .ctx-item:hover { background: #2b3139; color: #fff; }



.chart-ctx-menu .ctx-sep { height: 1px; background: #2b3139; margin: 4px 4px; }



.mkt-item { display: flex; flex-direction: column; gap: 2px; flex: none; }



.mkt-label { font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }



.mkt-val { font-size: 12.5px; color: var(--text); font-weight: 500;



  font-variant-numeric: tabular-nums; white-space: nowrap; }



.mkt-val .num-pos { color: var(--green); }



.mkt-val .num-neg { color: var(--red); }



.mkt-cd { color: var(--muted); font-weight: 500; }



.mkt-link {

  border: none; background: none; padding: 0; margin: 0;

  color: var(--accent, var(--accent)); font-size: 12.5px; font-weight: 600;

  cursor: pointer; text-decoration: none;

}

.mkt-link:hover { text-decoration: underline; filter: brightness(1.08); }



/* 杠杆与保证金档位表（币安风险限额） */

.lev-bracket-pop {

  position: fixed; z-index: 1200;

  background: var(--bg-elev, #0e1319);

  border: 1px solid var(--border, #222a34);

  border-radius: 10px;

  box-shadow: 0 12px 40px rgba(0,0,0,.45);

  overflow: hidden;

}

.lev-bracket-pop.hidden { display: none; }

.lev-bracket-head {

  display: flex; align-items: center; gap: 10px;

  padding: 10px 12px; border-bottom: 1px solid var(--border);

  background: var(--bg-elev2, #141a22);

}

.lev-bracket-title { font-size: 13px; font-weight: 700; color: var(--text); }

.lev-bracket-sym { font-size: 12px; color: var(--accent, var(--accent)); font-weight: 600; }

.lev-bracket-x {

  margin-left: auto; width: 28px; height: 28px; border-radius: 6px;

  border: 1px solid var(--border); background: transparent; color: var(--muted);

  font-size: 18px; line-height: 1; cursor: pointer;

}

.lev-bracket-x:hover { color: var(--text); border-color: var(--accent); }

.lev-bracket-body { padding: 8px 10px 10px; max-height: min(420px, 60vh); overflow: auto; }

.lev-bracket-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.lev-bracket-table th {

  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;

  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;

}

.lev-bracket-table td {

  padding: 7px 8px; border-bottom: 1px solid rgba(34,42,52,.7);

  font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap;

}

.lev-bracket-table tr:last-child td { border-bottom: none; }

.lev-bracket-table tr:hover td { background: rgba(90,127,196,.06); }

.lev-bracket-note { margin: 8px 4px 2px; font-size: 11px; color: var(--muted); }
.lev-bracket-note.lev-bracket-warn { color: var(--accent); line-height: 1.45; }
.lev-bracket-note.lev-bracket-warn b { color: var(--accent); }







/* 图表略缩小，给下方持仓表更多空间 */
.trade-chart { width: 100%; height: 48vh; min-height: 360px; max-height: 560px; }







/* 交易页子页签（持仓 / 挂单 / 已实现盈亏） */



.trade-tables { padding-top: 10px; }



.subtabs { display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }

.subtabs .hide-other-sym {

  margin-left: auto; margin-bottom: 0; margin-right: 4px;

  font-size: 12px; gap: 5px; white-space: nowrap; user-select: none;

}

.subtabs .hide-other-sym input { accent-color: #6b9eff; }



.subtab { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 13px;



  padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }



.subtab:hover { color: var(--text); }

.subtab-count {

  display: inline-block;

  margin-left: 6px;

  min-width: 1.1em;

  padding: 1px 7px;

  border-radius: 8px;

  font-size: 13px;

  font-weight: 700;

  line-height: 18px;

  color: var(--muted);

  background: rgba(132, 142, 156, 0.16);

  font-variant-numeric: tabular-nums;

  vertical-align: 1px;

}

.subtab.active .subtab-count {

  color: var(--text);

  background: rgba(107, 158, 255, 0.22);

}

/* 群控汇总表：复用交易页 trade-tables 的外观，只补页签右侧的状态与刷新 */
/* 紧贴图表舞台下方，下面才是下单/选择账户，所以上下边距都要留 */
.gc-agg-card { margin-top: 0; margin-bottom: 12px; }
/* 勾选框和右侧的状态、刷新是一组，一起靠右；margin-left:auto 挪到这里，
   状态文字改成紧跟其后，勾选框才会正好落在「已汇总 N 个账户」左边 */
.gc-agg-only-sym {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.gc-agg-only-sym input { margin: 0; cursor: pointer; }
.gc-agg-only-sym:hover { color: var(--text); }
/* 勾上后点亮：表格是被过滤过的，得让人一眼看出来 */
.gc-agg-only-sym:has(input:checked) { color: var(--brand); }

.gc-agg-status {
  margin-left: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.gc-agg-refresh { flex: none; margin-left: 8px; }
#gcSubtabs { flex-wrap: wrap; align-items: center; }

/* 勾了「隐藏其他合约」且确实藏了东西时显示「当前/全部」，
   换个底色提示这个数字被过滤过，不是全部 */
.subtab-count.has-hidden {
  color: var(--accent, #f0b90b);
  background: rgba(240, 185, 11, 0.16);
  letter-spacing: 0.01em;
}
.subtab.active .subtab-count.has-hidden {
  color: var(--accent, #f0b90b);
  background: rgba(240, 185, 11, 0.24);
}



.subtab.active { color: var(--accent); border-bottom-color: var(--accent); }







/* 表单字段标记：必填 / 选填 */



.field .req { color: var(--red); font-size: 11px; font-weight: 600; margin-left: 4px; }



.field .opt { color: var(--muted); font-size: 11px; font-weight: 500; margin-left: 4px; }



@media (max-width: 1000px) {



  .acct-bar { grid-template-columns: none; }



}







.card {



  background: var(--bg-elev); border: 1px solid var(--border);



  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;



}



.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }



.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }







.stat { margin-bottom: 0; }



.stat-label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
/* 「几个账户读不到」——合计悄悄少一截比数字难看严重得多，要显眼 */
.stat-sub { margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--red); }



.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }







/* Tables */



.table-wrap { overflow-x: auto; }



table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }



th, td { padding: 10px 12px; text-align: right; white-space: nowrap; }



th:first-child, td:first-child { text-align: left; }



th { color: var(--muted); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--border); }



td { border-bottom: 1px solid var(--bg-elev2); }



tbody tr:hover { background: var(--bg-elev2); }



.empty { text-align: center; color: var(--muted); padding: 24px; }



.pos-long { color: var(--green); font-weight: 600; }

.pos-qty-long { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }

.pos-qty-short { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }

.pos-liq { color: #ff9f43; font-weight: 600; font-variant-numeric: tabular-nums; }



.pos-short { color: var(--red); font-weight: 600; }



.num-pos { color: var(--green); }



.num-neg { color: var(--red); }



/* 与当前持仓表一致：td 跟随正文 14px，th 用全局 12px；仅保留多列表头换行 */

.pos-history-table th { white-space: normal; line-height: 1.35; max-width: 6.5em; vertical-align: bottom; }

.pos-history-table .nowrap { white-space: nowrap; }



.funding-fee-summary {

  margin: 0 0 10px; font-size: 12px; line-height: 1.5;

}







/* Trade panel */



.order-fields { display: flex; flex-direction: column; gap: 9px; margin-bottom: 8px; }
/* 隐藏 input 与 datalist 高度为 0，但作为 flex 子项照样各吃一份 gap，白占两行间距 */
.order-fields > input[type="hidden"],
.order-fields > datalist { display: none; }

/* 市价/限价等切换时：价格相关字段叠在同一槽，高度不跳动 */
.order-type-extra {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 3.8em;
}
.order-type-extra > .field {
  grid-area: 1 / 1;
  margin: 0;
}
.order-type-extra > .field.is-inactive {
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}
/* 市价单三个字段都不激活；与其留一块空白，不如把价格框摆出来置灰，
   让人一眼知道这里是价格、只是市价用不上 */
.order-type-extra > .field.is-placeholder {
  visibility: visible;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}
.order-type-extra > .field.is-active {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
/* 条件单的触发类型：一行放标签 + 分段按钮 + 一句提示，只在止损/止盈/追踪止损时出现 */
.order-wt-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 6px;
}
.order-wt-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tp-label);
}
.order-wt-seg .seg-btn { padding: 5px 11px; font-size: 12px; }
.order-wt-hint {
  flex: 1 1 100%;
  font-size: 12px;
  line-height: 1.4;
}
/* 市价/限价单附带止盈止损。勾上后整块挪进订单簿那一列（.order-tpsl-cover），止盈、止损各一张卡：
   触发价、金额（填哪个都行，另一个跟着算）、涨跌和收益率。数字框有自身最小宽度，列宽一律 minmax(0, 1fr) */
.order-tpsl { margin: 0 0 8px; min-width: 0; max-width: 100%; }
.order-tpsl > .order-check { margin-bottom: 0; }
.order-tpsl-fields { margin-top: 6px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.otp-leg {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px 7px 13px;
  border: 1px solid var(--tp-line, #2b3139);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}
/* 左边一道色条分止盈（绿）止损（红），比整圈描色安静 */
.otp-leg::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.otp-leg-tp::before { background: var(--tp-buy, #0ecb81); }
.otp-leg-sl::before { background: var(--tp-sell, #f6465d); }
.otp-leg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.otp-leg-name { font-size: 13.5px; font-weight: 700; letter-spacing: 0.08em; }
.otp-leg-tp .otp-leg-name { color: var(--tp-buy, #0ecb81); }
.otp-leg-sl .otp-leg-name { color: var(--tp-sell, #f6465d); }
.otp-leg-move {
  font-size: 12px;
  color: var(--tp-label, #9aa3af);
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.otp-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  color: var(--tp-label, #9aa3af);
}
.otp-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--tp-line, #2b3139);
  background: var(--tp-bg2, #1e2329);
  color: var(--tp-text, #eaecef);
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.otp-row input:focus {
  border-color: var(--tp-accent, #6b9eff);
  box-shadow: 0 0 0 2px rgba(107, 158, 255, 0.14);
}
.otp-row input::placeholder { color: #5e6673; font-weight: 400; font-size: 12.5px; }
.otp-row input.otp-bad { border-color: rgba(246, 70, 93, 0.75); }
.otp-amt { position: relative; display: block; min-width: 0; }
.otp-amt input { padding-right: 46px; }
.otp-amt i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 11.5px;
  color: #6b7480;
  pointer-events: none;
}
.otp-leg-tp .otp-amt input.otp-has { color: var(--tp-buy, #0ecb81); }
.otp-leg-sl .otp-amt input.otp-has { color: var(--tp-sell, #f6465d); }
.otp-info {
  min-height: 16px;
  padding-left: 48px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tp-label, #9aa3af);
}
.otp-info b { font-family: var(--num-font); font-weight: 600; font-variant-numeric: tabular-nums; }
.otp-info .otp-warn { color: var(--red); }
.otp-info .otp-tip { color: #c99a2e; }
.otp-sum {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(107, 158, 255, 0.1);
  font-size: 12.5px;
  color: var(--tp-label, #9aa3af);
}
.otp-sum b {
  margin-left: 4px;
  color: var(--tp-text, #eaecef);
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
}
.order-tpsl-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: #6b7480;
}
.order-tpsl-hint p { margin: 0; }
.order-tpsl-hint p + p { margin-top: 1px; }
.order-tpsl-hint b { font-weight: 600; }
.order-tpsl-hint .num-neg { color: var(--red); font-weight: 600; }
/* 挂单表里带了止盈止损的入口单：成交后才挂，先用标签说明 */
#orderTable .ord-tag-tpsl { color: var(--accent); border-color: rgba(240, 185, 11, 0.45); }
/* 策略（暴涨做空等）的仓位和挂单：策略挂单页签里的策略名用带框的小标签 */
.ord-tag-strat { color: #b39df0; border-color: rgba(179, 157, 240, 0.45); }
.ord-tag-strat.ord-tag-warn { color: var(--red); border-color: rgba(246, 70, 93, 0.45); }
/* 持仓表「策略」列（数量前面单独一列）：只写策略名，和表格一样大的字，不加框，居中；各占多少在「数量」那一格写成
   「策略记的/账户持仓」（_posQtyParts）。10-28 用户一路改过来：从数量下面挪到前面 → 紧贴数量时位数一不同就左右错开
   （不整齐）→ 字大一点、不要边框、换个颜色、调布局 → 靠在数量这一边、写成多少/多少 → 多少/多少只在数量栏、
   策略栏只写名字、再换个颜色、居中。这本账簿上没有策略（仓位、挂单，按全部合约算，不看「隐藏其他合约」）时整列藏起来
   （_syncPosStratCol 给表加 pos-has-strat） */
#posTable .pos-strat-col { text-align: center; }
#posTable:not(.pos-has-strat) .pos-strat-col { display: none; }
#posTable .pos-strat-col .ord-tag { margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  font-size: inherit; line-height: inherit; vertical-align: baseline; color: var(--muted); }
#posTable .pos-strat-col .ord-tag-strat { color: var(--strat-label); }
/* 外面的单把策略记的仓位一起平掉了（2026-11-01，_posSweptHtml）：不是策略名，是要人看一眼的，红字，悬停看来龙去脉 */
#posTable .pos-strat-col .ord-tag-swept { color: var(--red); cursor: help; }
#posTable .pos-strat-col .ord-tag + .ord-tag::before { content: "·"; margin: 0 6px; color: var(--muted); }
#stratOrderTable .ord-tag-strat { margin-left: 0; }



.trade-panel .field {

  display: flex; flex-direction: column; gap: 4px; margin-bottom: 0;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--tp-label);

  line-height: 1.4;

}



.field input, .field select {

  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);

  border-radius: 9px; padding: 10px 12px; font-size: 14px; outline: none;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  transition: border-color .15s ease, box-shadow .15s ease;

}



.trade-panel .field input,

.trade-panel .field select {

  background: var(--tp-bg2);

  border-color: var(--tp-line);

  color: var(--tp-text);

  font-size: 15px;

  letter-spacing: 0.04em;

  line-height: 1.4;

  padding: 7px 12px;

}



.trade-panel .field input[type="number"],

.trade-panel #symbolInput {

  font-family: var(--num-font);

  font-variant-numeric: tabular-nums; font-weight: 500;

  letter-spacing: 0.02em;

}



.field input:focus, .field select:focus {

  border-color: rgba(107, 158, 255, 0.55);

  box-shadow: 0 0 0 2px rgba(107, 158, 255, 0.12);

}



.trade-panel .field input:focus,

.trade-panel .field select:focus {

  border-color: var(--tp-accent);

  box-shadow: 0 0 0 2px rgba(107, 158, 255, 0.14);

}



.field input::placeholder { color: #5e6673; font-weight: 400; letter-spacing: 0.02em; }



.trade-avail-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--tp-label, #9aa3af);
}
  .trade-avail-label { flex: none; }
.trade-avail-val {
  font-family: var(--num-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--tp-text, #eaecef);
  font-variant-numeric: tabular-nums;
}
.trade-avail-unit {
  font-size: 11px;
  color: var(--tp-label, #9aa3af);
}

.est-liq-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 0 1px;
  font-size: 12px;
  color: var(--tp-label, #9aa3af);
  font-variant-numeric: tabular-nums;
}
.est-liq-label { flex: none; letter-spacing: 0.04em; }
.est-liq-side {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  font-weight: 500;
}
.est-liq-side b {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  margin-left: 4px;
}
.est-liq-long b { color: var(--up, #0ecb81); }
.est-liq-short b { color: var(--down, #f6465d); }

.max-open-row {

  display: flex; justify-content: space-between; gap: 10px;

  margin: 0; padding: 0 1px;

}

.max-open-btn {

  flex: 1 1 0; min-width: 0; margin: 0; padding: 2px 0; border: none; background: transparent;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 14px; font-weight: 500; letter-spacing: 0.06em;

  color: var(--tp-label, var(--muted));

  display: flex; align-items: baseline; gap: 4px;

  white-space: nowrap; overflow: hidden;

  cursor: pointer; line-height: 1.55;

}

.max-open-btn:hover { color: var(--tp-text, var(--text)); }

.max-open-btn b {

  font-family: var(--num-font);

  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14.5px;

  letter-spacing: 0.02em; margin-left: 0;

  flex: 1 1 auto; min-width: 0;

  white-space: nowrap; overflow: hidden;

}

.max-open-btn.max-open-long { justify-content: flex-start; text-align: left; }

.max-open-btn.max-open-short { justify-content: flex-end; text-align: right; }

.max-open-long b { color: var(--tp-buy, var(--green)); }

.max-open-short b { color: var(--tp-sell, var(--red)); }

.max-open-btn:disabled { cursor: default; opacity: 0.75; }

.max-open-btn:disabled:hover { color: var(--tp-label, var(--muted)); }

.qty-pct-box {
  margin: 0;
  padding: 0 1px;
}
.qty-pct-box input[type=range] {
  width: 100%;
  height: 4px;
  margin: 0;
  padding: 0;
  accent-color: var(--tp-accent, #6b9eff);
  cursor: pointer;
}
.qty-pct-box input[type=range]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.qty-pct-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  gap: 2px;
}
.qty-pct-mark {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  color: var(--tp-label, #9aa3af);
  cursor: pointer;
  line-height: 1.3;
}
.qty-pct-mark:hover { color: var(--tp-text, #eaecef); }
.qty-pct-mark.active { color: var(--tp-accent, #6b9eff); font-weight: 600; }
.qty-pct-val {
  margin-top: 2px;
  text-align: right;
  font-family: var(--num-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-text, #eaecef);
  font-variant-numeric: tabular-nums;
}



.seg { display: flex; gap: 8px; margin-bottom: 16px; }



.seg-btn {

  flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border);

  background: var(--bg-elev2); color: var(--muted); cursor: pointer; font-weight: 600;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

}



/* 多空切换：实心选中，贴近币安合约 */

.side-seg {

  gap: 0; margin-bottom: 14px; padding: 3px;

  background: #0b0e11; border: 1px solid var(--tp-line); border-radius: 10px;

}

.side-seg .seg-btn {

  border: none; border-radius: 8px; padding: 11px 8px;

  background: transparent; color: var(--tp-label); font-size: 13px; font-weight: 700;

  transition: background .15s ease, color .15s ease, box-shadow .15s ease;

}

.side-seg .seg-btn:hover:not(.active) { color: var(--tp-text); background: rgba(255,255,255,.03); }

.side-seg .seg-btn.active[data-side="BUY"] {

  background: var(--tp-buy); color: #0b0e11;

  box-shadow: 0 4px 14px rgba(14, 203, 129, 0.22);

}

.side-seg .seg-btn.active[data-side="SELL"] {

  background: var(--tp-sell); color: #fff;

  box-shadow: 0 4px 14px rgba(246, 70, 93, 0.22);

}



.seg-btn.active[data-side="BUY"] { background: var(--green-bg); color: var(--green); border-color: transparent; }

.seg-btn.active[data-side="SELL"] { background: var(--red-bg); color: var(--red); border-color: transparent; }



/* 下单 / 对冲：原来两个按钮长得一模一样，看不出当前在哪个面板。
   沿用 margin-seg 的药丸样式：整组一条内嵌轨道，选中的那个填色 */

.trade-pane-seg {

  gap: 0; margin-bottom: 0; padding: 3px; flex: none;

  background: #0b0e11; border: 1px solid var(--tp-line); border-radius: 10px;

}

.trade-pane-seg .seg-btn {

  flex: none; min-width: 60px; border: none; border-radius: 8px; padding: 6px 14px;

  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;

  transition: background .15s ease, color .15s ease, box-shadow .15s ease;

}

.trade-pane-seg .seg-btn:hover:not(.active) {

  color: var(--tp-text); background: rgba(255, 255, 255, .06);

}

/* 选中态要一眼看得出来。原来只是 14% 透明度的淡蓝底，深色背景上几乎和未选中一样，
   分不清当前在「下单」还是「对冲」。改成实心填充，与周期/图表模式那两组选项卡一致 */

.trade-pane-seg .seg-btn.active {

  background: var(--tp-accent); color: #0b1220; font-weight: 700;

  box-shadow: 0 1px 6px rgba(107, 158, 255, .35);

}

.margin-seg {

  gap: 0; margin-bottom: 8px; padding: 3px;

  background: #0b0e11; border: 1px solid var(--tp-line); border-radius: 10px;

}

.margin-seg .seg-btn {

  border: none; border-radius: 8px; padding: 9px 8px;

  background: transparent; color: var(--tp-label); font-size: 12px; font-weight: 700;

}

.margin-seg .seg-btn:hover:not(.active) { color: var(--tp-text); background: rgba(255,255,255,.03); }

.margin-seg .seg-btn.active {

  background: var(--tp-bg2); color: var(--tp-accent);

  box-shadow: inset 0 0 0 1px var(--tp-accent-line);

}



.check { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 14px; cursor: pointer; }

.order-check {

  margin: 0 0 8px; padding: 5px 10px; border-radius: 8px;

  background: var(--tp-bg2); border: 1px solid var(--tp-line);

  font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: #b7bec8;

  line-height: 1.4;

}

.trade-side-card .order-check {

  background: var(--tp-bg2); border-color: var(--tp-line); color: #b7bec8;

}

.order-check input { accent-color: var(--tp-accent); }



/* 下单区杠杆：滑条+下拉，实时显示当前/最高 */

.lev-box {

  margin-bottom: 16px; padding: 13px 14px; border-radius: 10px;

  background: #0b0e11; border: 1px solid var(--tp-line);

}

.lev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.lev-title {

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: var(--tp-label);

}


.lev-notional {
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.lev-notional.is-empty { color: #848e9c; font-weight: 500; }
.lev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lev-current {

  font-family: "JetBrains Mono", "IBM Plex Sans", ui-monospace, monospace;

  font-size: 14px; font-weight: 700; letter-spacing: 0.04em; color: var(--tp-accent);

  padding: 4px 10px; border-radius: 999px;

  background: var(--tp-accent-soft);

  border: 1px solid var(--tp-accent-line);

}

.lev-current.is-set { color: var(--tp-accent); }

body.trade-book-lead .lev-current {

  color: var(--tp-accent); background: rgba(107, 158, 255, 0.18);

  border-color: rgba(107, 158, 255, 0.48);

}

.lev-max { margin-left: auto; font-size: 14px; color: var(--tp-label); font-weight: 600; letter-spacing: 0.04em; }

.lev-controls { display: flex; align-items: center; gap: 10px; }

.lev-controls input[type=range] { flex: 1; min-width: 0; accent-color: var(--tp-accent); height: 4px; }

.lev-step {

  flex: none; width: 32px; height: 32px; padding: 0; border-radius: 8px;

  border: 1px solid var(--tp-line); background: var(--tp-bg2); color: var(--tp-text);

  font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer;

  display: inline-flex; align-items: center; justify-content: center;

}

.lev-step:hover:not(:disabled) { border-color: var(--tp-accent); color: var(--tp-accent); }

.lev-step:active:not(:disabled) { filter: brightness(1.08); }

.lev-step:disabled { opacity: .4; cursor: not-allowed; }

.lev-select {

  width: 88px; flex: none; padding: 7px 8px; border-radius: 8px;

  border: 1px solid var(--tp-line); background: var(--tp-bg2); color: var(--tp-text);

  font-family: "JetBrains Mono", "IBM Plex Sans", ui-monospace, monospace;

  font-weight: 700; font-size: 14px; letter-spacing: 0.04em; cursor: pointer;

}

.lev-select:disabled, .lev-controls input[type=range]:disabled { opacity: .45; cursor: not-allowed; }

.lev-hint { margin: 10px 0 0; color: var(--tp-label); line-height: 1.6; letter-spacing: 0.04em; font-size: 13.5px; }

.lev-hint.lev-err { color: var(--tp-sell); }

.lev-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; }



.order-submit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* 开仓键下方那片空白：当前账簿的钱包余额与权益 */
.trade-acct-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--tp-line, #2b3139);
  font-size: 12px;
  color: var(--tp-label, #9aa3af);
}
.trade-acct-cell {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
/* 权益贴右，和上面「可用」那行一样左右分开 */
.trade-acct-equity { margin-left: auto; }
.trade-acct-label { flex: none; }
.trade-acct-val {
  font-family: var(--num-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--tp-text, #eaecef);
  font-variant-numeric: tabular-nums;
}
.trade-acct-unit { font-size: 11px; }
/* 第二行：保证金比率 + 维持保证金，和上面那行共用一条分隔线 */
.trade-acct-row.trade-acct-row2 { margin-top: 6px; padding-top: 0; border-top: 0; flex-wrap: wrap; row-gap: 2px; }
.trade-acct-val.ps-warn { color: #f0b90b; }
.trade-acct-val.num-neg { color: var(--red); }

.order-submit {

  border: none; border-radius: 10px; padding: 10px 8px;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  /* 按钮文字带「· 主账户/带单」后缀，300px 栏里两列并排容易折行撑高，
     收窄字距并禁止换行，超长时截断而不是把按钮撑成两行 */
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;

  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease;

  width: 100%;

}

.order-submit:active { transform: translateY(1px); }

.order-submit.side-buy {

  background: var(--tp-buy); color: #0b0e11;

  box-shadow: 0 6px 18px rgba(14, 203, 129, 0.18);

}

.order-submit.side-buy:hover { filter: brightness(1.05); }

.order-submit.side-sell {

  background: var(--tp-sell); color: #fff;

  box-shadow: 0 6px 18px rgba(246, 70, 93, 0.18);

}

.order-submit.side-sell:hover { filter: brightness(1.05); }

.trade-book-hint {

  margin: 12px 0 0; padding-top: 10px;

  border-top: 1px solid var(--tp-line);

  line-height: 1.65; letter-spacing: 0.04em; color: var(--tp-label); font-size: 13.5px;

}

.trade-panel .mkt-link { color: var(--tp-accent); font-size: 14px; }

.trade-panel .mkt-link:hover { color: #8db4ff; }





.grow { flex: 1; margin-bottom: 0 !important; }



.hint { color: var(--muted); font-size: 11px; margin: 12px 0 0; }







/* Buttons */



.btn { border: none; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 600; }



.btn-ghost { background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border); }



.btn-ghost:hover { border-color: var(--accent); }



.btn-primary { background: var(--accent); color: #0b0e11; }



.btn-primary:hover { filter: brightness(1.05); }



.btn-block { width: 100%; padding: 13px; }

/* 提交中：不替换按钮文字（避免与并排按钮的整行宽度/高度抖动），仅做视觉降权 */
.btn.is-loading { cursor: progress; opacity: 0.55; }
.btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }



.btn-danger { background: var(--red); color: #fff; }



.btn-mini { padding: 5px 10px; font-size: 12px; }



.btn-buy { background: var(--green); color: #fff; }



.btn-sell { background: var(--red); color: #fff; }







/* Chips */



.chips { display: flex; flex-wrap: wrap; gap: 8px; }



.chip { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 12px; }







/* Key-value list (跟单监控 带单状态) */



.kv-list { display: flex; flex-direction: column; }



.kv-list .kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bg-elev2); font-size: 13px; }



.kv-list .kv:last-child { border-bottom: none; }



.kv-list .kv span:first-child { color: var(--muted); }



.kv-list .kv span:last-child { font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }







/* Modal */



.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }



/* 确认对话框需盖在账户管理弹窗之上，否则在其下层无法点击 */



#modal { z-index: 300; }



.modal-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 420px; max-width: 90vw; }



.modal-box h3 { margin: 0 0 14px; }



.modal-body { color: var(--text); margin-bottom: 20px; line-height: 1.7; }



.modal-body .kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--bg-elev2); }



.modal-body .kv span:first-child { color: var(--muted); }

/* 策略启动被拒的弹窗：说明是几行长句，左对齐，标题不许被挤扁 */
.modal-body.st-refused .kv { justify-content: flex-start; gap: 14px; padding: 8px 0; font-size: 15px; }
.modal-body.st-refused .kv span:first-child { flex: none; width: 5em; }
.modal-body.st-refused .kv span:last-child { min-width: 0; line-height: 1.65; }



.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }







/* Toast */



.toast {



  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);



  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);



  padding: 12px 20px; border-radius: 8px; z-index: 200; max-width: 80vw;



}



.toast.ok { border-color: var(--green); }



.toast.warn { border-color: var(--accent); }



.toast.err { border-color: var(--red); }







/* Tabs */



/* 左侧竖排导航栏（固定侧边栏） */



.tabs {



  display: flex; flex-direction: column; flex-wrap: nowrap; gap: 1px;



  padding: 40px 0 6px; background: var(--bg-elev);



  border-right: 1px solid var(--border);



  position: fixed; top: 44px; left: 0; bottom: 0; width: 78px; z-index: 9;



  overflow-y: auto;



}



.tab {



  background: none; border: none; color: #d6dae1;



  padding: 11px 6px; width: 100%; text-align: center;



  font-size: 16px; font-weight: 600; cursor: pointer;



  border-left: 3px solid transparent; white-space: nowrap;



}



.tab:hover { color: #ffffff; background: var(--bg-elev2); }



.tab.active { color: var(--accent); border-left-color: var(--accent); background: var(--bg-elev2); }







/* 主内容与横幅整体右移，给左侧栏让位（用 width:calc 避免 100%+margin 产生底栏横向滚动） */



.layout {

  margin-left: 78px !important;

  margin-right: auto !important;

  width: calc(100% - 78px);

  max-width: 1920px;

}



.banner { margin-left: calc(78px + 18px) !important; }



html, body { overflow-x: hidden; }







/* 窄窗口 / 桌面应用缩放：侧边栏改回顶部横排，避免遮挡 */



@media (max-width: 820px) {



  .tabs {



    position: static; flex-direction: row; flex-wrap: wrap; width: auto;



    padding: 0 12px; border-right: none; border-bottom: 1px solid var(--border);



    overflow-x: auto;



  }



  .tab { width: auto; padding: 14px 16px; border-left: none; border-bottom: 2px solid transparent; }



  .tab.active { border-left-color: transparent; border-bottom-color: var(--accent); background: none; }



  .layout { margin-left: auto !important; width: 100%; max-width: none; }



  .banner { margin-left: 24px !important; }



}







/* Chart toolbar（结构样式见上方 .chart-toolbar / .chart-quote-row） */

.chart-sym { font-size: 15px; font-weight: 700; }



.chart-sym-input {

  width: 158px;

  background: #141a22;

  border: 1px solid var(--border);

  color: var(--text);

  border-radius: 9px;

  padding: 9px 12px 9px 32px;

  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;

  font-size: 14px;

  font-weight: 700;

  letter-spacing: 0.02em;

  outline: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23848e9c' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E");

  background-repeat: no-repeat; background-position: 10px center;

}



.chart-sym-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(90,127,196,.12); }







/* ===== 币安专业版风格合约搜索下拉 ===== */



.sym-picker {



  position: fixed; z-index: 1200;



  background: #0b0f14; border: 1px solid #2b333f;



  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.7);



  width: 480px; max-width: 94vw; overflow: hidden;



  font-variant-numeric: tabular-nums;



}



.sym-picker.hidden { display: none; }







.sort-arrow { font-style: normal; font-size: 10px; opacity: .9; margin-left: 2px; }







/* 可排序列名行（点列名升/降序） */



.sym-picker-collabel {



  display: grid; grid-template-columns: minmax(0,1fr) auto 92px; gap: 12px;



  padding: 9px 18px; font-size: 12px; color: var(--muted);



  border-bottom: 1px solid #1d242e; background: #0e131a; user-select: none;



}



.sym-picker-collabel .sym-clabel { display: inline-flex; align-items: center; gap: 5px; }



.sym-picker-collabel .sym-clabel:nth-child(2), .sym-picker-collabel .sym-clabel:nth-child(3) { justify-content: flex-end; }



.sym-picker-collabel .sortable {



  display: inline-flex; align-items: center; font-weight: 500; color: var(--muted);



  cursor: pointer; transition: color .12s;



}



.sym-picker-collabel .sortable:hover { color: var(--text); }



.sym-picker-collabel .sortable.active { color: var(--accent); font-weight: 700; }



.sym-picker-collabel .clabel-sep { color: #384150; }







.sym-picker-list { overflow-y: auto; }



.sym-picker-list::-webkit-scrollbar { width: 8px; }



.sym-picker-list::-webkit-scrollbar-thumb { background: #2b333f; border-radius: 4px; }



.sym-picker-loading, .sym-picker-empty { padding: 28px 16px; color: var(--muted); font-size: 13px; text-align: center; }



.sym-picker-empty.hidden { display: none; }







/* 行：左=币种+成交额，中=最新价+资金费率，右=涨跌幅 */



.sym-row {



  display: grid; grid-template-columns: minmax(0, 1fr) auto 92px; gap: 12px; align-items: center;



  padding: 9px 18px; cursor: pointer;



  border-left: 3px solid transparent;



}



.sym-row:hover, .sym-row.active { background: #161d26; }



.sym-row.current { border-left-color: var(--accent); background: rgba(90,127,196,.06); }



.sym-cell-name { min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 9px; }



.sym-name-box { min-width: 0; overflow: hidden; }



/* 币种图标：加载失败回退首字母圆形徽标 */



.coin-ic { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; overflow: hidden;



  display: inline-flex; align-items: center; justify-content: center; background: #2b333f; }



.coin-ic-fb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;



  font-size: 11px; font-weight: 700; color: #cfd6e0; }



.coin-ic img { position: relative; width: 100%; height: 100%; object-fit: cover; }



.sym-name-line { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }



.sym-name-line b { color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: .2px; }

.sym-tradifi,
.sym-name-line b.sym-tradifi,
.chart-sym-input.sym-tradifi,
#tpslSym.sym-tradifi,
a.sym-link.sym-tradifi { color: #8ec8ff; }

a.sym-link.sym-tradifi:hover { color: #c5e4ff; }



.sym-quote { color: var(--muted); font-size: 10.5px; border: 1px solid #2b333f; border-radius: 3px; padding: 0 4px; }



.sym-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; white-space: nowrap; }



.sym-cell-price { text-align: right; white-space: nowrap; }



.sym-price { color: var(--text); font-weight: 600; font-size: 14px; }



.sym-sub2 { color: var(--muted); font-size: 11.5px; margin-top: 3px; }



.sym-sub2 .num-pos { color: var(--green); }



.sym-sub2 .num-neg { color: var(--red); }



.sym-chg { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; }



.sym-chg.num-pos { color: var(--green); }



.sym-chg.num-neg { color: var(--red); }



.sym-chg.flat { color: var(--muted); }



@media (max-width: 520px) {



  .sym-picker { width: 96vw; }



}



.chart-last { font-size: 15px; font-weight: 700; color: #e8edf5; font-variant-numeric: tabular-nums; margin-left: auto; }



.interval-seg { margin: 0; gap: 4px; }



.interval-seg .seg-btn { flex: none; padding: 6px 12px; font-size: 12px; }



.interval-seg .seg-btn.active { background: var(--accent); color: #0b0e11; border-color: transparent; }



.chartmode-seg { margin: 0; gap: 4px; }



.chartmode-seg .seg-btn { flex: none; padding: 7px 14px; }



.chartmode-seg .seg-btn.active { background: var(--accent); color: #0b0e11; border-color: transparent; }



#tradeTvChart { background: var(--bg-elev2); border-radius: 8px; overflow: hidden; }







.chart-grid { display: grid; grid-template-columns: 1fr 240px; gap: 14px; }



@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }



.big-chart { width: 100%; height: 520px; }



.depth-card h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); }



.depth-box { font-size: 12px; font-variant-numeric: tabular-nums; }



.depth-side { display: flex; flex-direction: column; }



.depth-row { display: flex; justify-content: space-between; padding: 2px 6px; }



.depth-row.ask span:first-child { color: var(--red); }



.depth-row.bid span:first-child { color: var(--green); }







/* Filters */



.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }



.filters .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin: 0; }



.filters .btn { height: 40px; }



.hist-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }







/* Event / log */



.event-log { max-height: 320px; overflow-y: auto; font-size: 12px; }

.siren-banner {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #6b141c;
  color: #fff;
  font-weight: 600;
  animation: siren-pulse 1s ease-in-out infinite;
}
.siren-hint { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.siren-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
#sirenWatchTable { width: 100%; margin-bottom: 8px; }
.siren-status.is-ringing { color: var(--red); font-weight: 600; }
.siren-card.is-ringing { outline: 1px solid var(--red); }
@keyframes siren-pulse { 50% { opacity: .72; } }

.risk-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.risk-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.risk-alerts {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.risk-alerts .event-log { max-height: 220px; }
@media (max-width: 1100px) {
  .risk-tools { grid-template-columns: 1fr; }
}

#accuScanCard .card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#accuScanCard .card-head h2 { margin-right: auto; }
#accuScanMeta { font-size: 12px; }
#accuScanBtSym {
  width: 132px;
  background: var(--bg-elev2, #1c232c);
  border: 1px solid var(--border, #2a323d);
  color: var(--text, #eaecef);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
#accuScanTable .btn { font-variant-numeric: tabular-nums; }
.accu-hist-title { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.accu-hist-wrap { max-height: 320px; overflow: auto; }
#accuScanBtTable .btn { font-variant-numeric: tabular-nums; }
.accu-bt-dash { margin: 10px 0 12px; }
.accu-bt-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.accu-bt-stat {
  background: var(--bg-elev2, #1c232c);
  border-radius: 8px;
  padding: 8px 10px;
}
.accu-bt-stat-k { font-size: 11px; color: var(--muted, #848e9c); }
.accu-bt-stat-v { font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.accu-bt-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.accu-bt-chart-box { min-width: 0; }
.accu-bt-chart-lab { font-size: 12px; color: var(--muted, #848e9c); margin-bottom: 6px; }
.accu-bt-chart {
  height: 200px;
  width: 100%;
  background: #0b0e11;
  border: 1px solid rgba(43, 49, 57, 0.7);
  border-radius: 8px;
}
.accu-bt-canvas {
  display: block;
  width: 100%;
  height: 200px;
  background: #0b0e11;
  border: 1px solid rgba(43, 49, 57, 0.7);
  border-radius: 8px;
}
.accu-bt-canvas-sm { height: 160px; }
.accu-bt-sym-wrap { margin-top: 4px; }
@media (max-width: 1100px) {
  .accu-bt-charts { grid-template-columns: 1fr; }
}

.access-hint { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.access-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 8px; font-size: 13px; }
.access-remote { margin: 8px 0; }
.access-ip-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.access-ip-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--bg-elev2); border-radius: 6px; }
.access-ip-row code { font-size: 12px; }
.access-add-row { margin-top: 6px; }
.access-note { margin: 8px 0 0; font-size: 12px; }



.log-line { padding: 5px 0; border-bottom: 1px solid var(--bg-elev2); }







/* Strategy */



.strategy-list { display: flex; flex-direction: column; gap: 10px; }



.strategy-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; background: var(--bg-elev2); border-radius: 8px; }



.strategy-item .muted { font-size: 11px; }



#stParams { margin-bottom: 8px; }







.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) {
  .row-3 { grid-template-columns: 1fr; }
}

/* 群控：主视野尺寸与交易页一致（图表 + 订单簿/成交 + 下单栏） */
#tab-group .gc-stage {
  /* 交易页为 图表 | 下单300 | 盘口268；群控为 图表 | 盘口268 | 下单300，宽高一致 */
  grid-template-columns: minmax(0, 1fr) 268px 300px;
  /* 高度必须是定值：图表用 autoSize，放进自动高度的容器会和容器互相喂高度，
     实测栏高会一路涨到 1683px。所以这里锁定，靠字段紧排让内容装得下。 */
  height: calc(100vh - 240px);
  min-height: 400px;
  max-height: 620px;
  margin-bottom: 12px;
  align-items: stretch;
}
@media (max-width: 1280px) {
  #tab-group .gc-stage {
    grid-template-columns: minmax(0, 1fr) 240px 280px;
  }
}
@media (max-width: 1100px) {
  #tab-group .gc-stage {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
}
.gc-side-form {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  align-self: stretch;
}
.gc-side-panel {
  margin: 0;
  flex: 1 1 auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* 兜底：视口太矮时让它自己滚，而不是像原来 overflow:hidden 那样把底部静默切掉 */
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 与订单簿/最新成交卡片同色同边框，上下对齐同一高度 */
  background: var(--tp-bg, #161a1e);
  border: 1px solid var(--tp-line, #2b3139);
  border-radius: 8px;
  padding: 6px 10px 8px;
  box-sizing: border-box;
}
#tab-group .gc-side-form .gc-side-panel {
  flex-shrink: 1;
}
.gc-side-panel .card-head {
  margin: 0 0 8px;
  padding: 0;
  flex: none;
}
.gc-side-panel .card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #eaecef;
}
/* ===== 对冲页：图表 + 订单簿；对冲表单在下方整行铺开 ===== */
#tab-hedge .hg-stage {
  grid-template-columns: minmax(0, 1fr) 268px;
  height: calc(100vh - 240px);
  min-height: 400px;
  max-height: 620px;
  margin-bottom: 12px;
  align-items: stretch;
}
@media (max-width: 1280px) {
  #tab-hedge .hg-stage { grid-template-columns: minmax(0, 1fr) 240px; }
}

/* ===== 对冲表单（同一份 DOM，在对冲页和交易页下单区之间挪） ===== */
/* 静态标记里它是 body 的直接子节点，脚本跑起来才会挪进槽位。
   没挪走之前必须藏住，否则页面底部会多出一块无处安放的表单。 */
body > .hedge-form-host { display: none; }
.hedge-form-host { margin: 0 0 12px; }
.hedge-form-host .card-head { gap: 10px; }
.hedge-form-host .card-head .muted { margin-right: auto; }
.hedge-top-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.hedge-top-fields .field { margin: 0; }
.hedge-submit-row { margin-top: 12px; }
.hedge-result:empty { display: none; }
.hedge-result {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev2);
}

/* 交易页的对冲选项卡：订单簿那一列让位，表单列吃掉它的宽度 */
#tab-trade .trade-stage.hedge-pane-on {
  grid-template-columns: minmax(0, 1fr) 576px;
}
#tab-trade .trade-stage.hedge-pane-on > .trade-ob-col { display: none; }
@media (max-width: 1280px) {
  #tab-trade .trade-stage.hedge-pane-on { grid-template-columns: minmax(0, 1fr) 520px; }
}
/* 这一栏是定高的，腿多了让表单自己滚，别把卡片撑破 */
#hgFormSlotTrade {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  /* 10px 缝 + 8px 滚动条 = 卡片原本的 18px 内边距，内容右缘正好和卡片头对齐 */
  padding-right: 10px;
}
/* 滚动条贴到下单区最右侧，而不是缩在卡片内边距里浮在内容中间：
   卡片让出右内边距，不滚动的头部自己补回来，滚动容器就能铺满整宽。 */
#tab-trade .trade-stage.hedge-pane-on .trade-form-col > .trade-panel {
  padding-right: 0;
}
#tab-trade .trade-stage.hedge-pane-on .trade-form-col > .trade-panel > .card-head {
  padding-right: 18px;
}
/* 显式给出宽度：默认的覆盖式滚动条宽度为 0，会压在内容上且不易察觉 */
#hgFormSlotTrade::-webkit-scrollbar { width: 8px; }
#hgFormSlotTrade::-webkit-scrollbar-track { background: transparent; }
#hgFormSlotTrade::-webkit-scrollbar-thumb {
  background: var(--tp-line, #2b3139);
  border-radius: 4px;
}
#hgFormSlotTrade::-webkit-scrollbar-thumb:hover {
  background: var(--tp-label, #848e9c);
}
#hgFormSlotTrade .hedge-form-host {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}
#hgFormSlotTrade .hedge-top-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* 576px 放不下六列横排，可用可开单独占一行的紧凑排布 */
#hgFormSlotTrade .hedge-leg {
  grid-template-columns: minmax(0, 1.3fr) 72px 100px minmax(70px, 0.9fr) auto;
  gap: 6px;
}
/* 列宽收窄后靠削内边距把「做多 BUY」这类文字塞下，别让它被截成「做多 BU」 */
#hgFormSlotTrade .hedge-leg select,
#hgFormSlotTrade .hedge-leg input {
  padding: 8px 6px;
  font-size: 13px;
}
/* 徽标和选项文字都带 U本位/带单 标识，这栏挤，把徽标压到最小换给账户名 */
#hgFormSlotTrade .hg-acc-badge {
  min-width: 34px;
  padding: 0 5px;
  font-size: 11px;
}
#hgFormSlotTrade .hedge-leg-cap {
  grid-column: 1 / -1;
  order: 9;
  font-size: 12px;
  padding: 0 2px;
}
/* 576px 这栏再插一列就挤爆了：挂单腿改成与「可用/可开」并排占第二行。
   给它单独一行的话，每条腿多 32px，两条腿就能把提交按钮顶出可视区。 */
#hgFormSlotTrade .hedge-legs.is-limit .hedge-leg {
  grid-template-columns: minmax(0, 1.3fr) 72px 100px minmax(70px, 0.9fr) auto;
}
#hgFormSlotTrade .hedge-legs.is-limit .hedge-leg-cap {
  grid-column: 1 / 4;
  order: 8;
}
#hgFormSlotTrade .hedge-legs.is-limit .hg-maker-pick {
  grid-column: 4 / -1;
  order: 9;
  padding: 3px 6px;
  font-size: 11.5px;
}
#hgFormSlotTrade .hg-limit-note {
  font-size: 11.5px;
  line-height: 1.5;
  padding: 6px 8px;
  margin-bottom: 8px;
}
#hgFormSlotTrade .hg-plan { font-size: 11.5px; padding: 7px 9px; }
/* 这一栏窄且定高，结果多了自己滚，别把提交按钮顶出可视区 */
#hgFormSlotTrade .hedge-result {
  max-height: 132px;
  font-size: 11px;
  padding: 6px 8px;
}
#hgFormSlotTrade .hedge-result .log-line { padding: 3px 0; }
@media (max-width: 1100px) {
  #tab-hedge .hg-stage {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
}
.hg-side-form {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  align-self: stretch;
}
.hg-side-panel {
  margin: 0;
  flex: 1 1 auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tp-bg, #161a1e);
  border: 1px solid var(--tp-line, #2b3139);
  border-radius: 8px;
}
.hg-side-panel .card-head { margin: 0 0 8px; padding: 0; flex: none; }
.hg-side-panel .card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: #eaecef; }
.hg-side-panel > .order-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hg-side-panel > .order-submit-row { flex: none; }
.hg-side-panel .order-submit-row .btn { width: 100%; padding: 9px 8px; font-size: 14px; }
/* 净敞口两个按钮并排，信息另起一行免得挤 */
.hg-exp-side { display: flex; gap: 8px; margin: 0; }
.hg-exp-side .btn { flex: 1; min-width: 0; }
.hg-exp-info { font-size: 12px; line-height: 1.5; word-break: break-all; }
/* 对冲腿、保护单两张卡并排；窄屏堆叠 */
.hg-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 1280px) {
  .hg-bottom { grid-template-columns: 1fr; }
}
.hg-bottom > .card { margin: 0; }

.gc-side-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.gc-side-fields .field {
  margin: 0;
}
/* 平仓占宽一些、检测窄一些，宽度也体现主次；与上面开仓行留出间距防误点 */
/* 市价平仓已挪到「当前持仓」栏，这里只剩「检测 API」一个，占满一行 */
.gc-side-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
  flex: none;
}

.gc-side-actions .btn {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
}
/* 工具按钮：最轻，只在悬停时浮起来 */
.gc-btn-check {
  background: transparent;
  color: var(--tp-label);
  border: 1px solid var(--tp-line);
}
.gc-btn-check:hover {
  color: var(--tp-text);
  border-color: var(--tp-accent-line);
  background: rgba(255, 255, 255, .04);
}
.gc-btn-check:disabled { opacity: .55; cursor: default; }
/* 主操作：比次要按钮明显高一档，视线先落在这里 */
.gc-open-row {
  margin-top: 14px;
  gap: 10px;
}
.gc-open-row .order-submit {
  padding: 12px 8px;
  font-size: 15px;
}
.gc-side-secondary {
  margin-top: 8px;
}
#gcPriceField.is-inactive {
  opacity: 0.45;
}
.gc-result {
  margin-top: 8px;
  flex: 1 1 auto;
  /* 没有结果时不占地方：这一栏定高，56px 的空白会把下面的内容挤出去 */
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.gc-result:empty { display: none; }
.gc-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
/* 群控下单 / 止盈止损 两个页签：沿用交易页那套药丸式分段控件 */
.gc-pane-seg {
  gap: 0;
  margin: 0 0 12px;
  padding: 3px;
  flex: none;
  background: #0b0e11;
  border: 1px solid var(--tp-line);
  border-radius: 10px;
}
.gc-pane-seg .seg-btn {
  flex: 1 1 0;
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: var(--tp-label);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.gc-pane-seg .seg-btn:hover:not(.active) {
  color: var(--tp-text);
  background: rgba(255, 255, 255, .04);
}
.gc-pane-seg .seg-btn.active {
  background: var(--tp-accent-soft);
  color: var(--tp-accent);
  box-shadow: inset 0 0 0 1px var(--tp-accent-line);
}
/* 数量超过账户可开量的提示：不挡提交，只把是哪几个账户说清楚 */
.gc-qty-warn {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
}
.gc-qty-warn:empty { display: none; }
/* 2026-10-13 用户要求这些提醒用白字。按钮上的警示圈另算。 */
.gc-qty-bad { color: var(--text); }
.gc-qty-tip { color: var(--muted); line-height: 1.5; }
.gc-qty-ok { color: var(--muted); }
/* 对应方向可开量不足时给按钮描一圈警示，悬停有明细 */
.order-submit.is-overcap {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.order-submit.is-overcap::after {
  content: " ⚠";
  font-size: 12px;
}

.gc-pane {
  display: flex;
  flex-direction: column;
  flex: none;
  min-height: 0;
}
.gc-pane.hidden { display: none; }
.gc-tpsl-wt,
.gc-reduce-only {
  margin: 10px 0 0;
  font-size: 12px;
}
/* 统一杠杆：一个值接管所有下单账户，账户行的滑块同时置灰 */
.gc-uni-lev {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}
.gc-uni-lev-on {
  flex: 0 0 auto;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}
.gc-uni-lev-ctl {
  flex: 1 1 auto;
  min-width: 0;
}
.gc-uni-lev-ctl.is-off { opacity: .45; }
.gc-uni-lev-val {
  flex: 0 0 auto;
  min-width: 40px;
  text-align: right;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
/* 被统一杠杆接管的账户行：滑块拖不动，但数值仍显示这一单实际生效的倍数 */
.gc-lev-wrap.is-locked .gc-lev-range {
  opacity: .4;
  cursor: not-allowed;
}
.gc-lev-wrap.is-capped .gc-lev-top b { color: var(--accent); }

.gc-tpsl-submit { margin-top: 12px; }
.gc-tpsl-hint { margin: 8px 0 0; font-size: 11px; }

.gc-acc-card,
.gc-order-card {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gc-acc-card .card-head,
.gc-order-card .card-head {
  margin-bottom: 4px;
}

/* 勾选账户的总权益，紧挨在「下单区 N 个账户」左边。
   这是全页最该一眼看到的钱数，别用 .muted 的灰。 */
.gc-equity-total {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #eaecef;
  white-space: nowrap;
}

.gc-order-card .card-head #gcOrderHint { margin-left: 10px; }
.gc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

/* —— 账户分组 —— */
.gc-groups {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--tp-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
}
.gc-groups-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.gc-groups-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-label);
  letter-spacing: .03em;
}
.gc-groups-tip { font-size: 11.5px; color: var(--tp-label); opacity: .75; }
.gc-group-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.gc-group-empty {
  font-size: 12px;
  color: var(--tp-label);
  line-height: 1.5;
}
/* 虚线框 = 「还没有的东西」，和实心胶囊区分开 */
.gc-group-add {
  border: 1px dashed var(--tp-line);
  border-radius: 999px;
  background: transparent;
  color: var(--tp-label);
  cursor: pointer;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.gc-group-add:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(240, 185, 11, .08);
}
/* 名字与删除键做成一个整体胶囊，删除键紧贴右侧不额外占位 */
.gc-group-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--tp-line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elev2);
}
.gc-group-chip:hover { border-color: var(--tp-accent-line); }
.gc-group-pick {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 4px 4px 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc-group-pick i {
  font-style: normal;
  font-family: var(--num-font);
  font-size: 11px;
  font-weight: 700;
  color: var(--tp-label);
  background: rgba(255, 255, 255, .07);
  border-radius: 999px;
  padding: 1px 6px;
}
.gc-group-x {
  border: none;
  border-left: 1px solid var(--tp-line);
  background: transparent;
  color: var(--tp-label);
  cursor: pointer;
  padding: 0 8px;
  font-size: 14px;
  line-height: 1;
}
.gc-group-x:hover { color: var(--red); background: rgba(246, 70, 93, .12); }
/* 当前勾选与某分组完全一致时点亮，一眼看出正在用哪组 */
.gc-group-chip.is-active {
  border-color: var(--accent);
  background: rgba(240, 185, 11, .12);
}
.gc-group-chip.is-active .gc-group-pick { color: var(--accent); }
.gc-group-chip.is-active .gc-group-pick i {
  color: #0b0e11;
  background: var(--accent);
}
.gc-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
}
.gc-acc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  max-height: min(220px, 28vh);
  overflow: auto;
  padding: 8px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1 1 auto;
}
.gc-acc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.gc-acc-item:hover { border-color: var(--accent); }
.gc-acc-item.is-lead { border-color: rgba(125, 180, 245, 0.65); }
.gc-acc-item.is-fut { border-color: rgba(232, 148, 58, 0.55); }
.gc-acc-item.is-on {
  background: rgba(107, 158, 255, 0.08);
  border-color: var(--accent);
}
.gc-acc-item input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.gc-acc-item .hg-acc-badge {
  border-radius: 6px;
  border-right: 1px solid;
  min-width: 42px;
  padding: 2px 6px;
  font-size: 10px;
  flex-shrink: 0;
}
.gc-acc-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.gc-order-legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 8px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 72px;
}
.gc-order-legs .gc-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 18px 8px;
  text-align: center;
}
.gc-order-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gc-order-row.is-lead { border-color: rgba(125, 180, 245, 0.65); }
.gc-order-row.is-fut { border-color: rgba(232, 148, 58, 0.55); }
.gc-order-row.is-ok { border-color: rgba(14, 203, 129, 0.7); }
.gc-order-row.is-bad { border-color: rgba(246, 70, 93, 0.7); }
.gc-order-head {
  display: grid;
  grid-template-columns:
    56px
    minmax(100px, 1.1fr)
    minmax(300px, 2.2fr)
    218px
    100px
    100px
    minmax(48px, 0.7fr)
    26px;
  align-items: center;
  column-gap: 10px;
  min-width: 0;
}
.gc-order-head .hg-acc-badge {
  border-radius: 6px;
  min-width: 56px;
  padding: 3px 8px;
  font-size: 13px;
  justify-self: start;
}
.gc-order-head .gc-order-name {
  min-width: 0;
  max-width: none;
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-order-head .gc-order-cap {
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
  padding: 0;
  overflow: hidden;
}
.gc-order-head .gc-lev-wrap {
  width: 218px;
}
.gc-order-head input[type="number"] {
  width: 100px;
}
.gc-order-head .gc-check-st {
  min-width: 0;
}
.gc-order-head .gc-order-rm {
  margin-left: 0;
  justify-self: end;
}
.gc-order-row .hg-acc-badge {
  border-radius: 6px;
  min-width: 56px;
  padding: 3px 8px;
  font-size: 13px;
}
.gc-order-name {
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 持仓那一行是这块里最该被读到的信息（持仓/盈亏/两平/面值/强平/挂单）。
   原先它和上面账户名那行同一个底色、同一号字，两行糊成一片、扫不出重点。
   这里把它连同本行的下单按钮一起放进一条独立底色的栏里，
   上边界实线分隔，标签压暗一档、数值提亮加大——先看到数字，再看到字段名。 */
.gc-order-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px -10px -10px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.035);
  min-width: 0;
}

/* 每账户的持仓 / 挂单明细，字段口径与交易页持仓表一致 */
.gc-order-pos {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  font-size: 16px;
  line-height: 1.5;
  min-width: 0;
}

/* 每个账户自己的下单按钮，贴在本行右端 */
.gc-leg-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.gc-leg-btn {
  min-width: 60px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}
.gc-order-pos .gc-pos-grp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}
.gc-order-pos .gc-pos-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.gc-order-pos .gc-pos-k {
  color: var(--muted);
  font-size: 12px;
}
/* 数值比标签大一档、更亮：一眼扫过去先落在数字上 */
.gc-order-pos b {
  font-size: 17px;
  font-weight: 700;
  color: #eaecef;
  font-variant-numeric: tabular-nums;
}
.gc-order-pos .pos-liq { color: var(--red, #f6465d); }
.gc-order-pos .gc-ord-chip {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-elev2);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.gc-lev-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.gc-lev-top {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.gc-lev-top b {
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
/* 加减键占固定宽度，滑块吃掉剩下的空间——列宽是固定的 218px，
   滑块再写死宽度就会把加减键挤出格子 */
.gc-lev-range {
  flex: 1 1 auto;
  width: auto;
  min-width: 56px;
  accent-color: var(--accent, #6b9eff);
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.gc-lev-step {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gc-lev-step:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.gc-lev-step:active:not(:disabled) { filter: brightness(1.12); }
.gc-lev-step:disabled { opacity: .35; cursor: not-allowed; }
.gc-order-row input[type="number"] {
  width: 100%;
  font-size: 15px;
  padding: 7px 8px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.gc-order-cap.is-loading { opacity: 0.75; }
.gc-order-cap {
  display: grid;
  grid-template-columns: minmax(108px, 1.2fr) minmax(86px, 1fr) minmax(86px, 1fr);
  align-items: center;
  column-gap: 9px;
}
.gc-order-cap .gc-cap-cell {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.gc-order-cap .hg-cap-k { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.gc-order-cap .hg-cap-u { font-size: 12px; opacity: 0.85; flex: 0 0 auto; }
.gc-order-cap b,
.gc-order-cap .hg-max-qty {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 0;
}
.gc-order-cap b { color: var(--text); }
.gc-order-cap .hg-max-qty {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.gc-order-cap .hg-max-qty:hover { text-decoration: underline; }
/* 可开为 0 时按钮保留占位，只是不可点，避免整格结构变化引起跳动 */
.gc-order-cap .hg-max-qty.is-zero {
  color: var(--muted);
  cursor: default;
}
.gc-order-cap .hg-max-qty.is-zero:hover { text-decoration: none; }
.gc-check-st {
  font-size: 14px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc-check-st.ok { color: var(--green, #0ecb81); }
.gc-check-st.bad { color: var(--red, #f6465d); }
.gc-order-rm {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}
.gc-order-rm:hover { color: var(--red, #f6465d); }
@media (max-width: 1100px) {
  .gc-order-head {
    grid-template-columns:
      56px
      minmax(92px, 1fr)
      minmax(250px, 1.6fr)
      218px
      92px
      92px
      minmax(44px, 0.6fr)
      26px;
  }
  .gc-order-pos { gap: 4px 12px; font-size: 15px; }
}








/* Account switcher + manager */



.account-select {



  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);



  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; outline: none; max-width: 180px;



}



.account-select:focus { border-color: var(--accent); }

/* ---------- 出口 IP 弹窗 ---------- */
/* 11-04 用户：下面出口池那块太小不好操作，整体做大、左右排。
   左边大栏是出口池 + 账户绑定（改绑定都在这儿），整栏一起滚，账户绑定的标题吸顶；
   右边是自检结果和共用告警，自己滚。窄于 1100px 上下排（共用告警挪到最后），整块一起滚。
   原先告警卡占着固定高度、把出口池和账户绑定挤进底下一百来像素的滚动框里。 */
.egress-modal {
  position: relative;
  width: min(1800px, calc(100vw - 32px));
  max-width: none;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 22px 0;
}
/* 标题和统计、自检按钮并成一排，省下的高度给下面两栏 */
.egress-head {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  padding-right: 44px;   /* 让开右上角的 × */
  margin-bottom: 14px;
}
.egress-head-text { min-width: 0; }
.egress-head h3 { margin: 0 0 4px; font-size: 18px; }
.egress-desc { margin: 0; font-size: 13px; line-height: 1.5; }
.egress-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.egress-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.egress-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.egress-chip b { font-variant-numeric: tabular-nums; }
.egress-chip-free { border-color: rgba(14, 203, 129, 0.45); color: #0ecb81; }
.egress-chip-used { border-color: rgba(90,127,196, 0.45); color: var(--accent); }
.egress-chip-warn { border-color: rgba(246, 70, 93, 0.45); color: #f6465d; }
.egress-chip-share {
  border-color: rgba(246, 70, 93, 0.7);
  background: rgba(246, 70, 93, 0.16);
  color: #ff8a96;
  font-weight: 700;
}
.egress-chip-spare { border-style: dashed; border-color: rgba(132, 142, 156, 0.6); color: var(--muted); }
.egress-chip-note { font-size: 13px; }

/* 顶栏「出口IP」：有账户共用时整颗按钮变红，右侧数字角标点开就能对上 */
#egressBtn.has-share-warn {
  border-color: rgba(246, 70, 93, 0.7);
  color: #ff8a96;
  background: rgba(246, 70, 93, 0.1);
}
#egressBtn.has-share-warn:hover { border-color: #f6465d; }
.egress-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f6465d;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.egress-btn-badge.hidden { display: none; }

/* 右栏的共用警示：没冲突时收成一行绿条，有冲突时整块红底，每一行能点 */
.egress-share-warn { display: none; flex: none; }
.egress-share-warn.is-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(14, 203, 129, 0.08);
  border: 1px solid rgba(14, 203, 129, 0.35);
  color: #0ecb81;
  font-size: 14px;
}
.egress-share-warn.is-bad {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(246, 70, 93, 0.14);
  border: 1px solid rgba(246, 70, 93, 0.55);
  color: #ffb4bb;
  box-shadow: inset 0 0 0 1px rgba(246, 70, 93, 0.12);
}
.egress-warn-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: #ffd0d4;
  font-size: 15px;
}
.egress-warn-head b { color: #fff; font-size: 16px; }
.egress-warn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f6465d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.egress-share-warn.is-ok .egress-warn-icon {
  background: #0ecb81;
  font-size: 12px;
}
.egress-warn-tip {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(246, 70, 93, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.egress-warn-body { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.egress-warn-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 14px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.egress-warn-line:hover { border-color: rgba(246, 70, 93, 0.55); background: rgba(0, 0, 0, 0.32); }
.egress-warn-line.is-pick { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.egress-warn-line code { color: #fff; font-size: 14px; }
.egress-warn-line b { color: #f6465d; font-variant-numeric: tabular-nums; }
.egress-warn-foot { margin-top: 10px; font-size: 13px; line-height: 1.55; }
.egress-selftest { flex: none; font-size: 13px; }
.egress-selftest:empty { display: none; }
/* 自检表在右栏：表自己限高滚动，下面那句「N 个出口对应 M 个公网 IP」留在外面看得见；
   全局 td 是 15px、10px 12px 留白、不换行，窄栏里「备注」会被挤出去 */
.egress-selftest-table { max-height: 40vh; overflow: auto; }
.egress-selftest-table table { font-size: 14px; }
.egress-selftest-table th,
.egress-selftest-table td { padding: 6px 8px; }
.egress-selftest-table th:last-child,
.egress-selftest-table td:last-child { text-align: left; white-space: normal; overflow-wrap: anywhere; }
/* 两栏：左边大栏（出口池 + 账户绑定）、右边窄栏（自检 + 共用告警），各自滚 */
.egress-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 480px);
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
}
.egress-main,
.egress-side {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 14px;
}
.egress-main { padding-right: 6px; }
.egress-side { display: flex; flex-direction: column; gap: 12px; }
.egress-panel + .egress-panel { margin-top: 18px; }
.egress-panel-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.egress-panel-hint { font-size: 13px; font-weight: 400; letter-spacing: 0; }
/* 账户绑定的标题吸在左栏顶上：往下翻账户时也看得到是不是只看某个出口，「显示全部」随手能点 */
.egress-panel-acc > .egress-panel-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 4px;
  padding: 8px 0;
  background: var(--bg-elev);
}
.egress-focus { color: var(--text); font-size: 14px; letter-spacing: 0; }
.egress-focus code { color: var(--accent); font-size: 14px; }
.egress-pool-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  gap: 10px;
}
.egress-ip-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  min-width: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}
/* 有账户的格子是按钮：点了账户绑定只看这个出口上的账户 */
button.egress-ip-card { cursor: pointer; }
button.egress-ip-card:hover { filter: brightness(1.18); }
.egress-ip-card.is-pick { box-shadow: 0 0 0 2px var(--accent); }
.egress-ip-card.is-free {
  border-color: rgba(14, 203, 129, 0.35);
  background: rgba(14, 203, 129, 0.06);
}
.egress-ip-card.is-used {
  border-color: rgba(90,127,196, 0.4);
  background: rgba(90,127,196, 0.07);
}
.egress-ip-card.is-shared {
  border-color: rgba(246, 70, 93, 0.65);
  background: rgba(246, 70, 93, 0.12);
}
/* 备用出口（不分给账户）：虚线框；没人用时灰色，别和绿色的「空闲」混了 */
.egress-ip-card.is-reserved { border-style: dashed; }
.egress-ip-card.is-spare {
  border-color: rgba(132, 142, 156, 0.6);
  background: rgba(132, 142, 156, 0.06);
}
.egress-ip-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(132, 142, 156, 0.6);
  white-space: nowrap;
}
.egress-ip-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}
.egress-ip-addr {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}
.egress-ip-count { font-size: 13px; color: #f6465d; white-space: nowrap; }
/* 这个出口上的账户名整串写出来，太长就换行 */
.egress-ip-who {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.egress-ip-card.is-shared .egress-ip-who { color: #ffc2c8; }
.egress-ip-who.free { color: #0ecb81; }
.egress-ip-who.spare { color: var(--muted); }
/* 近 24h 这个出口权重打满的分钟数：有就显示，正在打满时整行标红 */
.egress-ip-sat {
  font-size: 12px;
  color: #f0b90b;
  white-space: nowrap;
}
.egress-ip-sat.now { color: #f6465d; font-weight: 700; }
/* 账户绑定两列排（宽屏下 29 个账户约 15 行），窄了自动一列 */
.egress-acc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr));
  gap: 10px;
}
.egress-acc-list > .muted { grid-column: 1 / -1; }
.egress-acc-card.is-out { display: none; }
.egress-acc-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
}
.egress-acc-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.egress-acc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
}
.egress-mode {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.account-select.egress-select {
  width: 100%;
  max-width: none;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}
.egress-acc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 0;
}
.egress-status {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.egress-status code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.egress-status-label { color: var(--muted); flex-shrink: 0; }
.egress-status.ok code { color: var(--text); }
.egress-status.warn code { color: var(--accent); }
.egress-status.bad code { color: #f6465d; }
.egress-acc-card.is-shared {
  border-color: rgba(246, 70, 93, 0.55);
  background: rgba(246, 70, 93, 0.08);
}
.egress-share { font-size: 13px; font-weight: 700; color: #f6465d; }
.egress-select optgroup {
  font-weight: 700;
  font-style: normal;
  color: var(--muted);
}
/* 底部「关闭」收窄一点，高度留给两栏 */
.egress-modal .settings-actions {
  flex: none;
  margin: 0 -22px;
  padding: 10px 22px;
}
/* 窄屏上下排，整块一起滚（各栏不再自己滚）：自检结果在最上面（离按钮近），
   接着出口池和账户绑定，共用告警放最后——出口池格子里已经写着谁和谁共用。
   别留成网格：两栏带着 min-height: 0，网格行会被压成容器高度，内容溢出叠在一起 */
@media (max-width: 1100px) {
  .egress-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-bottom: 14px;
  }
  .egress-main { flex: none; overflow: visible; padding: 0; }
  .egress-side { display: contents; }
  .egress-selftest { order: -1; }
  .egress-share-warn { order: 1; }
}
/* 手机上标题区就占了两百多像素：整个弹窗一起滚，标题跟着滚走，「关闭」吸在底上 */
@media (max-width: 640px) {
  .egress-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    padding: 14px 14px 0;
    overflow-y: auto;
  }
  .egress-body { flex: none; overflow: visible; }
  .egress-pool-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .egress-modal .settings-actions { margin: 0 -14px; padding: 10px 14px; }
  .egress-acc-card { grid-template-columns: 1fr; }
}

/* ---------- 账户管理弹窗 ---------- */
.accounts-modal {
  position: relative;
  width: min(760px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 22px 0;
}
.accounts-head h3 { margin: 0 0 6px; font-size: 18px; }
.accounts-desc { margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; max-width: 64ch; }
.accounts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.accounts-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.accounts-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}
.accounts-chip b { font-variant-numeric: tabular-nums; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounts-chip-lead { border-color: rgba(125, 180, 245, 0.55); color: #9ec5f5; }
.accounts-chip-cur { border-color: rgba(107, 158, 255, 0.45); color: #6b9eff; }
.accounts-chip-warn { border-color: rgba(246, 70, 93, 0.4); color: #f6465d; }
/* 两块结果面板已移进 .accounts-body（可滚动区）。这里再各自限高，
   是为了避免某一块太长把账户列表顶到很远的下方；外层滚动仍然照常可用。 */
.accounts-import-result:empty { display: none; }
.accounts-import-result {
  margin-bottom: 0;
  max-height: 24vh;
  overflow: auto;
  flex: none;
}
.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  padding-bottom: 4px;
}

/* 账户体检结果：独立弹窗，列多行多，给足宽度 */
.acc-check-modal {
  position: relative;
  width: min(1200px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 22px 0;
}
.acc-check-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  flex: none;
}
.acc-check-bar .btn { margin-left: auto; }
.acc-check-scroll { overflow: auto; min-height: 0; flex: 1 1 auto; }
.acc-check-modal .settings-actions { margin-left: -22px; margin-right: -22px; }
.acc-check-desc {
  font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
  font-size: 13px;
  letter-spacing: .02em;
}
.acc-chk-name { font-weight: 600; white-space: nowrap; }
.acc-num { text-align: right; white-space: nowrap; }
.acc-money { font-family: var(--num-font); font-variant-numeric: tabular-nums; }
.acc-copiers {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.acc-copier-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
}
.acc-copier-link:hover { text-decoration: underline; }
#copierModal { z-index: 120; }
/* 标题在左、操作在右，右侧给关闭按钮留空，避免和 × 叠在一起。
   说明不再吃账户页那条 64ch：宽弹窗里会把最后两个字挤到下一行。 */
.acc-check-modal .accounts-desc { max-width: none; }
.copier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 36px;
  margin-bottom: 12px;
}
.copier-head-text { min-width: 0; }
.copier-head .accounts-desc { margin-bottom: 0; }
.copier-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.copier-note { margin: 0 0 8px; }
.copier-note:empty { display: none; }
/* 摘要四格平分整行。人数、规模、名单各占一份，不要挤在标题下面左侧。 */
.copier-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.copier-stats:empty { display: none; }
.copier-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
}
.copier-stat .k { color: var(--muted); font-size: 12px; }
.copier-stat b {
  font-family: var(--num-font);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copier-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copier-user > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.copier-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: rgba(255, 255, 255, .08);
}
/* 表头随内容滚动时钉住，行多了也知道哪列是哪列。
   面板底色是半透明白叠在弹窗上，表头得用不透明色，否则会透出下面滚动的行。 */
.acc-check-table thead th {
  position: sticky;
  top: 0;
  background: #171c23;
  z-index: 1;
}
.acc-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.acc-sortable:hover { color: var(--brand); }
.acc-sortable.is-sorted { color: var(--brand); }
/* 箭头用伪元素画，避免每次排序都改表头文字导致列宽跳动。
   没箭头时不能留 margin：右对齐的金额列会因此比下面的数字左移 4px。 */
.acc-sortable::after { content: attr(data-arrow); font-size: 10px; }
.acc-sortable.is-sorted::after { margin-left: 4px; }
.acc-check-wait { font-size: 12.5px; padding: 4px 0; }
/* 列宽按列数平分，不按内容长短挤在左侧。auto 布局会把多出来的宽度
   全塞给账户名或说明，宽弹窗里数字就拢成一团。 */
.acc-check-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  table-layout: fixed;
}
/* 八列都要能放下「资产管理规模」。窄窗口宁可横向滚动，也不要把表头裁掉。
   跟单用户只有五列，跟着这条最小宽度会把「跟单天数」挤出可视区。 */
#accCheckTable { min-width: 880px; }
/* 跟单用户：名字只留头像加打码昵称的宽度。其余宽度四列数据平分，
   天数落在最后一等份的右侧，和收益率隔开大约一整列。 */
#copierTable { min-width: 760px; }
#copierTable col.copier-col-name { width: 190px; }
#copierTable col.copier-col-metric { width: calc((100% - 190px) / 4); }
/* 全局有 `th, td { text-align: right }`，会把这张表的数据格全推到右边、
   和左对齐的表头对不上。这里逐列显式指定，表头与单元格用同一条规则，
   加不加新列都不会再错位。 */
.acc-check-table th,
.acc-check-table td {
  text-align: left;
}
.acc-check-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 状态标签列内容短，居中才落在各自那一等份的中间，不会贴在格子左边。 */
#accCheckTable th:nth-child(2),
#accCheckTable td:nth-child(2),
#accCheckTable th:nth-child(3),
#accCheckTable td:nth-child(3) {
  text-align: center;
}
.acc-check-table th.acc-num,
.acc-check-table td.acc-num {
  text-align: right;
}
.acc-check-table td.empty { text-align: center; }
.acc-check-table th {
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
}
.acc-check-table td { padding: 8px 12px; vertical-align: middle; }
.acc-check-table tbody tr + tr td { border-top: 1px solid rgba(255, 255, 255, .045); }
.acc-check-table tbody tr:hover td { background: rgba(255, 255, 255, .035); }
/* 有问题的行整行压一层淡红，扫一眼就知道该看哪几行 */
.acc-check-table tbody tr.is-bad td { background: rgba(246, 70, 93, .06); }
.acc-check-table tbody tr.is-bad:hover td { background: rgba(246, 70, 93, .11); }
.acc-chk-note {
  color: var(--muted);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 结论用颜色分档：能用 / 能读不能下单 / 完全不通 / 无从判断。
   等宽保证三列标签左边缘对齐，不会参差不齐。 */
.acc-chk {
  display: inline-block;
  min-width: 58px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.acc-chk.ok { color: var(--green); background: rgba(46, 189, 133, .14); }
.acc-chk.warn { color: var(--accent); background: rgba(90, 127, 196, .18); }
.acc-chk.bad { color: var(--red); background: rgba(246, 70, 93, .14); }
.acc-chk.na { color: var(--muted); background: rgba(255, 255, 255, .06); }
.accounts-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 8px;
}
.accounts-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.accounts-list { display: flex; flex-direction: column; gap: 8px; }
.accounts-empty {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}
.accounts-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
}
.accounts-card.is-current {
  border-color: rgba(107, 158, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(107, 158, 255, 0.15);
}
.accounts-card.is-editing {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: var(--accent);
}
.accounts-card.is-disabled { opacity: 0.65; }
.accounts-card-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.accounts-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}
.accounts-card-keys {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.accounts-card-keys .k {
  display: inline-block;
  min-width: 3em;
  color: var(--muted);
}
.accounts-card-keys code {
  color: var(--text);
  font-size: 12px;
}
.accounts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.accounts-lead-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.accounts-add-form {
  margin: 0;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.accounts-add-form .form-grid { gap: 10px 12px; }
.accounts-modal .settings-actions {
  margin-left: -22px;
  margin-right: -22px;
}
@media (max-width: 640px) {
  .accounts-card { grid-template-columns: 1fr; }
  .accounts-actions { justify-content: flex-start; }
}





/* 账户管理弹窗：整体竖向布局，内容区随高度增长，操作按钮悬浮在底部始终可见 */



.modal-wide {



  position: relative; width: 560px; max-width: 92vw; max-height: 90vh;



  display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 0;



}



/* 取消账户列表自身的内部滚动条，避免弹窗内出现嵌套滚动条 */



.acc-list { display: flex; flex-direction: column; gap: 8px; }







/* 右上角关闭叉 */



.modal-x {



  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;



  display: flex; align-items: center; justify-content: center;



  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--muted);



  border-radius: 8px; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; z-index: 2;



}



.modal-x:hover { color: var(--text); border-color: var(--accent); }

/* 仓位止盈/止损弹窗（对齐币安合约） */
/* 半透明：改触发价时要能看见弹窗底下那几根辅助线，所以遮罩几乎不压暗，
   弹窗本体靠毛玻璃保证文字可读。不支持 backdrop-filter 的浏览器会退化成
   较实的底色，只是看不到线，功能不受影响。 */
.modal.modal-see-through {
  background: rgba(0, 0, 0, 0.18);
  padding: 24px;
}
/* 加宽比加高划算：横向宽了，预估那几行长文本就不换行，纵向反而更省。
   max-height 只是兜底——常见分辨率下内容约 710px，够放，不会出滚动条；
   真遇到特别矮的屏幕，宁可滚动也别把内容截在视口外面够不着。 */
.tpsl-modal {
  position: relative;
  width: 760px;
  max-width: 96vw;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 上内边距留给标题栏自己：sticky 元素不能定位到包含块（内容盒）之外，
     父级留了 padding-top 的话，负 margin 会被 sticky 顶回来，直接压住下面一行。 */
  padding: 0 20px 14px;
  background: rgba(30, 35, 41, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(120, 132, 148, 0.45);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  font-size: 15px;
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .tpsl-modal { background: rgba(30, 35, 41, 0.96); }
}
/* 标题栏兼作拖拽把手：touch-action 必须关掉，不然触屏上会被当成滚动手势 */
.tpsl-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -20px 10px;
  padding: 11px 50px 10px 18px;
  border-bottom: 1px solid rgba(120, 132, 148, 0.28);
  border-radius: 10px 10px 0 0;
  background: rgba(38, 44, 52, 0.94);
  cursor: move;
  user-select: none;
  touch-action: none;
}
.tpsl-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #eaecef;
}
/* 拖动中：关掉毛玻璃，否则每帧重采样背景会明显掉帧 */
.tpsl-modal.is-dragging {
  cursor: grabbing;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(30, 35, 41, 0.92);
}
.tpsl-modal > .modal-x { top: 10px; right: 12px; width: 28px; height: 28px; z-index: 3; }
/* 合约名与三个指标并到一行：各占一行要多吃 40 多像素，纯浪费 */
.tpsl-sym-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
}
.tpsl-sym { font-weight: 700; color: #eaecef; font-size: 17px; }
.tpsl-side { font-weight: 700; font-size: 15px; }
.tpsl-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: rgba(43, 49, 57, 0.62);
  border-radius: 6px;
  font-size: 13px;
}
.tpsl-meta > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.tpsl-meta b {
  font-weight: 600;
  color: #eaecef;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpsl-body { display: flex; flex-direction: column; gap: 10px; }
.tpsl-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
@media (max-width: 640px) {
  .tpsl-panes { grid-template-columns: 1fr; }
}
.tpsl-pane {
  padding: 11px 12px;
  border: 1px solid rgba(43, 49, 57, 0.9);
  border-radius: 6px;
  background: rgba(24, 26, 32, 0.55);
  min-width: 0;
}
.tpsl-pane-tp { border-color: rgba(46, 189, 133, 0.35); }
.tpsl-pane-sl { border-color: rgba(246, 70, 93, 0.35); }
.tpsl-enable {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #eaecef;
  cursor: pointer;
}
.tpsl-enable input { accent-color: var(--accent); width: 16px; height: 16px; }
.tpsl-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.tpsl-lab { font-size: 13px; color: #848e9c; }
.tpsl-row input,
.tpsl-pct-wrap {
  width: 100%;
}
.tpsl-row input {
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid rgba(72, 81, 94, 0.85);
  background: rgba(43, 49, 57, 0.78);
  color: #eaecef;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.tpsl-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.tpsl-row input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tpsl-row input.tpsl-bad {
  border-color: #f6465d;
}
.tpsl-pct-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tpsl-pct-wrap input { padding-right: 52px; }
.tpsl-pct-suffix {
  position: absolute;
  right: 12px;
  color: #848e9c;
  font-size: 13px;
  pointer-events: none;
}
.tpsl-row input.tpsl-pnl-pos { color: var(--green, #2ebd85); }
.tpsl-row input.tpsl-pnl-neg { color: var(--red, #f6465d); }
.tpsl-remain {
  margin: -3px 0 6px 86px;
  font-size: 13px;
  color: #848e9c;
  line-height: 1.35;
}
.tpsl-remain b {
  font-weight: 600;
  color: #eaecef;
  font-variant-numeric: tabular-nums;
}
.tpsl-remain.tpsl-remain-zero b { color: #848e9c; }
.tpsl-opts { display: flex; flex-direction: column; gap: 8px; }
/* 触发类型与价格保护挤到同一行，省掉一整行的高度 */
.tpsl-working {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tpsl-wt-seg { flex: none; }
.tpsl-wt-seg .seg-btn {
  padding: 7px 14px;
  font-size: 13px;
}
.tpsl-protect { margin-left: auto; font-size: 13px; color: #848e9c; }
.tpsl-hint { margin: 0; font-size: 13px; line-height: 1.45; }
.tpsl-fill-summary {
  margin-top: 1px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(43, 49, 57, 0.9);
  background: rgba(18, 21, 26, 0.6);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tpsl-fill-title {
  font-size: 13px;
  font-weight: 600;
  color: #eaecef;
}
.tpsl-fill-row {
  font-size: 13px;
  color: #848e9c;
  line-height: 1.45;
}
.tpsl-fill-row b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tpsl-fill-row .muted { margin-left: 6px; font-size: 12px; }
.tpsl-fill-total {
  padding-top: 7px;
  border-top: 1px solid #2b3139;
  color: #eaecef;
}
.tpsl-fill-avail {
  color: #eaecef;
  font-size: 13px;
}
.tpsl-fill-avail > div + div {
  margin-top: 5px;
}
.tpsl-fill-avail b {
  color: var(--accent);
  font-size: 15px;
}
.tpsl-actions {
  margin-top: 11px;
  padding-top: 0;
  gap: 12px;
}
.tpsl-actions .btn {
  font-size: 15px;
  padding: 9px 18px;
}
.tpsl-actions .btn-primary {
  min-width: 130px;
  background: var(--accent);
  color: #0b0e11;
  border: none;
  font-size: 15px;
}
.tpsl-actions .btn-primary:hover { filter: brightness(1.05); }
.tpsl-actions .btn-primary:disabled { opacity: 0.55; cursor: wait; }
/* 仓位在弹窗开着时被平掉：换成一句提示，别停在过期数据上 */
.tpsl-empty {
  padding: 26px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

/* API 合约权限告警条：出现在下单按钮上方，红底提示，无异常时不渲染 */
.trade-book-warn {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(246, 70, 93, 0.55);
  border-radius: 6px;
  background: rgba(246, 70, 93, 0.1);
  color: var(--red, #f6465d);
  font-size: 13px;
  line-height: 1.5;
}

.pos-tpsl-cell { min-width: 96px; }
.pos-tpsl-link {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
}
.pos-tpsl-link:hover { opacity: 0.85; }
.pos-tpsl-tp {
  color: var(--green);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pos-tpsl-sl {
  color: var(--red);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}







/* 关闭 / 添加并验证：悬浮固定在弹窗底部居中，无需滚到最底也能看到 */



.settings-actions {



  position: sticky; bottom: 0; justify-content: center; gap: 14px;



  margin: 16px -24px 0; padding: 14px 24px;



  background: linear-gradient(to top, var(--bg-elev) 70%, rgba(21,26,33,0));



  border-top: 1px solid var(--border);



}



.settings-actions .btn { min-width: 132px; }



.acc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; }



.acc-row.acc-active { border-color: var(--accent); }



.acc-ops { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }



.acc-rename-input {



  flex: 1; min-width: 120px; background: var(--bg-elev2); border: 1px solid var(--accent);



  color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 14px; outline: none;



}







/* 账户管理弹窗：分区与表单网格 */



.acc-section, .acc-form { margin-top: 16px; }



.acc-section-title {



  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none;



  letter-spacing: .3px; margin-bottom: 10px; padding-bottom: 8px;



  border-bottom: 1px solid var(--border);



}



.acc-form { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }



.acc-form .acc-section-title { border-bottom-color: var(--border); }



.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }



.form-grid .span-2 { grid-column: 1 / -1; }



.modal-box .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; font-size: 12px; color: var(--muted); }



.modal-box .field input { width: 100%; }



.modal-box .check { margin-bottom: 0; }



.form-status { min-height: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }







/* 多账户总览：当前账号置顶高亮行，与其它账户做区分 */



tr.acc-current td { background: rgba(90,127,196, 0.13); font-weight: 600; }



tr.acc-current:hover td { background: rgba(90,127,196, 0.18); }



tr.acc-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }







/* 账户类型标记：带单 / 普通 */



.tag-lead, .tag-normal { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }



.tag-lead { color: var(--green); background: var(--green-bg); }



.tag-normal { color: var(--muted); background: var(--bg-elev2); border: 1px solid var(--border); }







/* Hedge */



.hedge-legs { display: flex; flex-direction: column; gap: 10px; }
.hedge-leg {
  display: grid;
  grid-template-columns: minmax(200px, 1.55fr) minmax(150px, 1.05fr) 72px 104px minmax(88px, 0.9fr) auto;
  gap: 8px;
  align-items: center;
}
/* 限价模式多一列「挂单腿」单选。市价下该列 display:none，网格自然退回六列 */
.hedge-legs.is-limit .hedge-leg {
  grid-template-columns: minmax(190px, 1.5fr) minmax(130px, 1fr) 74px 66px 100px minmax(84px, 0.85fr) auto;
}
.hg-maker-pick { display: none; }
.hedge-legs.is-limit .hg-maker-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.hedge-legs.is-limit .hg-maker-pick:hover { border-color: var(--accent); }
.hedge-legs.is-limit .hg-maker-pick.is-maker {
  border-color: #f0b90b;
  background: rgba(240, 185, 11, 0.14);
  color: #f0b90b;
}
.hg-maker-pick input { margin: 0; accent-color: #f0b90b; }
.hedge-leg.is-maker-leg .hg-acc-cell select { box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.45); }

.hg-limit-note {
  margin: 0 0 10px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(240, 185, 11, 0.35);
  background: rgba(240, 185, 11, 0.08);
  color: #e8c877;
  font-size: 12.5px;
  line-height: 1.6;
}
.hg-limit-note b { color: #f0b90b; }
.hg-limit-note.hidden { display: none; }
.hg-limit-note.is-bad {
  border-color: rgba(246, 70, 93, 0.5);
  background: rgba(246, 70, 93, 0.1);
}
.hg-limit-warn { display: block; margin-top: 4px; color: var(--red); font-weight: 600; }
.hg-limit-warn.hidden { display: none; }

/* ---------- 限价对冲的跟进计划 ---------- */
.hg-follow { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hg-follow.hidden { display: none; }
.hg-plan {
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  font-size: 12.5px;
}
.hg-plan.is-working { border-color: rgba(240, 185, 11, 0.5); background: rgba(240, 185, 11, 0.06); }
.hg-plan.is-done { border-color: rgba(46, 189, 133, 0.45); background: rgba(46, 189, 133, 0.06); }
.hg-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.hg-plan-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.hg-plan.is-working .hg-plan-badge { background: #f0b90b; color: #1a1208; }
.hg-plan.is-done .hg-plan-badge { background: var(--green); color: #05130d; }
.hg-plan-cancel { margin-left: auto; }
.hg-plan-name { color: var(--text); font-weight: 600; }
.hg-plan-bar {
  height: 4px;
  margin: 7px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.hg-plan-bar i { display: block; height: 100%; background: #f0b90b; transition: width 0.25s ease; }
.hg-plan.is-done .hg-plan-bar i { background: var(--green); }
.hg-plan-fill { color: var(--muted); font-variant-numeric: tabular-nums; }
.hg-plan-fill b { color: var(--text); }
.hg-plan-leg {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.hg-plan-arrow { color: var(--muted); }
.hg-plan-lag { color: #f0b90b; }
.hg-plan-log { margin-top: 6px; font-size: 11.5px; }
.hg-acc-cell,
.hg-protect-acc {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}
.hg-acc-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 0 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  white-space: nowrap;
  user-select: none;
}
/* 对冲腿里徽章 + 下拉拼成一个「按钮」：外面不描边，只靠底色区分类型。
   一行里本来就有杠杆、数量、移除好几个控件，再各描一圈就全是格子了。
   只作用于对冲单元格，群控页复用的同款徽章不受影响。 */
.hg-acc-cell .hg-acc-badge,
.hg-protect-acc .hg-acc-badge { border: none; }
.hg-acc-badge.is-fut {
  color: #1a1208;
  background: #e8943a;
  border-color: #d07a22;
}
.hg-acc-badge.is-lead {
  color: #0b1220;
  background: #8ec5f7;
  border-color: #6eb0ef;
}
.hg-acc-badge.is-empty {
  color: var(--muted);
  background: var(--bg-elev2);
}
.hg-acc-cell select,
.hg-protect-acc select {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  border-radius: 0 8px 8px 0 !important;
  background-color: #1e2329;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.hg-acc-cell:hover select,
.hg-protect-acc:hover select { filter: brightness(1.25); }
/* 底色必须用不透明值：给 select 设半透明背景时，Chrome 会把展开的下拉弹层
   合成成白底，选项文字直接看不清。这里是深色叠上类型色调后的实色。 */
.hg-acc-cell select.is-fut,
.hg-protect-acc select.is-fut { background-color: #2a2119; }
.hg-acc-cell select.is-lead,
.hg-protect-acc select.is-lead { background-color: #1b2530; }
/* 顶栏正在看的账户：整块压一层黄，避免在一堆同名腿里选错户 */
.hg-acc-cell select.is-current,
.hg-protect-acc select.is-current { background-color: #2e2a17; }
/* 弹层里的选项单独上色，否则跟随系统主题会变成白底黑字 */
.hg-acc-cell select option,
.hg-protect-acc select option {
  background-color: #1e2329;
  color: var(--text);
  font-weight: 500;
}
.hg-acc-cell select optgroup,
.hg-protect-acc select optgroup {
  background-color: #12161b;
  color: var(--muted);
}
.hedge-leg-cap {
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  padding: 2px 4px;
  min-width: 0;
}
.hedge-leg-cap.is-loading { opacity: 0.7; }
.hedge-leg-cap .hg-cap-inline {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hedge-leg-cap .hg-cap-k { color: var(--muted); }
.hedge-leg-cap .hg-cap-u { font-size: 10px; opacity: 0.85; margin-left: 1px; }
.hedge-leg-cap .hg-cap-sep { color: var(--border); margin: 0 2px; }
.hedge-leg-cap b { color: var(--text); font-weight: 600; }
.hedge-leg-cap .hg-max-qty {
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
}
.hedge-leg-cap .hg-max-qty:hover { text-decoration: underline; }
.hedge-leg-cap .hg-cap-warn {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  white-space: normal;
  cursor: help;
}
.hedge-leg-cap .hg-cap-warn.is-bad { color: var(--red); font-weight: 600; }
@media (max-width: 980px) {
  .hedge-leg {
    grid-template-columns: 1fr 1fr;
  }
  .hedge-leg .btn { justify-self: start; }
}



.hedge-leg select, .hedge-leg input { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 12px; outline: none; }



.hedge-leg select:focus, .hedge-leg input:focus { border-color: var(--accent); }



.hedge-exposure { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; }



.hedge-exposure .muted { font-size: 13px; }

/* ---------- 同步止盈止损 ---------- */
.hg-sync-open { margin-top: 8px; }
/* 半透明毛玻璃 + 可拖动，整套跟持仓止盈止损弹窗保持一致：
   两个窗口经常要对着同一张图看价位，样式不一样会很割裂。 */
/* 外框高度固定：弹窗是 flex 居中的，内容一变高居中位置就跟着挪，
   填个价、切个触发类型、挂完出结果，整个窗上下跳。所以外框锁死，
   只让中间的预览区伸缩滚动，标题/输入/汇总/按钮全部原地不动。 */
.hg-sync-modal {
  position: relative;
  width: 820px;
  max-width: 96vw;
  /* 不锁死高度也不自己滚：高度由内容决定，顶部对齐保证长高时不挪位置
     （见 #hgSyncStopModal）。装不下时滚的是外面那层遮罩，弹窗整体往上走，
     所以中间不会出现第二条滑动条。 */
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  /* 底部不留 padding：按钮栏自己带，粘在底边时才不会悬在半空 */
  padding: 0 20px;
  background: rgba(30, 35, 41, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(120, 132, 148, 0.45);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .hg-sync-modal { background: rgba(30, 35, 41, 0.96); }
}
.hg-sync-modal.is-dragging {
  cursor: grabbing;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(30, 35, 41, 0.92);
}
/* 顶部对齐，不跟着内容居中。
   `.modal` 是 `align-items: center`，居中的盒子**内容一变高，位置就挪半个差值**：
   填个止损价（预览从一行变成 N 行）、切触发类型（提示显隐）、挂完出结果日志，
   整窗都会上下跳，手停在按钮上就点空了。原先是靠「锁死外框高度」躲开这件事，
   代价是清单那一段得自己滚，弹窗中间凭空多一条滑动条。
   改成顶部对齐之后，内容只往下长，上面的输入区原地不动，两个毛病一起没了。 */
#hgSyncStopModal {
  align-items: flex-start;
  padding: 24px 0;
  overflow-y: auto;
}

.hg-sync-head {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 -20px 10px;
  padding: 11px 50px 10px 18px;
  border-bottom: 1px solid rgba(120, 132, 148, 0.28);
  background: rgba(30, 35, 41, 0.9);
  cursor: move;
  user-select: none;
  touch-action: none;
}
.hg-sync-head h3 { margin: 0; font-size: 16px; }
.hg-sync-head .muted { font-size: 12px; }
.hg-sync-sym {
  flex: none;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(18, 21, 26, 0.55);
  font-size: 13px;
}
.hg-sync-sym > div { display: flex; align-items: baseline; gap: 6px; }
/* 两个输入框各占一半：挤成四列时「同步对冲」会被甩到最右边孤零零一个，
   而它和「触发类型」都是开关，理应并排在下面一行 */
.hg-sync-fields {
  flex: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.hg-sync-fields .field { min-width: 0; margin: 0; }
.hg-sync-fields input { font-family: var(--num-font); font-variant-numeric: tabular-nums; }
.hg-sync-opts {
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.hg-sync-wt { display: flex; align-items: center; gap: 8px; }
.hg-sync-lab { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hg-stop-wt-seg { flex: none; }
.hg-stop-wt-seg .seg-btn { flex: none; padding: 6px 12px; font-size: 12px; }
.hg-sync-chk { white-space: nowrap; margin: 0; }
.hg-sync-hint {
  flex: none;
  margin-top: 8px;
  padding: 6px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  background: rgba(240, 185, 11, 0.08);
  font-size: 12px;
  line-height: 1.6;
  color: #d6c08a;
}

/* 镜像守卫的现状。挂完不关窗，所以这块要能就地反映守卫补了哪几档 */
.hg-sync-guard {
  flex: none;
  margin-top: 8px;
  padding: 6px 10px;
  border-left: 2px solid var(--up, #0ecb81);
  border-radius: 4px;
  background: rgba(14, 203, 129, 0.07);
  font-size: 12px;
  line-height: 1.6;
}

.hg-sync-guard-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.hg-sync-guard-log {
  margin: 4px 0 0;
  padding-left: 16px;
  max-height: 72px;
  overflow-y: auto;
  color: var(--muted);
}

/* 按内容长，不在这儿开滑动条。
   这一段原先是「外框锁死高度、清单自己滚」，代价是弹窗中间多一条滑动条，
   而且两三个账户时上面空着一大片。现在整个弹窗按内容长、超出视口才滚一条，
   下面的汇总和按钮靠 `.modal-actions` 的 sticky 留在视线里。 */
.hg-sync-preview {
  flex: 0 0 auto;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(18, 21, 26, 0.35);
  font-size: 12.5px;
  line-height: 1.7;
}
.hg-sync-preview .hg-sync-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
/* 「止损价 X 在现价 Y 下方 → …」这句是整块预览的题眼，压过下面的逐账户行 */
.hg-sync-preview .hg-sync-head-line {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(120, 132, 148, 0.18);
  color: #eaecef;
}
/* 逐账户那几行列数固定，对齐了才好横着扫一眼比数 */
.hg-sync-preview .hg-sync-row.is-acct {
  display: grid;
  grid-template-columns: 42px minmax(78px, 1.3fr) minmax(96px, 1.1fr) minmax(104px, 1.2fr)
    minmax(96px, 1.1fr) minmax(84px, 1fr) minmax(112px, 1.2fr);
  gap: 4px 10px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(120, 132, 148, 0.14);
  white-space: nowrap;
}
.hg-sync-preview .hg-sync-row.is-acct > span { overflow: hidden; text-overflow: ellipsis; }
.hg-sync-preview .hg-sync-tag {
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
}
.hg-sync-tag.is-stop { color: #ffb3bd; background: rgba(246, 70, 93, 0.18); }
.hg-sync-tag.is-hedge { color: #8ee6b0; background: rgba(14, 203, 129, 0.16); }
.hg-sync-tag.is-skip { color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.hg-sync-warn { color: var(--red); font-weight: 600; }
.hg-sync-dim { color: var(--muted); }

.hg-sync-summary {
  flex: none;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(18, 21, 26, 0.6);
  font-size: 12.5px;
}
.hg-sync-sum-title {
  margin-bottom: 6px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
/* 标签一列、数值一列：四行的数字对齐了才扫得动，挤在一行文字里读不出来 */
.hg-sync-sum-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
  align-items: baseline;
}
.hg-sync-sum-grid dt { color: var(--muted); white-space: nowrap; }
.hg-sync-sum-grid dd {
  margin: 0;
  min-width: 0;
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
}
.hg-sync-sum-grid .is-net {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(120, 132, 148, 0.22);
}
.hg-sync-sum-grid dd.is-net { font-size: 13.5px; font-weight: 600; }
/* 账户多了这一行会折成好几行，把汇总撑高——封顶让它自己滚，别去挤预览区 */
.hg-sync-sum-grid dd.is-avail {
  color: #eaecef;
  line-height: 1.7;
  max-height: 3.4em;
  overflow-y: auto;
}
.hg-sync-sum-grid dd.is-avail b { color: var(--accent); }
.hg-sync-log { flex: none; max-height: 120px; margin-bottom: 12px; font-size: 12px; }
/* 弹窗整体可滚之后按钮会被滚出视线，粘在底边上。
   勾满几十个账户时「挂同步单」必须一直点得到，翻到底去找它太容易误点上面的行。 */
#hgSyncStopModal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: none;
  margin: 0 -20px;
  padding: 10px 20px 14px;
  background: rgba(30, 35, 41, 0.92);
  border-top: 1px solid rgba(120, 132, 148, 0.28);
}



.btn-warn { background: #141c2c; color: var(--accent); border: 1px solid #2f4566; }



.btn-warn:hover { background: #1a2538; }







/* 多账户总览：页头与实时标识 */



#accTotals { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }



.acc-head-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }



.acc-head-bar h2 { margin: 0; font-size: 18px; font-weight: 600; }



.acc-head-bar .acc-updated { margin-left: auto; }



.live-tag {



  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;



  border-radius: 999px; font-size: 12px; font-weight: 600;



  color: var(--green); background: var(--green-bg);



}



.live-dot {



  width: 7px; height: 7px; border-radius: 50%; background: var(--green);



  box-shadow: 0 0 0 0 rgba(46, 189, 133, .6); animation: live-pulse 1.4s infinite;



}



@keyframes live-pulse {



  0% { box-shadow: 0 0 0 0 rgba(46, 189, 133, .55); }



  70% { box-shadow: 0 0 0 6px rgba(46, 189, 133, 0); }



  100% { box-shadow: 0 0 0 0 rgba(46, 189, 133, 0); }



}



/* 总览主体：账户概览与全部持仓并排，窄屏自动堆叠 */



/* 两张表各占整行（堆叠），让 8~9 列有充足横向空间，避免底部出现横向滚动条 */



.acc-grid { display: flex; flex-direction: column; gap: 16px; }



#accTable, #accPosTable { width: 100%; table-layout: auto; }



/* 总览表紧凑排版，进一步保证不溢出 */



#accTable th, #accTable td, #accPosTable th, #accPosTable td { padding: 7px 8px; }







/* 数据行排序 + 特别关注 */



.card-head-wrap {
  flex-wrap: wrap;
  gap: 8px 12px;
}
.multi-close-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.multi-close-sym {
  width: 132px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border, #2b3139);
  border-radius: 6px;
  background: var(--bg-elev2, #1e2329);
  color: var(--text, #eaecef);
  font-size: 12px;
}
.multi-close-sym:focus {
  outline: none;
  border-color: #474d57;
}
#multiCloseBtn,
#tradeMultiCloseBtn {
  white-space: nowrap;
}
.multi-close-modal {
  width: min(560px, 94vw);
}
.mc-desc {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
}
.mc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mc-list {
  max-height: min(420px, 55vh);
  overflow: auto;
  border: 1px solid var(--border, #2b3139);
  border-radius: 8px;
  background: var(--bg, #0b0e11);
  padding: 4px 0;
}
.mc-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1.4fr) minmax(0, 1fr) 36px 72px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  margin: 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.mc-row:hover { background: rgba(255,255,255,0.04); }
.mc-row input { margin: 0; }
.mc-acc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 11px;
  color: #848e9c;
  border: 1px solid #2b3139;
}
.mc-sym {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.mc-qty {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mc-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 13px;
}



.row-ops { display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }



.row-ops .row-btn {



  padding: 1px 6px; font-size: 12px; line-height: 1.3; border-radius: 5px;



  border: 1px solid var(--border); background: transparent; color: var(--text-muted);



  cursor: pointer; transition: background .12s, color .12s, border-color .12s;



}



.row-ops .row-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }



.row-ops .row-btn:disabled { opacity: .3; cursor: default; }



/* 特别关注：星标按钮激活态金色 */



.row-ops .fav-btn.active { color: #f5b301; border-color: #f5b301; }



/* 特别关注行整行变色（绿底高亮，覆盖当前账户的高亮） */



tr.row-fav > td { background: rgba(245, 179, 1, .14) !important; }



tr.row-fav > td:first-child { box-shadow: inset 3px 0 0 #f5b301; }







/* 鼠标拖动重排：仅右侧手柄 ⠿ 可拖动 */



.row-ops .drag-handle {



  cursor: grab; letter-spacing: -1px; user-select: none;



  padding: 1px 5px; font-weight: 700;



}



.row-ops .drag-handle:hover { color: var(--text); border-color: var(--text-muted); }



.row-ops .drag-handle:active { cursor: grabbing; }



tr.row-dragging { opacity: .4; }



tr.row-drop-before > td { box-shadow: inset 0 2px 0 0 var(--accent, #4c8dff); }



tr.row-drop-after > td { box-shadow: inset 0 -2px 0 0 var(--accent, #4c8dff); }



/* 换位成功闪动提示 */



@keyframes rowMovedFlash {



  0%   { background: rgba(76, 141, 255, .45); }



  60%  { background: rgba(76, 141, 255, .22); }



  100% { background: transparent; }



}



tr.row-moved > td { animation: rowMovedFlash 1.2s ease-out; }







/* 价格每秒跳动高亮：绿涨 / 红跌，0.6s 渐隐 */



.mark-cell { font-variant-numeric: tabular-nums; transition: color .15s; }



@keyframes tick-up-kf { 0% { background: var(--green-bg); color: var(--green); } 100% { background: transparent; } }



@keyframes tick-down-kf { 0% { background: var(--red-bg); color: var(--red); } 100% { background: transparent; } }



.tick-up { animation: tick-up-kf .6s ease-out; }



.tick-down { animation: tick-down-kf .6s ease-out; }







/* 可排序表头 */



th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .15s; }



th.sortable:hover { color: var(--text); }



th.sortable::after { content: " \2195"; opacity: .3; font-size: 11px; }



th.sortable.active { color: var(--accent); }



th.sortable.active[data-dir="asc"]::after { content: " \2191"; opacity: 1; }



th.sortable.active[data-dir="desc"]::after { content: " \2193"; opacity: 1; }







/* ============== 跟单工具区（单币种查询 / 深度分析）统一样式 ============== */



.lead-tools .card-head h2 { font-size: 17px; }



.lead-tools .tool-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }



.lead-tools .tool-row + .tool-row { margin-top: 10px; }



.lead-tools .tool-field { display: flex; flex-direction: column; gap: 6px; }



.lead-tools .tool-field > label { font-size: 13px; color: var(--muted); font-weight: 500; }



.lead-tools .spacer { flex: 1 1 auto; }







.lead-tools input, .lead-tools select, .lead-tools textarea {



  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);



  border-radius: 8px; padding: 10px 13px; font-size: 15px; outline: none;



  font-family: inherit; transition: border-color .15s; height: 42px;



}



.lead-tools textarea { width: 100%; height: auto; resize: vertical; line-height: 1.6; }



.lead-tools input:focus, .lead-tools select:focus, .lead-tools textarea:focus { border-color: var(--accent); }



.lead-tools input::placeholder, .lead-tools textarea::placeholder { color: #5b6573; }



.lead-tools select { cursor: pointer; padding-right: 8px; }







.lead-tools .range-inputs { display: flex; align-items: center; gap: 8px; }



.lead-tools .range-inputs input { width: 128px; }



.lead-tools .range-sep { color: var(--muted); }







.lead-tools .btn {



  background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border);



  border-radius: 8px; padding: 0 18px; height: 42px; font-size: 15px; font-weight: 600;



  cursor: pointer; transition: border-color .15s, filter .15s, background .15s; white-space: nowrap;



}



.lead-tools .btn:hover { border-color: var(--accent); }



.lead-tools .btn.primary { background: var(--accent); color: #0b0e11; border-color: transparent; font-weight: 700; }



.lead-tools .btn.primary:hover { filter: brightness(1.06); }



.lead-tools .btn:disabled { opacity: .5; cursor: not-allowed; filter: none; border-color: var(--border); }







.lead-tools .tool-hint { color: var(--muted); font-size: 13px; align-self: center; }



.lead-tools .tool-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 12px 0 0; }



.lead-tools .import-box {



  margin-top: 12px; padding: 14px; border: 1px solid var(--border);



  border-radius: 10px; background: rgba(255,255,255,.02);



}



.lead-tools .import-box textarea { margin-top: 4px; }



.lead-tools .table-wrap { margin-top: 8px; }



.lead-tools .data-table { font-size: 14px; }



.lead-tools .data-table th { font-size: 13px; }



.lead-tools .data-table th, .lead-tools .data-table td { padding: 10px 13px; }







/* 单币种查询结果：指标卡片网格 */



.detail-result:empty { display: none; }



.detail-result { margin-top: 14px; }



.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }



.detail-stat { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }



.detail-stat .k { font-size: 13px; color: var(--muted); margin-bottom: 7px; }



.detail-stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }



.detail-stat .sub { font-size: 12px; color: var(--muted); margin-top: 5px; }



.detail-err { color: var(--red); font-size: 14px; margin-top: 10px; }







/* 简单信息表（查询命中列表） */



.mini-table { margin-top: 4px; font-size: 14px; }



.mini-table th, .mini-table td { padding: 8px 11px; }



.mini-table th { font-size: 13px; }







/* 深度分析黑名单标签 */



.bl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }



.bl-chip {



  display: inline-flex; align-items: center; gap: 6px;



  background: var(--red-bg); color: var(--red); border: 1px solid rgba(246,70,93,.35);



  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 600;



  font-variant-numeric: tabular-nums;



}



.bl-chip .bl-x {



  border: none; background: rgba(246,70,93,.18); color: var(--red); cursor: pointer;



  width: 18px; height: 18px; border-radius: 50%; line-height: 1; font-size: 14px;



  display: inline-flex; align-items: center; justify-content: center; padding: 0;



}



.bl-chip .bl-x:hover { background: var(--red); color: #fff; }







/* 从桌面文件导入账户 */



.import-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }



.import-hint { font-size: 12px; }



.import-result { margin: 4px 0 12px; font-size: 13px; line-height: 1.7; }



.import-result .import-file { font-size: 12px; margin-bottom: 4px; word-break: break-all; }



.import-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }



.import-line .import-name { font-weight: 600; min-width: 90px; }





/* 持仓/委托/已实现盈亏表里的合约名：点击跳到该合约的图表 */

.sym-link { cursor: pointer; border-bottom: 1px dashed var(--border); transition: color .12s; }

.sym-link:hover { color: var(--accent, var(--accent)); border-bottom-color: currentColor; }



/* 顶栏：主账户 / 带单账户切换（位于「已连接」左侧） */

.trade-book-switch {

  display: inline-flex; align-items: center; gap: 2px;

  padding: 2px; border-radius: 999px;

  background: rgba(0,0,0,.28); border: 1px solid var(--border);

}

.trade-book-switch .tb-btn {

  appearance: none; border: 0; cursor: pointer;

  padding: 5px 12px; border-radius: 999px;

  font-size: 12px; font-weight: 650; letter-spacing: .02em;

  color: var(--muted); background: transparent;

  transition: background .15s, color .15s, box-shadow .15s;

}

.trade-book-switch .tb-btn:hover:not(:disabled) { color: var(--text); }

.trade-book-switch .tb-btn:disabled { opacity: .35; cursor: not-allowed; }

.trade-book-switch.is-main .tb-btn.active {

  color: #0b0e11; background: #0ecb81;

  box-shadow: 0 0 0 1px rgba(14,203,129,.35);

}

.trade-book-switch.is-lead .tb-btn.active {

  color: #0b0e11; background: #6b9eff;

  box-shadow: 0 0 0 1px rgba(107, 158, 255, 0.45);

}



/* 交易区标签：切换后一眼区分当前簿 */

.trade-book-tag {

  display: inline-flex; align-items: center;

  padding: 3px 11px; border-radius: 999px;

  font-size: 13px; font-weight: 700; letter-spacing: .08em;

  border: 1px solid transparent;

}

.trade-book-tag.book-main {

  color: #0ecb81; background: rgba(14, 203, 129, 0.1);

  border-color: rgba(14, 203, 129, 0.28);

}

.trade-book-tag.book-lead {

  color: #8db4ff; background: rgba(107, 158, 255, 0.12);

  border-color: rgba(107, 158, 255, 0.38);

}



/* 主账户：绿色描边；带单：蓝色描边 */

body.trade-book-main .trade-panel,

body.trade-book-main .trade-side-card {

  border-color: rgba(14, 203, 129, 0.28);

}

body.trade-book-main .trade-tables {

  border-color: rgba(14, 203, 129, 0.22);

}

body.trade-book-lead .trade-panel,

body.trade-book-lead .trade-side-card {

  border-color: rgba(107, 158, 255, 0.4);

  box-shadow: inset 0 0 0 1px rgba(107, 158, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.03);

}

body.trade-book-lead .trade-tables {

  border-color: rgba(107, 158, 255, 0.34);

  box-shadow: inset 0 0 0 1px rgba(107, 158, 255, 0.08);

}

body.trade-book-lead .order-submit.side-buy {

  box-shadow: 0 6px 18px rgba(14, 203, 129, 0.18), inset 0 0 0 1px rgba(107, 158, 255, 0.35);

}

body.trade-book-lead .order-submit.side-sell {

  box-shadow: 0 6px 18px rgba(246, 70, 93, 0.18), inset 0 0 0 1px rgba(107, 158, 255, 0.35);

}

.lev-hint.lev-warn { color: var(--tp-accent, #6b9eff); }

.lev-current.lev-over {

  color: #f0a0a8; background: rgba(246, 70, 93, 0.14);

  border-color: rgba(246, 70, 93, 0.45);

}



.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 2px 8px;
}
.table-toolbar-hint { font-size: 12px; }
.table-toolbar .btn { flex: none; }

.ph-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 10px;
  padding: 0 2px;
}
.ph-range-seg {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev2, #1e2329);
}
.ph-range-seg .seg-btn {
  flex: none;
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.ph-range-seg .seg-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.ph-range-seg .seg-btn.active {
  background: var(--accent);
  color: #0b0e11;
}
.ph-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-custom.hidden { display: none; }
.ph-custom input[type="date"] {
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev2, #1e2329);
  color: var(--text);
  font-size: 12px;
}
.ph-range-sep { color: var(--muted); font-size: 12px; }
.ph-range-hint { font-size: 12px; }
/* 「有合约没取到、列表可能不全」——缺一个合约和「那天没交易过」长得一样，得显眼 */
.ph-note {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--down, #f6465d);
  background: rgba(246, 70, 93, 0.1);
  color: var(--down, #f6465d);
  font-size: 12px;
  line-height: 1.5;
}
.ph-open-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #6b9eff);
  background: rgba(107, 158, 255, 0.12);
  border: 1px solid rgba(107, 158, 255, 0.28);
}
.ph-row-open td { opacity: 0.98; }
/* 持仓中那一行的已实现盈亏可以悬停看拆分（手续费、资金费、当前未实现盈亏） */
.ph-pnl-tip {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.btn.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-elev2, #1e2329);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.btn-sm:hover { border-color: var(--accent); color: var(--accent); }


/* ===== 交易页订单簿（币安风格） ===== */
.trade-orderbook {
  display: flex;
  flex-direction: column;
  padding: 6px 0 4px;
  background: var(--tp-bg, #161a1e);
  border: 1px solid var(--tp-line, #2b3139);
  min-height: 0;
}

/* 最新成交（订单簿下方，对齐币安） */
/* 这一栏和订单簿抢高度。原来最新成交固定吃 36%，1366 屏上盘口每侧只剩 4 行多，
   浅得没法看盘；行高收紧后 30% 也能显示差不多条数，省下的都还给盘口。 */
.trade-mkt-trades {
  display: flex;
  flex-direction: column;
  flex: 0 0 30%;
  min-height: 110px;
  max-height: 34%;
  margin: 0;
  padding: 6px 0 4px;
  background: var(--tp-bg, #161a1e);
  border: 1px solid var(--tp-line, #2b3139);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.mt-head {
  flex: none;
  padding: 0 10px 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* 「每秒汇总」：说明这一栏是按秒并过的，不是逐笔 */
.mt-head-note { font-size: 11px; }
.mt-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #eaecef;
}
/* 表头与数据行同一套列宽/内边距，标题才会正对着数字（币安两者左边缘完全对齐） */
.mt-cols {
  flex: none;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 4px;
  padding: 0 10px 3px 14px;
  font-size: 12px;
  color: #707a8a;
}
.mt-cols span:nth-child(2),
.mt-cols span:nth-child(3) { text-align: right; }
.mt-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 4px;
  font-family: BinancePlex, Arial, "JetBrains Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.mt-list::-webkit-scrollbar { width: 4px; }
.mt-list::-webkit-scrollbar-thumb {
  background: #2b3139;
  border-radius: 2px;
}
.mt-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 4px;
  padding: 0 10px 0 14px;
  min-height: 20px;
  font-size: 14px;
  line-height: 20px;
  color: #eaecef;
}
.mt-row:hover { background: rgba(255,255,255,0.04); }
.mt-row.is-buy .mt-px { color: #0ecb81; }
.mt-row.is-sell .mt-px { color: #f6465d; }
/* 三列同字号同亮度，只有价格带涨跌色——币安这一栏时间也是亮白的，不是灰的 */
.mt-row .mt-qty,
.mt-row .mt-tm { text-align: right; color: #eaecef; }
.mt-empty {
  padding: 16px 10px;
  text-align: center;
  color: #848e9c;
  font-size: 13px;
}
.ob-toolbar {
  flex: none;
  padding: 0 10px 2px;
}
/* 工具条是纯开销，占掉的每一像素都是从盘口深度里扣的。
   这条「跟单深度」原来 33px，是工具条里最大的一块，收紧到一行高。 */
.ob-copy-depth {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 1px 0 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(107, 158, 255, 0.08);
  border: 1px solid rgba(107, 158, 255, 0.22);
  line-height: 1.35;
}
.ob-cd-label {
  font-size: 12px;
  color: #848e9c;
  flex: none;
}
.ob-cd-pct {
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 700;
  color: #eaecef;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.ob-cd-pct.ok { color: #0ecb81; }
.ob-cd-pct.warn { color: var(--accent); }
.ob-cd-pct.bad { color: #f6465d; }
.ob-cd-sub {
  font-size: 11px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.ob-title-row h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #eaecef;
}
.ob-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ob-view {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px;
  border: 1px solid #2b3139;
  border-radius: 2px;
  background: #0b0e11;
}
.ob-view-btn {
  width: 22px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: #848e9c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ob-view-btn:hover { background: rgba(255,255,255,0.04); color: #eaecef; }
.ob-view-btn.active { background: #2b3139; color: #eaecef; }
.ob-ico {
  display: block;
  width: 12px;
  height: 10px;
  position: relative;
}
.ob-ico::before,
.ob-ico::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  border-radius: 0.5px;
}
.ob-ico-both::before { top: 0; background: #f6465d; opacity: 0.95; }
.ob-ico-both::after { bottom: 0; background: #0ecb81; opacity: 0.95; }
.ob-ico-bid::before { top: 1px; height: 2px; background: #0ecb81; opacity: 0.35; }
.ob-ico-bid::after { bottom: 0; height: 4px; background: #0ecb81; opacity: 1; }
.ob-ico-ask::before { top: 0; height: 4px; background: #f6465d; opacity: 1; }
.ob-ico-ask::after { bottom: 1px; height: 2px; background: #f6465d; opacity: 0.35; }
.ob-tick {
  min-width: 64px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid #2b3139;
  border-radius: 2px;
  background: #1e2329;
  color: #eaecef;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ob-tick:hover,
.ob-tick:focus {
  border-color: #474d57;
  outline: none;
}
.ob-cols {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 4px;
  padding: 0 10px 3px 14px;
  font-size: 12px;
  color: #707a8a;
}
/* 表头里的 (USDT)/(BTC)：<i> 默认斜体，这里要正体；单位放不下由 JS 摘掉，不许换行 */
.col-unit { font-style: normal; }
.ob-cols span,
.mt-cols span { white-space: nowrap; overflow: hidden; }
.ob-cols span:nth-child(2),
.ob-cols span:nth-child(3) { text-align: right; }
.ob-side {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #2b3139 transparent;
}
.ob-mode-both .ob-side {
  max-height: none;
  min-height: 0;
}
.ob-mode-bid .ob-asks,
.ob-mode-ask .ob-bids { display: none; }
.ob-mode-bid .ob-bids,
.ob-mode-ask .ob-asks {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: none;
}
.ob-mode-ask .ob-mid {
  order: 2;
  border-top: 0;
}
.ob-mode-ask .ob-asks { order: 1; }
.ob-mode-bid .ob-mid {
  border-bottom: 0;
}
.ob-side::-webkit-scrollbar { width: 4px; }
.ob-side::-webkit-scrollbar-thumb {
  background: #2b3139;
  border-radius: 2px;
}
.ob-side-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.ob-asks .ob-side-inner { justify-content: flex-end; }
.ob-bids .ob-side-inner { justify-content: flex-start; }
.ob-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 4px;
  padding: 0 10px 0 14px;
  min-height: 22px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-family: BinancePlex, Arial, "JetBrains Mono", Consolas, monospace;
  cursor: pointer;
  line-height: 22px;
  z-index: 0;
  flex: none;
}
.ob-row:hover { background: rgba(255,255,255,0.04); }
/* 自己有挂单的那一档：只在行首点一个小三角，和币安一致。
   整行不染色——订单簿已经靠红绿区分买卖、靠深度条表示数量，
   再叠一层底色会和这两者抢注意力，价格档本身反而更难读。
   三角固定一个颜色，不跟买卖方向变：它表达的是「这一档有我的单」，
   与方向无关，跟着变色反倒像是又一种买卖标记。 */
.ob-row .ob-mine-mark {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid #f0b90b;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  z-index: 1;
  pointer-events: none;
}
/* 同一档有多笔时，在三角右边标笔数。行左内边距只有 14px，
   三角占 2~7px，这里从 8px 起，正好不压到价格 */
.ob-row .ob-mine-badge {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  line-height: 1;
  color: #f0b90b;
  font-weight: 700;
  z-index: 1;
  pointer-events: none;
}
.ob-row .ob-bar {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
}
.ob-row.ask .ob-bar { background: #f6465d; }
.ob-row.bid .ob-bar { background: #0ecb81; }
.ob-row.ask .ob-px { color: #f6465d; }
.ob-row.bid .ob-px { color: #0ecb81; }
.ob-row .ob-qty,
.ob-row .ob-sum { color: #eaecef; text-align: right; }
.ob-mid {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin: 0;
  border-top: 1px solid #2b3139;
  border-bottom: 1px solid #2b3139;
  background: rgba(30, 35, 41, 0.55);
}
.ob-mid-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ob-last {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #eaecef;
}
.ob-last.up { color: #0ecb81; }
.ob-last.down { color: #f6465d; }
.ob-last-arrow {
  font-size: 13px;
  line-height: 1;
  color: inherit;
}
.ob-mid-main:has(.ob-last.up) .ob-last-arrow { color: #0ecb81; }
.ob-mid-main:has(.ob-last.down) .ob-last-arrow { color: #f6465d; }
.ob-spread { font-size: 11px; white-space: nowrap; color: #848e9c; }
.ob-agg-hint {
  margin: 0 10px 4px;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--accent);
  background: rgba(90,127,196, 0.08);
  border: 1px solid rgba(90,127,196, 0.22);
  border-radius: 4px;
}
.ob-agg-hint.hidden { display: none; }
.ob-empty {
  padding: 28px 10px;
  text-align: center;
  color: #848e9c;
  font-size: 12px;
}
.ob-more {
  padding: 4px 10px;
  text-align: center;
  color: #848e9c;
  font-size: 11px;
  flex: none;
}

/* 窗口之外的价位：只有我自己的挂单，市场深度未知。
   不画深度条、合计标成下界，免得被读成「市场在这个价位只有 5000」 */
.ob-row.is-beyond { background: rgba(255, 255, 255, 0.02); }
.ob-row.is-beyond .ob-px,
.ob-row.is-beyond .ob-qty { opacity: 0.75; }
.ob-sum-na { color: #5d6673; font-size: 10.5px; font-style: italic; }

/* 顶部划转 / 提现弹窗 */
.fund-modal { width: 440px; }
.fund-modal-head { margin-bottom: 14px; }
.fund-modal-head h3 { margin: 0 0 6px; }
.fund-modal-desc { margin: 0; font-size: 12px; line-height: 1.45; }
.fund-bals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b0e11;
  border: 1px solid var(--border);
}
.fund-bals.fund-bals-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) {
  .fund-bals.fund-bals-4 { grid-template-columns: repeat(4, 1fr); }
}
.fund-bals div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fund-bals .muted { font-size: 11px; }
.fund-bals b {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
#withdrawModal .fund-bals,
#userTransferModal .fund-bals { grid-template-columns: 1fr 1fr; }
.ut-peer-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b0e11;
  font-size: 12px;
  line-height: 1.45;
  color: #848e9c;
}
.ut-peer-box.ut-peer-ok {
  border-color: rgba(14, 203, 129, 0.35);
  color: var(--text);
}
.ut-peer-box.ut-peer-warn {
  border-color: rgba(90,127,196, 0.4);
}
.ut-peer-box b { color: #0ecb81; font-weight: 600; }
.fund-amt-row { display: flex; gap: 8px; align-items: center; }
.fund-amt-row input { flex: 1; }
.fund-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.fund-modal .field { margin-bottom: 12px; }
.fund-modal .modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }

/* 统一杠杆：有账户到不了这个倍数时标出来（悬停有名单） */
.gc-uni-lev-val.is-capped { color: var(--accent); cursor: help; }
.gc-uni-lev-val.is-capped::after { content: "*"; }

/* 群控账户行的「数量 / 限价」：两个没标题的输入框并排，谁也认不出哪个是哪个。
   标题压在框上方，占的是原来就留白的那点高度，不挤宽度。 */
.gc-leg-inp { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gc-leg-inp > span { font-size: 10px; line-height: 1; color: var(--muted); }
.gc-leg-inp > input { width: 100%; }

/* 群控：按比例开仓的快捷档位 */
.gc-pct-marks { display: flex; gap: 6px; margin: -4px 0 2px; }
.gc-pct-marks button {
  flex: 1 1 0;
  padding: 4px 0;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.gc-pct-marks button:hover { color: var(--text); border-color: var(--accent); }
.gc-pct-marks button.active { color: var(--text); border-color: var(--accent); background: var(--bg-elev); }

/* 全账户实时成交（独立应用窗口，不在主控制台页签里） */
.fills-window { min-height: 100vh; display: flex; flex-direction: column; }
.fills-win-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--bg-elev); border-bottom: 1px solid var(--border);
  flex: none;
}
.fills-win-bar .brand { gap: 8px; }
.fills-win-bar h1 { font-size: 15px; margin: 0; font-weight: 600; }
.fills-win-main {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding: 12px 16px 16px;
}
.fills-window .filters { margin-bottom: 8px; }
.fills-window .fills-table-wrap {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
  overflow: auto;
}
.fills-window .fills-table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  z-index: 1;
}
#lfTable th:nth-child(2),
#lfTable td:nth-child(2) { text-align: left; }
#lfTable .lf-acc small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}
#lfTable .lf-oid {
  font-family: var(--num-font);
  font-size: 12px;
  color: var(--muted);
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fills-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.fills-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.fills-live.is-on { color: var(--green); }
.fills-live.is-on .fills-live-dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 189, 133, 0.45);
  animation: fills-pulse 1.6s ease-out infinite;
}
@keyframes fills-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 189, 133, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(46, 189, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 189, 133, 0); }
}
.lf-pause {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}
.lf-pause input { margin: 0; }
/* 成交窗口的两个页签：全部成交 / 对冲成交 */
.lf-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--border);
}
.lf-tab {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: -1px;
}
.lf-tab:hover { color: var(--text); }
.lf-tab.active {
  color: var(--text);
  background: var(--bg-elev);
  border-color: var(--border);
  border-bottom-color: var(--bg-elev);
}
.lf-view-note {
  margin: -2px 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
#lfTable tr.lf-pair-head td,
#lfTable tr.lf-single-head td {
  text-align: left;
  padding: 7px 10px;
  background: var(--bg-elev2);
  border-top: 2px solid var(--border);
}
#lfTable tr.lf-pair-head td { font-weight: 600; }
#lfTable tr.lf-single-head td { color: var(--muted); font-weight: 500; }
#lfTable .lf-pair-metrics {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
#lfTable .lf-pair-metrics b { font-family: var(--num-font); font-weight: 600; color: var(--text); }
#lfTable .lf-pair-metrics b.num-pos { color: var(--green); }
#lfTable .lf-pair-metrics b.num-neg { color: var(--red); }
#lfTable td.lf-slip { font-family: var(--num-font); }
#lfTable .lf-src {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(240, 185, 11, 0.45);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.sound-modal { width: 360px; }
.sound-modal h3 { margin: 0 20px 8px 0; }
.sound-modal-desc { margin: 0 0 16px; line-height: 1.45; }
.sound-vol {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}
.sound-vol > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text);
  font-size: 13px;
}
.sound-vol > span b {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.sound-vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sound-vol-row input[type=range] {
  flex: 1 1 auto;
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------------------------------------------------------------- 暴涨做空马丁（策略页） */
.ps-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.ps-meta b { color: var(--text); font-weight: 600; }
/* 指标连成一条，格子之间一条缝，不再一格一个框套在卡片里 */
.ps-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px; margin-bottom: 12px; background: var(--border); border-radius: 10px; overflow: hidden;
}
.ps-kpi { background: var(--bg-elev2); border: none; border-radius: 0; padding: 10px 12px 11px; min-width: 0; }
.ps-kpi-k { color: var(--muted); font-size: 11px; margin-bottom: 3px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-kpi-v { font-size: 16px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; font-family: var(--num-font); overflow-wrap: anywhere; }
.ps-kpi-v .muted { font-weight: 400; font-size: 12px; }
.ps-kpi-s { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.35; font-variant-numeric: tabular-nums; }
#psReplay .ps-kpis { grid-template-columns: repeat(9, minmax(0, 1fr)); margin-top: 2px; }
#psReplay .ps-kpi { padding: 8px 10px 9px; }
#psReplay .ps-kpi-v { font-size: 13px; }
.ps-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.ps-about { margin-top: 8px; }
.ps-about > summary { cursor: pointer; color: var(--muted); font-size: 12px; width: max-content; }
.ps-about > summary:hover { color: var(--text); }
.ps-about .hint { margin: 6px 0 0; }
.ps-x { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--bg-elev2); border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 600; font-family: var(--num-font); line-height: 16px; }
.ps-log-filter { margin: 0; gap: 4px; }
.ps-log-filter .seg-btn { flex: none; padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.ps-log-filter .seg-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.ps-more-row td { text-align: center; border-bottom: none; }
.ps-more-row:hover { background: none; }
.ps-plan-list { max-height: 560px; overflow-y: auto; }
/* 默认收起的卡片（方案日志、其他策略）：整条标题可点，展开箭头在标题前 */
.ps-fold > details > summary { list-style: none; cursor: pointer; margin-bottom: 0; align-items: center; gap: 8px 12px; }
.ps-fold > details > summary h2 { flex: 0 1 auto; }
.ps-fold > details > summary::-webkit-details-marker { display: none; }
.ps-fold > details > summary h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.ps-fold > details[open] > summary h2::before { transform: rotate(90deg); }
.ps-fold > details[open] > summary { margin-bottom: 14px; }
.ps-fold > details > summary > .muted:last-child { flex: 1 1 auto; font-size: 12px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 12px; }
.ps-log-card .card-head { flex-wrap: wrap; gap: 8px; }
.ps-legacy-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr); gap: 20px; }
@media (max-width: 900px) { .ps-legacy-body { grid-template-columns: 1fr; } }
.ps-actions .btn:disabled { opacity: .45; cursor: default; }
.ps-note { border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; font-size: 12px; line-height: 1.5; }
.ps-note-warn { background: rgba(240, 185, 11, .10); color: #f0b90b; }
.ps-note-err { background: var(--red-bg); color: var(--red); }
.ps-note-info { background: rgba(128, 128, 128, .10); }
.ps-warn { color: #f0b90b; }
.ps-group { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.ps-group:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.ps-group-t { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.ps-group-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.ps-wide { grid-column: 1 / -1; }
#psCfgCard .field, #nlCfgCard .field, #wkCfgCard .field, #zzCfgCard .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
#psCfgCard .ps-group-body .field { margin-bottom: 0; }
#psCfgCard .field input, #psCfgCard .field select, #nlCfgCard .field input, #wkCfgCard .field input, #zzCfgCard .field input { width: 100%; box-sizing: border-box; padding: 7px 10px; font-size: 13px; }
#psCfgCard .ps-group-body .field input { padding: 6px 9px; }
.ps-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-field, .ps-check { position: relative; }
.ps-field.ps-changed::before, .ps-check.ps-changed::before { content: ""; position: absolute; left: -8px; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--accent); }
.ps-field.ps-changed .ps-name, .ps-check.ps-changed { color: var(--text); }
.ps-def { display: none; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.ps-changed .ps-def { display: block; }
.ps-check .ps-def { display: none; margin-left: auto; }
.ps-check.ps-changed .ps-def { display: inline; }
.ps-desc { display: none; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
.ps-field:focus-within .ps-desc { display: block; }
.ps-check { margin-bottom: 0; font-size: 13px; }
/* 保存栏平时在卡片底部；有没保存的改动时浮到窗口右下角，改到哪儿都点得到（这一页的滚动容器让 sticky 不生效） */
.ps-save-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ps-save-bar .ps-dirty { display: none; color: #f0b90b; font-size: 12px; }
.ps-save-bar.dirty { position: fixed; right: 24px; bottom: 20px; z-index: 60; margin: 0; padding: 10px 14px;
  background: var(--bg-elev); border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.ps-save-bar.dirty .ps-dirty { display: inline; order: -1; }
.ps-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ps-tag { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 2px 1px 7px; font-size: 12px; color: var(--text); font-family: var(--num-font); }
.ps-tag-x { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 5px; font-size: 14px; line-height: 1; }
.ps-tag-x:hover { color: var(--red); }
.ps-bl-add { display: flex; gap: 6px; }
#psCfgCard .ps-bl-add input, #nlCfgCard .ps-bl-add input, #wkCfgCard .ps-bl-add input, #zzCfgCard .ps-bl-add input { flex: 1; min-width: 0; }
.ps-table th, .ps-table td { padding: 8px 8px; }
.ps-table th:first-child, .ps-table td:first-child { padding-left: 4px; }
.ps-table td { font-size: 14px; font-variant-numeric: tabular-nums; font-family: var(--num-font); vertical-align: top; }
.ps-table td .muted { font-size: 12px; }
.ps-table td > div { font-size: 12px; }
.ps-table td .badge { font-size: 11px; padding: 1px 5px; vertical-align: 1px; }
/* 开仓 / 平仓时间是参考信息，灰色，不和价格、盈亏抢眼（10-24 用户要求） */
.ps-table td.ps-td-t { color: var(--muted); }
/* 出场是文字：左对齐。「多拿平仓·反弹（亏）」这种长的把列撑宽时，空白落在字后面，不会把每一行的「止盈」推到格子右边 */
.ps-table th.ps-col-exit, .ps-table td.ps-col-exit { text-align: left; }
.ps-table td > .ps-err { max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
#tab-strategy .grid > * { min-width: 0; }   /* 否则窄屏时表格的最小宽度把整列撑出屏幕，表格自己的横向滚动用不上 */
/* 策略页整页一列（2026-10-23）：状态 → 参数 → 持仓梯子 → 已平梯子 | 运行日志 → 每日对账 → 方案日志（收起）→ 其他策略（收起） */
#tab-strategy .grid { grid-template-columns: minmax(0, 1fr); }
#tab-strategy .col-main { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; container-name: pscol; }
#tab-strategy .col-main > .card, #tab-strategy .ps-split > .card { margin: 0; }
/* 状态卡：标题和状态在左，启动 / 暂停 / 平仓在右，不用翻过指标才找得到 */
.ps-status-head, .ps-replay-head { flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ps-head-text { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.ps-replay-head .ps-head-text { display: block; flex: 1 1 220px; }
.ps-head-text h2 .muted { font-size: 12px; font-weight: 400; margin-left: 6px; }
.ps-sub { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; margin-top: 2px; }
.ps-status-head .ps-actions { margin: 0 0 0 auto; flex: none; }
.ps-status-head .ps-actions .btn { padding: 7px 12px; font-size: 13px; }
.ps-status-head .ps-actions .btn-danger { margin-left: 6px; }
#psKpis .ps-kpi-k, #nlKpis .ps-kpi-k, #wkKpis .ps-kpi-k, #zzKpis .ps-kpi-k, .stov-kpis .ps-kpi-k { white-space: normal; overflow: visible; }
#psKpis .ps-kpi-v, #nlKpis .ps-kpi-v, #wkKpis .ps-kpi-v, #zzKpis .ps-kpi-v, .stov-kpis .ps-kpi-v { font-size: 18px; }
/* 参数卡：账簿和模拟盘/实盘挪进卡片头，参数分组排成小块 */
.ps-cfg-head { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ps-cfg-head h2 .muted { font-size: 12px; font-weight: 400; margin-left: 6px; }
.ps-cfg-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-left: auto; }
.ps-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ps-inline select { min-width: 200px; max-width: 280px; padding: 5px 8px; font-size: 13px; }
/* 模拟盘 / 实盘：在状态卡头上，选中的那个实心上色——模拟盘黄、实盘红（2026-10-26 用户：切换按钮太不明显。
   在那之前它挤在参数卡头里，没现货做多那组连选中样式都没有，两个按钮长得一模一样） */
.ps-mode { margin: 0; gap: 0; padding: 3px; flex: none; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-elev2); }
.ps-mode .seg-btn { flex: none; padding: 6px 16px; font-size: 13px; font-weight: 700; border: none; border-radius: 7px;
  background: transparent; white-space: nowrap; }
.ps-mode .seg-btn:hover:not(.active):not(:disabled) { color: var(--text); background: rgba(255, 255, 255, .04); }
.ps-mode .seg-btn.ps-m-paper.active { background: #f0b90b; color: #1a1208; }
.ps-mode .seg-btn.ps-m-live.active { background: var(--red); color: #fff; }
.ps-mode .seg-btn:disabled { cursor: not-allowed; }
.ps-mode .seg-btn:disabled:not(.active) { opacity: .45; }
/* 宽屏分左右两栏、各自往下排（JS 把小块放进左栏 .ps-pcol、大块放进右栏）：两栏高度差不多。
   按行排时（10-23 第一版）960–1440 宽下大块独占整行、小块两两一行，参数卡约 1030px；auto-fill 更糟，一宽就 5～7 列、右边空一截。 */
#psParams { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ps-pcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; container-type: inline-size; container-name: pspcol; }
#psParams .ps-group { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, .02); min-width: 0; }
#psParams .ps-group-t { display: flex; align-items: baseline; gap: 2px 8px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
#psParams .ps-group-t .muted { flex: 1 1 auto; font-size: 11px; font-weight: 400; line-height: 1.4; }
#psParams .ps-group-body { align-items: stretch; }
#psParams .ps-field, #psParams .ps-check { min-width: 0; }
#psParams .ps-name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
/* 小块里的勾选独占一行。宽块里的勾选排到数字后面，单独成一行开关，不和输入框交错 */
#psParams .ps-group:not(.ps-g-wide) .ps-check.ps-wide { grid-column: 1 / -1; }
#psParams .ps-check.ps-wide { grid-column: auto; align-self: stretch; margin: 0; min-height: 32px; display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev2); white-space: normal; line-height: 1.35; }
/* 默认值写在输入框下面，独占这一格。写在名称旁边时，四列里「首仓名义价值」和「默认 100」会叠在一起 */
#psParams .ps-field.ps-changed input, #nlParams .ps-field.ps-changed input, #wkParams .ps-field.ps-changed input,
#zzParams .ps-field.ps-changed input { border-color: var(--accent); }
#psParams .ps-field.ps-changed .ps-def { display: block; white-space: normal; }
#psParams .ps-field.ps-changed::before, #psParams .ps-check.ps-changed::before, #nlParams .ps-field.ps-changed::before,
#wkParams .ps-field.ps-changed::before, #zzParams .ps-field.ps-changed::before { content: none; }
#psParams .ps-check.ps-changed { border-color: var(--accent); }
#psParams .ps-check .ps-def { margin-left: auto; }
#psParams .ps-field.ps-wide { grid-column: 1 / -1; }
#psParams .ps-g-wide { container-type: inline-size; container-name: pswide; }
@container pscol (min-width: 720px) {
  #psParams { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
/* 左栏够宽时小块也排四格一行，和右栏大块的四格对齐 */
@container pspcol (min-width: 520px) {
  #psParams .ps-group:not(.ps-g-wide) .ps-group-body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container pswide (min-width: 520px) {
  #psParams .ps-g-wide .ps-group-body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 占两格：四个开关排成两行，「止盈后提走超出本金的部分」不用在一格里折成两行 */
  #psParams .ps-g-wide .ps-check { order: 1; grid-column: span 2; }
}
/* 收起：表单藏起来，只留一行摘要；有没保存的改动时保存栏照样浮在右下角 */
.ps-cfg-sum { display: none; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; }
.ps-cfg-sum .ps-sum-i { display: inline-flex; gap: 5px; align-items: baseline; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--num-font); font-variant-numeric: tabular-nums; }
.ps-cfg-sum .ps-sum-i .muted { font-family: inherit; }
.ps-cfg-sum .ps-sum-i.ps-changed { border-color: var(--accent); }
#psCfgCard.ps-collapsed .ps-cfg-sum { display: flex; }
#psCfgCard.ps-collapsed #psParams, #psCfgCard.ps-collapsed .ps-about, #psCfgCard.ps-collapsed .ps-save-bar:not(.dirty) { display: none; }
#psCfgCard.ps-collapsed .card-head { margin-bottom: 10px; }
/* 已平梯子占满剩余宽度，日志固定一窄列（短句不需要半屏）。高度仍只跟左边那张表走 */
.ps-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); gap: 14px; align-items: stretch; }
.ps-split > .card { min-width: 0; }
.ps-log-card { display: flex; flex-direction: column; }
.ps-log-card .event-log {
  flex: 1 1 auto; height: 0; min-height: 220px; max-height: none;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--border); border-radius: 8px; padding: 2px 10px;
}
@container pscol (max-width: 1040px) {
  .ps-split { grid-template-columns: minmax(0, 1fr); }
  .ps-log-card .event-log { flex: none; height: auto; max-height: 420px; }
}
/* 表按内容收宽，数字靠在一起。拉满整张卡片时，右对齐的数字中间会空出一整列 */
#psLadders, #psHistory, #psReplay .ps-table, #nlLots, #nlHistory, .stov-rows,
#wkArmed, #wkRows, #wkHistory, #wkDays, #zzTop, #zzPos, #zzHistory { width: max-content; max-width: 100%; }
.ps-table td.ps-hist-act { text-align: right; padding-right: 4px; padding-top: 5px; padding-bottom: 5px; }
/* 手动接管：每行一个，平时淡着、指到这一行才亮，和已平梯子的删除一样；卡片头一个「全部手动接管」 */
.ps-table td.ps-lad-act { text-align: right; padding-right: 4px; padding-top: 5px; }
.ps-lad-act .btn { padding: 2px 8px; font-size: 12px; opacity: .45; border-color: transparent; white-space: nowrap; }
#psLadders tr:hover .ps-lad-act .btn, #nlLots tr:hover .ps-lad-act .btn { opacity: 1; border-color: var(--border); }
.ps-lad-act .btn + .btn { margin-left: 4px; }
.ps-lad-act .btn:hover, #psHandoverAll:hover, #nlHandoverAll:hover { color: #f0b90b; border-color: rgba(240, 185, 11, .5) !important; }
.ps-lad-head { display: inline-flex; align-items: center; gap: 10px; }
/* 每日对账：宽屏左边逐日表、右边当天的差异 */
.ps-replay-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 18px; margin-top: 10px; }
.ps-replay-diffs .event-log { max-height: 300px; }
@container pscol (min-width: 1040px) {
  .ps-replay-body { grid-template-columns: max-content minmax(0, 1fr); align-items: start; }
  .ps-replay-diffs .event-log { max-height: 260px; }
}
/* 持仓梯子：份数下的细条（加满变红），止盈 ← 现价 → 加仓 的价格条 */
.ps-units { width: 46px; height: 3px; margin: 6px 0 0 auto; border-radius: 2px; background: var(--bg-elev2); overflow: hidden; }
.ps-units i { display: block; height: 100%; background: var(--accent); }
.ps-units-full i { background: var(--red); }
.ps-strip { position: relative; width: 168px; height: 6px; margin: 6px 0 5px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(46, 189, 133, .6), rgba(132, 142, 156, .22) 50%, rgba(240, 185, 11, .6)); }
.ps-strip-sl { background: linear-gradient(90deg, rgba(46, 189, 133, .6), rgba(132, 142, 156, .22) 50%, rgba(246, 70, 93, .7)); }
.ps-strip i { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--text);
  box-shadow: 0 0 0 2px var(--bg-elev); }
.ps-table td > .ps-strip-lbl { display: flex; justify-content: space-between; gap: 10px; width: 168px; font-size: 12px; }
/* 窄了：价格条收短，「下一档加仓」那一列藏起来（距离在价格条下面、价格在它的悬停里），表不用横着滚 */
@container pscol (max-width: 1040px) {
  .ps-strip, .ps-table td > .ps-strip-lbl { width: 130px; }
  #psLadders .ps-col-add { display: none; }
}
/* 删除按钮平时淡着，指到这一行才亮：每行一个实心按钮太抢眼，还把行撑高 */
.ps-hist-act .btn { padding: 2px 8px; font-size: 11px; opacity: .35; border-color: transparent; }
#psHistory tr:hover .ps-hist-act .btn, #nlHistory tr:hover .ps-hist-act .btn, #wkHistory tr:hover .ps-hist-act .btn { opacity: 1; border-color: var(--border); }
.ps-hist-act .btn:hover { color: var(--red); border-color: rgba(246, 70, 93, .5) !important; }
/* 「策略接管」一律一个颜色（10-27 用户：策略接管这几个字换个颜色）：卡片头的按钮、已平「交给手动」行末的按钮、
   接管进来的那一行下面的标记都用 --takeover，别再借「交给手动」的黄（两个是反方向的操作，同色分不出来） */
#psTakeover, #nlTakeover, #wkTakeover, .ps-hist-act [data-ps-retake], .ps-hist-act [data-nl-retake], .st-takeover { color: var(--takeover); }
.ps-hist-act [data-ps-retake], .ps-hist-act [data-nl-retake] { opacity: .85; }
#psTakeover:hover, #nlTakeover:hover, .ps-hist-act [data-ps-retake]:hover, .ps-hist-act [data-nl-retake]:hover {
  color: var(--takeover); border-color: rgba(169, 140, 245, .6) !important; }
#psTakeover:disabled, #nlTakeover:disabled, #wkTakeover:disabled { color: var(--muted); }
/* 策略日志不红的那几类（开仓、止损、交给手动……）照样写【摘要】，但不加粗；红的才 <b>（10-29 用户：只有不正常的紧急的提示采用红色字） */
.log-line .log-tag { font-weight: 500; }
.ps-hist-act .btn + .btn { margin-left: 4px; }
#psKpis, #nlKpis, #wkKpis, #zzKpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stov-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#psCard, #nlCard, #wkCard, #zzCard, .stov-head-card { container-type: inline-size; }
@container (max-width: 860px) { #psKpis, #nlKpis, #wkKpis, #zzKpis, .stov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 420px) { #psKpis, #nlKpis, #wkKpis, #zzKpis, .stov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container pscol (max-width: 1280px) { #psReplay .ps-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@container pscol (max-width: 860px) { #psReplay .ps-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container pscol (max-width: 520px) { #psReplay .ps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ps-plan-list { display: flex; flex-direction: column; gap: 8px; }
.ps-plan { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.ps-plan > summary { cursor: pointer; font-size: 13px; line-height: 1.6; }
.ps-plan > summary b { font-family: var(--num-font); margin-right: 4px; }
.ps-plan[open] > summary { margin-bottom: 6px; }
.ps-plan-sec { margin: 6px 0 4px; }
.ps-plan-h { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.ps-plan-sec ul, .ps-plan-sec ol { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.65; }
.ps-plan-sec li { margin: 2px 0; }
.ps-replay-ctl { display: inline-flex; gap: 6px; align-items: center; }
.ps-replay-ctl input { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-size: 12px; }

/* 策略页顶上的切换：总览 / 各策略（2026-10-26 用户：切换时没有明显变化）。选中的那个实心底色，圆点是那个策略此刻的状态 */
.strat-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.strat-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elev); }
.strat-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px; border: none; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; font: 600 14px "IBM Plex Sans", "Microsoft YaHei", sans-serif; white-space: nowrap; transition: background .12s, color .12s; }
.strat-tab:hover:not(.active) { color: var(--text); background: rgba(255, 255, 255, .05); }
.strat-tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.strat-book { font-size: 12px; color: var(--muted); }
.strat-book b { color: var(--text); font-weight: 600; }
/* 账簿名旁边的保证金比率（2026-10-30 用户：交易页和策略页都要显示）；到暂停线黄、到全平线红 */
.strat-ratio { font-size: 13px; color: var(--muted); cursor: help; }
.strat-ratio b { font: 600 15px var(--num-font); color: var(--text); }
.strat-ratio b.ps-warn, .stov-risk-now b.ps-warn { color: #f0b90b; }
.strat-ratio b.num-neg, .stov-risk-now b.num-neg { color: var(--red); }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: rgba(132, 142, 156, .5); flex: none; }
.st-dot-ok { background: #0ecb81; box-shadow: 0 0 0 3px rgba(14, 203, 129, .18); }
.st-dot-warn { background: #f0b90b; box-shadow: 0 0 0 3px rgba(240, 185, 11, .18); }
.st-dot-err { background: var(--red); box-shadow: 0 0 0 3px rgba(246, 70, 93, .2); }
.st-mode { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.st-mode:empty { display: none; }
.st-mode-live { background: rgba(246, 70, 93, .16); color: var(--red); }
.st-mode-paper { background: rgba(240, 185, 11, .16); color: #f0b90b; }
.strat-tab.active .st-mode { background: rgba(255, 255, 255, .22); color: #fff; }
.strat-tab.active .st-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }

/* 策略总览（策略页「总览」、交易页底部「策略」页签共用） */
.stov { display: flex; flex-direction: column; gap: 14px; }
.stov.hidden { display: none; }
.stov > .card, .stov-split > .card { margin: 0; }
.stov-head-card .card-head h2 .muted { font-size: 12px; font-weight: 400; margin-left: 6px; }
.stov-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.stov-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: rgba(255, 255, 255, .02); min-width: 0; }
[data-stov="page"] .stov-card { cursor: pointer; transition: border-color .12s; }
[data-stov="page"] .stov-card:hover { border-color: var(--accent); }
.stov-card.st-card-ok { border-left: 3px solid #0ecb81; }
.stov-card.st-card-warn { border-left: 3px solid #f0b90b; }
.stov-card.st-card-err { border-left: 3px solid var(--red); }
.stov-card.st-card-off { opacity: .75; }
.stov-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; }
.stov-card-head .stov-go { margin-left: auto; }
.stov-state { font-size: 12px; color: var(--muted); }
.stov-state.st-lv-ok { color: #0ecb81; }
.stov-state.st-lv-warn { color: #f0b90b; }
.stov-state.st-lv-err { color: var(--red); }
.st-pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; }
.st-pill-live { background: var(--red); color: #fff; }
.st-pill-paper { background: #f0b90b; color: #1a1208; }
.st-pill-off { background: rgba(132, 142, 156, .2); color: var(--muted); }
.stov-kvs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stov-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stov-kv > span { font-size: 11px; color: var(--muted); }   /* 只管标题：写成 .stov-kv span 会连数字里的涨跌色 span 一起变小变灰 */
.stov-kv b { font: 600 14px var(--num-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stov-card .ps-note { margin: 8px 0 0; }
.st-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; line-height: 17px; margin-right: 4px;
  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif; white-space: nowrap; }
.st-chip-ps { background: rgba(246, 70, 93, .14); color: #f6858f; }
.st-chip-nl { background: rgba(14, 203, 129, .14); color: #3fd69c; }
.st-chip-wk { background: rgba(34, 211, 238, .14); color: #4dd9ee; }
.st-chip-zz { background: rgba(232, 121, 249, .14); color: #ec8ffb; }
.stov-rows td.stov-hint { color: var(--muted); font-size: 12px; white-space: normal; min-width: 180px; }
/* 策略、合约、方向、仓位、离场条件是文字：左对齐（数字列照旧右对齐） */
.stov-rows th:nth-child(-n+4), .stov-rows td:nth-child(-n+4), .stov-rows th:last-child, .stov-rows td:last-child { text-align: left; }
/* 持仓表 11 列，和日志并排会被挤得横着滚：上下排，日志在下面 */
.stov-split.ps-split { grid-template-columns: minmax(0, 1fr); }
.stov-split .ps-log-card .event-log { flex: none; height: auto; min-height: 0; max-height: 380px; }
.stov-rows td:first-child .muted { font-size: 11px; }
/* 交易页底部那一块：卡片排一行、持仓表和日志并排，外面已经是卡片了不再套 */
.stov-compact { gap: 0; padding: 4px 2px 2px; container-type: inline-size; }
.stov-compact .stov-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stov-compact .stov-card { padding: 9px 12px; }
.stov-compact .stov-kvs { margin-top: 8px; }
.stov-compact .stov-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stov-pos, .stov-logbox { min-width: 0; }
.stov-sub-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.stov-sub-h .muted { font-weight: 400; font-size: 12px; }
.stov-logbox .stov-log { max-height: 260px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); border-radius: 8px; padding: 2px 10px; }
@container (max-width: 560px) { .stov-kvs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 总览里的风控线（10-29 晚：两条保证金比率线从策略参数页搬到这里，统一一条 + 各策略单独设） */
.stov-risk-card .card-head h2 .muted { font-size: 13px; font-weight: 400; margin-left: 6px; }
.stov-risk-now { font-size: 13px; }
.stov-risk-now b { font: 600 15px var(--num-font); color: var(--text); }
.stov-risk-grid { display: flex; flex-direction: column; gap: 8px; }
.stov-risk-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; padding: 6px 0;
  border-bottom: 1px dashed var(--border); }
.stov-risk-row:last-child { border-bottom: 0; }
.stov-risk-uni { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.stov-risk-name { flex: 0 0 96px; font-size: 14px; }
.stov-risk-row label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
/* 和参数表单的输入框同一个样子（`.nl-field input`）：这里没有 .field 包着，不写的话是浏览器默认的白框 */
.stov-risk-in { width: 112px; box-sizing: border-box; background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 6px 9px; font-size: 14px; text-align: right; outline: none;
  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif; transition: border-color .15s ease, box-shadow .15s ease; }
.stov-risk-in:focus { border-color: rgba(107, 158, 255, .55); box-shadow: 0 0 0 2px rgba(107, 158, 255, .12); }
.stov-risk-in::placeholder { color: #5e6673; font-weight: 400; }
.stov-risk-eff { font-size: 13px; color: var(--muted); }
.stov-risk-eff.stov-risk-own { color: var(--takeover, #b197fc); }
.stov-risk-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.stov-risk-foot .btn { flex: none; white-space: nowrap; }
.stov-risk-msg { font-size: 13px; }
.stov-risk-note { font-size: 13px; margin-top: 8px; line-height: 1.6; }

/* 没现货做多的参数表单：和暴涨做空同一套样子（10-26 用户：两个策略页的样式字体不统一） */
.nl-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.nl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.nl-field input[type=number] { width: 100%; box-sizing: border-box; background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 6px 9px; font-size: 13px; outline: none; font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease; }
.nl-field input[type=number]:focus { border-color: rgba(107, 158, 255, .55); box-shadow: 0 0 0 2px rgba(107, 158, 255, .12); }
.nl-field.ps-changed input[type=number] { border-color: var(--accent); }
.nl-field.ps-changed > span, .nl-chk.ps-changed { color: var(--text); }
.nl-field .ps-def, .nl-chk .ps-def { display: block; }
.nl-chk { flex-direction: row; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 32px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev2); font-size: 13px; }
.nl-chk.ps-changed { border-color: var(--accent); }
.nl-chk .ps-def { flex-basis: 100%; }
/* 参数分块：通用 / 三个开仓的组（各自勾选，立刻生效）/ 暴拉两组共用；块的样子和暴涨做空的参数组一样 */
#nlParams, #wkParams, #zzParams { display: flex; flex-direction: column; gap: 10px; }
.nl-gblock { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; background: rgba(255, 255, 255, .02); min-width: 0; }
.nl-gtitle { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.nl-gtitle .muted { font-weight: 400; font-size: 11px; margin-left: 6px; }
.nl-gtitle-row { margin: 4px 0 -2px; padding-bottom: 0; border-bottom: none; }
.nl-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.nl-group .nl-params { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.nl-gswitch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.nl-gswitch input { width: 16px; height: 16px; cursor: pointer; }
.nl-gstate { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: rgba(14, 203, 129, .12); color: #0ecb81; }
.nl-off .nl-gstate { background: rgba(128, 128, 128, .15); color: var(--muted); }
.nl-gdesc { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 8px 0 10px; }
.nl-group { border-color: rgba(14, 203, 129, .35); }
.nl-group.nl-off { border-color: var(--border); }
.nl-group.nl-off .nl-params, .nl-group.nl-off .nl-gdesc { opacity: .55; }
/* 没现货做多的黑名单在最后一块「选币」里，和暴涨做空的黑名单同一套写法（.field.ps-field + .ps-tags + .ps-bl-add），样式见上面 #psCfgCard 那几条；
   这一块是整行宽，框收到和暴涨做空右栏差不多宽，别拉满整张卡 */
#nlCfgCard .nl-coin .ps-field, #wkCfgCard .nl-coin .ps-field, #zzCfgCard .nl-coin .ps-field { max-width: 620px; margin-bottom: 0; }
/* 策略接管弹窗：账户里不属于策略的仓位，一行一个，单选 */
.stk-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; margin-bottom: 10px; }
.stk-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.stk-row:has(input:checked) { border-color: var(--accent); background: rgba(240, 185, 11, .06); }
.stk-row input { margin: 0; align-self: center; }
.stk-row .muted { font-size: 12px; }
.stk-modal .modal-box { width: 600px; }
.stk-modal .modal-body .kv { gap: 16px; font-size: 13px; padding: 6px 0; }
.stk-modal .modal-body .kv > span:first-child { flex: none; color: var(--muted); }
.stk-modal .modal-body .kv > span:last-child { flex: 1; text-align: left; line-height: 1.55; }
.stk-sub { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.stk-groups .stk-row .muted { flex-basis: 100%; padding-left: 22px; }
.stk-qty { display: block; margin: 0 0 10px; }
.stk-qty input { width: 100%; }
#psParams .ps-group-t { font-size: 13px; }
/* 三页的卡片间距一样：都按 14px 的缝排，卡片自己不带下边距 */
#psWrap, #nlWrap, #wkWrap, #zzWrap { display: flex; flex-direction: column; gap: 14px; }
#psWrap.hidden, #nlWrap.hidden, #wkWrap.hidden, #zzWrap.hidden { display: none; }
#psWrap > .card, #nlWrap > .card, #wkWrap > .card, #zzWrap > .card { margin: 0; }
/* 追涨（2026-11-08）：和另外几个策略同一套样子。手里的每个币下面一行列出每一份；排名表前 3 名（这一小时能出信号的）亮一点 */
#zzTop th:nth-child(2), #zzTop td:nth-child(2), #zzTop th:last-child, #zzTop td:last-child,
#zzPos th:first-child, #zzPos td:first-child, #zzHistory th:first-child, #zzHistory td:first-child,
#zzHistory th:nth-child(5), #zzHistory td:nth-child(5) { text-align: left; }
#zzTop tr.zz-cand td { background: rgba(232, 121, 249, .06); }
#zzTop tr:not(.zz-cand) td { color: var(--muted); }
#zzPos tr.zz-lots-row td { text-align: left; white-space: normal; padding-top: 0; font-size: 13px; color: var(--muted); }
.zz-lot { display: inline-block; margin: 0 14px 4px 0; white-space: nowrap; }
.zz-lot b { color: var(--text); font-weight: 600; }
/* 接插针（2026-10-28）：和另外两个策略同一套样子。名额表的梯子 / 仓位、手里的「哪一块」「离场条件」是文字：左对齐、可以折行 */
#wkArmed th:nth-child(n+7), #wkRows th:nth-child(3), #wkRows th:last-child { text-align: left; }
#wkArmed td.wk-text, #wkRows td.wk-text { text-align: left; white-space: normal; min-width: 150px; }
#wkArmed td.wk-text { min-width: 230px; }
#wkRows td.wk-hint { text-align: left; white-space: normal; min-width: 240px; color: var(--muted); }
.wk-lv { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.wk-fixed { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.wk-fx { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-elev2); }
#wkHistory th:nth-child(-n+2), #wkHistory td:nth-child(-n+2) { text-align: left; }
/* 策略页、交易页「策略」页签整体大一号（2026-10-26 用户：字体显示都大一些）。只在这里统一往上调，别回到各处单独改 */
.strat-tab { font-size: 15px; }
.strat-book { font-size: 13px; }
#tab-strategy .card-head h2 { font-size: 16px; }
#tab-strategy .card-head h2 .muted, #tab-strategy .ps-head-text h2 .muted, .stov-head-card .card-head h2 .muted { font-size: 13px; }
#tab-strategy .ps-meta { font-size: 13px; }
#tab-strategy .ps-note, .stov .ps-note { font-size: 13px; }
#tab-strategy .ps-kpi-k, .stov .ps-kpi-k { font-size: 12px; }
#tab-strategy .ps-kpi-s, .stov .ps-kpi-s { font-size: 12px; }
#tab-strategy .ps-about > summary { font-size: 13px; }
#tab-strategy .hint { font-size: 13px; }
/* 表格：字 15px，第二行小字 13px，表头 14px */
#tab-strategy .ps-table th, .stov .ps-table th { font-size: 14px; }
#tab-strategy .ps-table td, .stov .ps-table td { font-size: 15px; }
#tab-strategy .ps-table td .muted, #tab-strategy .ps-table td > div,
.stov .ps-table td .muted, .stov .ps-table td > div { font-size: 13px; }
#tab-strategy .ps-table td .badge { font-size: 12px; }
.stov-rows td.stov-hint { font-size: 13px; }
#tab-strategy .ps-table td > .ps-strip-lbl { font-size: 13px; }
/* 日志 */
#tab-strategy .event-log, .stov .event-log { font-size: 13px; }
#tab-strategy .log-line, .stov .log-line { padding: 6px 0; }
.ps-x { font-size: 12px; }
/* 总览卡片 */
.stov-card-head { font-size: 15px; }
.stov-state { font-size: 13px; }
.st-pill, .st-mode { font-size: 12px; }
.st-chip { font-size: 12px; line-height: 19px; }
.stov-kv > span { font-size: 12px; }
.stov-kv b { font-size: 16px; }
.stov-sub-h { font-size: 15px; }
.stov-sub-h .muted { font-size: 13px; }
.stov-compact .stov-cards .btn-mini, .stov-cards .stov-go { font-size: 13px; }
/* 参数表单（两个策略一样） */
#psCfgCard .field, .nl-field { font-size: 13px; }
#psCfgCard .field input, #psCfgCard .field select, #psCfgCard .ps-group-body .field input, .nl-field input[type=number] { font-size: 14px; }
#psParams .ps-check, .nl-chk { font-size: 14px; }
#psParams .ps-group-t, .nl-gtitle, .nl-gswitch { font-size: 14px; }
#psParams .ps-group-t .muted, .nl-gtitle .muted { font-size: 12px; }
#tab-strategy .ps-def, #tab-strategy .ps-desc, .nl-gdesc { font-size: 12px; }
.nl-gstate { font-size: 12px; }
.ps-save-bar .ps-dirty { font-size: 13px; }
.ps-cfg-sum { font-size: 13px; }
/* 接插针：固定参数一行行小标签、梯子金额那行说明、离场条件，都按小字 13px */
.wk-fx { font-size: 14px; }
.wk-fx .muted, .wk-lv, #wkRows td.wk-hint { font-size: 13px; }

/* 跨所价差监控（策略页「跨所价差」，2026-11-01）：只读，表格沿用 ps-table，字号跟上面那块一样 */
.xa-cfg { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 4px 0 10px; }
.xa-cfg .field { font-size: 13px; margin: 0; }
.xa-cfg .field input { width: 120px; font-size: 14px; }
.xa-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding-bottom: 9px; cursor: pointer; }
.xa-dirty { font-size: 13px; color: #f0b90b; padding-bottom: 9px; }
.xa-hot { color: var(--red); font-weight: 700; }
.xa-warm { color: #f0b90b; font-weight: 600; }
.xa-table { width: max-content; max-width: 100%; }      /* 按内容收宽，别拉满卡片把数字中间空开（和接插针的表一样） */
.xa-table td { white-space: nowrap; }
.xa-table tr.xa-live td { background: rgba(246, 70, 93, .06); }
.xa-table td.xa-act { text-align: right; padding-right: 4px; }
.xa-table tr.xa-trace-row td { background: var(--bg-elev2); padding: 10px 12px; white-space: normal; }
.xa-trace .muted { font-size: 13px; margin-top: 4px; }
.xa-svg { display: block; width: 100%; max-width: 760px; height: auto; }
.xa-line { fill: none; stroke: var(--brand); stroke-width: 1.6; }
.xa-thr { stroke: var(--red); stroke-width: 1; stroke-dasharray: 5 4; opacity: .7; }
.xa-ax { fill: var(--muted); font-size: 11px; font-family: var(--num-font); }
.xa-pairs { font-size: 13px; line-height: 1.7; padding: 4px 2px 8px; }
