:root {
  --outer-bg: #080a0f;
  --outer-card: #11151d;
  --phone-bg: #0b0e14;
  --surface-1: #131822;
  --surface-2: #1b2230;
  --surface-3: #232c3d;
  --border: #232b3a;
  --border-strong: #323e54;
  --text-1: #f0f4fa;
  --text-2: #8e9bb0;
  --text-3: #5b677d;
  --green: #0ecb81;
  --green-soft: rgba(14, 203, 129, 0.14);
  --red: #f6465d;
  --red-soft: rgba(246, 70, 93, 0.14);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", sans-serif;
  background: var(--outer-bg);
  color: var(--text-1);
  min-height: 100vh;
  padding: 18px 22px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.num { font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ===== 外部控制区 ===== */
.outer-bar {
  width: 100%;
  max-width: 1200px;
  background: var(--outer-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.outer-brand { display: flex; align-items: center; gap: 10px; }
.outer-brand h1 { font-size: 15px; font-weight: 600; }
.outer-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}
.outer-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctrl-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 8px;
}
.ctrl-label { font-size: 11px; color: var(--text-2); padding: 0 6px; }
.ctrl-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.ctrl-btn:hover { color: var(--text-1); }
.ctrl-btn.active { background: var(--blue); color: #fff; font-weight: 500; }

.stage {
  width: 100%;
  max-width: 1200px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== 手机真机外框容器 ===== */
.phone-frame {
  width: 394px;
  height: 832px;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(155deg, #2a3346, #131720);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  flex-shrink: 0;
}
.phone-notch {
  width: 102px;
  height: 22px;
  background: #000;
  border-radius: 12px;
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
}
.phone-viewport {
  width: 100%;
  height: 100%;
  border-radius: 35px;
  background: var(--phone-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
}

/* ===== 右侧外部说明区 ===== */
.outer-notes {
  flex: 1;
  min-width: 320px;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note-card {
  background: var(--outer-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.note-card h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.scene-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.scene-btn {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-1);
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.scene-btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.note-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.note-list strong { color: var(--text-1); font-weight: 500; }
.phase-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  margin-right: 4px;
}
.phase-pill.p1 { background: var(--green-soft); color: var(--green); }
.phase-pill.p2 { background: var(--purple-soft); color: #c084fc; }

/* ===== 手机内部：顶部系统状态栏与网络提示 ===== */
.status-bar {
  height: 36px;
  padding: 10px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.net-banner {
  display: none;
  padding: 6px 12px;
  font-size: 11px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.net-banner.show { display: flex; }
.net-banner.slow { background: rgba(245, 158, 11, 0.14); color: var(--amber); border-bottom: 1px solid rgba(245, 158, 11, 0.28); }
.net-banner.offline { background: rgba(246, 70, 93, 0.16); color: #ff7a8a; border-bottom: 1px solid rgba(246, 70, 93, 0.3); }
.net-banner-left { display: flex; align-items: center; gap: 6px; }

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg { display: block; }

/* ===== 交易主屏顶栏 ===== */
.top-bar {
  height: 50px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.symbol-btn {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.symbol-btn:hover { background: var(--surface-1); }
.sym-line-1 { display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 700; }
.sym-line-2 { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-top: 1px; }
.pill-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 500;
}
.top-right { display: flex; align-items: center; gap: 6px; }
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 132px;
}
.acct-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn:hover { border-color: var(--border-strong); }
.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.net-badge.slow { background: var(--amber-soft); color: var(--amber); }
.net-badge.offline { background: var(--red-soft); color: var(--red); }

/* 周期条 */
.tf-bar {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(35, 43, 58, 0.65);
  flex-shrink: 0;
}
.tf-group { display: flex; gap: 4px; }
.tf-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
}
.tf-btn.active { background: var(--surface-2); color: var(--text-1); font-weight: 600; }
.tf-status { font-size: 10px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }

/* ===== 交易主屏容器（固定高度，下方浮层绝不挤压上方） ===== */
.trade-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== K 线主视觉区 ===== */
.chart-wrap {
  flex: 1;
  min-height: 210px;
  position: relative;
  background: #0a0d12;
  overflow: hidden;
  cursor: crosshair;
}
.chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.range-band {
  position: absolute;
  left: 0;
  right: 60px;
  background: rgba(59, 130, 246, 0.13);
  border-top: 1px solid rgba(59, 130, 246, 0.55);
  border-bottom: 1px solid rgba(168, 85, 247, 0.55);
}
.range-band.cancel-mode {
  background: rgba(246, 70, 93, 0.12);
  border-color: rgba(246, 70, 93, 0.55);
}
.range-band.trailing-mode {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.55);
}
.grid-line {
  position: absolute;
  left: 0;
  right: 60px;
  border-top: 1px dashed rgba(59, 130, 246, 0.42);
}
.price-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
}
.price-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 60px;
  top: 0;
  height: 1.5px;
  background: currentColor;
}
.price-line.dashed::before {
  background: transparent;
  border-top: 1.5px dashed currentColor;
}
.handle-pill {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.handle-pill.dragging { transform: translateY(-50%) scale(1.06); }
.axis-tag {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  text-align: right;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  border-radius: 3px 0 0 3px;
}
.existing-line {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  opacity: 0.72;
}
.existing-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 60px;
  border-top: 1px dotted currentColor;
}
.existing-tag {
  position: absolute;
  left: 8px;
  top: -14px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(19, 24, 34, 0.88);
  border: 1px solid currentColor;
}

/* 极薄持仓条（浮在 K 线底部，显隐不导致 K 线位移） */
.mini-pos {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  height: 36px;
  padding: 0 12px;
  background: rgba(19, 24, 34, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  z-index: 12;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.mini-pos.hidden-under-sheet {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.mini-pos-info { display: flex; align-items: center; gap: 6px; }
.dir-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.dir-chip.long { background: var(--green-soft); color: var(--green); }
.dir-chip.short { background: var(--red-soft); color: var(--red); }
.mini-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.mini-btn:active { transform: scale(0.95); }
.text-btn {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
}
.text-btn:hover { color: #60a5fa; }

/* 仓位与委托页：账户范围下拉 */
.acct-select { position: relative; }
.acct-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 210px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.acct-select-btn:hover { border-color: var(--border-strong); }
.acct-select-btn .acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-width: 262px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 5px;
  z-index: 30;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.62);
}
.acct-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-1);
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.acct-menu-item:hover { background: var(--surface-2); }
.acct-menu-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.acct-menu-item .acct-meta { font-size: 10px; color: var(--text-3); font-weight: 500; flex-shrink: 0; }
.acct-menu-item .acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 底部快捷买/卖/工具箱（固定占位 64px） */
.dock {
  height: 64px;
  padding: 10px 12px;
  background: var(--phone-bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.dock-buy, .dock-sell {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.dock-buy:active, .dock-sell:active, .dock-tool:active, .primary-btn:active, .tool-item:active {
  transform: scale(0.97);
}
.dock-buy { background: var(--green); color: #052014; }
.dock-sell { background: var(--red); color: #fff; }
.dock-sub { font-size: 10px; font-weight: 500; opacity: 0.85; }
.dock-tool {
  width: 64px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-1);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.dock-tool:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* ===== 半屏联动抽屉（绝对定位浮层，展开/收起绝不挤压上方 K 线） ===== */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: rgba(19, 24, 34, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.62);
  transform: translateY(0);
  opacity: 1;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  will-change: transform, opacity;
}
.sheet::before {
  content: "";
  width: 34px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 auto 2px;
  flex-shrink: 0;
}
.sheet.anim-enter {
  transform: translateY(100%);
  opacity: 0.4;
}
.sheet.anim-exit {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 210ms cubic-bezier(0.4, 0, 1, 1), opacity 180ms ease;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.icon-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-close:hover { color: var(--text-1); }

.row { display: flex; align-items: center; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg {
  display: flex;
  width: 100%;
  min-width: 0;
  background: var(--phone-bg);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
/* 仅在横向行内参与均分，避免在竖向 flex 容器（登录页、页面主体）里被拉高 */
.row > .seg { flex: 1; width: auto; }
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.seg-btn.active { background: var(--surface-2); color: var(--text-1); font-weight: 600; }
.seg-btn.long { background: var(--green); color: #052014; font-weight: 700; }
.seg-btn.short { background: var(--red); color: #fff; font-weight: 700; }
.lev-btn {
  border: 1px solid var(--border);
  background: var(--phone-bg);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.field {
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
}
.field.focus-blue { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
.field.focus-green { border-color: var(--green); box-shadow: 0 0 0 2px rgba(14, 203, 129, 0.2); }
.field.focus-red { border-color: var(--red); box-shadow: 0 0 0 2px rgba(246, 70, 93, 0.2); }
.field.focus-purple { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2); }
.field-lbl { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.field-right { display: flex; align-items: center; gap: 5px; }
.field-input {
  width: 92px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}
.step-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pct-bar { display: flex; gap: 6px; }
.pct-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--phone-bg);
  color: var(--text-2);
  font-size: 11px;
  padding: 5px 0;
  border-radius: 6px;
  cursor: pointer;
}
.pct-btn.active { border-color: var(--blue); background: var(--blue-soft); color: var(--text-1); font-weight: 600; }

.primary-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.primary-btn.buy { background: var(--green); color: #052014; }
.primary-btn.sell { background: var(--red); color: #fff; }
.primary-btn.blue { background: var(--blue); color: #fff; }
.primary-btn.amber { background: var(--amber); color: #191103; }
.primary-btn.ghost { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border); }

.est-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  padding: 0 2px;
}

/* ===== 页面滚动容器（仓位与委托 / 我的） ===== */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.equity-card {
  background: linear-gradient(135deg, #172033, #111622);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metrics-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.m-lbl { font-size: 10px; color: var(--text-3); }
.m-val { font-size: 12px; font-weight: 600; margin-top: 2px; }
.card-actions {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.act-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0;
  border-radius: 7px;
  cursor: pointer;
}
.act-btn.danger { color: var(--red); border-color: rgba(246, 70, 93, 0.35); }
.top-bar.select-mode {
  background: var(--blue-soft);
  border-bottom-color: rgba(59, 130, 246, 0.35);
}
.icon-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
}
.icon-select:hover { color: var(--text-1); border-color: var(--border-strong); }
.logout-text {
  margin-top: auto;
  align-self: center;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  padding: 12px 16px;
  cursor: pointer;
}
.logout-text:hover { color: var(--text-2); }
.empty-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ===== 模态层与全屏页（带进出场动画） ===== */
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity 220ms ease;
}
.modal-mask.anim-enter { opacity: 0; }
.modal-mask.anim-exit { opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.modal-box {
  background: var(--surface-1);
  border-top: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  will-change: transform;
}
.modal-mask.anim-enter .modal-box { transform: translateY(100%); }
.modal-mask.anim-exit .modal-box { transform: translateY(100%); transition: transform 200ms cubic-bezier(0.4, 0, 1, 1); }
.modal-box.full {
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  border-top: none;
}
/* 整屏页统一用轻量淡入上浮，不做横向滑入 */
.modal-mask.anim-enter .modal-box.full { opacity: 0; transform: translateY(10px); }
.modal-mask.anim-exit .modal-box.full { opacity: 0; transform: translateY(6px); }
.modal-head {
  padding: 13px 15px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-body {
  padding: 12px 15px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.text-input {
  width: 100%;
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text-1);
  font-size: 13px;
  outline: none;
}
.text-input:focus { border-color: var(--blue); }
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap .icon {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  pointer-events: none;
}
.search-wrap .text-input { padding-left: 34px; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--phone-bg);
  border: 1px solid var(--border);
  cursor: pointer;
}
.list-item:hover { border-color: var(--border-strong); }
.list-item.selected { border-color: var(--blue); background: rgba(59, 130, 246, 0.08); }
.star-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
}
.star-btn.fav { color: var(--amber); }

.subtle-switch {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}
.subtle-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.subtle-btn:hover { color: var(--text-1); border-color: var(--border-strong); }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tool-item {
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-1);
}
.tool-item:hover { border-color: var(--blue); }
.tool-item-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.tool-item-desc { font-size: 10px; color: var(--text-2); line-height: 1.4; }
.tool-icon-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-icon-box.danger { color: var(--red); background: var(--red-soft); }
.tool-icon-box.amber { color: var(--amber); background: var(--amber-soft); }

/* ===== 底部 Tab Bar ===== */
.tab-bar {
  height: 58px;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 6px;
  flex-shrink: 0;
}
.tab-bar.hidden { display: none; }
.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 18px;
  cursor: pointer;
  position: relative;
}
.tab-btn.active { color: var(--text-1); font-weight: 600; }
.tab-badge {
  position: absolute;
  top: 0;
  right: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Toast */
.toast {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(19, 24, 34, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  z-index: 80;
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 登录全屏容器 */
.auth-screen {
  flex: 1;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.auth-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.auth-2fa { display: flex; flex-direction: column; gap: 8px; }
.auth-2fa-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-2);
  background: var(--blue-soft);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 9px;
  padding: 8px 10px;
}
.code-row { display: flex; gap: 8px; }.code-row .text-input { flex: 1; }
.code-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 12px;
  padding: 0 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.ip-box {
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
}

/* ===== 期权专属样式（信息条、行权价快切、T型期权链、追单线停止按钮） ===== */
.opt-info-strip {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 68px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(19, 24, 34, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: var(--text-2);
  pointer-events: none;
}
.opt-info-strip strong { color: var(--text-1); font-weight: 600; }

.strike-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}
.strike-nav-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.strike-nav-btn:hover { color: var(--text-1); border-color: var(--border-strong); }

.chaser-stop-pill {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.chaser-stop-btn {
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  cursor: pointer;
}

/* 手机版 T 型期权链 */
.opt-chain-head {
  display: grid;
  grid-template-columns: 1fr 74px 1fr;
  text-align: center;
  font-size: 10px;
  color: var(--text-3);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.opt-chain-row {
  display: grid;
  grid-template-columns: 1fr 74px 1fr;
  gap: 5px;
  align-items: stretch;
}
.opt-cell {
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  text-align: left;
  color: var(--text-1);
}
.opt-cell.put { text-align: right; }
.opt-cell.active { border-color: var(--blue); background: rgba(59, 130, 246, 0.12); }
.opt-cell:hover { border-color: var(--border-strong); }
.opt-strike-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  background: var(--surface-2);
  border-radius: 8px;
}

/* ===== 会员方案（对齐主站档位 / 计价 / 订单状态） ===== */
.plan-note { font-size: 11px; line-height: 1.55; color: var(--text-2); }
.plan-card .primary-btn { margin-top: 2px; }
.plan-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin: 5px 0 -3px;
}
.plan-compare {
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 11px;
}
.plan-compare-row {
  display: grid;
  grid-template-columns: 1fr 44px 62px;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(35, 43, 58, 0.6);
}
.plan-compare-row:last-child { border-bottom: none; }
.plan-compare-row.head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  padding: 7px 0 5px;
}
.plan-compare-row.head span:nth-child(2),
.plan-compare-row.head span:nth-child(3) { text-align: center; }
.plan-compare-name { color: var(--text-1); }
.plan-compare-flag {
  display: flex;
  justify-content: center;
  color: transparent;
}
.plan-compare-flag.owned { color: var(--green); }
.plan-order {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
}
.plan-order-status { font-size: 11px; font-weight: 600; }
.plan-order-status.CREATED { color: var(--amber); }
.plan-order-status.FILLED { color: var(--green); }
.plan-order-status.CANCELED,
.plan-order-status.REFUNDED { color: var(--text-2); }

/* ===== 数量 / 比例滑条 ===== */
.slider-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}
.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
}
.slider-value { color: var(--text-1); font-weight: 600; }
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 0 1px var(--blue);
}
.slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}
.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--surface-1);
}

/* ===== 复选模式底部操作条 ===== */
.select-actions {
  flex-shrink: 0;
  padding: 10px 14px 14px;
  background: var(--phone-bg);
  border-top: 1px solid var(--border);
}
.select-actions .primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== 下单抽屉：止盈止损单行入口 ===== */
.tpsl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--phone-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
  color: var(--text-1);
}
.tpsl-row:hover { border-color: var(--border-strong); }
.tpsl-row-lbl { font-size: 11px; color: var(--text-2); }
.tpsl-row-val { margin-left: auto; font-size: 13px; font-weight: 600; }
.tpsl-row .icon { color: var(--text-3); }

/* ===== 交易所接入向导 ===== */
.link-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 6px; }
.link-hero-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--surface-2); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.link-links { display: flex; justify-content: center; gap: 16px; }
.link-tabs { display: flex; gap: 6px; padding-bottom: 2px; }
.link-tab {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); background: var(--phone-bg);
  color: var(--text-2); font-size: 12px; padding: 7px 9px;
  border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.link-tab.active { border-color: var(--blue); color: var(--text-1); background: var(--blue-soft); }
.link-badge { font-size: 9px; padding: 1px 4px; border-radius: 4px; background: var(--blue-soft); color: #60a5fa; }
.link-step-title { font-size: 12px; font-weight: 600; color: var(--text-2); }
.link-copy { font-size: 12px; line-height: 1.7; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; }
.link-copy b { color: var(--text-1); }
.link-field { display: flex; flex-direction: column; gap: 6px; }
.link-textarea { min-height: 62px; resize: none; padding: 9px 10px; font-family: inherit; }
.link-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* ===== 执行按钮上方的计算摘要 ===== */
.exec-summary {
  font-size: 11px;
  color: var(--text-2);
  padding: 0 2px;
  text-align: left;
  line-height: 1.4;
}

/* ===== 高级交易分组 ===== */
.tool-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin: 8px 0 -4px;
}
.tool-group-title:first-child { margin-top: 0; }
