* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f6f7f9;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f7;
}
.login-box {
  width: 360px;
  background: #fff;
  padding: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.login-box h1 {
  margin: 0 0 22px;
  font-size: 22px;
}
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: #111827;
  color: #d1d5db;
  padding: 20px 14px;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 18px;
  padding: 0 10px;
}
.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.nav a.active,
.nav a:hover {
  background: #2563eb;
  color: #fff;
}
.main {
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.content {
  padding: 22px 24px 40px;
}
.page-title {
  margin: 0 0 18px;
  font-size: 22px;
}
.grid {
  display: grid;
  gap: 14px;
}
.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}
.stat-label {
  color: #6b7280;
  font-size: 13px;
}
.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
input,
select,
textarea {
  max-width: 100%;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}
input[type="file"] {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 36px;
  padding: 6px 10px;
}
textarea {
  height: auto;
  min-height: 72px;
  padding: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.btn.small {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}
.btn.secondary {
  background: #475569;
}
.btn.danger {
  background: #dc2626;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
  white-space: nowrap;
}
th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
}
.badge.success {
  background: #dcfce7;
  color: #166534;
}
.badge.warn {
  background: #fef3c7;
  color: #92400e;
}
.badge.fail {
  background: #fee2e2;
  color: #991b1b;
}
.notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}
.kv div:nth-child(odd) {
  color: #6b7280;
}
.form-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.form-row > * {
  min-width: 0;
}
.detail-grid .form-row {
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
}
.config-value {
  width: min(640px, 100%);
}
.config-panel {
  margin-bottom: 14px;
}
.config-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}
.config-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.muted {
  color: #6b7280;
}
.face-thumb {
  width: 42px;
  height: 54px;
  object-fit: cover;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f3f4f6;
}
.id-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.section-heading h2 {
  margin: 0;
}
.btn.active {
  background: #2563eb;
  color: #fff;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  color: #374151;
  flex-wrap: wrap;
}
.pager-summary {
  font-size: 13px;
}
.pager-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pager-links a,
.pager-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
}
.pager-links .page-number {
  min-width: 34px;
  padding: 0 8px;
}
.pager-links span {
  color: #9ca3af;
  background: #f9fafb;
}
.pager-links .page-number.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.pager-jump input {
  width: 72px;
  height: 32px;
}
.raw-json {
  width: 100%;
  min-height: 560px;
  max-height: 72vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .config-columns {
    grid-template-columns: 1fr;
  }
}
