/* =============================================================
   lakesu 管理后台 - 现代专业风格
   主题色: Indigo; 中性色: Slate; 响应式: PC / 移动端
   ============================================================= */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .12), 0 8px 10px -6px rgba(15, 23, 42, .08);
  --topbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 登录页 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(99, 102, 241, .38), transparent 55%),
    radial-gradient(760px 480px at 88% 92%, rgba(56, 189, 248, .26), transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 48%, #4338ca 100%);
}
.login-box {
  width: 380px;
  max-width: 100%;
  background: rgba(255, 255, 255, .97);
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 25px 60px rgba(2, 6, 23, .42), 0 0 0 1px rgba(255, 255, 255, .12);
  animation: login-in .45s ease-out;
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}
.login-box h1 { font-size: 22px; text-align: center; color: var(--text); letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--text-3); margin: 8px 0 28px; font-size: 13px; }
.login-box .form-msg { margin: 0 0 10px; text-align: center; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 24px;
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 58%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 6, 23, .18);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
}
.brand::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .22);
}
.userinfo { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255, 255, 255, .92); }
.topbar .btn {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .32);
  color: #fff;
}
.topbar .btn:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: var(--topbar-h);
  z-index: 40;
  display: flex;
  gap: 2px;
  background: #fff;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  border: none;
  background: none;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background-color .2s;
}
.nav-btn:hover { color: var(--primary); background: var(--primary-soft); }
.nav-btn.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* ---------- 内容区 ---------- */
.content { max-width: 1200px; margin: 24px auto; padding: 0 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panel-in .25s ease-out; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--text); }
.panel-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
}

/* ---------- 卡片 ---------- */
.box, .push-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.push-box h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.push-box h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.push-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-tip { font-size: 12px; color: var(--text-3); }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-item .input { width: 100%; }
.input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
  background: #fff;
  color: var(--text);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 46px; }
select.input { cursor: pointer; }
.form-msg, .inline-msg { color: var(--danger); font-size: 13px; margin-top: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.chk input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  transition: all .18s ease;
}
.btn:hover { background: var(--bg); border-color: #cbd5e1; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(79, 70, 229, .28); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 2px 6px rgba(220, 38, 38, .22); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }
.btn-warn { background: var(--warning); border-color: var(--warning); color: #fff; box-shadow: 0 2px 6px rgba(217, 119, 6, .22); }
.btn-warn:hover { background: var(--warning-hover); border-color: var(--warning-hover); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: #fff; border-color: var(--border); color: var(--text-2); }
.ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 18px;
}
.table { width: 100%; min-width: 640px; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.table th { background: #f8fafc; color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover td { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--text-3); padding: 32px 16px; white-space: normal; }
#tab-bans .table { min-width: 780px; }
#tab-logs .table { min-width: 980px; }
#tab-apis .table, #tab-admins .table { min-width: 780px; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5; }
.tag-on { background: var(--success-soft); color: var(--success); }
.tag-off { background: var(--danger-soft); color: var(--danger); }
.tag-super { background: var(--warning-soft); color: var(--warning); }
.tag-normal { background: var(--info-soft); color: var(--info); }
.tag-warn { background: var(--warning-soft); color: var(--warning); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- 代码 ---------- */
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; padding: 2px 6px; border-radius: 4px; background: #f1f5f9; color: #4338ca; }

/* ---------- 弹窗 ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
}
.modal.show { display: flex; }
.modal-box {
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .22s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box h3 { margin-bottom: 18px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.inline-msg { display: inline-block; margin-left: 10px; }

/* ---------- 移动端适配 (max-width: 768px) ---------- */
@media (max-width: 768px) {
  :root { --topbar-h: 54px; }
  .topbar { padding: 0 14px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-logo { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
  .userinfo { gap: 8px; font-size: 12px; }
  .userinfo .btn { padding: 4px 10px; font-size: 12px; }
  .nav { padding: 0 8px; }
  .nav-btn { padding: 12px 14px; font-size: 13px; }
  .content { margin: 14px auto; padding: 0 12px; }
  .panel-head { margin-bottom: 12px; }
  .panel-head h2 { font-size: 16px; }
  .box, .push-box { padding: 16px; margin-bottom: 14px; }
  .push-row { gap: 8px; }
  .push-row .input { width: 100% !important; }
  .push-row .btn { flex: 1 1 auto; }
  .push-row .btn-sm { flex: 0 0 auto; }
  .modal-box { padding: 20px 18px; }
  .login-box { padding: 32px 22px 26px; }
}
