/* AI池子全站唯一分页标准：桌面 34×34，移动端顶部 30×30。 */
:root {
  --aichizi-page-size: 34px;
  --aichizi-page-size-mobile-top: 30px;
  --aichizi-page-gap: 6px;
  --aichizi-page-radius: 9px;
  --aichizi-page-border: #dce1e9;
  --aichizi-page-text: #5e6879;
  --aichizi-page-active: #4c83f3;
}

.aichizi-page-heading,
.channel-group-heading.has-channel-pager {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center !important;
  gap: 14px !important;
}

.aichizi-pagination,
.channel-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--aichizi-page-gap) !important;
  min-width: 0;
}

.aichizi-pagination--top,
.channel-pager-top {
  justify-self: end;
  justify-content: flex-end;
  min-height: var(--aichizi-page-size) !important;
  height: var(--aichizi-page-size) !important;
  margin: 0 0 0 auto !important;
  flex-wrap: nowrap !important;
}

.aichizi-pagination--bottom,
.channel-pager:not(.channel-pager-top) {
  min-height: 0 !important;
  margin: 28px 0 8px !important;
  flex-wrap: wrap;
}

.aichizi-page-button,
.channel-page-button {
  display: inline-grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  min-width: var(--aichizi-page-size) !important;
  width: var(--aichizi-page-size) !important;
  height: var(--aichizi-page-size) !important;
  padding: 0 !important;
  border: 1px solid var(--aichizi-page-border) !important;
  border-radius: var(--aichizi-page-radius) !important;
  background: #fff !important;
  color: var(--aichizi-page-text) !important;
  font: 500 12px/1 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.aichizi-page-button:hover:not(:disabled):not(.active),
.channel-page-button:hover:not(:disabled):not(.active) {
  border-color: #a9c9ff !important;
  color: #3977dd !important;
  transform: translateY(-1px);
}

.aichizi-page-button.active,
.channel-page-button.active {
  border-color: var(--aichizi-page-active) !important;
  background: var(--aichizi-page-active) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

.aichizi-page-button:disabled,
.channel-page-button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.aichizi-page-ellipsis,
.channel-page-ellipsis {
  width: 22px !important;
  color: #9aa3b3;
  text-align: center;
  font-size: 12px;
}

.aichizi-page-fraction,
.channel-page-fraction {
  display: none;
  min-width: 56px;
  color: #657084;
  text-align: center;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.aichizi-page-summary,
.channel-page-summary {
  flex-basis: 100%;
  margin-top: 3px;
  color: #929cab;
  text-align: center;
  font-size: 11px;
}

.dark .aichizi-page-button,
.dark .channel-page-button,
.channel-dark .aichizi-page-button,
.channel-dark .channel-page-button {
  border-color: #414153 !important;
  background: #252535 !important;
  color: #c2c4d4 !important;
}

.dark .aichizi-page-button.active,
.dark .channel-page-button.active,
.channel-dark .aichizi-page-button.active,
.channel-dark .channel-page-button.active {
  border-color: #6c5ce7 !important;
  background: #6c5ce7 !important;
  color: #fff !important;
}

.dark .aichizi-page-fraction,
.dark .channel-page-fraction,
.channel-dark .aichizi-page-fraction,
.channel-dark .channel-page-fraction { color: #c2c4d4; }

@media (max-width: 700px) {
  .aichizi-page-heading,
  .channel-group-heading.has-channel-pager {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 8px !important;
  }

  .aichizi-pagination--top,
  .channel-pager-top {
    min-height: var(--aichizi-page-size-mobile-top) !important;
    height: var(--aichizi-page-size-mobile-top) !important;
    gap: 4px !important;
  }

  .aichizi-pagination--top .aichizi-page-number,
  .aichizi-pagination--top .aichizi-page-ellipsis,
  .channel-pager-top .channel-page-button:not(:first-child):not(:last-of-type),
  .channel-pager-top .channel-page-ellipsis { display: none !important; }

  .aichizi-pagination--top .aichizi-page-fraction,
  .channel-pager-top .channel-page-fraction { display: inline-grid; place-items: center; }

  .aichizi-pagination--top .aichizi-page-button,
  .channel-pager-top .channel-page-button {
    min-width: var(--aichizi-page-size-mobile-top) !important;
    width: var(--aichizi-page-size-mobile-top) !important;
    height: var(--aichizi-page-size-mobile-top) !important;
    padding: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aichizi-page-button,
  .channel-page-button { transition: none; }
}
