:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-soft: #263449;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --gold: #f59e0b;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top right, #1e293b, #0f172a 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(30, 41, 59, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.brand {
  text-align: center;
  margin-bottom: 22px;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  background: linear-gradient(90deg, #38bdf8, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(135deg, #d97706, #f59e0b); color: #111827; }
.btn-ok { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.err { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.msg.ok { background: rgba(34, 197, 94, 0.16); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.msg.warn { background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.4); color: #fde68a; }

/* Slider Captcha */
.slider-box {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 14px;
  user-select: none;
}
.slider-track {
  position: relative;
  height: 40px;
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}
.slider-target {
  position: absolute;
  top: 4px;
  width: 32px;
  height: 30px;
  border: 2px dashed var(--gold);
  background: rgba(245, 158, 11, 0.18);
  border-radius: 6px;
  pointer-events: none;
}
.slider-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: rgba(56, 189, 248, 0.2);
}
.slider-knob {
  position: absolute;
  top: 3px; left: 0;
  width: 36px; height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  cursor: grab;
  touch-action: none;
}
.slider-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.slider-box.passed .slider-knob { background: var(--ok); }
.slider-box.passed .slider-label { color: #86efac; }

/* App Shell */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.topbar h2 { margin: 0; font-size: 18px; }
.layout { display: flex; min-height: calc(100vh - 54px); }
.sidebar {
  width: 220px;
  background: rgba(30, 41, 59, 0.7);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  flex-shrink: 0;
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.nav-item:hover { background: rgba(56, 189, 248, 0.1); color: var(--text); }
.nav-item.active { background: rgba(56, 189, 248, 0.2); color: #fff; font-weight: 600; }
.main { flex: 1; padding: 20px; overflow-x: auto; max-width: 1300px; }
.card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stat-box {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat-box .k { font-size: 12px; color: var(--muted); }
.stat-box .v { font-size: 22px; font-weight: 700; margin-top: 4px; color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; background: rgba(15, 23, 42, 0.5); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.badge-ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge-warn { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.badge-err { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; gap: 6px; padding: 8px; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-item { width: auto; white-space: nowrap; margin-bottom: 0; }
}
