/* ===== 模块系统 ===== */
.module-container {
  display: none;
}
.module-container.active-module {
  display: block;
}

/* ===== 响应式导航 ===== */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.logo-section {
  flex-shrink: 0;
}

.logo {
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* 品牌小标签 - 用于模块标题、功能卡片等处 */
.brand-tag {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
}

.brand-tag-sm {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 3px;
}

.tagline {
  font-size: 0.85rem;
  margin: 0;
  color: #888;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  padding: 4px 12px;
  background: #667eea;
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid #667eea;
  color: #667eea;
}
.btn-outline:hover {
  background: #667eea;
  color: white;
}

.btn-admin {
  background: #2d3436;
  color: white;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
}
.btn-admin:hover {
  background: #636e72;
}

/* ===== 首页 ===== */
.hero {
  text-align: center;
  padding: 30px 0;
}

.hero h2 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 20px;
}

.hero-text {
  max-width: 700px;
  margin: 0 auto 40px;
  color: #666;
  line-height: 1.8;
  font-size: 1.05rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.feature-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 20px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.feature-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 15px;
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature-card p {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* ===== 最新动态 ===== */
.recent-section {
  margin-top: 40px;
}
.recent-section h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.recent-list {
  display: grid;
  gap: 15px;
}

.recent-item {
  background: #f8f9fa;
  padding: 18px 22px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  cursor: pointer;
  transition: background 0.2s;
}
.recent-item:hover {
  background: #eef0ff;
}
.recent-item .recent-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}
.recent-item .recent-meta {
  font-size: 0.8rem;
  color: #999;
}

.recent-desc {
  font-size: 0.85rem;
  color: #777;
  margin: 4px 0;
  line-height: 1.4;
}

/* ===== 每日一问 ===== */
.module-header {
  text-align: center;
  margin-bottom: 30px;
}
.module-header h2 {
  color: #667eea;
  font-size: 1.8rem;
}

.qa-filter {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.date-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
}

.date-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.date-list .label {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
}

.date-tag {
  display: inline-block;
  padding: 3px 12px;
  background: #eef0ff;
  color: #667eea;
  border-radius: 15px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.date-tag:hover, .date-tag.active {
  background: #667eea;
  color: white;
}

/* QA 条目 */
.qa-item {
  background: #fff;
  border: 1px solid #eef0ff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.qa-date {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 3px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.qa-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

.qa-question {
  background: #e3f2fd;
  padding: 14px 18px;
  border-radius: 12px 12px 12px 4px;
  margin-bottom: 10px;
  position: relative;
}
.qa-question::before {
  content: '问';
  position: absolute;
  top: -8px;
  left: 12px;
  background: #667eea;
  color: white;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 6px;
}

.qa-answer {
  background: #fff3e0;
  padding: 14px 18px;
  border-radius: 12px 12px 4px 12px;
  position: relative;
}
.qa-answer::before {
  content: '答';
  position: absolute;
  top: -8px;
  right: 12px;
  background: #ff9800;
  color: white;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 6px;
}

/* ===== 每日一问 - 图文并排布局 ===== */

.qa-item {
  background: #fff;
  border: 1px solid #eef0ff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.qa-date {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 3px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.qa-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

/* 图文并排主体 */
.qa-body {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* 文字区域：左侧，可滚动 */
.qa-text-content {
  flex: 1;
  min-width: 0;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}
.qa-text-content::-webkit-scrollbar {
  width: 4px;
}
.qa-text-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.qa-dialogue {
  margin-bottom: 0;
}

.qa-question {
  background: #e3f2fd;
  padding: 14px 18px;
  border-radius: 12px 12px 12px 4px;
  margin-bottom: 10px;
  position: relative;
}
.qa-question::before {
  content: '问';
  position: absolute;
  top: -8px;
  left: 12px;
  background: #667eea;
  color: white;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 6px;
}

.qa-answer {
  background: #fff3e0;
  padding: 14px 18px;
  border-radius: 12px 12px 4px 12px;
  position: relative;
}
.qa-answer::before {
  content: '答';
  position: absolute;
  top: -8px;
  right: 12px;
  background: #ff9800;
  color: white;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 6px;
}

/* 图片区域：右侧，手机截图宽度 360px，可滚动 */
.qa-images-area {
  flex-shrink: 0;
  width: 360px;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 8px;
  background: #f8f8f8;
}
.qa-images-area::-webkit-scrollbar {
  width: 5px;
}
.qa-images-area::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}

.qa-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-images img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #ddd;
  cursor: zoom-in;
  transition: opacity 0.2s;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.qa-images img:hover {
  opacity: 0.9;
}

/* 图片灯箱：展示原图，可自由滚动查看 */
.image-lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 3000;
  cursor: zoom-out;
  overflow: auto;
  padding: 30px;
}
.image-lightbox::-webkit-scrollbar {
  width: 8px;
}
.image-lightbox::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}
.image-lightbox img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* 响应式：小屏幕时图片放到下方 */
@media (max-width: 768px) {
  .qa-body {
    flex-direction: column;
  }
  .qa-images-area {
    width: 100%;
    max-height: 300px;
  }
  .qa-images {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
  }
  .qa-images img {
    width: auto;
    height: 200px;
  }
  .qa-text-content {
    max-height: none;
  }
}

/* ===== 评论区 ===== */
.comment-section {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 18px;
}

.comment-section h4 {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 12px;
}

.comment-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.comment-form textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 50px;
  font-family: inherit;
}
.comment-form textarea:focus {
  outline: none;
  border-color: #667eea;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child {
  border-bottom: none;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: #444;
}

.comment-time {
  font-size: 0.75rem;
  color: #aaa;
  margin-left: 10px;
}

.comment-text {
  margin-top: 4px;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

.comment-del {
  float: right;
  font-size: 0.75rem;
  color: #e74c3c;
  cursor: pointer;
  opacity: 0.5;
}
.comment-del:hover {
  opacity: 1;
}

.login-to-comment {
  color: #667eea;
  cursor: pointer;
  font-size: 0.85rem;
}
.login-to-comment:hover {
  text-decoration: underline;
}

/* ===== Academy 课程 ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.course-card {
  background: #fff;
  border: 1px solid #eef0ff;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102,126,234,0.15);
}

.course-thumb {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea33, #764ba233);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #667eea;
  position: relative;
  overflow: hidden;
}
.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-thumb .play-icon {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.course-info {
  padding: 18px 20px;
}

.course-info h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 8px;
}

.course-desc {
  color: #777;
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.8rem;
  color: #aaa;
}

/* ===== 课程详情弹窗 - 视频与教案并排 ===== */
.course-detail-modal {
  max-width: 1200px;
  max-height: 90vh;
  width: 95%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.course-detail-scroll {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.course-detail-scroll::-webkit-scrollbar {
  width: 4px;
}
.course-detail-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* 视频+教案并排容器 */
.course-detail-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 16px;
}

/* 左侧：视频区域（电脑录屏宽度） */
.course-media-area {
  flex: 1;
  min-width: 0;
  
}

.course-video {
  width: 100%;
  border-radius: 12px;
  background: #000;
}
.course-video video {
  width: 100%;
  border-radius: 12px;
  display: block;
}
.course-video iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 12px;
}

/* 右侧：教案区域，可滚动 */
.course-plan-area {
  flex-shrink: 0;
  width: 320px;
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  line-height: 1.8;
  white-space: pre-wrap;
}
.course-plan-area::-webkit-scrollbar {
  width: 4px;
}
.course-plan-area::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}
.course-plan-area h4 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1rem;
}
.course-plan-area h5 {
  font-size: 0.95rem;
  color: #444;
  margin: 12px 0 6px;
}
.course-plan-area h6 {
  font-size: 0.9rem;
  color: #555;
  margin: 8px 0 4px;
}

/* 响应式：小屏幕时上下排列 */
@media (max-width: 800px) {
  .course-detail-body {
    flex-direction: column;
  }
  .course-media-area {
    max-width: 100%;
  }
  .course-plan-area {
    width: 100%;
    max-height: 300px;
  }
  .course-video iframe {
    height: 240px;
  }
}

/* ===== 弹窗系统 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #999;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #333;
}

/* ===== 认证表单 ===== */
.auth-form h3 {
  text-align: center;
  color: #333;
  margin-bottom: 24px;
  font-size: 1.3rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.form-submit:hover {
  opacity: 0.9;
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: #888;
}
.auth-toggle a {
  color: #667eea;
  cursor: pointer;
  text-decoration: underline;
}

.form-error {
  background: #ffe0e0;
  color: #e74c3c;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: none;
}

/* ===== 加载 & 空状态 ===== */
.loading-text {
  text-align: center;
  color: #999;
  padding: 40px 0;
  font-size: 0.95rem;
}

.empty-text {
  text-align: center;
  color: #bbb;
  padding: 40px 0;
  font-size: 0.95rem;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .nav {
    justify-content: center;
  }
  
  .user-area {
    margin-top: 8px;
  }
  
  .course-grid {
    grid-template-columns: 1fr;
  }
  
  .qa-filter {
    flex-direction: column;
  }
  
  .date-selector {
    flex-wrap: wrap;
  }
  
  .course-video iframe {
    height: 240px;
  }
  
  /* 手机端：图片区域放到下方全宽 */
  .qa-body {
    flex-direction: column;
  }
  .qa-images-area {
    width: 100% !important;
    max-height: 350px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
  }
  .qa-images-area .qa-images {
    flex-direction: row;
    white-space: nowrap;
  }
  .qa-images-area .qa-images img {
    width: auto;
    height: 300px;
  }
  .qa-text-content {
    max-height: none;
  }
}
