:root {
    --brand-red: #EE1C25;
    --brand-dark: #333333;
    --brand-light: #F4F4F4;
    --text-color: #333333;
    --bg-color: #FFFFFF;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    scroll-behavior: smooth;
}

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 40px; }
main { flex: 3; min-width: 0; padding: 40px 0; }
.sidebar { flex: 1; position: relative; }

header {
    border-bottom: 2px solid var(--brand-red);
    padding: 20px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container { display: flex; justify-content: space-between; align-items: center; }
.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--brand-red);
    text-decoration: none;
}
.main-nav ul { list-style: none; display: flex; gap: 20px; }
.main-nav ul li a { text-decoration: none; color: var(--brand-dark); font-weight: 500; font-size: 14px; transition: color 0.2s; }
.main-nav ul li a:hover { color: var(--brand-red); }

main {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 40px 0;
}

.content {
    flex: 3;
    min-width: 300px;
}

.sidebar {
    flex: 1;
    min-width: 250px;
}

.toc {
    position: sticky;
    top: 100px;
    background: var(--brand-light);
    padding: 20px;
    border-radius: 8px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.toc ul {
    list-style: none;
}

.toc ul li {
    margin-bottom: 10px;
}

.toc ul li a {
    text-decoration: none;
    color: var(--brand-dark);
    font-size: 14px;
    transition: color 0.2s;
}

.toc ul li a:hover {
    color: var(--brand-red);
}

h1, h2, h3, h4 {
    color: var(--brand-red);
    margin-bottom: 20px;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 40px; }
h3 { font-size: 1.5rem; margin-top: 30px; }

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.ai-summary {
    background: #fdf2f2;
    border-left: 5px solid var(--brand-red);
    padding: 20px;
    margin-bottom: 30px;
}

.ai-summary h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--brand-dark);
}

.ai-summary ul {
    margin-left: 20px;
}

.ai-summary ul li {
    margin-bottom: 10px;
    font-weight: 500;
}

.snippet {
    font-style: italic;
    color: #555;
    border-bottom: 1px dashed #ccc;
    display: inline;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

table th, table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: var(--brand-light);
    color: var(--brand-red);
}

footer {
    background: var(--brand-dark);
    color: #fff;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 20px;
    font-size: 14px;
    color: #888;
}

.copyright a { color: #aaa; text-decoration: none; }

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    .sidebar {
        order: -1;
    }
    .toc {
        position: static;
        max-height: none;
    }
}
