/* ========== AI课程空间（对齐原平台 aiCourseSpace） ========== */
.cs-page {
  position: relative;
  min-height: calc(100vh - 56px);
  padding: 12px 16px 16px;
  color: #1d2129;
  background: #f5f7fa;
  box-sizing: border-box;
}

.cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.cs-title-wrap {
  position: relative;
}

.cs-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1d2129;
  line-height: 1.3;
}

.cs-title-underline {
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e63323, #f2796b);
}

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

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.cs-btn-ai-control {
  border-color: #f5c6c0;
  background: #fef3f2;
  color: #c0271b;
}

.cs-btn-ai-control:hover {
  background: #fde8e6;
}

.cs-btn-primary {
  background: #e63323;
  border-color: #e63323;
  color: #fff;
}

.cs-btn-primary:hover {
  background: #c0271b;
  border-color: #c0271b;
}

.cs-btn-outline {
  border-color: #e5e6eb;
  background: #fff;
  color: #4e5969;
}

.cs-btn-outline:hover {
  border-color: #c9cdd4;
}

.cs-btn-block {
  width: 100%;
}

.cs-btn-push svg {
  flex-shrink: 0;
}

.cs-ai-assistant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f2796b 0%, #e63323 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.cs-ai-assistant:hover {
  opacity: 0.92;
}

.cs-ai-assistant-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  font-weight: 700;
}

.cs-ai-panel {
  position: absolute;
  right: 20px;
  top: 108px;
  z-index: 20;
  width: min(360px, calc(100vw - 40px));
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e5e6eb;
  background: #fff;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.15);
}

.cs-ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 15px;
}

.cs-ai-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #f2f3f5;
  color: #86909c;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cs-ai-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-ai-panel-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f2f3f5;
  font-size: 14px;
}

.cs-ai-panel-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: #86909c;
  line-height: 1.5;
}

.cs-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.cs-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cs-switch i {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: #c9cdd4;
  transition: background 0.2s;
}

.cs-switch i::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.cs-switch input:checked + i {
  background: #e63323;
}

.cs-switch input:checked + i::after {
  transform: translateX(18px);
}

.cs-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 140px);
}

.cs-nav-card,
.cs-work-card,
.cs-notebook-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e6eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cs-nav-card {
  padding: 12px;
  height: 100%;
  overflow: auto;
}

.cs-curriculum-select-wrap {
  display: block;
  margin-bottom: 12px;
}

.cs-curriculum-select {
  width: 100%;
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 13px;
  color: #1d2129;
  appearance: none;
  cursor: pointer;
}

.cs-chapter-tree {
  font-size: 13px;
}

.cs-unit-block {
  margin-bottom: 4px;
}

.cs-unit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1d2129;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.cs-unit-toggle:hover {
  background: #f7f8fa;
}

.cs-unit-toggle .cs-chevron {
  color: #86909c;
  font-size: 12px;
  transition: transform 0.15s;
}

.cs-unit-block.is-collapsed .cs-chevron {
  transform: rotate(-90deg);
}

.cs-unit-block.is-collapsed .cs-lesson-list {
  display: none;
}

.cs-lesson-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px 8px;
}

.cs-lesson-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #4e5969;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.cs-lesson-btn:hover {
  background: #f7f8fa;
}

.cs-lesson-btn.is-active {
  background: #fef3f2;
  color: #e63323;
  font-weight: 500;
}

.cs-lesson-tag {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3f2;
  color: #c0271b;
  font-size: 11px;
  line-height: 1.4;
}

.cs-unit-collapsed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #4e5969;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.cs-unit-collapsed-item:hover {
  background: #f7f8fa;
}

.cs-work-col {
  min-width: 0;
}

.cs-work-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100vh - 140px);
  overflow: hidden;
}

.cs-lesson-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f2f3f5;
}

.cs-lesson-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cs-lesson-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-unit-tag {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 4px;
  background: #fef3f2;
  color: #e63323;
  font-size: 12px;
}

.cs-lesson-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-btn-class {
  height: 32px;
  padding: 0 16px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #f7f8fa;
  color: #c9cdd4;
  font-size: 14px;
  cursor: not-allowed;
}

.cs-btn-doc {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f5c6c0;
  border-radius: 6px;
  background: #fef3f2;
  color: #c0271b;
  cursor: pointer;
}

.cs-main-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid #f2f3f5;
}

.cs-main-tab {
  position: relative;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #4e5969;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.cs-main-tab:hover {
  color: #e63323;
}

.cs-main-tab.active {
  color: #e63323;
  font-weight: 600;
}

.cs-main-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #e63323;
}

.cs-tab-panel {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.cs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cs-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cs-filter-select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  color: #4e5969;
  appearance: none;
}

.cs-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}

.cs-search {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  font-size: 13px;
}

.cs-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #86909c;
  pointer-events: none;
}

.cs-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e63323;
  border-radius: 6px;
  background: #fff;
  color: #e63323;
  font-size: 13px;
  cursor: pointer;
}

.cs-link-action {
  border: none;
  background: none;
  color: #e63323;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.cs-link-action:hover {
  text-decoration: underline;
}

.cs-link-danger {
  color: #f53f3f;
  margin-left: 12px;
}

.cs-resource-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-resource-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f2f3f5;
}

.cs-resource-row:last-child {
  border-bottom: none;
}

.cs-file-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.cs-file-icon-ppt {
  background: linear-gradient(135deg, #ff9a3c, #ff6b35);
}

.cs-file-icon-word {
  background: linear-gradient(135deg, #f2796b, #c0271b);
}

.cs-file-icon-excel {
  background: linear-gradient(135deg, #f2796b, #c0271b);
}

.cs-file-icon-video {
  background: linear-gradient(135deg, #f2796b, #e63323);
}

.cs-file-icon-folder {
  background: linear-gradient(135deg, #ffc53d, #faad14);
  font-size: 14px;
}

.cs-resource-main {
  flex: 1;
  min-width: 0;
}

.cs-resource-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.4;
}

.cs-resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cs-meta-tag {
  padding: 1px 8px;
  border-radius: 4px;
  background: #f2f3f5;
  color: #86909c;
  font-size: 12px;
}

.cs-meta-tag-official {
  background: #fef3f2;
  color: #fa8c16;
}

.cs-meta-tag-school {
  background: #fde8e6;
  color: #c0271b;
}

.cs-resource-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.cs-plan-section {
  margin-bottom: 20px;
}

.cs-plan-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1d2129;
}

.cs-plan-section-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #e63323;
}

.cs-sub-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f2f3f5;
  padding-bottom: 0;
}

.cs-sub-tab {
  padding: 8px 0;
  border: none;
  background: none;
  color: #4e5969;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}

.cs-sub-tab.active {
  color: #e63323;
  font-weight: 600;
}

.cs-sub-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #e63323;
}

.cs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: #86909c;
  font-size: 14px;
}

.cs-empty-illus {
  width: 120px;
  height: 100px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.cs-empty-btn {
  margin-top: 16px;
  height: 36px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: #e63323;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.cs-list-footer {
  padding: 16px 0 8px;
  text-align: center;
  color: #c9cdd4;
  font-size: 13px;
}

.cs-notebook-col {
  min-width: 0;
}

.cs-notebook-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100vh - 140px);
  padding: 14px;
}

.cs-notebook-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.cs-notebook-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1d2129;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cs-notebook-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #e63323;
}

.cs-notebook-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #c9cdd4;
}

.cs-link-muted {
  border: none;
  background: none;
  color: #86909c;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.cs-link-muted:hover {
  color: #e63323;
}

.cs-class-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #4e5969;
}

.cs-class-select {
  flex: 1;
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 13px;
  appearance: none;
}

.cs-notebook-body {
  flex: 1;
  overflow: auto;
  min-height: 120px;
}

.cs-notebook-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f2f3f5;
}

.cs-notebook-item-title {
  flex: 1;
  font-size: 13px;
  color: #1d2129;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-tag-pushed {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fef3f2;
  color: #c0271b;
  font-size: 12px;
}

.cs-notebook-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 1280px) {
  .cs-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .cs-notebook-col {
    grid-column: 1 / -1;
  }

  .cs-notebook-card {
    min-height: 320px;
  }
}

@media (max-width: 900px) {
  .cs-body {
    grid-template-columns: 1fr;
  }
}
