/* ============================================
   澄曜 · 音乐播放器 - 黑金配色主题
   ============================================ */

:root {
  --gold-50: #fefce8;
  --gold-300: #fbbf24;
  --true-gold: #C9A84D;
  --light-gold: #E5C87C;
  --dark-gold: #A6893A;
  --pale-gold: #F0DFB0;
  --glow-gold: rgba(201, 168, 77, 0.3);

  --black-50: #fafafa;
  --black-200: #e5e5e5;
  --black-300: #a3a3a3;
  --black-400: #737373;
  --black-500: #525252;
  --black-600: #2a2a2a;
  --black-700: #1a1a1a;
  --black-800: #0f0f0f;
  --black-900: #080808;
  --black-950: #020202;

  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Noto Serif SC', 'Georgia', serif;
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --bar-height: 80px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--black-950);
  color: var(--black-200);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================
   Layout
   ============================================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   侧边栏 - 播放列表
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--black-900);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--black-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.sidebar-close:hover {
  color: var(--black-200);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--black-400);
  margin-bottom: 12px;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--true-gold);
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--black-50);
  margin-bottom: 4px;
}

.sidebar-info {
  font-size: 12px;
  color: var(--black-400);
}

.sidebar-search {
  position: relative;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-search svg {
  position: absolute;
  left: 24px;
  color: var(--black-500);
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  color: var(--black-200);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.sidebar-search input::placeholder {
  color: var(--black-500);
}

.sidebar-search input:focus {
  border-color: rgba(201, 168, 77, 0.2);
}

.song-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
}

.song-list::-webkit-scrollbar {
  width: 4px;
}
.song-list::-webkit-scrollbar-track {
  background: transparent;
}
.song-list::-webkit-scrollbar-thumb {
  background: var(--black-600);
  border-radius: 2px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.song-item:hover {
  background: rgba(255,255,255,0.03);
}

.song-item.active {
  background: rgba(201, 168, 77, 0.08);
  border: 1px solid rgba(201, 168, 77, 0.12);
}

.song-item .song-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dark-gold);
  opacity: 0;
  flex-shrink: 0;
}

.song-item.active .song-dot {
  opacity: 1;
}

.song-item.active .song-name {
  color: var(--true-gold);
  font-weight: 600;
}

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

.song-item .song-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--black-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.song-item .song-item-time {
  font-size: 11px;
  color: var(--black-500);
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.load-local-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--black-400);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.load-local-btn:hover {
  border-color: rgba(201, 168, 77, 0.15);
  color: var(--black-200);
}

/* ============================================
   主内容区
   ============================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-y: auto;
  padding-bottom: var(--bar-height);
}

.main-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201, 168, 77, 0.06), transparent),
              radial-gradient(ellipse 50% 50% at 20% 80%, rgba(201, 168, 77, 0.03), transparent),
              radial-gradient(ellipse 50% 50% at 80% 80%, rgba(201, 168, 77, 0.03), transparent);
  transition: 1.5s ease;
}

/* ============================================
   顶部
   ============================================ */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(to bottom, var(--black-950) 60%, transparent);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--black-300);
  cursor: pointer;
  padding: 4px;
}

.platform-switch {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 2px;
}

.platform-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--black-400);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.platform-btn:hover {
  color: var(--black-200);
}

.platform-btn.active {
  background: var(--black-700);
  color: var(--true-gold);
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  color: var(--black-500);
  text-align: center;
  padding: 40px;
}

.empty-icon svg {
  opacity: 0.3;
}

.empty-state h3 {
  font-weight: 400;
  font-size: 18px;
  color: var(--black-400);
}

.empty-state p {
  font-size: 14px;
}

/* ============================================
   播放视图
   ============================================ */
.player-view {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 20px 24px 0;
  flex: 1;
  overflow: hidden;
}

/* 封面黑胶 */
.cover-section {
  position: relative;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.cover-wrapper {
  width: 240px;
  height: 240px;
  position: relative;
}

.cover-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: discSpin 20s linear infinite;
  animation-play-state: paused;
}

.cover-disc.playing {
  animation-play-state: running;
}

.disc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--black-700) 0deg, var(--black-600) 90deg,
    var(--black-700) 180deg, var(--black-600) 270deg, var(--black-700) 360deg
  );
  box-shadow:
    0 0 40px rgba(201, 168, 77, 0.08),
    0 0 80px rgba(201, 168, 77, 0.04);
}

.cover-image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--black-800);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}

.cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.disc-center {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--black-950);
  border: 2px solid var(--black-600);
  z-index: 2;
}

/* 歌曲信息 */
.song-info {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.song-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--black-50);
  margin-bottom: 4px;
  line-height: 1.2;
}

.song-artist {
  font-size: 14px;
  font-weight: 400;
  color: var(--black-400);
  margin-bottom: 8px;
}

.song-meta {
  font-size: 12px;
  color: var(--black-500);
}

/* 歌词 */
.lyrics-section {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lyrics-container {
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 8px 0;
}

.lyrics-container::-webkit-scrollbar {
  width: 2px;
}
.lyrics-container::-webkit-scrollbar-thumb {
  background: var(--black-600);
  border-radius: 1px;
}

.lyrics-scroll .lyric-line {
  text-align: center;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 400;
  color: var(--black-500);
  line-height: 1.7;
  transition: all 0.3s ease;
  cursor: default;
}

.lyrics-scroll .lyric-line.active {
  color: var(--true-gold);
  font-size: 17px;
  font-weight: 600;
  text-shadow: 0 0 20px rgba(201, 168, 77, 0.2);
}

.lyrics-scroll .lyric-line.empty {
  height: 2px;
  padding: 0;
  margin: 16px 0;
  background: rgba(255,255,255,0.02);
}

.lyrics-scroll .lyric-line.section-header {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--black-600);
  text-transform: uppercase;
  padding-top: 24px;
}

/* ============================================
   底部播放栏
   ============================================ */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bar-height);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.04);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding-left: var(--sidebar-width);
  transition: var(--transition);
}

/* 进度条 */
.bar-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  margin-top: -6px;
}

.time-current, .time-total {
  font-size: 11px;
  font-weight: 500;
  color: var(--black-500);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.time-total {
  text-align: right;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s ease;
}

.progress-track:hover {
  height: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--true-gold), var(--light-gold));
  border-radius: 2px;
  width: 0%;
  position: relative;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--light-gold);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s ease;
  box-shadow: 0 0 10px rgba(201, 168, 77, 0.4);
}

.progress-track:hover .progress-thumb {
  transform: translateY(-50%) scale(1);
}

/* 控制区 */
.bar-controls {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.bar-song-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  max-width: 260px;
}

.bar-cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--black-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.bar-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bar-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--black-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.ctrl-btn {
  background: none;
  border: none;
  color: var(--black-400);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ctrl-btn:hover {
  color: var(--black-100);
}

.ctrl-btn.active {
  color: var(--true-gold);
}

.play-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--true-gold), var(--dark-gold));
  border-radius: 50%;
  color: var(--black-900) !important;
  box-shadow: 0 4px 20px rgba(201, 168, 77, 0.2);
  transition: var(--transition-bounce);
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 30px rgba(201, 168, 77, 0.3);
}

.bar-extra {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  max-width: 200px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-track {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.volume-fill {
  height: 100%;
  background: var(--black-300);
  border-radius: 2px;
}

.volume-thumb {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--black-200);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.volume-track:hover .volume-thumb {
  opacity: 1;
}

/* ============================================
   动画
   ============================================ */
@keyframes discSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 499;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 500;
    width: 280px;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
  }

  .sidebar-close {
    display: flex;
  }

  .sidebar-toggle {
    display: flex;
  }

  .player-bar {
    padding-left: 0;
  }

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

  .cover-image {
    width: 108px;
    height: 108px;
  }

  .song-title {
    font-size: 22px;
  }

  .player-view {
    padding: 16px 16px 0;
  }

  .bar-controls {
    padding: 0 12px;
    gap: 8px;
  }

  .bar-extra .volume-control {
    display: none;
  }

  .bar-song-info {
    max-width: 120px;
  }

  .bar-play-controls {
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .bar-song-info {
    display: none;
  }

  .bar-controls {
    justify-content: center;
    gap: 0;
  }

  .bar-extra {
    display: none;
  }

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

  .cover-image {
    width: 96px;
    height: 96px;
  }

  .song-title {
    font-size: 20px;
  }
}
