/* shadcn/ui-inspired light theme (zinc) */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --success: 142 76% 36%;
  --warning: 38 92% 50%;
  --radius: 0.5rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, hsl(240 4.8% 95.9% / 0.9), transparent 55%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: hsl(var(--border));
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: hsl(var(--foreground)); }

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}
.shell-focus {
  width: min(720px, calc(100% - 2rem));
}

/* ----- Nav (shadcn header style) ----- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  background: hsl(var(--background) / 0.85);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0.75rem;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: 0.9; }

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
  text-decoration: none;
}
.nav-links a.active {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}

/* ----- Hero ----- */
.hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 0.25rem 0.15rem;
}
.hero-focus {
  text-align: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.hero-focus .eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.hero-focus .hero-lead {
  margin: 0 auto;
  max-width: 36rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.hero-focus h1 {
  font-size: clamp(1.85rem, 5vw, 2.5rem);
}
.hero p {
  margin: 0;
  max-width: 62ch;
  color: hsl(var(--muted-foreground));
  font-size: 1.015rem;
}

/* Focused install card */
.card-focus {
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: var(--shadow-md);
}
.card-focus .tabs-lg {
  width: 100%;
  margin-bottom: 1rem;
  justify-content: stretch;
}
.card-focus .tabs-lg .tab {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
}
.cmd-block-lg pre {
  font-size: 0.875rem;
  padding: 1.1rem 1.15rem 1.2rem;
  min-height: 4.5rem;
}
.cmd-block-lg .cmd-head {
  padding: 0.55rem 0.7rem 0.55rem 1rem;
}
.cmd-block-lg .btn.primary {
  min-width: 6.5rem;
}
.hint {
  margin: 1rem 0 0.35rem;
  padding: 0.75rem 0.9rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  line-height: 1.5;
  background: hsl(var(--muted) / 0.45);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.hint code {
  font-size: 0.85em;
}
.after-cmd {
  margin: 1.15rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}
.after-cmd strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}
.after-cmd a {
  font-weight: 500;
}

/* Collapsible folds */
.fold-stack {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.fold {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: hsl(var(--card));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.fold > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background 0.15s ease;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid hsl(var(--muted-foreground));
  border-bottom: 1.5px solid hsl(var(--muted-foreground));
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-top: -0.15rem;
}
.fold[open] > summary::after {
  transform: rotate(225deg);
  margin-top: 0.15rem;
}
.fold > summary:hover {
  background: hsl(var(--muted) / 0.45);
}
.fold-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.9rem;
}
.fold-body-stack {
  display: grid;
  gap: 1.15rem;
}
.fold-sub {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.fold-note {
  margin: 0 0 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
}
.plain-list {
  margin: 0;
  padding-left: 1.15rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}
.plain-list li + li { margin-top: 0.35rem; }
.plain-list code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
  color: hsl(var(--foreground));
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.badge strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ----- Layout ----- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav {
    border-radius: var(--radius);
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links { justify-content: flex-start; }
}

/* ----- Card ----- */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card h2,
.card h3 {
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  font-weight: 600;
}
.card h2 { font-size: 1.125rem; }
.card h3 { font-size: 1rem; }
.card p {
  margin: 0 0 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.925rem;
}
.card p:last-child { margin-bottom: 0; }
.card.soft {
  background: hsl(var(--muted) / 0.45);
  box-shadow: none;
}

/* ----- Steps ----- */
.steps {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  display: grid;
  place-items: center;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid hsl(var(--border));
}
.steps strong {
  color: hsl(var(--foreground));
  font-size: 0.9rem;
}
.steps span {
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
}
.steps code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
}

/* ----- Command block ----- */
.cmd-block {
  position: relative;
  margin: 0.75rem 0 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.55);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0.45rem 0.85rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.7);
}
.cmd-head .label {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-family: var(--mono);
}
.cmd-block pre {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: hsl(var(--foreground));
  white-space: pre-wrap;
  word-break: break-all;
}
.cmd-block code { font-family: inherit; }

/* ----- Buttons (shadcn button variants) ----- */
.btn {
  appearance: none;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1.25;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  text-decoration: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.btn.primary {
  background: hsl(var(--primary));
  border-color: transparent;
  color: hsl(var(--primary-foreground));
}
.btn.primary:hover {
  background: hsl(var(--primary) / 0.9);
  color: hsl(var(--primary-foreground));
}
.btn.copied {
  border-color: hsl(var(--success) / 0.4);
  color: hsl(var(--success));
  background: hsl(142 76% 36% / 0.08);
}

/* ----- Tabs (shadcn-like pills / muted track) ----- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  border-radius: var(--radius);
  background: hsl(var(--muted));
  border: 1px solid transparent;
}
.tab {
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tab:hover { color: hsl(var(--foreground)); }
.tab.active {
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  box-shadow: var(--shadow-sm);
}

.panel { display: none; }
.panel.active { display: block; }

/* ----- Key / value rows ----- */
.kv {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.kv-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  font-size: 0.85rem;
}
.kv-row .k {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}
.kv-row .v {
  font-family: var(--mono);
  color: hsl(var(--foreground));
  word-break: break-all;
  font-size: 0.8rem;
}
.kv-row .v.muted {
  color: hsl(var(--muted-foreground));
  font-family: var(--font);
  font-size: 0.85rem;
}
.kv-row code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: hsl(var(--muted));
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
}

/* ----- Callouts / Alerts ----- */
.callout {
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--foreground));
  background: hsl(var(--muted) / 0.5);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  margin: 0.75rem 0;
  font-size: 0.875rem;
}
.callout.warn {
  border-color: hsl(var(--warning) / 0.35);
  border-left-color: hsl(var(--warning));
  background: hsl(48 96% 89% / 0.55);
  color: hsl(32 95% 28%);
}
.callout.ok {
  border-color: hsl(var(--success) / 0.3);
  border-left-color: hsl(var(--success));
  background: hsl(142 76% 36% / 0.08);
  color: hsl(144 61% 20%);
}
.callout strong { color: hsl(var(--foreground)); }
.callout code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: hsl(var(--background) / 0.7);
  border: 1px solid hsl(var(--border));
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
}

.section { margin-top: 1.75rem; }
.section > h2 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* ----- Guide ----- */
.toc {
  display: grid;
  gap: 0.2rem;
}
.toc a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.toc a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
  text-decoration: none;
}

.guide-layout {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-side { position: static !important; }
}
.guide-side {
  position: sticky;
  top: 5rem;
}
.guide-main h2 {
  margin: 1.75rem 0 0.6rem;
  padding-top: 0.35rem;
  scroll-margin-top: 5.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.guide-main h2:first-child { margin-top: 0; }
.guide-main h3 {
  margin: 1.15rem 0 0.45rem;
  color: hsl(var(--foreground));
  font-size: 1rem;
  font-weight: 600;
  scroll-margin-top: 5.5rem;
}
.guide-main p,
.guide-main li {
  color: hsl(var(--muted-foreground));
  font-size: 0.925rem;
}
.guide-main ul,
.guide-main ol { padding-left: 1.2rem; }
.guide-main code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  color: hsl(var(--foreground));
}
.guide-main pre {
  background: hsl(var(--muted) / 0.65);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.guide-main pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ----- Footer / forms ----- */
.footer {
  margin-top: 2.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  justify-content: space-between;
}
.footer a {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.inline-actions a.btn { text-decoration: none; }

.site-url-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.site-url-form label {
  color: hsl(var(--muted-foreground));
  font-size: 0.825rem;
  font-weight: 500;
}
.site-url-form input {
  width: 100%;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.site-url-form input::placeholder {
  color: hsl(var(--muted-foreground) / 0.7);
}
.site-url-form input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.25);
}

/* Inline code in cards (outside guide-main) */
.card code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
  color: hsl(var(--foreground));
}
.cmd-block code {
  background: none;
  border: none;
  padding: 0;
}
