:root {
  --bg: #0f1419;
  --surface: #171e26;
  --surface-2: #1e2731;
  --line: #2a3644;
  --text: #eef3f8;
  --muted: #93a3b4;
  --accent: #38bdf8;
  --accent-2: #0284c7;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 28px 18px 64px; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.3px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.nav-links { display: flex; gap: 10px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.pill.ok { border-color: rgba(34, 197, 94, .45); color: #86efac; }
.pill.warn { border-color: rgba(245, 158, 11, .45); color: #fcd34d; }
.pill.danger { border-color: rgba(239, 68, 68, .45); color: #fca5a5; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 4px; font-size: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 8px; font-size: 17px; }
.card h3 { margin: 16px 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }

label { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { min-height: 92px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.row > .grow { flex: 1 1 200px; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary {
  background: var(--accent-2);
  border-color: var(--accent);
  color: #fff;
}
button.danger {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .5);
  color: #fca5a5;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.sm { padding: 5px 10px; font-size: 12px; }

.msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-all;
}
.msg.ok { border-color: rgba(34, 197, 94, .45); color: #bbf7d0; }
.msg.err { border-color: rgba(239, 68, 68, .45); color: #fecaca; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
td code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

ol.steps { padding-left: 20px; margin: 10px 0 0; }
ol.steps li { margin-bottom: 8px; }
