
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1e2330;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #00a3ff;
  --link: #0086d1;
  --code-bg: #f1f5f9;
  --aside: #ffffff;
}
[data-theme="dark"] {
  --bg: #0f1218;
  --card: #171b24;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --border: #2a3140;
  --primary: #3db8ff;
  --link: #6ec8ff;
  --code-bg: #12161f;
  --aside: #141822;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
.wrap { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.wiki-topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.85rem; }
.logo { height: 28px; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline; }
.title { font-size: 1.25rem; font-weight: 700; }
.badge-offline {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 999px; padding: 0.15rem 0.55rem;
}
.lang-label { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; }
select, input[type="search"] {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 0.45rem; padding: 0.35rem 0.55rem; font: inherit;
}
.main {
  display: grid; grid-template-columns: 260px 1fr; gap: 1.75rem;
  padding: 1.75rem 0 2.5rem; align-items: start;
}
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
}
.toc-col, .article-col {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0.75rem; padding: 1.1rem 1.15rem;
}
.toc-heading { font-weight: 700; margin-bottom: 0.85rem; }
.toc-section {
  margin: 0.9rem 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.toc-section:first-child { margin-top: 0; }
.menu-item { margin: 0.1rem 0; }
.menu-link {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.4rem; text-decoration: none; color: var(--text);
  padding: 0.28rem 0.4rem; border-radius: 0.4rem; font-size: 0.92rem;
}
.menu-link:hover, .menu-link.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.menu-sub { display: none; padding-left: 0.7rem; }
.menu-accordion.show > .menu-sub { display: block; }
.menu-accordion.show > .menu-link .menu-arrow { transform: rotate(90deg); }
.menu-arrow { font-size: 0.7rem; color: var(--muted); transition: transform .15s ease; }
.article-col { position: relative; min-height: 50vh; }
#wiki_article_title { margin: 0 0 1rem; font-size: 1.55rem; }
.wiki-article h1 { font-size: 1.4rem; }
.wiki-article h2 { font-size: 1.2rem; margin-top: 1.5rem; }
.wiki-article h3 { font-size: 1.05rem; margin-top: 1.2rem; }
.wiki-article a { color: var(--link); }
.wiki-article img {
  max-width: 100%; height: auto; display: block; margin: 1rem 0 0.5rem;
  border-radius: 0.5rem; border: 1px solid var(--border);
}
.wiki-article blockquote {
  margin: 1rem 0; padding: 0.6rem 0.9rem; border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 0.35rem;
}
.wiki-article pre, .wiki-article code { background: var(--code-bg); border-radius: 0.35rem; }
.wiki-article pre { padding: 0.75rem 1rem; overflow: auto; }
.wiki-article code { padding: 0.1rem 0.3rem; font-size: 0.9em; }
.wiki-article table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.wiki-article th, .wiki-article td, .wiki-term-table th, .wiki-term-table td {
  border: 1px solid var(--border); padding: 0.45rem 0.6rem; vertical-align: top;
}
.wiki-term-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 1rem 0;
}
.wiki-term-toolbar label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.badge {
  display: inline-block; background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary); border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 600;
}
.busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; background: color-mix(in srgb, var(--card) 85%, transparent); z-index: 2;
}
.spinner {
  width: 1.25rem; height: 1.25rem; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.d-none { display: none !important; }
.text-muted { color: var(--muted); }
.text-danger { color: #e11d48; }
.fw-semibold { font-weight: 600; }
.footer { padding: 0 0 2rem; color: var(--muted); font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }


.brand-link { display: inline-flex; align-items: center; }
.btn-app {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 0.85rem; font-weight: 600;
  color: #fff; background: var(--primary); border-radius: 0.45rem;
  padding: 0.4rem 0.75rem; white-space: nowrap;
}
.btn-app:hover { filter: brightness(1.05); color: #fff; }
.footer a { color: var(--link); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
