* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa;
  color: #1f2937;
  line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
h1 { font-size: 24px; margin-bottom: 8px; }
h2 { font-size: 18px; margin: 20px 0 12px; }
.muted { color: #6b7280; font-size: 14px; }

.nav { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.nav a {
  padding: 8px 18px; background: #fff; border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 500;
}
.nav a:hover { background: #eff6ff; text-decoration: none; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus { outline: none; border-color: #2563eb; }

button, .btn {
  display: inline-block; padding: 10px 20px; border: none; border-radius: 8px;
  background: #2563eb; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; margin: 8px 8px 0 0;
}
button:hover { background: #1d4ed8; }
button.secondary { background: #6b7280; }
button.secondary:hover { background: #4b5563; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
button:disabled { background: #9ca3af; cursor: not-allowed; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.off { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }

#log {
  background: #0f172a; color: #a7f3d0; border-radius: 8px;
  padding: 12px; height: 220px; overflow-y: auto;
  font-family: Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap;
}
#messages { margin-top: 12px; }
.msg {
  background: #f0fdf4; border-left: 3px solid #22c55e;
  padding: 8px 12px; border-radius: 4px; margin-bottom: 8px; font-size: 14px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }
th { background: #f9fafb; font-weight: 600; }
td code, .mono { font-family: Menlo, Consolas, monospace; font-size: 13px; }

.hero { text-align: center; padding: 40px 16px; }
.hero h1 { font-size: 32px; }
.hero p { color: #6b7280; margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.grid .card { margin: 0; text-align: center; }
.grid .card .icon { font-size: 32px; }

pre {
  background: #0f172a; color: #e2e8f0; padding: 14px;
  border-radius: 8px; overflow-x: auto; font-size: 13px; margin: 8px 0;
}
code.inline { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity .3s; z-index: 999;
}
.toast.show { opacity: 1; }

.login-box { max-width: 380px; margin: 80px auto; }
.error { color: #dc2626; font-size: 14px; margin-top: 8px; min-height: 20px; }
.picker-row { display: flex; gap: 8px; align-items: center; }
.picker-row input { flex: 1; }
