
:root {
  color-scheme: light;
  --bg-gradient: radial-gradient(circle at 0% -10%, #fefefe 0%, #eef1f7 45%, #e1e6f1 100%);
  --surface: #f5f6fa;
  --sidebar-bg: rgba(255, 255, 255, 0.78);
  --content-bg: rgba(255, 255, 255, 0.94);
  --border: rgba(24, 32, 56, 0.12);
  --border-subtle: rgba(24, 32, 56, 0.08);
  --ink: #1c1c1e;
  --ink-muted: rgba(60, 60, 67, 0.72);
  --accent: #0a84ff;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 18px 46px rgba(15, 23, 42, 0.08);
  --code-bg: rgba(15, 23, 42, 0.06);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(24px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 48px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-brand__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.site-brand__tagline {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 32px;
  max-width: 1400px;
  margin: 48px auto 72px;
  padding: 0 48px;
  align-items: start;
}
.sidebar {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}
.sidebar-inner {
  padding: 28px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.search-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#search-input::placeholder {
  color: rgba(60, 60, 67, 0.5);
}
#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.18);
}
.search-results {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-card);
  display: none;
  overflow: hidden;
}
.search-results.visible {
  display: block;
}
.search-result {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.search-result:last-child {
  border-bottom: none;
}
.search-result a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.search-result a:hover {
  color: var(--accent);
}
.search-result p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}
.search-result mark {
  background: rgba(10, 132, 255, 0.2);
  color: var(--ink);
  border-radius: 4px;
  padding: 0 2px;
}
.toc-level {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc-item {
  position: relative;
  border-radius: var(--radius-small);
  transition: background 0.2s ease;
}
.toc-item > a {
  display: block;
  padding: 10px 14px 10px 20px;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.toc-item > .toc-label {
  display: block;
  padding: 10px 14px 10px 20px;
  color: rgba(60, 60, 67, 0.38);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: default;
}
.toc-item > a:hover {
  color: var(--ink);
}
.toc-item.current > a,
.toc-item.active > a {
  color: var(--accent);
}
.toc-item.disabled > .toc-label {
  color: rgba(60, 60, 67, 0.3);
}
.toc-item.active:not(.current) {
  background: rgba(10, 132, 255, 0.08);
}
.toc-item.has-children {
  padding-left: 28px;
}
.toc-item.has-children > a {
  padding-left: 2px;
}
.toc-item.has-children > .toc-label {
  padding-left: 2px;
}
.toc-item.has-children > .toc-toggle {
  position: absolute;
  left: 4px;
  top: 8px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.14);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.toc-item.disabled > .toc-toggle {
  background: rgba(60, 60, 67, 0.08);
  cursor: default;
}
.toc-item.has-children > .toc-toggle:hover {
  background: rgba(10, 132, 255, 0.22);
}
.toc-toggle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.toc-item:not(.collapsed) > .toc-toggle::before {
  transform: rotate(45deg);
}
.toc-item.collapsed > ul {
  display: none;
}
.toc-item ul {
  margin: 6px 0 0;
  padding-left: 0;
}
.content {
  background: var(--content-bg);
  border-radius: var(--radius-large);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 44px 56px 56px;
  backdrop-filter: blur(18px);
}
.content article {
  max-width: 900px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: 0.01em;
}
article h1,
article h2,
article h3,
article h4 {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
article h1 {
  font-size: 36px;
  margin-top: 0;
  margin-bottom: 24px;
}
article h2 {
  font-size: 28px;
  margin: 48px 0 16px;
}
article h3 {
  font-size: 22px;
  margin: 32px 0 14px;
}
article h4 {
  font-size: 18px;
  margin: 24px 0 12px;
}
article p {
  margin: 16px 0;
}
article ul,
article ol {
  padding-left: 22px;
  margin: 16px 0;
}
article li {
  margin-bottom: 10px;
}
pre {
  background: var(--code-bg);
  border-radius: var(--radius-medium);
  padding: 18px 20px;
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 14px;
  border: 1px solid var(--border-subtle);
}
code {
  background: rgba(10, 132, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: var(--radius-medium);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}
th,
td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px;
  text-align: left;
  font-size: 15px;
}
th {
  background: rgba(10, 132, 255, 0.12);
  font-weight: 600;
}
blockquote {
  border-radius: var(--radius-medium);
  border: 1px solid rgba(10, 132, 255, 0.12);
  background: rgba(10, 132, 255, 0.1);
  padding: 16px 20px;
  color: var(--ink);
  margin: 24px 0;
}
blockquote p {
  margin: 0;
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 0 24px;
  }
  .sidebar {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
  }
}
@media (max-width: 768px) {
  .site-header__inner {
    padding: 18px 24px;
  }
  .layout {
    margin: 32px auto 48px;
    padding: 0 18px;
  }
  .content {
    padding: 32px 24px 42px;
  }
  #search-input {
    font-size: 14px;
  }
  .toc-item > a {
    font-size: 14px;
  }
  .content article {
    font-size: 16px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #060608;
    --sidebar-bg: rgba(28, 29, 33, 0.82);
    --content-bg: rgba(22, 23, 28, 0.88);
    --border: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --ink: #f5f5f7;
    --ink-muted: rgba(235, 235, 245, 0.6);
    --code-bg: rgba(255, 255, 255, 0.08);
    --bg-gradient: radial-gradient(circle at 0% -10%, #1b1d26 0%, #0b0c12 100%);
  }
  #search-input {
    background: rgba(34, 35, 43, 0.95);
  }
  .search-results,
  .sidebar,
  .content {
    color: var(--ink);
  }
  .search-result mark {
    color: var(--ink);
  }
  .toc-item.has-children > .toc-toggle {
    background: rgba(10, 132, 255, 0.24);
  }
  code {
    background: rgba(10, 132, 255, 0.18);
  }
  th {
    background: rgba(10, 132, 255, 0.2);
  }
}
