/* ============================================================
   评测榜单（3.1.1 基准测试榜单 / 3.1.2 协同测试榜单）
   版式：左栏榜单目录（扁平，每基准一个榜单）+ 右侧榜单卡片
       卡片内：三张图表（能力 / Token / 平均耗时）在上，数据表一份在最下方
   样式：参考 artificialanalysis.ai —— 彩色柱、值标在柱内、对象徽标 + 斜排轴名、
       卡片细边框 + 右上工具项、左栏圆点目录
   ============================================================ */

/* ---------------- 版式 ---------------- */
/* 评测榜单为对外学术版式：整页转白底、去网格与噪点（仅本视图生效，路由切换时加 body.is-pub） */
body.is-pub { background-image: none; background-color: #fff; }
body.is-pub .grain { display: none; }

/* 本页字号以 10px 为主（仅作用于评测榜单视图，不影响其他页面）
   —— 2026-09-20 用户裁决"字体缩小到 10 以内"，层级改由字重与墨色承担；
   页头页名与卡片标题为两处例外（2026-09-21 用户要求参考 artificialanalysis.ai，见 3.1.1 Q9） */
#viewPubBoard .page-head { margin-top: 14px; align-items: flex-start; }
#viewPubBoard .page-head h1 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
#viewPubBoard .lede { margin-top: 7px; font-size: 11px; line-height: 1.6; max-width: 780px; }

/* 页头：方角标记 + 页名 + 本期标记（参考 artificialanalysis.ai 的指标页页头） */
.pb-head-row { display: flex; align-items: center; gap: 8px; }
.pb-head-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
}
.pb-head-mark svg { width: 16px; height: 16px; }
.pb-head-tag {
  flex: none;
  padding: 1px 7px;
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.08);
  color: #6D28D9;
  font-size: 9px;
  letter-spacing: 0.04em;
}
#viewPubBoard .sync { padding-bottom: 0; }
#viewPubBoard .sync-label { font-size: 9px; letter-spacing: 0.1em; }
#viewPubBoard .sync-time { font-size: 10px; }
#viewPubBoard .empty h4 { font-size: 11px; }
#viewPubBoard .empty p { font-size: 10px; line-height: 1.7; }

.pb-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}
.pb-main { min-width: 0; }

/* 左栏目录：参考站的索引列表——白底裸列表，无边框卡片 */
.pb-rail {
  position: sticky;
  top: 14px;
  padding: 2px 0;
  background: none;
  border: 0;
}
.pb-rail-head {
  padding: 3px 9px 8px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
.pb-rail-item {
  display: flex;
  /* 每项＝榜单名一行（2026-09-22 用户「左侧菜单不需要一句话说明，删除」），色标与名字居中对齐 */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  text-align: left;
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pb-rail-item:hover { background: #F4F6F9; color: var(--ink); }
.pb-rail-item.is-active { background: #F4F6F9; color: var(--ink); font-weight: 600; }
/* 色标为方角小块（学术版式；总榜为深色块）——单项一行，与名字居中对齐 */
.pb-rail-dot { flex: none; width: 8px; height: 8px; border-radius: 2px; opacity: 0.5; }
.pb-rail-item.is-active .pb-rail-dot { opacity: 1; }
.pb-rail-txt { min-width: 0; }
.pb-rail-name { display: block; min-width: 0; }

/* ---------------- 榜单卡片 ---------------- */
/* 榜单区＝一组独立白框的堆叠：卡片头 / 每张图 / 数据区各自成框（参考站的卡片堆叠布局） */
.pb-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pb-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
/* 细行卡片头（2026-09-22 用户「每个榜单页面最上方的榜单标题与一句话说明也删除」）：
   卡片最上方不再给标题与说明（榜单名在左栏目录、指标口径在每张图的标题行与题注），
   该行只承载「已定位」提示与工具项（复制 / 下载），不成框、不占版式位。 */
.pb-card-head.is-slim {
  align-items: center;
  min-height: 22px;
  padding: 0 2px;
  background: none;
  border: 0;
  border-radius: 0;
}
.pb-gap { flex: 1; }
.pb-tools { display: inline-flex; gap: 4px; }
.pb-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pb-tool:hover { color: var(--blue); border-color: rgba(15, 98, 254, 0.3); background: var(--surface-2); }
.pb-tool svg { width: 12px; height: 12px; }

/* ---------------- 图表区（多张图） ---------------- */
/* 卡片头之后直接进图表：标签信息行（榜单版本 / 披露方式等）已按用户裁决取消 */
.pb-charts { display: flex; flex-direction: column; gap: 12px; padding: 0; }
.pb-chart-block {
  min-width: 0;
  padding: 13px 16px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pb-chart-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pb-chart-head h4 { font-size: 10px; font-weight: 600; color: var(--ink); }
.pb-chart-note { font-size: 9.5px; color: var(--ink-4); }

/* 图 / 表题注（2026-09-21 学术版式第一批）：编号 · 口径｜样本 · 来源；
   图表标题行仍只留指标名，样本与来源统一收在题注里（卡片头不重复） */
.pb-caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 10px;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--ink-3);
}
.pb-cap-no { flex: none; font-size: 9.5px; font-weight: 600; color: var(--ink); }
.pb-cap-txt { min-width: 0; }
.pb-cap-meta { margin-left: auto; font-size: 9px; color: var(--ink-4); }

/* 矩阵跳转后的定位提示（可取消） */
.pb-focus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 2px 4px 2px 9px;
  border: 1px solid rgba(15, 98, 254, 0.28);
  border-radius: 999px;
  background: var(--blue-wash);
  color: var(--blue-700);
  font-size: 9.5px;
  white-space: nowrap;
}
.pb-focus-x {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 98, 254, 0.12);
  color: var(--blue-700);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.pb-focus-x:hover { background: rgba(15, 98, 254, 0.22); }

/* 图下脚注：ⓘ + 口径说明（分型榜的兼容样式，本页统一走 .pb-caption） */
.pb-foot {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 9px;
  font-size: 9.5px;
  line-height: 1.55;
  color: var(--ink-4);
}
.pb-info {
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-style: normal;
  font-size: 8px;
  line-height: 9px;
  text-align: center;
}

.pb-chart { padding: 0 2px; }
/* 图表按卡片宽度等分自适应：不设柱宽保底、不出现横向滚动条（2026-09-20 用户裁决） */
.pb-chart-scroll { overflow: visible; }
.pb-chart-inner { min-width: 0; }
.pb-cols {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 150px;
  padding: 0 2px;
  /* 参考线改虚线（学术版式：网格只作读数参考，不抢数据） */
  background-image: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px);
  background-size: 100% 1px;
  background-position: 0 25%, 0 50%, 0 75%;
  background-repeat: repeat-x;
  border-bottom: 1px solid var(--line);
}
.pb-col { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; align-items: flex-end; height: 100%; }
.pb-bar {
  position: relative;
  display: block;
  /* 每图 15 个对象（2026-09-21）：列距 ~68px，柱宽上限放宽到 34px（原 20 列时 30px） */
  width: min(34px, 78%);
  border-radius: 3px 3px 0 0;
}
/* 柱内数值：竖排（2026-09-21 用户「图表还是溢出」——20 根柱时横排数字比柱宽还长，
   会压到相邻柱与边界，改为柱内竖排：始终落在柱内，不再溢出） */
.pb-bar-v {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}

/* 横轴：对象徽标 + **三行横排名称**（2026-09-21 用户「把每个柱状图的对象降低到 15 个吧，
   20 个文字只能竖着排」）：竖排按字数往下长，20 字的名字需要 ~220px、会被轴高截断；
   三行横排（应用 / 模型 / 档位）在 15 列时放得下，轴高也不随列数增长（168px → 66px）。
   安全型矩阵的横轴（.pb-matrix-xaxis，20 列）仍走竖排，不受本组规则影响。 */
.pb-xaxis { display: flex; gap: 3px; padding: 6px 2px 0; height: 66px; }
.pb-xcell { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; }
/* 对象徽标：默认随文排布（图例 / 行标签 / 表格共用）；
   只有在图表横轴的单元里才绝对定位到列中央 */
.pb-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
}
.pb-xcell .pb-chip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}
/* 竖排轴名：现只用于安全型矩阵的横轴（20 列，列宽 ~49px，横排放不下） */
.pb-xname {
  position: absolute;
  bottom: 4px;
  left: 50%;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  max-height: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
  line-height: 1.15;
  color: var(--ink-3);
}
/* 柱状图横轴：三行横排（应用 / 模型 / 档位），行与行对齐，每行独立省略 */
.pb-xaxis .pb-xname {
  top: 19px;
  bottom: auto;
  width: 100%;
  max-height: none;
  overflow: visible;
  white-space: normal;
  transform: translateX(-50%);
  writing-mode: horizontal-tb;
  text-align: center;
  line-height: 1.2;
}
.pb-xaxis .pb-xname > i,
.pb-xaxis .pb-xname > em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-weight: 400;
}
.pb-xaxis .pb-xname > i { font-size: 9px; color: var(--ink-4); }
.pb-xaxis .pb-xname > em.pb-xeff { color: var(--ink-4); }

/* ---------------- 数据区：一份数据，独立成框 ---------------- */
.pb-data-box {
  padding: 13px 16px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pb-data-box .pb-data-head { margin: 0 0 8px; padding-top: 0; border-top: 0; }
.pb-data-box .tbl-wrap { border: 0; border-radius: 0; box-shadow: none; }
.pb-data-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.pb-data-head h4 { font-size: 10px; font-weight: 600; color: var(--ink); }

/* 数据表：按卡片宽度收起（固定列宽 + 列头换行），不出现横向滚动条 */
.pb-card .tbl-wrap { overflow-x: visible; }
/* 数据表：三线表（booktabs，2026-09-21 学术版式第一批）——
   顶线 / 表头下线 / 底线，取消竖线与表头底色；数字列右对齐、等宽、统一 1 位小数 */
.pb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  table-layout: fixed;
  border-top: 1.2px solid #16233A;
  border-bottom: 1.2px solid #16233A;
}
.pb-table thead th {
  padding: 6px 4px;
  background: none;
  border: 0;
  border-bottom: 1px solid #16233A;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}
.pb-table thead th:first-child { width: 34px; }
.pb-table thead th:nth-child(2) { width: 158px; }
.pb-table thead th.num { text-align: right; }
.pb-table tbody td {
  padding: 5px 4px;
  border: 0;
  color: var(--ink-2);
}
.pb-table tbody tr:hover { background: #F7F9FC; }
/* 结果总览矩阵跳转后的定位行 */
.pb-table tbody tr.is-focus { background: rgba(15, 98, 254, 0.07); }
.pb-table td.num { text-align: right; white-space: nowrap; }
.pb-table td.strong { color: var(--ink); font-weight: 600; }
.pb-table .rank-no { color: var(--ink-3); }
.pb-table .rank-no.top { color: var(--blue-700); font-weight: 600; }
.pb-obj { display: flex; align-items: center; gap: 6px; }
.pb-obj span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pb-note-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 9px;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--ink-4);
}

/* ---------------- 打印（学术使用：导出 PDF / 纸质稿，2026-09-21） ----------------
   榜单页在打印时只保留卡片、图表与数据表：左栏目录、工具项与定位提示不打印；
   每张图 / 每张表避免被分页切断，长表跨页保留表头。 */
@media print {
  .pb-layout { display: block; }
  .pb-rail,
  .pb-tools,
  .pb-focus { display: none !important; }
  /* 细行卡片头打印时整体隐去（只剩工具项与定位提示，隐去后不留空行） */
  .pb-card-head.is-slim { display: none; }
  .pb-card-head,
  .pb-chart-block,
  .pb-data-box {
    border-color: #C6CFDB;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .pb-table thead,
  .pb-mx2 thead { display: table-header-group; }
  .pb-table tbody tr:hover,
  .pb-mx2 .pb-mx2-cell:hover { background: none; box-shadow: none; }
  .pb-caption { color: #444; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .pb-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 18px; }
  .pb-matrix-xaxis .pb-xname { max-height: 110px; }
  .pb-table thead th:nth-child(2) { width: 128px; }
}
@media (max-width: 900px) {
  .pb-layout { grid-template-columns: minmax(0, 1fr); }
  .pb-rail { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .pb-rail-head { width: 100%; padding: 2px 6px 6px; }
  .pb-rail-item { width: auto; padding: 6px 10px; }
  .pb-cols { height: 128px; }
  .pb-matrix-xaxis { height: 112px; }
  .pb-matrix-xaxis .pb-xname { max-height: 88px; }
  .pb-xaxis .pb-xname { font-size: 9px; }
}
