:root {
    --bg-color: #f8f9fa;
    --text-color: #343a40;
    --border-color: #dee2e6;
    --header-bg: #ffffff;
    --accent-color: #007bff;
    --accent-color-light: #e7f3ff;
    --today-highlight: #fff3cd;
    --campus-minhang: #28a745;
    --campus-zhongbei: #dc3545;
    --font-family: 'Noto Sans SC', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--header-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg);
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.week-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.week-selector h2 {
    margin: 0 20px;
    font-size: 1.5rem;
    font-weight: 500;
    min-width: 150px;
    text-align: center;
}

.week-selector button, #current-week-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.week-selector button:hover, #current-week-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#current-week-btn {
    background-color: #6c757d;
}

#current-week-btn:hover {
    background-color: #5a6268;
}

.week-selector h2.current {
    color: var(--accent-color);
    font-weight: 700;
}


.timetable-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    padding: 1px;
}

.grid-item {
    background-color: var(--header-bg);
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
    position: relative;
}

.day-header, .time-header {
    font-weight: 500;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-slot {
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60px;
    box-sizing: border-box;
}

.time-slot span {
    display: block;
}

.course-cell {
    padding: 0;
    height: 60px;
    box-sizing: border-box;
    position: relative;
}

.course-item {
    padding: 8px;
    border-radius: 8px;
    color: white;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 2px;
    right: 2px;
    bottom: 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.course-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.course-item strong {
    font-weight: 500;
}

.course-item .location {
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.9;
}

.campus-闵行 { background-color: var(--campus-minhang); }
.campus-中北 { background-color: var(--campus-zhongbei); }

.today {
    background-color: var(--accent-color-light) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .week-selector h2 {
        font-size: 1.1rem;
        min-width: 100px;
    }

    .week-selector button, #current-week-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .timetable-grid {
        grid-template-columns: 50px repeat(7, 1fr);
    }

    .grid-item {
        font-size: 0.7rem;
    }

    .course-item {
        font-size: 0.7rem;
    }

    .course-item .location {
        font-size: 0.6rem;
    }
}