/* ==========================================================================
   AIGC 模型市场使用占比 — 页面样式
   与 style.css 共用 :root 变量，这里只加价格雷达没有的组件。
   布局取向：一屏之内先给「结论」（谁第一、多少），再给「明细」（排名 / 图形）。
   ========================================================================== */

/* —— 分享页比价目页少一条悬浮对比栏，底部不需要留 120px —— */
.page.share-page { padding-bottom: 64px; }

/* 顶栏「数据状态 = 示例数据」用警示色，让人在滚动前就看见 */
.topbar-meta .meta-v.is-warn { color: var(--warn); }

/* 概览条里「榜首占比」是当页的结论，给它一点主色权重 */
.stat.is-accent .stat-v { color: var(--accent-deep); }

/* ==========================================================================
   示例数据横幅 —— 只要 isSample 为 true 就必须存在，不允许被折叠或隐藏
   ========================================================================== */
.sample-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 14px;
  margin-bottom: 14px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-2);
  font-size: 12px;
  line-height: 1.6;
  color: var(--warn);
}
.sample-banner svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }
.sample-banner b { font-weight: 650; letter-spacing: .01em; }
.sample-banner .sb-body { min-width: 0; }
.sample-banner .sb-sub { color: #7a5a1a; }

/* 真实数据态：横幅退化成一行来源标注，不再喊「示例」 */
.sample-banner.is-real {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info);
}
.sample-banner.is-real .sb-sub { color: #276079; }

/* 工具栏里的常驻标注：横幅会滚出视野，顶栏的数据状态在窄屏被隐藏，
   所以列表正上方再挂一枚，保证任何滚动位置都能看出这是示例数据。 */
.sample-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 16px;
  border-radius: 4px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-weight: 500;
  cursor: help;
  vertical-align: 1px;
}
/* 真实数据的来源标签：蓝色中性，不要抢「示例数据」该有的警示感 */
.sample-chip.is-live {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info);
}

/* ==========================================================================
   维度切换（视频 / 图像）
   ========================================================================== */.cat-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 15px;
  border-radius: var(--r-1);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .14s, background .14s;
}
.cat-tab:hover { color: var(--ink); background: var(--surface-sub); }
.cat-tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 550;
  box-shadow: var(--shadow-1);
}
.cat-tab .ct-n {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 0 5px;
  height: 16px;
  line-height: 16px;
  border-radius: 4px;
  background: var(--surface-sub);
  color: var(--ink-3);
}
.cat-tab.active .ct-n { background: rgba(255, 255, 255, .2); color: #fff; }

/* ==========================================================================
   指定模型查询卡（图像维度）
   ========================================================================== */
.focus-panel { padding: 14px 20px 16px; margin-bottom: 14px; }
.focus-panel[hidden] { display: none; }

.focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.focus-head h2 { font-size: 13px; }
.focus-head .fh-hint { font-size: 11.5px; color: var(--ink-4); }

.focus-pick { display: flex; align-items: center; gap: 8px; }
.focus-pick select {
  height: 32px;
  min-width: 210px;
  max-width: 100%;
  padding: 0 30px 0 10px;
  border-radius: var(--r-1);
  border: 1px solid var(--line-2);
  background: var(--surface)
              url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.6L6 7.4L9 4.6' fill='none' stroke='%237d8593' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E")
              no-repeat right 9px center / 11px;
  appearance: none;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.focus-pick select:hover { border-color: var(--line-3); }
.focus-pick select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 选中模型后的读数条 */
.focus-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.focus-body[hidden] { display: none; }

.fb-cell {
  padding: 12px 16px 2px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.fb-cell:first-child { border-left: 0; padding-left: 0; }

.fb-k {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-v {
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -.03em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.fb-v small { font-size: 12px; font-weight: 500; letter-spacing: 0; margin-left: 1px; color: var(--ink-2); }
.fb-v .fb-pct-u { font-size: 13px; }
.fb-sub {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 1px;
}
/* 第一格放模型名 + 大号占比，视觉权重最高 */
.fb-cell.fb-lead .fb-v { font-size: 26px; color: var(--accent-deep); }
.fb-cell.fb-lead .fb-name { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.fb-cell.fb-lead .fb-name .fb-rank {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-deep);
  vertical-align: 1px;
}

/* ==========================================================================
   排行榜
   ========================================================================== */
.rank-panel { padding: 6px 0 4px; overflow: hidden; }

.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-head,
.rk-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(90px, 34%) 78px;
  align-items: center;
  gap: 0 14px;
}

.rank-head {
  padding: 8px 20px 9px;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
}
.rank-head .rh-r { text-align: right; }

.rk-row {
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .13s;
  position: relative;
  cursor: pointer;
}
.rk-row:last-child { border-bottom: 0; }
.rk-row:hover { background: var(--surface-sub); }
.rk-row.is-focus { background: var(--accent-soft); }
.rk-row.is-focus::before {
  content: "";
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 2px;
  background: var(--accent);
}

/* 排名徽章：前三名给色，其余保持中性，避免整列都在抢眼 */
.rk-no {
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  height: 24px;
  line-height: 22px;
  text-align: center;
  border-radius: var(--r-1);
  border: 1px solid transparent;
  color: var(--ink-3);
  background: var(--surface-sub);
}
.rk-no.top1 { background: var(--accent); border-color: var(--accent); color: #fff; }
.rk-no.top2,
.rk-no.top3 { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }

.rk-main { min-width: 0; }
.rk-name {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  letter-spacing: -.006em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.rk-name:hover { color: var(--accent); text-decoration: none; }
.rk-meta {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rk-meta .dot { color: var(--ink-4); margin: 0 5px; }
.rk-meta .num { font-variant-numeric: tabular-nums; }

/* 条形长度按榜首归一（不是占满 100%），否则 3.1% 和 3.3% 的差看不出 */
.rk-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.rk-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .5s cubic-bezier(.22, .61, .36, 1);
}
.rk-row.is-focus .rk-bar { background: var(--accent-deep); }

.rk-pct {
  text-align: right;
  font-size: 15px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--ink);
}
.rk-pct small { font-size: 10.5px; font-weight: 500; color: var(--ink-3); margin-left: 1px; letter-spacing: 0; }

/* 较上一统计周期：方向靠箭头，颜色保持中性 —— 用红绿会被读成涨跌行情 */
.rk-chg {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
  margin-left: 5px;
  white-space: nowrap;
}

/* 「其他 N 个模型」合并行：不是模型，别让它看起来像第 31 名 */
.rk-row.is-agg { background: var(--surface-sub); cursor: default; }
.rk-row.is-agg:hover { background: var(--surface-sub); }
.rk-row.is-agg .rk-no { background: transparent; color: var(--ink-4); }
.rk-row.is-agg .rk-name { color: var(--ink-2); font-weight: 500; }
.rk-row.is-agg .rk-bar { background: #b9c0cb; }
.lg-item.is-agg .lg-name { color: var(--ink-2); }

/* ==========================================================================
   占比图 —— 甜甜圈 + 图例
   ========================================================================== */
.chart-panel { padding: 20px; }

.chart-wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px 34px;
  align-items: center;
}

.donut-box { position: relative; width: 100%; max-width: 300px; margin: 0 auto; }
.donut-box svg { display: block; width: 100%; height: auto; }

.donut-seg {
  transition: opacity .15s, stroke-width .15s;
  cursor: pointer;
}
/* 选中时把其余扇区压暗，比单纯加粗描边更容易看出「是这一块」 */
.chart-wrap.has-focus .donut-seg:not(.is-focus) { opacity: .32; }
.donut-seg.is-focus { stroke-width: 30; }
.donut-seg:hover { opacity: .82; }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 26%;
}
.dc-k {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-v {
  font-size: 27px;
  font-weight: 640;
  letter-spacing: -.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.dc-v small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.dc-sub {
  font-size: 10.5px;
  color: var(--ink-4);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 图例：宽屏两栏，与圆环等高；窄屏一栏。DOM 顺序即排名顺序，
   用 CSS 多栏而不是 grid，这样「1-7 在左、8-13 在右」自然成立。 */
.legend { min-width: 0; columns: 2; column-gap: 26px; }
.lg-item { break-inside: avoid; }

.lg-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 0 9px;
  width: 100%;
  padding: 5px 6px;
  border-radius: var(--r-1);
  text-align: left;
  transition: background .13s;
}
.lg-item:hover { background: var(--surface-sub); }
.lg-item.is-focus { background: var(--accent-soft); }

.lg-chip {
  width: 9px; height: 9px;
  border-radius: 2.5px;
  flex: 0 0 9px;
}
.lg-name {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lg-name .lg-sub {
  font-size: 10.5px;
  color: var(--ink-4);
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
.lg-pct {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
  letter-spacing: -.01em;
}
.lg-item.is-focus .lg-pct { color: var(--accent-deep); }

/* 图例里的细条：解决「圆环里几块差不多大，看不出谁大」的问题 */
.lg-bar-wrap {
  grid-column: 2 / -1;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  margin: 2px 0 3px;
  overflow: hidden;
}
.lg-bar { display: block; height: 100%; border-radius: 999px; }

.chart-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ==========================================================================
   字段说明表
   ========================================================================== */
.dict-panel { margin-top: 14px; padding: 16px 20px 18px; }

.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dict-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .02em;
  padding: 0 10px 7px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dict-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
  line-height: 1.62;
}
.dict-table tr:last-child td { border-bottom: 0; }
.dict-table .dt-name {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.dict-table .dt-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--ink-4);
  font-weight: 400;
}
.dict-table .dt-type {
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 11px;
}
.dict-table .dt-ex {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 550;
}
.dict-table .dt-rule { min-width: 0; }
.dict-table .dt-rule b { color: var(--ink); font-weight: 600; }

/* 口径说明沿用价格页的 .notes 排版。
   价格页 4 条正好铺满一行；这里 5 条 + 统计范围 2 条，用 auto-fit 会变成
   「4 + 1 落单」，所以显式定成 3 栏，并把计入/不计入单独声明为 2 栏。 */
.share-notes { margin-top: 22px; }
.share-notes .notes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.share-notes .notes-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .chart-wrap { grid-template-columns: 1fr; gap: 18px; }
  .donut-box { max-width: 264px; }
  .legend { columns: 1; }
  .share-notes .notes-grid,
  .share-notes .notes-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .site-nav a { padding: 5px 9px; font-size: 12px; }
  .focus-body { grid-template-columns: 1fr 1fr; }
  .fb-cell:nth-child(3) { border-left: 0; padding-left: 0; }
  .fb-cell:nth-child(3), .fb-cell:nth-child(4) {
    border-top: 1px solid var(--line);
    margin-top: 10px;
    padding-top: 10px;
  }
  .rank-head, .rk-row { grid-template-columns: 46px minmax(0, 1fr) minmax(70px, 26%) 68px; }
}

@media (max-width: 700px) {
  /* 窄屏：条形挪到第二行整行，排名 / 名称 / 占比保持同一基线 */
  .rank-head { display: none; }
  .rk-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas:
      "no main pct"
      "track track track";
    align-items: center;
    gap: 7px 10px;
    padding: 10px 14px;
  }
  .rk-no { grid-area: no; height: 22px; line-height: 20px; font-size: 12px; }
  .rk-main { grid-area: main; }
  .rk-pct { grid-area: pct; font-size: 16px; }
  .rk-track { grid-area: track; }
  .rank-panel { padding-top: 4px; }
  .chart-panel { padding: 16px 14px 18px; }
  .legend { columns: 1; }
  .lg-item { padding: 6px 4px; }
  .donut-box { max-width: 232px; }
  .dc-v { font-size: 24px; }
  .focus-panel { padding: 13px 14px 14px; }
  .focus-pick { width: 100%; }
  .focus-pick select { flex: 1; min-width: 0; }
  .focus-body { grid-template-columns: 1fr; }
  .fb-cell { border-left: 0; padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 10px; }
  .fb-cell:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
  .dict-panel { padding: 14px 14px 16px; }
  .share-notes .notes-grid,
  .share-notes .notes-grid.n2 { grid-template-columns: 1fr; }
  /* 字段表在手机上转成「卡片式两行」：字段名 / 取值规则，类型与示例并进副行 */
  .dict-table, .dict-table tbody, .dict-table tr, .dict-table td { display: block; width: 100%; }
  .dict-table thead { display: none; }
  .dict-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .dict-table tr:last-child { border-bottom: 0; }
  .dict-table td { padding: 0; border: 0; }
  .dict-table .dt-name { font-size: 12.5px; }
  .dict-table .dt-code { display: inline; margin-left: 6px; }
  .dict-table .dt-type { display: inline; margin-left: 6px; }
  .dict-table .dt-ex { display: inline; margin-left: 6px; }
  .dict-table .dt-ex::before { content: "示例 "; color: var(--ink-4); font-weight: 400; }
  .dict-table .dt-rule { margin-top: 2px; }
}

@media (max-width: 560px) {
  /* 品牌区 + 导航挤在一行时，标题会被迫折成「AIGC 模型市场使用占 / 比」。
     缩字号 + 收紧导航，换来标题单行。 */
  .topbar-inner { gap: 14px; }
  .brand-text h1 { font-size: 13.5px; white-space: nowrap; }
  .site-nav a { padding: 5px 8px; font-size: 11.5px; }
  .site-nav a.active { padding: 4px 7px; }

  /* 价格页有条规则让前三个概览卡的副标题在手机上不显示（那三格只是注解）。
     占比页的前三格副标题是真信息：周期区间 / 同类收录数 / 榜首模型名，必须留。 */
  .share-page .stat:nth-child(-n+3) .stat-sub { display: block; }
  .stat-v { font-size: 17px; }
}

@media (max-width: 480px) {
  .cat-tab { padding: 0 11px; font-size: 12.5px; }
  .sample-banner { font-size: 11.5px; padding: 8px 11px; }
}

@media print {
  .sample-banner, .cat-tabs, .focus-panel, .toolbar, .site-nav { display: none !important; }
  .chart-wrap { grid-template-columns: 260px 1fr; }
  .rk-row { break-inside: avoid; }
}
