:root {
  --bg: #111315;
  --panel: #1b1f22;
  --panel-2: #242a2e;
  --line: #343b40;
  --text: #f5f7f8;
  --muted: #9aa4aa;
  --green: #07d09a;
  --green-dark: #06382c;
  --blue: #1676d2;
  --blue-soft: #75afe7;
  --danger: #ff7b6e;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.screen {
  min-height: calc(100vh - 36px);
}

.hidden {
  display: none !important;
}

.app-header,
.practice-topbar,
.action-bar,
.selection-tools,
.chord-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header,
.practice-topbar,
.action-bar {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.8rem);
}

.selected-pill,
.score-pill {
  min-width: 104px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #061b16;
  background: var(--green);
  font-weight: 800;
  text-align: center;
}

.selection-tools {
  margin: 20px 0 14px;
  align-items: end;
  flex-wrap: wrap;
}

.search-field {
  display: grid;
  flex: 1 1 280px;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-field input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--panel);
  padding: 0 14px;
}

.diagram-toggle {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-button,
.chord-button,
.primary-button,
.icon-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.filter-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
}

.filter-button.active {
  color: #061b16;
  background: var(--green);
  font-weight: 800;
}

.chord-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  padding-bottom: 96px;
}

.chord-grid:empty::before {
  content: "没有匹配的和弦";
  color: var(--muted);
  padding: 24px 0;
}

.chord-button {
  min-height: 68px;
  color: var(--text);
  background: #62686b;
  font-size: 1.35rem;
}

.chord-button.selected {
  color: #061b16;
  background: var(--green);
}

.action-bar {
  position: sticky;
  bottom: 0;
  min-height: 78px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 19, 21, 0.94);
  backdrop-filter: blur(10px);
}

.hint {
  margin: 0;
  color: var(--muted);
}

.primary-button {
  min-width: 180px;
  min-height: 54px;
  color: #061b16;
  background: var(--green);
  font-weight: 900;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.practice-screen {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
}

.icon-button {
  width: 48px;
  height: 48px;
  color: var(--text);
  background: transparent;
  font-size: 1.5rem;
}

.chord-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.preview-card {
  min-height: 58px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.preview-card span {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.8);
}

.preview-card strong {
  font-size: 1.4rem;
}

.preview-card.current {
  background: var(--blue);
}

.preview-card.next {
  background: var(--blue-soft);
}

.target-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.target-panel h2 {
  font-size: clamp(5rem, 22vw, 10rem);
  line-height: 0.9;
}

.diagram-slot {
  min-height: 0;
}

.progress-track {
  width: min(420px, 100%);
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 90ms linear;
}

.status-text {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.status-text.error {
  color: var(--danger);
}

.status-text.success {
  color: var(--green);
}

.chord-diagram {
  width: 220px;
  color: var(--text);
}

.string-markers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.string-marker {
  min-height: 22px;
}

.fretboard {
  position: relative;
  height: 230px;
  margin: 0 auto;
}

.chord-diagram:not(.high-position) .fretboard::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 9px;
  border-radius: 8px;
  background: var(--text);
  z-index: 2;
}

.string-line {
  position: absolute;
  top: 0;
  bottom: 12px;
  width: 4px;
  border-radius: 4px;
  background: #dce2e4;
}

.fret-line {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #8d979d;
}

.base-fret {
  position: absolute;
  left: -22px;
  top: 18px;
  color: var(--muted);
  font-weight: 900;
}

.finger-dot,
.barre {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  background: var(--text);
  color: #111315;
  font-weight: 900;
}

.finger-dot {
  width: 30px;
  border-radius: 50%;
}

.barre {
  border-radius: 999px;
}

.diagram-fallback {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
  }

  .selection-tools,
  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }
}
