/* Hegemon wiki */
:root {
  color-scheme: dark;
  --bg: #0b0c0f; --bg-2: #111318; --card: #16191f; --line: rgba(255, 255, 255, .09);
  --fg: #e9ebef; --muted: #a3a9b4; --red: #e8493c; --blue: #2f93d6; --orange: #f08516; --navy: #1d2c3a;
  --accent: var(--orange); --link: #6db6ea; --hh: 64px; --side: 272px; --rail: 220px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--hh) + 20px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
kbd { font: 600 .82em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: #20242c; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; white-space: nowrap; }

/* ---------- header ---------- */
.wk-header { position: sticky; top: 0; z-index: 60; height: var(--hh); background: rgba(11, 12, 15, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.wk-bar { height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 800; letter-spacing: .08em; flex: none; }
.brand img { border-radius: 8px; }
.brand span { display: flex; flex-direction: column; line-height: 1; font-size: .92rem; }
.brand small { font-size: .56rem; font-weight: 700; letter-spacing: .42em; color: var(--orange); margin-top: 4px; }
.search { position: relative; flex: 1; max-width: 460px; margin-inline: auto 0; }
.search input { width: 100%; height: 40px; padding: 0 38px 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; font-size: .95rem; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.slash { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.results { position: absolute; top: 46px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px -20px #000; max-height: 70vh; overflow: auto; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--fg); }
.results a small { display: block; color: var(--muted); font-size: .78rem; }
.results a b { font-weight: 700; }
.results a span { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: 2px; }
.results a:hover, .results a[aria-selected=true] { background: rgba(255, 255, 255, .07); }
.results mark { background: rgba(240, 133, 22, .28); color: inherit; border-radius: 3px; }
.results .none { padding: 14px; color: var(--muted); }
.top-links { display: flex; gap: 4px; }
.top-links a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-size: .94rem; font-weight: 500; }
.top-links a:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.langs summary::-webkit-details-marker { display: none; }
.langs[open] summary, .langs summary:hover { color: var(--fg); }
.langs > div { position: absolute; right: 0; top: 44px; min-width: 160px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; max-height: 60vh; overflow: auto; box-shadow: 0 24px 60px -20px #000; }
.langs a { padding: 8px 12px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: .93rem; }
.langs a:hover { background: rgba(255, 255, 255, .07); }
.langs a[aria-current=true] { color: var(--orange); font-weight: 700; }
.btn { display: inline-flex; align-items: center; background: linear-gradient(135deg, var(--orange), var(--red)); color: #fff !important; font-weight: 700; text-decoration: none; padding: 12px 22px; border-radius: 12px; flex: none; }
.btn-sm { padding: 9px 15px; font-size: .88rem; border-radius: 10px; }
.btn:hover { filter: brightness(1.1); }
.menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; place-items: center; flex: none; }
.menu-btn i, .menu-btn i::before, .menu-btn i::after { content: ""; display: block; width: 18px; height: 2px; background: var(--fg); position: relative; }
.menu-btn i::before { position: absolute; top: -6px; } .menu-btn i::after { position: absolute; top: 6px; }

/* ---------- layout ---------- */
.wk-layout { max-width: 1480px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--rail); gap: 0 40px; align-items: start; }
.sidebar { position: sticky; top: var(--hh); height: calc(100vh - var(--hh)); overflow-y: auto; padding: 28px 8px 40px 0; border-right: 1px solid var(--line); scrollbar-width: thin; }
.sg { margin-bottom: 24px; padding-right: 14px; }
.sg h2 { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 10px; }
.sg ul { list-style: none; margin: 0; padding: 0; }
.sg a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 9px; color: #c8ccd4; text-decoration: none; font-size: .95rem; line-height: 1.35; }
.sg a:hover { background: rgba(255, 255, 255, .06); color: var(--fg); }
.sg a.cur { background: rgba(240, 133, 22, .14); color: #ffb067; font-weight: 600; }
.b { font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); border: 1px solid rgba(240, 133, 22, .5); border-radius: 999px; padding: 1px 7px; line-height: 1.5; flex: none; }
.b-lg { font-size: .7rem; vertical-align: middle; margin-left: 12px; }
.article { padding: 36px 0 60px; min-width: 0; max-width: 820px; }
.crumb { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.crumb a { color: var(--muted); }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 800; }
.lede { font-size: 1.15rem; color: #c3c8d0; margin: 0 0 1.6em; }
.article h2 { font-size: 1.5rem; margin: 2.2em 0 .5em; letter-spacing: -.01em; padding-top: .3em; border-top: 1px solid var(--line); }
.article h3 { font-size: 1.15rem; margin: 1.7em 0 .3em; }
.article p, .article li { color: #d3d7de; }
.article li { margin: .35em 0; }
.article a.toclink, .headerlink { color: var(--muted); text-decoration: none; opacity: 0; margin-left: .4em; font-weight: 400; }
h2:hover .headerlink, h3:hover .headerlink { opacity: 1; }
.article img { border-radius: 14px; border: 1px solid var(--line); margin: 1.4em 0; background: #000; }
.article table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1.2em 0; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--card); font-weight: 700; }
.article code { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.article pre { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow: auto; }
.article pre code { background: none; border: 0; padding: 0; }
.article blockquote { margin: 1.2em 0; padding: 2px 18px; border-left: 4px solid var(--orange); color: var(--muted); }
.article ol > li::marker { color: var(--orange); font-weight: 700; }
.admonition { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: var(--card); border-radius: 12px; padding: 4px 18px 6px; margin: 1.4em 0; }
.admonition .admonition-title { font-weight: 800; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin: 12px 0 2px; }
.admonition p { margin: .5em 0; }
.admonition.tip { border-left-color: #35b37e; } .admonition.tip .admonition-title { color: #35b37e; }
.admonition.warning, .admonition.danger { border-left-color: var(--red); } .admonition.warning .admonition-title, .admonition.danger .admonition-title { color: #ff7a6e; }
.admonition.beta { border-left-color: var(--orange); } .admonition.beta .admonition-title { color: var(--orange); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 3em 0 1.5em; }
.pn a { display: block; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--fg); }
.pn a:hover { border-color: rgba(240, 133, 22, .6); }
.pn small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.pn span { font-weight: 700; }
.pn .next { text-align: right; }
.fb { color: var(--muted); font-size: .92rem; }
.rail { position: sticky; top: var(--hh); padding: 36px 0; max-height: calc(100vh - var(--hh)); overflow: auto; }
.toc h2 { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc ul ul { margin-left: 12px; }
.toc a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.4; border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--fg); }
.toc a.on { color: #ffb067; border-left-color: var(--orange); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 1em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card ul { list-style: none; padding: 0; margin: 0 0 10px; }
.card li { margin: .2em 0; font-size: .95rem; }
.wk-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.wk-foot { max-width: 1480px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.wk-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.wk-foot a { color: var(--muted); text-decoration: none; } .wk-foot a:hover { color: var(--fg); }
.wk-foot p { flex-basis: 100%; margin: 4px 0 0; font-size: .8rem; opacity: .85; }
.scrim { position: fixed; inset: var(--hh) 0 0 0; background: rgba(0, 0, 0, .6); z-index: 40; }
.pick { display: grid; place-items: center; min-height: 100vh; }
.pick-box { text-align: center; padding: 24px; }
.pick-box img { margin: 0 auto 14px; border-radius: 14px; }
.lang-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.lang-card { border: 1px solid var(--line); background: var(--card); padding: 12px 22px; border-radius: 12px; color: var(--fg); text-decoration: none; font-weight: 600; }
.lang-card:hover { border-color: var(--orange); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .wk-layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 880px) {
  .menu-btn { display: grid; }
  .top-links { display: none; }
  .wk-layout { display: block; }
  .sidebar { position: fixed; top: var(--hh); left: 0; bottom: 0; width: min(86vw, 330px); height: auto; background: var(--bg); z-index: 50; padding: 20px 8px 40px 12px; transform: translateX(-102%); transition: transform .22s ease; border-right: 1px solid var(--line); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; }
  .article { padding-top: 24px; }
}
@media (max-width: 620px) {
  .wk-bar { gap: 8px; padding: 0 12px; }
  .brand span { display: none; }
  .btn-sm { display: none; }
  .search { max-width: none; }
  .pn { grid-template-columns: 1fr; }
  .pn .next { text-align: left; }
  .slash { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sidebar { transition: none; } }
@media print { .wk-header, .sidebar, .rail, .pn, .wk-footer, .scrim { display: none; } .wk-layout { display: block; } body { background: #fff; color: #000; } .article p, .article li { color: #000; } }
