/* ==========================================================================
   楠凉好物 · 后台管理样式 admin.css
   与 style.css 一同加载，复用 :root 变量（--color-primary 等）。
   主题延续：天空蓝 + 浅粉。
   ========================================================================== */

/* ---------- 顶部栏：吸顶、白底 + 底部渐变线、两端对齐 ---------- */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.admin-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--gradient-primary);
}

.admin-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 主体容器 ---------- */
.admin-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ---------- 登录卡片：居中白卡 ---------- */
.admin-login-card {
  max-width: 380px;
  margin: 10vh auto 0;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 30px;
  animation: fadeInUp 0.4s ease both;
}

.admin-login-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--color-primary);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-login-sub {
  margin: 0 0 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
}

.admin-login-submit {
  width: 100%;
  margin-top: 4px;
}
/* ---------- 仪表盘布局：侧边标签 + 内容区 ---------- */
.admin-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* 侧边标签栏 */
.admin-tabs {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 84px;
}

.admin-tab {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: left;
  padding: 11px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.admin-tab:hover {
  color: var(--color-primary);
  background: rgba(76, 184, 232, 0.10);
}

.admin-tab.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(76, 184, 232, 0.30);
}

/* 内容区 */
.admin-panel {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 26px;
  min-height: 320px;
}

/* 区块标题行 */
.admin-section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.admin-count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-left: auto;
}

/* 筛选 pill（复用 .tab 外观，自带容器底色） */
.admin-filter {
  display: inline-flex;
  background: #efeff1;
  border-radius: 999px;
  padding: 3px;
}

.admin-filter .tab.is-active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow);
}

/* 空 / 错误状态 */
.admin-empty,
.admin-error {
  padding: 40px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.admin-error {
  color: var(--color-primary);
}
/* ---------- 数据表格 ---------- */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: none;
  white-space: nowrap;
  background: var(--gradient-soft);
}

.admin-table tbody tr {
  transition: background 0.12s ease;
}

.admin-table tbody tr:hover {
  background: rgba(76, 184, 232, 0.06);
}

.admin-cell-title {
  font-weight: 600;
  max-width: 320px;
}

.admin-excerpt {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.admin-cell-date {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 13px;
}

.admin-cell-num {
  white-space: nowrap;
  color: var(--color-text-muted);
}

.admin-cell-actions {
  white-space: nowrap;
}

.admin-cell-actions .btn {
  margin-right: 6px;
}

.admin-cell-actions .btn:last-child {
  margin-right: 0;
}

/* 等宽编号 */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
/* ---------- 小号操作按钮（表格 / 评论行内） ---------- */
.btn-xs {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
}

/* 通过：主色描边 → 填充 */
.btn-approve {
  background: rgba(76, 184, 232, 0.12);
  color: var(--color-primary-dark);
}

.btn-approve:hover {
  background: var(--color-primary);
  color: #fff;
}

/* 拒绝：中性灰，区别于删除的红 */
.btn-reject {
  background: #f0f1f3;
  color: #6b7280;
}

.btn-reject:hover {
  background: #e2e4e8;
  color: #3f4654;
}

/* 删除：危险红 */
.btn-del {
  background: #fdecec;
  color: #d9534f;
}

.btn-del:hover {
  background: #d9534f;
  color: #fff;
}

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.5;
}

.badge-approved {
  background: rgba(76, 184, 232, 0.14);
  color: var(--color-primary-dark);
}

.badge-pending {
  background: #fff4e0;
  color: #c8862a;
}

.badge-rejected {
  background: #fdecec;
  color: #d9534f;
}

/* ---------- 提示消息条（设置保存 / 操作反馈） ---------- */
.admin-msg {
  margin: 4px 0 0;
  padding: 10px 14px;
  font-size: 13.5px;
  border-radius: 10px;
}

.admin-msg.is-ok {
  background: rgba(76, 184, 232, 0.12);
  color: var(--color-primary-dark);
}

.admin-msg.is-error {
  background: #fdecec;
  color: #d9534f;
}

/* ---------- 评论管理：卡片式列表 ---------- */
.admin-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-comment {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
  transition: box-shadow 0.15s ease;
}

.admin-comment:hover {
  box-shadow: var(--shadow);
}

.admin-comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.admin-comment-author {
  font-weight: 700;
  color: var(--color-text);
}

.admin-comment-post {
  color: var(--color-text-muted);
}

.admin-comment-date {
  margin-left: auto;
  white-space: nowrap;
}

.admin-comment-text {
  margin: 8px 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  word-break: break-word;
}

.admin-comment-actions {
  text-align: right;
}

/* ---------- 系统设置表单 ---------- */
.admin-settings-form {
  max-width: 520px;
}

.admin-settings-form .form-field {
  margin-bottom: 18px;
}

/* 字段下方的灰色说明文字 */
.admin-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* 复选框字段：勾选框 + 文字横向对齐 */
.admin-check-field {
  background: var(--gradient-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.admin-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* 下拉框沿用 .text-input 外观，这里补上箭头留白 */
select.text-input {
  cursor: pointer;
}

/* ---------- 页脚 ---------- */
.admin-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- 响应式：窄屏下标签栏转为顶部横向滚动 ---------- */
@media (max-width: 760px) {
  .admin-layout {
    flex-direction: column;
    gap: 16px;
  }

  .admin-tabs {
    flex: 1 1 auto;
    flex-direction: row;
    width: 100%;
    position: static;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }

  .admin-tab {
    flex: 0 0 auto;
    text-align: center;
    padding: 9px 16px;
  }

  .admin-panel {
    padding: 18px 16px 20px;
  }

  .admin-comment-date {
    margin-left: 0;
  }
}

/* ---------- 可点击的标题单元格（打开帖子详情） ---------- */
.admin-cell-open {
  cursor: pointer;
  color: var(--color-text);
}

.admin-cell-open:hover {
  color: var(--color-primary-dark);
}

/* 用户名链接（跳个人主页） */
.admin-userlink {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.admin-userlink:hover {
  text-decoration: underline;
}

/* ---------- 帖子详情弹窗内的审核条与统计行 ---------- */
.admin-detail-statbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.admin-detail-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.detail-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--gradient-soft);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--color-text-muted);
}

.detail-stats-row .stat {
  white-space: nowrap;
}


/* ==========================================================================
   货币系统「猫草」后台样式 —— 精华控件、余额列、设置余额
   ========================================================================== */

/* 精华徽标（帖子列表 / 详情）：品牌渐变小药丸 */
.badge-essential {
  background: var(--gradient-primary);
  color: #fff;
}

/* 用户列表猫草余额单元格 */
.admin-cell-catnip {
  white-space: nowrap;
  font-weight: 700;
  color: var(--color-secondary-dark);
  font-variant-numeric: tabular-nums;
}

.admin-cell-catnip::before {
  content: "🌿 ";
  font-weight: 400;
}

/* 详情弹窗内的精华设置区块 */
.admin-essential-box {
  margin: 14px 0;
  padding: 14px 16px;
  background: var(--gradient-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.admin-essential-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-essential-row .admin-check {
  margin-right: auto;
}

.admin-essential-cost {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.admin-essential-cost input {
  width: 110px;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
}

.admin-essential-cost input:disabled {
  background: #f4f5f7;
  color: var(--color-text-muted);
}

/* 弹窗内余额管理对话（提示用） */
.admin-catnip-hint {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   分类/TAG 管理编辑器
   ========================================================================== */

/* 两列面板 */
.tax-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 760px) {
  .tax-panels {
    grid-template-columns: 1fr;
  }
}

.tax-panel {
  background: var(--gradient-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.tax-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
}

/* 分类树 */
.tax-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tax-tree .tax-tree {
  padding-left: 16px;
  margin-top: 4px;
}

.tax-tree-item {
  margin-bottom: 4px;
}

.tax-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.tax-item-name {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

/* TAG 列表 */
.tax-tag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tax-tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.tax-tag-name {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 管理员编辑帖子表单 ---------- */
.admin-edit-form {
  padding: 4px 0 8px;
}

.admin-edit-form .form-field {
  margin-bottom: 14px;
}

.admin-edit-stars {
  display: flex;
  gap: 4px;
  font-size: 24px;
  color: var(--color-border);
  cursor: pointer;
  user-select: none;
}

.admin-edit-stars .star.on {
  color: #f5a623;
}

.admin-edit-stars .star:hover,
.admin-edit-stars .star:focus {
  color: #f5a623;
  outline: none;
}

.btn-edit {
  background: #e8f4ff;
  color: #1a7fc1;
  border: 1px solid #b3d7f0;
}

.btn-edit:hover {
  background: #cce7fa;
}

/* ---------- 拒绝原因提示（弹窗状态栏内） ---------- */
.admin-reject-reason {
  font-size: 12px;
  color: #c0392b;
  background: #fff5f5;
  border: 1px solid #fcc;
  border-radius: 6px;
  padding: 3px 8px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

