:root {
    --bg: #06080f;
    --bg-2: #0b1322;
    --panel: rgba(12, 18, 32, 0.82);
    --panel-strong: rgba(15, 22, 36, 0.92);
    --line: rgba(92, 132, 255, 0.25);
    --glow: rgba(34, 227, 209, 0.25);
    --accent: #35f0da;
    --accent-2: #5aa8ff;
    --text: #eaf1ff;
    --muted: #9bb0d2;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --sans: "M PLUS Rounded 1c", "Nunito", "Noto Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --display: "M PLUS Rounded 1c", "Space Grotesk", "Nunito", "Noto Sans SC", sans-serif;
    --radius: 12px;
    --shadow: 0 18px 40px rgba(3, 7, 15, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.tech {
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(70% 50% at 18% 12%, rgba(28, 60, 96, 0.55) 0%, transparent 60%),
        radial-gradient(55% 60% at 82% 0%, rgba(22, 82, 110, 0.45) 0%, transparent 55%),
        linear-gradient(120deg, rgba(9, 14, 24, 0.9), rgba(7, 10, 18, 0.96)),
        var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: 0.2px;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(74, 163, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(74, 163, 255, 0.05) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.25;
    pointer-events: none;
}

.bg-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    mix-blend-mode: screen;
    opacity: 0.18;
    pointer-events: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 280px 1fr 120px;
    gap: 16px;
    padding: 16px 22px;
    background: linear-gradient(180deg, rgba(6, 10, 20, 0.95) 0%, rgba(6, 10, 20, 0.75) 100%);
    border-bottom: 1px solid rgba(92, 132, 255, 0.18);
    backdrop-filter: blur(16px);
}

.topbar.compact {
    grid-template-columns: 1fr 120px;
}

.actions.left {
    justify-content: flex-start;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, rgba(34, 227, 209, 0.1) 65%);
    box-shadow: 0 0 16px rgba(34, 227, 209, 0.7);
}

.brand-title {
    font-family: var(--display);
    font-size: 19px;
    letter-spacing: 0.8px;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-strong);
    border: 1px solid rgba(92, 132, 255, 0.28);
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: inset 0 0 0 1px rgba(53, 240, 218, 0.08);
}

.search-icon {
    font-family: var(--mono);
    color: var(--accent-2);
}

.search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.btn {
    border: 1px solid rgba(92, 132, 255, 0.3);
    background: rgba(12, 18, 32, 0.6);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    border-color: var(--accent-2);
    box-shadow: 0 0 16px rgba(74, 163, 255, 0.35);
}

.btn-primary {
    background: linear-gradient(120deg, rgba(53, 240, 218, 0.95), rgba(90, 168, 255, 0.95));
    color: #041018;
    border: none;
    box-shadow: 0 10px 22px rgba(53, 240, 218, 0.25);
}

.btn-ghost {
    background: rgba(12, 22, 36, 0.6);
}

.layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    padding: 22px;
}

.layout.single {
    grid-template-columns: minmax(0, 1fr);
}

.sidebar,
.aside {
    position: relative;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(92, 132, 255, 0.2);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}

.panel::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(34, 227, 209, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.panel:hover::after {
    opacity: 1;
}

.panel-title {
    font-family: var(--display);
    font-size: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.side-collapse > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.side-collapse > summary::marker {
    content: "";
}

.side-collapse > summary::after {
    content: "v";
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 12px;
}

.side-collapse:not([open]) > summary::after {
    content: ">";
}

.tree {
    font-family: var(--sans);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0;
    list-style: none;
}

.tree-branch {
    list-style: none;
}

.tree-folder summary {
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-left: 22px;
    color: var(--text);
}

.tree-folder summary::before {
    content: "▸";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-2);
    transition: transform 0.2s ease;
}

.tree-folder[open] summary::before {
    transform: rotate(90deg);
}

.tree-folder ul {
    list-style: none;
    padding-left: 18px;
    margin-top: 8px;
    border-left: 1px dashed rgba(74, 163, 255, 0.25);
}

.tree-file {
    padding: 6px 0 6px 10px;
    border-left: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
}

.tree-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.tree-link:hover {
    color: var(--text);
}

.tree-file.active,
.tree-file:hover {
    color: var(--text);
    border-left-color: var(--accent);
    background: rgba(34, 227, 209, 0.08);
}


.content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.hero {
    padding: 26px;
}

.hero-title {
    font-family: var(--display);
    font-size: 24px;
    margin-bottom: 8px;
}

.hero-meta {
    color: var(--muted);
    display: flex;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
}

.hero-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.results .result-list {
    display: grid;
    gap: 16px;
}

.result-card {
    border: 1px solid rgba(92, 132, 255, 0.22);
    border-radius: 12px;
    padding: 16px;
    background: rgba(12, 20, 34, 0.78);
    transition: border 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(10, 20, 34, 0.45);
}

.result-title {
    font-weight: 600;
    font-size: 16px;
}

.result-path {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.result-snippet {
    margin: 10px 0;
    color: #c7d7f1;
}

.result-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}

.result-empty {
    color: var(--muted);
    font-size: 14px;
    padding: 16px 0;
}

.hidden {
    display: none;
}

.mono { font-family: var(--mono); color: var(--accent-2); }

.doc-header .breadcrumbs {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.doc-title {
    font-family: var(--display);
    font-size: 28px;
    margin: 10px 0;
}

.doc-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}

.doc-body {
    line-height: 1.9;
    font-size: 16px;
    color: #dbe6fb;
}

.doc-body ul,
.doc-body ol {
    padding-left: 20px;
    margin: 12px 0;
}

.doc-body li {
    margin: 6px 0;
}

.doc-body code {
    background: rgba(34, 227, 209, 0.08);
    border: 1px solid rgba(34, 227, 209, 0.2);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.95em;
}

.doc-body pre {
    background: rgba(7, 12, 18, 0.8);
    border: 1px solid rgba(74, 163, 255, 0.2);
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 16px 0;
}

.doc-body pre code {
    background: transparent;
    border: none;
    padding: 0;
}

.doc-body a {
    color: var(--accent-2);
    text-decoration: none;
}

.doc-body a:hover {
    text-decoration: underline;
}


mark {
    background: rgba(34, 227, 209, 0.25);
    color: var(--text);
    padding: 0 2px;
    border-radius: 4px;
}

.hit {
    background: rgba(74, 163, 255, 0.3);
    color: var(--text);
    border-radius: 3px;
    padding: 0 2px;
}
.doc-body h2 {
    font-family: var(--display);
    font-size: 20px;
    margin: 18px 0 10px;
    color: var(--text);
}

.doc-body blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .topbar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 720px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: 2;
    }
    .topbar {
        padding: 14px;
    }
    .search {
        border-radius: 12px;
    }
    .actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}
