/* 掘金工作台 · 手机版样式（只做覆盖，不改桌面版 client.js 的结构） */
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #070b14; color: #dbe4f5;
  font: 14px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
* { -webkit-tap-highlight-color: transparent; }

/* ---------- 启动屏 ---------- */
#boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #241033, #070b14 70%);
}
#boot .boot-logo { font-size: 64px; line-height: 1; filter: drop-shadow(0 0 18px rgba(255,213,79,.45)); }
#boot .boot-name { margin-top: 14px; font-size: 20px; font-weight: 800; color: #ffd54f; letter-spacing: 2px; }
#boot .boot-tip { margin-top: 10px; font-size: 13px; color: #93a4c4; }

/* ---------- 入口页 ---------- */
#launcher {
  position: fixed; inset: 0; z-index: 9000; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 30%, #1a1030, #070b14 72%);
  padding: 24px; text-align: center;
}
#launcher .launch-logo { font-size: 56px; }
#launcher .launch-title { font-size: 24px; font-weight: 800; color: #ffd54f; letter-spacing: 2px; }
#launcher .launch-sub { font-size: 13px; color: #9fb2d4; }
#launcher #btn-open {
  margin-top: 18px; padding: 14px 44px; font-size: 16px; font-weight: 700;
  border: 0; border-radius: 999px; color: #2b033f;
  background: linear-gradient(180deg, #ffd54f, #f0b429);
  box-shadow: 0 10px 26px rgba(255,213,79,.28);
}
#launcher .launch-note { margin-top: 14px; font-size: 12px; color: #6b7c9c; }

/* ---------- 面板：手机全屏 ---------- */
#biga-panel.mobile,
#biga-panel {
  position: fixed !important;
  left: 0 !important; top: 0 !important;
  width: 100vw !important; height: 100vh !important;
  max-width: 100vw !important; max-height: 100vh !important;
  min-width: 0 !important; min-height: 0 !important;
  border: 0 !important; border-radius: 0 !important;
  box-shadow: none !important;
  padding-bottom: env(safe-area-inset-bottom);
}
#biga-panel .hd {
  padding: 10px 10px calc(10px) 12px !important;
  padding-top: calc(10px + env(safe-area-inset-top)) !important;
  gap: 6px !important; flex-wrap: nowrap !important; overflow-x: auto;
  cursor: default !important;
}
#biga-panel .hd .ttl { font-size: 15px !important; margin-right: 4px !important; }
#biga-panel .tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
#biga-panel .tabs::-webkit-scrollbar { display: none; }
#biga-panel .tb {
  padding: 7px 10px !important; font-size: 12.5px !important; white-space: nowrap;
  border-radius: 8px; flex: 0 0 auto;
}
/* 手机上隐藏窗口控制按钮（最大/最小/弹出/关闭） */
#biga-panel .hd .wbtn, #biga-panel .hd button[text="X"] { display: none !important; }
#biga-panel .hd .wbtn { display: none !important; }
#biga-panel .grip { display: none !important; }

/* 工具条：允许横向滚动，点按区域加大 */
#biga-panel .bar {
  padding: 8px 10px !important; gap: 6px !important;
  overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none;
}
#biga-panel .bar::-webkit-scrollbar { display: none; }
#biga-panel .bar input {
  min-width: 150px !important; flex: 1 1 150px; font-size: 13px !important; padding: 8px 10px !important;
}
#biga-panel .bar button, #biga-panel .bar select {
  padding: 8px 10px !important; font-size: 12.5px !important; white-space: nowrap;
}
#biga-panel .chip { padding: 6px 10px !important; font-size: 12.5px !important; }

/* 汇总行 */
#biga-panel .sum { font-size: 12px !important; line-height: 1.55; padding: 6px 10px !important; }

/* 表格：字号与行高适合手指 */
#biga-panel .tw { -webkit-overflow-scrolling: touch; }
#biga-panel table { font-size: 12.5px !important; }
#biga-panel th, #biga-panel td { padding: 8px 8px !important; }
#biga-panel th { position: sticky; top: 0; z-index: 2; }

/* 规则面板：手机上给足高度并可滚 */
#biga-panel .rules { max-height: 52vh !important; }

/* 帮助卡：手机上几乎满屏 */
#biga-panel .qhcard {
  width: 94vw !important; max-height: 86vh !important;
  font-size: 13.5px !important; padding: 14px 14px 18px !important;
}
#biga-panel .qhcard .x { font-size: 20px; padding: 4px 8px; }

/* 自选库弹窗 */
.pool-pop .pool-box { width: 92vw !important; max-height: 80vh !important; }
.pool-pop .pool-item { padding: 10px 8px !important; }

/* 个股图：手机全屏 + 触屏友好 */
#biga-chart-mask { padding: 0 !important; align-items: stretch !important; }
#biga-chart {
  width: 100vw !important; height: 100vh !important; max-width: 100vw !important;
  border-radius: 0 !important; border: 0 !important;
}
#biga-chart .ch {
  padding: 8px !important; gap: 6px !important;
  padding-top: calc(8px + env(safe-area-inset-top)) !important;
  overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none;
}
#biga-chart .ch::-webkit-scrollbar { display: none; }
#biga-chart .ch b { font-size: 13px !important; }
#biga-chart .ctab { padding: 7px 9px !important; font-size: 12.5px !important; white-space: nowrap; }
#biga-chart .biga-xg { top: calc(6px + env(safe-area-inset-top)) !important; right: 8px !important; }
#biga-chart .biga-xg button { padding: 6px 9px !important; }
/* 主图/副图工具行 */
#biga-chart .flt, #biga-chart .bar button { padding: 6px 9px !important; font-size: 12px !important; }
#biga-chart .indbar, #biga-chart .cfg4 {
  overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none;
  padding: 6px 8px !important;
}
#biga-chart .indbar::-webkit-scrollbar, #biga-chart .cfg4::-webkit-scrollbar { display: none; }
/* 追踪模式的价格标签在手机上略小 */
#biga-chart .zjptag { font-size: 11px !important; }

/* 悬浮球：手机上一个不碍事的角标（面板默认全屏打开） */
#biga-fab {
  right: 10px !important; bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  width: 44px !important; height: 44px !important; opacity: .92;
}


/* ================= 个股图工具条（手机重排） ================= */
/* 真实类名：#biga-chart .cind（主图/副图行）、.r4cfg（四灯配置行） */
#biga-chart .cind,
#biga-chart .r4cfg {
  display: flex; flex-wrap: wrap !important;
  align-items: center; gap: 6px 8px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
}
#biga-chart .cind .lb { font-size: 11.5px !important; color: #8fa3c4; }
#biga-chart .cind .fltbox { display: flex; gap: 6px; flex-wrap: nowrap; }
#biga-chart .cind .sp { flex: 1 1 0; min-width: 0; }
#biga-chart .cind button, #biga-chart .r4cfg button {
  padding: 7px 10px !important; font-size: 12.5px !important;
  border-radius: 8px; white-space: nowrap;
}
#biga-chart .cind .flt.on, #biga-chart .cind .flt {
  padding: 7px 10px !important; font-size: 12.5px !important;
}
#biga-chart .cind .subbar { display: flex; gap: 6px; flex-wrap: wrap; }
/* 顶栏（标题+周期+指数）允许换行，不要横向滚成一条 */
#biga-chart .ch {
  display: flex; flex-wrap: wrap !important; gap: 6px 8px !important;
  padding: 8px 10px !important;
  padding-top: calc(8px + env(safe-area-inset-top)) !important;
  overflow: visible !important;
}
#biga-chart .ch .idxline { font-size: 11px !important; opacity: .85; }
#biga-chart .ch .sp { display: none !important; }
/* 右上角按钮避开顶栏文字 */
#biga-chart .biga-xg { position: absolute !important; top: calc(6px + env(safe-area-inset-top)) !important; right: 8px !important; }
#biga-chart .biga-xg button { padding: 6px 9px !important; font-size: 13px !important; }
/* 底部说明文字 */
#biga-chart .cf { font-size: 11px !important; line-height: 1.5; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)) !important; }
/* 画布区在手机上占满剩余高度 */
#biga-chart { display: flex; flex-direction: column; }
#biga-chart canvas { flex: 0 0 auto; }


/* ===== 工具条进一步压缩（一屏看得到图） ===== */
#biga-chart .ch { padding: 6px 8px !important; gap: 4px 6px !important; }
#biga-chart .ch b { font-size: 12.5px !important; }
#biga-chart .ch .ctab { padding: 5px 8px !important; font-size: 12px !important; }
#biga-chart .ch .idxline { font-size: 10px !important; opacity: .8; }
#biga-chart .cind { padding: 5px 8px !important; gap: 4px 5px !important; }
#biga-chart .cind .lb { font-size: 10.5px !important; }
#biga-chart .cind button, #biga-chart .cind .flt {
  padding: 5px 8px !important; font-size: 11.5px !important; border-radius: 7px;
}
#biga-chart .r4cfg { padding: 5px 8px !important; gap: 4px 6px !important; font-size: 11.5px !important; }
#biga-chart .r4cfg button { padding: 4px 7px !important; font-size: 11.5px !important; }
#biga-chart .biga-xg button { padding: 5px 8px !important; font-size: 12.5px !important; }
#biga-chart .cf { font-size: 10.5px !important; padding: 4px 8px calc(6px + env(safe-area-inset-bottom)) !important; }


/* ===== 顶栏手机化：标题不换行、按钮更小、四个页签一屏放下 ===== */
#biga-panel .hd {
  display: flex !important; flex-wrap: nowrap !important;
  align-items: center; gap: 5px !important;
  padding: 8px 8px !important;
  padding-top: calc(8px + env(safe-area-inset-top)) !important;
  overflow: visible !important;
}
#biga-panel .hd .ttl {
  font-size: 13px !important; font-weight: 800 !important;
  margin-right: 2px !important; white-space: nowrap !important;
  flex: 0 0 auto; letter-spacing: 0 !important;
}
#biga-panel .hd .tabs {
  display: flex; gap: 4px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#biga-panel .hd .tb {
  padding: 6px 8px !important; font-size: 12px !important;
  border-radius: 7px; white-space: nowrap; flex: 0 0 auto;
}
#biga-panel .hd button.tb { padding: 6px 7px !important; font-size: 11.5px !important; }
#biga-panel .hd button:not(.tb) { padding: 6px 8px !important; font-size: 11.5px !important; flex: 0 0 auto; }
/* 底部状态栏：单行省略，别撑高 */
#biga-panel .foot {
  font-size: 10.5px !important; padding: 4px 8px calc(6px + env(safe-area-inset-bottom)) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 汇总行允许换行但紧凑 */
#biga-panel .sum { padding: 5px 8px !important; font-size: 11.5px !important; }


/* ===== 顶栏终极压缩：藏标题/藏关闭、使用说明变图标，四个页签一屏放下 ===== */
#biga-panel .hd .ttl { display: none !important; }
#biga-panel .hd > button:not(.tb) { display: none !important; }   /* 关闭：全屏面板不需要 */
#biga-panel .hd button.tb {
  font-size: 0 !important; padding: 6px 9px !important; line-height: 1 !important;
  flex: 0 0 auto;
}
#biga-panel .hd button.tb::before { content: "📖"; font-size: 15px; }
#biga-panel .hd .tabs { gap: 3px; }
#biga-panel .hd .tb { padding: 6px 7px !important; font-size: 11.5px !important; }


/* ================= 触屏手势支持 ================= */
/* 图表画布自己处理手势（单指平移 / 双指缩放），禁止浏览器默认滚动与缩放 */
#biga-chart canvas { touch-action: none !important; -webkit-user-select: none; user-select: none; }
/* 列表/帮助卡/规则面板：允许手指上下滑动 */
#biga-panel .tw,
#biga-panel .rules,
#biga-panel .qhcard,
.pool-pop .pool-box,
#biga-panel .bar,
#biga-panel .tabs {
  touch-action: pan-y pan-x;
  -webkit-overflow-scrolling: touch;
}
/* 面板整体：允许纵向滚动（内容超屏时可上下拖） */
#biga-panel { overflow-y: auto !important; overflow-x: hidden !important; }
/* 顶部工具条/页签保持横向滚动优先 */
#biga-panel .hd, #biga-panel .bar { touch-action: pan-x pan-y; }
/* 个股图容器：整体不可滚，只有画布手势 */
#biga-chart { overflow-y: auto !important; touch-action: pan-y; }
#biga-chart .ch, #biga-chart .cind, #biga-chart .r4cfg { touch-action: pan-x pan-y; }
/* 表格行点击反馈（手指按下有反馈，避免误以为没响应） */
#biga-panel tbody tr:active td { background: #17233c !important; }
