:root {
  --bg: #0f1513; --panel: #161e1b; --panel2: #1c2622; --line: #2a3832; --text: #e9f0ec; --muted: #8fa39a;
  --accent: #2fc795; --accent-ink: #06261b; --warn: #e8b04a; --bad: #ef6b6b; --ok: #2fc795; --radius: 14px;
}
:root[data-theme="light"] {
  --bg: #f4f7f5; --panel: #ffffff; --panel2: #f0f4f2; --line: #dbe4df; --text: #14201b; --muted: #5f7269;
  --accent: #128a65; --accent-ink: #ffffff; --warn: #a56a00; --bad: #c43c3c; --ok: #128a65;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 7px; top: 6px; width: 10px; height: 6px; border-left: 3px solid var(--accent-ink); border-bottom: 3px solid var(--accent-ink); transform: rotate(-45deg); }
.top-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top-nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; }
.top-nav a:hover { color: var(--text); }
.top-nav a.on { background: var(--panel2); color: var(--text); }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }

.banner { background: color-mix(in srgb, var(--warn) 18%, var(--bg)); color: var(--warn); border-bottom: 1px solid var(--line); padding: 10px 24px; text-align: center; }

main { width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 20px 48px; flex: 1; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { padding: 12px 14px; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; cursor: default; white-space: nowrap; overflow: hidden; }
.steps li:last-child { border-right: 0; }
.steps li span { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; display: grid; place-items: center; }
.steps li.on { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.steps li.on span, .steps li.done span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.go { cursor: pointer; }

h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.2; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 6px; }
.lead { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 16px; }
.grid2 > .card { margin-top: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.big-input { font-size: 18px !important; letter-spacing: .04em; font-family: ui-monospace, Menlo, Consolas, monospace !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt2 { margin-top: 26px; }
.btn { border: 0; border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sec { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.link { background: none; color: var(--muted); padding: 12px 6px; font-weight: 500; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.msg { border-radius: 10px; padding: 10px 14px; margin-top: 14px; font-size: 14px; border: 1px solid var(--line); background: var(--panel2); }
.msg.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.msg.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.msg.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.plan-box { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.plan-box strong { font-size: 20px; display: block; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: var(--ok); } .tag.bad { color: var(--bad); border-color: var(--bad); } .tag.warn { color: var(--warn); border-color: var(--warn); }

.howto { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.howto li { counter-increment: s; padding: 14px 0 14px 44px; position: relative; border-bottom: 1px solid var(--line); }
.howto li:last-child { border-bottom: 0; }
.howto li::before { content: "0" counter(s); position: absolute; left: 0; top: 14px; color: var(--accent); font: 600 13px ui-monospace, Menlo, monospace; }
.howto strong { display: block; }
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 8px; font-size: 13px; overflow: auto; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; color: var(--text); font-size: 14px; cursor: pointer; }
.check input { margin-top: 5px; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details summary::after { content: "+"; color: var(--accent); font-size: 18px; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 8px 0 0; }

.status-hero { display: flex; gap: 16px; align-items: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
.dot { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: none; color: #fff; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.logs { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.logs li { display: grid; grid-template-columns: 64px 76px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.logs li:last-child { border-bottom: 0; }
.logs em { font-style: normal; color: var(--muted); }
.logs time { color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.logs .lv-error { color: var(--bad); } .logs .lv-warn { color: var(--warn); } .logs .lv-success { color: var(--ok); }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stats div { background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 9; max-width: 90vw; }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .steps li { font-size: 0; justify-content: center; } .steps li span { font-size: 11px; }
  .top { padding: 12px 16px; } main { padding: 20px 16px 40px; }
  .logs li { grid-template-columns: 62px 1fr; } .logs li em { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
