/* 超级管理员后台样式（管理后台 /admin/） */
/* 配色沿用 site-ui.css 的 CSS 变量，保持全站统一观感。 */

.admin-wrap {
  padding-top: 28px;
  padding-bottom: 36px;
}

/* 未登录闸门 */
.admin-gate {
  max-width: 520px;
  margin: 40px auto;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}
.admin-gate h1 {
  margin: 0 0 10px;
  font-size: 22px;
}
.admin-gate .c-note {
  margin-bottom: 18px;
}

/* 标签页 */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}
.admin-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
}
.admin-tabs button:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.admin-tabs button.active {
  color: var(--brand-dark);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
/* 标签页上的数量徽标（如回收站待处理数） */
.tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 9px;
  background: var(--danger, #d6473c);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
}
.tab-badge[hidden] {
  display: none;
}

.admin-panel h1 {
  font-size: 20px;
  margin: 0 0 14px;
}

/* 操作状态条 */
.admin-status {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
  font-size: 14px;
}
.admin-status.is-bad {
  background: #fdeceb;
  color: var(--danger);
  border-color: #f3c4bf;
}

/* 概览统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.1;
}
.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* 工具条（筛选 / 搜索 / 分页） */
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-bar select,
.admin-bar input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
  color: inherit;
}
.admin-bar input {
  flex: 1 1 220px;
  min-width: 160px;
}
.admin-spacer {
  flex: 1 1 auto;
}

/* 分页 */
.c-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.c-pager span {
  padding: 0 4px;
}

/* 通用小字 */
.c-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* 数据表（博客 / 论坛 / 用户） */
.admin-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.admin-table .row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1.2fr 1fr 1.6fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.admin-table .row:last-child {
  border-bottom: 0;
}
.admin-table .row.head {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.admin-table .row .title {
  font-weight: 600;
  color: var(--ink, #1f2d3a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-table .row .ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.admin-table .row .ops .c-btn-ghost {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

/* 用户表列宽微调 */
#panel-users .admin-table .row {
  grid-template-columns: 1.6fr 1fr 0.8fr 0.9fr 1.2fr 0.9fr 1.6fr;
}

/* 多选列 + 批量操作栏 */
.admin-table .row .sel {
  display: flex;
  align-items: center;
}
.admin-table .row .sel input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand, #2b7de9);
  cursor: pointer;
}
.admin-table .row.head .sel {
  justify-content: flex-start;
}
/* 各列表首列增加勾选列，列数需与 head/row 的 span 数一致 */
#panel-blog .admin-table .row {
  grid-template-columns: 0.4fr 2.4fr 1fr 1.2fr 1fr 1.6fr;
}
#panel-forum .admin-table .row {
  grid-template-columns: 0.4fr 2.4fr 1fr 1.2fr 0.8fr 1.6fr;
}
#panel-users .admin-table .row {
  grid-template-columns: 0.4fr 1.6fr 1fr 0.8fr 0.9fr 1.2fr 0.9fr 1.6fr;
}
.batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--brand-soft, #eef4ff);
  border: 1px solid var(--brand-line, #cfe0ff);
  border-radius: 10px;
  position: sticky;
  top: 8px;
  z-index: 5;
}
.batch-bar .cnt {
  font-size: 14px;
  color: var(--brand-dark, #1457b0);
  font-weight: 600;
}
.batch-bar .cnt b {
  font-size: 16px;
}

/* 回收站：类型 / 标题 / 作者 / 删除时间 / 可恢复期限 / 操作 */
#panel-recycle .admin-table .row {
  grid-template-columns: 0.7fr 2.4fr 1.1fr 1.7fr 1fr 1.4fr;
}
.kind-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}
.kind-badge.k-blog {
  background: var(--brand-soft, #eef4ff);
  color: var(--brand-dark, #1457b0);
  border: 1px solid var(--brand-line, #cfe0ff);
}
.kind-badge.k-forum {
  background: #f2f7ec;
  color: #4a7c1f;
  border: 1px solid #d8e8c8;
}
/* 超过保留期：整行弱化，提示需清理 */
.admin-table .row.expired {
  background: #fbf7f7;
  color: var(--muted);
}
.admin-table .row.expired .title a {
  color: var(--muted);
}
/* 标题里的「查看」外链 */
.admin-table .row .title a {
  color: var(--brand-dark, #1457b0);
  text-decoration: none;
}
.admin-table .row .title a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .admin-table .row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-table .row.head {
    display: none;
  }
  .admin-table .row .title {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .admin-table .row .ops {
    justify-content: flex-start;
  }
  #panel-blog .admin-table .row,
  #panel-forum .admin-table .row,
  #panel-users .admin-table .row,
  #panel-recycle .admin-table .row {
    grid-template-columns: 1fr 1fr;
  }
}
