:root {
  color-scheme: light;
  --bg: #fafafa;
  --bg-soft: #f4f4f5;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --border: rgba(212, 212, 216, 0.72);
  --text: #18181b;
  --muted: #71717a;
  --primary: #99182f;
  --primary-2: #dc3852;
  --primary-soft: #fff1f3;
  --blue: #2563eb;
  --green: #059669;
  --terminal: #0f172a;
  --terminal-2: #1e293b;
  --shadow: 0 20px 50px rgba(24, 24, 27, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(185, 31, 56, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #fafafa 0%, #fff1f3 42%, #f4f4f5 100%);
  background-size: 64px 64px, 64px 64px, auto;
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "tnum";
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid rgba(212, 212, 216, 0.55);
  background: rgba(250, 250, 250, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.top-nav,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 24px rgba(153, 24, 47, 0.22);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 14px;
}

.top-nav a {
  border-radius: 8px;
  color: #52525b;
  padding: 8px 10px;
  transition: background 160ms ease, color 160ms ease;
}

.top-nav a:hover {
  background: rgba(244, 244, 245, 0.95);
  color: #18181b;
}

.top-nav .nav-action,
.btn.primary {
  background: var(--primary);
  color: #ffffff;
}

.top-nav .nav-action:hover,
.btn.primary:hover {
  background: #7f172d;
  color: #ffffff;
}

main {
  padding: 0 24px 64px;
}

.hero {
  display: grid;
  max-width: 1160px;
  min-height: 520px;
  align-items: center;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.8fr);
  gap: 56px;
  margin: 0 auto;
  padding: 72px 0 48px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  color: #111827;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  color: #4b5563;
  font-size: 19px;
  line-height: 1.78;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  border-color: rgba(212, 212, 216, 0.92);
  background: rgba(255, 255, 255, 0.76);
  color: #3f3f46;
}

.terminal {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--terminal-2), var(--terminal));
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-bar span:nth-child(1) {
  background: #ef4444;
}

.terminal-bar span:nth-child(2) {
  background: #eab308;
}

.terminal-bar span:nth-child(3) {
  background: #22c55e;
}

.terminal-bar em {
  flex: 1;
  margin-right: 52px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.terminal pre {
  margin: 0;
  padding: 26px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
}

.prompt,
.ok {
  color: #22c55e;
  font-weight: 700;
}

.muted {
  color: #64748b;
}

.doc-shell {
  display: grid;
  max-width: 1160px;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin: 0 auto;
  align-items: start;
}

.side-index {
  position: sticky;
  top: 88px;
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.side-index p {
  margin: 0 0 8px;
  color: #18181b;
  font-size: 13px;
  font-weight: 700;
}

.side-index a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
}

.side-index a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.content-flow {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.band {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-head {
  max-width: 760px;
}

h2 {
  margin-bottom: 12px;
  color: #18181b;
  font-size: 28px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  color: #18181b;
  font-size: 16px;
}

.section-head p,
article p,
.warning p {
  color: #52525b;
  line-height: 1.72;
}

.steps,
.feature-grid,
.split {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.steps article,
.feature-grid article,
.split article {
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.steps span {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
}

.ruby {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.blue {
  background: linear-gradient(135deg, #38bdf8, var(--blue));
}

.green {
  background: linear-gradient(135deg, #22c55e, var(--green));
}

.split code {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: #18181b;
  color: #e4e4e7;
  padding: 12px;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 8px;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid rgba(228, 228, 231, 0.9);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4f4f5;
  color: #3f3f46;
  font-size: 13px;
}

td {
  color: #52525b;
  font-size: 14px;
}

td code {
  color: var(--primary);
  font-size: 12px;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #3f3f46;
  padding: 12px 14px;
}

.checklist input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.warning {
  background: linear-gradient(135deg, rgba(255, 241, 243, 0.96), rgba(255, 255, 255, 0.82));
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.link-list a {
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 8px;
  background: #ffffff;
  color: #3f3f46;
  padding: 14px;
}

.link-list a:hover {
  border-color: rgba(153, 24, 47, 0.36);
  color: var(--primary);
}

.site-footer {
  justify-content: space-between;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid rgba(212, 212, 216, 0.72);
  color: #71717a;
  font-size: 13px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #09090b;
    --bg-soft: #18181b;
    --surface: rgba(24, 24, 27, 0.78);
    --surface-strong: #18181b;
    --border: rgba(63, 63, 70, 0.8);
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --primary-soft: rgba(153, 24, 47, 0.18);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  }

  body {
    background:
      linear-gradient(rgba(185, 31, 56, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px),
      linear-gradient(135deg, #09090b 0%, #18181b 54%, #09090b 100%);
    background-size: 64px 64px, 64px 64px, auto;
  }

  .site-header {
    border-color: rgba(63, 63, 70, 0.78);
    background: rgba(9, 9, 11, 0.84);
  }

  h1,
  h2,
  h3,
  .side-index p {
    color: #ffffff;
  }

  .lead,
  .section-head p,
  article p,
  .warning p,
  td {
    color: #d4d4d8;
  }

  .top-nav a,
  .brand small,
  .side-index a,
  .site-footer {
    color: #a1a1aa;
  }

  .top-nav a:hover {
    background: rgba(39, 39, 42, 0.9);
    color: #ffffff;
  }

  .btn.secondary,
  .band,
  .side-index,
  .steps article,
  .feature-grid article,
  .split article,
  .checklist label,
  .link-list a {
    border-color: rgba(63, 63, 70, 0.82);
    background: rgba(24, 24, 27, 0.78);
    color: #e4e4e7;
  }

  table {
    border-color: rgba(63, 63, 70, 0.82);
    background: #18181b;
  }

  th {
    background: #27272a;
    color: #e4e4e7;
  }

  th,
  td {
    border-color: rgba(63, 63, 70, 0.82);
  }

  .warning {
    background: linear-gradient(135deg, rgba(61, 7, 20, 0.66), rgba(24, 24, 27, 0.82));
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 48px;
  }

  .doc-shell {
    grid-template-columns: 1fr;
  }

  .side-index {
    position: static;
  }

  .steps,
  .feature-grid,
  .split,
  .link-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main {
    padding-inline: 16px;
  }

  .site-header {
    padding: 14px 16px;
  }

  .top-nav a {
    padding: 7px 8px;
  }

  h1 {
    font-size: 40px;
  }

  .lead {
    font-size: 16px;
  }

  .band {
    padding: 20px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding-inline: 16px;
  }
}
