:root {
    --primary: #0f4c81;
    /* NTHS typical blue */
    --secondary: #2c7da0;
    --accent: #fbc12d;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Subject Colors */
    --math-color: #ef476f;
    --physics-color: #f78c6b;
    --chemistry-color: #06d6a0;
    --biology-color: #118ab2;
    --earth-science-color: #4472a0;
    --cs-color: #073b4c;
    --data-processing-color: #8b5cf6;
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(15, 76, 129, 0.3) 0%, rgba(44, 125, 160, 0.1) 100%);
    top: -100px;
    left: -100px;
    border-radius: 50%;
}

.shape-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 214, 160, 0.2) 0%, rgba(17, 138, 178, 0.1) 100%);
    bottom: -150px;
    right: -100px;
    border-radius: 50%;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(251, 193, 45, 0.2) 0%, rgba(247, 140, 107, 0.1) 100%);
    top: 40%;
    left: 60%;
    border-radius: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -50px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 50px) scale(0.9);
    }
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.logo-link:hover {
    transform: scale(1.05);
}

.school-logo {
    height: 70px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.sub-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: -2px;
}

/* Main Content */
.content-wrapper {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Section Header */
.subject-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.section-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.math-icon {
    background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
}

.physics-icon {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.chemistry-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.biology-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.earth-science-icon {
    background: linear-gradient(135deg, #4d95b8 0%, #476197 100%);
}

.cs-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.data-processing-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.section-note {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: rgba(15, 76, 129, 0.08);
    color: var(--text-main);
    font-weight: 600;
}

.summary-strip strong {
    color: var(--primary);
}

.data-groups {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.status-message {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: rgba(251, 193, 45, 0.15);
    border: 1px solid rgba(251, 193, 45, 0.25);
    color: var(--text-main);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    text-decoration: none;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    z-index: 1;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.4;
    transition: var(--transition);
}

.course-card:hover .card-bg {
    opacity: 0.8;
    transform: scale(1.2);
}

.math-bg {
    background: var(--math-color);
    top: -50px;
    right: -50px;
}

.physics-bg {
    background: var(--physics-color);
    top: -50px;
    right: -50px;
}

.chemistry-bg {
    background: var(--chemistry-color);
    top: -50px;
    right: -50px;
}

.biology-bg {
    background: var(--biology-color);
    top: -50px;
    right: -50px;
}

.earth-science-bg {
    background: var(--earth-science-color);
    top: -50px;
    right: -50px;
}

.cs-bg {
    background: var(--cs-color);
    top: -50px;
    right: -50px;
}

.data-processing-bg {
    background: var(--data-processing-color);
    top: -50px;
    right: -50px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.card-badge {
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.course-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
}

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

.course-card .card-author {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.course-card:hover .arrow-icon {
    transform: translateX(5px);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.main-footer p {
    margin: 0.3rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .school-logo {
        height: 60px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}
