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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f6f8fa;
    color: #1f2328;
}

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #d0d7de;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #eaeef2;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #0969da;
    font-weight: 600;
}

/* Search */
.search-container {
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    color: #1f2328;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

#searchInput::placeholder {
    color: #6e7781;
}

#searchInput:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    margin-top: 6px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eaeef2;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f6f8fa;
}

.search-result-title {
    font-weight: 600;
    color: #0969da;
    margin-bottom: 4px;
    font-size: 14px;
}

.search-result-excerpt {
    font-size: 12px;
    color: #57606a;
    line-height: 1.4;
}

/* Navigation */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-menu ul {
    list-style: none;
}

/* Category styles */
.nav-category {
    margin: 8px 0;
}

.nav-category-header {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #57606a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-category-icon {
    font-size: 14px;
}

.nav-category-title {
    flex: 1;
}

.nav-category-items {
    list-style: none;
    padding-left: 28px;
}

.nav-category-items .nav-item {
    padding: 8px 16px;
}

.nav-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.nav-item:hover {
    background: #f6f8fa;
}

.nav-item.active {
    background: #f0f7ff;
    border-left-color: #0969da;
}

.nav-item.active .nav-item-title {
    color: #0969da;
    font-weight: 600;
}

.nav-item-title {
    font-weight: 500;
    font-size: 14px;
    color: #1f2328;
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.content-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #eaeef2;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #d0d7de;
    font-size: 20px;
    cursor: pointer;
    color: #57606a;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: #f6f8fa;
    border-color: #0969da;
    color: #0969da;
}

#pageTitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2328;
    margin: 0;
    line-height: 1.3;
}

/* Markdown Body */
.markdown-body {
    padding: 40px 48px;
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
}

/* Markdown Styles */
.markdown-body h1 {
    font-size: 2em;
    font-weight: 600;
    border-bottom: 1px solid #d0d7de;
    padding-bottom: 0.3em;
    margin: 24px 0 16px;
    color: #1f2328;
}

.markdown-body h1:first-child {
    margin-top: 0;
}

.markdown-body h2 {
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 1px solid #eaeef2;
    padding-bottom: 0.3em;
    margin: 24px 0 16px;
    color: #1f2328;
}

.markdown-body h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 24px 0 16px;
    color: #1f2328;
}

.markdown-body h4 {
    font-size: 1em;
    font-weight: 600;
    margin: 20px 0 12px;
    color: #1f2328;
}

.markdown-body p {
    line-height: 1.6;
    margin-bottom: 16px;
    color: #1f2328;
}

.markdown-body a {
    color: #0969da;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.markdown-body a:hover {
    border-bottom-color: #0969da;
}

.markdown-body ul, 
.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 2em;
    color: #1f2328;
}

.markdown-body li {
    margin: 6px 0;
    line-height: 1.6;
}

.markdown-body code {
    background: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 85%;
    color: #cf222e;
    border: 1px solid #eaeef2;
}

.markdown-body pre {
    background: #f6f8fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #eaeef2;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    border: none;
    color: #1f2328;
    font-size: 13px;
    line-height: 1.5;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeef2;
}

.markdown-body blockquote {
    border-left: 4px solid #d0d7de;
    padding-left: 20px;
    margin: 16px 0;
    color: #57606a;
    background: #f6f8fa;
    padding: 12px 20px;
    border-radius: 6px;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #d0d7de;
    padding: 10px 12px;
    text-align: left;
}

.markdown-body table th {
    background: #f6f8fa;
    font-weight: 600;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid #eaeef2;
    margin: 24px 0;
}

.markdown-body strong {
    font-weight: 600;
    color: #1f2328;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f6f8fa;
}

::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b1bac4;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
        width: 85%;
        max-width: 320px;
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .markdown-body {
        padding: 20px 16px;
    }

    .content-header {
        padding: 12px 16px;
    }

    #pageTitle {
        font-size: 1.2rem;
    }
    
    .markdown-body h1 {
        font-size: 1.6rem;
    }
    
    .markdown-body h2 {
        font-size: 1.3rem;
    }
    
    .markdown-body h3 {
        font-size: 1.1rem;
    }
    
    .markdown-body pre {
        font-size: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: none;
    }
    
    .markdown-body {
        padding: 16px 12px;
    }
    
    .content-header {
        padding: 10px 12px;
    }
    
    #pageTitle {
        font-size: 1.1rem;
    }
}

/* Highlight.js light theme override */
.hljs {
    background: #f6f8fa !important;
    color: #1f2328 !important;
}

/* Custom selection */
::selection {
    background: #ddf4ff;
    color: #1f2328;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth transitions */
.nav-item,
.search-result-item,
.menu-toggle,
#searchInput {
    transition: all 0.2s ease;
}