* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f6fb; color: #0f172a;
}
.hidden { display: none !important; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 12px 40px rgba(15,23,42,.12); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: #64748b; font-size: 13px; }
header.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
header.topbar h1 { font-size: 17px; margin: 0; flex: 1; }
.badge { background: #eef2ff; color: #4338ca; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.tabs { display: flex; gap: 8px; padding: 14px 20px 0; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; cursor: pointer; color: #475569; font-size: 14px; }
.tab.active { background: #4f46e5; color: #fff; }
main { padding: 18px 20px 60px; max-width: 1180px; margin: 0 auto; }
.card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 2px 12px rgba(15,23,42,.05); margin-bottom: 16px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: block; font-size: 12px; color: #475569; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=datetime-local], textarea, select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 9px 10px; font-size: 14px; background: #fff; color: #0f172a;
}
textarea { min-height: 84px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #c7d2fe; border-color: #6366f1; }
button.primary { background: #4f46e5; color: #fff; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-size: 14px; }
button.ghost { background: #fff; color: #334155; border: 1px solid #cbd5e1; border-radius: 9px; padding: 9px 14px; cursor: pointer; font-size: 13px; }
button.danger { background: #fee2e2; color: #b91c1c; border: 0; border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
button.small { padding: 6px 10px; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.switch input { width: auto; }
.api-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fbfcff; }
.api-card .head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.api-card .head input { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
th { color: #64748b; font-weight: 600; font-size: 12px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; max-width: 420px; }
.toast.show { opacity: 1; transform: translateY(0); }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat .item { background: #f8fafc; border-radius: 12px; padding: 14px; }
.stat .item b { display: block; font-size: 24px; margin-bottom: 4px; }
.muted { color: #64748b; font-size: 12px; }
