:root {
  --bg: #f3f5f8;
  --bg-2: #e8edf3;
  --panel: #ffffff;
  --line: #d9e0ea;
  --text: #1c2430;
  --muted: #6b778a;
  --primary: #1f6feb;
  --primary-2: #1558c0;
  --ok: #14804a;
  --warn: #b7791f;
  --danger: #c9372c;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
  --radius: 14px;
  --nav: #0f1724;
  --nav-text: #c9d4e4;
  --accent: #2bb0ed;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(43,176,237,.12), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(31,111,235,.10), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.install-card { width: min(460px, 100%); }

.brand {
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -.02em;
}

.muted { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 6px;
}

.form input, .form select, .form textarea,
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form input:focus, input:focus, select:focus, textarea:focus {
  border-color: #8bbcff;
  box-shadow: 0 0 0 3px rgba(31,111,235,.15);
}

textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .2s, box-shadow .2s, border-color .2s;
  text-decoration: none !important;
  color: inherit;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #2b7fff, var(--primary)); color: #fff; box-shadow: 0 8px 18px rgba(31,111,235,.25); }
.btn.primary:hover { background: linear-gradient(180deg, var(--primary), var(--primary-2)); color:#fff; }
.btn.ghost { background: #fff; border-color: var(--line); }
.btn.danger { background: #fff; border-color: #f0b4ae; color: var(--danger); }
.btn.ok { background: #eaf7f0; color: var(--ok); border-color: #b7e0c8; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 18px; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
  animation: slideDown .35s ease;
}
.alert.success { background: #eaf7f0; color: var(--ok); }
.alert.danger { background: #fdeceb; color: var(--danger); }
.alert.warn { background: #fff7e8; color: var(--warn); }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #101826 0%, #0c1320 100%);
  color: var(--nav-text);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}

.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #2bb0ed, #1f6feb);
  display: grid; place-items: center;
  color: #fff; font-size: 14px;
  box-shadow: 0 8px 20px rgba(43,176,237,.35);
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nav-text);
  padding: 11px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  text-decoration: none !important;
  transition: background .2s, color .2s, transform .2s;
}

.nav a:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.nav a.active {
  background: linear-gradient(90deg, rgba(43,176,237,.22), rgba(31,111,235,.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(43,176,237,.25);
}

.main { padding: 22px 26px 40px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.02em;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  box-shadow: var(--shadow);
}

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2bb0ed, #1f6feb);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: fadeUp .45s ease both;
}

.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }

.stat::after {
  content: "";
  position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43,176,237,.18), transparent 70%);
}

.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -.03em; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: fadeUp .4s ease both;
}

.panel + .panel { margin-top: 16px; }

.panel-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-hd h2 { margin: 0; font-size: 16px; }

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
table.data tr { transition: background .15s; }
table.data tbody tr:hover { background: #f7fafc; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #eaf7f0; color: var(--ok); }
.badge.warn { background: #fff7e8; color: var(--warn); }
.badge.danger { background: #fdeceb; color: var(--danger); }
.badge.muted { background: #eef2f7; color: var(--muted); }
.badge.info { background: #e8f1ff; color: var(--primary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px;
}

.toolbar .field { min-width: 160px; flex: 1; }
.toolbar .field label { display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }

.mono { font-family: var(--mono); font-size: 12px; }
.copyable { cursor: pointer; border-bottom: 1px dashed #9db4d0; }
.copyable:hover { color: var(--primary); }

.doc {
  line-height: 1.7;
  color: #2a3444;
}
.doc h3 { margin: 22px 0 8px; font-size: 17px; }
.doc h4 { margin: 16px 0 6px; font-size: 14px; color: #334155; }
.doc p, .doc li { color: #445266; font-size: 14px; }
.doc code, .doc pre {
  font-family: var(--mono);
  background: #0f1724;
  color: #e6eef8;
}
.doc code {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.doc pre {
  padding: 14px 16px;
  border-radius: 12px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.doc .tip {
  background: #eef6ff;
  border: 1px solid #cfe2ff;
  border-radius: 10px;
  padding: 12px 14px;
  color: #1e4b8f;
  margin: 12px 0;
}

.empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--muted);
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.animate-in { animation: fadeUp .5s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
