:root {
  --bg: #0b1020;
  --panel: #10182c;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --line: rgba(255, 255, 255, 0.1);
  --brand: #6aa7ff;
  --brand-2: #8ee6c8;
  --content: #f8fafc;
  --content-text: #162033;
  --content-muted: #5c667a;
  --content-line: #e5e7eb;
  --code-bg: #edf2f7;
  --shadow: 0 18px 54px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  color: var(--content-text);
  background: #eef2f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  color: var(--text);
  background: rgba(11, 16, 32, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 24px rgba(106, 167, 255, 0.45);
}
.topnav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.topnav a { text-decoration: none; }
.topnav a:hover, .topnav a.active { color: var(--text); }
.edit-link {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 700;
}
.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.lang-button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.lang-button.active { color: #07111f; background: var(--brand-2); }

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  width: 100%;
  min-height: calc(100vh - 64px);
}
.sidebar, .toc {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 28px 18px;
}
.sidebar { color: var(--text); background: var(--bg); border-right: 1px solid var(--line); }
.toc { padding: 28px 20px; background: #eef2f8; border-left: 1px solid #d9e0ec; }
.navigation-title {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.toc .navigation-title { color: #64748b; }
.sidebar a {
  display: block;
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}
.sidebar a:hover, .sidebar a.current { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.toc a {
  display: block;
  padding: 6px 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}
.toc a.level-3 { padding-left: 14px; }
.toc a.level-4 { padding-left: 28px; }
.toc a:hover, .toc a.current { color: #1d4ed8; }

.main { min-width: 0; padding: 28px 36px 34px; }
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 40px;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(106, 167, 255, 0.42), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(142, 230, 200, 0.22), transparent 28%),
    var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 14px !important; color: var(--brand-2) !important; font-size: 12px !important; font-weight: 800; letter-spacing: 0.16em; }
.hero h1 { margin: 0 0 10px; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; }
.hero p { max-width: 960px; margin: 8px 0; color: #cbd6ee; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: #07111f;
  background: var(--brand-2);
  font-weight: 700;
  text-decoration: none;
}
.button.secondary { color: var(--text); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }

.content-card { padding: 42px; background: var(--content); border-radius: 24px; box-shadow: var(--shadow); }
.doc-section + .doc-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--content-line); }
.content-card h2 { margin: 0 0 22px; font-size: 30px; letter-spacing: -0.02em; }
.content-card h3 { margin-top: 34px; font-size: 22px; }
.content-card h4 { margin-top: 26px; font-size: 18px; }
.content-card p, .content-card li { color: var(--content-text); font-size: 16px; line-height: 1.72; }
.content-card ul, .content-card ol { padding-left: 24px; }
.content-card a:not(.anchor) { color: #2563eb; }
.content-card code { padding: 2px 6px; border-radius: 6px; color: #1d4ed8; background: var(--code-bg); font-size: 0.92em; }
.content-card pre { overflow: auto; padding: 16px; border-radius: 14px; color: #dbeafe; background: #0f172a; }
.content-card pre code { padding: 0; color: inherit; background: transparent; }
.content-card blockquote { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--brand); border-radius: 12px; background: #eef6ff; }
.content-card blockquote p { margin: 4px 0; color: #24446d; }
.content-card hr { margin: 42px 0; border: 0; border-top: 1px solid var(--content-line); }
.anchor { opacity: 0; margin-left: -22px; padding-right: 8px; color: var(--brand); text-decoration: none; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--content-line); border-radius: 16px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th { color: #101827; background: #f1f5f9; text-align: left; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--content-line); vertical-align: top; line-height: 1.55; }
tr:last-child td { border-bottom: 0; }
.screenshot-placeholder { margin: 18px 0; padding: 22px; border: 1px dashed #94a3b8; border-radius: 16px; color: #64748b; background: #f8fafc; text-align: center; font-weight: 700; }
.doc-media { margin: 26px auto; text-align: center; }
.doc-media img, .doc-media video { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; border-radius: 14px; background: #0f172a; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16); }
.doc-media figcaption { margin-top: 10px; color: var(--content-muted); font-size: 14px; line-height: 1.5; }
.empty-state { padding: 70px 20px; color: #64748b; text-align: center; }
.footer { margin-top: 28px; padding: 28px; color: #64748b; text-align: center; }

@media (max-width: 1280px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
  .main { padding-right: 28px; }
}
@media (max-width: 880px) {
  .topbar { padding: 0 16px; }
  .topnav > a:not(.edit-link) { display: none; }
  .brand span:last-child { display: none; }
  .layout { display: block; }
  .sidebar { position: static; height: auto; max-height: 320px; }
  .main { padding: 18px; }
  .hero, .content-card { padding: 24px; border-radius: 20px; }
}
