:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #6a737d;
  --border: #e1e4e8;
  --accent: #155EEF;
  --accent-bg: #eef4ff;
  --sidebar-bg: #f8f9fb;
  --code-bg: #f6f8fa;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand img { height: 28px; width: 28px; border-radius: 4px; }

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 56px); }
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  padding: 16px 12px;
  overflow: auto;
}
.content { padding: 24px; }

.doc { max-width: 980px; margin: 0 auto; }
.doc h1 { font-size: 1.9rem; margin: 0 0 12px; }
.doc h2 { font-size: 1.4rem; margin-top: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.doc h3 { font-size: 1.1rem; margin-top: 1.2rem; }
.doc p { margin: 0.5rem 0; }
.doc ul { margin: 0.5rem 0 0.5rem 1.4rem; }
.doc code { background: var(--code-bg); padding: 0 4px; border-radius: 4px; }
.doc pre { background: var(--code-bg); padding: 12px; overflow: auto; border-radius: 6px; border: 1px solid var(--border); }
.doc table { border-collapse: collapse; }
.doc th, .doc td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }

.footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: space-between; }

.nav-section { margin-bottom: 12px; }
.nav-title { font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; margin: 10px 8px; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-item a { display: block; padding: 6px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.nav-item a:hover { background: var(--accent-bg); color: var(--accent); }
.nav-item a.active { background: var(--accent); color: #fff; }

.search { position: relative; flex: 1; max-width: 560px; }
#searchInput {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: none; max-height: 360px; overflow: auto;
}
.search-results.active { display: block; }
.search-item { padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.active { background: var(--accent-bg); }
.search-item .title { font-weight: 600; }
.search-item .excerpt { color: var(--muted); font-size: 12px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; }
}

