/* ================================================================
   GXLib API Reference — Dark Theme with Neon Accents
   ================================================================ */

:root {
    /* Base colors */
    --bg-deep:       #060a12;
    --bg-primary:    #0a0e17;
    --bg-secondary:  #0f1420;
    --bg-tertiary:   #151b2a;
    --bg-card:       #121825;
    --bg-hover:      #1a2236;

    /* Text */
    --text-primary:   #e2e8f0;
    --text-secondary: #8892a8;
    --text-muted:     #556180;
    --text-dim:       #3a4560;

    /* Accent colors */
    --cyan:         #00d4ff;
    --cyan-dim:     #00d4ff40;
    --cyan-glow:    #00d4ff20;
    --purple:       #a855f7;
    --purple-dim:   #a855f740;
    --pink:         #f472b6;
    --pink-dim:     #f472b640;
    --amber:        #fbbf24;
    --amber-dim:    #fbbf2440;
    --green:        #34d399;
    --green-dim:    #34d39940;
    --red:          #f87171;
    --blue:         #60a5fa;
    --blue-dim:     #60a5fa40;

    /* Type badges */
    --badge-class:    var(--pink);
    --badge-struct:   var(--cyan);
    --badge-enum:     var(--purple);
    --badge-const:    var(--amber);
    --badge-func:     var(--green);
    --badge-typedef:  var(--blue);

    /* Layout */
    --topbar-h:   56px;
    --sidebar-w:  280px;

    /* Borders */
    --border:       #1e293b;
    --border-light: #2a3550;

    /* Misc */
    --radius:       8px;
    --radius-sm:    4px;
    --radius-lg:    12px;
    --shadow:       0 4px 24px rgba(0,0,0,0.5);
    --transition:   0.2s ease;
    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
}

/* ================================================================
   Reset & Base
   ================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

::selection {
    background: var(--cyan-dim);
    color: var(--cyan);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono {
    font-family: var(--font-mono);
}

/* ================================================================
   Top Bar
   ================================================================ */

#topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid #1a2236;
    z-index: 100;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-center {
    flex: 1;
    max-width: 560px;
    position: relative;
}

.topbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 6px;
    user-select: none;
    cursor: pointer;
}

.logo-gx {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px var(--cyan-dim);
}

.logo-lib {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2px 8px;
    border: 1px solid var(--text-dim);
    border-radius: 10px;
    margin-left: 4px;
}

.icon-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-dim);
    border-radius: var(--radius);
    padding: 0 12px;
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 8px 10px;
    outline: none;
}
#search-input::placeholder {
    color: var(--text-dim);
}

.search-kbd {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    border: 1px solid var(--text-dim);
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--text-dim);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
}
.search-results.hidden { display: none; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #111827;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-hover);
}
.search-result-item .sr-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    min-width: 48px;
    text-align: center;
}
.search-result-item .sr-name {
    font-weight: 600;
    color: var(--text-primary);
}
.search-result-item .sr-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}
.search-result-item mark {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-radius: 2px;
    padding: 0 1px;
}

.stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.stats b {
    color: var(--cyan);
    font-weight: 600;
}

/* ================================================================
   Sidebar
   ================================================================ */

.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, rgba(15,20,32,0.95) 0%, rgba(10,14,23,0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid #1a2236;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 18px 8px;
    border-bottom: 1px solid #1a2236;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 8px 0;
}

/* Module item in sidebar */
.sb-module {
    user-select: none;
}

.sb-module-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 18px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
.sb-module-head:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sb-module-head.active {
    color: var(--cyan);
    background: var(--cyan-glow);
}

.sb-module-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sb-module-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-module-count {
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1px 6px;
    flex-shrink: 0;
}

.sb-module-arrow {
    font-size: 0.6rem;
    color: var(--text-dim);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sb-module.expanded > .sb-module-head > .sb-module-arrow {
    transform: rotate(90deg);
}

/* Files under module */
.sb-files {
    display: none;
    padding-left: 14px;
}
.sb-module.expanded > .sb-files {
    display: block;
}

/* File group (wrapper for file + its type items) */
.sb-file-group {
    /* no extra styles needed, just a grouping container */
}

.sb-file {
    padding: 4px 14px 4px 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 4px;
}
.sb-file-parent {
    cursor: pointer;
}
.sb-file-parent:hover {
    background: var(--bg-hover);
}
.sb-file-name {
    cursor: pointer;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-file-name:hover {
    color: var(--text-primary);
}
.sb-file.active,
.sb-file.active .sb-file-name {
    color: var(--cyan);
    background: var(--cyan-glow);
}

/* File arrow (expand/collapse indicator) */
.sb-file-arrow {
    font-size: 0.55rem;
    color: var(--text-dim);
    transition: transform 0.2s;
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}
.sb-file-group.expanded > .sb-file > .sb-file-arrow {
    transform: rotate(90deg);
}

/* File type count badge */
.sb-file-count {
    font-size: 0.65rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0 5px;
    flex-shrink: 0;
}

/* Items under file (types: class, struct, enum) */
.sb-items {
    display: none;
    padding-left: 16px;
}
.sb-file-group.expanded > .sb-items {
    display: block;
}

.sb-type-item {
    padding: 3px 14px 3px 22px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.sb-type-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.sb-type-item.active {
    color: var(--cyan);
}

/* ================================================================
   Sidebar Overlay (mobile)
   ================================================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 40;
}

/* ================================================================
   Main Content
   ================================================================ */

#main {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 24px 32px 60px;
    background: var(--bg-primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition);
}
.breadcrumb a:hover { color: var(--cyan); text-decoration: none; }
.breadcrumb .bc-sep {
    color: var(--text-dim);
    font-size: 0.7rem;
}
.breadcrumb .bc-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* ================================================================
   Landing Page — Module Grid
   ================================================================ */

.landing-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0 20px;
}
.landing-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.landing-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid #1a2236;
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    opacity: 0;
    transition: opacity 0.3s;
}
.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan-dim);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.08);
}
.module-card:hover::before {
    opacity: 1;
}

.module-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.module-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.module-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.module-card-stats {
    display: flex;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.module-card-stats span b {
    color: var(--cyan);
}

/* ================================================================
   Type Badges
   ================================================================ */

.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.badge-class   { color: var(--badge-class);   background: var(--pink-dim);   }
.badge-struct  { color: var(--badge-struct);  background: var(--cyan-dim);   }
.badge-enum    { color: var(--badge-enum);    background: var(--purple-dim); }
.badge-constns { color: var(--badge-const);   background: var(--amber-dim);  }
.badge-func    { color: var(--badge-func);    background: var(--green-dim);  }
.badge-typedef,
.badge-using   { color: var(--badge-typedef); background: var(--blue-dim);   }

/* Qualifier badges — full word labels */
.qual {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    cursor: help;
    position: relative;
    white-space: nowrap;
}
.qual-virtual  { color: var(--purple); background: var(--purple-dim); }
.qual-static   { color: var(--amber);  background: var(--amber-dim);  }
.qual-const    { color: var(--cyan);   background: var(--cyan-dim);   }
.qual-pure     { color: var(--red);    background: rgba(248,113,113,0.15); }
.qual-override { color: var(--green);  background: var(--green-dim);  }
.qual-mutable  { color: var(--blue);   background: var(--blue-dim);   }
.qual-inline   { color: var(--green);  background: var(--green-dim);  }

/* Glossary tooltips — interactive JS-managed popup */
.glossary-term {
    border-bottom: 1px dotted var(--cyan);
    cursor: help;
    color: var(--cyan);
    transition: color 0.15s;
}
.glossary-term:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.glossary-popup {
    position: fixed;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.8;
    min-width: 240px;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 1px rgba(0,212,255,0.2);
    animation: tooltipIn 0.15s ease;
    pointer-events: auto;
}
.glossary-popup .glossary-term {
    font-size: 0.75rem;
}
@keyframes tooltipIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   Detail View — File Overview
   ================================================================ */

.file-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.file-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-header .file-path {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.file-header .file-ns {
    font-size: 0.8rem;
    color: var(--purple);
    margin-top: 2px;
}

.type-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.type-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid #1a2236;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.type-list-item:hover {
    border-color: var(--cyan-dim);
    background: var(--bg-hover);
}
.type-list-item .tl-name {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.type-list-item .tl-doc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================================================================
   Detail View — Class / Struct
   ================================================================ */

/* class/enum specific elements inside .file-header */
.class-tpl {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--purple);
    margin-bottom: 4px;
}
.class-bases {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.class-bases b {
    color: var(--pink);
}
.class-doc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.7;
}
.enum-base {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.class-section {
    margin-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.class-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.class-section-title .access-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.access-dot.public    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.access-dot.protected { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.access-dot.private   { background: var(--red); box-shadow: 0 0 6px rgba(248,113,113,0.5); }

/* Subsection titles (Fields / Methods) */
.subsection-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 14px 4px;
}

/* Member cards — each method/field is a distinct card */
.member-card {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.member-card:last-child {
    border-bottom: none;
}
.member-card:hover {
    background: var(--bg-hover);
}

.member-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.member-sig {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    word-break: break-word;
}

.member-doc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 5px;
    line-height: 1.6;
    padding-left: 2px;
}

/* Syntax coloring in signatures */
.sig-kw   { color: var(--purple); }    /* keywords: virtual, static, const, void, bool, etc. */
.sig-type { color: var(--cyan); }      /* type names */
.sig-name { color: var(--text-primary); font-weight: 600; }
.sig-param { color: var(--pink); }     /* parameter names */
.sig-op   { color: var(--text-muted); } /* operators: &, *, =, etc. */
.sig-num  { color: var(--amber); }     /* numbers */
.sig-str  { color: var(--green); }     /* string literals */

/* ================================================================
   Detail View — Enum
   ================================================================ */

.enum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.enum-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 2px solid #1a2236;
}
.enum-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.enum-table tr:hover td {
    background: var(--bg-hover);
}
.enum-table .ev-name {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--purple);
    white-space: nowrap;
}
.enum-table .ev-init {
    font-family: var(--font-mono);
    color: var(--amber);
    white-space: nowrap;
}
.enum-table .ev-doc {
    color: var(--text-secondary);
}

/* ================================================================
   Detail View — Const Namespace
   ================================================================ */

.const-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.const-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 2px solid #1a2236;
}
.const-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.const-table tr:hover td {
    background: var(--bg-hover);
}
.const-table .ct-sig {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-word;
}
.const-table .ct-doc {
    color: var(--text-secondary);
}

/* ================================================================
   Free Functions
   ================================================================ */

.func-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.func-item:last-child {
    border-bottom: none;
}
.func-item:hover {
    background: var(--bg-hover);
}
.func-item .func-sig {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.func-item .func-doc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ================================================================
   Empty State
   ================================================================ */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .es-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 0.9rem;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 900px) {
    :root {
        --sidebar-w: 240px;
    }
}

@media (max-width: 768px) {
    .icon-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }

    #main {
        margin-left: 0;
        padding: 16px;
    }

    .search-kbd {
        display: none;
    }

    .logo-tag {
        display: none;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .landing-header h1 {
        font-size: 1.6rem;
    }

    .file-header h1 {
        font-size: 1.3rem;
    }

    .member-card {
        padding: 10px 12px;
    }

    .topbar-right {
        display: none;
    }
}

/* ================================================================
   Animations
   ================================================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content > * {
    animation: fadeIn 0.25s ease;
}

.module-card {
    animation: fadeIn 0.3s ease backwards;
}
.module-card:nth-child(2)  { animation-delay: 0.03s; }
.module-card:nth-child(3)  { animation-delay: 0.06s; }
.module-card:nth-child(4)  { animation-delay: 0.09s; }
.module-card:nth-child(5)  { animation-delay: 0.12s; }
.module-card:nth-child(6)  { animation-delay: 0.15s; }
.module-card:nth-child(7)  { animation-delay: 0.18s; }
.module-card:nth-child(8)  { animation-delay: 0.21s; }
.module-card:nth-child(9)  { animation-delay: 0.24s; }
.module-card:nth-child(10) { animation-delay: 0.27s; }

/* ================================================================
   Dictionary Cards (on landing page — above module grid)
   ================================================================ */

.dict-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
@media (max-width: 600px) {
    .dict-cards { grid-template-columns: 1fr; }
}
.dict-card {
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
}
.dict-card:hover {
    border-color: var(--cyan-dim);
    background: var(--bg-hover);
    box-shadow: 0 0 20px var(--cyan-glow);
    transform: translateY(-2px);
}
.dict-card-class { border-left: 3px solid #60a5fa; }
.dict-card-term  { border-left: 3px solid #a78bfa; }
.dict-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.dict-card-body { min-width: 0; }
.dict-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.dict-card-class .dict-card-title { color: #60a5fa; }
.dict-card-term  .dict-card-title { color: #a78bfa; }
.dict-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ================================================================
   Class Dictionary Entries
   ================================================================ */

.classdict-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    flex-wrap: wrap;
}
.classdict-entry:hover {
    border-color: var(--cyan-dim);
    background: var(--bg-hover);
    box-shadow: 0 0 12px var(--cyan-glow);
}
.classdict-name {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--text-primary);
}
.classdict-ns {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}
.classdict-ns::before { content: "::"; }
.classdict-module {
    font-size: 0.7rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 1px 7px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}
.classdict-doc {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 62px;
    line-height: 1.5;
}

/* ================================================================
   Glossary A-Z Page
   ================================================================ */

.glossary-page {
    max-width: 900px;
}

.glossary-jumpbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0 28px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.glossary-jump-link {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition);
    font-family: var(--font-mono);
}
.glossary-jump-link:hover {
    background: var(--cyan-glow);
    border-color: var(--cyan-dim);
    box-shadow: 0 0 8px var(--cyan-glow);
}

.glossary-group {
    margin-bottom: 32px;
}

.glossary-group-letter {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cyan);
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--cyan-dim);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.glossary-group-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-dim);
}

.glossary-entry {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}
.glossary-entry:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.glossary-entry-term {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.glossary-entry-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
