/* Teacherboard 样式 */ /* 按钮样式 */ .teacherboard { padding: 20px; font-family: Arial, sans-serif; } .teacherboard-title { text-align: center; font-size: 32px; margin-bottom: 20px; } #chapter-list { /* 设置固定高度,超出范围将出现滚动 */ max-height: 75vh; /* 超出高度时显示垂直滚动条 */ overflow-y: auto; /* 隐藏水平滚动条(如果不需要) */ overflow-x: hidden; /* 可选:添加一些内边距和边框增强视觉效果 */ padding: 10px; border: 1px solid #e0e0e0; border-radius: 4px; } /* 可选:美化滚动条样式(仅WebKit浏览器有效) */ #chapter-list::-webkit-scrollbar { width: 6px; /* 滚动条宽度 */ } #chapter-list::-webkit-scrollbar-track { background: #f1f1f1; /* 滚动条轨道背景 */ border-radius: 3px; } #chapter-list::-webkit-scrollbar-thumb { background: #c1c1c1; /* 滚动条滑块颜色 */ border-radius: 3px; } #chapter-list::-webkit-scrollbar-thumb:hover { background: #a8a8a8; /* 鼠标悬停时的滑块颜色 */ } .course-cards { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 20px; } .course-card { width: 250px; background-color: #f9f9f9; padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); cursor: pointer; } .course-image { width: 100%; height: 150px; object-fit: cover; border-radius: 5px; } .course-info { margin-top: 10px; } .course-name { font-size: 20px; font-weight: bold; } .course-description { font-size: 14px; color: #555; } /* 课程目录弹出框 */ .course-details { position: fixed; top: 0; left: -400px; /* 从左侧滑入 */ width: 300px; height: 100%; background-color: #fff; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); /* 修改阴影方向 */ padding: 20px; transition: left 0.3s ease; /* 过渡效果改为 left */ z-index: 9999; border-radius: 15px; } .course-details.open { left: 0; /* 打开时显示 */ } /* 基本的课程卡片样式 */ .course-card { width: 150px; height: 200px; margin: 10px; border: 1px solid #ddd; border-radius: 8px; position: relative; overflow: hidden; cursor: pointer; } .course-image { width: 100%; height: 100px; object-fit: cover; } .course-info { padding: 10px; } .course-name { font-size: 16px; font-weight: bold; } .course-description { font-size: 14px; color: #777; } /* 空的添加课程按钮卡片 */ .add-course-card { display: flex; justify-content: center; align-items: center; background-color: #f0f0f0; border: 1px dashed #bbb; } /* 模态框背景 */ .modal { display: none; /* 初始时隐藏 */ position: fixed; z-index: 1; /* 保证浮窗在顶部 */ left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); /* 半透明的黑色背景 */ } /* 浮窗内容 */ .modal-content { background-color: #fff; margin: 15% auto; padding: 20px; border-radius: 10px; width: 80%; /* 修改为80%以适应小屏幕 */ max-width: 600px; /* 设置最大宽度 */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0 1); overflow-y: auto; /* 添加垂直滚动条 */ max-height: 80vh; /* 设置最大高度 */ } /* 按钮样式 */ .modal-buttons { display: flex; justify-content: space-between; } input[type="text"], select { width: 100%; /* 占满一行 */ padding: 12px; /* 增加内边距 */ font-size: 16px; /* 调整字体大小 */ margin: 10px 0; /* 上下留间距 */ border: 2px solid #ccc; /* 边框 */ border-radius: 8px; /* 圆角边框 */ background-color: #f9f9f9; /* 背景色 */ transition: border 0.3s ease, box-shadow 0.3s ease; /* 添加过渡效果 */ } /* 鼠标悬停时输入框的效果 */ input[type="text"]:focus, select:focus { border-color: #4CAF50; /* 聚焦时的边框颜色 */ box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); /* 聚焦时的阴影效果 */ outline: none; /* 去掉默认的聚焦框 */ } /* 给表单标签添加样式 */ label { font-size: 18px; /* 增加字体大小 */ font-weight: bold; /* 加粗字体 */ margin-bottom: 8px; /* 下方间距 */ display: block; /* 使标签占一行 */ color: #333; /* 标签字体颜色 */ } /* 按钮部分 */ .modal-buttons { display: flex; justify-content: space-between; margin-top: 20px; /* 上方间距 */ } /* 添加课程按钮样式 */ .add-course-button { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; border-radius: 50%; background-color: #4CAF50; color: white; font-size: 30px; font-weight: bold; cursor: pointer; } .add-course-button:hover { background-color: #45a049; } .cover-image-container { display: flex; flex-direction: column; align-items: center; } .cover-image-placeholder { width: 150px; height: 150px; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; cursor: pointer; } .modal-buttons button { width: 48%; padding: 12px 0; font-size: 16px; background-color: #4CAF50; color: white; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.3s ease; } .modal-buttons button:hover { background-color: #45a049; } .modal-buttons button[type="button"] { background-color: #f44336; } .modal-buttons button[type="button"]:hover { background-color: #e53935; } .plus-sign { font-size: 30px; color: #888; } #cover-preview { width: 150px; height: 150px; margin-top: 10px; } /* 课程描述文本框样式 */ #course-description { width: 100%; /* 让 textarea 占据整个父容器的宽度 */ height: 150px; /* 设置适当的高度 */ padding: 10px; /* 内边距,让文本与边框之间有一定的间距 */ font-size: 16px; /* 设置字体大小 */ font-family: Arial, sans-serif; /* 字体样式 */ border: 1px solid #ddd; /* 边框颜色 */ border-radius: 8px; /* 边框圆角,使其更加圆润 */ resize: vertical; /* 允许用户垂直调整大小 */ box-sizing: border-box; /* 包含内边距和边框在内的总宽高 */ transition: border-color 0.3s, box-shadow 0.3s; /* 鼠标悬浮和聚焦时的动画效果 */ } /* 课程描述文本框的聚焦样式 */ #course-description:focus { border-color: #4CAF50; /* 聚焦时改变边框颜色 */ box-shadow: 0 0 8px rgba(76, 175, 80, 0.4); /* 聚焦时加上绿色的阴影 */ outline: none; /* 去掉聚焦时的默认外轮廓 */ } /* 课程描述标签样式 */ label[for="course-description"] { font-size: 18px; /* 标签字体大小 */ font-weight: bold; /* 加粗字体 */ margin-bottom: 8px; /* 标签与文本框之间的间距 */ display: block; /* 将标签设置为块级元素,保证换行 */ color: #333; /* 标签颜色 */ } .details-header { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: bold; } .details-header button { background-color: transparent; border: none; font-size: 24px; cursor: pointer; } .close-btn { background: transparent; border: none; font-size: 20px; cursor: pointer; } .add-chapter-btn { margin-top: 20px; padding: 10px 15px; background-color: #4CAF50; color: white; border: none; cursor: pointer; } .add-chapter-btn:hover { background-color: #45a049; } .course-card { border: 1px solid #ddd; padding: 15px; cursor: pointer; } .course-card:hover { background-color: #f1f1f1; } #courseDetails.open { right: 0; /* 打开侧边栏 */ } .details-content { padding-right: 20px; } .lesson-item { display: flex; align-items: center; justify-content: space-between; /* 让垃圾桶靠右 */ padding: 5px 0; } .lesson-text { cursor: pointer; /* 鼠标悬停时变成手指 */ transition: color 0.3s; flex: 1; /* 占据左侧空间 */ } .lesson-text:hover { color: #2575fc; /* 这里你可以设置悬停时的颜色 */ } .icon-btn { background: none; border: none; cursor: pointer; margin-left: 8px; color: #666; font-size: 14px; transition: color 0.2s; } .icon-btn:hover { color: #2575fc; /* hover 高亮 */ } .delete-btn { color: #c0392b; /* 红色垃圾桶 */ } .delete-btn:hover { color: #e74c3c; } .new-chapter-input { width: 200px; padding: 8px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; border-radius: 4px; border: 1px solid #ddd; } .icon-btn { background: none; border: none; cursor: pointer; margin-left: 8px; color: #666; font-size: 14px; transition: color 0.2s; } .icon-btn:hover { color: #2575fc; /* hover 高亮 */ } .delete-btn { color: #c0392b; /* 红色垃圾桶 */ } .delete-btn:hover { color: #e74c3c; } .add-chapter-btn { background-color: #2575fc; color: white; padding: 10px; border-radius: 5px; cursor: pointer; } /* 编辑弹窗 */ .edit-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); } .edit-modal-content { display: flex; flex-direction: column; } .edit-modal-content input, .edit-modal-content textarea { margin-bottom: 10px; padding: 10px; font-size: 16px; border: 1px solid #ddd; border-radius: 5px; } .edit-modal-content button { background-color: #2575fc; color: white; padding: 10px; border-radius: 5px; cursor: pointer; }