:root {
  --bg: #f5f7fb; --card: #ffffff; --primary: #2563eb; --text: #1f2937;
  --muted: #6b7280; --border: #e5e7eb; --danger: #dc2626; --success: #16a34a;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
}
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.btn:hover { background: #f3f4f6; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.badge-on { background: #dcfce7; color: var(--success); }
.badge-off { background: #f3f4f6; color: var(--muted); }
.badge-fail { background: #fee2e2; color: var(--danger); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px;
}
.nav a.active { background: #e0e7ff; color: var(--primary); font-weight: 500; }
/* 提示 toast：统一 5 秒 */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; width: min(90vw, 360px); }
.toast { padding: 12px 16px; border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: slideDown .25s ease; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: min(92vw, 480px); max-height: 90vh; overflow-y: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
@media (max-width: 640px) {
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}
