:root {
  --bg: #0d0d1a;
  --bg-surface: #16162e;
  --bg-card: #1a1a3e;
  --bg-hover: #222255;
  --primary: #9370DB;
  --primary-light: #b388ff;
  --primary-dim: #7c5cbf;
  --accent: #c084fc;
  --text: #e0dff0;
  --text-muted: #9595b5;
  --text-dim: #6b6b8a;
  --border: #2d2d5e;
  --glow: rgba(147, 112, 219, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
::selection { background: var(--primary); color: #fff; }
a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; }
code, pre, .doc-content code { font-family: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace; }
.container { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
html { overflow-x: hidden; }
body { width: 100%; max-width: 100%; overflow-x: hidden; }
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; backdrop-filter: blur(16px); background: rgba(13, 13, 26, 0.8); border-bottom: 1px solid var(--border); }
nav .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
nav .logo img { width: 28px; height: 28px; border-radius: 50%; }
nav .logo span { color: var(--primary-light); }
nav .back { color: var(--text-muted); font-size: 0.9rem; text-decoration: none; }
nav .back:hover { color: var(--primary-light); text-decoration: none; }
.doc-header { grid-column: 2; padding: 100px 0 40px; }
.doc-header h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 60%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.doc-header p { color: var(--text-muted); font-size: 1.05rem; max-width: 700px; }
.doc-content { grid-column: 2; min-width: 0; }
.doc-content h2 { font-size: 1.5rem; font-weight: 700; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text); scroll-margin-top: 80px; }
.doc-content h3 { font-size: 1.15rem; font-weight: 600; margin: 32px 0 12px; color: var(--primary-light); scroll-margin-top: 80px; }
.doc-content h4 { font-size: 1rem; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.doc-content p { margin-bottom: 16px; color: var(--text-muted); }
.doc-content strong { color: var(--text); }
.doc-content ul, .doc-content ol { margin: 0 0 16px 24px; color: var(--text-muted); }
.doc-content li { margin-bottom: 6px; }
.doc-content code { background: rgba(147,112,219,0.15); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: var(--primary-light); }
.doc-content pre { background: #0c0c0c; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; overflow-x: auto; margin-bottom: 20px; }
.doc-content pre code { background: none; padding: 0; color: #e0dff0; font-size: 0.85rem; }
.doc-content table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.9rem; }
.doc-content th { background: var(--bg-surface); color: var(--text); font-weight: 600; text-align: left; padding: 10px 14px; border: 1px solid var(--border); }
.doc-content td { padding: 10px 14px; border: 1px solid var(--border); color: var(--text-muted); }
.doc-content tr:hover td { background: rgba(147,112,219,0.05); }
.doc-content blockquote { border-left: 3px solid var(--primary); padding: 12px 20px; margin: 0 0 20px; background: rgba(147,112,219,0.08); border-radius: 0 var(--radius) var(--radius) 0; }
.doc-content blockquote p { margin-bottom: 0; color: var(--text-muted); }
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.doc-sidebar { position: fixed; top: 115px; left: max(24px, calc((100vw - 900px) / 2 + 24px)); width: 220px; max-height: calc(100vh - 115px); overflow-y: auto; }
.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.toc { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px; }
.toc h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary-dim); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--text-muted); font-size: 0.85rem; transition: color .2s, border-color .2s; display: block; border-left: 2px solid transparent; padding-left: 8px; }
.toc a:hover { color: var(--primary-light); }
.toc a.active { color: var(--primary-light); border-left-color: var(--primary); }
footer { border-top: 1px solid var(--border); padding: 40px 0; text-align: center; color: var(--text-dim); font-size: 0.85rem; }
footer a { color: var(--primary-dim); }
@media (max-width: 768px) {
  .doc-header { grid-column: auto; padding: 80px 0 30px; }
  .doc-header h1 { font-size: 1.8rem; }
  .doc-content { grid-column: auto; min-width: 0; overflow-wrap: break-word; }
  .doc-content h2 { font-size: 1.3rem; }
  .doc-content pre { padding: 14px; font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; }
  .doc-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .container { width: 100%; max-width: 100%; padding: 0 16px; }
  .doc-layout { grid-template-columns: 1fr; gap: 0; min-width: 0; }
  .doc-sidebar { display: none; }
  nav .container { gap: 8px; }
  nav .back { font-size: 0.8rem; white-space: nowrap; }
  nav [style*="display:flex"] { flex-shrink: 0; overflow-x: auto; }
}
