:root {
  --bg:      #0d1117;
  --panel:   #161b22;
  --border:  #30363d;
  --text:    #c9d1d9;
  --muted:   #8b949e;
  --accent:  #58a6ff;
  --green:   #3fb950;
  --red:     #f85149;
  --warn:    #d29922;
  --code-bg: #161b22;
  --sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --sidebar: 240px;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { background: var(--bg); color: var(--text); font-family: var(--sans);
       line-height: 1.65; min-height: 100vh; }

/* ── Header ── */
header { display: flex; align-items: center; padding: 0 1.25rem;
         height: 52px; border-bottom: 1px solid var(--border);
         background: var(--panel); position: sticky; top: 0; z-index: 100; }
.hb { display: flex; align-items: center; gap: .6rem; }
.menu-btn { display: none; background: none; border: none; color: var(--muted);
            font-size: 1.2rem; cursor: pointer; padding: 4px 6px; }
.logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.logo-img { width: 26px; height: 26px; border-radius: 4px; }
.sep { color: var(--border); margin: 0 .2rem; }
.tag { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.badge { font-family: var(--mono); font-size: .65rem; color: var(--accent);
         border: 1px solid rgba(88,166,255,.3); padding: 1px 7px;
         border-radius: 20px; margin-left: .4rem; }
.hl { margin-left: auto; display: flex; align-items: center; gap: 1.2rem; }
.hl a { color: var(--muted); text-decoration: none; font-size: .8rem; }
.hl a:hover { color: var(--text); }

/* ── Layout ── */
.layout { display: flex; height: calc(100vh - 52px); overflow: hidden; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar); flex-shrink: 0; overflow-y: auto;
           border-right: 1px solid var(--border); background: var(--panel);
           padding: .75rem 0; }
.sidebar-overlay { display: none; }
.sg { margin-bottom: .25rem; }
.sg-label { padding: .55rem 1rem .25rem; font-size: .64rem; font-weight: 700;
            color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.nl { display: flex; align-items: center; gap: .5rem; padding: .32rem 1rem .32rem 1.1rem;
      color: var(--muted); text-decoration: none; font-size: .79rem;
      border-left: 2px solid transparent; transition: color .1s, border-color .1s;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nl.active { color: var(--accent); border-left-color: var(--accent);
             background: rgba(88,166,255,.07); }
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor;
       flex-shrink: 0; opacity: .5; }
.nl.active .dot { opacity: 1; }

/* ── Content ── */
.content { flex: 1; overflow-y: auto; padding: 2.5rem 3rem; max-width: 960px; }
article h2 { font-size: 1.65rem; font-weight: 700; margin-bottom: .4rem;
             border-bottom: 1px solid var(--border); padding-bottom: .6rem; }
.sd { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; margin-top: .3rem; }
article h3 { font-size: 1rem; font-weight: 600; color: var(--accent);
             margin: 2rem 0 .6rem; font-family: var(--mono); }
article p { margin: .6rem 0 1rem; color: #b0b9c5; font-size: .92rem; }
article a { color: var(--accent); text-decoration: none; }
article a:hover { text-decoration: underline; }
article ol, article ul { margin: .5rem 0 1rem 1.5rem; font-size: .92rem; }
article li { margin-bottom: .3rem; }
code { font-family: var(--mono); font-size: .82rem; background: var(--code-bg);
       border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px;
       color: var(--accent); }

/* ── Code block ── */
.cb { font-family: var(--mono); font-size: .8rem; line-height: 1.7;
      background: var(--code-bg); border: 1px solid var(--border);
      border-left: 3px solid var(--accent); border-radius: 4px;
      padding: .9rem 1.1rem; margin: .6rem 0 .5rem; overflow-x: auto;
      white-space: pre; color: #e6edf3; }

/* ── Try-it button ── */
.try-btn { display: inline-block; margin: 0 0 1.2rem; font-size: .74rem;
           color: var(--accent); text-decoration: none;
           font-family: var(--mono); opacity: .8; }
.try-btn:hover { opacity: 1; text-decoration: underline; }

/* ── Verb table ── */
.vt { width: 100%; border-collapse: collapse; margin: .5rem 0 1.4rem;
      font-size: .84rem; }
.vt th { text-align: left; padding: .45rem .75rem; background: var(--panel);
         border: 1px solid var(--border); color: var(--muted);
         font-size: .72rem; font-weight: 600; text-transform: uppercase;
         letter-spacing: .05em; }
.vt td { padding: .45rem .75rem; border: 1px solid var(--border);
         vertical-align: top; }
.vt tr:hover td { background: rgba(255,255,255,.015); }
.vt td code { font-size: .79rem; }

/* ── Note box ── */
.nt { background: rgba(88,166,255,.07); border: 1px solid rgba(88,166,255,.2);
      border-radius: 4px; padding: .7rem 1rem; font-size: .84rem;
      color: var(--text); margin: .75rem 0 1.2rem; line-height: 1.6; }
.nt strong { color: var(--accent); }

/* ── Page nav ── */
.page-nav { display: flex; justify-content: space-between; margin-top: 3rem;
            padding-top: 1.2rem; border-top: 1px solid var(--border);
            font-size: .82rem; }
.page-nav a { color: var(--accent); text-decoration: none; }
.page-nav a:hover { text-decoration: underline; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .content { padding: 1.5rem 1.2rem; }
  .hl { display: none; }
  .menu-btn { display: block; }
  .sidebar { position: fixed; top: 52px; left: -260px; height: calc(100vh - 52px);
             width: 240px; z-index: 200; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 2px 0 20px rgba(0,0,0,.5); }
  .sidebar-overlay { display: block; position: fixed; inset: 52px 0 0 0;
                     background: rgba(0,0,0,.5); z-index: 199;
                     opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
}
