/* Вики rustbase.shop — премиум-дарк, в тон панели/витрины. */
:root {
  --bg: #0a0a0b; --panel: #141416; --panel2: #1a1a1d; --code: #0e0e12;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --text: #fafafa; --muted: #a1a1aa; --dust: #71717a;
  --accent: #f15a29; --accent-h: #ff7a4d;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 15px/1.65 'Inter', -apple-system, system-ui, sans-serif; }
a { color: var(--accent-h); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Шапка */
.wtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  height: 58px; padding: 0 20px; background: rgba(10,10,11,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.wbrand { font-weight: 800; font-size: 16px; color: var(--text); white-space: nowrap; }
.wbrand span { color: var(--accent); }
.wbrand em { font-style: normal; font-weight: 500; color: var(--dust); font-size: 12px; margin-left: 6px; }
.wpanel { font-size: 13px; color: var(--muted); white-space: nowrap; }
.wburger { display: none; background: none; border: 0; color: var(--text); font-size: 20px; cursor: pointer; }

/* Поиск */
.wsearch { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.wsearch input { width: 100%; height: 36px; padding: 0 12px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line2); border-radius: var(--r); font-size: 14px; outline: none; }
.wsearch input:focus { border-color: var(--accent); }
.wsearch-res { position: absolute; top: 42px; left: 0; right: 0; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 6px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); }
.wsearch-res a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.wsearch-res a:hover, .wsearch-res a.sel { background: var(--panel2); text-decoration: none; }
.wsearch-res .sr-t { font-weight: 600; font-size: 13.5px; }
.wsearch-res .sr-s { font-size: 12px; color: var(--dust); margin-top: 2px; }
.wsearch-res .sr-empty { padding: 12px; color: var(--dust); font-size: 13px; text-align: center; }
.wsearch-res mark { background: var(--accent-soft, rgba(241,90,41,.25)); color: var(--accent-h); border-radius: 3px; }

/* Раскладка: навигация | контент | оглавление */
.wlayout { display: grid; grid-template-columns: 264px minmax(0,1fr) 220px; gap: 0; max-width: 1340px; margin: 0 auto; }

/* Левое дерево */
.wnav { position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); overflow-y: auto;
  padding: 22px 14px 60px; border-right: 1px solid var(--line); }
.wnav .sec { margin-bottom: 18px; }
.wnav .sec-t { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dust); padding: 0 10px 6px; }
.wnav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.wnav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.wnav a.active { background: var(--panel2); color: var(--accent-h); font-weight: 600; }

/* Контент */
.wmain { min-width: 0; padding: 30px 40px 80px; }
.wdoc { max-width: 800px; }
.wloading { color: var(--dust); padding: 40px 0; }
.wdoc h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
.wdoc h2 { font-size: 21px; font-weight: 700; margin: 34px 0 12px; padding-top: 8px; scroll-margin-top: 72px; }
.wdoc h3 { font-size: 16.5px; font-weight: 600; margin: 24px 0 8px; scroll-margin-top: 72px; }
.wdoc p { margin: 0 0 14px; color: #e7e7ea; }
.wdoc ul, .wdoc ol { margin: 0 0 14px; padding-left: 24px; }
.wdoc li { margin: 5px 0; }
.wdoc li > ul, .wdoc li > ol { margin: 5px 0; }
.wdoc a { text-decoration: underline; text-underline-offset: 2px; }
.wdoc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.wdoc strong { color: #fff; font-weight: 600; }
.wdoc :not(pre) > code { font-family: var(--mono); font-size: 12.8px; background: var(--code);
  border: 1px solid var(--line); border-radius: 5px; padding: 1.5px 6px; color: #ffd9c9; }

/* Таблицы */
.wdoc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.wdoc th, .wdoc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wdoc th { font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line2); }
.wdoc td code { white-space: nowrap; }

/* Блоки кода */
.wdoc .code { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--code); }
.wdoc .code-head { display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.wdoc .code-head span { font: 600 11px var(--mono); color: var(--dust); text-transform: uppercase; letter-spacing: .04em; }
.wdoc .code-copy { background: var(--panel2); color: var(--muted); border: 1px solid var(--line2);
  border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.wdoc .code-copy:hover { color: var(--text); border-color: var(--line2); }
.wdoc .code-copy.done { color: #4ade80; border-color: #2e6b3e; }
.wdoc pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.wdoc pre code { font-family: var(--mono); font-size: 12.8px; line-height: 1.6; color: #d7d7db; white-space: pre; }

/* Callout-блоки */
.wdoc .callout { border: 1px solid var(--line2); border-left-width: 3px; border-radius: var(--r);
  padding: 12px 16px; margin: 0 0 16px; background: var(--panel); }
.wdoc .callout p:last-child { margin-bottom: 0; }
.wdoc .callout.note { border-left-color: #4f8ef7; }
.wdoc .callout.tip { border-left-color: #4ade80; }
.wdoc .callout.warn { border-left-color: #fbbf24; }
.wdoc .callout.danger { border-left-color: #ef4444; }
.wdoc .callout::before { display: block; font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 6px; }
.wdoc .callout.note::before { content: "Заметка"; color: #4f8ef7; }
.wdoc .callout.tip::before { content: "Совет"; color: #4ade80; }
.wdoc .callout.warn::before { content: "Важно"; color: #fbbf24; }
.wdoc .callout.danger::before { content: "Внимание"; color: #ef4444; }

/* Оглавление справа */
.wtoc { position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); overflow-y: auto;
  padding: 30px 16px; border-left: 1px solid var(--line); }
.wtoc .toc-t { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dust); margin-bottom: 8px; }
.wtoc a { display: block; padding: 3px 0; color: var(--dust); font-size: 13px; line-height: 1.4; }
.wtoc a.lvl3 { padding-left: 12px; font-size: 12.5px; }
.wtoc a:hover, .wtoc a.active { color: var(--accent-h); text-decoration: none; }

/* Адаптив */
@media (max-width: 1080px) { .wlayout { grid-template-columns: 240px 1fr; } .wtoc { display: none; } }
@media (max-width: 760px) {
  .wlayout { grid-template-columns: 1fr; }
  .wnav { position: fixed; top: 58px; left: 0; width: 280px; background: var(--bg); z-index: 20;
    transform: translateX(-100%); transition: transform .2s; border-right: 1px solid var(--line2); }
  .wnav.open { transform: none; }
  .wburger { display: block; }
  .wsearch { max-width: none; }
  .wpanel { display: none; }
  .wmain { padding: 22px 18px 70px; }
}
