* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: 3em;
    font-weight: 700;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

header p {
    font-size: 1.2em;
    opacity: 0.95;
    font-weight: 300;
}

/* 日历容器 */
.calendar-wrapper {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease-out 0.2s both;
    backdrop-filter: blur(10px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-light);
}

.calendar-header h2 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    font-weight: 700;
}

.nav-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.2em;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.nav-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.nav-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 星期标题 */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.weekdays div {
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    padding: 15px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 日期网格 */
.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 1.2em;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    background: var(--bg-light);
    color: var(--text-dark);
    cursor: default;
}

.day.other-month {
    color: #cbd5e0;
    background: transparent;
}

.day.today {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    border: 3px solid #f39c12;
}

.day.has-homework {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* 今天且有作业的特殊样式 */
.day.today.has-homework {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: 4px solid #f39c12;
    box-shadow: 0 0 0 2px white, 0 0 12px rgba(243, 156, 18, 0.6);
}

.day.has-homework:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.day.has-homework::after {
    content: '📝';
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.65em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 页脚 */
footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    font-size: 1em;
    opacity: 0.9;
    animation: fadeIn 1s ease-out 0.4s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.9; }
}

/* 作业列表容器 */
.homework-container {
    max-width: 900px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--primary-color);
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-size: 1.05em;
}

.back-btn:hover {
    background: var(--bg-light);
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.date-title {
    color: white;
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.date-title h1 {
    font-size: 2.8em;
    margin-bottom: 8px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 700;
}

.date-title p {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 300;
}

/* 科目网格 */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.subject-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.subject-card:hover::before {
    transform: scaleX(1);
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.25);
}

.subject-card.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

.subject-icon {
    font-size: 4em;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.subject-name {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 作业内容样式 */
.homework-content {
    background: white;
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-lg);
    line-height: 1.8;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.homework-content h2 {
    color: var(--primary-color);
    margin-bottom: 24px;
    border-bottom: 4px solid var(--primary-color);
    padding-bottom: 16px;
    font-size: 2em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.homework-content h3 {
    color: var(--secondary-color);
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.homework-content h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.homework-content p {
    margin-bottom: 16px;
    color: var(--text-dark);
    font-size: 1.05em;
}

.homework-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.homework-content ul, 
.homework-content ol {
    margin-left: 28px;
    margin-bottom: 20px;
}

.homework-content li {
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 1.05em;
    line-height: 1.7;
}

.homework-content li::marker {
    color: var(--primary-color);
    font-weight: 700;
}

.note-box {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 20px 24px;
    border-radius: 16px;
    margin: 24px 0;
    border-left: 5px solid #f39c12;
    box-shadow: var(--shadow-sm);
}

.note-box p {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1em;
    }

    .calendar-wrapper {
        padding: 20px;
        border-radius: 16px;
    }

    .calendar-header h2 {
        font-size: 1.5em;
    }

    .nav-btn {
        padding: 10px 18px;
        font-size: 1em;
    }

    .weekdays div {
        font-size: 0.85em;
        padding: 10px 5px;
    }

    .day {
        font-size: 1em;
        border-radius: 12px;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .subject-card {
        padding: 30px 20px;
    }

    .date-title h1 {
        font-size: 2em;
    }

    .homework-content {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .homework-content h2 {
        font-size: 1.6em;
    }

    .homework-content h3 {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .calendar-wrapper {
        padding: 15px;
    }

    .days {
        gap: 8px;
    }

    .day {
        font-size: 0.9em;
    }

    .weekdays {
        gap: 8px;
    }
}

/* 加载动画 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 4%, #e0e0e0 25%, #f0f0f0 36%);
    background-size: 1000px 100%;
}
