/* r19b: paired with ia-shell remount keep-alive */
/* 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));
  min-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 !important;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
  position: relative;
  order: 99; /* keep at flex end if siblings reorder */
}
#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; }

/* 20261105g touch targets >=44 + modify sheet padding (mobile-trading-app-ui) */
#ia-me-btn { width: 44px !important; height: 44px !important; min-width: 44px; min-height: 44px; }
.ind-scroll button { min-width: 44px !important; min-height: 44px; }
.card-row .btn.sm, #ia-p-refresh, #ia-h-refresh { min-width: 44px !important; min-height: 44px !important; }
.screen > .split { position: relative; }
.screen > .split::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; }
.ia-sheet-body.ia-mod-body, #ia-sheet-body.ia-mod-body { padding-left: 16px; padding-right: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }

/* 20261105h 一键清仓确认 sheet：红色确认沉底 ≥48px */
#ia-sheet-body.ia-closeall .ia-ca-ok { display:block; width:100%; min-height:48px; margin:16px 0 4px; border:0; border-radius:10px; background:#f6465d; color:#fff; font-size:16px; font-weight:700; }
#ia-sheet-body.ia-closeall .ia-ca-ok:active { background:#d93a4f; }
#ia-sheet-body.ia-closeall .detail .line { display:flex; justify-content:space-between; gap:12px; padding:6px 0; }
/* Round 6：等待新品种报价时禁用下单按钮 */
button.ia-wait { opacity: .38 !important; filter: grayscale(1); pointer-events: auto; }
.ia-qrow .hl .up { color: #0ecb81; } .ia-qrow .hl .dn { color: #f6465d; }

/* R12 计算风险 sheet */
.ind-edit-panel { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; max-height: 82vh; overflow-y: auto; scrollbar-width: none; }
.ind-edit-panel::-webkit-scrollbar { display: none; }
.ind-edit-panel > .btn { min-height: 44px; width: 100%; }
.hj-risk { color: var(--ia-text, #eaecef); font-variant-numeric: tabular-nums; }
.hj-risk .hr-head { font-size: 17px; font-weight: 700; text-align: center; margin: 4px 0 12px; }
.hj-risk .hr-card { background: var(--ia-bg, #0b0e11); border: 1px solid var(--ia-line, #1e2329); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.hj-risk .hr-card h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.hj-risk .up h4, .hj-risk .up .hr-row b { color: var(--ia-up, #0ecb81); }
.hj-risk .dn h4, .hj-risk .dn .hr-row b { color: var(--ia-dn, #f6465d); }
.hj-risk .hr-row { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 14px; border-bottom: 1px solid var(--ia-line, #1e2329); }
.hj-risk .hr-row span { color: var(--ia-muted, #848e9c); }
.hj-risk .hr-row b { font-weight: 600; }
.hj-risk .hr-row.zero { opacity: .45; }
.hj-risk .hr-total { border-bottom: 0; min-height: 40px; }
.hj-risk .hr-total span { color: var(--ia-text, #eaecef); font-weight: 700; }
.hj-risk .hr-total b { font-size: 17px; font-weight: 800; }
.hj-risk .hr-empty { text-align: center; color: var(--ia-muted, #848e9c); font-size: 13px; margin: 0 0 10px; }
.hj-risk .hr-state { text-align: center; color: var(--ia-muted, #848e9c); padding: 24px 8px; font-size: 14px; line-height: 1.6; }
.hj-risk .hr-err { color: var(--ia-dn, #f6465d); }
.hj-risk .hr-spin { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--ia-line, #1e2329); border-top-color: var(--ia-yellow, #f0b90b); border-radius: 50%; animation: hrspin .8s linear infinite; }
@keyframes hrspin { to { transform: rotate(360deg); } }
