:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --primary: #31c27c;
  --primary-dark: #2aab6d;
  --text: #2b2f36;
  --text-secondary: #8a919f;
  --border: #e6eaf0;
  --shadow: 0 8px 24px rgba(20, 32, 50, 0.08);
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 140px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 14px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.search-input {
  flex: 1;
  height: 48px;
  padding: 0 20px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(49, 194, 124, 0.15);
}

.search-btn {
  height: 48px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn:active {
  transform: scale(0.97);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.song-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  animation: fadeIn 0.3s ease;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(20, 32, 50, 0.12);
}

.song-cover {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.song-info {
  flex: 1;
  min-width: 0;
}

.song-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-play {
  color: var(--primary);
  display: flex;
  align-items: center;
}

.empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 0;
  font-size: 14px;
}

/* 播放器 */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(20, 32, 50, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  z-index: 100;
}

.player-cover img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.time {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 2px;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
  opacity: 1;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.control-btn:hover {
  background: var(--primary-dark);
}

.control-btn:active {
  transform: scale(0.94);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lyric-btn {
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.lyric-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.lyric-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 歌词面板 */
.lyric-panel {
  position: fixed;
  right: 20px;
  bottom: 96px;
  width: 320px;
  max-height: 60vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
  z-index: 99;
}

.lyric-panel.open {
  display: block;
  animation: fadeIn 0.2s ease;
}

.lyric-scroll {
  height: 100%;
  max-height: 60vh;
  overflow-y: auto;
  padding: 20px 16px;
  text-align: center;
}

.lyric-line {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.3s, transform 0.3s;
  line-height: 1.7;
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

@media (hover: hover) {
  .lyric-line:hover {
    background: rgba(49, 194, 124, 0.08);
  }

  .lyric-scroll.suppress-hover .lyric-line:hover {
    background: transparent;
  }
}

.lyric-line:active {
  background: rgba(49, 194, 124, 0.12);
}

.lyric-line.active {
  color: var(--primary);
  font-weight: 600;
  transform: scale(1.05);
}

.lyric-scroll::-webkit-scrollbar {
  width: 5px;
}

.lyric-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* 加载动画 */
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  font-size: 14px;
}

.loading[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(43, 47, 54, 0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}

@media (max-width: 600px) {
  .container {
    padding: 24px 16px 140px;
  }

  .player {
    padding: 12px 16px;
  }

  .player-cover img {
    width: 48px;
    height: 48px;
  }

  .lyric-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }
}
