/* ==========================================================================
   paging.css · 通用分页/加载组件 v1.0（2026-10-01）
   配套 paging.js 使用。作用域全部带 .pg 前缀，不影响宿主页任何样式。
   三种模式（data-mode）：load-more | pagination | scroll
   ========================================================================== */

/* ---- 容器 ---- */
.pg {
  --pg-accent: #F5822A;            /* 品牌橙（与站点 --red 一致） */
  --pg-navy: #0A2742;
  --pg-line: #E4E9EF;
  --pg-muted: #667085;
  --pg-bg: #FFFFFF;
  margin: 28px 0 8px;
  font-family: inherit;
}

/* ---- 状态行（aria-live 由 JS 输出 role="status"） ---- */
.pg-status {
  text-align: center;
  font-size: 12.5px;
  color: var(--pg-muted);
  margin-bottom: 10px;
  min-height: 18px;
}

/* pagination 模式下页码条已经把「第几页 / 共几页」表达清楚了，
   状态行只播报给读屏（aria-live 保留），视觉上不再重复显示。 */
.pg--pagination .pg-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- 通用按钮 ---- */
.pg button {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--pg-line);
  background: var(--pg-bg);
  color: var(--pg-navy);
  border-radius: 999px;
  transition: border-color .2s, color .2s, background .2s, transform .1s;
}
.pg button:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 2px;
}
.pg button[disabled],
.pg button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .45;
  color: var(--pg-muted);
}

/* ---- 模式一：load-more / scroll 的「加载更多」 ---- */
.pg-more {
  display: block;
  margin: 0 auto;
  padding: 11px 34px;
  font-size: 14px;
  font-weight: 600;
}
.pg-more:hover:not([disabled]) {
  border-color: var(--pg-accent);
  color: var(--pg-accent);
}
.pg-more.is-loading {
  pointer-events: none;
  opacity: .7;
}

/* ---- 模式二：pagination ---- */
.pg-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-btn {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
}
.pg-pages {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.pg-num {
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pg-num:hover:not([disabled]) { border-color: var(--pg-accent); color: var(--pg-accent); }
.pg-num.is-current {
  background: var(--pg-navy);
  border-color: var(--pg-navy);
  color: #fff;
  cursor: default;
}
.pg-gap {
  min-width: 24px;
  text-align: center;
  color: var(--pg-muted);
  font-size: 14px;
  line-height: 38px;
  user-select: none;
}

/* ---- 模式三：scroll 的触底哨兵（不可见，仅占位给 IntersectionObserver） ---- */
.pg-sentinel {
  height: 1px;
  margin-top: -1px;
  pointer-events: none;
}

/* ---- 移动端微调 ---- */
@media (max-width: 640px) {
  .pg-btn { padding: 8px 13px; font-size: 12.5px; }
  .pg-num { min-width: 34px; height: 34px; font-size: 12.5px; }
  .pg-more { width: 100%; padding: 12px 20px; }
}
