/* ===== 课程页（课程目录 / 课程学习页）样式 ===== */

body.courses-body { background: var(--bg); }

.page-wrap { max-width: 1288px; margin: 0 auto; padding: 32px 0 0; }

.courses-layout { display: flex; align-items: flex-start; gap: 16px; }
.filter-col { width: 310px; flex: 0 0 310px; }
.courses-content { flex: 1; min-width: 0; }

.paper {
  background: #fff; border-radius: 4px;
  box-shadow: 0 0 2px rgba(0, 0, 0, .1);
}

/* ---------- 左侧筛选 ---------- */
.filter-card { padding: 20px 24px 24px; }
.filter-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.filter-group { margin-top: 20px; }
.filter-group-label { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.filter-group-label .ic { width: 13px; height: 13px; color: var(--text-3); }

.radio-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.radio-row .dot {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #ced4da; background: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 18px;
}
.radio-row.checked .dot { border-color: var(--violet); }
.radio-row.checked .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.radio-row.checked { color: var(--text); }
.radio-row:hover .dot { border-color: #adb5bd; }

.check-row2 { display: flex; align-items: center; gap: 9px; padding: 6px 0 0; font-size: 14px; color: var(--text); cursor: pointer; }
.check-box2 { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #ced4da; background: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 18px; }
.check-row2.checked .check-box2 { background: var(--violet); border-color: var(--violet); color: #fff; }
.check-row2 .check-box2 .ic { width: 12px; height: 12px; }

.sort-select {
  width: 100%; height: 36px; margin-top: 8px; padding: 0 30px 0 10px; font-size: 14px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23868e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}

.route-card { padding: 20px 24px; margin-top: 16px; }
.route-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.route-desc { margin: 8px 0 12px; font-size: 13px; line-height: 1.6; color: var(--text-3); }
.route-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.route-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 36px;
  border: 1px solid var(--violet); border-radius: 4px; background: #fff; color: var(--violet);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.route-btn:hover { background: var(--violet-0); }

/* ---------- 搜索卡 ---------- */
.search-card { padding: 16px 24px 20px; }
.search-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.search-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.search-link { font-size: 11px; color: var(--text-3); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.search-sub { margin: 2px 0 0; font-size: 12px; line-height: 18px; color: var(--text-3); }
.search-input-wrap {
  display: flex; align-items: center; height: 40px; margin-top: 10px; padding: 0 4px 0 12px;
  border: 1px solid var(--border-strong); border-radius: 4px; background: #fff;
}
.search-input-wrap:focus-within { border-color: var(--violet); }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); }
.search-input::placeholder { color: var(--text-4); }
.search-send { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--violet); cursor: pointer; border-radius: 4px; }
.search-send:hover { background: var(--violet-0); }
.search-send .ic { width: 16px; height: 16px; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topic-chip { height: 24px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--bg); color: var(--text-2); font-size: 12px; cursor: pointer; }
.topic-chip:hover { background: var(--border); color: var(--text); }

/* ---------- 课程卡片 ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.course-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 4px; box-shadow: 0 0 2px rgba(0, 0, 0, .1); }
.cc-imgwrap { padding: 12px 12px 0; }
.cc-frame { border: 1px solid var(--border-strong); border-radius: 4px; background: #f8f9fa; aspect-ratio: 16 / 9; overflow: hidden; }
.cc-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 6px 12px 12px; }
.cc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-badge { height: 16px; padding: 0 6px; border-radius: 3px; font-size: 10px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.cc-badge.violet { background: #e5dbff; color: #5f3dc4; }
.cc-badge.green  { background: #d3f9d8; color: #2b8a3e; }
.cc-badge.yellow { background: #fff3bf; color: #e67700; }
.cc-badge.orange { background: #ffe8cc; color: #d9480f; }
.cc-badge.gray   { background: #f1f3f5; color: #495057; }
.cc-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-title a { color: inherit; text-decoration: none; }
.cc-desc { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.cc-foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.cc-divider { height: 1px; background: var(--border); }
.cc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-3); }
.cc-meta .dur { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.cc-meta .dur .ic { width: 13px; height: 13px; }
.cc-meta .preq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.cc-btn {
  display: block; width: 100%; height: 34px; border: 1px solid var(--violet); border-radius: 4px;
  background: #fff; color: var(--violet); font-size: 14px; font-weight: 500; text-align: center; line-height: 32px; text-decoration: none;
}
.cc-btn:hover { background: var(--violet-0); }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px 0 128px; }
.pg {
  min-width: 36px; height: 36px; padding: 0 8px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
}
.pg:hover { border-color: #ced4da; }
.pg.active { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 500; }
.pg .ic { width: 16px; height: 16px; color: var(--text-3); }

.courses-footer { background: #fff; padding: 0; }
.footer-inner { max-width: 1108px; margin: 0 auto; padding: 32px 0 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-3); }
.courses-footer .footer-links a { color: var(--text-3); text-decoration: none; margin-left: 20px; }
.courses-footer .footer-links a:hover { color: var(--violet); }

.empty-state { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--text-3); font-size: 14px; background: #fff; border-radius: 4px; box-shadow: 0 0 2px rgba(0, 0, 0, .1); }

/* ================= 课程学习页 ================= */
.learn-layout { display: flex; min-height: calc(100vh - 48px); align-items: stretch; }

.curriculum { width: 358px; flex: 0 0 358px; background: #fff; padding: 20px 24px 32px; overflow-y: auto; max-height: calc(100vh - 48px); position: sticky; top: 48px; }
.cur-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 14px; }
.cur-top a { font-size: 14px; color: var(--violet); text-decoration: none; }
.cur-top a:hover { text-decoration: underline; }
.cur-collapse { border: 0; background: transparent; color: var(--text-2); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; }
.cur-collapse:hover { background: var(--bg); }
.cur-collapse .ic { width: 18px; height: 18px; }

.cur-course { display: flex; align-items: center; gap: 9px; padding: 6px 0 14px; font-size: 14px; font-weight: 600; color: var(--violet); }
.cur-course .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--violet); display: flex; align-items: center; justify-content: center; flex: 0 0 16px; }
.cur-course .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }

.cur-chapter { margin-top: 14px; }
.cur-chapter-title { font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 0 6px; }
.cur-lesson { display: block; padding: 6px 0 6px 16px; font-size: 13px; color: var(--text-2); text-decoration: none; line-height: 1.45; }
.cur-lesson:hover { color: var(--violet); }
.cur-quiz { padding: 7px 0 7px 16px; font-size: 13px; color: var(--text-2); }

.learn-main { flex: 1; min-width: 0; padding: 32px 55px 0 62px; }
.learn-card { background: #fff; border-radius: 8px; padding: 40px 48px 32px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); min-height: 845px; }
.learn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.learn-title { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.25; color: var(--text); }
.learn-add {
  display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; flex: 0 0 auto;
  border: 0; border-radius: 4px; background: #f1f3f5; color: var(--text-4); font-size: 13px; cursor: default;
}
.learn-add .ic { width: 15px; height: 15px; }
.learn-desc { margin: 16px 0 0; font-size: 15px; line-height: 1.65; color: var(--text); }
.learn-meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--text); }
.learn-meta .lbl { font-weight: 600; }
.learn-meta + .learn-meta { margin-top: 10px; }
.learn-badge { height: 20px; padding: 0 7px; border-radius: 3px; font-size: 11px; font-weight: 600; line-height: 20px; }
.learn-badge.green { background: #d3f9d8; color: #2b8a3e; }
.learn-badge.yellow { background: #fff3bf; color: #e67700; display: inline-flex; align-items: center; gap: 3px; }
.learn-badge.yellow .ic { width: 12px; height: 12px; }

.learn-tabs { display: flex; align-items: center; gap: 6px; margin-top: 26px; border-bottom: 1px solid var(--border); }
.learn-tab {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px 12px; border: 0; background: transparent;
  color: var(--text-3); font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.learn-tab .ic { width: 14px; height: 14px; }
.learn-tab.active { color: var(--text); border-bottom-color: var(--violet); font-weight: 500; }
.learn-tab:hover { color: var(--text); }

.learn-panel { display: none; padding-top: 24px; }
.learn-panel.active { display: block; }

.outcome { display: flex; gap: 12px; padding: 10px 0; }
.outcome .ic { width: 20px; height: 20px; color: var(--violet); flex: 0 0 20px; margin-top: 1px; }
.outcome b { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.outcome p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }

.panel-line { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; color: var(--text); }
.panel-line .ic { width: 18px; height: 18px; color: var(--violet); flex: 0 0 18px; }
.panel-muted { font-size: 13px; color: var(--text-3); }

.next-course { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.next-course:last-child { border-bottom: 0; }
.next-course img { width: 96px; height: 54px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border-strong); }
.next-course b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.next-course span { font-size: 12px; color: var(--text-3); }
.next-course a { margin-left: auto; font-size: 13px; color: var(--violet); text-decoration: none; flex: 0 0 auto; }

.review-box { border: 1px solid var(--border-strong); border-radius: 4px; padding: 12px; }
.review-box textarea { width: 100%; min-height: 76px; border: 0; outline: 0; resize: vertical; font-size: 14px; font-family: inherit; color: var(--text); }
.review-actions { display: flex; justify-content: flex-end; }
.review-submit { height: 32px; padding: 0 16px; border: 0; border-radius: 4px; background: var(--violet); color: #fff; font-size: 13px; cursor: pointer; }

.learn-foot { max-width: 1288px; margin: 0 auto; padding: 16px 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-3); }
.learn-foot .social { display: flex; align-items: center; gap: 10px; }
.learn-foot .social .ic { width: 15px; height: 15px; }
.learn-foot .social .ic.heart { color: #fa5252; }

@media (max-width: 1180px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-main { padding: 24px 24px 0; }
}
@media (max-width: 900px) {
  .page-wrap { padding: 16px 16px 0; }
  .courses-layout { flex-direction: column; }
  .filter-col { width: 100%; flex: 1 1 auto; }
  .cards-grid { grid-template-columns: 1fr; }
  .curriculum { display: none; }
  .learn-layout { display: block; }
  .learn-main { padding: 16px 16px 0; }
  .learn-card { padding: 24px 20px; min-height: 0; }
  .learn-title { font-size: 24px; }
  .courses-footer { padding: 16px; flex-wrap: wrap; }
}
