body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../static/images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

header h1 {
    color: #1a73e8;
    text-align: center;
    font-size: 36px;
    margin: 40px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.grade-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 固定三列 */
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grade-link {
    text-decoration: none;
    color: inherit;
}

.grade-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.grade-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.grade-content {
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.grade-content h2 {
    color: #1a73e8;
    font-size: 24px;
    margin-bottom: 15px;
    width: 100%;
    text-align: center;
}

.grade-content p {
    color: #666;
    font-size: 16px;
    margin: 0;
    width: 100%;
    text-align: center;
}

.grade-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px;
    z-index: 1000;
}

#chat-history {
    height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    max-width: 80%;
}

.user-message {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.ai-message {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
}

#chat-input-container {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#chat-container button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#chat-container button:hover {
    background-color: #0056b3;
}

#history-content {
    margin-top: 40px;
}

.timeline {
    border-left: 3px solid #007bff;
    padding-left: 20px;
}

.event {
    margin-bottom: 30px;
    position: relative;
}

.event h3 {
    color: #007bff;
    margin-bottom: 10px;
}

.event::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 50%;
}

#chat-header {
    cursor: pointer;
    padding: 5px;
    background: #007bff;
    color: white;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-body {
    display: block; /* 默认展开 */
    margin-top: 10px;
}

header {
    position: relative;
    margin-bottom: 40px;
}

.back-link {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: #1557b0;
    transform: translateY(-50%) translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grade-link:hover .grade-section {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.semester-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.semester-link {
    text-decoration: none;
    color: inherit;
}

.semester-section {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.semester-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.semester-section-content {
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.semester-section h2 {
    color: #1a73e8;
    font-size: 24px;
    margin-bottom: 10px;
}

.semester-section p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.semester-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    transition: all 0.3s ease;
    display: block;
}

.semester-text {
    text-align: center;
}

.semester-text h2 {
    color: #1a73e8;
    font-size: 24px;
    margin-bottom: 10px;
}

.semester-text p {
    color: #666;
    font-size: 16px;
}

.semester-section:hover .semester-icon {
    transform: scale(1.1);
}

@media (max-width: 992px) {
    .grade-sections {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grade-sections {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    body {
        background-attachment: scroll;
    }
    
    main {
        margin: 20px;
        padding: 20px;
    }
    
    .back-link {
        position: static;
        display: inline-block;
        transform: none;
        margin-top: 20px;
        text-align: center;
    }
    
    header {
        text-align: center;
    }
    
    .semester-section-content {
        padding: 20px;
    }
    
    .semester-icon {
        width: 60px;
        height: 60px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.semester-section {
    animation: fadeInUp 0.5s ease-out;
}

.semester-section:nth-child(2) {
    animation-delay: 0.1s;
}

.semester-section:nth-child(3) {
    animation-delay: 0.2s;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* 删除或注释掉以下历史知识相关样式 */
/*
.history-section {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-content {
    margin-top: 20px;
    line-height: 1.6;
}
*/

/* 学霸笔记模块样式 */
.notes-section {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin: 40px 0;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.8s ease-out;
}

.notes-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.notes-section h2 {
    font-size: 32px;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.notes-content {
    max-width: 800px;
    margin: 0 auto;
}

.notes-content p {
    font-size: 20px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.notes-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.notes-features li {
    font-size: 18px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.notes-button {
    display: inline-block;
    background: white;
    color: #1a73e8;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.notes-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .notes-section {
        padding: 30px 20px;
    }
    
    .notes-section h2 {
        font-size: 24px;
    }
    
    .notes-content p {
        font-size: 16px;
    }
    
    .notes-features li {
        font-size: 16px;
    }
}

/* 笔记页面样式优化 */
.notes-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.notes-header {
    text-align: center;
    margin-bottom: 30px;
}

.notes-header h1 {
    color: #1a73e8;
    font-size: 32px;
    margin-bottom: 15px;
}

.notes-description {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.notes-preview-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.notes-preview {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.notes-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1a73e8;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
}

.download-button:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

.download-icon {
    font-size: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    color: #1a73e8;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid #1a73e8;
}

.back-button:hover {
    background: #e8f0fe;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .notes-container {
        margin: 20px;
        padding: 20px;
    }
    
    .notes-header h1 {
        font-size: 24px;
    }
    
    .notes-description {
        font-size: 16px;
    }
    
    .notes-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-button, 
    .back-button {
        width: 100%;
        justify-content: center;
    }
}

/* 资源模块样式 */
.resource-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* 通用资源模块样式 */
.resource-module {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.resource-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.resource-module h2 {
    color: #1a73e8;
    font-size: 22px;
    margin-bottom: 15px;
}

.resource-module p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 通用容器样式 */
.container-common {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 通用头部样式 */
.header-common {
    text-align: center;
    margin-bottom: 30px;
}

.header-common h1 {
    color: #1a73e8;
    font-size: 32px;
    margin-bottom: 15px;
}

.description-common {
    color: #666;
    font-size: 18px;
    margin: 15px 0 30px;
}

/* 通用预览容器样式 */
.preview-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.preview-container h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.preview-container p {
    font-size: 18px;
    margin-bottom: 15px;
}

/* 通用按钮样式 */
.button-common {
    display: inline-block;
    background: #1a73e8; /* 蓝色背景 */
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.button-common:hover {
    background: #1557b0; /* 深蓝色背景 */
    transform: translateY(-2px);
}

/* 特定按钮样式 */
.resource-button {
    background: #1a73e8; /* 蓝色背景 */
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resource-button:hover {
    background: #1557b0; /* 深蓝色背景 */
    transform: translateY(-2px);
}

/* 下载按钮样式 */
.download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a73e8;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-button:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-icon {
    font-size: 20px;
}

/* 特殊模块样式 */
.timeline-module {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border: 1px solid #ffcdd2;
}

.notes-module {
    background: linear-gradient(135deg, #f3f9ff, #fff);
    border: 1px solid #bbdefb;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container-common {
        margin: 20px;
        padding: 20px;
    }

    .header-common h1 {
        font-size: 24px;
    }

    .description-common {
        font-size: 16px;
    }

    .button-common,
    .download-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* 页面容器 */
.page-container {
    min-height: 100vh;
    position: relative;
}

/* 页面头部样式 */
.page-header {
    position: relative;
    padding: 20px;
    margin-bottom: 40px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 标题样式 */
.page-header h1 {
    color: #1a73e8;
    text-align: center;
    font-size: 36px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 返回链接样式 */
.back-link {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-link:hover {
    background: #1557b0;
    transform: translateY(-50%) translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .back-link {
        position: static;
        transform: none;
        display: inline-block;
        margin-top: 10px;
    }

    .page-header h1 {
        font-size: 28px;
    }
}

/* 时间对照表模块样式 */
.timeline-section {
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    padding: 40px;
    border-radius: 20px;
    color: white;
    text-align: center;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.3);
}

.timeline-icon {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.timeline-section h2 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timeline-content {
    max-width: 600px;
    margin: 0 auto;
}

.timeline-content p {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.timeline-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.timeline-features li {
    font-size: 18px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.timeline-button {
    display: inline-block;
    background: white;
    color: #1a73e8;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.timeline-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .timeline-section {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .timeline-section h2 {
        font-size: 24px;
    }
    
    .timeline-content p {
        font-size: 16px;
    }
    
    .timeline-features {
        flex-direction: column;
        gap: 10px;
    }
    
    .timeline-features li {
        font-size: 16px;
        width: 100%;
    }
    
    .timeline-button {
        width: 100%;
        padding: 12px 0;
    }
}

/* 答题技巧模块样式 */
.tips-section {
    background: #1a73e8; /* 蓝色背景 */
    padding: 40px;
    border-radius: 20px;
    color: white;
    text-align: center;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.3);
}

.tips-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.tips-section h2 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: bold;
}

.tips-description {
    font-size: 18px;
    margin-bottom: 20px;
}

.tips-content {
    max-width: 600px;
    margin: 0 auto;
}

.tips-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.tips-features li {
    font-size: 18px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.tips-button {
    display: inline-block;
    background: white;
    color: #1a73e8;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
}

.tips-button:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
}

.button-container {
    display: flex;
    justify-content: center; /* 居中对齐 */
    margin-top: 15px; /* 可选，增加按钮与内容之间的间距 */
}

.button-container .download-button {
    margin-right: 10px; /* 可选，增加按钮之间的间距 */
}

.coffee-section {
    text-align: center;
    margin: 40px 0;
}

.coffee-button {
    display: inline-block;
    background: #1a73e8; /* 蓝色背景 */
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.coffee-button:hover {
    background: #1557b0; /* 深蓝色背景 */
    transform: translateY(-2px);
}