/* =========================================================
   分页控件（三端共用）
   —— 资讯流的「加载更多 / 到底了」页脚，和后台表格的页码条。
   前缀分开（pg- 流式、pbar 表格），避免和各自页面既有样式打架。
   ========================================================= */

/* ---------------- 流式分页页脚 ---------------- */

.pg-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 0 34px;
  min-height: 44px;
}

.pg-btn {
  appearance: none;
  border: 1px solid var(--border-strong, #e2e3e9);
  background: #fff;
  color: var(--text-2, #55565f);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.pg-btn:hover {
  border-color: var(--brand-line, #d7e6ff);
  background: var(--brand-soft, #eef4ff);
  color: var(--brand, #1f6feb);
}

.pg-btn:active { transform: translateY(1px); }

.pg-tip {
  font-size: 12px;
  color: var(--text-3, #9298a3);
  font-variant-numeric: tabular-nums;
}

.pg-end {
  font-size: 12px;
  color: var(--text-3, #9298a3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 「到底了」前面一条短线，读起来像个收尾而不是加载失败 */
.pg-end::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--border, #ebecf0);
}

.pg-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 16px;
  color: var(--text-3, #9298a3);
  font-size: 13px;
}

.pg-err {
  font-size: 12.5px;
  color: #c0392b;
  margin-bottom: 2px;
}

/* 转圈：纯 CSS，不引图标库 */
.pg-spin {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong, #e2e3e9);
  border-top-color: var(--brand, #1f6feb);
  border-radius: 50%;
  display: inline-block;
  animation: pg-rotate .7s linear infinite;
  vertical-align: -2px;
}

@keyframes pg-rotate { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pg-spin { animation-duration: 3s; }
}

/* ---------------- 后台表格页码条 ---------------- */

.pbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 2px;
}

.pbar-total {
  font-size: 12.5px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.pbar-total b { color: #111827; font-weight: 600; }

.pbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pbar-btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background .12s, border-color .12s, color .12s;
}

.pbar-btn:hover:not(:disabled) { background: #f3f4f6; border-color: #d1d5db; }

.pbar-btn:disabled { opacity: .45; cursor: not-allowed; }

.pbar-num.is-on {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
  font-weight: 600;
}

.pbar-num.is-on:hover { background: #1557bf; border-color: #1557bf; }

.pbar-gap { color: #9ca3af; padding: 0 2px; user-select: none; }

.pbar-size {
  font-size: 12.5px;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pbar-size select {
  appearance: none;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  height: 30px;
  padding: 0 8px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%239ca3af'/></svg>") no-repeat right 8px center;
  padding-right: 24px;
  font: inherit;
  font-size: 12.5px;
  color: #374151;
  cursor: pointer;
}

/* 手机上页码条收成两行：上一页/下一页 + 页码，避免横向溢出 */
@media (max-width: 640px) {
  .pbar { justify-content: center; padding: 10px 0; }
  .pbar-total { order: 3; width: 100%; text-align: center; }
  .pbar-size { order: 2; }
  .pbar-btn { min-width: 28px; height: 28px; padding: 0 7px; }
  .pbar-btn[data-go="1"], .pbar-btn:last-child { display: none; }
}

/* ---------------- 增量提示条 ----------------

   页面开着的时候后台又采到了新资讯，就在顶部挂一条。**不自动插入**：
   自动把新条目塞到顶部，正在读的人会被顶得找不到刚才那一行。
   点一下才换列表，主动权在读者手上。 */

.live-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--brand-line, #d7e6ff);
  border-radius: 999px;
  background: #fff;
  color: var(--brand, #1f6feb);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(16, 24, 40, .12);
  animation: live-in .22s ease-out;
}

.live-bar:hover { background: var(--brand-soft, #eef4ff); }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand, #1f6feb);
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .live-bar { animation: none; }
  .live-dot { animation: none; }
}
