* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  background: #0a1208; color: #f0f4f8; min-height: 100vh;
}
.hidden { display: none !important; }

/* ========== 登录 ========== */
.admin-login-screen {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(ellipse at center, #0f1f12 0%, #0a1208 100%);
  padding: 20px; position: relative;
}
.admin-login-screen::before {
  content: ''; position: fixed; inset: 0;
  background: url('/bg.jpg') center/cover; opacity: 0.08; pointer-events: none;
}
.admin-login-card {
  background: linear-gradient(145deg, #132018, #0d1810);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  text-align: center; position: relative; z-index: 1;
}
.admin-login-card h1 { font-size: 28px; margin-bottom: 4px; background: linear-gradient(135deg, #4ade80, #22c55e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.admin-login-sub { color: #64748b; font-size: 14px; margin-bottom: 28px; }
.admin-login-card .form-group { text-align: left; margin-bottom: 16px; }
.admin-login-card .form-group label { display: block; font-size: 13px; font-weight: 600; color: #94a3b8; margin-bottom: 6px; }
.admin-login-card .form-group input {
  width: 100%; padding: 10px 14px;
  background: #1a2332; border: 1px solid #2d3a4f;
  border-radius: 8px; font-size: 15px; color: #f0f4f8;
  outline: none; transition: border-color 0.2s;
}
.admin-login-card .form-group input:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.admin-btn-primary {
  width: 100%; padding: 12px; background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.admin-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,0.3); }
.admin-error { color: #ef4444; font-size: 13px; margin-top: 12px; min-height: 20px; }
.admin-back-link { display: block; margin-top: 16px; color: #64748b; font-size: 13px; text-decoration: none; }
.admin-back-link:hover { color: #4ade80; }

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

/* ========== 侧边栏 ========== */
.admin-sidebar {
  width: 220px; background: #0d1810; border-right: 1px solid rgba(74, 222, 128, 0.08);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.admin-sidebar-header { padding: 20px 16px; border-bottom: 1px solid rgba(74, 222, 128, 0.08); }
.admin-sidebar-header h2 { font-size: 18px; background: linear-gradient(135deg, #4ade80, #22c55e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.admin-nav { flex: 1; padding: 8px; }
.admin-nav-item {
  display: block; width: 100%; padding: 10px 14px; background: none; border: none;
  color: #64748b; font-size: 14px; text-align: left; cursor: pointer;
  border-radius: 8px; margin-bottom: 2px; transition: all 0.15s;
}
.admin-nav-item:hover { background: rgba(74, 222, 128, 0.06); color: #e2e8f0; }
.admin-nav-item.active { background: rgba(34,197,94,0.12); color: #4ade80; font-weight: 600; border-left: 3px solid #22c55e; }
.admin-sidebar-footer {
  padding: 12px 16px; border-top: 1px solid rgba(74, 222, 128, 0.08);
  font-size: 12px; display: flex; align-items: center; justify-content: space-between; color: #64748b;
}
.admin-btn-logout {
  padding: 4px 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.admin-btn-logout:hover { background: #ef4444; border-color: #ef4444; color: white; }

/* ========== 主内容 ========== */
.admin-main { flex: 1; padding: 24px; overflow-y: auto; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.admin-section-header h2 { font-size: 22px; font-weight: 700; color: #f0f4f8; }
.admin-btn-refresh {
  padding: 8px 16px; background: #1a2332; border: 1px solid #2d3a4f;
  color: #94a3b8; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.admin-btn-refresh:hover { border-color: #22c55e; color: #4ade80; }

/* ========== 指标卡片 ========== */
.admin-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: linear-gradient(145deg, #132018, #0d1810);
  border: 1px solid rgba(74, 222, 128, 0.1);
  border-radius: 12px; padding: 20px; transition: all 0.2s;
}
.metric-card:hover { border-color: rgba(74, 222, 128, 0.25); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.metric-value { font-size: 32px; font-weight: 800; color: #4ade80; }
.metric-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }

/* ========== 图表 & 活动 ========== */
.admin-chart-section, .admin-recent-activity {
  background: linear-gradient(145deg, #132018, #0d1810);
  border: 1px solid rgba(74, 222, 128, 0.1);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
}
.admin-chart-section h3, .admin-recent-activity h3 { font-size: 15px; margin-bottom: 16px; color: #94a3b8; }
.no-data { color: #475569; font-size: 14px; text-align: center; padding: 20px; }
.chart-container { min-height: 200px; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 10px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar {
  width: 100%; max-width: 24px;
  background: linear-gradient(to top, #16a34a, #4ade80);
  border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.4s ease;
}
.chart-bar:hover { opacity: 0.8; }
.chart-label { font-size: 8px; color: #475569; margin-top: 6px; white-space: nowrap; }

.activity-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid rgba(74, 222, 128, 0.06); font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-email { color: #e2e8f0; font-weight: 500; }
.activity-desc { color: #94a3b8; }
.activity-time { color: #475569; font-size: 12px; }

/* ========== 搜索框 ========== */
.admin-search-box input {
  padding: 8px 14px; background: #1a2332; border: 1px solid #2d3a4f;
  border-radius: 8px; font-size: 14px; color: #f0f4f8;
  width: 240px; outline: none;
}
.admin-search-box input:focus { border-color: #22c55e; }
.admin-search-box input::placeholder { color: #475569; }

/* ========== 表格 ========== */
.admin-table-wrap {
  background: linear-gradient(145deg, #132018, #0d1810);
  border: 1px solid rgba(74, 222, 128, 0.1);
  border-radius: 12px; overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: rgba(74, 222, 128, 0.04);
  padding: 12px 16px; text-align: left; font-size: 12px;
  font-weight: 700; color: #64748b; white-space: nowrap;
  border-bottom: 1px solid rgba(74, 222, 128, 0.08);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid rgba(74, 222, 128, 0.04); font-size: 14px; color: #cbd5e1; }
.admin-table tr:hover td { background: rgba(74, 222, 128, 0.03); }
.admin-table tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-verified { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-unverified { background: rgba(239,68,68,0.15); color: #fca5a5; }

.tx-type { font-weight: 600; font-size: 13px; }
.tx-register { color: #60a5fa; }
.tx-recharge { color: #4ade80; }
.tx-analysis { color: #f87171; }
.tx-refund { color: #fbbf24; }

.admin-btn-small {
  padding: 4px 10px; background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2); color: #4ade80;
  border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.admin-btn-small:hover { background: #22c55e; color: white; border-color: #22c55e; }
.admin-btn-small.danger:hover { background: #ef4444; border-color: #ef4444; color: white; }

/* ========== 分页 ========== */
.admin-pagination { margin-top: 16px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.page-btn {
  padding: 6px 12px; background: #1a2332; border: 1px solid #2d3a4f;
  color: #94a3b8; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.page-btn:hover { border-color: #22c55e; color: #4ade80; }
.page-btn.active { background: #22c55e; color: white; border-color: #22c55e; }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ========== 设置 ========== */
.admin-settings-form { max-width: 500px; }
.setting-item {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 16px 20px;
  background: linear-gradient(145deg, #132018, #0d1810);
  border: 1px solid rgba(74, 222, 128, 0.1);
  border-radius: 12px;
}
.setting-item label { width: 160px; font-weight: 600; font-size: 14px; color: #94a3b8; flex-shrink: 0; }
.setting-item input {
  width: 100px; padding: 8px 12px; background: #1a2332; border: 1px solid #2d3a4f;
  border-radius: 6px; font-size: 14px; color: #f0f4f8; text-align: center; outline: none;
}
.setting-item input:focus { border-color: #22c55e; }

/* ========== Toast ========== */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; padding: 12px 24px;
  border-radius: 8px; color: white; font-weight: 600; font-size: 14px;
  z-index: 9999; animation: slideIn 0.3s ease;
}
.admin-toast.success { background: #22c55e; }
.admin-toast.error { background: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .admin-panel { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-header { display: none; }
  .admin-nav { display: flex; padding: 4px; }
  .admin-nav-item { font-size: 12px; padding: 6px 10px; }
  .admin-sidebar-footer { width: 100%; }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .setting-item { flex-wrap: wrap; }
  .setting-item label { width: 100%; }
}
