/* [VISITS-DIST-20261122] 访问记录·右侧三卡片（平台/浏览器/iOS版本）布局收敛
   问题：iOS 版本实测 234 个不同值，.visit-pie__legend 没有高度限制
        -> 行数 x line-height(22px) 把卡片撑到 5000px+。
   处理：① 图例限高 + 内部滚动（兜底，以后数据再多也不撑爆）
        ② 宽屏双列（13 条 -> 7 行）
        ③ 三卡片等高，避免平台/浏览器卡留白 */
.visit-dist .ant-col { display: flex; }
.visit-dist .ant-card { width: 100%; }

.visit-pie__legend {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.visit-pie__legend::-webkit-scrollbar { width: 6px; }
.visit-pie__legend::-webkit-scrollbar-thumb { background: rgba(57,255,20,.35); border-radius: 3px; }

/* 卡片够宽时才双列，窄屏保持单列 */
@media (min-width: 1600px) {
  .visit-pie__legend { column-count: 2; column-gap: 18px; }
  .visit-pie__legend .visit-pie__row { break-inside: avoid; }
}

/* [VT-TAGS-20261122] 访问记录：浏览器/型号/系统版本 实心小标签 */
.vt-tag { display:inline-block; padding:0 7px; border-radius:4px; font-size:12px; line-height:20px; border:1px solid transparent; font-weight:600; }
.vt-tag.vt-blue   { color:#07110a !important; background:#5aa9ff !important; border-color:#5aa9ff !important; }
.vt-tag.vt-purple { color:#07110a !important; background:#c084fc !important; border-color:#c084fc !important; }
.vt-tag.vt-gold   { color:#07110a !important; background:#f5c451 !important; border-color:#f5c451 !important; }
.vt-tag.vt-green  { color:#07110a !important; background:#39ff14 !important; border-color:#39ff14 !important; }
.vt-tag.vt-cyan   { color:#07110a !important; background:#22d3ee !important; border-color:#22d3ee !important; }
.vt-tag.vt-red    { color:#fff !important; background:#ef4444 !important; border-color:#ef4444 !important; }

/* [VT-CENTER-20261122] 访问记录页：行高收拢 + 内容居中（仅 body.vt-visits 生效，不影响其他页表格） */
body.vt-visits .ant-table-thead > tr > th {
  padding: 8px 6px !important;
  text-align: center !important;
  white-space: nowrap;
}
body.vt-visits .ant-table-tbody > tr > td {
  padding: 5px 6px !important;
  text-align: center !important;
  line-height: 20px;
}
/* 单元格内常见元素也居中（避免 ellipsis / flex 布局残留左对齐） */
body.vt-visits .ant-table-cell,
body.vt-visits .ant-table-cell > div,
body.vt-visits .ant-table-cell > span {
  text-align: center !important;
}
/* 操作列按钮组居中 */
body.vt-visits .ant-table-cell .ant-space { justify-content: center; }
/* 标签上下留白减小 */
body.vt-visits .vt-tag { margin: 1px 0; }

/* [VT-BROWSERCOLOR-20261122] 浏览器分类配色（新增 粉/橙，其余复用已有变体） */
.vt-tag.vt-pink   { color:#07110a !important; background:#f472b6 !important; border-color:#f472b6 !important; }
.vt-tag.vt-orange { color:#07110a !important; background:#fb923c !important; border-color:#fb923c !important; }

/* [VT-WECHAT-20261122] 微信官方绿（比主题绿偏冷，与 Safari 区分） */
.vt-tag.vt-wechat { color:#07110a !important; background:#07c160 !important; border-color:#07c160 !important; }

/* [VT-CNBROWSER-20261122] 国产浏览器配色 */
.vt-tag.vt-baidu { color:#fff !important; background:#2932e1 !important; border-color:#2932e1 !important; }
.vt-tag.vt-quark { color:#07110a !important; background:#22d3ee !important; border-color:#22d3ee !important; }
.vt-tag.vt-uc    { color:#07110a !important; background:#fb923c !important; border-color:#fb923c !important; }
.vt-tag.vt-qq    { color:#fff !important; background:#0099ff !important; border-color:#0099ff !important; }
.vt-tag.vt-oem   { color:#07110a !important; background:#94a3b8 !important; border-color:#94a3b8 !important; }

/* [VT-LEGEND-20261122] 图例：取消双列 + 字号小一号，让 Safari/QQ浏览器/App内浏览器 完整显示
   背景：后端已 Top12 折叠（13 条），双列纯属多余，反而把每列压到 ~145px 导致 ellipsis 截断。
   做法：强制单列（每行可用宽度 ~290px）+ 11px 字号 + 百分比列 44px。 */
.visit-pie__legend { column-count: 1 !important; }
@media (min-width: 1600px) {
  .visit-pie__legend { column-count: 1 !important; }
}
.visit-pie__row {
  font-size: 11px !important;
  line-height: 19px !important;
  gap: 6px !important;
}
.visit-pie__row em {
  width: 42px !important;
  flex: 0 0 42px !important;
  font-size: 11px !important;
}
.visit-pie__row b {
  font-size: 11px !important;
  min-width: 38px;
  text-align: right;
}
.visit-pie__row i { width: 7px !important; height: 7px !important; flex: 0 0 7px !important; }

/* [VT-ROWH-20261122b] 加强行高收拢：覆盖 ant-table-middle/large 与 cell 内层
   截图实测行高仍 ~40px，说明 .ant-table-tbody>tr>td 被 ant 的 size 规则盖住 */
body.vt-visits .ant-table-wrapper .ant-table-tbody > tr > td,
body.vt-visits .ant-table-wrapper .ant-table-thead > tr > th,
body.vt-visits .ant-table-cell {
  padding: 4px 6px !important;
  height: auto !important;
  line-height: 18px !important;
}
body.vt-visits .ant-table-middle .ant-table-tbody > tr > td,
body.vt-visits .ant-table-middle .ant-table-thead > tr > th,
body.vt-visits .ant-table-small .ant-table-tbody > tr > td,
body.vt-visits .ant-table-small .ant-table-thead > tr > th {
  padding: 4px 6px !important;
}
/* 让表格容器吃掉可用高度，减少内部滚动条出现的概率 */
body.vt-visits .ant-table-body,
body.vt-visits .ant-table-content { max-height: none !important; }

/* [VT-NOALERT-20261122] 隐藏「落地页 SDK 命中漏斗...」说明条，给列表腾出 ~50px 垂直空间
   该 Alert 紧邻 visit-summary 之前；用 :has(+ .visit-summary) 精准命中，不误伤其他 Alert */
body.vt-visits .ant-alert:has(+ .visit-summary) { display: none !important; }
/* 兜底：若浏览器不支持 :has()，退化为隐藏该页第一条 info Alert */
@supports not selector(:has(*)) {
  body.vt-visits .ant-alert-info:first-of-type { display: none !important; }
}
