:root {
  --theme-color: #6366f1;
  --base-color: #f1f5f9;
  --text-color: #cbd5e1;
  --sidebar-width: 300px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-family: var(--sans);
  background: #0b0f1a;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: #0e1523;
  border-right: 1px solid #1e293b;
  padding-top: 0;
}

.sidebar .app-name {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 8px;
}

.sidebar .app-name-link {
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 15px;
  color: #f1f5f9 !important;
}

.sidebar-nav {
  padding: 8px 24px 40px;
}

.sidebar-nav p {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
  color: #64748b;
  margin: 22px 0 8px;
  font-weight: 700;
}

.sidebar-nav a {
  color: #94a3b8 !important;
  font-size: 13.5px;
  padding: 5px 0;
  font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav li.active > a {
  color: #818cf8 !important;
}

.sidebar-nav li.active > a {
  font-weight: 600;
}

.sidebar-nav ul {
  padding-left: 14px;
}

/* ---------- Content ---------- */
.markdown-section {
  max-width: 880px;
  padding: 48px 56px 80px;
  font-size: 15.5px;
  line-height: 1.75;
  color: #cbd5e1;
}

.markdown-section h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #f1f5f9;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 14px;
}

.markdown-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 44px;
}

.markdown-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 30px;
}

.markdown-section a {
  color: #818cf8;
  text-decoration: none;
  border-bottom: 1px solid rgba(129, 140, 248, .3);
}

.markdown-section a:hover {
  border-bottom-color: #818cf8;
}

.markdown-section code {
  font-family: var(--mono);
  background: #131c2e;
  color: #7dd3fc;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .87em;
}

.markdown-section pre {
  background: #0d1421;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
}

.markdown-section pre > code {
  background: none;
  color: #cbd5e1;
  padding: 0;
  font-size: .85em;
  line-height: 1.65;
}

.markdown-section blockquote {
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, .07);
  padding: 14px 20px;
  margin: 22px 0;
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
}

.markdown-section blockquote p {
  margin: 0;
}

.markdown-section table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  font-size: .9em;
  display: table;
}

.markdown-section table th {
  background: #131c2e;
  color: #e2e8f0;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid #1e293b;
}

.markdown-section table td {
  padding: 9px 14px;
  border: 1px solid #1e293b;
  color: #94a3b8;
}

.markdown-section table tr:nth-child(2n) {
  background: #0d1421;
}

.markdown-section hr {
  border: none;
  border-top: 1px solid #1e293b;
  margin: 36px 0;
}

/* ---------- Search ---------- */
.search input {
  background: #0d1421;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 12px 24px;
  width: calc(100% - 48px);
}

.search .results-panel {
  background: #0e1523;
  border: 1px solid #1e293b;
  border-radius: 8px;
  margin: 0 24px;
}

.search .matching-post {
  border-bottom: 1px solid #1e293b;
  padding: 10px 14px;
}

.search .matching-post a {
  color: #cbd5e1 !important;
  font-size: 13px;
}

.search p {
  color: #64748b !important;
  font-size: 11.5px;
}

/* ---------- Top bar ---------- */
.wiki-topbar {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
}

.wiki-topbar a {
  font-size: 12.5px;
  color: #94a3b8;
  text-decoration: none;
  border: 1px solid #1e293b;
  background: #0e1523;
  padding: 6px 13px;
  border-radius: 7px;
  transition: all .2s;
}

.wiki-topbar a:hover {
  color: #f1f5f9;
  border-color: #6366f1;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .markdown-section {
    padding: 28px 20px 60px;
    font-size: 15px;
  }

  .wiki-topbar {
    top: auto;
    bottom: 16px;
    right: 16px;
  }
}
