/* ==================== 基础变量定义 ==================== */
:root {
  /* 亮色主题（默认） */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  
  --border-color: #dee2e6;
  --hover-bg: #f1f3f5;
  --active-bg: #e9ecef;
  
  --accent-color: #20c997;
  --accent-hover: #1ba87e;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* 暗色主题 */
[data-theme="dark"] {
  --bg-primary: #1a1d23;
  --bg-secondary: #252830;
  --bg-tertiary: #2f333d;
  
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --text-tertiary: #6c757d;
  
  --border-color: #3a3f4b;
  --hover-bg: #2f333d;
  --active-bg: #3a3f4b;
  
  --accent-color: #20c997;
  --accent-hover: #2ddfb0;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
  transition: all 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

/* ==================== 头部区域 ==================== */
.header {
  position: relative;
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.title {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 主题切换按钮 - 修复位置 */
.theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.theme-toggle:hover {
  background: var(--hover-bg);
  transform: rotate(180deg);
}

.theme-icon {
  font-size: 24px;
}

/* ==================== 搜索区域 ==================== */
.search-section {
  margin-bottom: 30px;
}

.search-container {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--bg-primary);
}

.source-select {
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  min-width: 140px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.source-select:hover {
  border-color: var(--accent-color);
}

.search-btn {
  padding: 14px 30px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 搜索类型标签 */
.search-type-tabs {
  display: flex;
  gap: 10px;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* ==================== 主内容区域 ==================== */
.main-content {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 20px;
  margin-bottom: 30px;
  min-height: 500px;
}

/* 专辑封面区域 */
.album-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.album-cover-wrapper {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.album-cover:hover {
  transform: scale(1.05);
}

.song-info {
  text-align: center;
  width: 100%;
}

.song-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 播放列表区域 */
.playlist-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.playlist-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.playlist {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
}

.playlist::-webkit-scrollbar {
  width: 6px;
}

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

.playlist-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.playlist-item:hover {
  background: var(--hover-bg);
  transform: translateX(5px);
}

.playlist-item.playing {
  background: var(--accent-color);
  color: white;
}

/* 搜索结果/歌词区域 */
.results-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.section-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

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

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-item {
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}

.result-item:hover {
  background: var(--hover-bg);
  transform: translateX(5px);
}

/* 空状态提示 */
.empty-hint {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px 20px;
  font-size: 14px;
}

/* ==================== 播放控制栏 ==================== */
.player-controls {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-buttons {
  display: flex;
  gap: 10px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--hover-bg);
  transform: scale(1.1);
}

.play-btn {
  width: 54px;
  height: 54px;
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  font-size: 22px;
}

.play-btn:hover {
  background: var(--accent-hover);
}

.progress-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 45px;
  text-align: center;
}

.progress-bar {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16
