/* =====================================
   基础
===================================== */

:root {
  --bg: #0b1020;
  --card: rgba(18,25,54,.94);
  --text: #eef2ff;
  --muted: #a7b0d8;
  --line: rgba(255,255,255,.08);
  --accent: #8b5cf6;
  --accent-dark: #6d28d9;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(139,92,246,.18), transparent 45%),
    radial-gradient(1000px 500px at 100% 15%, rgba(34,197,94,.08), transparent 35%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select { font: inherit; }

.app {
  max-width: 1180px;
  margin: auto;
  padding: 14px;
  min-height: 100vh;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.hero {
  padding: 20px;
  background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(34,197,94,.08));
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139,92,246,.14);
  border: 1px solid rgba(139,92,246,.26);
  color: #ddd8ff;
  font-size: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat {
  padding: 14px;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 25px;
}

.layout {
  display: grid;
  gap: 14px;
}

.sidebar, .content {
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h2 {
  margin: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.search {
  width: 100%;
  margin: 12px 0;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

.progress-wrap {
  height: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

.progress {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width .3s;
}

.course-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.lesson-btn {
  width: 100%;
  padding: 13px;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: .2s;
}

.lesson-btn:hover { transform: translateY(-1px); }

.lesson-btn.active {
  background: linear-gradient(135deg, rgba(139,92,246,.9), rgba(109,40,217,.9));
  border-color: transparent;
}

.lesson-btn .title {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.lesson-btn .desc {
  color: var(--muted);
  font-size: 13px;
}

.lesson-btn.active .desc {
  color: rgba(255,255,255,.8);
}

.module-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.module-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.module-tab.active {
  background: rgba(139,92,246,.2);
  border-color: rgba(139,92,246,.4);
}

.module { display: none; }
.module.active { display: block; }

.lesson-header {
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.03);
}

.lesson-header h2 {
  margin: 5px 0 10px;
  font-size: 25px;
}

.lesson-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.tags,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag,
.chip {
  padding: 7px 10px;
  color: var(--text);
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}

.tag { background: rgba(139,92,246,.14); }

.grid-2 {
  display: grid;
  gap: 12px;
}

.panel {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.03);
}

.panel h3 { margin: 0 0 10px; }

.panel p,
.panel li {
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.panel ul {
  margin: 0;
  padding-left: 20px;
}

.note {
  padding: 12px;
  color: #d9ffe6;
  line-height: 1.7;
  border-radius: 16px;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.22);
}

button,
select {
  min-height: 46px;
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 14px;
}

button { cursor: pointer; font-weight: 700; }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
}

.secondary {
  background: rgba(255,255,255,.04);
}

.button-grid,
.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.piano {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.piano-key {
  min-height: 120px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.piano-key.active {
  background: rgba(139,92,246,.2);
  border-color: rgba(139,92,246,.45);
}

.piano-key .name {
  font-size: 20px;
  font-weight: 800;
}

.piano-key .desc {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.quiz {
  margin-top: 14px;
  padding: 15px;
}

.question {
  line-height: 1.7;
  font-size: 16px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  width: 100%;
  padding: 13px;
  color: var(--text);
  text-align: left;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.option.correct {
  background: rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.35);
}

.option.wrong {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.35);
}

.feedback {
  color: var(--muted);
  line-height: 1.7;
}

.review-box,
.task-list {
  display: grid;
  gap: 9px;
}

.review-card,
.task {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}

.review-card strong,
.task strong {
  display: block;
  margin-bottom: 5px;
}

.review-card span,
.task span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer {
  margin-top: 14px;
  padding-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (min-width: 900px) {
  .topbar { grid-template-columns: 1.5fr .9fr; }
  .layout { grid-template-columns: 340px 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 36px; }
}

@media (max-width: 600px) {
  .app { padding: 9px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 25px; }
  .content, .sidebar { padding: 11px; }
  .stats { gap: 8px; }
  .stat { min-height: 80px; }
  .stat strong { font-size: 21px; }
  .piano { gap: 4px; }
  .piano-key { min-height: 105px; }
  .piano-key .name { font-size: 17px; }
  .button-grid, .toolbar { grid-template-columns: 1fr; }
}
