:root {
  color-scheme: dark;
  --bg: #090a0c;
  --surface: #111318;
  --surface-soft: #171b22;
  --text: #f1f3f6;
  --muted: #9299a4;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #4c8dff;
  --accent-strong: #83adff;
  --accent-soft: rgba(76, 141, 255, 0.13);
  --success: #2de2c5;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.24);
  --radius: 18px;
  --content: 780px;
  --header-bg: rgba(9, 10, 12, 0.78);
  --header-line: rgba(255, 255, 255, 0.055);
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-border: rgba(255, 255, 255, 0.13);
  --control-text: #e9edf4;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-soft: #eef2f8;
  --text: #182033;
  --muted: #667187;
  --line: rgba(30, 48, 78, 0.12);
  --accent: #2f6fe8;
  --accent-strong: #245ed9;
  --accent-soft: rgba(47, 111, 232, 0.09);
  --success: #07856d;
  --shadow: 0 18px 52px rgba(36, 55, 85, 0.12);
  --header-bg: rgba(246, 247, 250, 0.84);
  --header-line: rgba(30, 48, 78, 0.1);
  --control-bg: rgba(255, 255, 255, 0.76);
  --control-border: rgba(30, 48, 78, 0.14);
  --control-text: #1f2b40;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 44% at 62% -8%, rgba(76, 141, 255, 0.16), transparent 64%),
    radial-gradient(ellipse 46% 34% at 96% 22%, rgba(146, 94, 255, 0.1), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
}

html[data-theme='light'] body {
  background:
    radial-gradient(ellipse 70% 44% at 62% -8%, rgba(47, 111, 232, 0.12), transparent 64%),
    radial-gradient(ellipse 46% 34% at 96% 22%, rgba(118, 84, 220, 0.08), transparent 70%),
    var(--bg);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

img,
svg {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(1.35);
}

.site-header__inner,
.site-footer__inner,
.shell,
.article {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.site-header__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand__mark {
  display: block;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  flex: 0 0 auto;
  filter: drop-shadow(0 7px 20px rgba(59, 130, 246, 0.22));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
}

.site-header__actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.site-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-language-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.site-language-toggle:hover {
  background: var(--control-bg);
  color: var(--text);
}

.site-language-toggle svg,
.site-theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.site-theme-toggle {
  display: inline-flex;
  width: 58px;
  height: 30px;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--control-bg) 72%, transparent);
  color: var(--muted);
  cursor: pointer;
}

.site-theme-toggle:hover {
  border-color: color-mix(in srgb, var(--text) 22%, var(--control-border));
  background: color-mix(in srgb, var(--control-bg) 92%, transparent);
}

.site-theme-toggle__track {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: 1fr 1fr;
}

.site-theme-toggle__thumb {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-theme-toggle[data-current-theme='dark'] .site-theme-toggle__thumb {
  transform: translateX(100%);
}

.site-theme-toggle__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.site-theme-toggle[data-current-theme='light'] .site-theme-toggle__icon--light,
.site-theme-toggle[data-current-theme='dark'] .site-theme-toggle__icon--dark {
  color: var(--accent);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--control-bg);
  color: var(--control-text) !important;
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
}

.nav-cta:hover {
  border-color: rgba(123, 170, 255, 0.45);
  background: rgba(76, 141, 255, 0.12);
}

.shell {
  padding-block: 82px 106px;
}

.hero-copy {
  max-width: 980px;
  margin-bottom: 52px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
}

h1,
h2,
h3 {
  letter-spacing: -0.035em;
  line-height: 1.22;
}

h1 {
  max-width: 900px;
  margin: 0 0 22px;
  font-size: clamp(44px, 5.7vw, 78px);
  font-weight: 710;
}

.hero-copy h1 {
  background: linear-gradient(105deg, #f4f7ff 4%, #a7c7ff 52%, #b39aff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin: 52px 0 18px;
  font-size: clamp(26px, 3.8vw, 38px);
}

h3 {
  margin: 34px 0 10px;
  font-size: 22px;
}

p {
  margin: 0 0 1.15em;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.65;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.content-loading {
  padding: 80px 0;
  color: var(--muted);
  text-align: center;
}

.guide-tags,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-tags {
  margin-top: 24px;
}

.guide-tags a,
.card-tags a {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.guide-tags a.is-active,
.guide-tags a:hover,
.card-tags a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.card-tags {
  margin: 18px 0;
}

.guide-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 38px;
}

.guide-pagination a {
  min-width: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.guide-pagination a.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.content-card {
  min-height: 230px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.content-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.content-card__meta {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-card__badge {
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--success) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: var(--success);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.content-card h2,
.content-card h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.content-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.content-card a {
  font-weight: 700;
  text-decoration: none;
}

.article {
  display: block;
  width: min(980px, calc(100% - 64px));
  padding-block: 58px 100px;
}

.article__body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.article__body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 14px;
  object-fit: contain;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: inherit;
}

.article h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 20px 0 42px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.section-figure {
  margin: 28px 0 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  background: var(--surface-soft);
}

.section-figure figcaption {
  padding: 14px 18px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.copy-blocks {
  display: grid;
  gap: 20px;
  margin: 0 0 48px;
}

.copy-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.copy-block__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 24px 18px;
}

.copy-block__heading .eyebrow {
  margin-bottom: 10px;
}

.copy-block__heading h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.copy-block__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.copy-block__heading button {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.copy-block pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 22px 24px;
  border-top: 1px solid var(--line);
  background: #17141f;
  color: #ece8f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-block code {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.demo-block {
  margin: 0 0 54px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 72%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow);
}

.demo-block__heading h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
}

.demo-block__heading p {
  margin-bottom: 24px;
  color: var(--muted);
}

.demo-prompt {
  padding: 22px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
}

.demo-prompt > span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.demo-prompt blockquote {
  margin: 12px 0 16px;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  font-size: 17px;
  line-height: 1.75;
}

.demo-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.demo-surface {
  position: relative;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.demo-surface:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.demo-surface__index {
  display: block;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.demo-surface h3 {
  margin: 0 0 7px;
  font-size: 19px;
}

.demo-surface p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.demo-surface ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.demo-surface li {
  margin: 0;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  line-height: 1.5;
}

.demo-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.demo-columns h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.demo-flow,
.demo-checks {
  margin: 0;
  padding-left: 1.25em;
  color: var(--muted);
  font-size: 14px;
}

.demo-flow li,
.demo-checks li {
  margin-bottom: 9px;
}

.article__body h2 {
  padding-top: 10px;
  scroll-margin-top: 90px;
}

.article__body h3 {
  scroll-margin-top: 90px;
}

.article__body ul,
.article__body ol {
  padding-left: 1.4em;
}

.article__body li {
  margin-bottom: 0.55em;
}

.article__body table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.65;
}

.article__body th,
.article__body td {
  padding: 13px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article__body th {
  background: var(--surface-soft);
}

.article__body code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--surface-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.code-block {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 24px 0 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #17141f;
  box-shadow: 0 16px 42px rgba(7, 9, 14, 0.18);
}

.code-block pre {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 52px 20px 20px;
  border: 0;
  background: transparent;
  color: #ece8f7;
  white-space: pre;
  tab-size: 2;
}

.code-block pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1.75;
  white-space: inherit;
}

.code-block__copy {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8e4f3;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.code-block__copy:hover {
  border-color: rgba(131, 173, 255, 0.48);
  background: rgba(76, 141, 255, 0.16);
}

.callout {
  margin: 28px 0;
  padding: 22px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--accent-soft);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
}

.step-list {
  counter-reset: steps;
  display: grid;
  gap: 16px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.step-list > li {
  counter-increment: steps;
  position: relative;
  padding: 21px 22px 19px 68px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.step-list > li::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  top: 20px;
  left: 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.article-aside {
  position: sticky;
  top: 98px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.article-aside h2 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-aside ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.article-aside li {
  margin-bottom: 10px;
}

.article-aside a {
  color: inherit;
  text-decoration: none;
}

.article-aside a:hover {
  color: var(--accent);
}

.related {
  margin-top: 50px;
  padding: 26px;
  border-radius: 18px;
  background: var(--surface);
}

.related h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.related ul {
  margin: 0;
  padding-left: 20px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  padding-block: 44px;
}

.site-footer p {
  max-width: 440px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 10px 22px;
  font-size: 13px;
}

.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .article {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .article-aside {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header__inner,
  .site-footer__inner,
  .shell,
  .article {
    width: min(100% - 28px, 1120px);
  }

  .site-header__inner {
    min-height: 62px;
  }

  .site-nav {
    gap: 14px;
  }

  .site-header__actions {
    gap: 8px;
  }

  .site-controls {
    gap: 5px;
  }

  .site-theme-toggle {
    width: 52px;
    height: 28px;
  }

  .site-language-toggle {
    width: 28px;
    height: 28px;
  }

  .site-nav a:not(.nav-cta):nth-child(2),
  .site-nav a:not(.nav-cta):nth-child(4) {
    display: none;
  }

  .shell {
    padding-block: 46px 70px;
  }

  .article {
    padding-block: 38px 70px;
  }

  .copy-block__heading {
    flex-direction: column;
    padding: 20px 18px 16px;
  }

  .copy-block pre {
    max-height: 420px;
    padding: 18px;
    font-size: 11px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .demo-block {
    padding: 22px;
  }

  .demo-surfaces,
  .demo-columns {
    grid-template-columns: 1fr;
  }

  .demo-surface:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .content-card {
    min-height: 0;
    padding: 23px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}
