* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #f8f9fa;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 导航栏样式 */
.navbar {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.logo i {
  color: #ffd43b;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover {
  background: rgba(33, 150, 243, 0.25);
}

.nav-link.active {
  background: linear-gradient(to right, #228be6, #1971c2);
  color: white;
}

.language-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 8px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.language-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.container {
  max-width: 1200px;
  width: 100%;
  padding: 20px;
  flex: 1 0 auto;
  margin-bottom: 0;
}

header {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 20px;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 15px;
  font-weight: 300;
  color: #fff;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

h1::after {
  content: '交互练习版';
  position: absolute;
  top: -10px;
  right: -100px;
  font-size: 0.9rem;
  background: linear-gradient(to right, #40c057, #2b8a3e);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.2rem;
  color: #a3d9ff;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 300;
}

.control-panel {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e9ecef;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 26px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  font-size: 1.05rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn.active {
  background: rgba(33, 150, 243, 0.25);
  color: #4dabf7;
  border-color: rgba(33, 150, 243, 0.4);
}

.btn.primary {
  background: linear-gradient(to right, #228be6, #1971c2);
  color: white;
  border: none;
}

.btn.primary:hover {
  background: linear-gradient(to right, #1971c2, #1864ab);
  transform: translateY(-2px);
}

.btn.danger {
  background: linear-gradient(to right, #e03131, #c92a2a);
  color: white;
  border: none;
}

.btn.danger:hover {
  background: linear-gradient(to right, #c92a2a, #a61e1e);
  transform: translateY(-2px);
}

.btn.success {
  background: linear-gradient(to right, #2b8a3e, #2b8a3e);
  color: white;
  border: none;
}

.btn.success:hover {
  background: linear-gradient(to right, #2b8a3e, #2b8a3e);
  transform: translateY(-2px);
}

.btn i {
  font-size: 1.2rem;
}

/* 状态栏样式 */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 18px 25px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.2rem;
  color: #c5f6fa;
  min-height: 65px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 30px;
  transition: all 0.3s ease;
}

.status-bar.highlight {
  background: rgba(64, 192, 87, 0.15);
  color: #69db7c;
  box-shadow: 0 0 15px rgba(64, 192, 87, 0.2);
}

.status-bar.error {
  background: rgba(250, 82, 82, 0.15);
  color: #ff8787;
  box-shadow: 0 0 15px rgba(250, 82, 82, 0.2);
}

.status-bar.info {
  background: rgba(33, 150, 243, 0.15);
  color: #74c0fc;
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.2);
}

/* 和弦参考区 - 修改为水平排列 */
.chords-reference {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  overflow-x: visible;
  gap: 10px;
  margin: 15px auto 20px;
  max-width: 100%;
  padding: 5px;
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
  align-items: flex-start;
}

.chords-reference::-webkit-scrollbar {
  display: none;
}

.chord-card {
  min-width: 100px;
  min-height: 80px;
  padding: 20px;
  font-size: 1.2rem;
  border-radius: 15px;
  margin: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.chord-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.chord-level {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 6px;
  color: #ffd43b;
}

.chord-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.chord-type {
  font-size: 0.8rem;
  color: #a3d9ff;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

/* 练习模式下的样式 */
.practice-mode .chord-card {
  min-width: 100px;
  min-height: 80px;
  padding: 20px;
  font-size: 1.2rem;
  border-radius: 15px;
  margin: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.practice-mode .chord-level {
  display: none;
}

.practice-mode .chord-name {
  font-size: 1.2rem;
  margin: 0;
}

/* 正确/错误状态 */
.chord-card.correct {
  background: linear-gradient(
    135deg,
    rgba(64, 192, 87, 0.5),
    rgba(43, 138, 62, 0.5)
  );
  border: 2px solid #40c057;
}

.chord-card.error {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.5),
    rgba(255, 43, 43, 0.5)
  );
  border: 2px solid #ff6b6b;
}

/* 新增的音符选择器样式 */
.top-note-selection {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.top-note-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  color: #e9ecef;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.top-note-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.top-note-btn.active {
  background: linear-gradient(135deg, #40c057, #2b8a3e);
  color: white;
  transform: scale(1.1);
}

.top-note-btn.error {
  background: linear-gradient(135deg, #ff6b6b, #ff2b2b);
  color: white;
  transform: scale(1.1);
}

.fretboard-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 30px;
  overflow-x: auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.fretboard {
  position: relative;
  min-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: 50px;
}

.fretboard-header {
  display: flex;
  height: 40px;
  position: absolute;
  top: 0;
  left: 60px;
  right: 0;
  z-index: 10;
}

.fret-number {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #ced4da;
  font-size: 16px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 5px;
  padding: 5px 0;
  background: transparent;
  margin: 0 1px;
}

.fret-number:hover {
  background: rgba(255, 255, 255, 0.1);
}

.fret-number.selected {
  background: rgba(33, 150, 243, 0.3);
  color: #4dabf7;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.4);
}

/* 特殊品位样式 */
.fret-number.special {
  background: rgba(33, 150, 243, 0.25);
  color: #e7f5ff;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(33, 150, 243, 0.4);
  font-weight: bold;
  z-index: 11;
}

.fret-row {
  display: flex;
  position: relative;
  height: 55px;
  margin-bottom: 5px;
}

.string-label {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #e9ecef;
  font-size: 1rem;
  z-index: 5;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  margin-right: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  padding: 8px 0;
  text-align: center;
  line-height: 1.2;
  min-height: 40px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.fret-notes {
  display: flex;
  flex: 1;
  position: relative;
}

.note-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.note {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 3;
  background: rgba(33, 150, 243, 0.2);
  border: 1px solid rgba(33, 150, 243, 0.3);
  color: #a5d8ff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.note:hover {
  background: rgba(33, 150, 243, 0.3);
  transform: scale(1.1);
}

.note.selected {
  background: linear-gradient(135deg, #40c057, #2b8a3e);
  color: white;
  border-color: #2f9e44;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(64, 192, 87, 0.5);
  transform: scale(1.1);
}

.note.root-note {
  background: linear-gradient(135deg, #ff6b6b, #ff2b2b);
  color: white;
  border-color: #e03131;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(255, 107, 107, 0.5);
}

.note.scale-note {
  background: linear-gradient(135deg, #ffd43b, #fcc419);
  color: #212529;
  border-color: #fab005;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(255, 212, 59, 0.5);
}

/* 非母调式的音阶样式 */
.note.scale-note.inactive {
  background: linear-gradient(
    135deg,
    rgba(255, 212, 59, 0.7),
    rgba(252, 196, 25, 0.7)
  );
  opacity: 0.7;
}

.note.root-note.inactive {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.7),
    rgba(255, 43, 43, 0.7)
  );
  opacity: 0.7;
}

.example-open-note,
.open-note {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  background: rgba(248, 240, 198, 0.2);
  border: 1px solid rgba(233, 216, 166, 0.3);
  color: #f8f0c6;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.example-open-note.selected,
.open-note.selected {
  background: linear-gradient(135deg, #40c057, #2b8a3e);
  color: white;
  border-color: #2f9e44;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(64, 192, 87, 0.5);
}

.example-open-note.root-note,
.open-note.root-note {
  background: linear-gradient(135deg, #ff6b6b, #ff2b2b);
  color: white;
  border-color: #e03131;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(255, 107, 107, 0.5);
}

.example-open-note.scale-note,
.open-note.scale-note {
  background: linear-gradient(135deg, #ffd43b, #fcc419);
  color: #212529;
  border-color: #fab005;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(255, 212, 59, 0.5);
}

.example-open-note.scale-note.inactive,
.open-note.scale-note.inactive {
  background: linear-gradient(
    135deg,
    rgba(255, 212, 59, 0.7),
    rgba(252, 196, 25, 0.7)
  );
  opacity: 0.7;
}

.example-open-note.root-note.inactive,
.open-note.root-note.inactive {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.7),
    rgba(255, 43, 43, 0.7)
  );
  opacity: 0.7;
}

.string-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #adb5bd, transparent);
  z-index: 1;
}

/* 品丝样式 */
.fret-wire {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #adb5bd, #868e96, #adb5bd);
  z-index: 2;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.instructions {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 25px;
  margin-top: 30px;
  max-width: 800px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions h2 {
  margin-bottom: 20px;
  color: #e9ecef;
  font-size: 1.7rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.instructions ul {
  padding-left: 25px;
}

.instructions li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: #ced4da;
  font-size: 1.05rem;
}

.highlight {
  background: rgba(33, 150, 243, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  color: #4dabf7;
  font-weight: 500;
}

footer {
  text-align: center;
  margin-top: auto;
  padding: 20px 0 10px 0;
  font-size: 0.95rem;
  color: #a3d9ff;
  width: 100%;
  background: none;
}

footer a {
  color: #fff;
  text-decoration: none;
  transition: text-decoration 0.2s;
}

footer a:hover {
  text-decoration: underline;
}

/* 调式选择器优化 */
.scale-selector {
  background: rgba(255, 255, 255, 0.1);
  color: #e9ecef;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 46px 14px 26px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.05rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23e9ecef' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 18px;
}

/* 下拉选项样式 */
.scale-selector option {
  background: #203a43;
  color: white;
  font-size: 1rem;
  padding: 10px;
}

.scale-selector:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.scale-selector:focus {
  outline: none;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-root {
  background: linear-gradient(135deg, #ff6b6b, #ff2b2b);
}

.legend-scale {
  background: linear-gradient(135deg, #ffd43b, #fcc419);
}

.legend-selected {
  background: linear-gradient(135deg, #40c057, #2b8a3e);
}

/* 练习统计 */
.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  font-size: 1.1rem;
  display: none;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 5px;
}

.correct {
  color: #40c057;
}

.incorrect {
  color: #ff6b6b;
}

/* 闪烁动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pulse {
  animation: pulse 1.5s infinite;
}

/* 响应式设计 */
@media (max-width: 850px) {
  h1 {
    font-size: 2.2rem;
  }

  h1::after {
    top: -15px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .control-panel {
    flex-direction: column;
    align-items: center;
  }

  .chord-card {
    min-width: 100px;
    padding: 15px;
  }

  .chord-level {
    font-size: 1.5rem;
  }

  .chord-name {
    font-size: 1.2rem;
  }

  .practice-mode .chord-name {
    font-size: 1.8rem;
  }

  .fretboard-container {
    padding: 20px 15px;
  }

  .fretboard {
    min-width: 700px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .top-note-selection {
    gap: 5px;
  }

  .top-note-btn {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .navbar {
    padding: 10px 15px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-link {
    padding: 8px 15px;
    font-size: 0.9rem;
  }

  .string-label {
    width: 50px;
    font-size: 0.9rem;
    padding: 6px 0;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .status-bar {
    font-size: 1rem;
    padding: 15px;
  }

  .instructions li {
    font-size: 0.95rem;
  }

  .scale-selector {
    width: 100%;
  }

  .legend {
    gap: 10px;
  }

  .legend-item {
    font-size: 0.8rem;
  }

  .top-note-selection {
    gap: 3px;
  }

  .top-note-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .nav-links {
    gap: 5px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .language-toggle {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .string-label {
    width: 45px;
    font-size: 0.8rem;
    padding: 4px 0;
    min-height: 35px;
  }
}

/* 内容区域切换 */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}
