:root {
  color-scheme: light;
  --brand: #e77817;
  --accent: #aa4809;
  --accent-soft: #fff2e6;
  --background: #fff;
  --surface: #f8f9fa;
  --text: #24272d;
  --muted: #606773;
  --line: #e8eaed;
  --overlay: rgb(25 29 35 / 36%);
  --focus: #aa4809;
  --header-height: 88px;
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #ffad66;
  --accent-soft: #35251c;
  --background: #17191c;
  --surface: #202328;
  --text: #eceef1;
  --muted: #adb4bf;
  --line: #30353d;
  --overlay: rgb(0 0 0 / 62%);
  --focus: #ffad66;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; background: var(--background); color: var(--text); font-size: 15px; line-height: 1.7; transition: background-color .16s, color .16s; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 3px; }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.skip-link { position: fixed; left: 18px; top: -70px; padding: 10px 18px; z-index: 20; background: var(--background); }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 5; height: var(--header-height); border-bottom: 1px solid var(--line); background: var(--background); }
.header-inner { max-width: 1520px; padding: 0 42px; height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 20px; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-logo { display: block; line-height: 0; padding: 3px 8px; background: #fff; border-radius: 4px; }
.brand-logo img { display: block; width: 112px; height: auto; }
.brand-divider { height: 24px; width: 1px; background: var(--line); }
.brand-label { font-size: 15px; font-weight: 550; letter-spacing: -.2px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.search-trigger { display: flex; align-items: center; gap: 11px; min-height: 42px; width: 298px; padding: 8px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: left; font-size: 13px; transition: border-color .16s; }
.search-trigger:hover { border-color: var(--muted); }
kbd { font-family: inherit; font-size: 11px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--background); }
.search-trigger kbd { margin-left: auto; }
.icon-button { width: 42px; height: 42px; display: inline-flex; justify-content: center; align-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 6px; font-size: 26px; transition: color .16s, background-color .16s; }
.icon-button:hover { color: var(--text); background: var(--surface); }
.sun-icon, .menu-trigger { display: none; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr) 172px; max-width: 1520px; margin: auto; padding: 0 42px; gap: 54px; }
.sidebar { position: sticky; top: var(--header-height); height: calc(100svh - var(--header-height)); padding: 36px 20px 24px 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list .nav-list { margin: 4px 0 24px; }
.nav-list a { display: block; color: var(--muted); padding: 7px 12px; margin: 2px 0; font-size: 13px; text-decoration: none; border-radius: 5px; line-height: 1.55; transition: color .14s, background-color .14s; }
.nav-list a:hover { color: var(--text); background: var(--surface); }
.nav-list a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 2px 0 var(--brand); }
.nav-section { display: block; color: var(--text); font-size: 12px; font-weight: 650; padding: 0 12px 4px; margin-top: 25px; }
.nav-list > li:first-child > .nav-section { margin-top: 0; }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 35px 12px 0; font-size: 11px; color: var(--muted); }
.status-dot { height: 6px; width: 6px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
main { min-width: 0; padding: 35px 0 0; outline: none; }
.preview-note { display: flex; gap: 12px; align-items: center; font-size: 10px; font-weight: 650; letter-spacing: .03em; color: var(--accent); margin: 0 0 28px; }
.preview-note span { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.breadcrumb { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.breadcrumb span { margin: 0 8px; color: var(--muted); }
.article { max-width: 780px; }
.article h1 { font-size: clamp(30px, 3vw, 43px); letter-spacing: -1.5px; font-weight: 650; line-height: 1.16; margin: 0 0 22px; text-wrap: balance; }
.article h2 { margin: 48px 0 16px; font-size: 24px; font-weight: 620; letter-spacing: -.65px; line-height: 1.3; }
.article h3 { margin: 30px 0 10px; font-size: 18px; font-weight: 620; letter-spacing: -.25px; }
.article p, .article ul, .article ol { margin: 0 0 20px; }
.article li { margin: 7px 0; padding-left: 4px; }
.article img { max-width: 100%; height: auto; }
.article > p:first-of-type { font-size: 17px; color: var(--muted); line-height: 1.8; }
.article strong { font-weight: 620; }
.headerlink { margin-left: 8px; opacity: 0; font-size: .65em; text-decoration: none; }
:is(h1,h2,h3,h4):hover .headerlink, .headerlink:focus-visible { opacity: 1; }
.article code { background: var(--surface); border-radius: 3px; padding: 2px 5px; font-size: .88em; overflow-wrap: anywhere; }
.article pre { background: var(--surface); padding: 22px; border: 1px solid var(--line); border-radius: 7px; overflow-x: auto; line-height: 1.7; }
.article pre code { padding: 0; overflow-wrap: normal; }
.article table { display: block; overflow-x: auto; border-collapse: collapse; width: 100%; font-size: 14px; margin: 24px 0; }
.article th, .article td { padding: 12px 18px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { font-weight: 620; }
.article blockquote, .admonition { margin: 26px 0; padding: 16px 22px; background: var(--surface); border-left: 3px solid var(--brand); }
.article blockquote p:last-child, .admonition p:last-child { margin-bottom: 0; }
.admonition-title { font-weight: 600; }
.page-outline { padding-top: 76px; position: sticky; top: var(--header-height); height: fit-content; }
.page-outline p { font-size: 11px; font-weight: 600; margin: 0 0 14px; }
.page-outline ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.page-outline a { display: block; color: var(--muted); font-size: 12px; padding: 6px 0 6px 15px; text-decoration: none; line-height: 1.5; }
.page-outline a:hover { color: var(--accent); }
.page-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; border-top: 1px solid var(--line); margin: 64px 0 0; padding: 22px 0; }
.page-navigation a { min-width: 0; text-decoration: none; font-size: 14px; font-weight: 550; line-height: 1.55; overflow-wrap: anywhere; }
.page-navigation-direction { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-bottom: 6px; }
.page-navigation-title { display: block; }
.page-navigation-separator { color: var(--muted); }
.page-navigation .next-page { grid-column: 2; text-align: right; }
@media (max-width: 640px) {
  .page-navigation { grid-template-columns: minmax(0, 1fr); }
  .page-navigation .next-page { grid-column: 1; }
}
.page-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: 11px; }
.landing .workspace { grid-template-columns: 236px minmax(0, 1fr); }
.landing .page-outline { display: none; }
.landing .article { max-width: none; }
.landing .article h1 { max-width: 740px; font-size: clamp(38px, 4.2vw, 58px); letter-spacing: -2.3px; margin-top: 28px; }
.landing .article > p:first-of-type { max-width: 630px; margin-bottom: 42px; }
.landing .article h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.15px; color: var(--muted); margin: 46px 0 18px; }
.reader-paths { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; border-top: 1px solid var(--line); }
.reader-path { display: block; text-decoration: none; padding: 23px 0; border-bottom: 1px solid var(--line); color: var(--text); position: relative; }
.reader-path strong { display: block; font-size: 17px; letter-spacing: -.3px; padding-right: 30px; }
.reader-path span { display: block; color: var(--muted); font-size: 13px; margin-top: 7px; padding-right: 32px; }
.reader-path::after { content: '↗'; position: absolute; right: 0; top: 23px; color: var(--accent); transition: transform .15s; }
.reader-path:hover strong { color: var(--accent); }
.reader-path:hover::after { transform: translate(2px,-2px); }
.topic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; list-style: none; padding: 0; }
.topic-list li { padding: 0; margin: 0; }
.topic-list a { text-decoration: none; color: var(--muted); font-size: 14px; }
.topic-list a:hover { color: var(--accent); }
dialog { color: var(--text); background: var(--background); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 22px 80px rgb(0 0 0 / 20%); }
dialog[open] { animation: dialog-enter .15s ease-out; }
dialog::backdrop { background: var(--overlay); }
.search-dialog { width: min(660px, calc(100vw - 32px)); margin: 12svh auto auto; max-height: 76svh; overflow-y: auto; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.dialog-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.search-dialog input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 17px; }
.search-status { color: var(--muted); font-size: 12px; margin: 16px 0; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results a { display: block; text-decoration: none; color: var(--text); padding: 14px 10px; border-top: 1px solid var(--line); border-radius: 3px; }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface); }
.search-results strong { display: block; font-size: 14px; font-weight: 600; }
.search-results span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.dialog-hint { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); margin: 20px 0 0; }
.dialog-hint span { margin-left: auto; }
.navigation-dialog { width: min(350px, calc(100vw - 32px)); max-height: 85svh; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1500px) { .workspace { gap: 64px; } }
@media (max-width: 1180px) { .workspace, .landing .workspace { grid-template-columns: 210px minmax(0,1fr); gap: 36px; padding: 0 28px; } .page-outline { display: none; } .header-inner { padding: 0 28px; } }
@media (max-width: 820px) {
  :root { --header-height: 76px; }
  .header-inner { padding: 0 20px; gap: 12px; }
  .brand { gap: 12px; }
  .brand-logo { padding: 3px 5px; }
  .brand-logo img { width: 90px; }
  .brand-label { font-size: 13px; }
  .header-actions { gap: 6px; }
  .search-trigger { width: 42px; height: 42px; padding: 10px; border: 0; background: transparent; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .menu-trigger { display: inline-flex; }
  .sidebar { display: none; }
  .workspace, .landing .workspace { display: block; padding: 0 28px; max-width: 780px; }
  main { padding-top: 25px; }
  .article h1 { font-size: 36px; }
  .landing .article h1 { font-size: 46px; max-width: 600px; }
  .reader-paths { column-gap: 28px; }
}
@media (max-width: 460px) {
  .header-inner { padding: 0 12px; }
  .brand { gap: 8px; }
  .brand-label { font-size: 11px; }
  .brand-logo img { width: 76px; }
  .brand-divider { display: none; }
  .header-actions { gap: 0; }
  .workspace, .landing .workspace { padding: 0 22px; }
  .preview-note { display: block; }
  .preview-note span { margin-left: 8px; }
  .landing .article h1 { font-size: 39px; letter-spacing: -1.6px; }
  .reader-paths, .topic-list { grid-template-columns: 1fr; }
  .reader-path { padding: 20px 0; }
  .article > p:first-of-type { font-size: 16px; }
  .page-footer { font-size: 10px; }
  .search-dialog { padding: 16px; margin-top: 5svh; max-height: 88svh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
