:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --paper: #fffefa;
  --text: #202124;
  --muted: #666a70;
  --line: #ded9cf;
  --accent: #165a72;
  --accent-soft: #e7f1f3;
  --code-bg: #f0eee8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.94);
}

.site-nav {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.8rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  border-radius: 5px;
  padding: 0.22rem 0.48rem;
}

.site-nav a:first-child {
  font-weight: 700;
  margin-right: 0.2rem;
}

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

.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.1rem 4rem;
}

.breadcrumbs {
  margin-bottom: 1.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: inherit;
}

.content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  box-shadow: 0 16px 50px rgba(37, 34, 27, 0.06);
}

.content h1,
.content h2,
.content h3,
.content h4 {
  line-height: 1.18;
  margin: 1.7em 0 0.55em;
}

.content h1:first-child,
.content .page-title:first-child {
  margin-top: 0;
}

.page-title {
  font-size: clamp(2rem, 8vw, 3.1rem);
}

.content p,
.content ul,
.content ol,
.content blockquote,
.content pre,
.content table {
  margin-top: 0;
  margin-bottom: 1.05rem;
}

.content img,
.content video {
  max-width: 100%;
  height: auto;
}

.content pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 6px;
  background: var(--code-bg);
}

.content code {
  background: var(--code-bg);
  padding: 0.08rem 0.24rem;
  border-radius: 4px;
}

.content pre code {
  padding: 0;
  background: transparent;
}

.content blockquote {
  border-left: 4px solid var(--line);
  padding-left: 1rem;
  color: #3f4247;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.content th,
.content td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
}

.sitemap-tree,
.sitemap-tree ul {
  list-style: none;
  padding-left: 0;
}

.sitemap-tree ul {
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.sitemap-tree li {
  margin: 0.25rem 0;
}

.dir-label {
  color: var(--muted);
  font-weight: 650;
}

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .site-nav {
    gap: 0.35rem;
  }

  .site-main {
    padding-top: 1.5rem;
  }

  .content {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: -1.1rem;
    margin-right: -1.1rem;
  }
}
