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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, "Segoe UI", "Liberation Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #202122;
    background-color: #ffffff;
}

.page-wrapper {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    gap: 30px;
}

/* --- Sticky Table of Contents (Left Sidebar) --- */

.toc-sidebar {
    flex: 0 0 260px;
    position: relative;
}

.toc-container {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    font-size: 13.5px;
    line-height: 1.5;
}

.toc-container::-webkit-scrollbar {
    width: 5px;
}

.toc-container::-webkit-scrollbar-thumb {
    background: #a2a9b1;
    border-radius: 3px;
}

.toc-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #a2a9b1;
    color: #202122;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 3px;
}

.toc-list li a {
    color: #0645ad;
    text-decoration: none;
    display: block;
    padding: 1px 0;
}

.toc-list li a:hover {
    text-decoration: underline;
}

.toc-list .toc-h2 {
    padding-left: 0;
    font-weight: 600;
}

.toc-list .toc-h3 {
    padding-left: 16px;
    font-size: 12.5px;
}

.toc-list .toc-number {
    margin-right: 5px;
    color: #202122;
}

/* --- Main Article Content --- */

.article-content {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-family: "Linux Libertine", "Georgia", "Times", serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 4px;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 6px;
    color: #000000;
}

.article-subtitle {
    font-size: 13px;
    color: #54595d;
    margin-bottom: 18px;
    font-style: italic;
}

.lead-paragraph {
    font-size: 16px;
    margin-bottom: 20px;
}

.lead-paragraph b {
    font-weight: 700;
}

/* --- Infobox (Right-side summary box like Wikipedia) --- */

.infobox {
    float: right;
    clear: right;
    width: 300px;
    margin: 0 0 16px 20px;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    font-size: 14px;
    line-height: 1.5;
    border-collapse: collapse;
}

.infobox-header {
    background-color: #eaecf0;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 1px solid #a2a9b1;
}

.infobox-row {
    display: flex;
    border-bottom: 1px solid #eaecf0;
}

.infobox-label {
    flex: 0 0 110px;
    padding: 6px 10px;
    font-weight: 600;
    background-color: #f1f1f1;
    border-right: 1px solid #eaecf0;
}

.infobox-value {
    flex: 1;
    padding: 6px 10px;
}

/* --- Headings --- */

h2 {
    font-family: "Linux Libertine", "Georgia", "Times", serif;
    font-size: 24px;
    font-weight: 400;
    border-bottom: 1px solid #a2a9b1;
    margin-top: 28px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    color: #000000;
}

h3 {
    font-size: 19px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #000000;
}

h4 {
    font-size: 16px;
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 6px;
    color: #000000;
}

/* --- Paragraphs and Text --- */

p {
    margin-bottom: 12px;
}

strong {
    font-weight: 700;
}

/* --- Lists --- */

ul, ol {
    margin: 8px 0 14px 24px;
}

ul li, ol li {
    margin-bottom: 4px;
}

/* --- Tables --- */

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 14px;
    background-color: #f8f9fa;
}

.wiki-table th {
    background-color: #eaecf0;
    border: 1px solid #a2a9b1;
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
}

.wiki-table td {
    border: 1px solid #a2a9b1;
    padding: 6px 10px;
}

.wiki-table tr:nth-child(even) {
    background-color: #f0f2f4;
}

/* --- Blockquotes / Note Boxes --- */

.note-box {
    background-color: #f8f9fa;
    border-left: 4px solid #36c;
    padding: 10px 14px;
    margin: 14px 0;
    font-size: 14.5px;
}

/* --- FAQ Section --- */

.faq-item {
    margin-bottom: 16px;
}

.faq-question {
    font-weight: 700;
    margin-bottom: 4px;
}

.faq-answer {
    margin-left: 0;
}

/* --- Footer --- */

.article-footer {
    margin-top: 40px;
    padding-top: 14px;
    border-top: 1px solid #a2a9b1;
    font-size: 13px;
    color: #72777d;
    text-align: center;
}

/* --- Responsive --- */

@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .toc-sidebar {
        flex: none;
        width: 100%;
    }

    .toc-container {
        position: relative;
        top: 0;
        max-height: none;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 16px 0;
    }
}

@media (max-width: 600px) {
    .article-title {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 17px;
    }
}
