:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --background: #f6f7fa;
  --surface: #ffffff;
  --inset: #f3f5fb;
  --text: #192133;
  --muted: #4e5b71;
  --line: #dde3ed;
  --control: #8590a3;
  --accent: #2949bd;
  --accent-hover: #203a98;
  --on-accent: #ffffff;
  --step-background: #e9eeff;
  --error: #a52c26;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #10141d;
    --surface: #171d29;
    --inset: #202838;
    --text: #eff2fc;
    --muted: #bcc6d9;
    --line: #323d50;
    --control: #78849a;
    --accent: #b4c2ff;
    --accent-hover: #ccd5ff;
    --on-accent: #151e37;
    --step-background: #2a375e;
    --error: #ffb2a7;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.65;
}

main {
  width: min(100%, 49rem);
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) 2.5rem;
}

main p { margin: 0; }
.intro { margin-bottom: 1.75rem; }

.product {
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
}

h1 {
  margin: .375rem 0 .5rem;
  font-size: clamp(1.9rem, 5.5vw, 2.875rem);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.summary { color: var(--muted); }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: setup-step;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 1.75rem);
  counter-increment: setup-step;
}

.step + .step { border-top: 1px solid var(--line); }

.step::before {
  content: counter(setup-step);
  display: grid;
  place-items: center;
  align-self: start;
  aspect-ratio: 1;
  border-radius: .5rem;
  background: var(--step-background);
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
}

h2 {
  margin: .125rem 0 .375rem;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.4;
}

.step-body > p + p,
.help-body > p + p { margin-top: .375rem; }

code, textarea {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

code {
  padding: .12em .35em;
  border-radius: .25rem;
  background: var(--inset);
  font-size: .9em;
  overflow-wrap: anywhere;
}

.setup { margin-top: .875rem; }

label {
  display: block;
  margin-bottom: .375rem;
  font-weight: 650;
}

.setup-controls {
  display: grid;
  grid-template-columns: minmax(0, 14rem) max-content;
  gap: .625rem;
}

button, select, textarea {
  min-height: 2.75rem;
  border: 1px solid var(--control);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

button, select {
  padding: .5rem .75rem;
  font-family: inherit;
}

button { font-weight: 650; }
button:not(:disabled), select:not(:disabled), summary { cursor: pointer; }
button:not(:disabled):hover { background: var(--inset); }

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.primary:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.primary:disabled {
  border-color: var(--line);
  background: var(--inset);
  color: var(--muted);
}

:is(button, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hint, .status, footer {
  color: var(--muted);
  font-size: .875rem;
}

.setup > .hint, .setup > .status { margin-top: .375rem; }
.status:empty { margin: 0; }
.status[data-state="error"] { color: var(--error); }

.command-panel {
  margin-top: .875rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--inset);
}

textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  margin-block: .625rem;
  padding: .625rem;
  resize: vertical;
  font-size: .875rem;
  line-height: 1.5;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .625rem;
}

.pair-options {
  margin-block: .375rem .5rem;
  padding-inline-start: 1.25rem;
}

.help {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
}

summary {
  padding: .625rem 1rem;
  font-weight: 650;
}

summary::marker { color: var(--accent); }

.help-body { padding: 0 1rem 1rem; }
.help-body dl { margin: .75rem 0 0; }
.help-body dt { font-weight: 650; }
.help-body dd { margin: 0 0 .5rem; }
.help-body dd:last-child { margin-bottom: 0; }

footer { margin-top: 1rem; }

@media (max-width: 36rem) {
  .intro { margin-bottom: 1.25rem; }
  .step {
    grid-template-columns: 1.625rem minmax(0, 1fr);
    gap: .625rem;
  }
  .setup-controls { grid-template-columns: minmax(0, 1fr); }
}
