/* ============================================================
   协会网 SaaS 后台管理系统样式
   ============================================================ */

.admin-body {
  background: #F4F6FA; color: #1A1A1A; font-size: 14px;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #9E1B21 0%, #5A0F14 100%);
  position: relative; overflow: hidden; padding: 20px;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(201,169,97,0.18) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
}
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 420px;
  background: #fff; border-radius: 16px; padding: 44px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 14px;
  background: linear-gradient(135deg, #C8252C, #9E1B21);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 22px; font-weight: 800;
}
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: #888; font-size: 13px; margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form .form-input { padding: 12px 14px; }
.login-form .btn { width: 100%; padding: 12px; }
.login-foot { text-align: center; font-size: 12px; color: #999; margin-top: 22px; }

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

/* 侧边栏 */
.admin-sidebar {
  width: 230px; background: #1E1E2D; color: #A0A0B0; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .logo {
  padding: 20px 22px; border-bottom: 1px solid #2A2A3C;
  display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px;
}
.admin-sidebar .logo .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #C8252C, #9E1B21);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.admin-menu { flex: 1; padding: 12px 10px; overflow-y: auto; }
.admin-menu .menu-group-title { font-size: 11px; color: #5A5A6E; padding: 12px 12px 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #A0A0B0; font-size: 14px; margin-bottom: 2px; transition: all 0.2s;
}
.admin-menu a:hover { background: #2A2A3C; color: #fff; }
.admin-menu a.active { background: linear-gradient(135deg, #C8252C, #9E1B21); color: #fff; }
.admin-menu a .ico { width: 18px; text-align: center; font-size: 16px; }
.admin-menu a .badge {
  margin-left: auto; background: #C8252C; color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 10px; font-weight: 600;
}
.admin-sidebar .user-box {
  padding: 14px 18px; border-top: 1px solid #2A2A3C;
  display: flex; align-items: center; gap: 10px;
}
.admin-sidebar .user-box .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #C9A961, #B8860B); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.admin-sidebar .user-box .info { flex: 1; min-width: 0; }
.admin-sidebar .user-box .name { color: #fff; font-size: 13px; font-weight: 500; }
.admin-sidebar .user-box .role { color: #888; font-size: 11px; }
.admin-sidebar .user-box .logout { color: #888; cursor: pointer; font-size: 16px; }
.admin-sidebar .user-box .logout:hover { color: #fff; }

/* 主区域 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 60px; background: #fff; border-bottom: 1px solid #EAEAEA;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.admin-topbar .page-title { font-size: 17px; font-weight: 600; }
.admin-topbar .actions { display: flex; gap: 10px; align-items: center; }
.admin-topbar .sidebar-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.admin-content { padding: 24px; flex: 1; }

/* ===== 数据看板 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 20px; border: 1px solid #EAEAEA;
  display: flex; align-items: center; gap: 14px;
}
.stat-card .ico {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.stat-card .ico.red { background: linear-gradient(135deg, #C8252C, #9E1B21); }
.stat-card .ico.blue { background: linear-gradient(135deg, #1565C0, #0D47A1); }
.stat-card .ico.gold { background: linear-gradient(135deg, #B8860B, #8B6508); }
.stat-card .ico.green { background: linear-gradient(135deg, #2E7D32, #1B5E20); }
.stat-card .ico.purple { background: linear-gradient(135deg, #6A1B9A, #4A148C); }
.stat-card .info .label { font-size: 13px; color: #888; margin-bottom: 4px; }
.stat-card .info .num { font-size: 24px; font-weight: 700; color: #1A1A1A; }
.stat-card .info .delta { font-size: 12px; color: #16A34A; margin-top: 2px; }
.stat-card .info .delta.down { color: #DC2626; }

.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-card { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid #EAEAEA; }
.dash-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dash-card .head h3 { font-size: 15px; font-weight: 600; }
.dash-card .head a { font-size: 13px; color: #C8252C; }

/* 图表占位 */
.chart-placeholder {
  height: 240px; background: linear-gradient(180deg, #FAFAFA 0%, #F0F0F0 100%);
  border-radius: 8px; display: flex; align-items: flex-end; padding: 16px; gap: 8px;
}
.chart-placeholder .bar {
  flex: 1; background: linear-gradient(180deg, #C8252C, #9E1B21); border-radius: 4px 4px 0 0;
  opacity: 0.8;
}

/* ===== 通用面板 ===== */
.panel {
  background: #fff; border-radius: 10px; border: 1px solid #EAEAEA; margin-bottom: 16px;
}
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid #EAEAEA;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel-head h3 { font-size: 15px; font-weight: 600; }
.panel-head .tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 20px; }
.panel-body.no-pad { padding: 0; }

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 12px 16px; background: #FAFAFA; color: #666;
  font-weight: 600; font-size: 12px; border-bottom: 1px solid #EAEAEA; white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid #F0F0F0; color: #333; vertical-align: middle; }
.data-table tr:hover td { background: #FAFAFA; }
.data-table .row-logo {
  width: 32px; height: 32px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
  margin-right: 8px; vertical-align: middle;
}
.data-table .actions-cell { white-space: nowrap; }
.data-table .actions-cell a { color: #1565C0; margin-right: 12px; font-size: 13px; }
.data-table .actions-cell a.danger { color: #DC2626; }
.data-table .actions-cell a:hover { text-decoration: underline; }

/* 状态标签 */
.status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.status-active { background: #DCFCE7; color: #16A34A; }
.status-inactive { background: #FEE2E2; color: #DC2626; }
.status-pending { background: #FEF3C7; color: #D97706; }
.status-draft { background: #F3F4F6; color: #6B7280; }
.status-published { background: #DBEAFE; color: #2563EB; }
.status-new { background: #FEE2E2; color: #DC2626; }
.status-contacted { background: #FEF3C7; color: #D97706; }
-status-joined { background: #DCFCE7; color: #16A34A; }
.status-invalid { background: #F3F4F6; color: #9CA3AF; }
.status-open { background: #DBEAFE; color: #2563EB; }
.status-ended { background: #F3F4F6; color: #6B7280; }
.status-hidden { background: #F3F4F6; color: #6B7280; }

/* 主题色小圆点 */
.theme-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* ===== 搜索/筛选栏 ===== */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.filter-bar .form-input, .filter-bar .form-select {
  padding: 7px 10px; font-size: 13px; min-width: 130px;
}
.filter-bar .search-input { flex: 1; min-width: 200px; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 16px; }
.pagination a {
  padding: 6px 12px; border: 1px solid #EAEAEA; border-radius: 4px;
  font-size: 13px; color: #555;
}
.pagination a:hover { background: #FAFAFA; }
.pagination a.active { background: #C8252C; color: #fff; border-color: #C8252C; }

/* ===== 表单页（新增/编辑）===== */
.form-page { max-width: 880px; }
.form-page .form-section {
  background: #fff; border-radius: 10px; border: 1px solid #EAEAEA; margin-bottom: 16px;
}
.form-page .form-section .sec-head {
  padding: 14px 20px; border-bottom: 1px solid #EAEAEA; font-weight: 600; font-size: 14px;
  background: #FAFAFA; border-radius: 10px 10px 0 0;
}
.form-page .form-section .sec-body { padding: 22px 20px; }
.form-page .form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-page .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-page .form-actions {
  padding: 16px 0; display: flex; gap: 10px; justify-content: flex-end;
}
.form-page .btn-primary { background: linear-gradient(135deg, #C8252C, #9E1B21); }
.form-page .btn-outline { color: #666; border-color: #D0D0D0; }
.form-page .btn-outline:hover { background: #F0F0F0; color: #333; }

/* 主题色选择器 */
.theme-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.theme-option {
  border: 2px solid #EAEAEA; border-radius: 10px; padding: 14px 10px; cursor: pointer;
  text-align: center; transition: all 0.2s; background: #fff;
}
.theme-option:hover { border-color: #C8252C; }
.theme-option.selected { border-color: #C8252C; background: #FCEBEA; }
.theme-option .swatch { width: 100%; height: 36px; border-radius: 6px; margin-bottom: 8px; }
.theme-option .name { font-size: 12px; font-weight: 500; }

/* 图片上传 */
.upload-box {
  border: 2px dashed #D0D0D0; border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: #FAFAFA;
}
.upload-box:hover { border-color: #C8252C; background: #FCEBEA; }
.upload-box .ico { font-size: 30px; color: #B0B0B0; margin-bottom: 8px; }
.upload-box .txt { font-size: 13px; color: #666; }
.upload-box .hint { font-size: 12px; color: #999; margin-top: 4px; }
.upload-preview {
  display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.upload-preview .item {
  width: 100px; height: 100px; border-radius: 8px; background: #F0F0F0;
  background-size: cover; background-position: center; position: relative;
  border: 1px solid #EAEAEA;
}
.upload-preview .item .remove {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; font-size: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ===== 详情查看页 ===== */
.detail-list { display: grid; grid-template-columns: 130px 1fr; gap: 12px 20px; font-size: 14px; }
.detail-list dt { color: #888; }
.detail-list dd { color: #1A1A1A; }

/* ===== 移动端 ===== */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1000;
    transition: left 0.25s;
  }
  .admin-sidebar.open { left: 0; }
  .admin-topbar .sidebar-toggle { display: block; }
  .admin-content { padding: 16px; }
  .form-page .form-row-3, .form-page .form-row-2 { grid-template-columns: 1fr; }
  .theme-picker { grid-template-columns: repeat(2, 1fr); }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 8px; }
  .stat-grid { grid-template-columns: 1fr; }
}
