/* ═══════════════════════════════════════════════════════════
   AgentNet Mobile Trade Panel (手机端专属单列竖屏金融面板)
   100% 还原手机高保真设计稿: 底部向上滑出 Sheet + 单列卡片流 + 二段式分段器
   ═══════════════════════════════════════════════════════════ */

:root {
  --mtp-bg: #030308;
  --mtp-surface: rgba(18, 14, 36, 0.98);
  --mtp-surface-card: rgba(26, 20, 48, 0.95);
  --mtp-border: rgba(192, 132, 252, 0.18);
  --mtp-border-light: rgba(192, 132, 252, 0.12);
  --mtp-primary: #c084fc;
  --mtp-primary-glow: rgba(192, 132, 252, 0.25);
  --mtp-green: #34d399;
  --mtp-red: #f87171;
  --mtp-text: #ffffff;
  --mtp-text-dim: #cbd5e1;
  --mtp-text-muted: #94a3b8;
  --mtp-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --mtp-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 手机端满屏遮罩 (底部对齐) */
#mobile-trade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 6, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  font-family: var(--mtp-font);
}
#mobile-trade-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* 手机端向上弹出的 Sheet 容器 (占据 92% 视口高度 · 顶部大圆角) */
.mtp-sheet {
  width: 100vw;
  max-width: 100vw;
  height: 92vh;
  max-height: 92vh;
  background: var(--mtp-surface);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--mtp-border);
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* 1. 顶部 Header (大世界金融市场 + 关闭按钮 + 横向分类滑块) */
.mtp-header {
  padding: 14px 16px 10px;
  background: rgba(24, 18, 48, 0.96);
  border-bottom: 1px solid var(--mtp-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mtp-head-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mtp-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.mtp-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--mtp-border);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 标的横向滑动 Tabs */
.mtp-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mtp-cats::-webkit-scrollbar { display: none; }
.mtp-cat-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mtp-text-muted);
  background: rgba(36, 26, 64, 0.7);
  border: 1px solid var(--mtp-border);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .15s;
}
.mtp-cat-btn.active {
  color: #fff;
  background: rgba(168, 85, 247, 0.35);
  border-color: var(--mtp-primary);
  box-shadow: 0 0 10px var(--mtp-primary-glow);
}

/* 2. 手机端单列垂直滚动容器 */
.mtp-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* 3. 核心行情主卡片 (现价 + 四宫格 + 迷你 K 线) */
.mtp-market-card {
  background: var(--mtp-surface-card);
  border: 1px solid var(--mtp-border);
  border-radius: 18px;
  padding: 14px 16px;
  flex-shrink: 0;
}
.mtp-sym-name {
  font-size: 12px;
  color: var(--mtp-text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.mtp-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.mtp-cur-price {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--mtp-mono);
  color: #fff;
}
.mtp-change-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.18);
  color: var(--mtp-green);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.mtp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  font-size: 10px;
  color: var(--mtp-text-muted);
  font-family: var(--mtp-mono);
}

/* 迷你 K 线 Canvas 包装层 */
.mtp-canvas-box {
  width: 100%;
  height: 180px;
  position: relative;
}
#mtp-kline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 4. 二段式分段器 (Segmented Controller) */
.mtp-seg-ctrl {
  display: flex;
  background: rgba(22, 16, 42, 0.95);
  border: 1px solid var(--mtp-border);
  border-radius: 12px;
  padding: 3px;
  flex-shrink: 0;
}
.mtp-seg-btn {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  color: var(--mtp-text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all .15s;
}
.mtp-seg-btn.active {
  background: var(--mtp-primary);
  color: #000;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

/* 5. 视图面板 (心智透视 vs 订单簿) */
.mtp-view-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mtp-view-pane.hidden {
  display: none !important;
}

/* 心智卡片流 */
.mtp-intent-card {
  padding: 12px 14px;
  background: var(--mtp-surface-card);
  border: 1px solid var(--mtp-border);
  border-radius: 14px;
}
.mtp-ic-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mtp-ic-name {
  font-weight: 800;
  color: #fff;
  font-size: 14px;
}
.mtp-ic-act {
  font-weight: 800;
  font-size: 12px;
  margin-right: 6px;
}
.mtp-ic-act.buy { color: var(--mtp-green); }
.mtp-ic-act.sell { color: var(--mtp-red); }
.mtp-ic-tag {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--mtp-mono);
  background: rgba(168, 85, 247, 0.18);
  color: var(--mtp-primary);
  border: 1px solid rgba(192, 132, 252, 0.35);
}
.mtp-ic-reason {
  font-size: 13px;
  color: var(--mtp-text-dim);
  line-height: 1.55;
  margin-bottom: 6px;
}
.mtp-ic-meta {
  font-size: 10px;
  color: var(--mtp-text-muted);
  font-family: var(--mtp-mono);
  display: flex;
  justify-content: space-between;
}

/* 订单簿流 */
.mtp-ob-wrap {
  background: var(--mtp-surface-card);
  border: 1px solid var(--mtp-border);
  border-radius: 14px;
  padding: 12px 14px;
}
.mtp-ob-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mtp-text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--mtp-border);
  font-family: var(--mtp-mono);
}
.mtp-ob-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0;
  font-family: var(--mtp-mono);
  font-size: 12px;
}
.mtp-ob-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 4px;
  border-radius: 4px;
}
.mtp-ob-row .bg-bar {
  position: absolute; right: 0; top: 0; bottom: 0;
  border-radius: 3px; z-index: 0; pointer-events: none;
}
.mtp-ob-row.ask .bg-bar { background: rgba(248, 113, 113, 0.16); }
.mtp-ob-row.bid .bg-bar { background: rgba(52, 211, 153, 0.16); }
.mtp-ob-row span { position: relative; z-index: 1; }
.mtp-ob-row.ask .p { color: var(--mtp-red); }
.mtp-ob-row.bid .p { color: var(--mtp-green); }

.mtp-mid-price {
  margin: 6px 0;
  padding: 8px 10px;
  background: rgba(22, 16, 42, 0.8);
  border: 1px solid var(--mtp-border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mtp-mid-price .val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--mtp-mono);
  color: var(--mtp-green);
}
