/* 后台样式 */
:root {
  --bg: #f0f2f5;
  --side: #1e293b;
  --side-hover: #334155;
  --accent: #e85d4c;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: #fff;
  --radius: 12px;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--side); color: #e2e8f0;
  padding: 20px 0; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
  padding: 0 20px 20px; font-weight: 700; font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px;
  color: #fff;
}
.sidebar a {
  display: block; padding: 12px 20px; color: #94a3b8;
  transition: .15s;
}
.sidebar a:hover, .sidebar a.active { background: var(--side-hover); color: #fff; }
.main { flex: 1; padding: 24px; min-width: 0; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.top h1 { font-size: 1.35rem; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 16px;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border: 0; border-radius: 8px;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff;
}
.btn:hover { filter: brightness(1.05); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: #dc2626; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; max-width: 520px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }
.alert-ok { background: #ecfdf5; color: #047857; }
.alert-err { background: #fef2f2; color: #b91c1c; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.b0 { background: #fff7ed; color: #c2410c; }
.b1 { background: #ecfdf5; color: #047857; }
.b2 { background: #eff6ff; color: #1d4ed8; }
.b3 { background: #f0fdf4; color: #15803d; }
.b4 { background: #f1f5f9; color: #64748b; }
.b5 { background: #faf5ff; color: #7e22ce; }
.bm0 { background: #fff7ed; color: #c2410c; }
.bm1 { background: #ecfdf5; color: #047857; }
.bm2 { background: #fef2f2; color: #b91c1c; }
.bm3 { background: #f1f5f9; color: #475569; }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 16px; padding: 32px;
}
.login-box h1 { margin-bottom: 8px; }
.login-box .sub { color: var(--muted); margin-bottom: 24px; font-size: .9rem; }
.switch { display: flex; align-items: center; gap: 8px; }
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; padding: 12px; gap: 4px; }
  .sidebar .logo { width: 100%; border: 0; padding: 8px 12px; margin: 0; }
  .sidebar a { padding: 8px 12px; border-radius: 8px; }
  .main { padding: 16px; }
  table { display: block; overflow-x: auto; }
}
