* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
.app { max-width: 1180px; margin: 0 auto; padding: 28px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { margin: 0 0 8px; font-size: 28px; }
p { margin: 0; color: #64748b; }
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
h2 { margin: 0 0 14px; font-size: 18px; }
.row { display: flex; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
label { display: flex; flex-direction: column; gap: 6px; color: #475569; font-size: 14px; }
input {
  width: 100%;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 9px 13px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: #1d4ed8; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
.hint { margin-top: 8px; font-size: 13px; }
.message { min-height: 22px; margin-bottom: 10px; color: #64748b; }
.message.ok { color: #059669; }
.message.err { color: #dc2626; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 10px; text-align: left; vertical-align: middle; }
th { color: #475569; font-size: 13px; background: #f8fafc; }
code { user-select: all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.badge.on { background: #dcfce7; color: #15803d; }
.badge.off { background: #fee2e2; color: #b91c1c; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { padding: 6px 9px; font-size: 12px; background: #475569; }
.actions button:hover { background: #334155; }
.actions button.danger { background: #dc2626; }
.empty { text-align: center; color: #94a3b8; padding: 28px; }
@media (max-width: 760px) {
  .app { padding: 14px; }
  header, .row { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; }
}
