/* MT4/MT5-like mobile IA shell — additive overlay; Huobi www untouched */
:root {
  --ia-bg: #0b0e11;
  --ia-panel: #12161c;
  --ia-line: #1e2329;
  --ia-text: #eaecef;
  --ia-muted: #848e9c;
  --ia-blue: #3b82f6;
  --ia-bid: #3b82f6;
  --ia-ask: #f6465d;
  --ia-up: #0ecb81;
  --ia-dn: #f6465d;
  --ia-yellow: #f0b90b;
}

/* hide Vue native tabbar; our #ia-tabbar replaces it */
.phone > nav.tabs,
.phone .tabs.vue-native,
#app .phone > .tabs {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

#ia-tabbar {
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--ia-line);
  background: var(--ia-panel);
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
  position: relative;
}
#ia-tabbar button {
  border: 0;
  background: transparent;
  color: var(--ia-muted);
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
#ia-tabbar button.on { color: var(--ia-blue); }
#ia-tabbar button svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* fullscreen pages cover chart+ops; sit above screen-slot, below sheets */
#ia-quotes,
#ia-positions,
#ia-history,
#ia-me-overlay {
  position: absolute;
  inset: 0 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0;
  z-index: 25;
  background: var(--ia-bg);
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#ia-quotes.on,
#ia-positions.on,
#ia-history.on,
#ia-me-overlay.on { display: flex; }

.ia-hd {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--ia-line);
  background: var(--ia-panel);
}
.ia-hd .menu {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--ia-text);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.ia-hd .titles { flex: 1; min-width: 0; }
.ia-hd .titles .t1 { font-size: 13px; color: var(--ia-muted); line-height: 1.1; }
.ia-hd .titles .t2 { font-size: 16px; font-weight: 700; color: var(--ia-text); }
.ia-hd .tools { display: flex; gap: 2px; }
.ia-hd .tools button {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--ia-muted);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}

.ia-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ia-scroll::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* Quotes / MarketWatch rows — MT5 crop */
.ia-qrow {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid #161b22;
  min-height: 72px;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.ia-qrow:active { background: #151a22; }
.ia-qrow .sym { font-size: 15px; font-weight: 700; color: var(--ia-text); }
.ia-qrow .meta { font-size: 11px; color: var(--ia-muted); margin-top: 2px; line-height: 1.35; }
.ia-qrow .bid, .ia-qrow .ask {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}
.ia-qrow .bid { color: var(--ia-bid); }
.ia-qrow .ask { color: var(--ia-ask); }
.ia-qrow .bid.up, .ia-qrow .ask.up { color: var(--ia-up); }
.ia-qrow .bid.dn, .ia-qrow .ask.dn { color: var(--ia-dn); }
.ia-qrow .hl {
  grid-column: 2 / 4;
  text-align: right;
  font-size: 10px;
  color: var(--ia-muted);
  margin-top: -2px;
}
.ia-qrow .pip { font-size: 11px; vertical-align: super; }

/* Positions account summary */
.ia-acct {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--ia-line);
  background: #0f1318;
  flex-shrink: 0;
}
.ia-acct .pnl {
  font-size: 22px;
  font-weight: 800;
  color: var(--ia-blue);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.ia-acct .pnl.dn { color: var(--ia-dn); }
.ia-acct .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ia-text);
}
.ia-acct .row .k { color: var(--ia-muted); }
.ia-acct .row .dots {
  flex: 1;
  border-bottom: 1px dotted #3a4250;
  margin: 0 8px 4px;
  min-width: 12px;
}
.ia-sec {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ia-muted);
  background: #10141a;
  border-bottom: 1px solid var(--ia-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.ia-prow {
  padding: 12px 14px;
  border-bottom: 1px solid #161b22;
  min-height: 56px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.ia-prow:active, .ia-prow.hold { background: #151a22; }
.ia-prow .r1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ia-prow .name { font-size: 14px; font-weight: 700; }
.ia-prow .profit { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ia-prow .profit.up { color: var(--ia-blue); }
.ia-prow .profit.dn { color: var(--ia-dn); }
.ia-prow .r2 { margin-top: 4px; font-size: 11px; color: var(--ia-muted); }

/* History empty */
.ia-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ia-muted);
  padding: 24px;
  text-align: center;
}
.ia-empty .ico {
  width: 88px; height: 72px;
  border: 2px solid #3a4250;
  border-radius: 8px;
  position: relative;
  opacity: .55;
}
.ia-empty .ico:before {
  content: '';
  position: absolute;
  left: 10px; right: 10px; top: -8px;
  height: 14px;
  border: 2px solid #3a4250;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.ia-empty .txt { font-size: 15px; color: #c9d1d9; font-weight: 600; }

.ia-hrow {
  padding: 12px 14px;
  border-bottom: 1px solid #161b22;
  min-height: 56px;
}
.ia-hrow .r1 { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; }
.ia-hrow .r2 { margin-top: 4px; font-size: 11px; color: var(--ia-muted); }

/* Sheets */
.ia-sheet-mask {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: flex-end;
}
.ia-sheet-mask.on { display: flex; }
.ia-sheet {
  width: 100%;
  background: #12161c;
  border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  max-height: 78%;
  overflow: auto;
  scrollbar-width: none;
}
.ia-sheet::-webkit-scrollbar { display: none; }
.ia-sheet .grab {
  width: 36px; height: 4px; border-radius: 2px; background: #3a4250; margin: 4px auto 10px;
}
.ia-sheet .detail {
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--ia-line);
  margin-bottom: 4px;
}
.ia-sheet .detail .ttl { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ia-sheet .detail .line {
  display: flex; justify-content: space-between; font-size: 12px; line-height: 1.7; color: var(--ia-muted);
}
.ia-sheet .detail .line b { color: var(--ia-text); font-weight: 600; }
.ia-sheet .act {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid #161b22;
  background: transparent;
  color: var(--ia-text);
  text-align: left;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
}
.ia-sheet .act:active { background: #1a2030; }
.ia-sheet .act.danger { color: #f87171; }
.ia-sheet .act.cancel { color: var(--ia-muted); text-align: center; border-bottom: 0; margin-top: 6px; }

.ia-toast {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  pointer-events: none;
  background: #1a1408;
  border: 1px solid #d4a017;
  color: #f0b90b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  display: none;
}
.ia-toast.on { display: block; }

/* header 我的 entry */
#ia-me-btn {
  position: absolute;
  top: calc(4px + env(safe-area-inset-top, 0px));
  right: 8px;
  z-index: 28;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #2a323c;
  background: #1a1f27;
  color: var(--ia-yellow);
  font-size: 12px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}
.phone.ia-ready #ia-me-btn { display: flex; }

/* when fullscreen tab active, hide fab to reduce clutter */
.phone.ia-tab-quotes .fab,
.phone.ia-tab-positions .fab,
.phone.ia-tab-history .fab { display: none !important; }

/* ensure phone is positioning context */
.phone { position: relative; }
