/* Hyperliquid-inspired trading terminal */
:root {
  --bg: #0b0f0e;
  --bg2: #0e1412;
  --panel: #101614;
  --panel2: #131b18;
  --border: #202a27;
  --border2: #2a3733;
  --txt: #e5ece9;
  --mut: #64736e;
  --mut2: #91a19b;
  --grn: #4fd1b5;
  --grn2: #2fb899;
  --red: #f06f75;
  --red2: #dc5961;
  --pur: #4fd1b5;
  --pur2: #2fb899;
  --de-color: #4fd1b5;
  --ex-color: #69a7ff;
  --rs-color: #e8c36a;
}
body { background: var(--bg); font-size: 12px; }
.header {
  height: 52px; padding: 0 14px; background: #0c1210;
  border-bottom-color: var(--border); position: relative;
}
.header > .badge, .header > .hdot, .header > .header-sep { display: none; }
.header-logo { font-size: 15px; letter-spacing: 0; }
.header-logo span { color: var(--grn); }
.main-tabs {
  flex: 1 1 auto; min-width: 0; min-height: 51px; padding: 0 8px; background: transparent;
  border-bottom: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.main-tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; padding: 15px 12px 13px; font-size: 11px; white-space: nowrap; }
.tab-btn.active { color: var(--grn); border-bottom-color: var(--grn); }
.wrap { max-width: none; padding: 0; }
.panel { border-radius: 0; box-shadow: none; }

.strategy-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  min-height: calc(100vh - 98px);
  background: var(--bg);
}
.strategy-config-column {
  order: 2;
  min-width: 0;
  border-left: 1px solid var(--border);
  background: var(--panel);
}
.strategy-monitor-column {
  order: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.strategy-config-column > .panel {
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-top-width: 2px;
  padding: 16px;
}
.strategy-market-panel .choice-picker {
  grid-auto-flow: row;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-columns: auto;
}
.strategy-market-panel select[id$="-market"].choice-select {
  position: static;
  width: 100%;
  height: 38px;
  padding: 7px 34px 7px 10px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 1px solid var(--border2);
}
.strategy-market-panel div[id$="-market-picker"] { display: none; }
.strategy-settings-panel .modes { gap: 6px; }
.strategy-available-balance { min-height: 38px; display: flex; align-items: center; padding: 7px 10px; border: 1px solid var(--border2); background: var(--bg2); color: var(--grn); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.strategy-auto-note { display: flex; align-items: flex-end; padding-bottom: 8px; line-height: 1.45; }
.strategy-settings-panel .mode-btn { min-height: 48px; }
.strategy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.strategy-actions .btn { width: 100%; margin: 0; min-height: 36px; }
.strategy-actions .btn-ghost { grid-column: 1 / -1; }
.strategy-status-panel {
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 20px;
  background: var(--panel);
}
.strategy-status-panel > .grid-2 {
  gap: 28px !important;
  margin: 2px 0 12px !important;
}
.strategy-status-panel .kv { min-height: 31px; align-items: center; }
.strategy-status-panel > .kv { max-width: 720px; }
.strategy-monitor-column > [id$="range-warn"] { padding: 0 20px; }
.strategy-chart-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.strategy-chart-panel .price-panel-title { min-height: 52px; margin: 0; padding: 12px 20px; align-items: center; border-bottom: 1px solid var(--border); }
.strategy-chart-panel [id$="range-warn"] { padding: 10px 20px 0; }
.strategy-chartbox { width: 100%; height: 390px; min-height: 300px; }
.strategy-activity-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 0 !important;
  flex: 1;
  align-items: stretch;
}
.strategy-activity-grid .panel {
  margin: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  min-height: 300px;
  padding: 18px 20px;
}
.strategy-activity-grid .trade-table-wrap { overflow-x: auto; }
.strategy-activity-grid .log { max-height: 360px; }
.strategy-activity-grid .empty-row { height: 180px; }
.strategy-exchange-tabs {
  min-height: 48px;
  height: auto;
  gap: 2px;
  padding: 0 16px;
}
.strategy-exchange-tabs button { min-height: 47px; padding: 0 14px; white-space: nowrap; }
.strategy-exchange-tabs span { padding-left: 16px; text-align: right; line-height: 1.4; }
.strategy-settings-panel .risk-preview {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.chartbox { height: 520px; }
.panel-title { letter-spacing: 0; font-size: 11px; margin-bottom: 10px; }
.price-panel-title { margin-bottom: 2px; }
input, select { background: #0b100f; border-color: var(--border2); border-radius: 3px; }
input:focus, select:focus { border-color: var(--grn); box-shadow: 0 0 0 1px #4fd1b530; }
.choice-btn, .mode-btn, .btn { border-radius: 3px; }
.choice-btn.active, .mode-btn.sel { border-color: var(--grn); color: var(--grn); background: #4fd1b512; }
.btn-start { background: var(--grn); color: #07110e; }
.btn-start:hover:not(:disabled) { background: #6bddc3; }
.btn-stop { background: #f06f7518; border: 1px solid #f06f7560; color: #ff9196; }
.rec-box { border-radius: 3px; }
.kv { border-bottom-color: var(--border); }
th, td { border-bottom-color: var(--border); }

@media (max-width: 1100px) {
  .strategy-workbench { grid-template-columns: minmax(0, 1fr) 350px; }
  .strategy-activity-grid { grid-template-columns: 1fr; }
  .strategy-activity-grid .panel { min-height: 220px; }
}
@media (max-width: 800px) {
  .header { padding: 8px 10px; }
  .wrap { padding: 0; }
  .strategy-exchange-tabs { flex-wrap: wrap; padding: 0 8px 8px; }
  .strategy-exchange-tabs button { flex: 1; min-width: 90px; }
  .strategy-exchange-tabs span { width: 100%; margin: 0; padding: 0 6px; text-align: left; }
  .strategy-workbench { display: flex; flex-direction: column; min-height: 0; }
  .strategy-config-column { order: 1; border-left: 0; }
  .strategy-monitor-column { order: 2; }
  .strategy-status-panel > .grid-2 { grid-template-columns: 1fr; gap: 0 !important; }
  .strategy-activity-grid { grid-template-columns: 1fr; }
  .strategy-chartbox { height: 340px; min-height: 280px; }
  .chartbox { height: 340px; }
}

.trade-terminal { min-height: calc(100vh - 52px); background: #0b0f0e; }
.brand-mark {
  width: 34px; height: 34px; display: inline-block; position: relative;
  background-image: url("/assets/brand/logo.png?v=3");
  background-size: contain; background-position: center center; background-repeat: no-repeat;
  filter: drop-shadow(0 2px 8px rgba(79,209,181,0.25));
  transform: none;
}
.terminal-marketbar {
  height: 68px; display: flex; align-items: center; gap: 34px; padding: 0 16px;
  border-bottom: 1px solid var(--border); background: #0d1211; overflow-x: auto;
}
.product-switch { flex: 0 0 auto; display: flex; align-items: center; padding: 3px; background: #080c0b; border: 1px solid var(--border); }
.product-switch button { flex: 0 0 auto; height: 28px; padding: 0 12px; border: 0; background: transparent; color: var(--mut2); font: inherit; white-space: nowrap; cursor: pointer; }
.product-switch button.active { background: #23312d; color: var(--grn); }
.terminal-symbol { flex: 0 0 180px; min-width: 180px; display: flex; align-items: center; gap: 10px; }
.market-trigger { border: 0; background: transparent; color: var(--txt); text-align: left; cursor: pointer; font: inherit; }
.market-chevron { margin-left: auto; color: var(--mut2); font-size: 15px; }
.terminal-symbol .coin-mark { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #1a2426; }
.terminal-symbol .coin-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.terminal-symbol b { display: block; font-size: 15px; }
.terminal-symbol span:last-child { display: block; color: var(--mut2); font-size: 10px; margin-top: 2px; }
.ticker-stat { min-width: 90px; font-variant-numeric: tabular-nums; }
.terminal-marketbar .ticker-stat:last-child { min-width: 150px; }
.ticker-stat span { display: block; color: var(--mut2); font-size: 10px; margin-bottom: 3px; }
.ticker-stat b { font-size: 12px; white-space: nowrap; }
.ticker-price-stat select { display:block; width:auto; min-width:72px; margin:0 0 3px; padding:0 14px 0 0; border:0; background:transparent; color:var(--mut2); font-size:10px; line-height:14px; cursor:pointer; }
.ticker-price-stat select:focus-visible { outline:1px solid var(--accent); outline-offset:2px; }
.ticker-price-stat select option { background:var(--panel); color:var(--text); }
.terminal-grid { display: grid; grid-template-columns: minmax(560px, 1fr) 360px 350px; grid-template-rows: minmax(540px, calc(100vh - 288px)) 204px; }
.terminal-chart { min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display:flex; flex-direction:column; }
.terminal-toolbar { flex-shrink:0; height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid var(--border); }
.terminal-tabs, .timeframe-tabs, .order-type-tabs { display: flex; align-items: center; gap: 4px; }
.terminal-tabs button, .timeframe-tabs button, .order-type-tabs button {
  border: 0; background: transparent; color: var(--mut2); font: inherit; padding: 7px 9px; cursor: pointer;
  white-space: nowrap; flex: 0 0 auto; /* 禁止文字竖排：按钮不压缩、不换行 */
}
.terminal-section-title .terminal-tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.terminal-tabs button.active, .timeframe-tabs button.active, .order-type-tabs button.active { color: var(--txt); background: #1a2421; }
#trade-chart { width: 100%; flex: 1 1 0; min-height: 360px; }
#trade-chart[hidden], #trade-indicators[hidden] { display:none; }
.trade-chart-subview { min-height:480px; height:calc(100% - 42px); padding:28px; background:#0b0f0e; overflow:auto; }
.trade-chart-subview[hidden] { display:none; }
#trade-chart-details { grid-template-columns:repeat(2,minmax(180px,1fr)); align-content:start; gap:0 36px; }
#trade-chart-details:not([hidden]) { display:grid; }
#trade-chart-details > div { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid var(--border); }
#trade-chart-details span { color:var(--mut2); }
#trade-chart-details b { font-variant-numeric:tabular-nums; }
.indicator-settings { align-content:start; grid-template-columns:repeat(3,minmax(130px,1fr)); gap:1px; background:var(--border); padding:1px; }
.indicator-settings:not([hidden]) { display:grid; }
.indicator-settings button { min-height:64px; display:grid; grid-template-columns:10px 1fr auto; align-items:center; gap:10px; padding:0 16px; border:0; background:#0d1211; color:var(--txt); font:inherit; text-align:left; cursor:pointer; }
.indicator-settings button:hover { background:#15201d; }
.indicator-settings button.active { color:var(--grn); }
.indicator-settings button i { width:8px; height:8px; background:var(--indicator-color); }
.indicator-settings button b { color:var(--mut2); font-size:10px; font-weight:500; }
.chart-indicator-bar { flex-shrink:0; height: 28px; display:flex; align-items:center; gap:6px; padding:0 12px; color:var(--mut2); font-size:11px; border-bottom:1px solid var(--border); overflow-x:auto; scrollbar-width:none; }
.chart-indicator-bar::-webkit-scrollbar { display:none; }
.chart-indicator-bar span { white-space:nowrap; opacity:0.6; }
.chart-indicator-bar button { border:0; background:transparent; color:var(--mut2); padding:3px 6px; cursor:pointer; font:inherit; white-space:nowrap; }
.chart-indicator-bar button.active { color:#f0c84b; }
.chart-indicator-bar button[data-indicator="ema"].active { color:#2196f3; }
.chart-indicator-bar button[data-indicator="boll"].active { color:#4a9eff; }
.chart-indicator-bar button[data-indicator="vol"].active, .chart-indicator-bar button[data-indicator="macd"].active { color:#4fd1b5; }
.orderbook-panel, .order-entry { min-width: 0; background: #0d1211; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.terminal-section-title { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--border); font-weight: 650; }
.order-entry > .terminal-section-title { height:36px; }
.terminal-section-title span { color: var(--mut2); font-size: 10px; font-weight: 400; }
.book-head, .book-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; }
.book-head { height: 30px; align-items: center; color: var(--mut2); font-size: 10px; }
.book-row { height: 22px; align-items: center; position: relative; font-size: 10px; }
.book-row::before { content: ''; position: absolute; z-index: 0; top: 1px; bottom: 1px; right: 0; width: var(--depth); background: var(--depth-color); }
.book-row span, .book-head span { position: relative; z-index: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.book-row.ask span:first-child { color: var(--red); }
.book-row.bid span:first-child { color: var(--grn); }
.book-mid { height: 30px; display: flex; align-items: center; padding: 0 10px; color: var(--grn); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; }
/* 下单区：宽松可读布局，全部字段完整可见，超高时内部滚动；标签列加宽避免中文换行被切 */
.order-entry { position:relative; border-right:0; padding-bottom:10px; overflow-y:auto; scrollbar-width:thin; }
.side-switch { display:grid; grid-template-columns:1fr 1fr; margin:10px 10px 8px; background:#080c0b; padding:3px; }
.side-switch button { height:32px; border:0; color:var(--mut2); background:transparent; cursor:pointer; font:inherit; }
.side-switch button.active[data-side="buy"] { color: #07110e; background: var(--grn); }
.side-switch button.active[data-side="sell"] { color: white; background: var(--red); }
.order-type-tabs { margin:0 10px 8px; border-bottom:1px solid var(--border); }
.order-type-tabs button { padding:7px 11px; }
/* ════════════════════════════════════════════════════════════════
   下单区全局 hidden 兜底：
   .order-entry > label（含 reduce-only-control）/ .order-field /
   .trigger-order-grid / .trade-popover / .order-summary 都显式设置了
   display:flex / grid，其选择器特异性 (0,2,0) > 浏览器 UA 原生
   [hidden]{display:none} 的 (0,1,0)，导致 JS 写 .hidden = true 仍然可见！
   这里统一用 !important 兜底，JS hidden 属性绝对生效。
   ════════════════════════════════════════════════════════════════ */
.order-entry > label[hidden],
.order-entry > label.reduce-only-control[hidden],
.order-field[hidden],
.trigger-order-grid[hidden],
.trade-popover[hidden],
.amount-slider[hidden],
.slider-labels[hidden],
.order-summary[hidden],
.terminal-order-btn[hidden] { display: none !important; }

.order-entry > label { display:flex; justify-content:space-between; margin:6px 10px; color:var(--mut2); font-size:11px; min-height:16px; line-height:16px; }
/* ════════════════════════════════════════════════════════════════
   order-field 现货/合约共用：三列严格等分显示
   左列：文字标签（预估价/限价/数量/杠杆…） 右列：币种单位（USDT/BTC/模式…）
   中列：输入框/选择器
   ════════════════════════════════════════════════════════════════ */
.order-field { min-height:40px; height:40px; display:grid; grid-template-columns:64px 1fr 60px; align-items:center; justify-items: stretch; margin:6px 10px; padding:0 10px; border:1px solid var(--border2); background:#090e0c; overflow:visible; }
.order-field[hidden] { display:none !important; }
.order-field span { color: var(--mut2); white-space: nowrap; justify-self: start; align-self: center; padding-left: 2px; overflow: visible; clip-path: none; width:100%; text-align:left; font-size:11px; line-height: 16px; }
.order-field b { justify-self: end; align-self: center; text-align: right; font-size: 11px; font-weight: 500; white-space: nowrap; padding-right: 2px; color: var(--mut2); overflow: visible; clip-path: none; width:100%; line-height:16px; }
/* 输入框/选择器：明确 display:flex 不成立，用盒模型 + line-height 确保文字垂直居中，
   不被 Chrome 默认基线对齐 + border-box 压成"贴边卡线" */
.order-field input { min-width:0; width:100%; height:34px; line-height:34px; border:0; background:transparent; text-align:right; padding:0 8px; margin:0; font:inherit; font-variant-numeric: tabular-nums; color:var(--txt); display:inline-block; vertical-align:middle; box-sizing:border-box; font-size:12px; }
.order-field input[readonly] { color: var(--txt); opacity: 1; }
.order-field select { min-width:0; width:100%; height:34px; line-height:34px; border:0; background:transparent; color:var(--txt); text-align:right; padding:0 8px; font:inherit; display:inline-block; vertical-align:middle; box-sizing:border-box; font-size:12px; }
.order-field select option { background:#0b100f; color:var(--txt); }
.order-field select option:checked { background:#1c6bd1; color:#fff; }
/* 杠杆/保证金下拉触发器：单独一列时，居中不贴边 */
.order-field .order-select-trigger { min-width:0; width:100%; height:34px; line-height:34px; border:0; background:transparent; color:var(--txt); text-align:right; padding:0 8px; margin:0; font:inherit; font-variant-numeric:tabular-nums; cursor:pointer; box-sizing:border-box; display:inline-block; vertical-align:middle; }
.order-field-action { position:relative; }
.order-select-trigger { min-width:0; width:100%; border:0; background:transparent; color:var(--txt); text-align:right; padding:0 8px; font:inherit; font-variant-numeric:tabular-nums; cursor:pointer; }
.order-select-trigger::after { content:'⌄'; color:var(--mut2); margin-left:7px; font-size:12px; }

/* 条件单（trigger）两列网格：被上面的大段替换时一起删掉了，这里补回，避免"条件"tab 下触发价/方向行变形 */
.trigger-order-grid { height:40px; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.8fr); gap:6px; margin:6px 10px; }
.trigger-order-grid[hidden] { display:none; }
.trigger-order-grid label { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:6px; padding:0 9px; border:1px solid var(--border2); background:#090e0c; color:var(--mut2); min-height:40px; }
.trigger-order-grid input,.trigger-order-grid select { min-width:0; width:100%; height:34px; line-height:34px; border:0; background:transparent; color:var(--txt); text-align:right; padding:0 8px; margin:0; font:inherit; vertical-align:middle; box-sizing:border-box; }
.trigger-order-grid select option { background:#0b100f; color:var(--txt); }
.trigger-order-grid b { color:var(--txt); font-size:11px; white-space: nowrap; padding-right:2px; justify-self:end; align-self:center; line-height:16px; }

/* 现货/合约 共用的 0%-100% 按钮行：强制 display:flex，避免被 .aentry-pcts（portal.css）的 display:grid 选择器从更上层命中，spot 页目前 slider-labels 被渲染成 grid 导致按钮竖排 */
.order-entry .slider-labels { display:flex !important; flex-direction: row !important; justify-content: space-between; margin: 0 6px 2px; flex-wrap: nowrap; gap: 2px; }
.order-entry .slider-labels button { min-width:0; flex: 1 1 0; height:24px; padding:0 2px; border:0; background:transparent; color:var(--mut); font:inherit; font-size:10px; cursor:pointer; white-space: nowrap; display:inline-flex; align-items:center; justify-content:center; }
.trade-popover { position:absolute; z-index:30; left:10px; right:10px; margin:0; padding:10px; border:1px solid var(--border2); background:#121b18; box-shadow:0 12px 30px #000c; }
.trade-popover[hidden] { display:none; }
.popover-title { display:flex; justify-content:space-between; margin:0 2px 8px; color:var(--txt); font-size:11px; font-weight:650; }
.popover-title span { color:var(--mut2); font-size:9px; font-weight:400; }
.leverage-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; }
.leverage-grid button { height:30px; border:1px solid var(--border2); background:#0b100f; color:var(--mut2); font:inherit; font-size:10px; cursor:pointer; }
.leverage-grid button:hover,.leverage-grid button.active { border-color:var(--grn); background:#4fd1b514; color:var(--grn); }
.margin-mode-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.margin-mode-grid button { min-height:48px; border:1px solid var(--border2); background:#0b100f; color:var(--mut2); text-align:left; padding:7px 9px; cursor:pointer; }
.margin-mode-grid button:hover,.margin-mode-grid button.active { border-color:var(--grn); background:#4fd1b514; color:var(--grn); }
.margin-mode-grid b,.margin-mode-grid small { display:block; }
.margin-mode-grid b { font-size:11px; }
.margin-mode-grid small { margin-top:3px; color:var(--mut2); font-size:9px; }
.order-entry > label.reduce-only-control { min-height:38px; justify-content:flex-start; align-items:center; gap:8px; margin:6px 10px; padding:0 6px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); color:var(--txt); cursor:pointer; }
.reduce-only-control input { accent-color: var(--grn); }
.reduce-only-control button { display:flex; align-items:center; gap:7px; border:0; background:transparent; color:var(--mut2); padding:0; font:inherit; cursor:pointer; }
.reduce-only-control button i { width:18px; height:10px; position:relative; border-radius:8px; background:#33413c; transition:.15s ease; }
.reduce-only-control button i::after { content:''; position:absolute; top:2px; left:2px; width:6px; height:6px; border-radius:50%; background:#9ca8a3; transition:.15s ease; }
.reduce-only-control button[aria-checked="true"] { color:var(--grn); }
.reduce-only-control button[aria-checked="true"] i { background:var(--grn); }
.reduce-only-control button[aria-checked="true"] i::after { left:10px; background:#07110e; }
.reduce-only-control small { margin-left:auto; color:var(--mut); font-size:9px; white-space:nowrap; }
/* 滑块：归一化高度，避免 Win Chrome 原生滑块高 22px 挤走下方百分比/摘要行 */
.amount-slider { width:calc(100% - 20px); height:16px; margin:10px 10px 4px; accent-color:var(--grn); -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.amount-slider::-webkit-slider-runnable-track { height: 4px; background: #1c2522; border-radius: 3px; }
.amount-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--grn); border: 2px solid #090e0c; box-shadow: 0 0 0 1px var(--grn); cursor: pointer; }
.amount-slider::-moz-range-track { height: 4px; background: #1c2522; border-radius: 3px; }
.amount-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--grn); border: 2px solid #090e0c; box-shadow: 0 0 0 1px var(--grn); cursor: pointer; }
.order-entry .slider-labels { display:flex !important; flex-direction: row !important; justify-content: space-between; margin: 0 6px 4px; flex-wrap: nowrap; gap: 2px; }
.order-entry .slider-labels button { min-width:0; flex: 1 1 0; height:28px; padding:0 2px; border:0; background:transparent; color:var(--mut); font:inherit; font-size:10px; cursor:pointer; white-space: nowrap; display:inline-flex; align-items:center; justify-content:center; }
.slider-labels { display:flex; justify-content:space-between; margin:0 6px 4px; flex-wrap: nowrap; gap: 2px; }
.slider-labels button { min-width:0; flex: 1 1 0; height:28px; padding:0 2px; border:0; background:transparent; color:var(--mut); font:inherit; font-size:10px; cursor:pointer; white-space: nowrap; }
.slider-labels button:hover,.slider-labels button.active { color:var(--grn); background:#4fd1b512; }
.order-summary { min-height:22px; display:flex; align-items:center; justify-content:space-between; gap: 8px; margin:6px 10px; color:var(--mut2); font-size:11px; }
.order-summary[hidden] { display: none; }
.order-summary b { color: var(--txt); }
.terminal-order-btn { width:calc(100% - 20px); height:42px; margin:10px 10px 6px; border:0; background:var(--grn); color:#07110e; font:inherit; font-weight:750; cursor:pointer; flex-shrink: 0; }
.app-toast { position: fixed; z-index: 1000; right: 16px; top: 96px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--border2); background: #151d1a; color: var(--txt); box-shadow: 0 12px 34px #0008; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .18s ease; }
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.error { border-color: #f06f7570; color: #ffafb3; }
.app-toast.ok { border-color: #4fd1b570; color: #8ce8d3; }
.aim-confirm-overlay { position: fixed; inset: 0; z-index: 2000; background: #000a; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); animation: aimFade .15s ease; }
@keyframes aimFade { from { opacity: 0; } to { opacity: 1; } }
.aim-confirm-dialog { width: min(420px, calc(100vw - 48px)); background: #131e1b; border: 1px solid #2a4540; border-radius: 12px; box-shadow: 0 24px 80px #000b; padding: 24px; animation: aimPop .2s ease; }
@keyframes aimPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.aim-confirm-dialog.danger { border-color: #f06f7555; }
.aim-confirm-dialog h3 { margin: 0 0 16px; font-size: 17px; color: #e8f0ec; font-weight: 600; }
.aim-confirm-dialog ul { list-style: none; margin: 0 0 20px; padding: 0; }
.aim-confirm-dialog li { padding: 6px 0; font-size: 14px; color: #a8bcb6; line-height: 1.5; }
.aim-confirm-dialog li b { color: #e8f0ec; }
.aim-confirm-actions { display: flex; gap: 12px; }
.aim-confirm-actions button { flex: 1; height: 42px; border: 0; border-radius: 8px; font-size: 15px; cursor: pointer; transition: .15s; }
.aim-confirm-cancel { background: #1c2926; color: #8ea09a; border: 1px solid #2a3a36; }
.aim-confirm-cancel:hover { background: #243531; }
.aim-confirm-ok { background: #1a8f72; color: #fff; }
.aim-confirm-ok:hover { background: #22a684; }
.aim-confirm-ok.danger { background: #c44d52; }
.aim-confirm-ok.danger:hover { background: #d9666c; }
.market-picker-backdrop { position: fixed; inset: 0; z-index: 1200; background: #0008; display: flex; align-items: flex-start; justify-content: center; padding-top: 96px; }
.market-picker-backdrop[hidden] { display: none; }
.market-picker-dialog { width: min(800px, calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left) - 24px)); border: 1px solid var(--border2); background: #101a1c; box-shadow: 0 24px 80px #000b; }
.market-search { display: grid; grid-template-columns: 28px 1fr 34px; align-items: center; margin: 10px; height: 36px; padding-left: 9px; border: 1px solid #637176; background: #152125; }
.market-search input { border: 0; background: transparent; padding: 0; }
.market-search button { border: 0; background: transparent; color: var(--mut2); font-size: 20px; cursor: pointer; }
.market-category-tabs { display: flex; gap: 18px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.market-category-tabs button { height: 38px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mut2); font: inherit; cursor: pointer; }
.market-category-tabs button.active { color: var(--txt); border-bottom-color: var(--grn); }
.market-list-head, .market-list-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; align-items: center; min-height: 38px; padding: 0 12px; text-align: right; }
.market-list-head { color: var(--mut2); font-size: 10px; }
.market-list-head span:first-child, .market-list-row span:first-child { text-align: left; }
.market-list-row { width: 100%; border: 0; background: #172327; color: var(--txt); font: inherit; cursor: pointer; }
.market-list-row:hover { background: #203034; }
.market-pair { display: flex; align-items: center; gap: 9px; min-width: 0; }
.market-pair > span:last-child { text-align: left; white-space: nowrap; }
.market-list-logo { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #263235; }
.market-list-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.market-list-row em { margin-left: 7px; padding: 2px 5px; color: var(--grn); background: #123c38; font-size: 9px; font-style: normal; }
.market-list-row i { font-style: normal; }
.market-list-row i.up { color: var(--grn); }
.market-list-row i.down { color: var(--red); }
.market-list-row small { color: var(--txt); }
.terminal-bottom { grid-column: 1 / 4; border-bottom: 1px solid var(--border); background: #0d1211; }
.terminal-bottom .terminal-tabs { height: 42px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.terminal-empty { height: 150px; display: grid; place-items: center; color: var(--mut); }
.terminal-account-content { height: 150px; overflow: auto; }
.terminal-data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.terminal-data-table th, .terminal-data-table td { height: 36px; padding: 0 14px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.terminal-data-table th { color: var(--mut2); font-size: 10px; font-weight: 500; }
.terminal-data-table th:first-child, .terminal-data-table td:first-child { text-align: left; }
.table-action { height: 26px; padding: 0 9px; border: 1px solid var(--border2); background: transparent; color: var(--txt); cursor: pointer; }
.position-close-control { display: inline-grid; grid-template-columns: 92px 64px auto; align-items: center; gap: 5px; }
.position-close-control input,
.position-close-control select { height: 28px; min-width: 0; border: 1px solid var(--border2); background: #090e0c; color: var(--txt); font: inherit; }
.position-close-control input { width: 92px; padding: 0 7px; text-align: right; }
.position-close-control select { width: 64px; padding: 0 5px; }
.position-close-control select option { background: #0b100f; color: var(--txt); }
.asset-name { color: var(--txt); font-weight: 650; }
.asset-name small { margin-left: 7px; color: var(--mut2); font-weight: 400; }
.strategy-exchange-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--border); background: #0d1211; }
.strategy-exchange-tabs span { margin-left: auto; color: var(--mut2); font-size: 10px; }
.strategy-exchange-tabs button { border: 0; background: transparent; color: var(--mut2); cursor: pointer; font: inherit; }
.strategy-exchange-tabs button.active { color: var(--grn); background: #4fd1b512; }
.strategy-exchange-tabs button.strategy-running { color: var(--grn); }
#tab-overview .overview-report-grid { display: none; }
#tab-overview .ov-card .trend-box { margin-top: 10px; }
#tab-de .panel:has(.chartbox),
#tab-ex .panel:has(.chartbox),
#tab-rs .panel:has(.chartbox) { display: none !important; }

@media (max-width: 1150px) {
  .terminal-grid { grid-template-columns: minmax(420px, 1fr) 250px 320px; }
  .terminal-marketbar { gap: 20px; }
}
/* ≤1000px 时，合约/现货下单区堆叠到下一行，不再被压成 ~280px 窄条导致文字遮挡 */
@media (max-width: 1000px) {
  .terminal-grid {
    display: flex;
    flex-direction: column;
  }
  .terminal-grid > .terminal-chart { flex: 0 0 auto; min-height: 360px; }
  .terminal-grid > .orderbook-panel { flex: 0 0 auto; height: 380px; }
  .terminal-grid > .order-entry { flex: 0 0 auto; overflow: visible; }
  .terminal-grid > .terminal-bottom { flex: 0 0 auto; }
}

/* ── 订单簿面板 tab + 最近成交 + 深度图 ────────────────────────────────────── */
.orderbook-panel { display: flex; flex-direction: column; }
.orderbook-panel > .terminal-section-title { flex: 0 0 auto; gap: 0; }
.orderbook-panel > .terminal-section-title .terminal-tabs { flex: 1 1 auto; }
.book-panel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.book-panel[hidden] { display: none; }
#trade-book-panel .book-rows { flex: 0 0 auto; }
#trade-trades { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.trade-trades-list .book-row { grid-template-columns: 1fr 1fr 1.2fr; }
.trade-trades-list .book-row span:last-child { color: var(--mut2); font-size: 9px; }
#trade-depth-panel { padding: 6px; display: flex; flex-direction: column; }
#trade-depth-canvas { flex: 1 1 0; min-height: 200px; width: 100%; display: block; }

/* ── 资金费率倒计时 ────────────────────────────────────────────────────────── */
.ticker-funding-stat b { font-variant-numeric: tabular-nums; }
.ticker-funding-stat #trade-funding-countdown { color: var(--grn); }

/* ── 自选收藏星标 ──────────────────────────────────────────────────────────── */
.market-favorite-btn { flex: 0 0 auto; width: 22px; height: 22px; border: 0; background: transparent; color: #4a5752; font-size: 14px; line-height: 1; cursor: pointer; }
.market-favorite-btn.active { color: #f0c84b; }
.market-favorite-btn:hover { color: #f0c84b; }
.market-list-row .market-favorite-btn { margin-right: 6px; }

/* ── 订单簿聚合精度 ──────────────────────────────────────────────────────────── */
.book-precision-select { background: transparent; border: 1px solid var(--border); color: var(--mut2); font: 10px ui-monospace, monospace; padding: 1px 4px; border-radius: 2px; cursor: pointer; }

/* ── 下单有效期 ──────────────────────────────────────────────────────────────── */
.order-tif-field select { background: transparent; border: 1px solid var(--border); color: var(--txt); font: inherit; padding: 2px 4px; border-radius: 2px; cursor: pointer; }

/* ── 市价单预估价 ─────────────────────────────────────────────────────────────── */
#trade-order-price-field .est-price-tag { font-size: 9px; color: var(--mut2); }

@media (max-width: 900px) {
  .header > .badge, .header > .hdot, .header > .header-sep { display: none; }
  .header { min-height: 48px; flex-wrap: nowrap; }
  .header-logo { flex: 0 0 auto; white-space: nowrap; }
  .header-right { flex: 0 0 auto; margin-left: auto; }
  .header-right .conn, .header-right #hdr-time { display: none; }
  .wallet-connect { padding: 5px 9px; font-size: 11px; }
  .main-tabs { scrollbar-width: none; }
  /* 窄屏：三栏改为上下堆叠，下单区独占整行不再挤压 */
  .terminal-grid { display:flex; flex-direction:column; }
  .terminal-grid > .terminal-chart { flex:0 0 auto; }
  .terminal-grid > .orderbook-panel { flex:0 0 auto; height:380px; }
  .terminal-grid > .order-entry { flex:0 0 auto; overflow:visible; }
  .terminal-grid > .terminal-bottom { flex:0 0 auto; }
  .terminal-chart .chart-indicator-bar { font-size: 10px; }
  .terminal-bottom { min-height: 220px; }
  .ticker-stat:nth-last-child(-n+2) { display: none; }
}

/* ── ≤560px 手机：最激进 —— marketbar 只留 symbol+price+24h，下单面板触控增大 ── */
@media (max-width: 560px) {
  .trade-terminal { min-height: 100svh; }
  .terminal-marketbar {
    height: auto; min-height: 62px; padding: 8px 10px; gap: 12px;
    flex-wrap: wrap; align-items: flex-start; overflow-x: auto;
  }
  .product-switch { order: 1; flex: 0 0 auto; }
  .product-switch button { height: 32px; padding: 0 10px; font-size: 12px; }
  .terminal-symbol {
    order: 2; flex: 0 0 100%; min-width: 0;
    justify-content: space-between; padding: 2px 0;
  }
  .terminal-symbol b { font-size: 15px; }
  .terminal-symbol span:last-child { font-size: 10px; }
  .market-chevron { margin-left: 0; }
  .terminal-marketbar .ticker-stat {
    order: 3; min-width: 0; flex: 1 1 0; padding: 4px 2px;
  }
  .terminal-marketbar .ticker-stat span { font-size: 9px; }
  .terminal-marketbar .ticker-stat b { font-size: 12px; }
  /* 保留最多 3 个 ticker stat（24h price change + High/Low），否则全隐藏 */
  .terminal-marketbar .ticker-stat:nth-child(n+6) { display: none; }
  .terminal-marketbar .ticker-stat.optional-stat { display: none; }
  .terminal-marketbar .market-favorite-btn { order: 4; width: 28px; height: 28px; font-size: 16px; }
  .terminal-grid { grid-template-columns: 1fr; }
  .terminal-grid > .terminal-chart { min-height: 280px; flex: 0 0 auto; }
  #trade-chart { min-height: 260px; }
  .terminal-toolbar { height: 42px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; gap: 8px; flex-wrap: nowrap; }
  .terminal-toolbar::-webkit-scrollbar { display: none; }
  .terminal-tabs, .timeframe-tabs, .order-type-tabs {
    flex-shrink: 0; overflow-x: auto; scrollbar-width: none; gap: 2px;
    max-width: 100%;
  }
  .terminal-tabs::-webkit-scrollbar, .timeframe-tabs::-webkit-scrollbar, .order-type-tabs::-webkit-scrollbar { display: none; }
  .terminal-tabs button, .timeframe-tabs button, .order-type-tabs button {
    padding: 8px 10px; font-size: 12px; min-height: 36px;
  }
  /* timeframe 周期：手机默认全列出来可横滑，不要堆叠 */
  .orderbook-panel { flex: 0 0 auto; height: 420px; }
  .book-panel { padding-top: 2px; }
  .book-head, .book-row { gap: 4px; padding: 0 8px; }
  .book-row { font-size: 10px; height: 24px; }
  .book-head { font-size: 10px; }
  .order-entry.aentry { border-radius: 12px; padding: 0 0 14px; }
  .order-entry.aentry > .terminal-section-title { height: 44px; padding: 0 12px; }
  /* 订单底部表格手机折叠卡片 */
  .terminal-bottom { min-height: 240px; }
  .terminal-data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .terminal-data-table thead { display:none; }
  .terminal-data-table, .terminal-data-table tbody, .terminal-data-table tr { display:block; width:100%; }
  .terminal-data-table tr { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; padding:10px 10px; border-bottom:1px solid var(--border); }
  .terminal-data-table td {
    display:flex; justify-content:space-between; gap:8px; width:auto; border:0; padding:2px 0; text-align:right;
    font-size: 12px;
  }
  .terminal-data-table td::before { content:attr(data-label); color:var(--mut2); text-align:left; font-size: 11px; }
  .terminal-data-table td:first-child { grid-column: 1 / -1; }
  .terminal-data-table .empty-row { display: block; grid-column: 1 / -1; padding: 18px 6px; }
  #trade-indicators { padding: 12px; }
  #trade-chart-details { grid-template-columns: 1fr; padding: 18px 14px; }
  #trade-chart-details > div { min-height: 44px; padding: 0 4px; }
  .indicator-settings { grid-template-columns: 1fr !important; }
  .indicator-settings button { min-height: 52px; padding: 0 14px; }
}

/* ≤380px 超窄手机 marketbar 再压缩一档 */
@media (max-width: 380px) {
  .terminal-symbol .coin-mark { width: 26px; height: 26px; }
  .terminal-marketbar .ticker-stat:nth-child(n+5) { display: none; }
  .terminal-symbol b { font-size: 14px; }
  .terminal-marketbar .ticker-stat b { font-size: 11px; }
}

/* ── 订单簿窄栏防竖排：压缩间距 + 缩字号 + 数字不换行省略 ─────────────────── */
@media (max-width: 1150px) {
  .book-head, .book-row { gap: 3px; padding: 0 8px; }
  .book-row { font-size: 9.5px; }
  .book-head { font-size: 9px; }
}
@media (max-width: 900px) {
  .book-head, .book-row { gap: 2px; padding: 0 6px; }
  .book-row { font-size: 9px; height: 20px; }
  .book-head { font-size: 8.5px; }
}

@media (max-width: 800px) {
  .strategy-exchange-tabs { flex-wrap: wrap; padding: 0 8px 8px; }
  .strategy-exchange-tabs button { flex: 1; min-width: 90px; }
  .strategy-exchange-tabs span { width: 100%; margin: 0; padding: 0 6px; text-align: left; }
}

/* ════════════════════════════════════════════════════════════════
   现货 / 合约 下单区 —— 对齐 A 币交易（.aentry）视觉规范
   作用域：aside.order-entry.aentry；保持 core.js id / 类体系不变，
   仅做视觉镜像：圆角卡片 / buy绿 sell红 胶囊按钮 / 34px 聚焦变绿输入行
   / 5列百分比按钮 / 虚线 quote-box 摘要 / 渐变下单按钮。
   ════════════════════════════════════════════════════════════════ */
.order-entry.aentry {
  border: 1px solid #1d2c2e;
  background: #101a1c;
  border-radius: 14px;
  padding-bottom: 14px;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
/* 原有 .order-entry 给 border-right 深色线，A 币卡片不需要 */
.order-entry.aentry { border-right: 1px solid #1d2c2e; }

.order-entry.aentry > .terminal-section-title {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #1d2c2e;
  font-weight: 650;
  margin: 0;
}
.order-entry.aentry > .terminal-section-title span {
  color: #81918e;
  font-size: 10px;
  font-weight: 400;
}

/* 买入 / 卖出 —— A 币 aentry-switch 同色：9px 圆角胶囊 1px 29413e 边框 */
.order-entry.aentry > .side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 12px 0;
  padding: 0;
  background: transparent;
}
.order-entry.aentry > .side-switch button {
  height: 32px;
  border: 1px solid #29413e;
  background: #0a1112;
  color: #81918e;
  font: inherit;
  font-size: 12.5px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}
.order-entry.aentry > .side-switch button.active[data-side="buy"] {
  color: #071312;
  background: #50d2c2;
  border-color: #50d2c2;
  font-weight: 700;
}
.order-entry.aentry > .side-switch button.active[data-side="sell"] {
  color: #fff;
  background: #f26c78;
  border-color: #f26c78;
  font-weight: 700;
}

/* 市价 / 限价 / 条件 三列 —— A 币 aentry-type 同色 */
.order-entry.aentry > .order-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 12px 0;
  padding: 0;
  border-bottom: 0;
}
.order-entry.aentry > .order-type-tabs button {
  height: 28px;
  border: 0;
  background: #0a1112;
  color: #81918e;
  font: inherit;
  font-size: 11.5px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0 6px;
  flex: none;
}
.order-entry.aentry > .order-type-tabs button.active {
  color: #50d2c2;
  background: rgba(80, 210, 194, 0.12);
}

/* 平台可用余额 / 可用保证金 行 —— A 币 aentry-avail 同色 */
.order-entry.aentry > label:not(.reduce-only-control) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 14px 0;
  padding: 0;
  min-height: 16px;
  line-height: 16px;
  color: #81918e;
  font-size: 11px;
  cursor: pointer;
}
.order-entry.aentry > label:not(.reduce-only-control) span {
  color: inherit;
}
.order-entry.aentry > label:not(.reduce-only-control) span:last-child,
.order-entry.aentry > label:not(.reduce-only-control) b {
  color: #e7f1ef;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.order-entry.aentry > label:not(.reduce-only-control):hover span:last-child,
.order-entry.aentry > label:not(.reduce-only-control):hover b {
  color: #50d2c2;
}

/* 输入行：.order-field 单格 —— A 币 aentry-field 视觉（34px 9px 圆角 29413e 聚焦变绿） */
.order-entry.aentry > .order-field {
  min-height: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  justify-items: stretch;
  margin: 6px 12px 0;
  padding: 0 10px;
  border: 1px solid #29413e;
  background: #0a1112;
  border-radius: 9px;
  transition: border-color 0.2s;
  overflow: visible;
}
.order-entry.aentry > .order-field:focus-within {
  border-color: #50d2c2;
}
.order-entry.aentry > .order-field span {
  color: #81918e;
  font-size: 11px;
  white-space: nowrap;
  padding-left: 2px;
  text-align: left;
  line-height: 16px;
  overflow: visible;
  clip-path: none;
  width: 100%;
  justify-self: start;
  align-self: center;
}
.order-entry.aentry > .order-field b {
  color: #81918e;
  font-size: 11px;
  text-align: center;
  font-weight: 400;
  white-space: nowrap;
  padding-right: 2px;
  justify-self: end;
  align-self: center;
  width: 100%;
  line-height: 16px;
  overflow: visible;
  clip-path: none;
}
.order-entry.aentry > .order-field input {
  width: 100%;
  min-width: 0;
  height: 32px;
  line-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: #e7f1ef;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  outline: none;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
  text-align: right;
}
.order-entry.aentry > .order-field input[readonly] {
  color: #e7f1ef;
  opacity: 1;
}
.order-entry.aentry > .order-field select {
  width: 100%;
  min-width: 0;
  height: 32px;
  line-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: #e7f1ef;
  font: inherit;
  font-size: 13px;
  outline: none;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
  text-align: right;
}
.order-entry.aentry > .order-field select option {
  background: #0a1112;
  color: #e7f1ef;
}
.order-entry.aentry > .order-field .order-select-trigger {
  width: 100%;
  min-width: 0;
  height: 32px;
  line-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  margin: 0;
  color: #e7f1ef;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  text-align: right;
}

/* 条件单：trigger-order-grid 两列也用 aentry-field 同色 */
.order-entry.aentry > .trigger-order-grid {
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  gap: 6px;
  margin: 6px 12px 0;
}
.order-entry.aentry > .trigger-order-grid label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid #29413e;
  background: #0a1112;
  border-radius: 9px;
  color: #81918e;
  font-size: 11px;
  transition: border-color 0.2s;
}
.order-entry.aentry > .trigger-order-grid label:focus-within { border-color: #50d2c2; }
.order-entry.aentry > .trigger-order-grid input,
.order-entry.aentry > .trigger-order-grid select {
  width: 100%;
  min-width: 0;
  height: 32px;
  line-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: #e7f1ef;
  font: inherit;
  font-size: 12.5px;
  outline: none;
  margin: 0;
  box-sizing: border-box;
  text-align: right;
}
.order-entry.aentry > .trigger-order-grid b {
  color: #81918e;
  font-size: 11px;
  white-space: nowrap;
  justify-self: end;
  align-self: center;
  line-height: 16px;
}

/* 只减仓：沿用 reduce-only-control 默认布局 + A 币同色系外框 */
.order-entry.aentry > label.reduce-only-control {
  min-height: 36px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 0 10px;
  border: 1px solid #29413e;
  border-top-color: #29413e;
  border-bottom-color: #29413e;
  background: #0a1112;
  border-radius: 9px;
  color: #cdd8d5;
  cursor: pointer;
}
.order-entry.aentry > label.reduce-only-control small {
  margin-left: auto;
  color: #6b7a77;
  font-size: 9px;
  white-space: nowrap;
}

/* 滑块：A 币 aentry-slider 固定高度 16px + 绿 #50d2c2 */
.order-entry.aentry > .amount-slider {
  display: block;
  width: calc(100% - 24px);
  height: 16px;
  margin: 10px 12px 0;
  accent-color: #50d2c2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.order-entry.aentry > .amount-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: #1d2c2e;
  border-radius: 3px;
}
.order-entry.aentry > .amount-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #50d2c2;
  border: 2px solid #0a1112;
  box-shadow: 0 0 0 1px #50d2c2;
  cursor: pointer;
}
.order-entry.aentry > .amount-slider::-moz-range-track {
  height: 4px;
  background: #1d2c2e;
  border-radius: 3px;
}
.order-entry.aentry > .amount-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #50d2c2;
  border: 2px solid #0a1112;
  box-shadow: 0 0 0 1px #50d2c2;
  cursor: pointer;
}

/* 百分比按钮：A 币 aentry-pcts 5 列 grid 6px 圆角 24px 高，hover 全绿白字 */
.order-entry.aentry > .slider-labels,
.order-entry.aentry .slider-labels {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 6px 12px 0;
  flex-direction: row !important;
  justify-content: normal;
  flex-wrap: nowrap;
}
.order-entry.aentry > .slider-labels button,
.order-entry.aentry .slider-labels button {
  flex: none;
  height: 24px;
  padding: 0 2px;
  border: 0;
  background: #0a1112;
  color: #81918e;
  font: inherit;
  font-size: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.order-entry.aentry > .slider-labels button:hover,
.order-entry.aentry > .slider-labels button.active,
.order-entry.aentry .slider-labels button:hover,
.order-entry.aentry .slider-labels button.active {
  background: #50d2c2;
  color: #071312;
  font-weight: 700;
}

/* 下单按钮：A 币 submit 渐变 + shadow；sell 侧红色 */
.order-entry.aentry > .terminal-order-btn {
  width: calc(100% - 24px);
  margin: 12px 12px 0;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #50d2c2, #5bd8c6);
  color: #071312;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(80, 210, 194, 0.25);
  flex-shrink: 0;
  display: block;
}
.order-entry.aentry > .terminal-order-btn:hover { filter: brightness(1.08); }
/* JS 在 core.js 里切换 .active[data-side='sell']，这里让按钮按当前选中的 side 变色 */
.order-entry.aentry:has(.side-switch button.active[data-side="sell"]) > .terminal-order-btn {
  background: linear-gradient(90deg, #f26c78, #ff7f8a);
  color: #fff;
  box-shadow: 0 6px 20px rgba(242, 108, 120, 0.25);
}

/* 虚线 quote-box 摘要区（来自 portal.css .quote-box）—— 这里只把 order-summary 转成 q-row */
.order-entry.aentry > .quote-box {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0a1112;
  border: 1px dashed #1d2c2e;
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.order-entry.aentry > .quote-box .order-summary.q-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: #81918e;
  font-size: 12px;
}
.order-entry.aentry > .quote-box .order-summary.q-row span {
  color: #81918e;
  flex-shrink: 0;
}
.order-entry.aentry > .quote-box .order-summary.q-row b {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: #e7f1ef;
}
/* [hidden] 兜底：order-summary 是 div，UA [hidden] 默认生效，但前面已经加了 .order-summary[hidden]{display:none !important}，这里加父作用域确保 q-row 的 hidden 也不被 .quote-box display:grid 影响 */
.order-entry.aentry > .quote-box .order-summary.q-row[hidden] { display: none !important; }

/* 杠杆/保证金 popover 卡片：改用 A 币深色卡系，不被上一级浅灰配色带出边界线 */
.order-entry.aentry > .trade-popover {
  left: 12px;
  right: 12px;
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid #29413e;
  background: #101a1c;
  border-radius: 10px;
  box-shadow: 0 12px 30px #000c;
}
.order-entry.aentry > .trade-popover .popover-title {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 8px;
  color: #e7f1ef;
  font-size: 11px;
  font-weight: 650;
}
.order-entry.aentry > .trade-popover .popover-title span { color: #81918e; font-size: 9px; font-weight: 400; }
.order-entry.aentry > .trade-popover .leverage-grid button {
  height: 30px;
  border: 1px solid #29413e;
  background: #0a1112;
  color: #81918e;
  font: inherit;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
}
.order-entry.aentry > .trade-popover .leverage-grid button:hover,
.order-entry.aentry > .trade-popover .leverage-grid button.active {
  border-color: #50d2c2;
  background: rgba(80, 210, 194, 0.12);
  color: #50d2c2;
}
.order-entry.aentry > .trade-popover .margin-mode-grid button {
  min-height: 48px;
  border: 1px solid #29413e;
  background: #0a1112;
  color: #81918e;
  text-align: left;
  padding: 7px 9px;
  cursor: pointer;
  border-radius: 8px;
}
.order-entry.aentry > .trade-popover .margin-mode-grid button:hover,
.order-entry.aentry > .trade-popover .margin-mode-grid button.active {
  border-color: #50d2c2;
  background: rgba(80, 210, 194, 0.12);
  color: #50d2c2;
}
