/* AI学习教程页面专用样式 */

/* ===== Hero 区域 ===== */
.hero--compact {
  padding: 36px 0 32px;
}

.hero-search {
  position: relative;
  max-width: 560px;
  margin-top: 20px;
}

.hero-search::before {
  content: "🔍";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

.hero-search input {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px 14px 44px;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 10px 40px rgba(7, 56, 62, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search input::placeholder {
  color: #8ba3b3;
}

.hero-search input:focus {
  box-shadow: 
    0 0 0 4px rgba(46, 196, 182, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.1),
    0 16px 48px rgba(7, 56, 62, 0.2);
  transform: translateY(-2px);
}

/* ===== 侧边栏 ===== */
.study-sidebar {
  padding: 16px 12px;
}

.sidebar-header {
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.study-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(15, 157, 144, 0.08);
  color: var(--brand-strong);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(15, 157, 144, 0.12) 0%, rgba(46, 196, 182, 0.08) 100%);
  color: var(--brand-strong);
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

/* ===== 课程区块 ===== */
.course-section {
  scroll-margin-top: 100px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 28px;
}

.section-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.section-desc {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background: linear-gradient(135deg, rgba(15, 157, 144, 0.12) 0%, rgba(46, 196, 182, 0.08) 100%);
  color: var(--brand-strong);
  border: 1px solid rgba(15, 157, 144, 0.2);
}

.badge-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* ===== 章节列表 ===== */
.chapter-list {
  display: grid;
  gap: 12px;
}

.chapter-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: #fafbfc;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.chapter-card:hover {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(15, 157, 144, 0.12);
  transform: translateY(-2px);
}

.chapter-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, #2ec4b6 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 157, 144, 0.3);
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-info h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.2s;
}

.chapter-card:hover .chapter-info h3 {
  color: var(--brand-strong);
}

.chapter-info p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(15, 157, 144, 0.1);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}

.meta-time {
  font-size: 12px;
  color: #8b9aad;
}

/* 更多按钮 */
.chapter-card--more {
  background: transparent;
  border: 2px dashed #d1d5db;
  justify-content: center;
  padding: 14px;
}

.chapter-card--more:hover {
  background: rgba(15, 157, 144, 0.03);
  border-color: var(--brand);
  border-style: dashed;
}

.chapter-more {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.chapter-card--more:hover .chapter-more {
  color: var(--brand-strong);
}

.chapter-more .arrow {
  transition: transform 0.2s;
}

.chapter-card--more:hover .arrow {
  transform: translateX(4px);
}

/* 筹备中状态 */
.chapter-card--coming {
  cursor: default;
  opacity: 0.7;
}

.chapter-card--coming:hover {
  background: #fafbfc;
  border-color: #e8ecf1;
  box-shadow: none;
  transform: none;
}

.chapter-card--coming .chapter-number {
  background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
  box-shadow: none;
}

.chapter-card--coming .chapter-info h3 {
  color: var(--ink);
}

.chapter-card--coming .chapter-info h3::after {
  content: " (筹备中)";
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

/* 预览模式 */
.chapter-list--preview {
  opacity: 0.75;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--ink-soft);
  font-size: 15px;
}

/* ===== 响应式适配 ===== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .study-sidebar {
    position: static;
    max-height: none;
    order: -1;
  }
  
  .study-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .nav-item {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }
  
  .nav-text {
    flex: none;
  }
}

@media (max-width: 600px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .chapter-card {
    padding: 14px;
  }
  
  .chapter-number {
    width: 36px;
    height: 36px;
    font-size: 12px;
    border-radius: 10px;
  }
  
  .chapter-info h3 {
    font-size: 15px;
  }
  
  .study-nav {
    flex-direction: column;
  }
  
  .nav-item {
    min-width: auto;
    justify-content: flex-start;
  }
}
