
:root {
    --bg-color: #f8fafc;
    --text-main: #334155;
    --math-color: #3b82f6;
    --physics-color: #8b5cf6;
    --history-color: #d97706;
    --english-color: #10b981;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo-area h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* Main Content */
.content-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.knowledge-block {
    margin-bottom: 4rem;
    scroll-margin-top: 120px;
}

.block-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.block-header h2 {
    font-size: 1.8rem;
    z-index: 2;
    background: var(--bg-color);
    padding-right: 1rem;
}

.icon-bg {
    position: absolute;
    right: 0;
    font-size: 4rem;
    opacity: 0.1;
    font-weight: bold;
    z-index: 1;
}

/* Math Theme */
.math-theme .block-header h2 { color: var(--math-color); }
.math-theme .icon-bg { color: var(--math-color); }
.math-theme .info-card { border-top: 4px solid var(--math-color); }

/* Physics Theme */
.physics-theme .block-header h2 { color: var(--physics-color); }
.physics-theme .icon-bg { color: var(--physics-color); }
.physics-theme .info-card { border-top: 4px solid var(--physics-color); }

/* History Theme */
.history-theme .block-header h2 { color: var(--history-color); }
.history-theme .icon-bg { color: var(--history-color); }
.history-theme .timeline-item { border-left-color: var(--history-color); }

/* English Theme */
.english-theme .block-header h2 { color: var(--english-color); }
.english-theme .icon-bg { color: var(--english-color); }
.english-theme .grammar-box { border-left: 4px solid var(--english-color); }

/* Cards */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.25rem;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    text-align: center;
    font-weight: bold;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 4px solid transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--history-color);
    border-radius: 50%;
}

.year {
    font-weight: bold;
    color: var(--history-color);
    margin-bottom: 0.3rem;
}

/* Grammar Grid */
.grammar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grammar-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.grammar-box h3 {
    color: var(--english-color);
    margin-bottom: 1rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    background: #e2e8f0;
    color: #64748b;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .main-nav ul {
        gap: 1rem;
    }
    
    .block-header h2 {
        font-size: 1.5rem;
    }
}
