:root {
  --bg: #f7f7f5; --panel: #ffffff; --text: #1d1d1b; --muted: #6b6a66; --line: #e3e2de;
  --accent: #2d6cdf; --accent-text: #ffffff; --ok: #2f9e5a; --bad: #c9473b; --warn: #c88a1a;
  --code-bg: #f0efec;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151615; --panel: #1e1f1e; --text: #e8e7e3; --muted: #9a9993; --line: #33342f;
    --accent: #6a9cf0; --accent-text: #0e1420; --ok: #4fc17e; --bad: #e46b5f; --warn: #e0a84a;
    --code-bg: #262725;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.mono, pre, code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.muted { color: var(--muted); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .muted { font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; }
nav button:hover { color: var(--text); background: var(--code-bg); }
nav button.active { color: var(--text); background: var(--code-bg); font-weight: 600; }
.auth { display: flex; align-items: center; gap: 8px; font-size: 13px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.tab { display: none; } .tab.active { display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 20px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.card .value.mono { font-size: 16px; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }

.form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form .grow { flex: 1; min-width: 220px; }
input, select, button { font: inherit; color: var(--text); }
input, select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 140px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.ghost { border-color: transparent; color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row h2 { margin-right: auto; }

.status { font-size: 14px; min-height: 22px; }
.status.err { color: var(--bad); }
.output { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.45; white-space: pre; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: currentColor; }
.pill.bad { color: var(--bad); border-color: currentColor; }
.pill.warn { color: var(--warn); border-color: currentColor; }

footer { text-align: center; font-size: 12px; padding: 0 16px 24px; }

@media (max-width: 640px) {
  .top { padding: 10px 16px; }
  .form label, .form .grow, input, select { width: 100%; }
  .form button { width: 100%; }
}
