:root {
  --a-bg: #f0f2f5;
  --a-side: #001529;
  --a-side-text: rgba(255,255,255,.75);
  --a-primary: #1677ff;
  --a-text: rgba(0,0,0,.88);
  --a-border: #f0f0f0;
  --a-card: #fff;
  --a-danger: #ff4d4f;
  --a-ok: #52c41a;
}
* { box-sizing: border-box; }
body.admin-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--a-text);
  background: var(--a-bg);
  min-height: 100vh;
}
.admin-body { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; flex: 0 0 220px; background: var(--a-side); color: #fff;
  display: flex; flex-direction: column; padding: 16px 0; min-height: 100vh;
}
.admin-side .brand { padding: 8px 24px 24px; font-weight: 700; font-size: 16px; }
.admin-side nav a {
  display: block; padding: 10px 24px; color: var(--a-side-text); text-decoration: none;
}
.admin-side nav a:hover, .admin-side nav a.on { color: #fff; background: rgba(255,255,255,.08); }
.admin-side .side-foot { margin-top: auto; padding: 16px 24px; color: rgba(255,255,255,.45); font-size: 12px; }
.admin-main { flex: 1; padding: 24px; max-width: 1100px; }
.admin-gate {
  width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #e8f3ff, #f5f7fb 45%, #fff);
}

.card {
  background: var(--a-card); border-radius: 10px; padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02);
}
.card h1 { margin: 0 0 8px; font-size: 20px; }
.card h2 { margin: 0 0 16px; font-size: 16px; }
.muted { color: rgba(0,0,0,.45); font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.field { margin-bottom: 16px; }
.field > span, .field > label { display: block; margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; height: 36px; padding: 4px 11px; border: 1px solid #d9d9d9; border-radius: 6px;
  font: inherit; outline: none; background: #fff;
}
.field textarea { height: auto; min-height: 80px; padding: 8px 11px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(22,119,255,.15);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .admin-body { flex-direction: column; } .admin-side { width: 100%; flex: none; min-height: auto; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 6px; border: 1px solid #d9d9d9;
  background: #fff; color: var(--a-text); cursor: pointer; font-size: 14px; text-decoration: none;
}
.btn-primary { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.btn-danger { color: var(--a-danger); border-color: #ffccc7; }
.btn-link { border: 0; background: transparent; color: var(--a-primary); padding: 0; height: auto; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 6px; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert-ok { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-err { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--a-border); text-align: left; vertical-align: middle; }
.table th { background: #fafafa; font-weight: 600; }
.tag { display: inline-block; padding: 0 8px; height: 22px; line-height: 22px; border-radius: 4px; font-size: 12px; }
.tag-on { background: #f6ffed; color: #389e0d; }
.tag-off { background: #f5f5f5; color: #8c8c8c; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f5f5f5; padding: 2px 6px; border-radius: 4px; word-break: break-all; font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gate-card { width: min(480px, 100%); }
.gate-card.wide { width: min(640px, 100%); }
.hint { color: rgba(0,0,0,.45); font-size: 12px; margin: 6px 0 0; line-height: 1.5; }
.section-title { margin: 24px 0 12px; font-size: 15px; font-weight: 600; padding-top: 8px; border-top: 1px dashed #f0f0f0; }
.section-title:first-child { border-top: 0; margin-top: 0; }
