* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #222;
  font-size: 14px;
}
header {
  background: #1e2a3a;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header .meta { font-size: 12px; color: #a0b0c8; display: flex; gap: 16px; }
header .meta #svc-status { font-weight: 600; }
header .meta #svc-status.online { color: #4ade80; }
header .meta #svc-status.offline { color: #f87171; }

nav.tabs {
  background: #fff;
  border-bottom: 1px solid #e0e4ea;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}
nav.tabs button.tab {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
nav.tabs button.tab:hover { color: #1e2a3a; }
nav.tabs button.tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

main { padding: 20px 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 16px 0; font-size: 16px; font-weight: 600; color: #1e2a3a; }

.form-row {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-row label { font-weight: 500; color: #444; min-width: 80px; }
.form-row select, .form-row input, .form-row textarea {
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.form-row select:focus, .form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.form-row textarea {
  width: 100%;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}

button {
  padding: 7px 14px;
  border: 1px solid #d0d5dd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
button:hover { background: #f5f6f8; }
button.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 500;
}
button.btn-primary:hover { background: #1d4ed8; }
button.btn-small { padding: 4px 10px; font-size: 12px; }
button.btn-danger { color: #dc2626; border-color: #fecaca; }

.status { margin-left: 12px; font-size: 13px; color: #666; }
.status.ok { color: #059669; }
.status.err { color: #dc2626; }

.result {
  margin-top: 16px;
  padding: 12px;
  background: #f0f9ff;
  border-left: 3px solid #2563eb;
  border-radius: 4px;
  font-size: 13px;
  overflow-x: auto;
}
.result.error { background: #fef2f2; border-left-color: #dc2626; }
.result pre { margin: 0; font-family: "Consolas", "Monaco", monospace; font-size: 12px; }
.result a { color: #2563eb; text-decoration: none; }
.result a:hover { text-decoration: underline; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th, table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
}
table th {
  background: #f9fafb;
  font-weight: 600;
  color: #4a5568;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
table tr:hover { background: #fafbfc; }
table .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #e5e7eb; color: #374151; }

.hidden { display: none !important; }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal .modal-body {
  background: #fff; border-radius: 8px;
  width: 80%; max-width: 900px; max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal .modal-head {
  padding: 14px 20px; border-bottom: 1px solid #eee;
  display: flex; justify-content: space-between; align-items: center;
}
.modal .modal-head h3 { margin: 0; font-size: 15px; }
.modal pre {
  padding: 16px 20px; margin: 0; overflow: auto;
  font-family: "Consolas", "Monaco", monospace; font-size: 12px;
  background: #f9fafb;
}
