/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 确保所有图片和媒体元素不会超出容器 */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

:root {
    --primary-blue: #00a8e8;
    --dark-blue: #0077b6;
    --light-blue: #90e0ef;
    --accent-gold: #ffd700;
    --accent-green: #00c853;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
}

html, body {
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    /* 背景图通过内联样式动态设置，默认值在index.html中 */
    color: var(--text-dark);
    width: 100%;
    max-width: 100%;
}

/* 主容器 */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 顶部标题栏 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 6px 12px;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    /*text-align: center;*/
    min-width: 0;
    padding: 0 20px;
}

.header-text h1 {
    font-size: 1.6rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 12px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    color: white;
    padding: 4px 8px;
    width: 180px;
    max-width: 180px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    color: white;
}

.login-btn, .logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.logout-btn {
    background: rgba(255,77,79,0.8);
    border-color: rgba(255,77,79,0.5);
    margin-left: 8px;
}

.change-password-btn {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    margin-right: 8px;
}

.change-password-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    color: white;
    font-size: 0.85rem;
    margin-right: 8px;
}

/* 内容区域 */
.content-area {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}

/* Section通用样式 */
.section {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: fit-content;
    max-height: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 左侧和右侧的section不要拉伸，保持内容高度 */
.left-column .section,
.right-column .section {
    flex: 0 0 auto;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--light-blue);
    flex-shrink: 0;
}

.section-title h2 {
    font-size: 1rem;
    color: var(--dark-blue);
}

.section-title .icon {
    font-size: 1.1rem;
}

.section-content {
    flex: 1;
    overflow-y: visible;
    overflow-x: hidden;
    min-height: fit-content;
}

.section-content::-webkit-scrollbar {
    width: 4px;
}

.section-content::-webkit-scrollbar-thumb {
    background: var(--light-blue);
    border-radius: 2px;
}

/* 关于我们 - 轮播 */
.teacher-carousel {
    position: relative;
    overflow: hidden;
    min-height: fit-content;
    max-height: none;
    height: auto;
}

.teacher-slider {
    display: flex;
    transition: transform 0.5s ease;
}

.teacher-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    text-align: center;
    box-sizing: border-box;
    min-height: fit-content;
}

.teacher-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    margin-bottom: 6px;
    box-shadow: 0 4px 15px rgba(0,119,182,0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.teacher-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-slide h4 {
    font-size: 0.95rem;
    color: var(--dark-blue);
    margin-bottom: 3px;
    font-weight: bold;
}

.teacher-slide .title {
    font-size: 0.75rem;
    color: var(--primary-blue);
    margin-bottom: 4px;
    font-weight: normal;
}

.teacher-slide p {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.5;
    margin-top: 6px;
    padding: 8px 6px;
    /*background: rgba(255, 255, 255, 0.8);*/
    /*border: 2px solid var(--accent-green);*/
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    max-height: 12em;
    text-align: left;
    word-break: break-word;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    flex-shrink: 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: var(--primary-blue);
}

/* 成果展示 */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: linear-gradient(135deg, #fffbf0, #fff9e6);
    border-radius: 8px;
    border-left: 3px solid var(--accent-gold);
    cursor: pointer;
    transition: all 0.3s;
}

.achievement-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.achievement-icon {
    font-size: 1.4rem;
}

.achievement-info h4 {
    font-size: 0.85rem;
    color: var(--dark-blue);
    margin-bottom: 2px;
}

.achievement-info p {
    font-size: 0.75rem;
    color: #666;
}

.empty-achievement {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.8rem;
}

/* 中间 - AI智能虚拟实验室 */
.center-section {
    background: rgba(255,255,255,0.98);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 2px solid var(--accent-green);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: fit-content;
}

.center-section .section-title {
    border-bottom: 2px solid var(--accent-green);
    justify-content: center;
    margin-bottom: 10px;
}

.center-section .section-title h2 {
    font-size: 1.15rem;
    color: #00875a;
}

.lab-panels {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.lab-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.lab-panel.required {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
}

.lab-panel.required .panel-header {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.lab-panel.elective {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-color: #9c27b0;
}

.lab-panel.elective .panel-header {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.lab-panel.games {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: #ff9800;
}

.lab-panel.games .panel-header {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.panel-header {
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 0.95rem;
    margin: 0;
}

.panel-content {
    flex: 1;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: fit-content;
}

.panel-content::-webkit-scrollbar {
    width: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* 教材分类 */
.textbook-group {
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    overflow: hidden;
}

.textbook-header {
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.textbook-name {
    cursor: pointer;
    flex: 1;
}

.textbook-name:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.textbook-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.textbook-click {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #999;
    cursor: pointer;
}

.textbook-click:hover {
    color: var(--primary-blue);
}

.textbook-click img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.textbook-header .arrow {
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    margin-left: 4px;
}

.textbook-header .arrow:hover {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.lab-panel.required .textbook-header {
    background: rgba(33, 150, 243, 0.2);
    color: #1565c0;
}

.lab-panel.elective .textbook-header {
    background: rgba(156, 39, 176, 0.2);
    color: #7b1fa2;
}

.textbook-header:hover {
    background: rgba(255,255,255,0.9) !important;
}

.textbook-header .arrow {
    transition: transform 0.3s;
    font-size: 0.75rem;
}

.textbook-header.active .arrow {
    transform: rotate(180deg);
}

.chapters-list {
    display: none;
    padding: 6px;
    gap: 4px;
    flex-direction: column;
}

.chapters-list.active {
    display: flex;
}

.chapter-item {
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e0e0e0;
    position: relative;
}

.chapter-click {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #999;
}

.chapter-click img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.chapter-item:hover {
    transform: translateX(3px);
}

.lab-panel.required .chapter-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.lab-panel.elective .chapter-item:hover {
    background: #f3e5f5;
    border-color: #9c27b0;
}

.chapter-item .ch-icon {
    font-size: 1rem;
}

.chapter-item .ch-text strong {
    color: var(--text-dark);
    font-size: 0.75rem;
}

.chapter-item .ch-text small {
    display: block;
    color: #666;
    font-size: 0.65rem;
}

/* 游戏卡片 */
.game-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #ffe0b2;
    text-align: center;
}

.game-card:hover {
    transform: scale(1.02);
    border-color: #ff9800;
    box-shadow: 0 3px 10px rgba(255,152,0,0.3);
}

.game-icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.game-card h4 {
    font-size: 0.85rem;
    color: #e65100;
    margin-bottom: 3px;
}

.game-card p {
    font-size: 0.7rem;
    color: #666;
}

/* 留言板 */
/* 留言板的section-content设置为flex布局，留言表单固定，列表可滚动 */
#messages .section-content {
    display: flex;
    flex-direction: column;
    height: auto;
    /* 不限制整个section-content的高度，让留言列表自己控制高度 */
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    flex-shrink: 0; /* 防止表单被压缩，固定显示 */
}

.form-row {
    display: flex;
    gap: 6px;
}

.message-form input,
.message-form textarea {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
}

.message-form textarea {
    min-height: 60px;
}

.message-form button {
    padding: 6px 14px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: auto;  /* 提交按钮靠右对齐 */
}

.anonymous-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.anonymous-check input {
    width: auto;
    flex: none;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto; /* 留言列表可滚动 */
    overflow-x: hidden; /* 隐藏横向滚动 */
    min-height: 0; /* 允许flex子元素缩小 */
    max-height: 180px; /* 限制留言列表最大高度，确保联系我们模块可见 */
    padding-right: 4px; /* 为滚动条留出空间 */
    /* 美化滚动条 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) rgba(0, 0, 0, 0.1);
}

.messages-list::-webkit-scrollbar {
    width: 6px;
}

.messages-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue);
}

/* 确保留言板section不会过度拉伸，为联系我们留出空间 */
#messages.section {
    flex: 0 0 auto;
    max-height: none; /* 移除之前可能的限制 */
}

.message-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-blue);
}

.message-left {
    display: flex;
    flex-direction: column;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-author {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--dark-blue);
}

.message-date {
    font-size: 0.7rem;
    color: #999;
}

.message-text {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.4;
    margin-bottom: 6px;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.message-content {
    flex: 1;
    font-size: 0.75rem;
    color: #555;
    line-height: 1.4;
}

.message-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: 15px;
}

.message-like {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    border-radius: 4px;
    color: var(--primary-blue);
    font-size: 0.7rem;
    transition: all 0.2s;
    align-self: flex-start;
    margin-top: 4px;
}

.message-like:hover {
    opacity: 0.8;
}

.message-like.liked {
    color: #ff4d4f;
}

.message-like.liked:hover {
    color: #ff7875;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
}

/* 联系我们 */
.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #e8f4f8, #f0f8ff);
    border-radius: 8px;
}

.contact-icon {
    font-size: 1.4rem;
}

.contact-info h4 {
    font-size: 0.85rem;
    color: var(--dark-blue);
    margin-bottom: 2px;
}

.contact-info p {
    font-size: 0.8rem;
    color: #666;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 6px 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 0px;
    top: 0px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
    z-index: 10;
}

.close:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.05);
}

.close:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
}

.tab-btn.active {
    background-color: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.form-container {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.form-submit-btn:hover {
    background-color: var(--dark-blue);
}

/* 返回按钮样式 */
.back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 其他页面的容器样式 */
.chapter-detail-container,
.textbook-detail-container,
.games-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .content-area {
        grid-template-columns: 260px 1fr 260px;
    }
}

@media (max-width: 1200px) {
    .content-area {
        grid-template-columns: 240px 1fr 240px;
    }
}

@media (max-width: 992px) {
    .content-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .left-column, .right-column {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .lab-panels {
        grid-template-columns: 1fr;
    }
}

/* 平板和手机适配 */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        position: relative;
    }
    
    * {
        max-width: 100%;
    }
    
    .main-container {
        padding: 4px 6px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Header适配 */
    .header {
        flex-wrap: wrap;
        padding: 8px 4px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        order: 0;
    }
    
    .header-text {
        flex: 1 1 100%;
        order: 2;
        text-align: center;
        min-width: 0;
        width: 100%;
    }
    
    .header-text h1 {
        font-size: 1.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-text p {
        font-size: 0.75rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }
    
    .header-actions {
        position: static;
        margin-top: 0;
        width: 100%;
        order: 3;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        flex: 1 1 100%;
    }
    
    .search-box {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
        order: 1;
        margin-bottom: 4px;
    }
    
    .search-box input {
        width: 100%;
        max-width: 100%;
        flex: 1;
        font-size: 0.8rem;
        padding: 4px 6px;
        box-sizing: border-box;
    }
    
    .user-section {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        order: 2;
    }
    
    .login-btn, .logout-btn, .change-password-btn {
        font-size: 0.75rem;
        padding: 4px 12px;
        white-space: nowrap;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-info span {
        font-size: 0.75rem;
    }
    
    /* 内容区域适配 */
    .content-area {
        padding: 4px 0;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .left-column, .right-column, .center-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Section适配 */
    .section {
        padding: 8px;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .section-title {
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .section-title h2 {
        font-size: 0.9rem;
    }
    
    .section-title .icon {
        font-size: 1rem;
    }
    
    /* 关于我们轮播适配 */
    .teacher-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
        margin-bottom: 4px;
    }
    
    .teacher-slide h4 {
        font-size: 0.85rem;
    }
    
    .teacher-slide .title {
        font-size: 0.7rem;
    }
    
    .teacher-slide p {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
    
    /* 轮播指示器适配 */
    .carousel-dots {
        gap: 6px;
        margin-top: 6px;
    }
    
    .carousel-dot {
        width: 6px;
        height: 6px;
    }
    
    /* 教研风采和成果展示适配 */
    .carousel-image {
        border-radius: 6px;
    }
    
    .carousel-indicators {
        gap: 6px;
        margin-top: 8px;
    }
    
    .indicator {
        width: 6px;
        height: 6px;
    }
    
    /* 中间AI智能虚拟实验室适配 */
    .center-section {
        padding: 8px;
    }
    
    .center-section .section-title h2 {
        font-size: 1rem;
    }
    
    .lab-panels {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .lab-panel {
        margin-bottom: 0;
        padding: 6px;
    }
    
    .panel-header {
        padding: 6px 8px;
    }
    
    .panel-header h3 {
        font-size: 0.85rem;
    }
    
    .textbook-header {
        padding: 6px 8px;
    }
    
    .textbook-name {
        font-size: 0.8rem;
    }
    
    .textbook-click {
        font-size: 0.65rem;
    }
    
    .textbook-click img {
        width: 12px;
        height: 12px;
    }
    
    .arrow {
        font-size: 0.7rem;
    }
    
    .chapters-list {
        padding: 0 4px;
    }
    
    .chapter-item {
        padding: 6px 8px;
        margin-bottom: 4px;
    }
    
    .ch-icon {
        font-size: 0.85rem;
        margin-right: 6px;
    }
    
    .ch-text strong {
        font-size: 0.75rem;
    }
    
    .ch-text small {
        font-size: 0.65rem;
    }
    
    /* 游戏卡片适配 */
    .game-card {
        padding: 8px;
    }
    
    .game-icon {
        font-size: 1.4rem;
        margin-bottom: 3px;
    }
    
    .game-card h4 {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .game-card p {
        font-size: 0.7rem;
    }
    
    /* 留言板适配 */
    .message-form {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .message-form textarea {
        min-height: 50px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .message-form button {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    .messages-list {
        max-height: 250px;
        gap: 4px;
    }
    
    .message-item {
        padding: 6px;
    }
    
    .message-author {
        font-size: 0.75rem;
    }
    
    .message-date, .message-time {
        font-size: 0.65rem;
    }
    
    .message-text, .message-content {
        font-size: 0.7rem;
    }
    
    .message-like {
        font-size: 0.65rem;
    }
    
    /* 联系我们适配 */
    .contact-item {
        padding: 8px;
        gap: 8px;
    }
    
    .contact-icon {
        font-size: 1.2rem;
    }
    
    .contact-info h4 {
        font-size: 0.8rem;
    }
    
    .contact-info p {
        font-size: 0.75rem;
    }
    
    /* 模态框适配 */
    .modal-content {
        width: 90%;
        max-width: 400px;
        margin: 5% auto;
        padding: 20px;
    }
    
    .modal-tabs {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 8px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 8px;
        font-size: 13px;
    }
    
    .form-submit-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    /* 页脚适配 */
    .footer {
        padding: 4px 0;
        font-size: 0.7rem;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        position: relative;
    }
    
    * {
        max-width: 100%;
    }
    
    .main-container {
        padding: 2px 4px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .header {
        padding: 6px 2px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .content-area {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .left-column, .right-column, .center-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .header-logo {
        width: 35px;
        height: 35px;
        flex-shrink: 0;
        order: 0;
    }
    
    .header-text {
        flex: 1 1 100%;
        order: 2;
        text-align: center;
        min-width: 0;
        width: 100%;
        margin-top: 4px;
    }
    
    .header-text h1 {
        font-size: 1rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }
    
    .header-text p {
        font-size: 0.7rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }
    
    .header-actions {
        gap: 4px;
        width: 100%;
        order: 3;
        flex: 1 1 100%;
    }
    
    .search-box {
        width: 100%;
        order: 1;
        margin-bottom: 4px;
    }
    
    .search-box input {
        font-size: 0.75rem;
        width: 100%;
        max-width: 100%;
    }
    
    .user-section {
        width: 100%;
        order: 2;
    }
    
    .login-btn, .logout-btn, .change-password-btn {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    .section {
        padding: 6px;
    }
    
    .section-title h2 {
        font-size: 0.85rem;
    }
    
    .teacher-avatar-large {
        width: 70px;
        height: 70px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
        margin: 10% auto;
    }
    
    .tab-btn {
        padding: 6px;
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input {
        padding: 6px;
        font-size: 12px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-submit-btn {
        padding: 8px;
        font-size: 13px;
    }
    
    /* 中间区域适配 */
    .center-section {
        padding: 6px;
    }
    
    .center-section .section-title h2 {
        font-size: 0.9rem;
    }
    
    .panel-header h3 {
        font-size: 0.8rem;
    }
    
    .textbook-header {
        padding: 5px 6px;
    }
    
    .textbook-name {
        font-size: 0.75rem;
    }
    
    .chapter-item {
        padding: 5px 6px;
    }
    
    .ch-text strong {
        font-size: 0.7rem;
    }
    
    .ch-text small {
        font-size: 0.65rem;
    }
    
    /* 游戏卡片适配 */
    .game-card {
        padding: 8px;
    }
    
    .game-card h4 {
        font-size: 0.85rem;
    }
    
    .game-card p {
        font-size: 0.7rem;
    }
    
    /* 留言列表适配 */
    .messages-list {
        max-height: 200px;
    }
    
    /* Toast弹窗适配 */
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}
