<style>
/* ==========================================================================
   pagination.css — 分页组件样式
   依赖页面变量：--color-foreground / --color-background / --color-button ...
   （没有这些变量时自动回落到黑白配色）
   ========================================================================== */

.pg {
  /* ---- 可调参数 ---- */
  --pg-item-h: 36px;
  --pg-item-min-w: 36px;
  --pg-gap: 6px;
  --pg-radius: 0;

  /* ---- 颜色（跟随站点 color-scheme） ---- */
  --pg-text: rgb(var(--color-foreground, 18, 18, 18));
  --pg-text-muted: rgba(var(--color-foreground, 18, 18, 18), 0.6);
  --pg-line: rgba(var(--color-foreground, 18, 18, 18), 0.18);
  --pg-line-strong: rgba(var(--color-foreground, 18, 18, 18), 0.35);
  --pg-surface: rgb(var(--color-background, 255, 255, 255));
  --pg-surface-hover: rgba(var(--color-foreground, 18, 18, 18), 0.06);
  --pg-active-bg: rgb(var(--color-button, 18, 18, 18));
  --pg-active-text: rgb(var(--color-button-text, 255, 255, 255));
  --pg-disabled: rgba(var(--color-foreground, 18, 18, 18), 0.3);

  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 40px 0 24px;
  font-family: var(--font-body-family, "DM Sans", sans-serif);
  font-size: 14px;
  letter-spacing: 0.6px;
  color: var(--pg-text);
  box-sizing: border-box;
}

.pg *,
.pg *::before,
.pg *::after { box-sizing: border-box; }

/* 只有一页 / 销毁时隐藏 */
.pg--empty { display: none !important; }

/* ---------- 总数文案 ---------- */
.pg__total {
  color: var(--pg-text-muted);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- 页码列表 ---------- */
.pg__list {
  display: flex;
  align-items: center;
  gap: var(--pg-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg__item { display: flex; }

/* ---------- 按钮 ---------- */
.pg__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--pg-item-min-w);
  height: var(--pg-item-h);
  padding: 0 8px;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--pg-surface);
  color: var(--pg-text);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, color .18s ease,
              border-color .18s ease, transform .12s ease;
}

@media (hover: hover) {
  .pg__btn:not(:disabled):not(.is-active):hover {
    background: var(--pg-surface-hover);
    border-color: var(--pg-line-strong);
  }
}

.pg__btn:not(:disabled):active { transform: scale(0.96); }

.pg__btn:focus { outline: none; }
.pg__btn:focus-visible {
  outline: 2px solid var(--pg-active-bg);
  outline-offset: 2px;
}

/* 当前页 */
.pg__btn.is-active {
  background: var(--pg-active-bg);
  border-color: var(--pg-active-bg);
  color: var(--pg-active-text);
  font-weight: 700;
  cursor: default;
}

/* 禁用态 */
.pg__btn:disabled {
  color: var(--pg-disabled);
  border-color: var(--pg-line);
  background: var(--pg-surface);
  cursor: not-allowed;
}

/* 上一页 / 下一页图标 */
.pg__btn--prev svg,
.pg__btn--next svg { display: block; }

/* ---------- 省略号 ---------- */
.pg__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: var(--pg-item-h);
  color: var(--pg-text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  user-select: none;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 749px) {
  .pg {
    flex-direction: column-reverse;   /* 按钮在上，总数在下 */
    align-items: center;
    gap: 10px;
    margin: 24px 0 16px;
  }
  .pg__list { gap: 4px; }
  .pg__total { font-size: 13px; text-align: center; }
  .pg__btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    font-size: 13px;
  }
  .pg__more { height: 32px; min-width: 18px; }
}
</style>