:root {
  color-scheme: light;
  --ink: #17243b;
  --muted: #64738d;
  --soft: #f3f6fb;
  --paper: #ffffff;
  --line: #dfe6f2;
  --accent: #2d65d8;
  --accent-strong: #1f4eae;
  --accent-soft: #edf3ff;
  --warning: #fff8e8;
  --warning-line: #f0d59a;
  --shadow: 0 20px 55px rgba(31, 57, 101, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid #8db3ff;
  outline-offset: 3px;
}

.site-header {
  border-bottom: 1px solid rgba(223, 230, 242, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
}

.brand {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 9px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: -1px;
}

.header-note {
  color: var(--muted);
  font-size: 13px;
}

.page-shell {
  display: grid;
  grid-template-columns: 215px minmax(0, 860px);
  gap: 42px;
  align-items: start;
  width: min(1180px, calc(100% - 40px));
  margin: 42px auto 70px;
}

.toc {
  position: sticky;
  top: 28px;
  padding: 17px 0 17px 2px;
}

.toc-title {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li + li {
  margin-top: 5px;
}

.toc a {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

.toc a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.toc-number {
  color: #8b99af;
  font-variant-numeric: tabular-nums;
}

.article {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(223, 230, 242, 0.95);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.article-inner {
  padding: 63px 72px 80px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(32px, 5vw, 50px);
}

h2 {
  display: flex;
  gap: 13px;
  align-items: baseline;
  margin: 58px 0 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: clamp(25px, 3vw, 32px);
  scroll-margin-top: 30px;
}

h2:first-of-type {
  margin-top: 46px;
}

h3 {
  margin: 38px 0 10px;
  font-size: 22px;
  scroll-margin-top: 30px;
}

.step-number {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.lead {
  max-width: 680px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.callout {
  margin: 30px 0;
  padding: 16px 19px;
  border: 1px solid #cfe0ff;
  border-radius: 11px;
  background: var(--accent-soft);
  color: #355786;
}

.callout strong {
  color: var(--accent-strong);
}

.callout.warning {
  border-color: var(--warning-line);
  background: var(--warning);
  color: #735b27;
}

.callout.warning strong {
  color: #5d471d;
}

p {
  margin: 13px 0;
}

ul,
ol {
  padding-left: 1.35em;
}

li + li {
  margin-top: 5px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0 4px;
  padding: 8px 14px;
  border: 1px solid #bfd2f4;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}

.link-button::after {
  content: "↗";
  font-size: 18px;
  line-height: 1;
}

.code-link {
  display: block;
  margin: 10px 0 19px;
  padding: 13px 15px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  color: #405170;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  text-decoration: none;
}

.code-link:hover {
  border-color: #b8ccf0;
  background: var(--accent-soft);
}

figure {
  margin: 23px 0 29px;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faff;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 28px;
  padding: 15px 17px;
  border-radius: 10px;
  background: #f7f9fd;
  color: var(--muted);
  font-size: 14px;
}

.next-step strong {
  color: var(--ink);
}

.site-footer {
  width: min(860px, calc(100% - 40px));
  margin: -25px auto 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.catalog {
  width: min(860px, calc(100% - 40px));
  margin: 42px auto 70px;
}

.catalog-intro {
  max-width: 650px;
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 18px;
}

.guide-list {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.guide-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.guide-card:hover {
  border-color: #b8ccf0;
  box-shadow: 0 12px 28px rgba(31, 57, 101, 0.08);
  color: var(--ink);
  transform: translateY(-2px);
}

.guide-card h2 {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 24px;
}

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

.guide-card-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 24px;
  }

  .toc {
    position: static;
    padding: 0;
  }

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

  .article-inner {
    padding: 45px 48px 60px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .header-inner,
  .page-shell,
  .catalog,
  .site-footer {
    width: min(100% - 24px, 860px);
  }

  .header-inner {
    min-height: 58px;
  }

  .header-note {
    display: none;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }

  .article {
    border-radius: 13px;
  }

  .article-inner {
    padding: 34px 22px 45px;
  }

  .lead {
    font-size: 17px;
  }

  h2 {
    gap: 9px;
    margin-top: 44px;
    font-size: 26px;
  }

  .next-step {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .toc,
  .site-footer {
    display: none;
  }

  .page-shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .article {
    border: 0;
    box-shadow: none;
  }

  .article-inner {
    padding: 0;
  }

  a {
    color: inherit;
  }
}
