:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Methodology & Disclaimer */
.methodology, .disclaimer {
    padding: 2rem 0;
}

.methodology {
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.methodology h3, .disclaimer h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.methodology ul {
    list-style-position: inside;
    margin: 1rem 0;
    padding-left: 1rem;
}

.methodology li {
    margin: 0.5rem 0;
}

.disclaimer {
    background: #fef3c7;
    border: 2px solid var(--warning-color);
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.disclaimer p {
    margin: 0.75rem 0;
}

.disclaimer strong {
    color: var(--danger-color);
}

/* Stats */
.stats {
    padding: 2rem 0;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Filters */
.filters {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Chapters */
.chapters-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

.loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chapter-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.chapter-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chapter-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.chapter-header:hover {
    background: var(--gray-50);
}

.chapter-info {
    flex: 1;
}

.chapter-number {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.chapter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-top: 0.25rem;
}

.chapter-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-new {
    background: #dbeafe;
    color: var(--primary-color);
}

.badge-changed {
    background: #fef3c7;
    color: #b45309;
}

.badge-unchanged {
    background: #d1fae5;
    color: var(--secondary-color);
}

.read-link {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    display: inline-block;
}

.read-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.read-22 {
    background: var(--primary-color);
    color: white;
}

.read-22:hover {
    background: var(--primary-dark);
}

.read-21 {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.read-21:hover {
    background: var(--gray-50);
}

.expand-icon {
    font-size: 1.5rem;
    color: var(--gray-700);
    transition: transform 0.2s;
}

.chapter-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.chapter-content {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.chapter-content.visible {
    display: block;
}

.comparison-text {
    line-height: 1.8;
    color: var(--gray-800);
}

.comparison-text p {
    margin-bottom: 1rem;
}

.comparison-text strong {
    font-weight: 600;
    color: var(--gray-900);
}

.comparison-text em {
    font-style: italic;
    color: var(--gray-700);
}

.comparison-text ul,
.comparison-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.comparison-text li {
    margin: 0.5rem 0;
}

.comparison-text h1,
.comparison-text h2,
.comparison-text h3,
.comparison-text h4 {
    font-weight: 600;
    color: var(--gray-900);
    margin: 1.5rem 0 0.75rem;
}

.comparison-text h1 {
    font-size: 1.5rem;
}

.comparison-text h2 {
    font-size: 1.25rem;
}

.comparison-text h3 {
    font-size: 1.125rem;
}

.comparison-text h4 {
    font-size: 1rem;
}

.comparison-text code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

.comparison-text pre {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.comparison-text pre code {
    background: none;
    padding: 0;
}

.comparison-text blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--gray-700);
}

.no-changes {
    color: var(--gray-700);
    font-style: italic;
}

/* Footer */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 2rem 0;
    text-align: center;
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 1.75rem;
    }

    .site-header h2 {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chapter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .chapter-badges {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .read-link {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}
