* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f9f9fb;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

#toc-sidebar {
    width: 300px;
    min-width: 300px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

#toc-sidebar h1 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

#toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc-sidebar li {
    margin: 0.4rem 0;
}

#toc-sidebar a {
    text-decoration: none;
    color: #34495e;
    display: block;
    padding: 0.35rem 0;
    border-radius: 4px;
    transition: all 0.2s;
}

#toc-sidebar a:hover {
    color: #3498db;
    background: #eef5fc;
    padding-left: 0.5rem;
}

#content {
    flex: 1;
    padding: 3rem 4rem;
    background: #ffffff;
    overflow-y: auto;
    max-width: 900px;
    margin: 0 auto;
    margin-top: 20px;
}

section {
    scroll-margin-top: 100px;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 100px;
}

h1 {
    font-size: 2rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid #ddd;
}

h3 {
    font-size: 1.3rem;
}

.image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 1.5rem 0;
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

table th, table td {
    border: 1px solid #ccc;
    padding: 0.8rem;
    text-align: left;
    vertical-align: top;
}

table th {
    background: #f0f7ff;
    color: #2c3e50;
    font-weight: 600;
}

table tr:nth-child(even) {
    background: #f9f9fb;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f0f7ff;
    border-left: 5px solid #3498db;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #555;
}

ul, ol {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

html {
    scroll-behavior: smooth;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    #toc-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 1rem;
    }

    #content {
        padding: 2rem;
    }
}

p {
    margin: 1rem 0;
}

a {
    color: #3498db;
    text-decoration: underline;
}

a:hover {
    color: #2980b9;
}