:root {
  --bg: #f5fbff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #10283a;
  --ink-soft: #29475a;
  --muted: #657f91;
  --line: rgba(28, 101, 150, 0.15);
  --line-strong: rgba(28, 101, 150, 0.24);
  --blue: #176be2;
  --green: #18a56f;
  --teal: #108aa2;
  --accent: var(--blue);
  --tint: #eaf5ff;
  --radius: 8px;
  --header-height: 72px;
  --drawer-width: 336px;
  --shadow-sm: 0 10px 28px rgba(24, 79, 111, 0.08);
  --shadow-md: 0 24px 70px rgba(24, 79, 111, 0.14);
  --shadow-lg: 0 36px 100px rgba(24, 79, 111, 0.18);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(23, 107, 226, 0.09), transparent 32%),
    linear-gradient(220deg, rgba(24, 165, 111, 0.11), transparent 34%),
    linear-gradient(180deg, #f7fcff 0%, #eef8f5 100%);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(23, 107, 226, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 165, 111, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.7) 46%, transparent 100%);
}

.site-texture {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 22%, rgba(255, 255, 255, 0.3) 70%, transparent),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 12px);
  opacity: 0.72;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 3px;
  background: transparent;
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--green));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: var(--header-height);
  padding: 12px clamp(18px, 3.2vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 252, 255, 0.82);
  backdrop-filter: blur(22px);
}

.brand,
.drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 14px 30px rgba(23, 107, 226, 0.24);
}

.brand strong,
.brand small,
.drawer-brand strong,
.drawer-brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong,
.drawer-brand strong {
  color: #0f2a3d;
  font-size: 1rem;
  line-height: 1.1;
}

.brand small,
.drawer-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.drawer-toggle,
.drawer-close,
.lightbox__close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(24, 79, 111, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.drawer-toggle:hover,
.drawer-close:hover,
.lightbox__close:hover {
  border-color: rgba(23, 107, 226, 0.42);
  background: #ffffff;
  transform: translateY(-1px);
}

.drawer-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: var(--ink);
}

.drawer-close {
  font-size: 1.55rem;
  line-height: 1;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.top-nav a,
.header-cta {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #2f4d61;
  font-size: 0.92rem;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.top-nav a:hover,
.top-nav a[data-active="true"],
.header-cta:hover {
  color: var(--blue);
  background: rgba(23, 107, 226, 0.08);
  transform: translateY(-1px);
}

.header-cta {
  border: 1px solid rgba(24, 165, 111, 0.18);
  color: #0d7c57;
  background: rgba(236, 251, 245, 0.78);
}

.app-frame {
  display: grid;
  grid-template-columns: var(--drawer-width) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 42px);
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 46px) 64px;
}

.page-stage,
.article {
  min-width: 0;
}

.drawer {
  position: sticky;
  top: calc(var(--header-height) + 18px);
  align-self: start;
  height: calc(100vh - var(--header-height) - 36px);
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 252, 255, 0.86)),
    linear-gradient(135deg, rgba(23, 107, 226, 0.05), rgba(24, 165, 111, 0.04));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-head .brand__mark {
  width: 36px;
  height: 36px;
}

.drawer-close {
  display: none;
}

.search {
  display: block;
  margin: 0 0 12px;
}

.search span {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 107, 226, 0.18);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search input:focus {
  border-color: rgba(23, 107, 226, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 107, 226, 0.11);
}

.search-results {
  display: grid;
  gap: 8px;
  margin: 10px 0 18px;
}

.search-results[hidden] {
  display: none;
}

.search-results a,
.empty-search {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.search-results span,
.search-results small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.search-results strong {
  color: var(--blue);
  font-size: 0.9rem;
  line-height: 1.35;
}

.drawer-title,
.drawer-toc h2,
.side-group h2 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.drawer-title {
  color: #173044;
}

.drawer-toc {
  margin: 16px 0 22px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tint) 54%, white);
}

.drawer-toc a,
.side-group a {
  display: block;
  border-radius: 8px;
  color: #38596d;
  line-height: 1.42;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drawer-toc a {
  margin: 3px 0;
  padding: 7px 9px;
  font-size: 0.84rem;
}

.drawer-toc .toc-level-3 {
  padding-left: 20px;
  color: #5f7889;
  font-size: 0.79rem;
}

.drawer-toc a:hover,
.drawer-toc a.is-active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.76);
}

.side-nav {
  display: grid;
  gap: 16px;
}

.side-group a {
  margin: 4px 0;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.side-group a:hover,
.side-group a[data-active="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  transform: translateX(2px);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: clamp(520px, 58vh, 720px);
  padding: clamp(30px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 251, 247, 0.86)),
    linear-gradient(110deg, rgba(23, 107, 226, 0.08), transparent 46%, rgba(24, 165, 111, 0.09));
  box-shadow: var(--shadow-md);
}

.home-hero::before {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(23, 107, 226, 0.38), rgba(24, 165, 111, 0.36), transparent);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #0e283b;
  font-size: clamp(3.2rem, 5.4vw, 6.25rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 680px;
  margin: 24px 0 0;
  color: #476779;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-link,
.quiet-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-link,
.button-link {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 18px 38px rgba(23, 107, 226, 0.22);
}

.quiet-link {
  border: 1px solid var(--line-strong);
  color: #244a62;
  background: rgba(255, 255, 255, 0.76);
}

.primary-link:hover,
.quiet-link:hover,
.button-link:hover {
  transform: translateY(-2px);
}

.hero-visual {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  min-width: 0;
}

.hero-media {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: #dcebf2;
  box-shadow: var(--shadow-sm);
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-media::after,
.doc-card::before,
.category-ribbon a::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0;
  background: radial-gradient(circle at var(--card-x, 50%) var(--card-y, 10%), rgba(255, 255, 255, 0.42), transparent 36%);
  transition: opacity 180ms ease;
}

.hero-media:hover,
.doc-card:hover,
.category-ribbon a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero-media:hover::after,
.doc-card:hover::before,
.category-ribbon a:hover::before {
  opacity: 1;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media-main {
  min-height: 430px;
}

.hero-media-pair {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.hero-media-pair .hero-media {
  min-height: 208px;
}

.hero-media figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(9, 38, 55, 0.62);
  backdrop-filter: blur(10px);
}

.hero-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(760px, 100%);
}

.hero-stats span {
  min-height: 70px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.hero-stats strong {
  display: block;
  color: var(--blue);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1;
}

.category-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.category-ribbon a {
  position: relative;
  min-height: 96px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), color-mix(in srgb, var(--tint) 52%, white));
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.category-ribbon strong,
.category-ribbon span {
  position: relative;
  z-index: 1;
  display: block;
}

.category-ribbon strong {
  color: #173044;
  font-size: 0.98rem;
}

.category-ribbon span {
  margin-top: 18px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.feature-section,
.category-section {
  margin-top: 44px;
  scroll-margin-top: 96px;
}

.category-section {
  padding-top: 32px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: #10283a;
  font-size: clamp(1.55rem, 2.5vw, 2.3rem);
  line-height: 1.2;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.doc-card {
  position: relative;
  min-height: 224px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 254, 255, 0.88)),
    linear-gradient(135deg, color-mix(in srgb, var(--tint) 38%, transparent), transparent);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.doc-card a {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 224px;
  flex-direction: column;
  padding: 20px;
}

.doc-card__category {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 10%, white);
}

.doc-card h3 {
  margin: 18px 0 9px;
  color: #112d41;
  font-size: 1.12rem;
  line-height: 1.38;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.doc-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  color: #6d8492;
  font-size: 0.8rem;
}

.read-mark {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
}

.article {
  width: min(1120px, 100%);
}

.article-hero {
  position: relative;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 17%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), color-mix(in srgb, var(--tint) 58%, white)),
    linear-gradient(115deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 50%);
  box-shadow: var(--shadow-md);
}

.article-hero::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), rgba(24, 165, 111, 0.32), transparent);
}

.crumb {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 7px 10px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 10%, white);
}

.article-hero h1 {
  max-width: 980px;
  margin: 0;
  color: #0e283b;
  font-size: clamp(2.25rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.article-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: #486779;
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.article-meta span {
  max-width: 100%;
  padding: 7px 10px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(23, 107, 226, 0.13);
  border-radius: 8px;
  color: #5d7687;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.72);
}

.article-body {
  margin-top: 22px;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

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

.article-body h2 {
  position: relative;
  margin: 2.6rem 0 1rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: clamp(1.34rem, 2.3vw, 1.95rem);
  line-height: 1.36;
  scroll-margin-top: 96px;
}

.article-body > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-body h2::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 3px;
  content: "";
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent);
}

.article-body h3 {
  margin: 1.8rem 0 0.78rem;
  color: #244b61;
  font-size: 1.18rem;
  line-height: 1.42;
  scroll-margin-top: 96px;
}

.article-body h4,
.article-body h5,
.article-body h6 {
  margin: 1.35rem 0 0.6rem;
  color: #2b5267;
}

.heading-anchor {
  margin-left: 8px;
  color: color-mix(in srgb, var(--accent) 50%, transparent);
  opacity: 0;
  transition: opacity 160ms ease;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor {
  opacity: 1;
}

.article-body p,
.article-body li {
  color: #2e4c60;
  font-size: 1rem;
  line-height: 1.88;
}

.article-body p {
  margin: 0.9rem 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.45rem;
}

.article-body li + li {
  margin-top: 0.32rem;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #355268;
  background: color-mix(in srgb, var(--tint) 62%, white);
}

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

.article-body blockquote > :last-child {
  margin-bottom: 0;
}

.article-body a {
  color: var(--accent);
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 28%, transparent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 160ms ease, color 160ms ease;
}

.article-body a:hover {
  color: color-mix(in srgb, var(--accent) 82%, #07324a);
  background-size: 100% 4px;
}

.article-body code:not(pre code) {
  padding: 0.16rem 0.34rem;
  border-radius: 6px;
  color: #125678;
  background: rgba(23, 107, 226, 0.09);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.code-shell {
  position: relative;
  margin: 1.35rem 0;
}

.copy-code {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #d5edf8;
  cursor: pointer;
  background: rgba(11, 36, 52, 0.76);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.copy-code:hover,
.copy-code.is-copied {
  color: #ffffff;
  background: color-mix(in srgb, var(--accent) 68%, #0b2434);
  transform: translateY(-1px);
}

pre.hljs {
  margin: 0;
  padding: 1.2rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: #d8ecf7;
  background: #0f2433;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

pre code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.72;
}

.hljs-comment,
.hljs-quote {
  color: #82a6b8;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
  color: #8bc8ff;
}

.hljs-string,
.hljs-title,
.hljs-name {
  color: #98e6ba;
}

.hljs-number,
.hljs-literal {
  color: #ffd28a;
}

.article-body p:has(> img),
.article-body a:has(> img) {
  display: block;
  text-align: center;
}

.article-body img {
  display: block;
  max-width: min(100%, 920px);
  max-height: 72vh;
  margin: 1.5rem auto;
  border: 1px solid rgba(23, 107, 226, 0.13);
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(24, 79, 111, 0.16);
  cursor: zoom-in;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.article-body img:hover {
  box-shadow: 0 28px 66px rgba(24, 79, 111, 0.22);
  transform: translateY(-2px);
}

.table-scroll {
  overflow: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #173044;
  background: color-mix(in srgb, var(--tint) 58%, white);
}

.route-map-card {
  margin: 1.5rem 0 1.8rem;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(23, 107, 226, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 250, 246, 0.86)),
    linear-gradient(110deg, rgba(23, 107, 226, 0.08), transparent 48%, rgba(24, 165, 111, 0.08));
  box-shadow: var(--shadow-sm);
}

.route-map-copy {
  margin-bottom: 16px;
}

.route-map-copy h3 {
  margin: 0;
  color: #10283a;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.route-map-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.route-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: 14px;
}

.route-map-canvas {
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #dcebf2;
  z-index: 0;
}

.route-map-card img,
.route-map-card .leaflet-tile,
.route-map-card .leaflet-marker-icon,
.route-map-card .leaflet-marker-shadow {
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: inherit;
  transform: none;
}

.route-map-card .leaflet-container {
  color: #173044;
  font: inherit;
}

.route-map-panel {
  display: flex;
  min-height: 460px;
  flex-direction: column;
  gap: 12px;
}

.route-map-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-map-tabs button {
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--day, var(--accent)) 18%, transparent);
  border-radius: 8px;
  color: color-mix(in srgb, var(--day, var(--accent)) 80%, #143044);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.route-map-tabs button:hover,
.route-map-tabs button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--day, var(--accent)) 40%, transparent);
  background: color-mix(in srgb, var(--day, var(--accent)) 12%, white);
  transform: translateY(-1px);
}

.route-map-summary {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.route-day-stack {
  display: grid;
  gap: 8px;
}

.route-day-stack article,
.route-day-detail {
  border: 1px solid color-mix(in srgb, var(--day) 18%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--day) 7%, white);
}

.route-day-stack article {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.route-day-stack strong {
  color: color-mix(in srgb, var(--day) 78%, #143044);
  font-size: 0.88rem;
}

.route-day-stack span,
.route-day-detail span,
.route-day-detail li {
  color: #536f80;
  font-size: 0.84rem;
  line-height: 1.55;
}

.route-day-detail {
  padding: 14px;
}

.route-day-detail p {
  margin: 0 0 6px;
  color: color-mix(in srgb, var(--day) 78%, #143044);
  font-size: 0.78rem;
  font-weight: 800;
}

.route-day-detail h4 {
  margin: 0 0 8px;
  color: #173044;
  font-size: 1rem;
}

.route-day-detail ol {
  margin: 12px 0 0;
  padding-left: 1.25rem;
}

.route-marker {
  border: 0;
  background: transparent;
}

.route-marker span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--day);
  box-shadow: 0 10px 20px rgba(16, 40, 58, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
}

.related {
  margin-top: 3.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.related .article-body h2::before {
  display: none;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(8, 28, 40, 0.78);
  backdrop-filter: blur(14px);
}

.lightbox[aria-hidden="false"] {
  display: grid;
}

.lightbox img {
  max-width: min(96vw, 1240px);
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 91;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.not-found {
  width: min(720px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

@media (min-width: 1181px) {
  .drawer-toggle {
    display: none;
  }
}

@media (max-width: 1320px) {
  :root {
    --drawer-width: 312px;
  }

  .top-nav {
    display: none;
  }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .header-cta {
    justify-self: end;
  }

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

  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  }
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 1fr;
    width: min(1080px, 100%);
  }

  .drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 75;
    width: min(390px, calc(100vw - 26px));
    height: 100vh;
    max-height: none;
    border-radius: 0 8px 8px 0;
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

  .drawer-open .drawer {
    transform: translateX(0);
  }

  .drawer-close {
    display: grid;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    background: rgba(7, 29, 42, 0.38);
    backdrop-filter: blur(6px);
  }

  .drawer-open .drawer-backdrop {
    display: block;
  }

  .article {
    width: 100%;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 64px;
  }

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

  .brand small,
  .header-cta {
    display: none;
  }

  .app-frame {
    padding: 18px 14px 44px;
  }

  .home-hero {
    min-height: auto;
    padding: 24px;
  }

  .hero-copy h1,
  .article-hero h1 {
    font-size: clamp(2.4rem, 11vw, 3.8rem);
  }

  .hero-visual {
    grid-template-columns: 1fr;
  }

  .hero-media-main,
  .hero-media-pair .hero-media {
    min-height: 210px;
  }

  .hero-media-pair {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }

  .hero-stats,
  .category-ribbon {
    grid-template-columns: 1fr;
  }

  .route-map-layout {
    grid-template-columns: 1fr;
  }

  .route-map-canvas,
  .route-map-panel {
    min-height: 360px;
  }

  .route-map-panel {
    min-height: auto;
  }

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

  .article-hero,
  .article-body,
  .not-found {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .brand strong {
    max-width: 180px;
  }

  .home-hero {
    padding: 20px;
  }

  .hero-media-pair {
    grid-template-columns: 1fr;
  }

  .hero-stats span {
    min-height: 64px;
  }

  .route-map-card {
    padding: 16px;
  }

  .route-map-canvas {
    min-height: 300px;
  }

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

  .doc-card,
  .doc-card a {
    min-height: 198px;
  }

  pre code {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
