:root {
  --blue: #1467c7;
  --blue-dark: #0d4e99;
  --ink: #1b2430;
  --muted: #3e4d5c;
  --line: #d7e2ec;
  --bg: #f3f6fa;
  --card: #ffffff;
  --soft: #e8f2fb;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.75 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue-dark); }

a:hover { text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus { top: 8px; }

.sticky-stack {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-header,
.ad-bar,
.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  min-height: 68px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
}

.site-header nav a[aria-current="page"] {
  color: var(--blue-dark);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--blue);
}

.ad-bar {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 0 8px;
}

.ad-bar[hidden] { display: none; }

.ad-label {
  position: absolute;
  left: 0;
  top: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

#ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  margin: 0;

  background: transparent;
}

#ads > div { width: 76px; }

#ads figure { margin: 0; }

#ads a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #5c6770;
  border-radius: 16px;
}

#ads img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(24, 24, 24, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  background: #fff;
}

#ads a:hover img,
#ads a:focus-visible img {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 24px rgba(24, 24, 24, 0.18);
}

#ads .caption {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
  color: #5c6770;
}

main { padding: 28px 0 64px; }

.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 28px 22px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.2vw, 34px);
  line-height: 1.35;
  text-wrap: balance;
}

h2 {
  margin: 40px 0 12px;
  font-size: 26px;
  line-height: 1.4;
  text-wrap: balance;
}

section[id] {
  scroll-margin-top: 188px;
}

h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

p { margin: 0 0 14px; }

.lead { font-size: 18px; }

.meta-line,
figcaption,
.crumbs {
  color: var(--muted);
  font-size: 14px;
}

.toc,
.card,
.table-wrap,
.note,
.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.toc { padding: 18px 20px 8px; }

.toc ol {
  margin: 8px 0 10px;
  padding-left: 22px;
  columns: 2;
  column-gap: 32px;
}

.toc a { text-decoration: none; }

.toc a:hover { text-decoration: underline; }

.note {
  padding: 14px 16px;
  background: var(--soft);
  border-left: 4px solid var(--blue);
  margin: 16px 0;
}

.pair {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 20px 32px;
  align-items: start;
  margin: 18px 0 8px;
}

.shot {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

.shot img {
  display: block;
  width: min(400px, 100%);
  margin-inline: auto;
  border-radius: 16px;
  background: #101820;
}

.shot figcaption { margin-top: 8px; }

.table-wrap { overflow-x: auto; margin: 12px 0 18px; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  background: #eef5fc;
  color: var(--blue-dark);
  font-weight: 700;
}

.defs {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
}

.defs dt { font-weight: 700; }

.defs dd { margin: 0; }

ol.steps { padding-left: 22px; }

ol.steps li { margin: 6px 0; }

.faq { padding: 8px 20px 12px; }

.faq h3 { margin-top: 16px; }

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.related a,
.actions a {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
}

.crumbs { margin: 0 0 14px; }

.crumbs a { color: var(--muted); }

.error-code {
  margin: 0;
  font-size: 72px;
  line-height: 1;
  color: var(--blue);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 22px 0 32px;
}

.site-footer .wrap { width: min(var(--max), calc(100% - 32px)); }

.site-footer nav a { color: var(--muted); text-decoration: none; }

.site-footer p { color: var(--muted); font-size: 14px; margin-top: 10px; }

@media (max-width: 800px) {
  section[id] { scroll-margin-top: 236px; }
  .toc ol { columns: 1; }
  .pair { grid-template-columns: 1fr; }
  .defs { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #ads img { transition: none; }
}
