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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    color: #1e293b;
    line-height: 1.6;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 3rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #64748b;
    text-shadow: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: #8b5cf6;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 1rem;
    position: relative;
}

.nav-links a:hover {
    color: #8b5cf6;
    background: transparent;
    transform: translateY(0);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #8b5cf6;
    transition: width 0.2s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 6rem 3rem 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: none;
}

.hero-content p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 1rem;
    font-weight: 400;
}

.subtitle {
    font-size: 1.1rem !important;
    color: #94a3b8 !important;
    margin-bottom: 2.5rem !important;
    font-weight: 400;
}

.page-hero {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 3rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    z-index: -1;
}

.page-hero h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: none;
}

.page-hero p {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 400;
}

.math-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.english-hero {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.chinese-hero {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn:hover::before {
    left: 100%;
}

.subjects {
    padding: 5rem 3rem;
    text-align: center;
    background: #ffffff;
    min-height: 60vh;
}

.subjects h2 {
    font-size: 2.25rem;
    color: #1e293b;
    margin-bottom: 3rem;
    font-weight: 700;
}

.subject-cards {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    width: 320px;
    padding: 2.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    display: block;
    background: white;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card:hover::before {
    transform: scaleX(1);
}

.math-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.english-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.chinese-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1);
}

.card h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 700;
}

.card p {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
}

.section {
    padding: 4rem 3rem;
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-size: 2.25rem;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.section-desc {
    text-align: center;
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 3rem;
    font-weight: 400;
}

.math-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.english-section {
    background: linear-gradient(135deg, #fdfcfb 0%, #f8fafc 100%);
}

.chinese-section {
    background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
}

.topic-list {
    display: grid;
    gap: 2rem;
}

.topic {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    font-size: 1rem;
    position: relative;
    border-left: 4px solid #8b5cf6;
}

.topic:hover {
    transform: translateX(4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.topic h4 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 700;
}

.topic p {
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
    font-weight: 400;
}

.formula-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
}

.formula {
    display: block;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 1.125rem;
    color: #334155;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    margin: 0.5rem 0;
    border: 1px solid #e2e8f0;
}

.example-box {
    background: #fffbeb;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #fde68a;
}

.grammar-box {
    background: #f0f9ff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #bae6fd;
}

.highlight {
    background: #dbeafe;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    color: #1d4ed8;
}

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.vocab-item {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.vocab-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #8b5cf6;
}

.word {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
}

.meaning {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 400;
}

.dialogue-box {
    background: #f5f3ff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #ddd6fe;
}

.dialogue-box p {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 3px solid #8b5cf6;
    font-size: 1rem;
    color: #475569;
}

.poem-box {
    background: #fffbeb;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #fde68a;
}

.poem-box h5 {
    color: #ca8a04;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.poem-box p {
    font-size: 1.125rem;
    color: #334155;
    font-weight: 400;
    line-height: 1.6;
}

.writing-tips {
    background: #f0fdf4;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #bbf7d0;
}

.writing-tips ul {
    list-style: none;
    margin-top: 1rem;
}

.writing-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    color: #475569;
}

.writing-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: bold;
}

.idiom-box {
    background: #fffbeb;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #fde68a;
}

.idiom-box h5 {
    color: #ca8a04;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.idiom-meaning {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #fde68a;
    color: #64748b;
    font-weight: 500;
}

.quiz-box {
    background: #f0f9ff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #bae6fd;
}

.quiz-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.quiz-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.back-link {
    text-align: center;
    margin-top: 3rem;
}

footer {
    background: #1e293b;
    color: white;
    padding: 3rem 3rem;
    text-align: center;
}

.footer-content p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #cbd5e1;
}

.copyright {
    margin-top: 1.5rem !important;
    opacity: 0.8;
    font-size: 0.9rem !important;
    color: #94a3b8 !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1.5rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        padding: 0.25rem 0;
        font-size: 0.875rem;
    }
    
    .hero, .page-hero {
        padding: 4rem 1.5rem 1.5rem;
        min-height: auto;
    }
    
    .hero-content h1, .page-hero h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.9rem !important;
    }
    
    .subjects {
        padding: 2.5rem 1.5rem;
    }
    
    .subjects h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .subject-cards {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .card {
        width: 100%;
        max-width: 300px;
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card h3 {
        font-size: 1.25rem;
    }
    
    .card p {
        font-size: 0.9rem;
    }
    
    .section {
        padding: 2rem 1.5rem;
    }
    
    .section-content {
        max-width: 100%;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .topic {
        padding: 1.5rem;
        font-size: 0.95rem;
    }
    
    .topic h4 {
        font-size: 1.125rem;
    }
    
    .topic p {
        font-size: 0.95rem;
    }
    
    .formula {
        font-size: 0.95rem;
    }
    
    .vocab-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .vocab-item {
        padding: 1rem;
    }
    
    .word {
        font-size: 1rem;
    }
    
    .meaning {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    footer {
        padding: 2rem 1.5rem;
    }
    
    .footer-content p {
        font-size: 0.9rem;
    }
}