/* ==========================================
   课程面板 — Z2 层（模块标签 + 课程列表 + 代码查看）
   ========================================== */

/* ----- 面板主容器：居中，暗色玻璃质感 ----- */
#lesson-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 760px;
  height: 540px;
  z-index: 2;
  background: #1a1e2b;
  color: #e0e0e0;
  border: 1px solid #3a4a6a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  resize: both;
  min-width: 480px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

/* ----- 标题栏 ----- */
#lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
#lesson-title {
  color: #b7c9e2;
  font-weight: 600;
  font-size: 15px;
}
#lesson-toggle-btn {
  background: none;
  border: none;
  color: #7a8aa2;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
#lesson-toggle-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ----- 内容区（展开时显示） ----- */
#lesson-content {
  flex: 1;
  display: none !important;
  overflow: hidden;
  padding: 12px;
  gap: 12px;
}

/* ----- 左侧区域：标签栏 + 列表 ----- */
#lesson-left-area {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* 模块标签栏（横排小按钮） */
#module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.module-tab {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #b0bec5;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.module-tab:hover {
  background: #2a3f5a;
  color: #fff;
}
.module-tab.active {
  background: #3a5a8c;
  border-color: #5a8ad4;
  color: #fff;
}

/* 课程列表容器 */
#lesson-list-wrapper {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow-y: auto;
}
#lesson-list {
  padding: 6px 0;
}
.lesson-loading {
  padding: 12px;
  color: #7a8aa2;
  font-size: 12px;
}
.lesson-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #b7c9e2;
  font-size: 13px;
  transition: all 0.2s;
}
.lesson-item:hover {
  background: #2a3a54;
  color: #fff;
}

/* ----- 右侧代码查看区（保留双窗口） ----- */
#lesson-code-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

#lesson-js-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

#lesson-js-label { color: #e5c07b; }


#lesson-js-viewer {
  width: 100%;
  flex:1;
  background: #0f131a;
  color: #d4d4d4;
  border: 1px solid #2a3344;
  border-radius: 8px;
  padding: 12px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  resize: none;
  white-space: pre;
  overflow: auto;
  line-height: 1.5;
}

/* ========== 折叠/展开状态 ========== */
#lesson-panel.collapsed {
  height: 48px !important;
  min-height: 48px !important;
  resize: none !important;
}
#lesson-panel.collapsed #lesson-content {
  display: none !important;
}
#lesson-panel.collapsed #lesson-header {
  border-bottom: none;
}
#lesson-panel.expanded #lesson-content {
  display: flex !important;
}