/* ============ 音阶 Play · 设计令牌 ============ */
:root {
  --bg: #141416;
  --surface: #1A1A1D;
  --surface-2: #26262B;
  --surface-3: #3A3940;
  --amber: #F5B942;
  --amber-deep: #D19A2A;
  --amber-glow: rgba(245, 185, 66, 0.35);
  --blue: #6C8CFF;
  --violet: #C084FC;
  --green: #3DDC97;
  --red: #FF5C5C;
  --cyan: #4CC9F0;
  --orange: #F59E42;

  --text: #FFFFFF;
  --text-2: #A3A3AD;
  --text-3: #6E6E78;
  --text-4: #8A8698;

  --key-white: #F2F0EA;
  --key-white-label: #141416;
  --key-white-note: #9A958A;
  --key-black: #1C1B20;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --font-cn: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Inter", "SF Pro Display", sans-serif;

  --nav-h: 72px;
  --sidebar-w: 264px;
  --right-w: 320px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-cn);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ============ 顶部导航 ============ */
.nav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 32px;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-text {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.nav-menu { display: flex; gap: 8px; }
.nav-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  font-family: var(--font-cn);
}
.nav-tab:hover { background: var(--surface-3); color: var(--text); }
.nav-tab.active {
  background: var(--amber);
  color: #141416;
  font-weight: 600;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  width: 200px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-cn);
  width: 100%;
}
.search-box input::placeholder { color: var(--text-3); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--blue);
  cursor: pointer;
}

/* ============ 页面容器 ============ */
.screen {
  display: none;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}
.screen.active { display: flex; }

/* ============ S1 练习台 ============ */
.practice-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.4px;
}
.mode-list { display: flex; flex-direction: column; gap: 8px; }
.mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}
.mode-card:hover { border-color: var(--line-strong); }
.mode-card.active {
  background: var(--amber);
  box-shadow: 0 4px 16px var(--amber-glow);
}
.mode-card .icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.mode-card .info { flex: 1; min-width: 0; }
.mode-card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.mode-card.active .name { color: #141416; }
.mode-card .desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.mode-card.active .desc { color: rgba(20,20,22,0.75); }
.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  flex-shrink: 0;
}
.mode-card.active .mode-dot { background: #141416; }

.shortcut-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kbd {
  min-width: 44px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
}
.shortcut-row .label {
  font-size: 12px;
  color: var(--text-2);
}

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

.octave-control {
  display: flex;
  gap: 8px;
  align-items: center;
}
.octave-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.octave-btn:hover { background: var(--surface-3); }
.octave-btn:active { transform: scale(0.93); }
.octave-btn svg { pointer-events: none; }
.octave-value {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
}

/* 中央练习区 */
.center-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px;
  gap: 20px;
  overflow: hidden;
  min-width: 500px;
}
.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.lesson-header > div:first-child {
  flex: 1;
  min-width: 0;
}
.lesson-header .title {
  font-size: 28px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-header .subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-block { width: 220px; flex-shrink: 0; }
.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-label .t {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.progress-label .v {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
}
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--amber);
  transition: width 0.4s ease;
}

.piano-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.hint-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(245,185,66,0.1);
  border: 1px solid rgba(245,185,66,0.25);
}
.hint-bar .t {
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  flex: 1;
}

.stage {
  flex: 1;
  border-radius: 16px;
  background: linear-gradient(180deg, #1E1C23 0%, #141218 100%);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

/* 落音轨道 */
.lane {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 12px;
  height: 160px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.lane-title {
  position: absolute;
  left: 14px;
  top: 10px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  z-index: 2;
}
.hit-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 2px;
  background: rgba(245,185,66,0.5);
}
.hit-line::before, .hit-line::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--amber);
}
.hit-line::before { left: -4px; }
.hit-line::after { right: -4px; }

.note-block {
  position: absolute;
  width: 56px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  transition: opacity 0.15s;
}
.note-block.falling {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}
.note-block.next {
  background: var(--amber);
  color: #141416;
  box-shadow: 0 4px 14px var(--amber-glow);
}
.note-block.upcoming {
  background: rgba(108,140,255,0.35);
  border: 1px solid rgba(108,140,255,0.5);
  color: #fff;
}
.note-block.hit {
  animation: noteHit 0.35s ease forwards;
}
.note-block.missed {
  animation: noteMiss 0.35s ease forwards;
}
@keyframes noteHit {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes noteMiss {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.7) translateY(20px); opacity: 0; }
}

.feedback-pop {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-en);
  font-size: 32px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 1px;
}
.feedback-pop.show {
  animation: popUp 0.6s ease forwards;
}
@keyframes popUp {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.8); }
  30% { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1.05); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-36px) scale(1); }
}

/* 钢琴键盘 */
.piano-wrap {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 72px;
  height: 170px;
  display: flex;
}
.key-white {
  flex: 1;
  height: 100%;
  border-radius: 2px 2px 8px 8px;
  background: var(--key-white);
  border: 1px solid rgba(0,0,0,0.18);
  border-top: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  gap: 4px;
  cursor: pointer;
  transition: background 0.06s, transform 0.06s;
  box-shadow: 0 6px 12px rgba(0,0,0,0.35);
  position: relative;
}
.key-white:hover { background: #E8E4DC; }
.key-white.pressed {
  background: var(--amber);
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.key-white.target {
  background: var(--amber);
  box-shadow: 0 8px 22px var(--amber-glow), inset 0 2px 4px rgba(255,255,255,0.35);
}
.key-white .k {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 800;
  color: var(--key-white-label);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.key-white .k .num {
  font-size: 9px;
  font-weight: 700;
  color: var(--amber-deep);
  background: rgba(245,185,66,0.18);
  border-radius: 4px;
  padding: 1px 4px;
}
.key-white .n {
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 500;
  color: var(--key-white-note);
  pointer-events: none;
}
.key-white.target .n, .key-white.pressed .n { color: rgba(20,20,22,0.7); }

.key-black {
  position: absolute;
  width: 38px;
  height: 105px;
  border-radius: 0 0 5px 5px;
  background: var(--key-black);
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  cursor: pointer;
  transition: background 0.06s, transform 0.06s;
  box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}
.key-black:hover { background: #2A2930; }
.key-black.pressed {
  background: var(--amber-deep);
  transform: translateY(2px);
}
.key-black.target {
  background: var(--amber);
  box-shadow: 0 8px 22px var(--amber-glow);
}
.key-black .k {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-4);
  pointer-events: none;
}
.key-black.target .k, .key-black.pressed .k { color: #141416; }

/* 指法提示条 */
.finger-bar {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 6px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
}
.finger-bar .t {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  flex-shrink: 0;
}
.finger-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}
.finger-item.active {
  background: rgba(245,185,66,0.15);
}
.finger-num {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.finger-item.active .finger-num {
  background: var(--amber);
  color: #141416;
}
.finger-item .name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.finger-item.active .name { color: var(--amber); }

/* 底部控制条 */
.control-bar {
  height: 64px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  flex-shrink: 0;
}
.ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.ctrl-btn:hover { background: var(--surface-3); }
.ctrl-btn:active { transform: scale(0.93); }
.ctrl-btn.primary {
  background: var(--amber);
}
.ctrl-btn.primary:hover { background: var(--amber-deep); }
.ctrl-btn.on {
  background: rgba(245,185,66,0.2);
  border: 1px solid var(--amber);
}
.ctrl-tag {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid transparent;
}
.ctrl-tag:hover { border-color: var(--line-strong); }
.ctrl-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--red);
}
.spacer { flex: 1; }
.vol-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vol-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background: var(--text-2);
  cursor: pointer;
}

/* 右侧课程面板 */
.right-panel {
  width: var(--right-w);
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}
.panel-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.tag.amber {
  background: rgba(245,185,66,0.15);
  color: var(--amber);
}
.panel-card .title {
  font-size: 17px;
  font-weight: 700;
}
.panel-card .desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 20px;
}
.meta-row { display: flex; gap: 16px; }
.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}
.btn-primary {
  height: 42px;
  border-radius: 12px;
  background: var(--amber);
  border: none;
  color: #141416;
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary:hover { background: var(--amber-deep); }
.btn-primary:active { transform: scale(0.97); }

.chart-svg { width: 100%; height: 100px; }
.legend-row {
  display: flex;
  justify-content: space-between;
}
.legend-row .item {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
}
.stat-row { display: flex; gap: 10px; }
.stat-box {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
}
.stat-box .v {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
}
.stat-box .v.plain { color: var(--text); }
.stat-box .l {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 3px;
}

/* ============ S2 课程 ============ */
.page-body {
  flex: 1;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}
.page-title {
  font-size: 32px;
  font-weight: 700;
}
.page-sub {
  font-size: 15px;
  color: var(--text-2);
  margin-top: 8px;
}

.curve-hero {
  height: 240px;
  border-radius: var(--r-xl);
  background: linear-gradient(90deg, #291F14 0%, #1A171F 100%);
  border: 1px solid rgba(245,185,66,0.2);
  position: relative;
  overflow: hidden;
}
.curve-hero .chart {
  position: absolute;
  left: 36px;
  top: 30px;
  right: 180px;
  height: 150px;
}
.curve-hero .axis-y {
  position: absolute;
  left: 36px;
  top: 8px;
  font-size: 11px;
  color: var(--text-3);
}
.curve-hero .axis-x {
  position: absolute;
  bottom: 12px;
  font-size: 11px;
  color: var(--text-2);
}
.curve-hero .axis-x.accent { color: var(--amber); }
.curve-stat {
  position: absolute;
  right: 36px;
  top: 24px;
  width: 140px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 14px;
}
.curve-stat .v {
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 700;
  color: var(--amber);
}
.curve-stat .l {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}
.stage-row {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.stage-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  overflow-y: auto;
}
.stage-col.current {
  background: rgba(245,185,66,0.08);
  border-color: rgba(245,185,66,0.25);
}
.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  flex-shrink: 0;
}
.stage-name {
  font-size: 15px;
  font-weight: 700;
}
.stage-week {
  flex: 1;
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
}
.stage-progress {
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.stage-progress .fill {
  height: 100%;
  border-radius: 3px;
}

.lesson-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.lesson-card:hover {
  border-color: rgba(245,185,66,0.3);
  transform: translateY(-2px);
}
.lesson-card .name {
  font-size: 13px;
  font-weight: 600;
}
.lesson-card .meta {
  font-size: 10px;
  color: var(--text-3);
}
.lesson-card.done { opacity: 0.85; }
.lesson-card.doing {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 4px 16px var(--amber-glow);
}
.lesson-card.doing .name { color: #141416; }
.lesson-card.doing .meta { color: rgba(20,20,22,0.7); }
.lesson-card.locked { opacity: 0.55; }
.lesson-card.locked .name { color: var(--text-2); }

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  align-self: flex-start;
}
.status-pill.done {
  background: rgba(61,220,151,0.15);
  color: var(--green);
}
.status-pill.doing {
  background: rgba(20,20,22,0.2);
  color: #141416;
}
.status-pill.locked {
  background: rgba(255,255,255,0.08);
  color: var(--text-3);
}

/* ============ S3 乐器库 ============ */
.instrument-hero {
  min-height: 220px;
  border-radius: var(--r-xl);
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-deep) 100%);
  padding: 32px 36px;
  display: flex;
  align-items: center;
  gap: 32px;
  box-shadow: 0 12px 36px var(--amber-glow);
  overflow: hidden;
}
.instrument-hero .left { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.instrument-hero .badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 600;
  align-self: flex-start;
}
.instrument-hero .title {
  font-size: 36px;
  font-weight: 700;
}
.instrument-hero .desc {
  font-size: 15px;
  font-weight: 500;
}
.btn-dark {
  height: 46px;
  padding: 0 24px;
  border-radius: 12px;
  background: #141416;
  border: none;
  color: var(--amber);
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s;
}
.btn-dark:hover { background: #000; transform: translateY(-1px); }
.instrument-hero .right {
  width: 320px;
  height: 150px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(16px);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instrument-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.instrument-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.instrument-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-3px);
}
.instrument-card .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.instrument-card .name {
  font-size: 16px;
  font-weight: 700;
}
.instrument-card .desc {
  font-size: 12px;
  color: var(--text-3);
}

/* ============ Toast / 提示 ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 触摸/指针反馈涟漪 ============ */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(245,185,66,0.35);
  pointer-events: none;
  animation: rippleOut 0.5s ease-out forwards;
  z-index: 20;
}
@keyframes rippleOut {
  0% { width: 0; height: 0; opacity: 0.6; }
  100% { width: 120px; height: 120px; opacity: 0; }
}

/* ============ 乐器切换器 ============ */
.inst-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inst-chip {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.inst-chip:hover { border-color: var(--line-strong); color: var(--text); }
.inst-chip.active {
  background: var(--amber);
  color: #141416;
  box-shadow: 0 2px 10px var(--amber-glow);
}

/* ============ 通用乐器舞台 ============ */
.instrument-stage {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 72px;
  top: 176px;
  overflow: hidden;
}

/* ============ 马头琴 ============ */
.morin-bow {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}
.morin-bow .bow-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--text-3), transparent);
}
.morin-bow .bow-label {
  font-size: 10px;
  color: var(--text-3);
}
.morin-string-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 52px 0 0 0;
}
.morin-string-row:first-of-type {
  margin-top: 24px;
}
.morin-string-name {
  width: 80px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-align: right;
  flex-shrink: 0;
  padding-top: 18px;
}
.morin-string-line {
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, #8B6914, #C9A84C, #8B6914);
  border-radius: 2px;
  position: relative;
  margin-top: 18px;
}
.morin-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.12s;
  padding: 2px 4px;
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
}
.morin-dot .dot-ring {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 2px solid var(--line-strong);
  transition: all 0.12s;
}
.morin-dot.open .dot-ring {
  border-color: #C9A84C;
  background: rgba(201,168,76,0.15);
}
.morin-dot:hover .dot-ring { border-color: #C9A84C; transform: scale(1.08); }
.morin-dot.active .dot-ring {
  background: #C9A84C;
  border-color: #C9A84C;
  box-shadow: 0 0 18px rgba(201,168,76,0.5);
  transform: scale(1.12);
}
.morin-dot.target .dot-ring {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 6px 20px var(--amber-glow);
}
.morin-dot .dot-label {
  font-size: 9px;
  color: var(--text-3);
}
.morin-dot.active .dot-label, .morin-dot.target .dot-label { color: var(--amber); }
.morin-dot .dot-note {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
}
.morin-dot.active .dot-note { color: var(--amber); }
.morin-dot .dot-key {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ============ 吉他 ============ */
.guitar-mode-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.g-mode {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.g-mode.active {
  background: var(--blue);
  color: #fff;
}
.g-mode-hint {
  flex: 1;
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
}
.guitar-chord-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.guitar-chord-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s;
}
.guitar-chord-card:hover {
  border-color: rgba(108,140,255,0.35);
  transform: translateY(-2px);
}
.guitar-chord-card.active {
  background: rgba(108,140,255,0.2);
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(108,140,255,0.3);
}
.guitar-chord-card.target {
  background: rgba(108,140,255,0.15);
  border-color: var(--blue);
}
.guitar-chord-card .chord-key {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 3px;
}
.guitar-chord-card .chord-num {
  font-size: 8px;
  background: rgba(108,140,255,0.2);
  border-radius: 3px;
  padding: 1px 4px;
}
.guitar-chord-card .chord-full {
  display: none;
}
.guitar-chord-card .chord-name {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.guitar-fretboard {
  position: relative;
  padding: 10px 0 10px 40px;
}
.guitar-nut {
  position: absolute;
  left: 40px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
}
.guitar-string-row {
  display: flex;
  align-items: center;
  height: 38px;
  border-bottom: 1px solid rgba(201,168,76,0.25);
}
.guitar-string-label {
  width: 36px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
}
.guitar-fret-cell {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: all 0.1s;
}
.guitar-fret-cell:hover { background: rgba(108,140,255,0.1); }
.guitar-fret-cell.active { background: rgba(108,140,255,0.3); }
.guitar-fret-cell .fret-dot {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guitar-fret-cell .fret-open {
  font-size: 16px;
  color: var(--text-3);
}

/* ============ 架子鼓 ============ */
.drum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
  height: 100%;
}
.drum-pad {
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
  overflow: hidden;
  color: var(--pad-color, var(--text-2));
}
.drum-pad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pad-color, #fff);
  opacity: 0;
  transition: opacity 0.15s;
}
.drum-pad:hover::before { opacity: 0.08; }
.drum-pad.hit::before { opacity: 0.3; }
.drum-pad.hit {
  transform: scale(0.95);
  border-color: var(--pad-color);
}
.drum-pad.target {
  border-color: var(--pad-color);
  box-shadow: 0 0 24px color-mix(in srgb, var(--pad-color) 40%, transparent);
}
.drum-pad .pad-key {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.drum-pad .pad-num {
  font-size: 9px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 5px;
}
.drum-pad .pad-icon {
  z-index: 1;
}
.drum-pad .pad-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  z-index: 1;
}
.drum-pad .pad-en {
  font-family: var(--font-en);
  font-size: 9px;
  color: var(--text-3);
  z-index: 1;
}

/* ============ 小提琴（复用马头琴骨架，紫色高亮） ============ */
.violin-wrap .morin-string-line.violin-string-line {
  background: linear-gradient(90deg, #6B5B8A, #A78BC9, #6B5B8A);
}
.violin-wrap .morin-string-row {
  margin: 40px 0 0 0;
}
.violin-wrap .morin-string-row:first-of-type {
  margin-top: 18px;
}
.violin-wrap .morin-dot.open .dot-ring {
  border-color: #A78BC9;
  background: rgba(167,139,201,0.15);
}
.violin-wrap .morin-dot:hover .dot-ring { border-color: #A78BC9; }
.violin-wrap .morin-dot.active .dot-ring {
  background: #A78BC9;
  border-color: #A78BC9;
  box-shadow: 0 0 18px rgba(167,139,201,0.5);
}
.violin-wrap .morin-dot.target .dot-ring {
  background: var(--amber);
  border-color: var(--amber);
}
.violin-wrap .morin-dot.active .dot-label,
.violin-wrap .morin-dot.active .dot-note { color: #C9AEE8; }

/* ============ 尤克里里 ============ */
.uke-mode-bar .g-mode.active {
  background: #3DDC97;
  color: #0C2A1E;
}
.uke-chord-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.uke-chord-card {
  padding: 10px 6px;
}
.uke-chord-card.active {
  border-color: #3DDC97;
  background: rgba(61,220,151,0.12);
}
.uke-chord-card.target {
  border-color: var(--amber);
}
.uke-chord-card .chord-name {
  font-size: 20px;
}
.uke-chord-card .chord-key {
  color: #3DDC97;
}
.uke-fretboard {
  margin-top: 8px;
}
.uke-fretboard .guitar-string-label {
  color: #3DDC97;
}
.uke-fretboard .guitar-fret-cell.active {
  background: rgba(61,220,151,0.3);
}
.uke-fretboard .fret-dot {
  background: #3DDC97;
}

/* ============ 古筝 ============ */
.guzheng-tip {
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.guzheng-tip span {
  padding: 3px 10px;
  background: rgba(232,121,160,0.1);
  border-radius: 6px;
}
.guzheng-bridge {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 90px solid transparent;
  border-right: 90px solid transparent;
  border-bottom: 34px solid rgba(232,121,160,0.18);
  pointer-events: none;
}
.guzheng-bridge::after {
  content: '';
  position: absolute;
  left: -90px;
  top: 34px;
  width: 180px;
  height: 3px;
  background: rgba(232,121,160,0.4);
}
.guzheng-strings {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 56px 8px 8px;
}
.guzheng-string {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.12s;
}
.guzheng-string .gz-line {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--thick, 2px);
  background: linear-gradient(90deg, #8A5A6E, #E879A0 30%, #F5A9C4 50%, #E879A0 70%, #8A5A6E);
  border-radius: 2px;
  transition: all 0.12s;
}
.guzheng-string:hover .gz-line {
  background: linear-gradient(90deg, #B87A90, #F5A9C4 30%, #FFD2E2 50%, #F5A9C4 70%, #B87A90);
}
.guzheng-string.active .gz-line {
  background: linear-gradient(90deg, #E879A0, #FFD2E2 50%, #E879A0);
  box-shadow: 0 0 16px rgba(232,121,160,0.55);
}
.guzheng-string.target .gz-line {
  background: linear-gradient(90deg, var(--amber), #FFE9B8 50%, var(--amber));
}
.guzheng-string .gz-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.guzheng-string .gz-note {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
}
.guzheng-string.active .gz-note { color: #FFD2E2; }
.guzheng-string .gz-key {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
}
.guzheng-string.active .gz-key {
  background: rgba(232,121,160,0.3);
  color: #FFD2E2;
}

/* ============ 长笛 ============ */
.flute-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}
.flute-mouth {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9BE8FF, #4CC9F0 55%, #2A8FB8);
  border: 2px solid rgba(76,201,240,0.5);
}
.flute-label {
  font-size: 11px;
  color: var(--text-3);
}
.flute-body {
  display: flex;
  align-items: center;
  gap: 0;
  height: 118px;
  margin: 6px 0;
  padding: 0 22px;
  border-radius: 60px;
  background: linear-gradient(180deg, #2A3A46 0%, #1E2A33 50%, #162028 100%);
  border: 1px solid rgba(76,201,240,0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}
.flute-hole {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.12s;
}
.flute-hole .hole-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1A2830, #0D1418);
  border: 2px solid rgba(76,201,240,0.35);
  transition: all 0.12s;
}
.flute-hole:hover .hole-ring {
  border-color: #4CC9F0;
  transform: scale(1.06);
}
.flute-hole.active .hole-ring {
  background: radial-gradient(circle at 40% 35%, #8FE8FF, #4CC9F0);
  border-color: #9BE8FF;
  box-shadow: 0 0 22px rgba(76,201,240,0.65);
  transform: scale(1.12);
}
.flute-hole.target .hole-ring {
  background: var(--amber);
  border-color: var(--amber);
}
.flute-hole .hole-note {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
}
.flute-hole.active .hole-note { color: #9BE8FF; }
.flute-hole .hole-key {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
}
.flute-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.breath-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.breath-wave span {
  width: 3px;
  border-radius: 2px;
  background: rgba(76,201,240,0.55);
  animation: breathPulse 1.4s ease-in-out infinite;
}
.breath-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.breath-wave span:nth-child(2) { height: 16px; animation-delay: 0.18s; }
.breath-wave span:nth-child(3) { height: 11px; animation-delay: 0.36s; }
.breath-wave span:nth-child(4) { height: 14px; animation-delay: 0.54s; }
@keyframes breathPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}
.foot-tip {
  font-size: 11px;
  color: var(--text-3);
}

/* ============ 乐器卡可学习状态 ============ */
.instrument-card.available {
  border-color: rgba(255,255,255,0.14);
}
.instrument-card.available:hover {
  border-color: rgba(245,185,66,0.35);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.instrument-card.current {
  border-color: var(--amber);
  background: rgba(245,185,66,0.08);
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ============ 音量/节拍 popover ============ */
.bpm-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
}
.bpm-ctl .val {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 64px;
  text-align: center;
}
.bpm-step {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bpm-step:hover { background: rgba(255,255,255,0.16); color: var(--text); }

/* 录音状态 */
.rec-timer {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  min-width: 40px;
}
.pulse {
  animation: pulseDot 1s ease infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ============================================================
   S4 乐理知识
   ============================================================ */
.theory-progress {
  display: flex;
  align-items: center;
  gap: 16px;
}
.theory-progress .tp-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.theory-progress .tp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--green));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.theory-progress .tp-text {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}

.theory-layout {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* 左侧主题列表 */
.theory-list {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.theory-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
}
.theory-item:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.theory-item.active {
  background: rgba(245, 185, 66, 0.1);
  border-color: var(--amber);
}
.theory-item.learned .ti-check {
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
}
.theory-item .ti-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.theory-item .ti-icon svg {
  width: 100%;
  height: 100%;
}
.theory-item .ti-info {
  flex: 1;
  min-width: 0;
}
.theory-item .ti-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theory-item .ti-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theory-item .ti-arrow {
  color: var(--text-3);
  font-size: 18px;
}

/* 右侧内容面板 */
.theory-content {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tc-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.tc-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tc-icon svg {
  width: 28px;
  height: 28px;
}
.tc-title {
  font-size: 22px;
  font-weight: 700;
}
.tc-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.tc-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}
.tc-body b {
  color: var(--text);
  font-weight: 600;
}
.tc-body p {
  margin-bottom: 12px;
}

.theory-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.theory-table th {
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.theory-table td {
  background: var(--surface);
  color: var(--text);
  text-align: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.theory-formula {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  background: rgba(245, 185, 66, 0.08);
  border: 1px solid rgba(245, 185, 66, 0.2);
  border-radius: var(--r-md);
  padding: 14px;
  margin: 12px 0;
}
.theory-diagram {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
}
.theory-diagram .td-row {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.td-note {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.td-arrow {
  font-size: 10px;
  color: var(--text-3);
}
.td-arrow.half {
  color: var(--orange);
}
.theory-list {
  list-style: none;
}
.theory-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.theory-list li:last-child {
  border-bottom: none;
}

/* 乐理演示区 */
.tc-demo {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.tc-demo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tc-demo-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

/* ============================================================
   S5 音感训练 · 游戏中心
   ============================================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.game-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: 28px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--gc);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.gc-icon {
  width: 48px;
  height: 48px;
}
.gc-icon svg {
  width: 100%;
  height: 100%;
}
.gc-name {
  font-size: 20px;
  font-weight: 700;
}
.gc-en {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}
.gc-desc {
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0;
}
.gc-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}
.gc-level {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
}
.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.gc-best .label {
  font-size: 11px;
  color: var(--text-3);
}
.gc-best .score {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  margin-left: 8px;
}
.gc-start {
  padding: 8px 20px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bg);
}

/* ============ 游戏对战区 ============ */
.game-arena {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 500px;
}
.game-hud {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 20px;
}
.hud-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: none;
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.hud-back:hover {
  background: var(--surface-3);
  color: var(--text);
}
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 60px;
}
.hs-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hs-value {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
}
.hs-value.combo {
  color: var(--amber);
}
.game-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.game-progress .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 题目区 */
.game-question {
  text-align: center;
  padding: 20px;
}
.gq-level {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.gq-prompt {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}
.gq-prompt kbd {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 10px;
  font-family: var(--font-en);
  font-size: 14px;
}
.gq-listen {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 12px 28px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.gq-listen:hover {
  background: var(--surface-3);
  transform: scale(1.03);
}
.gq-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
}

/* 选项按钮 */
.game-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}

/* 听音辨名选项 */
.pitch-opt {
  width: 80px;
  height: 64px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pitch-opt:hover:not(:disabled) {
  border-color: var(--amber);
  background: rgba(245, 185, 66, 0.1);
  transform: translateY(-2px);
}
.pitch-opt:disabled { cursor: default; opacity: 0.6; }
.pitch-opt.correct {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.15);
  opacity: 1;
}
.pitch-opt.wrong {
  border-color: var(--red);
  background: rgba(255, 92, 92, 0.15);
  opacity: 1;
}
.pitch-opt.reveal {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  opacity: 1;
}
.po-name {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 700;
}

/* 音程选项 */
.interval-opt {
  min-width: 110px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.interval-opt:hover:not(:disabled) {
  border-color: var(--blue);
  background: rgba(108, 140, 255, 0.1);
  transform: translateY(-2px);
}
.interval-opt:disabled { cursor: default; opacity: 0.6; }
.interval-opt.correct {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.15);
  opacity: 1;
}
.interval-opt.wrong {
  border-color: var(--red);
  background: rgba(255, 92, 92, 0.15);
  opacity: 1;
}
.interval-opt.reveal {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  opacity: 1;
}
.io-name {
  font-size: 15px;
  font-weight: 600;
}
.io-short {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-3);
}

/* 和弦选项 */
.chord-opt {
  min-width: 130px;
  height: 64px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.chord-opt:hover:not(:disabled) {
  border-color: var(--violet);
  background: rgba(192, 132, 252, 0.1);
  transform: translateY(-2px);
}
.chord-opt:disabled { cursor: default; opacity: 0.6; }
.chord-opt.correct {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.15);
  opacity: 1;
}
.chord-opt.wrong {
  border-color: var(--red);
  background: rgba(255, 92, 92, 0.15);
  opacity: 1;
}
.chord-opt.reveal {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  opacity: 1;
}
.co-name {
  font-size: 15px;
  font-weight: 600;
}
.co-feel {
  font-size: 10px;
  color: var(--text-3);
}

/* 迷你钢琴 */
.mini-piano-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.mini-piano {
  position: relative;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.mp-white {
  position: absolute;
  top: 0;
  background: var(--key-white);
  border-radius: 0 0 4px 4px;
  border-right: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  transition: background 0.1s;
}
.mp-white:hover { background: #E0DDD5; }
.mp-white.active {
  background: var(--amber);
}
.mp-black {
  position: absolute;
  top: 0;
  background: var(--key-black);
  border-radius: 0 0 3px 3px;
  z-index: 2;
  cursor: pointer;
  transition: background 0.1s;
}
.mp-black:hover { background: #2A2930; }
.mp-black.active {
  background: var(--amber-deep);
}

/* ============ 节奏大师 ============ */
.rhythm-arena {
  align-items: center;
}
.rhythm-visual {
  display: flex;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.rv-cell {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.rv-cell.beat {
  border: 1px solid var(--line-strong);
}
.rv-cell.offbeat {
  opacity: 0.6;
}
.rv-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: all 0.15s;
}
.rv-cell.hit .rv-dot {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}
.rv-cell.hit {
  background: rgba(61, 220, 151, 0.1);
}
.rv-cell.missed .rv-dot {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.5);
}
.rv-num {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-3);
}

.rhythm-tap-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.rhythm-tap-btn {
  width: 240px;
  height: 100px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 2px solid var(--green);
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.rhythm-tap-btn:hover {
  background: rgba(61, 220, 151, 0.1);
}
.rhythm-tap-btn.tapped {
  background: rgba(61, 220, 151, 0.25);
  transform: scale(0.96);
}
.rtb-text {
  font-size: 18px;
  font-weight: 700;
}
.rtb-sub {
  font-size: 12px;
  color: var(--text-3);
}
.rhythm-taps-display {
  display: flex;
  gap: 4px;
  min-height: 20px;
}
.rhythm-tap-mark {
  color: var(--green);
  font-size: 14px;
  animation: fadeInScale 0.2s ease;
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.rhythm-submit {
  margin-top: 8px;
}

/* ============ 游戏结算 ============ */
.game-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
}
.result-grade {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 800;
}
.result-title {
  font-size: 24px;
  font-weight: 700;
}
.result-desc {
  font-size: 15px;
  color: var(--text-2);
}
.result-newbest {
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
  animation: bounceIn 0.5s ease;
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.result-stats {
  display: flex;
  gap: 24px;
  margin: 16px 0;
}
.rs-item {
  text-align: center;
  min-width: 80px;
}
.rs-v {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 700;
}
.rs-l {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.result-best {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.result-actions {
  display: flex;
  gap: 12px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ============ 游戏反馈动画 ============ */
.game-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 800;
  pointer-events: none;
  z-index: 100;
  animation: flashPop 0.6s ease forwards;
}
.game-flash.correct {
  color: var(--green);
}
.game-flash.wrong {
  color: var(--red);
}
@keyframes flashPop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.combo-toast {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  font-weight: 800;
  color: var(--amber);
  text-shadow: 0 0 20px rgba(245, 185, 66, 0.5);
  pointer-events: none;
  z-index: 100;
  animation: comboUp 0.9s ease forwards;
}
@keyframes comboUp {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
  80% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.9); }
}
