* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #24292f;
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #d0d7de;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

#search {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  min-width: 220px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
}

.layout {
  display: flex;
  min-height: calc(100vh - 52px);
}

.drawer {
  width: 300px;
  border-right: 1px solid #d0d7de;
  padding: 1rem;
  overflow-y: auto;
  background: #f6f8fa;
  position: sticky;
  top: 52px;
  align-self: flex-start;
  height: calc(100vh - 52px);
}

.content {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 900px;
}

.nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.nav li {
  margin: 0.15rem 0;
}

.nav a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: #0969da;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
}

.nav a:hover,
.nav a.active {
  background: #e1e4e8;
}

.nav .section-title {
  font-weight: 600;
  margin-top: 0.8rem;
  color: #57606a;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nav .subnav {
  padding-left: 0.75rem;
  font-size: 0.92rem;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
}

.content pre {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 6px;
  overflow: auto;
}

.content code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.content img {
  max-width: 100%;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.content th,
.content td {
  border: 1px solid #d0d7de;
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.content th {
  background: #f6f8fa;
  font-weight: 600;
}

.content tr:nth-child(even) {
  background: #f9fafb;
}

mark {
  background: #fff8c5;
  padding: 0 2px;
  border-radius: 2px;
}

.search-results {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.search-results li {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}

.search-results a {
  color: #0969da;
  text-decoration: none;
  font-weight: 600;
}

.search-results a:hover {
  text-decoration: underline;
}

.search-results p {
  margin: 0.5rem 0;
  color: #57606a;
  font-size: 0.95rem;
}

.search-results ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.search-results li li {
  margin: 0.15rem 0;
  padding: 0;
  border: none;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: #57606a;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #d0d7de;
}

.breadcrumbs a {
  color: #0969da;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .sep {
  color: #8c959f;
  margin: 0 0.25rem;
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .drawer {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 9;
  }
  .drawer.open { transform: translateX(0); }
  .content { padding: 1rem; }
}
