/* =====================================================================
   走势图页 · 顶栏样式（自用版）
   类名统一 tgpt- 前缀，避免与原站 chart.css 冲突
   结构：6 行堆叠（标题 / 选位 / 除数 / 预测 / 分析工具 / 和值过滤）
   ===================================================================== */
.tgpt-top{
  display:flex;align-items:flex-start;gap:14px;flex-wrap:wrap;
  padding:6px 10px;margin:0 0 6px;background:#fff;
  border:1px solid #e3e9f2;border-radius:6px;font-size:12px;color:#333;
}
.tgpt-left{flex:1 1 0;display:block;min-width:0;align-self:flex-start}
.tgpt-right{
  flex:none;display:flex;flex-direction:column;gap:3px;
  padding:4px 8px 6px;background:#fbfcfe;
  border:1px solid #eef2f7;border-radius:6px;
}
.tgpt-right .tgpt-lbl{min-width:0;margin-bottom:1px}
.tgpt-row{
  display:flex;align-items:center;gap:6px;
  min-height:26px;padding:1px 0;gap:6px;
}

.tgpt-brand{font-weight:700;color:#e33;font-size:13px;letter-spacing:.5px}
.tgpt-title{font-weight:700;color:#333;font-size:12.5px;white-space:nowrap}
.tgpt-iss{
  color:#c0392b;font-weight:700;font-size:11px;white-space:nowrap;
  padding:1px 6px;border:1px solid #f3d6d2;border-radius:10px;background:#fff7f6;
}
.tgpt-sep{width:1px;height:16px;background:#e0e6ef;margin:0 4px}
.tgpt-lbl{color:#6b7684;white-space:nowrap;min-width:38px}

/* 分段按钮组 */
.tgpt-grp{display:inline-flex;border:1px solid #cfd8e3;border-radius:4px;overflow:hidden;background:#fff}
.tgpt-grp b{
  padding:0 11px;height:24px;line-height:24px;cursor:pointer;user-select:none;
  border-right:1px solid #e3e9f2;color:#5b6472;font-weight:400;white-space:nowrap;
}
.tgpt-grp b:last-child{border-right:none}
.tgpt-grp b:hover{background:#f2f7ff;color:#1678ff}
.tgpt-grp b.on{background:#1678ff;color:#fff;font-weight:700}
.tgpt-grp b.on:hover{background:#0a68ea;color:#fff}

/* =====================================================================
   和值过滤：5 列网格（固定列宽，跨行对齐）
   列1=不过滤  列2~4=除3三键  列5=除4余3
   除4组的余0/1/2 从列2 起排 → 除4余0 恒在 除3余0 正下方
   ===================================================================== */
.tgpt-grid{
  display:grid;
  grid-template-columns:repeat(5, 52px);
  gap:3px 6px;
  align-items:center;
}
.tgpt-grid b{
  height:22px;line-height:22px;text-align:center;cursor:pointer;user-select:none;
  border:1px solid #d5dde8;border-radius:11px;background:#fff;color:#5b6472;
  font-weight:400;white-space:nowrap;font-size:11.5px;
}
.tgpt-grid b:hover{border-color:#8fb8f0;color:#1678ff}
.tgpt-grid b.on{background:#1678ff;border-color:#1678ff;color:#fff;font-weight:700}
.tgpt-grid b.g1{grid-column:1}
.tgpt-grid b.g2{grid-column:2}
.tgpt-grid b.g3{grid-column:3}
.tgpt-grid b.g4{grid-column:4}
.tgpt-grid b.g5{grid-column:5}

.tgpt-left .tgpt-row:nth-child(n+4){padding-left:44px}

/* 入口按钮 */
.tgpt-btn{
  display:inline-block;padding:0 12px;height:24px;line-height:24px;
  border:1px solid #1678ff;border-radius:4px;background:#1678ff;color:#fff !important;
  text-decoration:none;white-space:nowrap;font-weight:600;
}
.tgpt-btn:hover{background:#0a68ea;border-color:#0a68ea}

.tgpt-tip{color:#8d97a6;font-size:11px;margin-left:auto;white-space:nowrap}

/* 除3/除4 时每位只剩 3/4 列，给一个最小宽度避免挤成一条线 */
.thbg1 th,.tfoot.tflh td{min-width:26px}

/* 彩种选择（预览版） */
.tgpt-sel b{padding:0 9px}
.tgpt-soon{color:#a8b3c2 !important;border-left:1px dashed #e3e9f2}
.tgpt-btn-lite{
  background:#fff !important;color:#1678ff !important;border-color:#8fb8f0 !important;
  font-weight:600;
}
.tgpt-btn-lite:hover{background:#eef5ff !important}

/* 左右两块之间的竖分隔线 */
.tgpt-right{
  border-left:1px solid #e6ebf3 !important;
  border-top:none;border-right:none;border-bottom:none;border-radius:0;
  background:transparent;padding-left:16px !important;
}

/* 彩种两行布局（预览） */
.tgpt-lots{display:inline-flex;flex-direction:column;gap:3px}
.tgpt-lot-lt b{padding:0 9px}
.tgpt-poscol{display:inline-flex;flex-direction:column;gap:3px}
.tgpt-rowline{display:inline-flex;align-items:center;gap:6px}
.tgpt-rowline .tgpt-btn{height:24px}

/* ===== 四大模块布局：等宽均分，标题贴顶同水平，内容居中 ===== */
.tgpt-mods{display:flex;flex:1 1 auto;align-items:stretch}
.tgpt-mod{display:flex;flex-direction:column;padding:5px 12px;flex:1 1 0;min-width:0;box-sizing:border-box}
.tgpt-mod:first-of-type{padding-left:0}
.tgpt-mod:nth-of-type(1){background:#fdf3e7;border-radius:8px}   /* ① 浅橙 */
.tgpt-mod:nth-of-type(2){background:#eaf3ff;border-radius:8px}   /* ② 浅蓝 */
.tgpt-mod:nth-of-type(3){background:#fdf3e7;border-radius:8px}   /* ③ 浅橙 */
.tgpt-mod:nth-of-type(4){background:#eaf3ff;border-radius:8px}   /* ④ 浅蓝 */
.tgpt-vline{width:1px;background:#e6ebf3;flex:none;align-self:stretch;margin:2px 0}
.tgpt-head{width:100%;border-bottom:1px solid #eef2f7;margin-bottom:6px;padding-bottom:5px}
.tgpt-mods{width:100%}
/* 模块标题：固定高度贴顶 → 三标题同一水平 */
.tgpt-mtit{
  font-weight:700;color:#333;font-size:12.5px;flex:none;
  height:20px;line-height:20px;margin:0 0 3px;
}
/* 标题以下内容区：垂直居中 */
.tgpt-body{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center}
/* 子模块标题 */
.tgpt-sub{color:#6b7684;font-size:11.5px;white-space:nowrap;display:inline}
.tgpt-sub2{font-weight:600;color:#8a9410}
/* 模块2 内：无标签的行缩进到按钮列（标签列约38px+6px间距） */
.tgpt-ind{margin-left:44px}
.tgpt-lbl{min-width:38px}
/* 彩种两行按钮组直接顶格 */
.tgpt-mod .tgpt-row{min-height:27px}

/* ===== 数据管理条（从右上角悬浮条挪入模块①） ===== */
#tgbar{
  position:static !important;box-shadow:none !important;border:none !important;
  background:transparent !important;padding:0 !important;border-radius:0 !important;
  display:inline-flex;gap:6px;align-items:center;white-space:nowrap;
}
#tgbar button{
  padding:0 10px;height:22px;font-size:12px;flex:none;white-space:nowrap;
  display:inline-flex;align-items:center;justify-content:center;
}
#tgbar button > *{flex:none}
#tgbar .tip{color:#8d97a6;font-size:11px;white-space:nowrap}
#tgbar button.tgexp{border-color:#2f9e44;color:#2f9e44}
#tgbar button.tgexp:hover{background:#2f9e44;color:#fff}

/* ===== 顶栏 + 合并功能行 锁定（fixed 容器由脚本生成） ===== */
#hzLockBar{
  position:fixed;top:0;z-index:900;background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.12);padding:6px 8px 4px;
  box-sizing:border-box;
}

/* ===== 手机端：取消锁定（随页面滚动），顶栏与表格紧凑化，走势图占满屏幕 =====
   电脑端（>768px）保持 fixed 锁定不变 */
@media (max-width: 768px){
  /* 脚本会写入内联 left/width，用 !important 覆盖为普通流布局 */
  #hzLockBar{
    position:static !important;
    left:auto !important;
    width:auto !important;
    box-shadow:none;
    padding:2px 2px 0;
  }
  .tgpt-top{padding:4px 4px;gap:8px;font-size:11px}
  /* 手机端四模块 2×2 排布 */
  .tgpt-mods{flex-wrap:wrap;gap:4px}
  .tgpt-mod{flex:1 1 46%;min-width:46%;padding:4px 8px}
  .tgpt-vline{display:none}
  .tgpt-mod .tgpt-row{min-height:23px}
  .tgpt-grid{grid-template-columns:repeat(5,44px);gap:2px 5px}
  .tgpt-grid b{height:20px;line-height:20px;font-size:11px}
  .tgpt-grp b{padding:0 8px;height:22px;line-height:22px}
  .tgpt-btn{padding:0 9px;height:22px;line-height:22px}
  #tgbar button{padding:0 8px;height:20px;font-size:11px}
  /* 表格紧凑：同屏多看几列 */
  .table-auto table td,.table-auto table th{font-size:1.1rem !important}
  .table-auto td{padding:.1rem .1rem !important}
  .table-auto th{padding:.1rem !important}
}

/* ===== 模块④：AI解读 ===== */
.tgpt-aisel{
  height:24px;border:1px solid #cfd8e3;border-radius:4px;background:#fff;
  color:#333;font-size:12px;padding:0 4px;max-width:150px;
}

/* ===== AI 抽屉（底部弹出，电脑端居中卡） ===== */
#tgAiMask{position:fixed;inset:0;z-index:9500;background:rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:opacity .2s}
#tgAiMask.on{opacity:1;pointer-events:auto}
#tgAiDrawer{
  position:fixed;left:50%;bottom:0;z-index:9501;width:100%;max-width:640px;
  transform:translate(-50%,100%);transition:transform .25s ease-out;
  background:#fff;border-radius:14px 14px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,.18);
  display:flex;flex-direction:column;max-height:78vh;box-sizing:border-box;
}
#tgAiDrawer.on{transform:translate(-50%,0)}
@media (min-width:769px){
  #tgAiDrawer{bottom:auto;top:50%;transform:translate(-50%,-46%);border-radius:10px;max-height:76vh}
  #tgAiDrawer.on{transform:translate(-50%,-50%)}
}
#tgAiHead{
  display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid #eef2f7;
  font-size:14px;flex:none;
}
#tgAiHead b{font-size:14.5px}
#tgAiProv{color:#1678ff;font-size:12px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tgAiClose{color:#8d97a6;text-decoration:none;font-size:16px;padding:2px 6px}
#tgAiBody{flex:1 1 auto;overflow-y:auto;padding:12px 16px;font-size:13.5px;line-height:1.75;color:#333}
#tgAiBody p{margin:0 0 8px}
#tgAiBody p.ai-li{color:#1a1a1a;font-weight:400;padding-left:2px}
#tgAiBody .ai-err{color:#c0392b}
#tgAiBody .ai-loading{color:#6b7684;text-align:center;padding:28px 0}
.ai-dot{
  display:inline-block;width:8px;height:8px;border-radius:50%;background:#1678ff;
  margin-right:8px;animation:aiBlink 1s infinite;
}
@keyframes aiBlink{0%,100%{opacity:.25}50%{opacity:1}}
#tgAiFoot{
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 14px;border-top:1px solid #eef2f7;
}
