:root {
  --bg: #ffffff;
  --fg: #1c2128;
  --muted: #57606a;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --border: #e3e6ea;
  --code-bg: #f6f8fa;
  --sidebar-bg: #fafbfc;
  --max-content: 820px;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

.layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  align-self: stretch;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--fg);
  margin-bottom: 24px;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li {
  margin: 2px 0;
}
.sidebar a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.94rem;
}
.sidebar a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 40px 48px 64px;
  display: flex;
  flex-direction: column;
}

article {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
}

article h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
article h2 {
  font-size: 1.45rem;
  margin: 2em 0 0.6em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--border);
}
article h3 {
  font-size: 1.15rem;
  margin: 1.6em 0 0.5em;
}

article p,
article li {
  color: var(--fg);
}

article a {
  color: var(--accent);
  text-decoration: none;
}
article a:hover {
  text-decoration: underline;
}

article code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
}
article pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}
article pre code {
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

article blockquote {
  margin: 1.2em 0;
  padding: 0.6em 1em;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}
article blockquote p {
  margin: 0.3em 0;
}

article table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 0.92rem;
}
article th,
article td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
article th {
  background: var(--sidebar-bg);
  font-weight: 600;
}
article tr:nth-child(even) td {
  background: #fcfcfd;
}

.page-footer {
  width: 100%;
  max-width: var(--max-content);
  margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    flex-basis: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content {
    padding: 28px 20px 48px;
  }
}
