:root {
  --color-bg: #fff;
  --color-bg-secondary: #f5f5f5;
  --color-text: #222;
  --color-text-aside: #6e6e6e;
  --color-link: #1a73e8;
  --color-ts-class: #6741d9;
  --color-ts-function: #467abf;
  --color-ts-property: #358c4a;
  --color-ts-method: #467abf;
  --color-ts-enum: #9a5726;
  --color-code-bg: #f7f7f7;
  --color-code-border: #e2e2e2;
  --color-sidebar-bg: #252526;
  --color-sidebar-text: #cccccc;
  --color-sidebar-active: #fff;
  --color-sidebar-hover: #3c3c3d;
  --color-sidebar-link: #4ec9b0;
  --color-sidebar-link-class: #e5c07b;
  --color-border: #e5e5e5;
  --color-accent: #1a73e8;
  --color-warning: #ffa500;
  --color-tag-bg: #e8e8e8;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: "Fira Code", "JetBrains Mono", "Source Code Pro", Consolas, "Courier New", monospace;
  --sidebar-width: 280px;
  --toc-width: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── SIDEBAR ─────────────────────────────────────────── */

.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  overflow-y: auto;
  z-index: 100;
  padding-bottom: 2rem;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #3c3c3d;
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-header .logo-text {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
}

.sidebar-header .logo-version {
  color: #888;
  font-size: 0.75rem;
  margin-left: 0.3rem;
}

.sidebar-nav { padding: 1rem 0; }

.sidebar-section {
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  padding: 0.6rem 0 0.3rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.3rem 1.25rem;
  color: var(--color-sidebar-text);
  font-size: 0.88rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.sidebar-nav a:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--color-sidebar-active);
  background: rgba(255,255,255,0.08);
  font-weight: 500;
}

.sidebar-nav a .badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-class { background: rgba(229,192,123,0.2); color: #e5c07b; }
.badge-fn { background: rgba(70,122,191,0.2); color: #61afef; }
.badge-type { background: rgba(78,201,176,0.2); color: #4ec9b0; }
.badge-const { background: rgba(209,154,102,0.2); color: #d19a66; }

/* ─── MAIN CONTENT ──────────────────────────────────── */

.site-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
}

.page-content {
  flex: 1;
  max-width: 900px;
  padding: 2.5rem 3rem 4rem;
  min-width: 0;
}

.page-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  padding: 2.5rem 1rem 2rem 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.page-toc .toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 0.5rem;
}

.page-toc a {
  display: block;
  padding: 0.2rem 0;
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: color 0.15s, border-color 0.15s;
}

.page-toc a:hover,
.page-toc a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  text-decoration: none;
}

.page-toc a.toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.78rem;
}

/* ─── TYPOGRAPHY ──────────────────────────────────────── */

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

p { margin-bottom: 0.9rem; }

ul, ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

li { margin-bottom: 0.3rem; }

/* ─── HERO ────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}

.hero p {
  color: var(--color-text-aside);
  font-size: 1.05rem;
}

.hero-badges {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badges img { height: 20px; }

/* ─── CODE ────────────────────────────────────────────── */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: #d4d4d4;
  font-size: 0.85rem;
  line-height: 1.6;
}

.code-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #999;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s;
}

.code-copy:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ─── METHOD / PROPERTY CARDS ──────────────────────── */

.member-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0;
  background: #fff;
}

.member-card .member-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.member-card .member-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ts-method);
}

.member-card .member-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
}

.tag-method { background: #e8f0fe; color: #1a73e8; }
.tag-property { background: #e6f4ea; color: #1e7e34; }
.tag-static { background: #fef3e0; color: #e65100; }
.tag-getter { background: #f3e5f5; color: #7b1fa2; }

.member-card .member-sig {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.member-card .member-desc {
  font-size: 0.9rem;
  color: #444;
}

.member-card .member-params {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.member-card .member-params dt {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #555;
  margin-top: 0.4rem;
}

.member-card .member-params dd {
  margin-left: 1rem;
  color: #666;
}

/* ─── TABLES ──────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.9rem;
}

th {
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg-secondary);
}

td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--color-border);
}

td code {
  font-size: 0.83em;
}

/* ─── CALLOUT / NOTE ──────────────────────────────────── */

.callout {
  border-left: 4px solid var(--color-accent);
  background: #f0f7ff;
  padding: 0.8rem 1.2rem;
  border-radius: 0 6px 6px 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.callout.warning {
  border-left-color: var(--color-warning);
  background: #fff8e6;
}

.callout strong {
  display: block;
  margin-bottom: 0.2rem;
}

/* ─── BREADCRUMB ──────────────────────────────────────── */

.breadcrumb {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: #999; }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb .separator { margin: 0 0.35rem; }

/* ─── FOOTER ──────────────────────────────────────────── */

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
  color: #999;
  text-align: center;
}

/* ─── INSTALL BOX ─────────────────────────────────────── */

.install-box {
  display: flex;
  align-items: center;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  margin: 0.75rem 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #d4d4d4;
}

.install-box .prompt { color: #6a9955; margin-right: 0.5rem; user-select: none; }

/* ─── FEATURE GRID ────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  list-style: none;
  padding: 0;
}

.feature-grid li {
  padding: 1rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-secondary);
  margin: 0;
}

.feature-grid li strong {
  display: block;
  margin-bottom: 0.2rem;
}

.feature-grid li span {
  font-size: 0.88rem;
  color: #666;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 1200px) {
  .page-toc { display: none; }
}

@media (max-width: 900px) {
  .site-sidebar { display: none; }
  .site-content { margin-left: 0; }
  .page-content { padding: 2rem 1.5rem; }
}
