:root {
    --font-family-base: 'Noto Sans KR', sans-serif;
    --bg-color: #ffffff;
    --sidebar-bg-color: #f5f5f5;
    --sidebar-border-color: #e0e0e0;
    --text-color-dark: #333333;
    --text-color-light: #666666;
    --accent-color: #4a7c9b;
    --border-color: #e8e8e8;
    --table-header-bg: #f9f9f9;
    --table-row-alt-bg: #f9f9f9;
    --highlight-bg-color: #f0f4f8;
    --timeline-line-color: #dcdcdc;
    --timeline-dot-color: #4a7c9b;
    --sidebar-width: 260px;
    --content-max-width: 900px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-color-dark);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    display: flex;
}

/* ==========================================================================
   Sidebar & Navigation
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg-color);
    border-right: 1px solid var(--sidebar-border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2.5rem;
    color: var(--text-color-dark);
}

.navigation ul {
    list-style: none;
}

.navigation li {
    margin-bottom: 0.5rem;
}

.navigation .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color-light);
    font-weight: 400;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1rem;
}

.navigation .nav-link:hover {
    background-color: var(--border-color);
    color: var(--text-color-dark);
}

.navigation .nav-link.active {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 700;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 3rem 4rem;
}

.page {
    display: none;
    max-width: var(--content-max-width);
    margin: 0 auto;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    color: var(--text-color-light);
}

article h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

article p {
    margin-bottom: 1.25rem;
}

article ul {
    margin-bottom: 1.25rem;
    padding-left: 20px;
}

/* ==========================================================================
   Site Footer (shown on every page, below all sections)
   ========================================================================== */
.site-footer {
    max-width: var(--content-max-width);
    margin: 4rem auto 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.site-footer .highlight-box {
    margin-bottom: 0;
}

.site-footer h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.site-footer p {
    line-height: 1.9;
}

/* ==========================================================================
   Specific Components
   ========================================================================== */

.highlight-box {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    background-color: var(--highlight-bg-color);
    border-left: 5px solid var(--accent-color);
}

.highlight-box h3, .highlight-box h4 {
    margin-top: 0;
    border-bottom: none;
    color: var(--accent-color);
}

.disclaimer {
    margin-top: 3rem;
    padding: 1rem;
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    font-size: 0.9rem;
}
.disclaimer p {
    margin-bottom: 0;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

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

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

thead th {
    background-color: var(--table-header-bg);
    font-weight: 700;
    color: var(--text-color-dark);
}

tbody tr:nth-child(even) {
    background-color: var(--table-row-alt-bg);
}

tbody tr.selected-row {
    background-color: var(--highlight-bg-color);
}

tbody tr.selected-row td:first-child {
    font-weight: 700;
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 2rem;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background-color: var(--timeline-line-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 3px solid var(--timeline-dot-color);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-date {
    position: absolute;
    left: -7rem;
    top: 5px;
    font-weight: 700;
    color: var(--accent-color);
    width: 5rem;
    text-align: right;
}

.timeline-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-color-light);
    margin-bottom: 0;
}

/* Details/Summary (Expandable Sections) */
.treatment-detail {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.treatment-detail summary {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    position: relative;
}

.treatment-detail summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: transform 0.2s;
}

.treatment-detail[open] > summary::after {
    transform: rotate(45deg);
}

.detail-content {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.paper-list {
    list-style: none;
    padding-left: 0;
}
.paper-list li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.paper-list a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
}
.paper-list a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Mobile & Responsive Styles
   ========================================================================== */
.mobile-nav-toggle {
    display: none;
}

.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        height: 100%;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 4.5rem 1.5rem 2rem;
    }

    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 1100;
    }

    #hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: var(--sidebar-bg-color);
        border: 1px solid var(--sidebar-border-color);
        border-radius: 8px;
        padding: 0;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: background-color 0.2s;
    }

    #hamburger-menu:active {
        background: var(--border-color);
    }

    #hamburger-menu span {
        display: block;
        width: 22px;
        height: 2px;
        margin: 3px 0;
        background: var(--text-color-dark);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    #hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    #hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    #hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    .timeline::before {
        left: -1.5rem;
    }
    .timeline-item::before {
        left: -1.5rem;
    }
    .timeline {
        padding-left: 1rem;
    }
    .timeline-date {
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    header h2 {
        font-size: 1.6rem;
    }
    article h3 {
        font-size: 1.3rem;
    }

    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 0.5rem 0.6rem;
    }

    .comparison-table {
        overflow-x: auto;
    }
}
