:root {
  --p-color-bg: #f6f6f7;
  --p-color-bg-surface: #ffffff;
  --p-color-text: #1a1a1a;
  --p-color-text-secondary: #6d7175;
  --p-color-border: #ebebeb;
  --p-color-bg-fill-brand: #4f46e5;
  --p-color-bg-fill-brand-hover: #4338ca;
  --p-color-bg-surface-brand: #eef2ff;
  --p-color-text-brand: #4338ca;
  --p-color-border-brand: #c7d2fe;
  --p-border-radius: 10px;
  --p-border-radius-300: 16px;
  --p-space-page: 1.5rem;
  --p-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --rc-brand: #4f46e5;
  --rc-brand-dark: #4338ca;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--p-font);
  color: var(--p-color-text);
  background: var(--p-color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rc-brand); }
a:hover { color: var(--rc-brand-dark); }
.shell {
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
  padding: var(--p-space-page) var(--p-space-page) 0;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.layout { flex: 1 0 auto; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--p-color-text);
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  top: 0.42rem;
  height: 0.14rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.28rem 0 rgba(255,255,255,.75), 0 0.56rem 0 rgba(255,255,255,.55);
}
.brand span { color: var(--p-color-text-secondary); font-weight: 550; font-size: 0.78rem; }
a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  line-height: 1.25;
  min-height: 2.1rem;
}
a.btn.secondary {
  background: #fff;
  color: var(--p-color-text);
  border-color: var(--p-color-border);
}
a.btn.secondary:hover { background: #fafafa; color: var(--p-color-text); }
a.btn.brand {
  background: var(--p-color-bg-fill-brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}
a.btn.brand:hover {
  background: var(--p-color-bg-fill-brand-hover);
  color: #fff;
}
.layout {
  display: grid;
  gap: 0.85rem;
  align-items: start;
}
@media (min-width: 960px) {
  .layout {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    gap: 0.85rem;
  }
}
.toc {
  position: sticky;
  top: 1rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-card);
}
.toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
  max-height: min(70vh, 36rem);
  overflow: auto;
}
.toc a {
  display: block;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--p-color-text-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
}
.toc a:hover,
.toc a[aria-current="true"] {
  background: var(--p-color-bg-surface-brand);
  color: var(--p-color-text-brand);
}
@media (max-width: 959px) {
  .toc { position: static; }
  .toc ol {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 0.15rem;
  }
  .toc a { white-space: nowrap; }
}
.article {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hero {
  padding: 1.6rem 1.5rem 1.35rem;
  border-bottom: 1px solid var(--p-color-border);
  background: linear-gradient(180deg, #fff 0%, #fafaff 100%);
}
@media (min-width: 720px) {
  .hero { padding: 1.85rem 1.85rem 1.5rem; }
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.1vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 680;
}
.meta-data {
  display: grid;
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}
.meta-data li {
  margin: 0;
  color: var(--p-color-text);
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1.4;
}
.meta-data code {
  font-weight: 550;
}
.content { padding: 0.35rem 1.35rem 1.75rem; }
@media (min-width: 720px) {
  .content { padding: 0.5rem 1.85rem 2.1rem; }
}
h2 {
  scroll-margin-top: 1rem;
  margin: 1.65rem 0 0.45rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
p {
  margin: 0.55rem 0;
  color: var(--p-color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}
ul {
  margin: 0.45rem 0 0.75rem;
  padding-left: 1.15rem;
}
li {
  margin: 0.4rem 0;
  color: var(--p-color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}
strong { color: var(--p-color-text); font-weight: 650; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: #f4f4f5;
  color: #3730a3;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  border: 1px solid #e4e4e7;
}
.banner {
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  margin: 1rem 0 0;
  border: 1px solid var(--p-color-border-brand);
  background: var(--p-color-bg-surface-brand);
  font-size: 0.8125rem;
  color: var(--p-color-text-brand);
}
.card {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  margin-top: 0.75rem;
  box-shadow: var(--shadow-card);
}
.card p { margin: 0.35rem 0; }
.page-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--p-color-border);
  font-size: 0.75rem;
  color: var(--p-color-text-secondary);
}
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  padding: 1rem var(--p-space-page) 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  color: var(--p-color-text-secondary);
  font-size: 0.75rem;
}
.site-footer a {
  color: var(--p-color-text-secondary);
  text-decoration: none;
  font-weight: 550;
}
.site-footer a:hover { color: var(--rc-brand); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
