:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --secondary-color: #60a5fa;
        --background-color: #0f172a;
        --surface-color: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1.25rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Components */
.card {
    background-color: var(--surface-color);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.toc {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toc ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.toc li a {
    display: block;
    padding: 0.5rem;
    background-color: var(--background-color);
    border-radius: 0.375rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.toc li a:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-color: var(--secondary-color);
}

/* Question Blocks */
.question-block {
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.question-block h1 {
    font-size: 1.5rem;
    border-bottom: none;
    margin-bottom: 1rem;
    -webkit-text-fill-color: initial;
    color: var(--primary-color);
}

/* Alternatives */
ul {
    list-style-position: inside;
    margin-bottom: 1.25rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: block;
    overflow-x: auto;
}

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

th {
    background-color: var(--background-color);
    font-weight: 600;
}

/* Code */
code {
    background-color: var(--background-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-block {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Collapsible Panel Replacement */
details {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

summary {
    padding: 1rem;
    cursor: pointer;
    background-color: var(--background-color);
    font-weight: 500;
    transition: background-color 0.2s;
}

summary:hover {
    background-color: var(--border-color);
}

details>div {
    padding: 1rem;
}