/* ==========================================================================
   审核台样式（#/admin-shenhe）
   沿用 app.css 的暖色 CSS 变量与圆角语言，但信息密度按后台需要提高，
   并且是宽屏布局 —— 与用户端的 480px 手机壳完全分开（见 body.admin-mode）。
   ========================================================================== */

body.admin-mode {
  overscroll-behavior: none;
}

body.admin-mode #app {
  max-width: none;
  box-shadow: none;
}

/* ---------- 外壳 ---------- */
/* 注意：挂载时 app.js 会给根节点加 .page（flex-direction: column），
   这里显式声明 row 覆盖它 —— admin.css 在 app.css 之后加载。 */
.admin-shell {
  display: flex;
  flex-direction: row;
  height: 100%;
  background: var(--bg);
}

.admin-side {
  flex: none;
  width: 238px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--surface);
  border-right: 1px solid var(--divider);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
}

.admin-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--rose), var(--sage));
  color: var(--accent-pressed);
}

:root[data-theme='dark'] .admin-brand-mark {
  color: #1a1817;
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-brand-text b {
  font-size: 15px;
  font-weight: 600;
}

.admin-brand-text i {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--on-surface);
  transition: background 0.16s ease, color 0.16s ease;
}

.admin-nav-item:hover {
  background: var(--surface-variant);
}

.admin-nav-item.active {
  background: var(--accent);
  color: #fff;
}

.admin-side-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}

.admin-who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 10px;
}

.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--light-rose);
  color: var(--accent-pressed);
  font-size: 14px;
  font-weight: 600;
}

.admin-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

:root[data-theme='dark'] .admin-avatar {
  color: var(--on-surface);
}

.admin-who-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.admin-who-text b {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-who-text i {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.admin-foot-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}

.admin-foot-btn:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 26px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
}

.admin-page-title {
  font-size: 17px;
  font-weight: 600;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
}

.admin-link:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 26px 64px;
}

.adm-pane {
  max-width: 1280px;
}

/* ---------- 登录 ---------- */
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  background:
    radial-gradient(circle at 14% 18%, rgba(217, 191, 184, 0.5), transparent 46%),
    radial-gradient(circle at 84% 78%, rgba(220, 224, 212, 0.55), transparent 48%),
    linear-gradient(160deg, #f7f2ec 0%, #efe6de 100%);
}

:root[data-theme='dark'] .admin-login {
  background:
    radial-gradient(circle at 14% 18%, rgba(122, 94, 85, 0.4), transparent 46%),
    radial-gradient(circle at 84% 78%, rgba(59, 64, 56, 0.5), transparent 48%),
    linear-gradient(160deg, #171514 0%, #211d1b 100%);
}

.admin-login-card {
  width: 100%;
  max-width: 430px;
  padding: 38px 34px 30px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.admin-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--rose), var(--sage));
  color: var(--accent-pressed);
}

:root[data-theme='dark'] .admin-login-brand {
  color: #1a1817;
}

.admin-login-title {
  font-size: 21px;
  font-weight: 600;
  text-align: center;
}

.admin-login-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.admin-login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

.admin-error {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(192, 130, 110, 0.14);
  color: var(--warn);
  font-size: 13px;
}

.admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 70px 20px;
  color: var(--muted);
  font-size: 14px;
  height: 100%;
}

.adm-err-icon {
  color: var(--warn);
  display: flex;
}

/* ---------- 统计卡片 ---------- */
.adm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}

.adm-stat {
  position: relative;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.adm-stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--rose);
  display: flex;
}

.adm-stat-value {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.adm-stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.adm-stat-warn .adm-stat-value,
.adm-stat-warn .adm-stat-icon {
  color: var(--warn);
}

.adm-stat-gold .adm-stat-value,
.adm-stat-gold .adm-stat-icon {
  color: var(--gold);
}

.adm-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.adm-cards + .adm-section-title,
.adm-grid-2 {
  margin-top: 26px;
}

.adm-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.adm-block {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.adm-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adm-count {
  font-weight: 500;
  color: var(--muted);
}

/* ---------- 工具栏 ---------- */
.adm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.adm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 430px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}

.adm-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: none;
  color: var(--on-surface);
  font-size: 14px;
}

.adm-search input::placeholder {
  color: var(--field-placeholder);
}

.adm-select {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  outline: none;
}

.adm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--light-rose);
  color: var(--accent-pressed);
  font-size: 13px;
}

:root[data-theme='dark'] .adm-filter-chip {
  color: var(--on-surface);
}

/* ---------- 表格 ---------- */
.adm-table-wrap {
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.adm-table th {
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  letter-spacing: 0.03em;
  background: var(--surface-variant);
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

.adm-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

.adm-table tbody tr:last-child td {
  border-bottom: none;
}

.adm-table-sm td,
.adm-table-sm th {
  padding: 9px 12px;
  font-size: 13px;
}

.adm-table .adm-empty-row td {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

.adm-row-clickable {
  cursor: pointer;
}

.adm-row-clickable:hover {
  background: var(--surface-variant);
}

.adm-nowrap {
  white-space: nowrap;
}

.adm-actions-cell {
  text-align: right;
}

.adm-actions-cell .btn + .btn {
  margin-left: 8px;
}

.adm-muted {
  color: var(--muted);
}

.adm-gold {
  color: var(--gold);
}

.adm-danger-text {
  color: var(--warn);
}

.adm-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.adm-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.adm-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adm-user-name b {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.adm-user-name i {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.adm-content-cell {
  max-width: 520px;
}

.adm-content-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  word-break: break-word;
}

.adm-detail {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.adm-link-btn {
  color: var(--accent);
  font-size: 14px;
  padding: 0;
  text-decoration: none;
}

.adm-link-btn:hover {
  text-decoration: underline;
}

/* ---------- 徽章 ---------- */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-variant);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.adm-badge-ok {
  background: rgba(107, 155, 126, 0.16);
  color: var(--success);
}

.adm-badge-danger {
  background: rgba(192, 130, 110, 0.18);
  color: var(--warn);
}

.adm-badge-info {
  background: rgba(196, 164, 139, 0.24);
  color: var(--accent);
}

:root[data-theme='dark'] .adm-badge-info {
  color: var(--gold);
}

/* ---------- 分页 ---------- */
.adm-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 16px;
  flex-wrap: wrap;
}

.adm-pager-info {
  font-size: 13px;
  color: var(--muted);
}

.adm-pager-btns {
  display: flex;
  gap: 8px;
}

/* ---------- 表单 ---------- */
.adm-form-row {
  margin-bottom: 18px;
}

.adm-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.adm-form-label i {
  font-style: normal;
  font-size: 12px;
}

.adm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adm-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 13px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.adm-chip:hover {
  border-color: var(--accent);
}

.adm-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.adm-textarea,
.adm-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.adm-textarea:focus,
.adm-input:focus {
  border-color: var(--accent);
}

.adm-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.adm-tip {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 右侧面板 ---------- */
.adm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.adm-overlay.in {
  opacity: 1;
}

.adm-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(28px);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}

.adm-overlay.in .adm-panel {
  transform: none;
}

.adm-panel-wide {
  width: min(780px, 100%);
}

.adm-panel-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
}

.adm-panel-titles {
  min-width: 0;
}

.adm-panel-title {
  font-size: 16px;
  font-weight: 600;
}

.adm-panel-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.adm-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 48px;
}

.adm-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- 详情 ---------- */
.adm-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.adm-detail-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 17px;
  font-weight: 600;
}

.adm-detail-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.adm-ban-banner {
  display: flex;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: rgba(192, 130, 110, 0.14);
  color: var(--warn);
  font-size: 13px;
}

.adm-ban-banner div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adm-ban-banner span {
  color: var(--muted);
  font-size: 12px;
}

.adm-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.adm-kv > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.adm-kv span {
  font-size: 12px;
  color: var(--muted);
}

.adm-kv b {
  font-weight: 500;
  font-size: 14px;
  word-break: break-word;
}

.adm-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}

.adm-detail-section {
  margin-top: 24px;
}

.adm-empty-text {
  font-size: 13px;
}

.adm-content-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adm-content-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
}

.adm-content-body {
  flex: 1;
  min-width: 0;
}

.adm-content-body p {
  margin: 0 0 4px;
  font-size: 14px;
  word-break: break-word;
}

.adm-content-body span {
  font-size: 12px;
}

.adm-content-body details {
  margin-top: 6px;
}

.adm-content-body summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
}

.adm-script {
  margin: 8px 0 0;
  padding: 12px 14px;
  max-height: 300px;
  overflow: auto;
  border-radius: 12px;
  background: var(--surface-variant);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.adm-script-full {
  max-height: none;
}

.adm-meta-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.adm-simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-simple-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.adm-simple-list li span:last-child {
  margin-left: auto;
  font-size: 12px;
}

/* ---------- 危险确认 ---------- */
.adm-danger-box p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
}

.adm-confirm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.adm-confirm-field b {
  color: var(--warn);
}

.adm-confirm-field input {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 15px;
  outline: none;
}

.adm-confirm-field input:focus {
  border-color: var(--warn);
}

.shake {
  animation: adm-shake 0.36s ease;
}

@keyframes adm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

/* ---------- 顶部类型切换（内容审核） ---------- */
.adm-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--surface-variant);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.adm-tab {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.adm-tab.active {
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: var(--shadow-sm);
}

/* ---------- 窄屏：侧栏变顶部导航 ---------- */
@media (max-width: 880px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-side {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }

  .admin-brand {
    padding: 0 6px 0 0;
  }

  .admin-brand-text {
    display: none;
  }

  .admin-nav {
    flex-direction: row;
    flex: 1;
    gap: 6px;
  }

  .admin-nav-item {
    padding: 9px 14px;
    white-space: nowrap;
  }

  .admin-side-foot {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding-top: 0;
    border-top: none;
  }

  .admin-who {
    display: none;
  }

  .admin-topbar {
    height: 54px;
    padding: 0 16px;
  }

  .admin-body {
    padding: 16px 14px 56px;
  }

  .adm-grid-2 {
    grid-template-columns: 1fr;
  }

  .adm-table-wrap {
    overflow-x: auto;
  }

  .adm-table {
    min-width: 620px;
  }

  .adm-panel,
  .adm-panel-wide {
    width: 100%;
  }
}
