/* ===== 小乐智慧课堂 样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(10, 15, 40, 0.9);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-brand { font-size: 20px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: 1px; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: #a5b4fc; font-weight: 600; }
.nav-btn {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.nav-btn:hover { background: rgba(99, 102, 241, 0.4); color: #fff; }

.hero {
  text-align: center;
  padding: 40px 20px 26px;
}
.hero h1 {
  font-size: 34px;
  background: linear-gradient(90deg, #fbbf24, #f472b6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { margin-top: 10px; color: #c7d2fe; font-size: 15px; max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-tags { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-tags span {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #e0e7ff;
}

.main { flex: 1; width: min(1080px, 96vw); margin: 0 auto; padding: 10px 0 30px; }

/* 我的学习 */
.mine {
  background: rgba(17, 24, 54, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.mine-pts { font-size: 15px; color: #c7d2fe; }
.mine-pts b { color: #fbbf24; font-size: 20px; }
.mine-done { color: #94a3b8; font-size: 13px; margin-top: 4px; }
.mine-list { list-style: none; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.mine-list li {
  background: rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: #c7d2fe;
}

/* 筛选 */
.filter {
  background: rgba(17, 24, 54, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 10px; }
.filter-label { color: #94a3b8; font-size: 14px; width: 42px; flex-shrink: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(30, 41, 82, 0.7);
  color: #c7d2fe;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.tab:hover { border-color: #818cf8; }
.tab.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-color: transparent; }

/* 课程卡片 */
.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.course-card {
  background: rgba(17, 24, 54, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform .15s;
}
.course-card:hover { transform: translateY(-3px); }
.course-card.done { border-color: rgba(74, 222, 128, 0.4); }
.course-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.course-tag { font-size: 12px; color: #a5b4fc; }
.course-pts { font-size: 12px; color: #fbbf24; font-weight: 700; }
.course-title { font-size: 16px; color: #fff; margin-bottom: 6px; }
.course-intro { font-size: 13px; color: #94a3b8; flex: 1; margin-bottom: 12px; }
.course-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #64748b; }
.course-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.course-btn:hover { filter: brightness(1.15); }
.course-done { color: #4ade80; font-weight: 600; }
.empty { grid-column: 1 / -1; text-align: center; color: #64748b; padding: 30px; }

/* 排行榜 */
.rank-sec {
  background: rgba(17, 24, 54, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 18px 20px;
}
.rank-sec h2 { font-size: 17px; margin-bottom: 12px; }
.rank-list { list-style: none; }
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.2);
  font-size: 14px;
}
.rank-list li:last-child { border-bottom: none; }
.rank-medal { width: 34px; }
.rank-points { margin-left: auto; color: #fbbf24; font-weight: 700; }

/* 课程详情页 */
.back-link { display: inline-block; margin: 14px 0; color: #a5b4fc; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #fff; }
.lesson {
  background: rgba(17, 24, 54, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 26px;
}
.lesson-title { font-size: 24px; color: #fff; }
.lesson-intro { color: #c7d2fe; margin-top: 8px; font-size: 15px; }
.lesson-meta { color: #fbbf24; font-size: 13px; margin-top: 8px; }
.sec-title { font-size: 17px; margin: 24px 0 12px; color: #e0e7ff; }
.knowledge { list-style: none; }
.knowledge li {
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid #818cf8;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}
.quiz-item { margin-bottom: 18px; }
.quiz-q { font-size: 15px; margin-bottom: 8px; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-opt {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(30, 41, 82, 0.7);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.quiz-opt:hover { border-color: #818cf8; }
.quiz-opt.right { background: #22c55e; border-color: transparent; color: #fff; }
.quiz-opt.wrong { background: #ef4444; border-color: transparent; color: #fff; }
.lesson-actions { margin-top: 20px; text-align: center; }
.btn.big-btn {
  padding: 14px 40px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.big-btn:hover { filter: brightness(1.12); }
.btn.big-btn:disabled { opacity: .6; cursor: not-allowed; }
.lesson-msg { margin-top: 12px; font-size: 14px; min-height: 20px; }

.foot { text-align: center; padding: 14px; color: #64748b; font-size: 12px; }

/* ===== 登录注册弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal {
  width: min(400px, 92vw);
  background: linear-gradient(160deg, #1b2552, #101a3a);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 18px;
  padding: 26px 26px 20px;
  position: relative;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
}
.modal-title { font-size: 22px; font-weight: 700; color: #fff; }
.modal-sub { font-size: 13px; color: #a5b4fc; margin: 6px 0 16px; }
.modal input {
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(30, 41, 82, 0.85);
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
}
.modal input:focus { border-color: #818cf8; }
.code-row { display: flex; gap: 8px; margin-bottom: 10px; }
.code-row input { flex: 1; margin-bottom: 0; }
.code-row .send-btn {
  width: auto;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  white-space: nowrap;
  background: rgba(99, 102, 241, 0.5);
}
.modal-err { min-height: 20px; font-size: 13px; color: #f87171; margin-bottom: 6px; }
.modal .btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.modal .btn:hover { filter: brightness(1.12); }
.modal-switch { text-align: center; font-size: 13px; color: #94a3b8; margin-top: 12px; }
.modal-switch a { color: #fbbf24; text-decoration: none; }

@media (max-width: 640px) {
  .hero h1 { font-size: 26px; }
  .courses { grid-template-columns: 1fr 1fr; }
  .filter-row { align-items: flex-start; }
  .filter-label { display: none; }
}
