* { box-sizing: border-box; }
:root {
  --brand-900:#0f2142;
  --brand-700:#1e3a6e;
  --brand-500:#3a6bc9;
  --bg:#f3f5fa;
  --card:#ffffff;
  --line:#e5e7eb;
  --text-900:#111827;
  --text-600:#4b5563;
}
html, body {
  margin:0;
  padding:0;
  font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;
  background:var(--bg);
  color:var(--text-900);
}
.auth-body { background: radial-gradient(circle at 20% 20%, #274a8f 0%, #162d5a 45%, #0f2142 100%); }
a { color:inherit; text-decoration:none; }

.admin-shell { display:grid; grid-template-columns:280px 1fr; min-height:100vh; }
.sidebar {
  background:linear-gradient(180deg,#0c1d3c,#0f2142 52%,#132c56);
  color:#e5ecfa;
  padding:22px 16px;
  display:flex;
  flex-direction:column;
}
.brand-wrap { margin-bottom:18px; }
.brand { font-size:22px; font-weight:700; margin-bottom:4px; }
.sidebar-meta { color:#c7d2fe; margin:0 0 6px; font-size:13px; }
.sidebar nav { display:grid; gap:8px; }
.sidebar nav a {
  display:block;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
}
.sidebar nav a:hover { background:rgba(255,255,255,.14); }
.sidebar nav a.disabled { opacity:.58; cursor:not-allowed; }
.sidebar-footer { margin-top:auto; padding-top:14px; border-top:1px solid rgba(255,255,255,.12); }

.main { padding:24px 28px; }
.topbar { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.topbar h1 { margin:0 0 6px; font-size:28px; letter-spacing:.2px; }
.topbar p { margin:0; color:var(--text-600); line-height:1.6; max-width:760px; }
.topbar-actions { display:flex; gap:10px; flex-wrap:wrap; }

.cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.card { background:var(--card); border-radius:14px; padding:18px; box-shadow:0 6px 20px rgba(15,23,42,.06); border:1px solid var(--line); }
.card h3 { margin:0 0 8px; }
.card p { margin:0; color:var(--text-600); line-height:1.6; }
.metric { margin-top:6px; font-size:30px; font-weight:700; color:var(--brand-900); }
.mt-16 { margin-top:16px; }

.metrics-5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.chart-grid { display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px; }
.chart-card.wide { grid-column:span 1; }
.chart-wrap { position:relative; width:100%; height:280px; margin-top:10px; }
.chart-wrap.small { height:220px; }

.funnel-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.funnel-item { background:#f8fafc; border:1px solid var(--line); border-radius:10px; padding:14px; }
.funnel-label { margin:0 0 6px; color:#374151; font-size:13px; }
.funnel-value { margin:0; font-size:28px; font-weight:700; color:var(--brand-900); }

.stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }

button, .btn-link {
  border:0;
  background:var(--brand-700);
  color:#fff;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
button.ghost { background:#111827; }
.btn-link.secondary { background:#374151; }
.inline-link { color:#1e3a8a; font-weight:600; }
.actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.text-btn { border:0; background:#eef2ff; color:#1e3a8a; border-radius:6px; padding:4px 8px; font-size:12px; cursor:pointer; }
.text-btn.danger { background:#fef2f2; color:#b91c1c; }

.alert { border-radius:10px; padding:10px 12px; margin-bottom:12px; font-size:14px; }
.alert.error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.alert.success { background:#ecfdf5; color:#166534; border:1px solid #a7f3d0; }

label { display:block; margin-bottom:6px; font-size:14px; color:#374151; font-weight:600; }
input, select, textarea {
  width:100%;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  margin-bottom:12px;
  background:#fff;
  font:inherit;
  transition:border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus {
  outline:none;
  border-color:var(--brand-500);
  box-shadow:0 0 0 3px rgba(58,107,201,.15);
}
.form-hint { margin:-6px 0 12px; color:#6b7280; font-size:13px; }

.filters {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  align-items:end;
}
.filters-actions { display:flex; gap:8px; align-items:center; }

.batch-toolbar { margin-bottom:14px; }
.batch-form .batch-row { display:flex; gap:16px; align-items:end; justify-content:space-between; flex-wrap:wrap; }
.batch-field { min-width:220px; }
.batch-actions { display:flex; gap:10px; align-items:center; }
.checkbox-col { width:44px; text-align:center !important; }

.login-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(94vw,420px); background:#fff; border-radius:16px; padding:28px; box-shadow:0 22px 48px rgba(8,15,36,.35); border:1px solid rgba(255,255,255,.35); }
.login-header { margin-bottom:12px; }
.login-card h1 { margin:0 0 8px; font-size:28px; color:var(--brand-900); letter-spacing:.2px; }
.hint { color:#4b5563; margin:0; line-height:1.5; }
.login-form label { display:block; margin-bottom:6px; font-size:14px; color:#374151; font-weight:600; }
.login-form input,.login-form select { width:100%; padding:11px 12px; border:1px solid #d1d5db; border-radius:10px; margin-bottom:12px; background:#fff; transition:border-color .18s ease, box-shadow .18s ease; }
.login-form input:focus,.login-form select:focus { outline:none; border-color:#3a6bc9; box-shadow:0 0 0 3px rgba(58,107,201,.16); }
.captcha-row { display:flex; gap:10px; align-items:stretch; margin-bottom:12px; }
.captcha-row input { margin-bottom:0; }
.captcha-code { min-width:108px; display:flex; align-items:center; justify-content:center; padding:0 12px; border-radius:10px; border:1px dashed #93c5fd; background:#eff6ff; color:#1e3a8a; font-size:15px; font-weight:700; letter-spacing:2px; user-select:none; }
.auth-note { margin:-6px 0 12px; font-size:13px; }
.login-submit { width:100%; margin-top:4px; padding:11px 14px; border-radius:10px; font-weight:700; }

.table-wrap { overflow:auto; background:#fff; border-radius:12px; box-shadow:0 4px 16px rgba(0,0,0,.06); border:1px solid var(--line); }
.table { width:100%; border-collapse:collapse; min-width:900px; }
.table th, .table td { text-align:left; padding:12px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:top; }
.thumb { width:42px; height:56px; object-fit:cover; border-radius:4px; border:1px solid var(--line); }
.badge { display:inline-block; background:#eff6ff; color:#1e3a8a; border:1px solid #bfdbfe; padding:2px 8px; border-radius:999px; font-size:12px; }
.empty { margin-top:14px; color:#6b7280; }
.muted { color:#6b7280; }

.upload-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.upload-preview {
  border:1px dashed #c7d2fe;
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
  background:#f8fbff;
}
.upload-preview h4 { margin:0 0 8px; font-size:14px; color:#1e3a8a; }
.preview-cover {
  width:100%;
  aspect-ratio: 16 / 9;
  border-radius:10px;
  background:linear-gradient(135deg,#dbeafe,#eff6ff);
  border:1px solid #bfdbfe;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#1e3a8a;
  font-size:13px;
  overflow:hidden;
}
.preview-cover img { width:100%; height:100%; object-fit:cover; }
.preview-meta { margin-top:8px; font-size:12px; color:#475569; }
.form .progress { width:100%; height:10px; background:#e5e7eb; border-radius:999px; margin:8px 0; overflow:hidden; }
.form .progress span { display:block; height:100%; background:linear-gradient(90deg,var(--brand-700),var(--brand-500)); }

@media (max-width: 1280px) {
  .filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1180px) {
  .metrics-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { display:none; }
  .main { padding:16px 14px 24px; }
  .cards, .upload-grid, .funnel-grid, .stats-grid, .metrics-5, .filters { grid-template-columns: 1fr; }
}
