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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: #1a1a1a;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    scrollbar-width: thin;
    scrollbar-color: #4a9eff #f0f0f0;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a9eff 0%, #357abd 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5aafff 0%, #4a9eff 100%);
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 0.75rem;
}

.sidebar h2 {
    padding: 0 1.5rem 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1rem;
    text-align: center;
    color: #555;
    font-weight: 400;
    line-height: 1.4;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin: 0;
}

.sidebar a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 400;
}

.sidebar a:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #f8f9fa 100%);
    color: #1a1a1a;
    border-left-color: #4a9eff;
}

.sidebar a.active {
    background: linear-gradient(90deg, #e3f2fd 0%, #f0f7ff 100%);
    color: #4a9eff;
    border-left-color: #4a9eff;
    font-weight: 600;
}

.content {
    margin-left: 280px;
    padding: 3rem 4rem;
    padding-bottom: 100px;
    max-width: 1200px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #4a9eff #f5f5f5;
}

.content::-webkit-scrollbar {
    width: 10px;
}

.content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a9eff 0%, #357abd 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5aafff 0%, #4a9eff 100%);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    border-bottom: 3px solid #4a9eff;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #2a2a2a;
}

h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

h4 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #444;
}

p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

.example-box {
    background: #f5f8ff;
    border-left: 4px solid #4a9eff;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.example-box h3 {
    margin-top: 0;
    color: #1a5fb4;
}

.principle {
    background: #fff;
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.principle h3 {
    margin-top: 0;
    color: #1a1a1a;
}

.example {
    background: #fffbf0;
    padding: 1rem;
    margin-top: 0.75rem;
    border-radius: 4px;
    font-style: italic;
    border-left: 3px solid #f59e0b;
}

.case-study {
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.case-study h3 {
    margin-top: 0;
    color: #166534;
}

.warning-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.tip-box {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.navigation-footer {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.navigation-footer a {
    color: #4a9eff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 2px solid #4a9eff;
    border-radius: 4px;
    transition: all 0.2s;
    background: white;
}

.navigation-footer a:hover {
    background: #4a9eff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 158, 255, 0.3);
}

.prev-page {
    margin-right: auto;
}

.next-page {
    margin-left: auto;
}

.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 2rem;
    background: #4a9eff;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    border: none;
    font-size: 1.5rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #357abd;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f5f5f5;
    font-weight: 600;
    color: #1a1a1a;
}

tr:hover {
    background: #fafafa;
}

code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.highlight {
    background: #fef08a;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
}

section {
    margin-bottom: 2.5rem;
}

/* Image Styles */
figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

figure img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.image-source {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.image-source a {
    color: #4a9eff;
    text-decoration: none;
}

.image-source a:hover {
    text-decoration: underline;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-gallery figure {
    margin: 0;
}

.image-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Full width images */
.full-width-image {
    margin: 2rem -2rem;
    width: calc(100% + 4rem);
}

.full-width-image img {
    width: 100%;
    border-radius: 0;
}

/* Side by side comparison */
.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.image-comparison figure {
    margin: 0;
}

/* Inline images */
.inline-image {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 400px;
}

.inline-image img {
    width: 100%;
}

@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .image-comparison {
        grid-template-columns: 1fr;
    }
    
    .inline-image {
        float: none;
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .full-width-image {
        margin: 2rem 0;
        width: 100%;
    }
}

.comparative-timeline {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.comparative-timeline h3 {
    color: #fff;
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline-item {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 6px;
    border-left: 4px solid #ffd700;
    backdrop-filter: blur(10px);
}

.timeline-item h4 {
    color: #ffd700;
    margin-top: 0;
    font-size: 1.2rem;
}

.timeline-item p {
    margin-bottom: 0.5rem;
}

.fun-fact {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    border-left: 5px solid #ffd700;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.fun-fact::before {
    content: "💡";
    font-size: 2rem;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

.fun-fact h3 {
    color: #fff;
    margin-top: 0;
    font-size: 1.3rem;
}

.contradiction {
    background: #fff5e6;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    border: 3px solid #d97706;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.contradiction h3 {
    color: #92400e;
    margin-top: 0;
    font-size: 1.4rem;
}

.contradiction h4 {
    color: #b45309;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .content {
        padding: 2rem 3rem;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 400px;
        overflow-y: auto;
    }
    
    .content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    .navigation-footer {
        left: 0;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .navigation-footer a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 1rem;
    }
    
    .back-to-top {
        bottom: 120px;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1.5rem 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .example-box,
    .principle,
    .case-study,
    .warning-box,
    .tip-box {
        padding: 1rem;
    }
}
