:root {
  color-scheme: light;
  --brand: #1459e8;
  --brand-dark: #0d3fb4;
  --brand-soft: #eef4ff;
  --ink: #172033;
  --muted: #667085;
  --line: #e5eaf3;
  --surface: #ffffff;
  --page: #f4f7fb;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(20, 89, 232, 0.1), transparent 28rem),
    var(--page);
  line-height: 1.7;
}

a {
  color: var(--brand);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(229, 234, 243, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 89, 232, 0.2);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #bdc9dc;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.button--primary {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(135deg, #2f7af7, var(--brand));
  box-shadow: 0 10px 26px rgba(20, 89, 232, 0.22);
}

.hero {
  padding: 70px 20px 54px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 37, 100, 0.97), rgba(20, 89, 232, 0.95)),
    #1459e8;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero__inner::after {
  position: absolute;
  top: -100px;
  right: -70px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 48% 52% 60% 40%;
  background: rgba(255, 255, 255, 0.06);
  content: "";
  transform: rotate(18deg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 22px 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.hero p {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.page-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 900px);
  gap: 34px;
  width: min(1240px, calc(100% - 40px));
  margin: 34px auto 90px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  padding: 18px 12px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(23, 32, 51, 0.06);
  overflow: auto;
}

.toc__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 12px;
  font-size: 14px;
  font-weight: 800;
}

.toc__links {
  display: grid;
  gap: 2px;
}

.toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 9px;
  color: #475467;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.45;
}

.toc a:hover,
.toc a.is-active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.toc a[data-level="2"] {
  padding-left: 18px;
}

.toc a[data-level="3"] {
  padding-left: 28px;
}

.toc a[data-level="4"],
.toc a[data-level="5"] {
  padding-left: 38px;
  font-size: 12px;
}

.toc-toggle {
  display: none;
  border: 0;
  color: var(--brand);
  background: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.article {
  min-width: 0;
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 51, 0.08);
}

.article > :first-child {
  margin-top: 0;
}

.article h2,
.article h3,
.article h4,
.article h5,
.article h6 {
  scroll-margin-top: 104px;
  color: #111827;
  line-height: 1.35;
}

.article h2 {
  margin: 58px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 30px;
}

.article h3 {
  margin: 42px 0 16px;
  font-size: 24px;
}

.article h4 {
  margin: 34px 0 14px;
  font-size: 20px;
}

.article h5,
.article h6 {
  margin: 28px 0 12px;
  font-size: 17px;
}

.article p {
  margin: 12px 0;
  color: #344054;
}

.intro-card,
.callout,
.quote {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 16px;
}

.intro-card {
  border: 1px solid #bcd0ff;
  background: linear-gradient(135deg, #f5f8ff, #eef4ff);
}

.callout {
  border: 1px solid #fde68a;
  background: #fffbeb;
}

.quote {
  border-left: 4px solid var(--brand);
  background: #f7f9fc;
}

.ordered-block {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
  color: #344054;
}

.ordered-block__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.table-scroll {
  width: 100%;
  margin: 18px 0 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  min-width: 120px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: #27364f;
  background: #f7f9fc;
  font-size: 14px;
}

tr:last-child > * {
  border-bottom: 0;
}

tr > *:last-child {
  border-right: 0;
}

td p,
th p {
  margin: 2px 0;
  font-size: 14px;
}

.tutorial-figure {
  margin: 16px auto 26px;
}

.tutorial-shot {
  position: relative;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #eef2f7;
  box-shadow: 0 14px 38px rgba(23, 32, 51, 0.1);
  overflow: hidden;
  cursor: zoom-in;
}

.tutorial-shot > img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-overlay {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid rgba(20, 89, 232, 0.12);
  border-radius: 16px;
  color: #12346f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.14);
  text-align: left;
  backdrop-filter: blur(9px);
}

.brand-overlay img {
  width: clamp(30px, 4vw, 56px);
  height: clamp(30px, 4vw, 56px);
  border-radius: 14px;
  flex: none;
}

.brand-overlay strong {
  display: block;
  font-size: clamp(15px, 2.2vw, 28px);
  line-height: 1.15;
}

.brand-overlay small {
  display: block;
  margin-top: 3px;
  color: #53657e;
  font-size: clamp(8px, 1.05vw, 13px);
}

.brand-overlay--welcome {
  top: 11%;
  left: 21%;
  width: 32%;
  min-height: 25%;
}

.brand-overlay--hero {
  top: 27%;
  left: 34%;
  width: 48%;
  min-height: 24%;
}

.brand-overlay--corner {
  top: 1.7%;
  left: 0.7%;
  min-height: 7%;
  padding: 5px 8px;
  border-radius: 8px;
}

.brand-overlay--corner img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.brand-overlay--corner strong {
  font-size: 11px;
}

.brand-overlay--corner small {
  display: none;
}

.figure-caption {
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

pre {
  padding: 18px;
  border-radius: 14px;
  color: #dbeafe;
  background: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

hr {
  height: 1px;
  margin: 34px 0;
  border: 0;
  background: var(--line);
}

.article-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(9, 16, 30, 0.88);
}

.lightbox.is-open {
  display: flex;
}

.lightbox__content {
  position: relative;
  width: min(1500px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.lightbox__content .tutorial-shot {
  cursor: zoom-out;
}

.lightbox__close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 28px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    position: sticky;
    top: 82px;
    z-index: 30;
    max-height: none;
    padding: 14px 16px;
  }

  .toc-toggle {
    display: inline-block;
  }

  .toc__links {
    display: none;
    max-height: 55vh;
    overflow: auto;
  }

  .toc.is-open .toc__links {
    display: grid;
  }
}

@media (max-width: 680px) {
  .site-header__inner,
  .page-shell {
    width: min(100% - 24px, 1240px);
  }

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

  .brand span {
    display: none;
  }

  .header-actions .button:first-child {
    display: none;
  }

  .button {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
  }

  .hero {
    padding: 52px 16px 42px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .page-shell {
    gap: 18px;
    margin-top: 18px;
  }

  .article {
    padding: 24px 18px 38px;
    border-radius: 18px;
  }

  .article h2 {
    margin-top: 44px;
    font-size: 25px;
  }

  .article h3 {
    font-size: 21px;
  }

  .table-scroll {
    margin-right: -8px;
    margin-left: -8px;
    width: calc(100% + 16px);
  }

  .brand-overlay {
    gap: 7px;
    padding: 7px 10px;
    border-radius: 9px;
  }

  .brand-overlay--welcome {
    left: 18%;
    width: 38%;
  }

  .brand-overlay--hero {
    left: 30%;
    width: 56%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
