:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f0ece4;
  --text: #1c2321;
  --muted: #5b6662;
  --border: #ddd6ca;
  --accent: #1f5f5b;
  --accent-text: #ffffff;
  --accent-soft: #e2efec;
  --highlight: #8f5a10;
  --code-bg: #17201e;
  --code-text: #e9f1ee;
  --error: #b42318;
  --error-soft: #fdecea;
  --warning: #8a5a00;
  --warning-soft: #fdf3dc;
  --focus: #2f7f79;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111615;
    --surface: #182120;
    --surface-2: #1f2a28;
    --text: #e6ece9;
    --muted: #9aa8a3;
    --border: #2c3a37;
    --accent: #5fb3aa;
    --accent-text: #0d1413;
    --accent-soft: #1d3330;
    --highlight: #e8a33d;
    --code-bg: #0b0f0e;
    --code-text: #dfeae6;
    --error: #ff8a80;
    --error-soft: #3a1c1a;
    --warning: #f1c46b;
    --warning-soft: #33290f;
    --focus: #7fd0c6;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* header */
.top { border-bottom: 1px solid var(--border); }
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.top-links { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.top-links a { color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--text); }
.link-button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
}
.link-button:hover { color: var(--text); border-color: var(--muted); }

/* intro */
.intro { padding: 44px 0 20px; }
.tagline {
  margin: 0 0 6px;
  color: var(--highlight);
  font-weight: 600;
  font-size: 0.95rem;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.lead { margin: 0; color: var(--muted); max-width: 60ch; }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
}
.section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 650;
}
.steps .section-title + p, .steps p { margin: 0 0 8px; }
.steps .section-title:not(:first-child) { margin-top: 22px; }

/* fields */
.field + .field { margin-top: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="url"], input[type="password"], input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: 15px/1.4 var(--mono);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input:focus-visible { outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--error); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.message {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.message.error { color: var(--error); background: var(--error-soft); }
.message.warning { color: var(--warning); background: var(--warning-soft); }

.options {
  border: 0;
  padding: 0;
  margin: 20px 0 0;
}
.options legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  margin: 0;
  padding: 6px 0;
  cursor: pointer;
}
.check input {
  width: 18px; height: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
}

/* buttons */
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.primary, .ghost {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.primary {
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
}
.primary:not(:disabled):hover { filter: brightness(1.08); }
.ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ghost:hover { border-color: var(--muted); }
.ghost.small { min-height: 34px; padding: 0 12px; font-size: 0.9rem; }
.done { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
[role="tab"] {
  min-height: 40px;
  padding: 4px 10px;
  line-height: 1.25;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.93rem;
}
[role="tab"]:hover { color: var(--text); }
[role="tab"][aria-selected="true"] {
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
[role="tabpanel"] { margin-top: 12px; }
[role="tabpanel"]:focus-visible { border-radius: 8px; }

/* the command */
.command-box {
  margin-top: 10px;
  background: var(--code-bg);
  border-radius: 10px;
  padding: 14px;
}
.command-box pre {
  margin: 0;
  max-height: 14em;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--code-text);
  font: 14px/1.6 var(--mono);
}
.status { margin: 0; color: #aab8b3; font-size: 0.95rem; }
.status.error { color: #ffb4ab; }
.command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.command-box .copy-status { color: #cfe3dd; }
.copy-status { font-size: 0.9rem; color: var(--accent); }
.copy-status.error { color: var(--error); }
.command-box .copy-status.error { color: #ffb4ab; }
.command-box .primary { --accent-text: #0d1413; background: #7fd0c6; border-color: #7fd0c6; }

.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 4px;
}
.mini code { flex: 1; font: 15px/1.4 var(--mono); }

code { font-family: var(--mono); }

/* privacy and footer */
.privacy {
  margin: 26px 0 10px;
  padding: 18px 20px;
  border-left: 3px solid var(--highlight);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.privacy p { margin: 0 0 6px; color: var(--muted); }
.privacy p:last-child { margin: 0; }
.foot {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--muted); }

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .intro { padding-top: 28px; }
  .card { padding: 16px; }
  .tabs { gap: 2px; }
  [role="tab"] { padding: 4px 6px; font-size: 0.85rem; }
  .command-actions .primary { flex: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .primary, .ghost, [role="tab"], .link-button { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}
