/**
 * 列表 / 搜索页：排序标签、分页、栅格辅助、cleafix
 * 与 st48-shoutu48.css 或门户其它皮肤配合使用。
 */

.cleafix::before,
.cleafix::after {
  content: "";
  display: table;
}

.cleafix::after {
  clear: both;
}

.text-center {
  text-align: center;
}

/* 排序标签（模板里 li 带 class="active"） */
.nj-sort-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  gap: 0.45rem;
}

.nj-sort-tabs li {
  margin: 0;
}

.nj-sort-tabs a {
  display: inline-block;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 26, 26, 0.12);
  color: #3d3d38;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.75);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nj-sort-tabs a:hover {
  border-color: rgba(232, 93, 4, 0.45);
  color: #c2410c;
  background: #fff;
}

.nj-sort-tabs li.active a {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

/* 分页区外层 */
.nj-pager {
  margin: 0.5rem 0 1.5rem;
}

.nj-pager--styled {
  padding: 0.25rem 0 0.5rem;
}

/* 帝国 / Stui 常见分页：ul.stui-page 内 li + a，或直接 a */
.stui-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
}

.stui-page li {
  display: inline-block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stui-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: #3d3d38;
  border-radius: 8px;
  border: 1px solid rgba(26, 26, 26, 0.1);
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stui-page a:hover {
  border-color: rgba(232, 93, 4, 0.4);
  color: #c2410c;
}

.stui-page li.active a,
.stui-page a.on,
.stui-page a.current {
  font-weight: 700;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35);
}

.stui-page li.disabled a,
.stui-page a.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* 部分模板用 strong 表示当前页 */
.stui-page strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
}

.nj-pager__meta-hint {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: #8a8a84;
}

/* 门户列表页若使用 nj-pager__meta 类名 */
.nj-pager__meta {
  margin: 1.1rem 0 0.65rem;
  font-size: 0.875rem;
  color: #5c5c56;
  text-align: center;
}

/* 栅格：无 st48 时也可单独用 */
.cq-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.85rem 0.65rem;
}

.cq-card-grid--dense {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.75rem 0.55rem;
}

@media (min-width: 640px) {
  .cq-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem 0.75rem;
  }

  .cq-card-grid--dense {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
