/* 市场榜单汇总页 · 浅蓝 / 白底体系（深蓝只用于文字、数字与小面积选中态；无外部依赖） */
:root {
  --bg: #f4f8fd;
  --panel: #ffffff;
  --line: #dde6f4;
  --text: #1b2434;
  --muted: #6b7891;

  /* 蓝色层次：深 -> 浅。navy-* 只作文字/数字；所有底色一律浅蓝到白，不再用整块深蓝 */
  --navy-900: #0f2a66;
  --navy-800: #143573;
  --blue-700: #3060c8;
  --blue-600: #4a78dc;
  --blue-500: #5b8ae4;
  --blue-100: #e8f0ff;
  --blue-50: #f6faff;

  --accent: var(--blue-700);
  --accent-soft: var(--blue-100);
  --warn-bg: #fff7e6;
  --warn-line: #f0c36d;
  --err-bg: #fdecec;
  --err-line: #e9a2a2;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
}

.layout { display: flex; min-height: 100vh; }

/* ---------- 左侧导航（浅蓝面 + 深蓝品牌块，与主区同一蓝色系） ---------- */
.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-right: 1px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* 品牌 / 页面标题块：浅蓝渐变 + 深蓝文字（靠色阶与描边分层，不再是整块深蓝） */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 13px;
  background: linear-gradient(135deg, #e8f1ff 0%, #f7fbff 100%);
  color: var(--navy-900);
  box-shadow: inset 0 -1px 0 #d5e3fb;
}
.brand-mark {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; line-height: 1;
  background: #fff;
  border: 1px solid #c3d9fa;
  color: var(--blue-700);
}
.brand-text { min-width: 0; }
.brand-title { font-size: 14.5px; font-weight: 700; color: var(--navy-900); letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #5d7396; margin-top: 3px; }

.nav { flex: 0 1 auto; min-height: 0; padding: 10px 10px 4px; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted);
  padding: 2px 9px 7px; text-transform: none;
}

/* 一级：渠道入口（三个入口同尺寸、同间距；可用的与待接入的只靠颜色/角标区分） */
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; margin-bottom: 3px;
  border: 1px solid transparent; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #33415c; cursor: pointer; user-select: none;
  transition: background .12s, color .12s, border-color .12s;
}
.nav-item-label { letter-spacing: .2px; }
.nav-item:hover { background: var(--blue-50); border-color: #dbe7fb; }
.nav-item:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.nav-item.is-live { color: var(--navy-800); }
.nav-item.active { background: var(--blue-100); border-color: #c9dcfb; color: var(--navy-900); }
.nav-item.is-off { color: #8b98b0; font-weight: 500; cursor: default; }
.nav-item.is-off:hover { background: #f4f6fa; border-color: transparent; }

/* 二级：当前渠道下的榜单（选中态＝浅蓝底 + 蓝色强调条 + 高对比文字） */
.nav-sub {
  margin: 0 0 10px 10px; padding: 1px 0 1px 7px;
  border-left: 1px solid var(--line);
}
.nav-subitem {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 9px; margin: 1px 0; border-radius: 8px;
  font-size: 12.5px; color: #4a5a78; cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
}
.nav-subitem:hover { background: var(--blue-50); color: var(--navy-800); }
.nav-subitem:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.nav-subitem.active {
  background: var(--blue-100); color: var(--navy-900); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--blue-700);
}
.nav-subitem.off { color: #9aa6bd; cursor: default; }
.nav-subitem.off:hover { background: transparent; color: #9aa6bd; }
.nav-subitem .off { color: #9aa6bd; font-size: 10.5px; margin-left: 6px; }

.tag {
  flex: 0 0 auto; font-size: 10px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid #dce3f0; color: #7a869c; background: #f6f8fc;
}
.tag-live { color: var(--blue-700); border-color: #c3d8fb; background: var(--blue-100); }

.side-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
  background: #fff;
}
/* 侧栏底部的一行真实数据摘要：把中间的空档收拢，页面版式更完整（数据来自 rankings.json，不写死） */
.side-data {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 12px 0;
  font-size: 10.5px; line-height: 1.7; color: var(--muted);
}
.side-data[hidden] { display: none; }
.side-data b { color: var(--navy-800); font-weight: 700; }
.side-data div { display: flex; justify-content: space-between; gap: 8px; }
.side-foot-line { font-size: 10.5px; color: var(--muted); line-height: 1.6; word-break: break-all; }

/* 窄屏横排导航的可感知滑动入口（桌面不出现；只有真的需要横向滚动时才由 JS 显示） */
.nav-hint { display: none; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; padding: 18px 20px 30px; }
/* 桌面：主区首个卡片顶边与左侧品牌块底边对齐，顶部看起来是一整条 */
@media (min-width: 901px) { .main { padding-top: 57px; } }

.issues { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.issues.level-error { border-color: var(--err-line); background: var(--err-bg); }
.issues h3 { margin: 0 0 6px; font-size: 13px; }
.issues ul { margin: 0; padding-left: 18px; }
.issues li { line-height: 1.7; }

/* ---------- 页头（渠道 / 榜单 / 周期 / 截止日期） ---------- */
.pagehead {
  background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 62%);
  border: 1px solid var(--line); border-left: 4px solid var(--blue-700);
  border-radius: var(--radius); padding: 16px 20px 14px;
}
.pagehead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pagehead-titles { min-width: 240px; }
.crumb { font-size: 12px; color: var(--blue-700); font-weight: 600; letter-spacing: .4px; }
.pagehead h1 { font-size: 22px; margin: 4px 0 6px; color: var(--navy-900); letter-spacing: .3px; }
/* 标题行：标题 + 低调的「口径说明」触发点（长口径默认不占版面，悬停/聚焦/点击才展开） */
.titlerow { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.titlerow h1 { margin: 4px 0 6px; }
.infoslot { display: inline-flex; align-items: center; }
.pagesub { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; max-width: 720px; }
.pagesub[hidden] { display: none; }
.tabs { display: flex; gap: 6px; }
.tab {
  padding: 7px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 13px; color: #33415c;
}
.tab:hover { border-color: #a8c6f5; background: var(--blue-50); }
.tab:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.tab.active { background: var(--blue-700); border-color: var(--blue-700); color: #fff; font-weight: 600; }
.tab.active:hover { background: #2c57b4; border-color: #2c57b4; }

/* 页头事实条：当前周期 / 数据覆盖 / 抓取时间 / 在榜记录 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; line-height: 1.6;
}
.chip .k { color: var(--muted); font-size: 11px; }
.chip .v { font-weight: 700; color: var(--navy-800); }
.pagecaveat {
  margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.7;
  border-top: 1px dashed var(--line); padding-top: 8px;
}
.pagecaveat[hidden] { display: none; }

/* ---------- 口径说明气泡（页头触发点 / 列头 / 入选理由共用；原生 title 在手机上不可见，不用它） ---------- */
.infotip {
  display: inline-flex; align-items: center; gap: 3px;
  border: 0; background: none; padding: 0 1px; margin: 0;
  font: inherit; font-size: 11.5px; line-height: 1.5; color: var(--muted);
  cursor: help; border-bottom: 1px dotted #b9c6dc; text-align: left;
}
.infotip .g { font-size: 12px; color: var(--blue-500); }
.infotip:hover, .infotip.active { color: var(--blue-700); border-bottom-color: var(--blue-500); }
.infotip:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; border-radius: 3px; color: var(--blue-700); }
h1 + .infoslot .infotip, .infoslot .infotip { font-weight: 600; }
/* 表头里的小图标触发点（紧凑，不撑高表头） */
.infotip--glyph { border-bottom: 0; font-size: 12px; }
.infotip--glyph .g { font-size: 12.5px; }
/* 单元格里的文本触发点（例如「双榜达标」）：看起来是文字，可悬停/聚焦查看完整口径 */
.infotip--text { border-bottom-color: #b9c6dc; }
.infopop {
  position: fixed; z-index: 70; max-width: 340px; padding: 8px 11px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue-500);
  border-radius: 8px; box-shadow: 0 10px 26px rgba(15, 42, 102, .18);
  font-size: 12px; line-height: 1.7; color: #35496f; pointer-events: none; word-break: break-word;
}
.infopop[hidden] { display: none; }

/* ---------- 概览卡（大数字 + 结论；浅底深字，靠色阶 / 强调条分层） ---------- */
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 12px; margin-top: 14px; }
.overview:empty { display: none; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 13px; box-shadow: 0 1px 2px rgba(20, 45, 100, .05);
  display: flex; flex-direction: column; gap: 6px; min-height: 104px;
}
.card .k { font-size: 12px; color: #44567a; font-weight: 600; letter-spacing: .2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
/* 卡标题旁的 ⓘ 口径触发点（与页头「口径说明」同一套气泡；默认不占版面、不撑高卡片） */
.card .k .cardtip { font-size: 11px; }
.card .k .cardtip .g { font-size: 12px; }
.card .v { font-size: 26px; font-weight: 800; color: var(--navy-800); line-height: 1.2; letter-spacing: .3px; }
.card .v.small { font-size: 17px; }
.card .s { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.card--hero {
  background: linear-gradient(180deg, #dce9fd 0%, #f0f7ff 100%);
  border-color: #b9d2f7;
  box-shadow: inset 5px 0 0 var(--blue-700), 0 1px 2px rgba(20, 45, 100, .05);
}
.card--hero .k { color: var(--navy-800); }
.card--hero .v { color: var(--navy-900); }
.card--hero .s { color: #5c7396; }
.card--soft { background: linear-gradient(180deg, #f7faff, #fcfdff); border-color: #dfe9fb; border-top: 3px solid #bcd4f7; }
.card--soft .v { color: var(--blue-700); }
.card--plain { background: linear-gradient(180deg, #ffffff, #fbfdff); border-color: var(--line); border-top: 3px solid #e2ecfa; }

.pending { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-top: 14px; }
.pending-badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 12px; background: var(--blue-50); color: var(--muted); border: 1px solid var(--line); }
.pending h2 { font-size: 16px; margin: 12px 0 8px; }
.pending p { margin: 4px 0; line-height: 1.8; }
.muted { color: var(--muted); }

/* 导入明细：中性诊断入口，默认折叠在侧边栏底部；真实 error/warning 仍走上方黄色告警区 */
.sideimport { margin-top: 8px; font-size: 11.5px; }
.sideimport summary {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f7faff;
  color: var(--navy-800); font-weight: 600; cursor: pointer; list-style: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sideimport summary::-webkit-details-marker { display: none; }
.sideimport summary::before { content: '▸'; color: var(--blue-700); }
.sideimport[open] summary::before { content: '▾'; }
.sideimport summary:hover { background: var(--blue-100); border-color: #c9dcfb; }
.sideimport summary:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.sideimport[hidden] { display: none; }
.sideimport-body {
  margin-top: 7px; max-height: 38vh; overflow-y: auto;
  font-size: 11px; color: #46536b; line-height: 1.7;
  background: #fbfcff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.sideimport-body ul { margin: 4px 0 0; padding-left: 14px; }
.sideimport-body li { line-height: 1.6; word-break: break-word; }
.importnotes-line { color: #46536b; }

/* ---------- 筛选区 ---------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 14px;
}
.control { display: flex; flex-direction: column; gap: 5px; }
.control.grow { flex: 1 1 260px; min-width: 220px; }
.control label { font-size: 11px; color: var(--muted); }
.control input[type="search"], .control select {
  height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; font-size: 13px; color: var(--text); max-width: 100%;
}
.control input[type="search"] { width: 100%; }
.control input[type="search"]:focus, .control select:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-500); }
#store { max-width: 260px; }
#categoryL2 { min-width: 172px; max-width: 230px; }
#categoryL2:disabled { color: #70809b; background: #f6f9ff; cursor: not-allowed; }
#priceBand { max-width: 230px; }
#potEvidence { max-width: 190px; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.segmented button {
  border: 0; background: #fff; padding: 0 16px; height: 32px; cursor: pointer;
  font-size: 13px; color: var(--text); border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--blue-50); }
.segmented button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; }
.segmented button.active { background: var(--blue-700); color: #fff; font-weight: 600; }
.segmented button.active:hover { background: #2c57b4; }
.segmented button:disabled { color: #b9bec7; cursor: not-allowed; background: #f7f8fa; }

/* ---------- 数据期：滚动窗口（近 1/7/30 天）+ 自定义起止日期（弹层日历） ---------- */
.periodwrap { position: relative; display: inline-flex; align-items: stretch; }
.daypicker {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  width: 302px; max-width: calc(100vw - 28px);
  max-height: calc(100vh - 24px); overflow-y: auto;
  background: #fff; border: 1px solid #cfe0f8; border-radius: 10px;
  box-shadow: 0 12px 28px rgba(22, 52, 110, .16); padding: 10px 10px 8px;
}
/* 下方空间不够时翻到切换器上方（窄屏尤其需要） */
.daypicker.up { top: auto; bottom: calc(100% + 6px); }
.daypicker-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.daypicker-head b { font-size: 13px; color: var(--navy-800); flex: 1; text-align: center; }
.daypicker-head button {
  height: 26px; min-width: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--text); font-size: 12px; cursor: pointer;
}
.daypicker-head button:hover { background: var(--blue-50); border-color: #a8c6f5; }
.daypicker-head button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.daypicker-head button:disabled { color: #c3cbda; cursor: not-allowed; background: #fafbfe; }
.daypicker-head button:disabled:hover { background: #fafbfe; border-color: var(--line); }
.dpweek, .dpgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dpweek span { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.dpcell {
  height: 30px; border: 1px solid transparent; border-radius: 6px; background: var(--blue-50);
  color: var(--text); font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.dpcell:hover { background: var(--blue-100); border-color: #bcd6fa; }
.dpcell:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.dpcell.active { background: var(--blue-700); border-color: var(--blue-700); color: #fff; font-weight: 600; }
.dpcell.active:hover { background: #2c57b4; border-color: #2c57b4; }
/* 没有该榜来源快照的日期：浅灰、禁用（鼠标与键盘都不可选），月份里仍然显示日期数字 */
.dpcell.off { background: #f5f7fb; border-color: transparent; color: #b9c2d4; cursor: not-allowed; }
.dpcell.off:hover { background: #f5f7fb; border-color: transparent; }
/* 已选日刚好没有来源快照（切榜后可能出现）：保持浅灰但用描边标出「就是这一天」 */
.dpcell.off.active { background: #f0f4fb; border-color: #a8c6f5; color: var(--blue-700); font-weight: 600; }
.dpcell.off.active:hover { background: #f0f4fb; border-color: #a8c6f5; }
.dpblank { height: 30px; }
.daypicker-foot {
  margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--muted); line-height: 1.6;
}
.daypicker-foot b { color: var(--navy-800); }

/* ---------- 自定义起止日期（按日记录）弹层：浅蓝整月日历 ----------
   起止日期是两个「字段按钮」（不再用原生 <input type=date> 分段输入），
   日期本身在下方整月日历里点选，选中即回显、底部「已选 N 天」同步更新；
   起止点成同一天就是该日的单日榜单。 */
.segmented button.segcustom { display: inline-flex; align-items: center; gap: 5px; }
.segmented button.segcustom .caret { font-size: 9px; opacity: .85; }
.segmented button.segcustom[aria-expanded="true"] { background: var(--blue-100); }
.rangepicker { width: 322px; }
.rangefields { display: flex; align-items: stretch; gap: 7px; }
.rangefield {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  cursor: pointer; text-align: left; font: inherit;
}
.rangefield:hover { background: var(--blue-50); border-color: #a8c6f5; }
.rangefield:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.rangefield.active { background: var(--blue-100); border-color: var(--blue-500); box-shadow: inset 0 0 0 1px #bcd6fa; }
.rangefield .rf-k { font-size: 11px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangefield.active .rf-k { color: var(--navy-800); font-weight: 600; }
.rangefield .rf-v { font-size: 12.5px; font-weight: 700; color: var(--navy-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rangearrow { align-self: center; color: var(--muted); font-size: 12px; }
.rangecal { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.rangecal .rphead { margin-bottom: 6px; }
.rangecal .rphead b { font-size: 12.5px; }
/* 区间内的日期：浅蓝底标出已选范围（端点仍是深蓝选中态） */
.dpcell.inrange { background: #e8f0ff; border-color: #c9dcfb; }
.dpcell.inrange:hover { background: #dbe8fc; border-color: #bcd6fa; }
.rangequick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rangequick button {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--text); font-size: 11.5px; cursor: pointer;
}
.rangequick button:hover { background: var(--blue-50); border-color: #a8c6f5; }
.rangequick button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.rangehint { margin-top: 8px; font-size: 11.5px; color: var(--navy-800); line-height: 1.6; }
.rangeerror {
  margin-top: 6px; padding: 5px 8px; font-size: 11.5px; line-height: 1.6;
  background: var(--err-bg); border: 1px solid var(--err-line); border-radius: 6px; color: #8f2f2f;
}
.rangeerror[hidden] { display: none; }
.rangebtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 9px; }

/* 按日记录（自定义范围）的数据日期列：一眼可分组，不藏在 tooltip 里 */
td.col-day, th.col-day { min-width: 112px; box-sizing: border-box; white-space: nowrap; }
td.col-day { font-weight: 600; color: var(--navy-800); font-variant-numeric: tabular-nums; }
thead th.col-day { background: linear-gradient(180deg, #e6f0ff, #d8e8fd); color: var(--navy-900); }
.periodnotice {
  margin: 10px 2px 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.7;
  background: var(--blue-50); border: 1px solid #cfe0f8; border-left: 3px solid var(--blue-500);
  border-radius: 8px; color: var(--navy-800);
}
.periodnotice b { color: var(--navy-900); }

.btnrow { display: flex; gap: 8px; }
.btn {
  height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
}
.btn:hover { background: var(--blue-50); border-color: #a8c6f5; }
.btn:active { background: var(--blue-100); }
.btn:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.btn.primary { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn.primary:hover { background: #2c57b4; border-color: #2c57b4; }
.btn.primary:active { background: #23499e; border-color: #23499e; }
.btn:disabled { color: #b9bec7; cursor: not-allowed; background: #f7f8fa; border-color: var(--line); }

.filtersummary { margin: 10px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.filtersummary b { color: var(--navy-800); }

/* ---------- 表格 ---------- */
.tablewrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-top: 10px; overflow-x: auto;
}
table { border-collapse: collapse; width: 100%; min-width: 1080px; }
#potTable { min-width: 1160px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #f2f7ff, #e6effd);
  color: var(--navy-800); text-align: left; font-size: 12px; font-weight: 700;
  padding: 10px; border-bottom: 1px solid #c9dcfb; white-space: nowrap;
  letter-spacing: .2px;
}
/* 表头分层：排名稍稍加强，关键指标列次之，商品列最浅（淡蓝底 + 深蓝字，层次靠色阶而非深色块）。
   「操作」列已下线，排名列仍用最深一档，保持一眼可扫。 */
thead th.rank { background: linear-gradient(180deg, #e2edfd, #d3e3fb); color: var(--navy-900); }
thead th.num, thead th.col-metric { background: linear-gradient(180deg, #eaf2ff, #dbe8fc); color: var(--navy-900); }
thead th.col-title { background: linear-gradient(180deg, #f4f9ff, #e9f2fe); }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { filter: brightness(.96); }
thead th .arrow { color: var(--blue-700); font-size: 11px; margin-left: 3px; }

tbody td { padding: 9px 10px; border-bottom: 1px solid #eef2f9; vertical-align: top; line-height: 1.55; }
tbody tr:hover { background: var(--blue-50); }
td.rank { font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--navy-900); }
td.num { white-space: nowrap; color: #1f2c47; }

/* ---------- 商品图缩略图 + 悬停/聚焦放大预览 ---------- */
.col-img { width: 78px; }
.imgbox {
  width: 66px; height: 66px; border: 1px dashed #cfd5de; border-radius: 6px;
  background: #fbfcfd; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 10px; color: #98a0ac; line-height: 1.3; padding: 2px;
}
.imgbox img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.imgbox-empty { flex-direction: column; gap: 2px; }
.imgbox-empty .why { font-size: 9px; color: #aeb5c0; }
.thumb {
  width: 66px; height: 66px; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: zoom-in; display: block; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb:hover, .thumb:focus-visible { border-color: var(--blue-500); box-shadow: 0 0 0 2px var(--blue-100); outline: none; }
.thumb.pinned { border-color: var(--blue-700); box-shadow: 0 0 0 2px var(--blue-100); }

/* 图片诊断：只在缩略图加载失败时出现；正常时整条 hidden、不占版面 */
.imgstatbar { margin: 6px 2px 0; font-size: 12px; color: #a8620a; line-height: 1.7; }
.imgstatbar[hidden] { display: none; }
.imgstatbar b { color: var(--text); }

.imgpreview {
  position: fixed; z-index: 60; max-width: 424px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 42, 102, .22); pointer-events: none;
}
.imgpreview img { display: block; width: auto; height: auto; max-width: 400px; max-height: 400px; object-fit: contain; margin: 0 auto; background: #fbfcfd; border-radius: 6px; }
.imgpreview-cap { margin-top: 6px; }
.imgpreview-title { font-size: 12px; font-weight: 600; line-height: 1.45; max-height: 3em; overflow: hidden; }
.imgpreview-meta { font-size: 11px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.imgpreview.pinned { pointer-events: auto; }
.imgpreview-loading img { opacity: .25; }
.imgpreview-fail { color: #a8620a; font-size: 12px; padding: 18px 6px; text-align: center; }

@media (max-width: 720px) {
  .imgpreview { max-width: 86vw; }
  .imgpreview img { width: 78vw; }
  .thumb { cursor: zoom-in; }
}

.title { font-weight: 600; color: var(--navy-800); text-decoration: none; display: block; max-width: 440px; }
.title:hover { color: var(--blue-700); text-decoration: underline; }
.pidline { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge-new { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: #fff2e0; border: 1px solid #ffd9a8; color: #a8620a; margin-left: 6px; }
/* 「操作」列下线后，商品链接缺失时在商品名称下方明确提示（不留空、不静默） */
.badge-nolink { display: inline-block; font-size: 11px; color: #a8620a; background: #fff7e6; border: 1px solid #f0c36d; border-radius: 4px; padding: 0 6px; margin-left: 6px; }

/* 短视频榜（「带货视频数」「带货达人（前 3）」两列已下线，与总榜同为 9 列）：
   把腾出的横向宽度分给商品名称与视频链接，避免右半边留白、左半边挤成竖排 */
#rankTable.sv .title { max-width: 520px; }
#rankTable.sv .col-vid { width: 248px; }

/* ---------- 带货短视频链接入口（短视频榜 / 潜力榜共用） ---------- */
.col-vid { width: 168px; }
.vidcell { font-size: 12px; }
.vidcell .vidhead { color: #374151; margin-bottom: 4px; white-space: nowrap; }
.vidcell .vidhead b { color: var(--text); }
.viddetails { width: 100%; }
.viddetails summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  padding: 5px 8px; border: 1px solid #d6e4fa; border-radius: 8px;
  background: #f4f8ff; color: var(--navy-800); cursor: pointer;
  font-size: 11px; line-height: 1.5; list-style: none;
}
.viddetails summary::-webkit-details-marker { display: none; }
.viddetails summary::before { content: '▸'; color: var(--blue-700); }
.viddetails[open] summary::before { content: '▾'; }
.viddetails summary:hover { background: #eaf2ff; border-color: #a9c8f4; }
.viddetails summary:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.viddetails summary b { color: var(--blue-700); }
.vidtoggle { margin-left: auto; color: var(--blue-700); }
.viddetails[open] .vidtoggle { font-size: 0; }
.viddetails[open] .vidtoggle::after { content: '收起'; font-size: 11px; }
.viditems { list-style: none; padding: 0; margin: 7px 0 0; display: grid; gap: 5px; }
.viditem { border: 1px solid #e1eafa; border-radius: 8px; background: #fff; padding: 5px 6px; min-width: 0; }
.viditem .vidlink {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0;
  border: 0; background: transparent; border-radius: 0; white-space: normal;
}
.viditem .vidnum {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: #eaf2ff; color: var(--blue-700);
}
.viditem .vidtitle { min-width: 0; overflow-wrap: anywhere; }
.viditem .vidopen { margin-left: auto; flex: 0 0 auto; }
.vidmetrics { display: flex; flex-wrap: wrap; gap: 3px 7px; margin: 4px 0 0 24px; color: var(--muted); font-size: 10px; }
.videxpand {
  display: flex; align-items: center; gap: 5px; width: 100%; max-width: 190px;
  padding: 6px 9px; border: 1px solid #cbdff9; border-radius: 8px;
  background: #f4f8ff; color: var(--navy-800); cursor: pointer; font: inherit; font-size: 11px;
}
.videxpand:hover, .videxpand:focus-visible { background: #eaf2ff; border-color: #98bff4; }
.videxpand span { margin-left: auto; color: var(--blue-700); }
.video-detail-row[hidden] { display: none; }
.video-detail-row td { background: #f8fbff; padding: 12px 18px; }
.video-detail-panel { max-width: 1240px; margin: 0 auto; }
.video-detail-panel > strong { display: block; margin-bottom: 8px; color: var(--navy-800); font-size: 12px; }
.video-detail-panel .viditems { margin: 0; gap: 7px; }
.video-detail-panel .viditem {
  display: grid; grid-template-columns: minmax(220px, 32%) minmax(0, 1fr);
  align-items: center; gap: 18px; padding: 10px 14px;
}
.video-detail-panel .viditem-main { min-width: 0; padding-right: 16px; border-right: 1px solid #e4ecf8; }
.video-detail-panel .viditem .vidlink {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 3px 8px;
  align-items: start; font-size: 12px; line-height: 1.4;
}
.video-detail-panel .viditem .vidtitle {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; font-weight: 600;
}
.video-detail-panel .viditem .vidopen { grid-column: 2; margin: 0; font-size: 11px; }
.video-detail-panel .viddata { display: grid; gap: 7px; min-width: 0; }
.video-detail-panel .vidstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.video-detail-panel .vidstat { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.video-detail-panel .vidstat > span { color: #667b9d; font-size: 11px; flex: none; }
.video-detail-panel .vidstat b { overflow: hidden; text-overflow: ellipsis; color: var(--navy-800); font-size: 12px; }
.video-detail-panel .vidstat-primary b { color: var(--blue-700); font-size: 13px; }
.video-detail-panel .viddata-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.video-detail-panel .vidcontext { display: flex; align-items: center; gap: 7px; min-width: 0; color: #788ba7; font-size: 10px; }
.video-detail-panel .vidcontext > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-detail-panel .vidcontext-sep { color: #b2bfd3; }
.video-detail-panel .vidextra { flex: none; position: relative; color: #607ba9; font-size: 10px; }
.video-detail-panel .vidextra summary { cursor: pointer; list-style: none; white-space: nowrap; }
.video-detail-panel .vidextra summary::-webkit-details-marker { display: none; }
.video-detail-panel .vidextra summary::after { content: ' ▾'; }
.video-detail-panel .vidextra[open] summary::after { content: ' ▴'; }
.video-detail-panel .vidextra > div { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 6px 0 0; }
.video-detail-panel .vidextra b { color: var(--navy-800); font-weight: 600; }
.video-detail-panel .viddata-empty { color: var(--muted); font-size: 11px; }
@media (max-width: 1050px) {
  .video-detail-panel .viditem { grid-template-columns: minmax(190px, 30%) minmax(0, 1fr); gap: 12px; }
  .video-detail-panel .vidstats { gap: 7px; }
}
.vidlinks {
  display: flex; flex-wrap: wrap; gap: 4px;
  max-height: 84px; overflow-y: auto; padding-right: 2px;
}
.vidlink {
  display: inline-block; font-size: 11px; line-height: 1.7; padding: 0 6px;
  border: 1px solid #dbe3f0; border-radius: 9px; background: #f7faff;
  color: var(--blue-700); text-decoration: none; white-space: nowrap;
}
.vidlink:hover, .vidlink:focus-visible { background: var(--blue-100); border-color: var(--blue-700); text-decoration: none; }
.missing-note { font-size: 11px; color: var(--muted); }
.emptystate { padding: 28px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pageinfo { font-size: 12px; color: var(--muted); }
.pageinfo b { color: var(--navy-800); }
.pagerbtns { display: flex; align-items: center; gap: 8px; }
.pagelabel { font-size: 12px; color: var(--muted); min-width: 76px; text-align: center; }

/* ---------- 潜力榜（找款候选，待人工复核） ---------- */
.potblocked {
  background: var(--err-bg); border: 1px solid var(--err-line); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 14px;
}
.potblocked h3 { margin: 0 0 6px; font-size: 14px; }
.potblocked ul { margin: 0 0 6px; padding-left: 18px; }
.potblocked li { line-height: 1.8; }

.potrules {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue-500);
  border-radius: var(--radius); padding: 12px 16px; margin-top: 14px; line-height: 1.85;
}
.potrules h2 { font-size: 15px; margin: 0 0 8px; color: var(--navy-900); }
.potrules .potroute { margin: 3px 0; font-size: 13px; }
.potrules p { margin: 6px 0; }
.potrules ul { margin: 4px 0; padding-left: 20px; }
.potrules .potwarn {
  margin-top: 9px; padding: 7px 11px; border-radius: 6px;
  font-size: 12px; line-height: 1.65; color: #5c4a1c;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 3px solid var(--warn-line);
}
.potrules .potlim { margin-top: 8px; font-size: 12px; color: var(--muted); }
.potrules .potlim summary { cursor: pointer; }
/* 选品范围排除（盲盒类）短说明：数量放在注释区，不占页头 4 张概览卡 */
.potrules .potscope {
  margin: 7px 0 0; padding: 7px 11px; font-size: 12px; line-height: 1.7; color: #35496f;
  background: var(--blue-50); border: 1px dashed #cfe0fb; border-radius: 7px;
}

.routebadge {
  display: inline-block; font-size: 11px; padding: 1px 7px; margin: 0 4px 4px 0;
  border-radius: 10px; border: 1px solid var(--line); background: #fafbfc; color: #4b5563;
}
.routebadge.dual { border-color: #bcd2fb; background: var(--blue-100); color: var(--blue-700); font-weight: 600; }

/* 30 天同榜证据标签（紧凑，避免新增整列） */
.evtier {
  display: inline-block; font-size: 10.5px; padding: 1px 7px; margin: 2px 4px 4px 0;
  border-radius: 10px; border: 1px solid #cfe0fb; background: #eef4ff; color: var(--navy-800);
}
.evtier.t3 { border-color: #9dc0f7; background: var(--blue-100); font-weight: 600; }
.evtier.t0 { border-color: #e2e6ee; background: #f7f8fa; color: #8b94a6; }
.ev30 { color: var(--navy-800); font-weight: 600; }
.ev30.none { color: #98a0ac; font-weight: 400; }

/* 潜力榜三组名次固定按 1 / 7 / 30 天阅读，缺来源保留空位。 */
#potTable { min-width: 1280px; }
#potTable .col-vid { min-width: 160px; }
#potTable .col-ranges { min-width: 195px; }
.rank-sequence { display: flex; gap: 4px; margin-top: 5px; white-space: nowrap; }
.rank-period {
  display: flex; align-items: baseline; gap: 4px; padding: 4px 6px;
  border: 1px solid #dce8f9; border-radius: 6px; background: #f7faff;
}
.rank-period i { font-style: normal; color: #7183a2; font-size: 10px; }
.rank-period b { color: var(--navy-800); font-size: 12px; }
.rank-period small { color: var(--blue-700); font-size: 9px; }

/* 「入选理由」只写路线结论（双榜达标 / 总榜达标 / 短视频达标），完整口径悬停或聚焦可读 */
.col-reason { min-width: 96px; max-width: 124px; font-size: 12px; color: #374151; line-height: 1.6; }
.col-reason .reasontext { white-space: nowrap; }
.col-review { min-width: 200px; max-width: 250px; font-size: 12px; }
.col-review .flag { margin-bottom: 5px; }
.col-review .flaglabel { display: block; color: #a8620a; }
.col-review .oknote { color: #1a7f45; }
/* 7 天支付 / 成交：每条路线一行，紧凑两段式（下限数值不逐格重复，只在列头提示与悬停/CSV 里） */
.col-ranges { min-width: 196px; }
.rangerow { margin-bottom: 3px; line-height: 1.5; white-space: nowrap; }
.rangerow:last-child { margin-bottom: 0; }
.rangerow .rk { color: var(--navy-800); font-weight: 600; margin-right: 1px; }
.rangerow .rv { color: #1f2c47; }
.na { color: #9aa1ac; }

.ipaudit {
  margin-top: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px;
}
.ipaudit summary { cursor: pointer; font-weight: 600; color: var(--navy-800); }
.ipauditbody { margin-top: 8px; }
.audittable { min-width: 900px; font-size: 12px; }
.audittable thead th { background: linear-gradient(180deg, #f2f7ff, #e6effd); }
.audittable .audittitle { max-width: 360px; }
.audittable .auditreason { max-width: 230px; color: #46536b; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    overflow: visible; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 10px 12px; }
  .brand-mark { flex: 0 0 26px; width: 26px; height: 26px; font-size: 13px; }
  .brand-title { font-size: 13.5px; }
  .nav {
    display: flex; align-items: center; gap: 4px; padding: 7px 10px;
    overflow-x: auto; overflow-y: hidden; flex: none;
  }
  .nav-label { display: none; }
  .nav-item { flex: 0 0 auto; padding: 6px 10px; margin-bottom: 0; white-space: nowrap; }
  .nav-sub {
    display: flex; align-items: center; gap: 4px; flex: 0 0 auto;
    margin: 0 2px 0 6px; padding: 0 0 0 6px; border-left-width: 1px;
  }
  .nav-subitem { flex: 0 0 auto; margin: 0; white-space: nowrap; box-shadow: none; }
  /* 横排时选中态改用下边强调条（左侧竖条在横排里看不出层级） */
  .nav-subitem.active { box-shadow: inset 0 -3px 0 var(--blue-700); }
  .side-foot { padding: 7px 12px 9px; }
  .side-data { display: none; }
  .side-foot-line { display: none; }
  /* 横排导航可能仍需左右滑动：给一行可感知的入口（结构上当前渠道已排在最前，通常无需滚动） */
  .nav-hint {
    display: block; padding: 0 12px 7px; font-size: 10.5px;
    color: var(--blue-700); font-weight: 600; text-align: right;
  }
  .nav-hint[hidden] { display: none; }
  .sideimport { margin-top: 0; }
  .sideimport-body { max-height: 30vh; }
  .main { padding: 12px; }
  .pagehead { padding: 14px; }
  .pagehead h1 { font-size: 19px; }
  /* 概览卡：窄屏两列；奇数张时最后一张占满整行，3 卡页也不会留下半行空格 */
  .overview { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
  .overview .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card { min-height: 0; padding: 12px; }
  .card .v { font-size: 21px; }
  /* 口径说明气泡窄屏收窄，避免超出视口 */
  .infopop { max-width: 86vw; }
  .infotip { font-size: 11px; }
  /* 数据期切换：近 1/7/30 天 + 自定义共 4 个入口，窄屏收紧内边距并允许换行，
     否则会把页面撑出横向滚动 */
  .periodwrap { max-width: 100%; }
  .periodwrap .segmented { flex-wrap: wrap; max-width: 100%; }
  .segmented button { padding: 0 12px; }
  .rangepicker { max-width: calc(100vw - 28px); }
}
