/* 后台管理样式 - 统一样式文件 */

/* ========== 基础变量 ========== */
:root {
  --primary-color: #3498db;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --border-color: #dee2e6;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

/* ========== 基础重置 ========== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* ========== 布局 ========== */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 120px;
  background: var(--dark-color);
  color: white;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.admin-brand {
  font-size: 24px;
  font-weight: bold;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.admin-sidebar .menu {
  display: flex;
  flex-direction: column;
}

.admin-sidebar .menu a {
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.admin-sidebar .menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.admin-sidebar .menu a.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: var(--primary-color);
}

.admin-main {
  flex: 1;
  margin-left: 110px;
  padding: 30px;
  min-height: 100vh;
}

.admin-main h2 {
  margin: 0 0 20px 0;
  font-size: 28px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ========== 统计卡片 ========== */
.stats-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: 8px;
  min-width: 120px;
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 统计卡片颜色变体 */
.stat-card.pending {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.stat-card.pending .stat-value {
  color: #856404;
}

.stat-card.pending .stat-label {
  color: #856404;
}

.stat-card.approved {
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.stat-card.approved .stat-value {
  color: #155724;
}

.stat-card.approved .stat-label {
  color: #155724;
}

.stat-card.rejected {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

.stat-card.rejected .stat-value {
  color: #721c24;
}

.stat-card.rejected .stat-label {
  color: #721c24;
}

/* ========== 表格 ========== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

.table {
  width: 100%;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
}

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

.table th {
  background: var(--light-color);
  font-weight: 600;
  color: var(--text-primary);
}

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

.table tr:hover {
  background: var(--light-color);
}

/* ========== 按钮 ========== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  text-align: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2980b9;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
}

.btn-warning {
  background: var(--warning-color);
  color: #212529;
}

.btn-warning:hover:not(:disabled) {
  background: #e0a800;
}

.btn-outline {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--light-color);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== 表单 ========== */
.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ========== 徽章 ========== */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-danger {
  background: var(--danger-color);
  color: white;
}

.badge-warning {
  background: var(--warning-color);
  color: #212529;
}

.badge-secondary {
  background: #6c757d;
  color: white;
}

/* ========== 状态标签 ========== */
.status-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.pending {
  background: var(--warning-color);
}

.status-dot.approved {
  background: var(--success-color);
}

.status-dot.rejected {
  background: var(--danger-color);
}

/* ========== 照片列表 ========== */
.photo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.photo-thumbnail {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.photo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-primary);
}

.photo-meta-item strong {
  font-weight: 600;
}

.photo-meta-item span {
  color: var(--text-secondary);
}

/* ========== 工具类 ========== */
.d-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

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

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

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
}

/* ========== 分页样式 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-primary);
}

.pagination a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination .current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  cursor: default;
  font-weight: 600;
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .prev,
.pagination .next {
  font-weight: 600;
  padding: 0 16px;
}

.pagination .prev::before {
  content: "← ";
}

.pagination .next::after {
  content: " →";
}

.pagination .ellipsis {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}

/* 分页信息 */
.pagination-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.pagination-info .total-count {
  font-weight: 600;
  color: var(--primary-color);
}

/* 响应式分页 */
@media (max-width: 768px) {
  .pagination {
    gap: 4px;
    padding: 12px;
  }
  
  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
  
  .pagination .prev,
  .pagination .next {
    padding: 0 12px;
  }
  
  /* 在小屏幕上隐藏部分页码 */
  .pagination a:not(.prev):not(.next):not(.current):nth-child(n+6) {
    display: none;
  }
}

/* ========== 用户ID链接样式 ========== */
.user-id-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: inline-block;
}

.user-id-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

/* ========== 用户照片网格样式 ========== */
.user-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.user-photo-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-photo-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.user-photo-wrapper:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.user-photo-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-status-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.user-photo-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .user-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .user-photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* ========== 表单分组样式优化 ========== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-header .sub {
  font-size: 13px;
  color: var(--text-muted);
}

.mt-3 {
  margin-top: 24px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.col {
  padding: 0 8px;
  margin-bottom: 16px;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-sm-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-sm-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

@media (max-width: 768px) {
  .col-sm-6,
  .col-sm-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
