/* 智游寰宇 - 后台管理系统样式 */
:root {
  --primary: #10B981;
  --primary-dark: #059669;
  --primary-light: #D1FAE5;
  --bg: #F0FDF4;
  --white: #FFFFFF;
  --text: #1F2937;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --red: #EF4444;
  --orange: #F59E0B;
  --blue: #3B82F6;
  --purple: #8B5CF6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: bold;
}
.sidebar-logo h2 { font-size: 18px; color: var(--text); }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  padding: 12px 24px 6px;
  font-size: 11px; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 24px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg); color: var(--primary); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }

/* ===== 顶部栏 ===== */
.topbar {
  position: fixed;
  left: var(--sidebar-w); right: 0; top: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 99;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 14px; }
.topbar-user .user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.btn-logout {
  background: none; border: 1px solid var(--border);
  color: var(--text-light); padding: 6px 14px;
  border-radius: 6px; cursor: pointer;
  font-size: 13px; transition: all 0.2s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* ===== 主内容区 ===== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-icon.green { background: #D1FAE5; color: #10B981; }
.stat-icon.blue { background: #DBEAFE; color: #3B82F6; }
.stat-icon.orange { background: #FEF3C7; color: #F59E0B; }
.stat-icon.purple { background: #EDE9FE; color: #8B5CF6; }
.stat-icon.red { background: #FEE2E2; color: #EF4444; }
.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-info p { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ===== 卡片容器 ===== */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px 24px; }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  background: #F9FAFB;
  color: var(--text-light);
  font-weight: 500; font-size: 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td { background: #F9FAFB; }
.data-table .cell-img {
  width: 60px; height: 40px; border-radius: 6px;
  object-fit: cover;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-green { background: #D1FAE5; color: #065F46; }
.tag-blue { background: #DBEAFE; color: #1E40AF; }
.tag-orange { background: #FEF3C7; color: #92400E; }
.tag-red { background: #FEE2E2; color: #991B1B; }
.tag-gray { background: #F3F4F6; color: #374151; }
.tag-purple { background: #EDE9FE; color: #5B21B6; }

/* ===== 搜索/筛选栏 ===== */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
  width: 240px; outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
  outline: none; background: var(--white);
  cursor: pointer;
  color: var(--text);
}
.filter-select:focus { border-color: var(--primary); }
.btn {
  padding: 8px 18px;
  border-radius: 8px; font-size: 14px;
  cursor: pointer; border: none;
  transition: all 0.2s;
  font-weight: 500;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: var(--white); color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }

/* ===== 分页 ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 16px;
}
.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px; background: var(--white);
  cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--text-light); }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 90%; max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text-light);
}
.modal-body { padding: 24px; }
.detail-row {
  display: flex; margin-bottom: 14px;
}
.detail-label {
  width: 100px; flex-shrink: 0;
  color: var(--text-light); font-size: 14px;
}
.detail-value { font-size: 14px; color: var(--text); flex: 1; word-break: break-all; }

/* ===== 加载与空状态 ===== */
.loading {
  text-align: center; padding: 40px;
  color: var(--text-light); font-size: 14px;
}
.empty {
  text-align: center; padding: 40px;
  color: var(--text-light); font-size: 14px;
}

/* ===== 登录页面 ===== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 50%, #6EE7B7 100%);
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}
.login-card .login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-card .login-logo .logo-icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: bold;
  margin-bottom: 12px;
}
.login-card .login-logo h1 { font-size: 22px; color: var(--text); }
.login-card .login-logo p { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px;
  color: var(--text); margin-bottom: 6px;
  font-weight: 500;
}
.form-group input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }
.btn-login {
  width: 100%; padding: 13px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  margin-top: 8px;
}
.btn-login:hover { background: var(--primary-dark); }
.login-error {
  color: var(--red); font-size: 13px;
  text-align: center; margin-top: 12px;
  display: none;
}
.login-error.show { display: block; }

/* ===== 活动列表状态 ===== */
.list-grid {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 16px;
}
.list-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr 80px;
  align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px;
}
.list-header {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr 80px;
  align-items: center; gap: 12px;
  padding: 8px 16px;
  font-size: 12px; color: var(--text-light);
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo h2, .nav-item span, .nav-group-title { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-logo { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; }
  .topbar { left: 60px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
