/* ========================================
   管理员后台样式 - 柔和轻拟物
   ======================================== */

:root {
  --admin-bg: #f7f3ee;
  --admin-surface: rgba(255, 255, 255, 0.78);
  --admin-surface-strong: #ffffff;
  --admin-line: rgba(175, 151, 138, 0.18);
  --admin-line-strong: rgba(175, 151, 138, 0.28);
  --admin-text: #4a3e39;
  --admin-text-soft: #7d6e67;
  --admin-primary: #cf7f93;
  --admin-primary-soft: #f6dbe2;
  --admin-mint: #dff0e8;
  --admin-gold: #f3e1bb;
  --admin-danger: #f7d4d8;
  --admin-shadow: 0 18px 36px rgba(190, 169, 158, 0.12);
  --admin-shadow-soft: 0 10px 24px rgba(190, 169, 158, 0.08);
  --admin-radius: 26px;
  --admin-radius-sm: 18px;
}

/* 后台布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(246, 219, 226, 0.78), transparent 24%),
    radial-gradient(circle at top right, rgba(223, 240, 232, 0.68), transparent 20%),
    linear-gradient(180deg, #faf7f2 0%, var(--admin-bg) 100%);
}

/* 移动端顶部栏 */
.admin-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--admin-line);
  backdrop-filter: blur(16px);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 16px;
  color: var(--admin-text);
}

.mobile-menu-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* 侧边栏 */
.admin-sidebar {
  width: 240px;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  backdrop-filter: blur(18px);
  box-shadow: 14px 0 32px rgba(188, 170, 160, 0.08);
}

.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 28px;
  font-size: 17px;
  font-weight: 700;
  color: var(--admin-text);
  border-bottom: 1px solid var(--admin-line);
  padding-bottom: 20px;
}

.admin-sidebar-logo span:first-child {
  font-size: 26px;
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--admin-text-soft);
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.admin-menu-item:hover {
  background: rgba(255, 255, 255, 0.62);
  color: var(--admin-text);
}

.admin-menu-item.active {
  background: linear-gradient(145deg, rgba(246, 219, 226, 0.9), rgba(255, 255, 255, 0.92));
  color: var(--admin-primary);
  font-weight: 600;
  box-shadow: var(--admin-shadow-soft);
}

.admin-menu-item .menu-icon-emoji {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.admin-sidebar-footer {
  border-top: 1px solid var(--admin-line);
  padding-top: 12px;
  margin-top: 12px;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* 主内容 */
.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 28px 32px;
  min-width: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--admin-text);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--admin-text-soft);
  flex-wrap: wrap;
}

/* 搜索框 */
.admin-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-shadow: var(--admin-shadow-soft);
}

.admin-search-box:focus-within {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 4px rgba(246, 219, 226, 0.75);
}

.admin-search-box .search-icon {
  color: #9CA3AF;
  font-size: 14px;
}

.admin-search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 180px;
  background: transparent;
}

/* 筛选栏 */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--admin-surface);
  border-radius: var(--admin-radius);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--admin-shadow);
  backdrop-filter: blur(14px);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d79ba9, #cf7f93);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  box-shadow: 0 22px 38px rgba(190, 169, 158, 0.16);
  transform: translateY(-1px);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stat-card-icon {
  font-size: 28px;
}

.stat-card-change {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.stat-card-change.up {
  background: var(--admin-mint);
  color: #487b66;
}

.stat-card-change.down {
  background: var(--admin-danger);
  color: #9d5161;
}

.stat-card-value {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

.stat-card-label {
  font-size: 13px;
  color: #6B7280;
  margin-top: 4px;
}

/* 快捷操作 */
.admin-quick-actions {
  background: white;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  padding: 24px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.quick-action-btn span:first-child {
  font-size: 28px;
}

.quick-action-btn:hover {
  background: #FDF2F8;
  border-color: #F9A8D4;
  color: #DB2777;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.1);
}

/* 表格 */
.admin-table-card {
  background: white;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
}

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #E5E7EB;
}

.admin-table-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 18px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #FAFAFA;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* 操作按钮 */
.action-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 4px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-btn-primary {
  background: #FDF2F8;
  color: #DB2777;
}

.action-btn-primary:hover {
  background: #EC4899;
  color: white;
}

.action-btn-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.action-btn-danger:hover {
  background: #EF4444;
  color: white;
}

.action-btn-warning {
  background: #FEF3C7;
  color: #92400E;
}

.action-btn-warning:hover {
  background: #F59E0B;
  color: white;
}

.action-btn-success {
  background: #ECFDF5;
  color: #065F46;
}

.action-btn-success:hover {
  background: #10B981;
  color: white;
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-active {
  background: #ECFDF5;
  color: #065F46;
}

.status-expired {
  background: #F3F4F6;
  color: #6B7280;
}

.status-pending {
  background: #FEF3C7;
  color: #92400E;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-pink {
  background: #FDF2F8;
  color: #DB2777;
}

.tag-orange {
  background: #FFF7ED;
  color: #C2410C;
}

.tag-green {
  background: #ECFDF5;
  color: #065F46;
}

.tag-purple {
  background: #EDE9FE;
  color: #6D28D9;
}

/* 举报卡片 */
.report-card {
  background: white;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}

.report-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.report-info {
  flex: 1;
  min-width: 0;
}

.report-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1F2937;
}

.report-info p {
  font-size: 13px;
  color: #6B7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 邀请码卡片 */
.invite-code-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.invite-code-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.invite-code-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 3px;
  color: #DB2777;
  white-space: nowrap;
}

.invite-code-meta {
  flex: 1;
  min-width: 0;
}

.invite-code-meta h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  color: #1F2937;
}

.invite-code-meta p {
  font-size: 13px;
  color: #6B7280;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: #F3F4F6;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F472B6, #EC4899);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 空状态 */
.admin-empty {
  text-align: center;
  padding: 60px 24px;
  color: #9CA3AF;
}

.admin-empty .empty-icon {
  font-size: 52px;
  margin-bottom: 14px;
}

.admin-empty .empty-title {
  font-size: 16px;
  font-weight: 500;
  color: #6B7280;
}

/* 分页 */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #F3F4F6;
}

.pagination-info {
  font-size: 13px;
  color: #6B7280;
}

.pagination-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: all 0.15s;
}

.pagination-btn:hover {
  background: #FDF2F8;
  border-color: #F9A8D4;
}

.pagination-btn.active {
  background: #EC4899;
  color: white;
  border-color: #EC4899;
}

.pagination-dots {
  padding: 6px 8px;
  color: #9CA3AF;
  font-size: 13px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #EC4899;
  color: white;
}

.btn-primary:hover {
  background: #DB2777;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #E5E7EB;
}

.btn-outline:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: adminFadeIn 0.2s ease;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  animation: adminSlideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: #F3F4F6;
  cursor: pointer;
  font-size: 18px;
  color: #6B7280;
  transition: all 0.15s;
}

.modal-close:hover {
  background: #E5E7EB;
  color: #1F2937;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 动画 */
@keyframes adminFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes adminSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 响应式 */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.mobile-open {
    transform: translateX(0);
  }

  .admin-sidebar-overlay.show {
    display: block;
  }

  .admin-mobile-header {
    display: flex;
  }

  .admin-main {
    margin-left: 0;
    padding-top: 72px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .admin-main {
    padding: 68px 14px 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 24px;
  }

  .quick-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-table {
    font-size: 13px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-header-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-search-box input {
    width: 120px;
  }

  .invite-code-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .report-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }
}
