:root {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --line: #e7e9ee;
  --text: #17212f;
  --muted: #66758a;
  --accent: #2457e6;
  --accent-soft: #f2f6ff;
  --code-bg: #111827;
  --shadow: 0 4px 14px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
}

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

code,
pre {
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  background: #fcfcfd;
  border-right: 1px solid var(--line);
}

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

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

.brand span:last-child {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.brand-mark img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.search {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  outline: none;
}

.search input:focus {
  border-color: #c7d7ff;
  background: #fff;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-group-title,
.kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-group {
  margin-bottom: 6px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-link strong {
  display: block;
  font-size: 0.95rem;
}

.nav-link small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  background: var(--accent-soft);
  border-color: #dce6ff;
}

.sidebar-note,
.aside-card {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.sidebar-note ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.main {
  min-width: 0;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 14px;
}

.header h1 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-actions a {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  padding: 0 28px 28px;
}

.article-panel {
  min-width: 0;
}

.markdown-body {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  line-height: 1.16;
  scroll-margin-top: 24px;
}

.markdown-body h1 {
  margin-top: 0;
  font-size: 1.9rem;
}

.markdown-body h2 {
  margin-top: 30px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
}

.markdown-body h3 {
  margin-top: 20px;
  font-size: 1.05rem;
}

.markdown-body p,
.markdown-body li,
.markdown-body blockquote {
  line-height: 1.75;
  color: #233247;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
}

.markdown-body p code,
.markdown-body li code {
  padding: 0.12rem 0.36rem;
  border-radius: 6px;
  background: #f1f4f9;
  color: #15326b;
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: #f7f9ff;
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

.markdown-body .doc-image {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.code-block {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 12px;
  background: var(--code-bg);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.copy-button {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #e5efff;
  line-height: 1.7;
}

.aside {
  position: sticky;
  top: 20px;
  align-self: start;
}

.aside-card nav {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.aside-card a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.aside-card a:hover,
.aside-card a:focus-visible {
  color: var(--accent);
}

.callout {
  padding: 14px 16px;
  border: 1px solid #ffe0b3;
  border-radius: 12px;
  background: #fff8ee;
}

@media (max-width: 1140px) {
  .content {
    grid-template-columns: 1fr;
  }

  .aside {
    position: static;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .header,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .markdown-body {
    padding: 22px;
  }
}
