﻿:root {
  --bg: #f5f6f8;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: rgba(15, 23, 42, 0.1);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  background:
    radial-gradient(circle at 6% -8%, rgba(255, 214, 10, 0.22), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(0, 122, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f4f6fa 42%, #edf0f5 100%);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.admin-sidebar {
  background: rgba(18, 24, 38, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0 30px 30px 0;
  box-shadow: 18px 0 48px rgba(15, 23, 42, 0.18);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 24px);
  left: 12px;
  padding: 14px 10px;
  position: fixed;
  top: 12px;
  width: 218px;
  z-index: 20;
}

.admin-brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  padding: 6px;
  text-decoration: none;
}

.admin-brand span {
  align-items: center;
  background: linear-gradient(145deg, #fff, #dfe7ff);
  border-radius: 16px;
  color: #111827;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.admin-brand strong { font-size: 16px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.nav-item {
  background: transparent;
  border: 0;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 6px 4px;
}
.sidebar-footer a { color: rgba(255, 255, 255, 0.72); font-size: 13px; text-decoration: none; }

.admin-shell {
  margin-left: 250px;
  max-width: 1500px;
  padding: 28px 28px 60px;
}

.admin-topbar {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.05em; margin-bottom: 8px; }
h2 { font-size: 20px; letter-spacing: -0.03em; margin-bottom: 0; }
p { color: var(--muted); line-height: 1.55; }

.account-box, .glass-card {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--soft-shadow);
}
.account-box {
  border-radius: 22px;
  display: grid;
  min-width: 230px;
  padding: 12px 16px;
}
.account-box span, .account-box small { color: var(--muted); font-size: 12px; font-weight: 800; }
.account-box strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.glass-card {
  border-radius: 28px;
  padding: 18px;
}
.auth-panel {
  display: grid;
  gap: 14px;
  max-width: 460px;
}
label { color: var(--muted); display: grid; font-size: 13px; font-weight: 900; gap: 7px; }
input, select {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}
input:focus, select:focus { border-color: rgba(0, 122, 255, 0.45); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12); }
.primary, .secondary, .danger, .mini {
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
}
.primary { background: #111827; color: #fff; }
.secondary { background: rgba(15, 23, 42, 0.07); color: #111827; }
.danger { background: rgba(255, 59, 48, 0.12); color: #b42318; }
.mini { font-size: 12px; min-height: 30px; padding: 0 10px; }
.status { color: var(--muted); font-size: 13px; margin: 0; }
.status.error { color: var(--red); }

.content-panel, .view-panel.active { display: grid; gap: 16px; }
.view-panel { display: none; }
.metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
}
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 900; }
.metric-card strong { font-size: 32px; letter-spacing: -0.05em; }
.metric-card small { color: var(--faint); font-weight: 800; }
.two-column-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); }
.logs-grid { align-items: start; }
.card-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar input { width: 210px; }

.table-shell { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 0 8px; width: 100%; }
th { color: var(--muted); font-size: 12px; padding: 0 10px 4px; text-align: left; white-space: nowrap; }
td {
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px;
  padding: 10px;
  vertical-align: middle;
  white-space: nowrap;
}
td:first-child { border-left: 1px solid rgba(15, 23, 42, 0.06); border-radius: 14px 0 0 14px; }
td:last-child { border-radius: 0 14px 14px 0; border-right: 1px solid rgba(15, 23, 42, 0.06); }
.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}
.badge.ok { background: rgba(52, 199, 89, 0.12); color: #15803d; }
.badge.warn { background: rgba(255, 149, 0, 0.14); color: #b45309; }
.badge.fail { background: rgba(255, 59, 48, 0.12); color: #b42318; }
.badge.info { background: rgba(0, 122, 255, 0.1); color: #1d4ed8; }

.check-list, .plugin-info, .security-grid, .quick-links { display: grid; gap: 10px; }
.check-row, .info-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}
.quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-links a {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  color: var(--text);
  font-weight: 900;
  padding: 16px;
  text-decoration: none;
}
.security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.security-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 18px;
  padding: 14px;
}
.security-card h3 { margin: 0 0 8px; }
.security-card p { margin: 4px 0; }
.json-panel {
  background: rgba(17, 24, 39, 0.92);
  border-radius: 18px;
  color: #e5e7eb;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}
.toast {
  background: rgba(17, 24, 39, 0.92);
  border-radius: 999px;
  bottom: 22px;
  color: #fff;
  font-weight: 900;
  left: 50%;
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 50;
}

@media (max-width: 980px) {
  .admin-sidebar { border-radius: 0; bottom: 0; flex-direction: row; height: auto; left: 0; overflow-x: auto; right: 0; top: auto; width: auto; }
  .admin-brand, .sidebar-footer { display: none; }
  .admin-sidebar nav { display: flex; gap: 6px; }
  .nav-item { min-width: max-content; }
  .admin-shell { margin-left: 0; padding: 18px 14px 92px; }
  .admin-topbar, .card-head { align-items: flex-start; flex-direction: column; }
  .metric-grid, .two-column-grid, .security-grid { grid-template-columns: 1fr; }
}
