:root {
  --bg: #ffffff;
  --bg-subtle: #f5f7fa;
  --text: #1f2328;
  --text-muted: #59636e;
  --border: #d8dee4;
  --accent: #0f6cbd;
  --accent-subtle: #ebf3fc;
  --code-bg: #f6f8fa;
  --callout-info: #ebf3fc;
  --callout-note: #fff8c5;
}
[data-theme="dark"] {
  --bg: #14171c;
  --bg-subtle: #1c2128;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --accent: #479ef5;
  --accent-subtle: #1c2d42;
  --code-bg: #1f242c;
  --callout-info: #162436;
  --callout-note: #2b2412;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand-logo { width: 28px; height: 28px; display: block; }
.search-wrap { position: relative; flex: 1; max-width: 460px; }
#search-input { width: 100%; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text); font-size: 14px; outline: none; }
#search-input:focus { border-color: var(--accent); background: var(--bg); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 400px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 30; }
.search-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.selected { background: var(--accent-subtle); text-decoration: none; }
.search-item-title { font-weight: 600; font-size: 14px; }
.search-item-section { font-size: 12px; color: var(--text-muted); }
.search-item-excerpt { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 14px; }
.mobile-only { display: none; }
.layout { flex: 1; display: grid; grid-template-columns: 270px minmax(0, 1fr); width: 100%; }
.sidebar { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--border); font-size: 14px; }
.sidebar ul { list-style: none; margin: 0; padding-left: 14px; }
.sidebar > ul { padding-left: 0; }
.nav-row { display: flex; align-items: center; gap: 4px; }
.nav-toggle { border: none; background: transparent; color: var(--text-muted); cursor: pointer; width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; flex-shrink: 0; transition: transform 0.15s, background 0.15s; }
.nav-toggle:hover { background: var(--bg-subtle); color: var(--text); }
.nav-group.open > .nav-row > .nav-toggle svg { transform: rotate(90deg); }
.nav-toggle svg { transition: transform 0.15s; }
.nav-group > ul { display: none; }
.nav-group.open > ul { display: block; }
.nav-leaf { padding-left: 26px; }
.nav-link { display: block; padding: 4px 8px; border-radius: 5px; color: var(--text); flex: 1; }
.nav-link:hover { background: var(--bg-subtle); text-decoration: none; }
.nav-link.active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.main-scroll { display: flex; flex-direction: column; min-width: 0; }
.main-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
.content { padding: 32px 32px 48px; min-width: 0; }
.content:only-child { grid-column: 1 / -1; }
@media (min-width: 781px) {
  body:not(.home-page) { height: 100vh; overflow: hidden; }
  body:not(.home-page) .layout { height: calc(100vh - 56px); min-height: 0; overflow: hidden; }
  body:not(.home-page) .sidebar { height: 100%; position: static; }
  body:not(.home-page) .main-scroll { height: 100%; overflow-y: auto; }
  body:not(.home-page) .page-toc { position: sticky; top: 28px; margin-top: 28px; }
}
.breadcrumbs, .article { max-width: 780px; margin-left: auto; margin-right: auto; }
.breadcrumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--text-muted); }
.article h1 { font-size: 1.625rem; font-weight: 600; margin: 0 0 16px; line-height: 1.3; }
.article h2 { font-size: 1.2rem; font-weight: 600; margin: 26px 0 10px; line-height: 1.35; }
.article h3 { font-size: 1.025rem; font-weight: 600; margin: 18px 0 8px; line-height: 1.4; }
.article h1 strong, .article h2 strong, .article h3 strong, .article h4 strong { font-weight: inherit; }
.article ul, .article ol { margin: 8px 0 12px; padding-left: 22px; }
.article li { margin: 4px 0; }
.article li > p { margin: 0; }
.article li > p + p { margin-top: 4px; }
.article li > ul, .article li > ol { margin: 4px 0; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.article th, .article td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--bg-subtle); font-weight: 600; }
.article th p, .article td p { margin: 0; }
.article th p + p, .article td p + p { margin-top: 6px; }
.article code { background: var(--code-bg); padding: 2px 5px; border-radius: 4px; font-size: 0.9em; }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; overflow-x: auto; }
.code-block code { background: none; padding: 0; }
.callout { border-left: 4px solid var(--accent); background: var(--callout-info); padding: 12px 16px; border-radius: 6px; margin: 16px 0; }
.callout-note { border-left-color: #d29922; background: var(--callout-note); }
.callout-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.doc-image { margin: 16px 0; text-align: center; }
.doc-image img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
.inline-toc { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 16px 0; }
.inline-toc-title, .toc-title { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 8px; }
.page-toc { position: sticky; top: 84px; height: fit-content; max-height: calc(100vh - 108px); overflow-y: auto; padding: 14px 16px; margin: 28px 24px 0 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; }
.page-toc ul, .inline-toc ul { list-style: none; margin: 0; padding: 0; }
.page-toc li, .inline-toc li { margin: 4px 0; }
.toc-l3 { padding-left: 12px; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-subtle); border: 1px solid var(--border); }
.children-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden; margin: 16px 0; }
.children-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; color: var(--text); border-bottom: 1px solid var(--border); font-size: 15px; transition: background 0.12s; }
.children-row:last-child { border-bottom: none; }
.children-row:hover { background: var(--bg-subtle); text-decoration: none; }
.children-row-nested { font-size: 14px; color: var(--text-muted); }
.children-row-chevron { color: var(--text-muted); font-size: 16px; }
.see-also-note { color: var(--text-muted); font-size: 13px; margin-left: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.home-card { display: block; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-subtle); color: var(--text); }
.home-card:hover { border-color: var(--accent); text-decoration: none; }
.home-card h3 { margin: 0 0 6px; font-size: 16px; }
.home-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Front page */
.home-hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(132, 204, 22, 0.28), transparent 45%),
    radial-gradient(circle at 12% 85%, rgba(15, 108, 189, 0.25), transparent 45%),
    linear-gradient(125deg, #132a1c 0%, #1f4722 52%, #366617 100%);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 52px;
  color: #ffffff;
}
.home-hero-inner { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.home-hero h1 { font-size: 2rem; font-weight: 600; margin: 0 0 8px; line-height: 1.2; color: #ffffff; letter-spacing: -0.015em; }
.home-hero-sub { margin: 0 0 28px; color: rgba(255, 255, 255, 0.85); font-size: 15.5px; }
.home-hero-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.78); margin-bottom: 12px; }
.home-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 36px 20px 64px; }
.home-section + .home-section { margin-top: 40px; }
.home-section h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 16px; }
.release-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.release-card { display: block; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; background: var(--bg); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.release-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2); border-color: #74b816; text-decoration: none; }
.release-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.release-card-title { font-weight: 600; font-size: 15px; }
.release-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eaf6d9; color: #2f5e0c; }
[data-theme="dark"] .release-badge { background: #264212; color: #b7e878; }
.release-card-meta { font-size: 13px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.doc-card { display: block; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.doc-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); transform: translateY(-1px); text-decoration: none; }
.doc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.doc-card-title { font-weight: 600; font-size: 15.5px; color: var(--text); }
.doc-card-count { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.doc-card-desc { margin: 0; font-size: 13.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-footer { width: 100%; background: var(--bg-subtle); border-top: 1px solid var(--border); padding: 20px 24px; font-size: 13px; color: var(--text-muted); }
.home-page .site-footer { padding: 20px 0; }
.home-page .footer-inner { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
@media (max-width: 780px) {
  .release-grid, .doc-list { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .page-toc { display: none; }
}
@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .mobile-only { display: inline-block; }
  .sidebar { display: none; position: fixed; left: 0; top: 56px; width: 280px; background: var(--bg); z-index: 25; }
  .sidebar.open { display: block; }
  .content { padding: 20px; }
}
