:root {
  --bg: #f6f4ee;
  --panel: #ede8dc;
  --paper: #fffdf8;
  --ink: #24231f;
  --muted: #756f63;
  --line: #ded8cb;
  --soft-line: #eee8da;
  --accent: #1f7a6d;
  --accent-2: #a95526;
  --code-bg: #282720;
  --code-ink: #f4ecd9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "LXGW WenKai", "Source Han Serif SC", Georgia, serif;
  line-height: 1.72;
}

a {
  color: var(--accent);
}

.site-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 240px;
  min-height: 100vh;
}

.left-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.right-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  border-left: 1px solid var(--line);
  background: #f8f5ec;
}

.content-panel {
  min-width: 0;
  padding: 42px 56px 80px;
}

.article {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 52px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.nav-section {
  margin: 16px 0;
}

.nav-section-title {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.doc-nav a {
  display: block;
  padding: 7px 9px;
  border-radius: 6px;
  color: #454138;
  text-decoration: none;
  font-size: 14px;
}

.doc-nav a:hover,
.doc-nav a.active {
  background: var(--paper);
  color: var(--accent);
}

.doc-nav a.hidden {
  display: none;
}

.toc-card {
  font-size: 14px;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 800;
}

#toc a {
  display: block;
  margin: 4px 0;
  color: var(--muted);
  text-decoration: none;
}

#toc a:hover {
  color: var(--accent);
}

#toc .toc-h3 {
  padding-left: 14px;
  font-size: 13px;
}

#toc .toc-h4 {
  padding-left: 28px;
  font-size: 13px;
}

.loading {
  color: var(--muted);
}

.home-kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  line-height: 1.28;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 18px;
  font-size: 40px;
}

h2 {
  margin: 34px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
  font-size: 27px;
}

h3 {
  margin: 26px 0 10px;
  font-size: 21px;
}

h4 {
  margin: 20px 0 8px;
  font-size: 17px;
}

p {
  margin: 0 0 13px;
}

ul,
ol {
  padding-left: 24px;
}

li {
  margin: 5px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th,
td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f1eadc;
  text-align: left;
}

pre {
  overflow-x: auto;
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  line-height: 1.55;
}

code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

:not(pre) > code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eee8da;
  color: #3b3932;
}

blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: #eef6f1;
}

img {
  display: block;
  max-width: 100%;
  margin: 14px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.home-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ef;
  color: var(--ink);
  text-decoration: none;
}

.home-card strong {
  display: block;
  margin-bottom: 6px;
}

.home-card span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .site-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 780px) {
  .site-shell {
    display: block;
  }

  .left-panel {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-panel {
    padding: 18px 12px 48px;
  }

  .article {
    padding: 24px 18px;
  }

  h1 {
    font-size: 30px;
  }

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