:root {
    --primary: #059669;
    --primary-dark: #047857;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    /* Functional group colors */
    --alkane: #64748b;
    --alkene: #2563eb;
    --alkyne: #7c3aed;
    --alcohol: #059669;
    --aldehyde: #d97706;
    --ketone: #dc2626;
    --acid: #be123c;
    --ester: #c026d3;
    --amine: #0891b2;
    --ether: #4f46e5;
    --halide: #65a30d;
    --aromatic: #ca8a04;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: #ffffff;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 { font-size: 1.25rem; font-weight: 600; }
header a { color: white; text-decoration: none; }

/* Navigation */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

nav .container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

nav a:hover, nav a.active { color: var(--primary); }

/* Main content */
main { padding: 2rem 0 4rem; min-height: 70vh; }

/* Footer */
footer {
    background: var(--text);
    color: #94a3b8;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* Chemical formula styling */
sub { font-size: 0.75em; vertical-align: sub; }
sup { font-size: 0.75em; vertical-align: super; }

/* Hero section */
.hero {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Section cards */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.section-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Content cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.card .tag {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Breadcrumbs */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.breadcrumb a:hover { text-decoration: underline; }

/* Article content */
.article-content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content strong {
    color: var(--text);
}

/* Info box */
.info-box {
    background: #f0fdf4;
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.info-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

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

th {
    background: var(--bg);
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover { background: #f8fafc; }

/* FAQ section */
.faq-section {
    margin: 3rem 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.25rem;
    background: var(--bg);
    font-weight: 600;
    cursor: pointer;
}

.faq-answer {
    padding: 1rem 1.25rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
}

.pagination a:hover { background: var(--bg); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .section-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    nav .container { gap: 1rem; }
}
