.music-player-wrapper {
  position: fixed;
  z-index: 9999;
  font-family: 'HarmonyOS Sans', 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow: visible;
}

/* 加载指示器 */
.player-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: #666;
}

[data-theme="dark"] .player-loading {
  background: rgba(30, 30, 40, 0.95);
  color: #aaa;
}

.player-loading .loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

[data-theme="dark"] .player-loading .loading-spinner {
  border-color: #555;
  border-top-color: #fff;
}

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

/* 歌词显示容器 */
.lyrics-container {
  position: fixed;
  z-index: 9998;
  text-align: center;
  pointer-events: auto;
  max-width: min(600px, calc(100vw - 48px));
  width: fit-content;
  padding: 14px 28px;
  max-height: calc(100vh - 96px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(200, 200, 210, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
}

.lyrics-container:active {
  cursor: grabbing;
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.01);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .lyrics-container {
  background: rgba(20, 20, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .lyrics-container:active {
  background: rgba(30, 30, 40, 0.94);
}

@media screen and (max-width: 768px) {
  .lyrics-container {
    padding: 10px 18px;
    border-radius: 14px;
  }
  
  .lyric-line.current {
    font-size: 15px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  }
  .lyric-line.next {
    font-size: 12px;
  }
}

.lyrics-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.lyric-line {
  display: block;
  font-weight: 650;
  color: var(--text-primary, #333);
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.9);
  opacity: 0.92;
  line-height: 1.3;
  transition: all 0.35s ease;
}

.lyric-line.next {
  opacity: 0.55;
  font-weight: 500;
}

/* 歌词占位符 — 修复亮色主题下不可读问题 */
.lyrics-placeholder {
  font-size: 13px;
  opacity: 0.65;
  font-weight: 500;
  color: var(--text-secondary, #888) !important;
}

[data-theme="dark"] .lyric-line {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .lyrics-placeholder {
  color: rgba(180, 180, 190, 0.75) !important;
}

/* Lyric Transition */
.lyric-fade-enter-active,
.lyric-fade-leave-active {
  transition: all 0.3s ease;
}
.lyric-fade-enter-from {
  opacity: 0;
  transform: translateY(10px);
}
.lyric-fade-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* ==================== Widget Container ==================== */
.player-widget {
  display: flex;
  align-items: center;
  background: var(--bg-secondary, #fff);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color, #e0e0e5);
  border-radius: 22px;
  padding: 7px 14px 7px 9px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04),
    0 12px 36px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 480px;
  width: fit-content;
}

.player-widget:hover {
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.05),
    0 16px 44px rgba(0, 0, 0, 0.11);
}

[data-theme="dark"] .player-widget {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 12px 36px rgba(0, 0, 0, 0.35);
  background: rgba(32, 32, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .player-widget:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 16px 48px rgba(0, 0, 0, 0.42);
}

/* Cover Art — 放大至 50px，增强存在感 */
.cover-container {
  position: relative;
  cursor: pointer;
  margin-right: 13px;
  flex-shrink: 0;
}

.cover-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 52%;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0f3, #e8e8ed);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--bg-primary, #fff);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cover-wrapper:hover {
  transform: scale(1.06);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.15), 0 2px 5px rgba(0, 0, 0, 0.08);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s linear;
}

.cover-img.rotating {
  animation: coverRotate 10s linear infinite;
}

@keyframes coverRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cover-placeholder {
  color: var(--text-tertiary, #999);
}

/* Content Area */
.content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.song-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 14px;
}

.song-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary, #222);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.song-artist {
  font-size: 11.5px;
  color: var(--text-secondary, #777);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  line-height: 1.35;
  margin-top: 1px;
}

/* Controls — 主次分明：播放按钮放大，辅助按钮缩小 */
.controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-control-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.volume-slider-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 10px;
  z-index: 100;
}

.volume-track {
  background: var(--bg-secondary, #fff);
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color, #eee);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  width: 36px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .volume-track {
  background: rgba(40, 40, 40, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
}

.volume-slider-vertical {
  width: 100px;
  height: 4px;
  transform: rotate(-90deg);
  border-radius: 2px;
  cursor: pointer;
  appearance: none;
  outline: none;
  background: rgba(128, 128, 128, 0.2);
}

.volume-track::before {
  display: none;
}

.volume-slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-primary, #333);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-top: -4px;
  position: relative;
  z-index: 2;
}

.volume-slider-vertical::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: transparent;
  border: none;
}

.more-control-wrapper {
  position: relative;
}

.more-menu-popup {
  position: absolute;
  bottom: 140%;
  right: 0;
  width: 180px;
  background: var(--bg-secondary, #fff);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color, #e8e8ec);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 100;
  overflow: hidden;
}

[data-theme="dark"] .more-menu-popup {
  background: rgba(38, 38, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
}

.more-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary, #333);
}

.more-menu-item:hover {
  background: rgba(100, 100, 110, 0.08);
}

.menu-icon {
  margin-right: 10px;
  display: flex;
  align-items: center;
  color: var(--text-secondary, #666);
}

.menu-text {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

/* Toggle Switch */
.menu-toggle {
  width: 34px;
  height: 19px;
  background: rgba(130, 130, 140, 0.2);
  border-radius: 999px;
  position: relative;
  transition: all 0.3s;
}

.menu-toggle::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: all 0.3s;
}

.menu-toggle.active {
  background: var(--text-primary, #333);
}

.menu-toggle.active::after {
  transform: translateX(15px);
}

[data-theme="dark"] .menu-toggle.active {
  background: #fff;
}

[data-theme="dark"] .menu-toggle.active::after {
  background: #000;
}

/* ==================== Icon Buttons — 核心改动 ==================== */

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #888);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  width: 31px;
  height: 31px;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.icon-btn:hover {
  background: rgba(100, 100, 115, 0.08);
  color: var(--text-primary, #222);
}

.icon-btn:hover svg {
  transform: scale(1.08);
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn.active {
  color: var(--link-color, #000);
  background: rgba(100, 100, 115, 0.12);
}

/* 播放/暂停按钮 — 主操作，放大+强调色 */
.icon-btn[title="Play/Pause"],
.icon-btn.play-pause-main {
  width: 37px;
  height: 37px;
  background: linear-gradient(135deg, #f0f0f3, #e5e5ea);
  color: var(--text-primary, #222);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.icon-btn[title="Play/Pause"]:hover,
.icon-btn.play-pause-main:hover {
  background: linear-gradient(135deg, #e5e5eb, #dcdce0);
  color: var(--link-color, #000);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transform: scale(1.05);
}

.icon-btn[title="Play/Pause"]:active,
.icon-btn.play-pause-main:active {
  transform: scale(0.95);
}

.icon-btn[title="Play/Pause"] svg,
.icon-btn.play-pause-main svg {
  width: 17px;
  height: 17px;
}

[data-theme="dark"] .icon-btn[title="Play/Pause"],
[data-theme="dark"] .icon-btn.play-pause-main {
  background: linear-gradient(135deg, rgba(70, 70, 78, 0.9), rgba(55, 55, 62, 0.9));
  color: #f0f0f2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .icon-btn[title="Play/Pause"]:hover,
[data-theme="dark"] .icon-btn.play-pause-main:hover {
  background: linear-gradient(135deg, rgba(85, 85, 94, 0.95), rgba(68, 68, 76, 0.95));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ==================== Progress Bar — 加粗+渐变色+交互增强 ==================== */
.progress-container {
  height: 6px;
  width: 100%;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
}

.progress-bg {
  height: 4px;
  background: var(--border-color, #e0e0e5);
  border-radius: 100px;
  overflow: hidden;
  transition: height 0.2s ease;
}

.progress-container:hover .progress-bg {
  height: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
  border-radius: 100px;
  transition: width 0.15s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 10px;
  height: 10px;
  background: #8b5cf6;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s ease;
}

.progress-container:hover .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

/* Playlist Panel */
.playlist-panel {
  position: absolute;
  bottom: 64px;
  left: 0;
  width: 280px;
  max-height: 400px;
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e8e8ec);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .playlist-panel {
  background: rgba(33, 33, 38, 0.96);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.07);
}

.playlist-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #f0f0f3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.playlist-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.playlist-items::-webkit-scrollbar {
  width: 4px;
}

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

.playlist-items li {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid transparent;
}

.playlist-items li:hover {
  background: rgba(100, 100, 115, 0.05);
}

.playlist-items li.active {
  background: rgba(99, 102, 241, 0.06);
}

.item-index {
  width: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.active .item-index {
  color: #8b5cf6;
  font-weight: 650;
}

.item-info {
  flex: 1;
  overflow: hidden;
}

.item-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 550;
}

.item-artist {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transitions */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: all 0.3s ease;
}
.fade-slide-enter-from,
.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(10px);
}

/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(220, 220, 225, 0.45);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 12px;
  min-width: 200px;
  color: #333;
  transform-origin: top left;
}

[data-theme="dark"] .context-menu {
  background: rgba(28, 28, 34, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f0f0f2;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.42);
}

.menu-header {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  color: #777;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.menu-item:last-child {
  margin-bottom: 0;
}

.menu-item label {
  font-size: 13px;
  font-weight: 500;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.value {
  font-size: 12px;
  color: #888;
  width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .value {
  color: #999;
}

/* Range Input */
input[type="range"] {
  width: 80px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--link-color, #333);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-top: -4px;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Color Input */
input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

/* 播放器移动端适配 */
@media (max-width: 600px) {
  .player-widget {
    max-width: calc(100vw - 24px);
    padding: 6px 10px 6px 7px;
  }

  .cover-wrapper {
    width: 42px;
    height: 42px;
  }

  .song-title {
    font-size: 12.5px;
    max-width: 100px;
  }

  .song-artist {
    font-size: 10.5px;
    max-width: 100px;
  }

  .icon-btn {
    width: 29px;
    height: 29px;
  }

  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  .icon-btn[title="Play/Pause"],
  .icon-btn.play-pause-main {
    width: 34px;
    height: 34px;
  }

  .controls {
    gap: 2px;
  }
}
