:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #d8e0ea;
  --line-soft: #edf1f6;
  --blue: #1f5fbf;
  --blue-dark: #174a94;
  --blue-soft: #eaf2ff;
  --green: #117a4d;
  --green-soft: #e8f7ef;
  --red: #b73535;
  --red-soft: #fff0f0;
  --amber: #9a650f;
  --amber-soft: #fff7e4;
  --shadow: 0 10px 28px rgba(21, 37, 67, .07);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { min-width: 1100px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  background: #111827;
  color: #dbe4f0;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 18px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f6fec;
  color: #fff;
  font-weight: 800;
}
.brand strong { display: block; color: #fff; font-size: 16px; }
.brand small { display: block; margin-top: 2px; color: #8ea0b8; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav a, .nav button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: #c8d3e2;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active {
  background: #fff;
  color: #101828;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.main { min-width: 0; padding: 28px 32px 48px; }
.pagebar {
  height: 70px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.pagebar-title { font-size: 16px; font-weight: 800; }
.pagebar-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
.sub { color: var(--muted); margin-top: 5px; }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.two { grid-template-columns: 420px minmax(0, 1fr); align-items: start; }
.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-hd {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800;
  background: linear-gradient(#fff, #fbfcfe);
}
.card-bd { padding: 18px; }
.stat { padding: 20px; min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .num { font-size: 32px; font-weight: 850; line-height: 1; color: #0f172a; }
.stat .label { color: var(--muted); margin-top: 10px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { color: #475467; font-size: 12px; font-weight: 800; background: #f8fafc; white-space: nowrap; }
td { background: #fff; }
tbody tr:hover td { background: #fbfdff; }
tr:last-child td { border-bottom: 0; }
.form { display: grid; gap: 13px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 12px; color: #475467; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #8db5f6;
  box-shadow: 0 0 0 3px rgba(31,95,191,.10);
}
textarea { min-height: 96px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #b7c4d6; background: #f8fafc; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}
.btn.edit {
  color: var(--blue);
  border-color: #b9cdf7;
  background: var(--blue-soft);
}
.btn.edit:hover {
  border-color: #8db5f6;
  background: #dfeaff;
}
.btn.danger.subtle {
  border-color: #f1c1c1;
  background: #fff;
}
.btn.danger.subtle:hover {
  background: var(--red-soft);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.flash { margin-bottom: 16px; display: grid; gap: 8px; }
.flash div { padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.flash .success { border-color: #b8e0ca; background: #f0fbf5; color: var(--green); }
.flash .error { border-color: #f1c1c1; background: #fff5f5; color: var(--red); }
.secret {
  border: 1px solid #b9cdf7;
  background: var(--blue-soft);
  padding: 14px;
  border-radius: var(--radius);
  word-break: break-all;
  margin-bottom: 16px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.muted { color: var(--muted); }
.pager { margin-top: 16px; display: flex; gap: 8px; align-items: center; }
.app-table { min-width: 1280px; }
.secret-cell {
  max-width: 280px;
  word-break: break-all;
  font-size: 12px;
}
.note-cell {
  max-width: 260px;
  white-space: pre-wrap;
}
.action-th,
.action-cell {
  width: 170px;
}
.app-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.app-actions form {
  margin: 0;
  display: inline-flex;
}
.app-edit-row { display: none; }
.app-edit-row.show { display: table-row; }
.app-edit-row td {
  background: #f8fafc;
  padding: 16px 18px;
}
.app-edit-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) 140px minmax(220px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}
.app-edit-panel textarea {
  min-height: 42px;
  padding: 9px 10px;
}
.app-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1px;
}
.doc-block { margin-top: 16px; }
.doc-title {
  margin-bottom: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.plain-list li { margin: 0 0 8px; }
.api-docs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  margin-top: 18px;
}
.account-grid {
  grid-template-columns: 360px minmax(360px, 520px);
  align-items: start;
}
.detail-list {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}
.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}
.detail-list dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.form-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #111827; }
.login-card { width: 100%; max-width: 430px; }
pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.codebox {
  background: #0f172a;
  color: #d7e1f2;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
@media (max-width: 1180px) {
  html { min-width: 0; }
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two, .split, .api-docs, .account-grid { grid-template-columns: 1fr; }
  .main { padding: 20px; }
}
