:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0d1830;
  --panel: rgba(15, 27, 50, 0.82);
  --panel-solid: #101d35;
  --panel-strong: #132442;
  --text: #eef5ff;
  --muted: #8fa2c2;
  --muted-2: #637797;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --primary: #4f8cff;
  --primary-dark: #2563eb;
  --cyan: #22d3ee;
  --green: #2dd4bf;
  --purple: #a78bfa;
  --pink: #fb7185;
  --yellow: #fbbf24;
  --success: #34d399;
  --danger: #fb7185;
  --warn-bg: rgba(251, 191, 36, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(79, 140, 255, 0.24), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(45, 212, 191, 0.18), transparent 32%),
    linear-gradient(135deg, #07111f 0%, #0a1326 44%, #101424 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(48px);
  opacity: .24;
  pointer-events: none;
  z-index: 0;
}
.orb-a { left: 18%; top: 62%; background: #4f8cff; }
.orb-b { right: 4%; top: 16%; background: #2dd4bf; }

a { color: #9cc2ff; text-decoration: none; transition: .18s ease; }
a:hover { color: #dbeafe; }

.sidebar, .main { position: relative; z-index: 1; }

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 17, 32, .92), rgba(10, 20, 38, .82));
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block { display: flex; align-items: center; gap: 13px; padding: 8px 8px 14px; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--green));
  color: #fff; font-weight: 900; box-shadow: 0 14px 38px rgba(79, 140, 255, .36);
}
.brand { font-size: 18px; font-weight: 850; letter-spacing: .02em; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; }

.admin-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.admin-avatar {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(79, 140, 255, .18); color: #bfdbfe; font-weight: 900;
}
.admin-meta { min-width: 0; }
.admin-meta strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.admin-meta span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.admin-card form { margin: 0; }
.logout-btn, .compact { min-height: 32px !important; padding: 6px 10px !important; font-size: 12px !important; }

.side-nav { display: grid; gap: 8px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #b8c7e3;
}
.side-nav a:hover { background: rgba(255,255,255,.055); border-color: var(--line); }
.side-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 140, 255, .22), rgba(45, 212, 191, .12));
  border-color: rgba(79, 140, 255, .38);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .16);
}
.nav-icon {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(148, 163, 184, .12);
  color: #dbeafe;
}
.side-nav b { display: block; font-size: 14px; }
.side-nav small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted-2); }
.sidebar-footer {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.live-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--success); box-shadow: 0 0 0 7px rgba(52,211,153,.12); }

.main { padding: 24px 30px 46px; min-width: 0; }
.topbar {
  min-height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(18px);
}
.topbar strong { display: block; margin-top: 4px; font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .12);
  color: #9ff3d1;
  border: 1px solid rgba(52, 211, 153, .22);
  font-size: 12px; font-weight: 750;
}
.status-chip i { width: 7px; height: 7px; border-radius: 99px; background: var(--success); }

.page-header, .hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-bottom: 20px;
}
.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(45, 212, 191, .08)),
    rgba(255,255,255,.045);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.eyebrow { color: #93c5fd; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 5px; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.04em; }
h2 { font-size: 18px; margin-bottom: 14px; letter-spacing: -.02em; }
p, small, td, li { color: var(--muted); }
.hero p, .page-header p { margin-top: 8px; max-width: 680px; line-height: 1.7; }
.hero-badge {
  min-width: 132px; padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  text-align: right;
}
.hero-badge span { display: block; color: var(--muted); font-size: 12px; }
.hero-badge strong { display: block; margin-top: 4px; font-size: 28px; color: #fff; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0,0,0,.22);
  backdrop-filter: blur(18px);
}
.metric { position: relative; padding: 18px; overflow: hidden; }
.metric::after { content: ""; position: absolute; inset: auto -30px -44px auto; width: 120px; height: 120px; border-radius: 50%; background: rgba(79,140,255,.13); }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 15px; background: rgba(79,140,255,.16); margin-bottom: 14px; }
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; color: #fff; letter-spacing: -.03em; }
.metric small { display: block; margin-top: 8px; font-size: 12px; }
.metric-2 .metric-icon { background: rgba(45,212,191,.16); }
.metric-3 .metric-icon { background: rgba(167,139,250,.16); }
.metric-4 .metric-icon { background: rgba(251,113,133,.16); }

.panel { padding: 18px; overflow-x: auto; }
.panel.narrow { max-width: 920px; }
.gradient-panel { background: linear-gradient(135deg, rgba(79,140,255,.18), rgba(167,139,250,.12)); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-panels { margin-top: 4px; }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.quick-links a { padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: #dbeafe; font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
input, select {
  width: 100%; min-width: 180px; max-width: 480px; min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit; color: var(--text);
  background: rgba(7, 17, 31, .72);
  outline: none;
}
input:focus, select:focus { border-color: rgba(79,140,255,.7); box-shadow: 0 0 0 4px rgba(79,140,255,.12); }
label { color: #cbd5e1; font-size: 13px; font-weight: 750; }
button, .ghost {
  min-height: 42px; padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit; font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
button { background: linear-gradient(135deg, var(--primary), #22c7d9); color: #fff; box-shadow: 0 12px 28px rgba(79,140,255,.22); }
button:hover { transform: translateY(-1px); box-shadow: 0 18px 36px rgba(79,140,255,.28); }
.ghost { display: inline-flex; align-items: center; justify-content: center; border-color: var(--line); background: rgba(255,255,255,.055); color: #dbeafe; }
.ghost:hover { background: rgba(255,255,255,.09); }
.danger { background: linear-gradient(135deg, #ef4444, #fb7185); }
.inline { display: inline; }
.form-actions { margin-top: 14px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #cbd5e1; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; background: rgba(255,255,255,.03); }
tbody tr { transition: .16s ease; }
tbody tr:hover { background: rgba(255,255,255,.035); }
td:first-child, th:first-child { border-left: 0; }
code { color: #bfdbfe; background: rgba(79,140,255,.12); padding: 3px 7px; border-radius: 8px; border: 1px solid rgba(79,140,255,.18); }

dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px 14px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: #e2e8f0; }
.status-list dd { text-align: right; }

.pill, .notice {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 850;
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  border: 1px solid var(--line);
}
.pill.ok { background: rgba(52,211,153,.12); color: #8ff0c9; border-color: rgba(52,211,153,.22); }
.pill.bad { background: rgba(251,113,133,.12); color: #fecdd3; border-color: rgba(251,113,133,.24); }
.pill.muted { background: rgba(148,163,184,.12); color: #cbd5e1; }
.notice { background: var(--warn-bg); color: #fde68a; border-color: rgba(251,191,36,.25); }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.error { margin-top: 12px; color: #fecdd3; }
ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; }

.login-shell { display: block; }
.login-shell .sidebar { display: none; }
.login-shell .main { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15,27,50,.92), rgba(12,23,43,.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.login-card::before {
  content: "积分运营后台";
  display: grid; place-items: center;
  width: 70px; height: 70px; margin-bottom: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--green));
  box-shadow: 0 20px 50px rgba(79,140,255,.32);
  color: #fff; font-size: 0;
}
.login-card::after { content: ""; display: block; clear: both; }
.login-card h1 { font-size: 32px; }
.login-card p { margin-top: 8px; }
.login-card form { display: grid; gap: 12px; margin-top: 22px; }
.login-card input { max-width: none; }
.login-card button { margin-top: 4px; }

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; position: static; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-footer { display: none; }
  .main { padding: 18px; }
  .page-header, .hero, .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .side-nav { grid-template-columns: 1fr; }
  .admin-card { grid-template-columns: 42px 1fr; }
  .admin-card form { grid-column: 1 / -1; }
  .logout-btn { width: 100%; }
  .hero { padding: 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
  input, select, button, .ghost { max-width: none; width: 100%; }
}
