:root {
    --text-color: #1a1a1a;
    --bg-color: #ffffff;
    --sidebar-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --accent-color: #000000;
    --link-color: #333333;
    --code-bg: #f7f7f7;
    --header-height: 60px;
    --sidebar-width: 250px;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    height: var(--header-height);
    background-color: var(--text-color);
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--bg-color);
}

.version {
    font-size: 0.8rem;
    background: #333;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
    font-family: monospace;
    color: #e0e0e0;
}

.search-container input {
    background: #333;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 200px;
}
.search-container input::placeholder {
    color: #888;
}

/* Layout */
.container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
nav.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    height: calc(100vh - var(--header-height));
    position: fixed;
    overflow-y: auto;
    padding: 20px 0;
}

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

nav.sidebar li {
    margin-bottom: 2px;
}

nav.sidebar a {
    display: block;
    padding: 8px 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

nav.sidebar a:hover {
    background-color: #eaeaea;
    color: #000;
}

nav.sidebar a.active {
    border-left-color: var(--accent-color);
    font-weight: 600;
    background-color: #eaeaea;
}

.sidebar-header {
    padding: 0 24px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 20px;
}
.sidebar-header:first-child {
    margin-top: 0;
}

/* Main Content */
main {
    margin-left: var(--sidebar-width);
    padding: 40px 60px;
    width: calc(100% - var(--sidebar-width));
    max-width: 900px;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    color: #000;
}

h1 { font-size: 2.2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-top: 0; }
h2 { font-size: 1.7rem; border-bottom: 1px solid #eee; padding-bottom: 5px; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1.2em;
    color: #333;
}

ul, ol {
    margin-bottom: 1.2em;
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover {
    color: #000;
}

/* Code Blocks */
pre {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 1.5em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    color: #24292e;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background-color: rgba(27,31,35,0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 85%;
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: 100%;
    border-radius: 0;
}

blockquote {
    border-left: 4px solid #ddd;
    padding-left: 15px;
    color: #555;
    margin-bottom: 1.5em;
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
    font-size: 0.95rem;
}

th, td {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background-color: var(--sidebar-bg);
    font-weight: 600;
}

/* Definition Lists */
dl {
    margin-bottom: 1.5em;
}
dt {
    font-weight: 700;
    margin-top: 1em;
    font-family: monospace;
}
dd {
    margin-left: 2em;
    margin-bottom: 0.5em;
    color: #444;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2em 0;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    nav.sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
    }

    main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .search-container {
        display: none; /* Hide search on mobile to save space */
    }
}
