@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1e1e1e;
  --bg-elevated: #181818;
  --bg-panel: #111111;
  --text: #e0e0e0;
  --text-secondary: #999;
  --accent: #1db954;
  --accent-hover: #1ed760;
  --heart: #e74c3c;
  --border: #282828;
  --radius: 8px;
  --radius-lg: 12px;
  /* Fluid: 44px@320 → 56px@1920 */
  --topbar-h: clamp(64px, 5.5vw, 84px);
  /* Fluid: 72px@320 → 120px@1920 */
  --player-h: clamp(72px, 9vw, 120px);
  --panel-min: clamp(56px, 5vw, 72px);
  --panel-open: 62vh;  /* expanded height */
  /* set in :root */
  --transition: 0.2s ease;
  --theme-transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  /* Fluid font sizes */
  --fs-xs: clamp(10px, 0.8vw, 12px);
  --fs-sm: clamp(11px, 0.9vw, 13px);
  --fs-md: clamp(13px, 1vw, 15px);
  --fs-lg: clamp(15px, 1.2vw, 20px);
  --fs-xl: clamp(18px, 1.5vw, 26px);
  /* Fluid spacing */
  --gap-xs: clamp(4px, 0.4vw, 8px);
  --gap-sm: clamp(6px, 0.6vw, 12px);
  --gap-md: clamp(10px, 1vw, 20px);
  --gap-lg: clamp(16px, 1.5vw, 28px);
}

/* ====== 亮色主题 ====== */
[data-theme="light"] {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-panel: #fafafa;
  --text: #1a1a2e;
  --text-secondary: #666;
  --accent: #1db954;
  --accent-hover: #17a349;
  --heart: #e74c3c;
  --border: #e0e0e0;
}
[data-theme="light"] .album-card { box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
[data-theme="light"] .album-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
[data-theme="light"] .player-bar { border-top-color: #d0d0d0; }
[data-theme="light"] .topbar { border-bottom-color: #d0d0d0; }
[data-theme="light"] .track-panel { border-top-color: #d0d0d0; }
[data-theme="light"] .song-list-header { border-bottom-color: #e0e0e0; }
[data-theme="light"] .song-item:hover { background: #f5f5f5; }
[data-theme="light"] .song-item.current { background: #e8f5e9; }
[data-theme="light"] .user-dropdown-trigger { background: #f0f0f0; border-color: #ddd; color: #333; }
[data-theme="light"] .user-dropdown-trigger:hover { background: #e5e5e5; }
[data-theme="light"] .user-dropdown-menu { background: #fff; border-color: #e0e0e0; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
[data-theme="light"] .dropdown-item:hover { background: #f5f5f5; }
[data-theme="light"] .nav-link.active { background: rgba(0,0,0,0.06); }
[data-theme="light"] .btn-login,
[data-theme="light"] .modal { background: #fff; border: 1px solid #e0e0e0; }
[data-theme="light"] .modal input,
[data-theme="light"] .modal select { background: #f5f5f5; border-color: #ddd; color: #333; }
[data-theme="light"] .toast { background: rgba(0,0,0,0.85); color: #fff; }
/* 封面懒加载骨架适配亮色 */
[data-theme="light"] .album-card-cover { background: #e8e8e8; }
[data-theme="light"] .album-card-cover.lazy-loading { background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%); background-size: 200% 100%; }

/* 全局过渡 */
body, .topbar, .player-bar, .track-panel, .album-card, .modal {
  transition: var(--theme-transition);
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', '微软雅黑', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  overflow: hidden; touch-action: manipulation;
  padding-bottom: var(--player-h);
}

/* === Topbar === */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 16px 48px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); z-index: 100;
  position: relative; min-height: 64px;
}
.topbar-brand { font-family: 'Ma Shan Zheng', -apple-system, sans-serif; font-size: 32px; font-weight: 400; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.version-tag { font-size: 10px; font-weight: 500; color: var(--accent); background: rgba(99,102,241,0.15); padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px; }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.topbar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.menu-toggle { display: none; }
.mobile-menu { display: none; }
.topbar-scroll { flex: 1; min-width: 0; }
.nav-link {
  padding: 8px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  color: var(--text-secondary); text-decoration: none;
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); transform: scale(1.05); }
.nav-link:active { transform: scale(0.95); }
.nav-link.active { color: var(--text); background: rgba(255,255,255,0.1); }
.nav-badge {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 5px; margin-left: 5px; border-radius: 9px;
  background: var(--heart, #ff4d6d); color: #fff; font-size: 10px; font-weight: 700;
  text-align: center; vertical-align: 2px;
}
.nav-dj { font-weight: 600; }
.nav-dj:hover { transform: scale(1.05); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* 搜索框 */
.search-box { position: relative; }
.search-box input {
  width: 220px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg-card); color: var(--text); font-size: 13px;
  outline: none; transition: width 0.2s, border-color 0.2s;
}
.search-box input:focus { width: 300px; border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-secondary); }
.search-results {
  position: absolute; top: 38px; right: 0; width: 400px; max-height: 420px;
  overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 999;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item .sri-cover {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
}
.search-result-item .sri-info { flex: 1; min-width: 0; }
.search-result-item .sri-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .sri-meta { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-no-results { padding: 20px; text-align: center; color: var(--text-secondary); font-size: 13px; }
@media (max-width: 768px) {
  .search-box input { width: 120px; font-size: 12px; }
  .search-box input:focus { width: 160px; }
  .search-results { width: calc(100vw - 20px); right: -60px; }
}

/* === Main: Album Grid === */
.main {
  overflow-y: auto; padding: 24px;
  position: relative; z-index: 1;
}
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--album-min-w, 180px), 1fr));
  gap: 20px;
  padding-bottom: calc(var(--panel-min) + 16px);
}
.album-card {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: 16px; cursor: pointer; transition: all var(--transition);
  position: relative;
}
.album-card:hover { background: var(--bg-hover); transform: translateY(-2px); }
.album-card.active { box-shadow: 0 0 0 2px var(--accent); }
.album-card-cover {
  width: 100%; aspect-ratio: 1/1;
  border-radius: var(--radius); overflow: hidden; touch-action: manipulation;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.album-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { font-size: 40px; opacity: 0.3; }
.album-card-name {
  font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; touch-action: manipulation; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.album-card-meta { font-size: 13px; color: var(--text-secondary); }
.album-listened-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%; width: 32px; height: 32px; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: all var(--transition);
  padding: 0; line-height: 1;
}
.album-listened-btn:hover { background: rgba(0,0,0,0.7); border-color: rgba(255,255,255,0.3); transform: scale(1.1); }
.ai-badge { display: inline-block; font-size: 11px; background: linear-gradient(135deg, #667eea22, #764ba222); border: 1px solid #667eea44; border-radius: 10px; padding: 1px 7px; margin-left: 2px; color: #667eea; white-space: nowrap; }
[data-theme="light"] .ai-badge { background: linear-gradient(135deg, #667eea18, #764ba218); }

/* Mix cards */

/* ============ GENRE CARDS ============ */
.genres-grid { display: flex; flex-direction: column; gap: clamp(12px, 1.5vw, 20px); padding-bottom: clamp(12px, 1.5vw, 20px); }
.genre-section { background: var(--bg-card); border-radius: var(--radius-lg); padding: clamp(10px, 1.2vw, 16px); }
.genre-header { display: flex; align-items: center; gap: clamp(6px, 0.8vw, 10px); margin-bottom: clamp(8px, 1vw, 14px); }
.genre-icon { font-size: clamp(22px, 2vw, 28px); }
.genre-title { font-size: clamp(14px, 1.2vw, 18px); font-weight: 700; color: var(--text); }
.genre-count { font-size: 13px; color: var(--text-secondary); margin-left: auto; }
.genre-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.genre-album-card {
  background: var(--bg-hover);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}
.genre-album-card:hover { background: var(--bg-elevated); transform: translateY(-2px); }
.genre-album-cover {
  width: 80px; height: 80px; border-radius: var(--radius);
  overflow: hidden; touch-action: manipulation; flex-shrink: 0;
  background: linear-gradient(135deg, #222, #333);
  display: flex; align-items: center; justify-content: center;
}
.genre-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.genre-album-name {
  font-size: 12px; color: var(--text-secondary);
  text-align: center; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; touch-action: manipulation; word-break: break-word;
}

/* === Track Panel (bottom drawer) === */
.track-panel {
  position: fixed; bottom: var(--player-h); left: 0; right: 0;
  height: var(--panel-open);
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  z-index: 50;
  display: flex; flex-direction: column;
  transform: translateY(calc(var(--panel-open) - var(--panel-min)));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.track-panel.open { transform: translateY(0); }

.track-panel-handle {
  height: var(--panel-min);
  min-height: var(--panel-min);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  -webkit-user-select: none; user-select: none;
}
.handle-bar {
  width: 48px; height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.track-panel-header {
  padding: 0 20px 12px;
  flex-shrink: 0;
}
.btn-back {
  background: none; border: none; color: var(--text-secondary);
  font-size: 16px; cursor: pointer; padding: 4px 8px;
  margin-left: -8px; margin-bottom: 8px;
}
.btn-back:hover { color: var(--text); }
.track-panel-album-info {
  display: flex; align-items: center; gap: 16px;
}
.track-panel-cover {
  width: clamp(42px, 5vw, 64px); height: clamp(42px, 5vw, 64px); aspect-ratio: 1/1;
  border-radius: 6px; overflow: hidden; touch-action: manipulation; flex-shrink: 0;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.track-panel-cover img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-cover-sm { font-size: 24px; opacity: 0.4; }
.track-panel-meta { min-width: 0; flex: 1; }
.track-panel-title-row { display: flex; align-items: center; gap: 6px; }
.track-panel-title-row h3 { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; touch-action: manipulation; text-overflow: ellipsis; min-width: 0; margin: 0; }
.track-panel-title-row .btn-icon-sm { opacity: 0.7; flex-shrink: 0; }
.track-panel-title-row .btn-icon-sm:hover { opacity: 1; }
.track-panel-title-row .btn-icon-sm.favorited { opacity: 1; }
.track-panel-meta p { font-size: 13px; color: var(--text-secondary); margin: 3px 0 8px; }
.track-panel-actions { display: flex; gap: 8px; }

.btn-primary-sm {
  background: var(--accent); border: none; color: #000;
  padding: 6px 16px; border-radius: 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-primary-sm:hover { background: var(--accent-hover); }
.btn-primary-sm:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary-sm {
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: var(--text); padding: 6px 16px; border-radius: 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary-sm:hover { border-color: var(--text); }
.btn-secondary-sm:disabled { opacity: 0.4; cursor: not-allowed; }

.track-panel-list-wrap {
  flex: 1; overflow-y: auto; padding: 0 8px 8px;
}

/* === Song List === */
.song-list-header {
  display: grid;
  grid-template-columns: 44px 1fr 56px 52px 96px;
  gap: 8px; padding: 6px 12px;
  font-size: 11px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-panel); z-index: 2;
  align-items: center;
}
.song-list-header .col-cb { display: flex; align-items: center; }
.song-list { padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.song-item {
  display: grid;
  grid-template-columns: 44px 1fr 56px 52px 96px;
  gap: 8px; padding: 8px 12px; align-items: center;
  border-radius: var(--radius); cursor: pointer;
  transition: background var(--transition);
  min-height: 52px;
}
.song-item:hover { background: var(--bg-hover); }
.song-item.current { background: rgba(29, 185, 84, 0.12); }
.song-item.current .col-title { color: var(--accent); font-weight: 600; }

/* col-num: number + play icon + checkbox stack */
.song-item .col-num {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px;
  position: relative; min-width: 44px; min-height: 36px;
}
.song-item .col-num .play-icon { display: none; }
.song-item.current .col-num .idx-num { display: none; }
.song-item.current .col-num .cb-song { display: none; }
.song-item.current .col-num .play-icon { display: inline; animation: pulse 0.8s ease infinite; }

/* col-main: title on top, artist below */
.song-item .col-main {
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
.song-item .col-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; line-height: 1.4;
  display: flex; align-items: center; gap: 6px;
}
.song-item .col-title .key-badge {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 10px;
  background: var(--accent); color: #fff;
  letter-spacing: 0.3px; white-space: nowrap;
}
.song-item .col-artist {
  font-size: 11px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; line-height: 1.3;
}
.song-item .col-bitrate { font-size: 11px; color: var(--text-secondary); text-align: center; }
.song-item .col-duration { font-size: 12px; color: var(--text-secondary); text-align: center; }
.song-item .col-actions { display: flex; gap: 2px; justify-content: flex-end; flex-shrink: 0; }

.btn-icon-sm {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 4px 5px; border-radius: 4px;
  transition: all var(--transition); opacity: 0.4;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon-sm:hover { opacity: 1; background: var(--bg-hover); }
.btn-icon-sm.favorited { opacity: 1; }

/* === Player Bar === */
.player-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px env(safe-area-inset-bottom, 0px); height: var(--player-h);
  background: var(--bg-card); border-top: 1px solid var(--border);
  z-index: 100; position: fixed; bottom: 0; left: 0; right: 0;
}
.player-cover {
  width: clamp(44px, 5.5vw, 72px); height: clamp(44px, 5.5vw, 72px); aspect-ratio: 1/1;
  border-radius: 4px; overflow: hidden; touch-action: manipulation; flex-shrink: 0;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-info {
  width: clamp(100px, 16vw, 260px); min-width: 0; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding-right: 8px;
}
.player-title { font-size: clamp(11px, 1vw, 15px); font-weight: 600; white-space: nowrap; overflow: hidden; touch-action: manipulation; text-overflow: ellipsis; line-height: 1.3; }
.player-artist { font-size: clamp(10px, 0.9vw, 13px); color: var(--text-secondary); white-space: nowrap; overflow: hidden; touch-action: manipulation; text-overflow: ellipsis; margin-top: 2px; }
.player-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.player-controls .mobile-queue-btn { display: none; } /* desktop: hidden, shown in player-right */
.player-progress { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.time { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; width: 34px; text-align: center; flex-shrink: 0; }
/* Old progress fill - replaced by waveform canvas */
.player-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.player-volume { display: flex; align-items: center; }
.volume-slider { width: 70px; accent-color: var(--accent); cursor: pointer; height: 4px; }

/* === Progress / Waveform === */
.progress-bar {
  flex: 1; height: clamp(48px, 8vw, 108px); background: transparent;
  border-radius: 2px; cursor: pointer; position: relative;
  min-width: 60px; overflow: hidden; touch-action: manipulation;
}
.progress-bar canvas {
  width: 100%; height: 100%; display: block;
  border-radius: 2px;
}
.cur_playing_bg { background: #1b4d2e !important; } /* hide old */
.btn-icon {
  background: none; border: none; color: var(--text-secondary);
  font-size: 18px; cursor: pointer; padding: 6px; border-radius: 50%;
  transition: all var(--transition); width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: var(--text); background: var(--bg-hover); }
.btn-play {
  background: #fff; border: none; color: #000;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
}
.btn-play:hover { transform: scale(1.07); }
.btn-primary {
  background: var(--accent); border: none; color: #000;
  padding: 10px 28px; border-radius: 24px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary {
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: var(--text); padding: 10px 28px; border-radius: 24px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--text); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.mode-btn.active { color: var(--accent); }

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); color: var(--text);
  padding: 10px 24px; border-radius: 20px;
  font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; }

/* Shortcut toast - centered, larger, faster */
.shortcut-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.9); color: #fff;
  padding: 12px 28px; border-radius: 24px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  opacity: 0; transition: opacity 0.15s; pointer-events: none; z-index: 1001;
}
.shortcut-toast.show { opacity: 1; }

/* Share guide overlay (desktop/HTTP fallback) */
.share-guide-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000; animation: fadeIn .15s;
}
.share-guide-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; width: 90%; max-width: 360px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp .2s;
}
.share-guide-cover {
  width: 120px; height: 120px; margin: 0 auto 12px;
  border-radius: 12px; overflow: hidden; background: var(--bg);
}
.share-guide-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.share-guide-title {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.share-guide-url {
  font-size: 11px; color: var(--text-muted); margin-bottom: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.share-guide-copy {
  width: 100%; padding: 12px; border: none; border-radius: 24px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .2s; margin-bottom: 10px;
}
.share-guide-copy:hover { opacity: 0.9; }
.share-guide-hint {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}
.share-guide-qr {
  margin: 12px auto 8px; padding: 10px; background: #fff; border-radius: 12px;
  display: inline-block;
}
.share-guide-qr canvas { display: block; }
.share-guide-poster-btn {
  width: 100%; padding: 12px; border: 2px solid var(--accent); color: var(--accent);
  border-radius: 24px; background: transparent; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s; margin-bottom: 10px;
}
.share-guide-poster-btn:hover { background: var(--accent); color: #fff; }
.share-guide-poster-overlay {
  position: fixed; inset: 0; z-index: 3100; background: rgba(0,0,0,0.85);
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 16px 30px;
  animation: fadeIn .15s;
}
.share-guide-poster-overlay img {
  width: auto; height: auto; max-width: 100%;
  border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  flex-shrink: 0;
}
.share-guide-poster-hint {
  color: #fff; font-size: 13px; margin-top: 16px; text-align: center; line-height: 1.7;
}
.share-guide-poster-close {
  margin-top: 14px; padding: 10px 26px; border: none; border-radius: 24px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.share-guide-close:hover { background: var(--bg-hover); color: var(--text); }

/* Shortcuts panel */
.shortcuts-panel { position: fixed; inset: 0; z-index: 2000; }
.shortcuts-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.shortcuts-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; width: 90%; max-width: 420px; max-height: 80vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp .2s;
}
.shortcuts-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.shortcuts-header h3 { margin: 0; font-size: 17px; }
.shortcuts-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.shortcuts-close:hover { background: var(--bg-hover); color: var(--text); }
.shortcuts-body { padding: 12px 20px; overflow-y: auto; flex: 1; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.shortcut-row:last-child { border: none; }
.shortcut-row span { font-size: 13px; color: var(--text); }
.shortcut-row kbd {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 7px; font-size: 11px; font-family: inherit;
  color: var(--accent); margin: 0 1px;
}
.shortcuts-footer {
  padding: 10px 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); text-align: center;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  z-index: 1000;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 28px; max-width: 400px; width: 90%; max-height: 80vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 12px; font-size: 18px; }
.modal h4 { margin-top: 16px; margin-bottom: 6px; font-size: 15px; color: var(--accent); }
.modal p { margin-bottom: 8px; }
.modal ul { margin-bottom: 12px; padding-left: 18px; }
.modal ul li { margin-bottom: 4px; font-size: 13px; color: var(--text-secondary); }
.modal .btn-primary, .modal .btn-secondary { margin-top: 12px; width: 100%; }
.page-modal { max-width: 560px !important; max-height: 78vh !important; }
.page-modal h3 { color: var(--accent); font-size: 20px; }
.page-modal p, .page-modal li { line-height: 1.7; }
.text-secondary { color: var(--text-secondary); font-size: 13px; }
.collection-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.collection-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg); border-radius: var(--radius);
  cursor: pointer; transition: background var(--transition);
}
.collection-item:hover { background: var(--bg-hover); }
.collection-item .col-name { font-size: 14px; }
.collection-item .col-count { font-size: 12px; color: var(--text-secondary); }
.collection-item .col-check { color: var(--accent); font-weight: bold; margin-left: 8px; }
.collection-new { display: flex; gap: 8px; margin-bottom: 8px; }
.collection-new input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius);
  font-size: 14px; outline: none;
}
.collection-new input:focus { border-color: var(--accent); }

.btn-download-all {
  background: linear-gradient(135deg, #f5af19, #f12711);
  border: none; color: #fff; padding: 6px 16px; border-radius: 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-download-all:hover { transform: scale(1.05); filter: brightness(1.1); }

.premium-features { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.pf-item {
  background: linear-gradient(135deg, rgba(245,175,25,0.15), rgba(241,39,17,0.1));
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.pf-item span { font-size: 18px; }

.col-card-del {
  position: absolute; top: 12px; right: 12px;
  opacity: 0; transition: opacity var(--transition);
  font-size: 16px; padding: 4px 6px;
}
.album-card:hover .col-card-del { opacity: 0.7; }
.album-card:hover .col-card-del:hover { opacity: 1; color: var(--heart); }

.loading, .empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
  font-size: 15px; grid-column: 1/-1;
}
.empty-state small { display: block; margin-top: 8px; font-size: 13px; opacity: 0.7; }

@keyframes spin { to { transform: rotate(360deg); } }
.refreshing { animation: spin 0.8s linear infinite; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* === Auth Modal === */
.auth-tabs { display: flex; gap: 0; margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; touch-action: manipulation; }
.auth-tab {
  flex: 1; padding: 10px; border: none; background: var(--bg);
  color: var(--text-secondary); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active { background: var(--accent); color: #000; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; outline: none;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-error { color: var(--heart); font-size: 13px; min-height: 18px; }

/* === User Area === */
.user-area { display: flex; align-items: center; gap: 8px; position: relative; }
.btn-login {
  background: var(--accent); border: none; color: #000;
  padding: 6px 14px; border-radius: 14px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.btn-login:hover { background: var(--accent-hover); }

/* === User Dropdown === */
.user-dropdown { position: relative; }
.user-dropdown-trigger {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); padding: 5px 10px; border-radius: 20px;
  cursor: pointer; font-size: 13px; transition: all var(--transition);
  font-family: inherit; white-space: nowrap;
}
.user-dropdown-trigger:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.user-avatar { font-size: 16px; line-height: 1; }
.user-name { font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-arrow { font-size: 10px; color: var(--text-secondary); transition: transform 0.2s; }

.user-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 180px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000; overflow: hidden;
  animation: dropdownIn 0.15s ease-out;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown-user-info {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
}
.dropdown-avatar { font-size: 24px; line-height: 1; }
.dropdown-user-detail { display: flex; flex-direction: column; gap: 2px; }
.dropdown-username { font-weight: 700; font-size: 14px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 0; }
.dropdown-item { color: #f0f0f0; 
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; color: #f0f0f0;
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background 0.1s; text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }

.role-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 8px;
  font-weight: 700; text-transform: uppercase;
}
.role-admin { background: #e74c3c; color: #fff; }
.role-vip { background: #f5af19; color: #000; }
.role-user { background: var(--border); color: var(--text-secondary); }

/* === About Dropdown === */
.about-dropdown { position: relative; }
.about-dropdown-trigger {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary); padding: 5px 10px; border-radius: 20px;
  cursor: pointer; font-size: 14px; transition: all 0.2s;
  font-family: inherit; white-space: nowrap;
}
.about-dropdown-trigger:hover {
  color: var(--text); background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
}
[data-theme="light"] .about-dropdown-trigger { background: #f0f0f0; border-color: #ddd; color: #666; }
[data-theme="light"] .about-dropdown-trigger:hover { background: #e5e5e5; color: #333; }
.about-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: auto; right: 0;
  width: 200px; min-width: 140px;
  background: rgba(20,20,20,0.85);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000; overflow: hidden;
  animation: dropdownIn 0.15s ease-out;
}
[data-theme="light"] .about-dropdown-menu { background: #fff; border-color: #e0e0e0; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.about-dropdown-menu .dropdown-item { color: #f0f0f0; 
  text-decoration: none;
}

/* === Admin Panel === */
.admin-user-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.admin-user-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg); border-radius: var(--radius);
}
.admin-user-item .uinfo { font-size: 13px; }
.admin-user-item .uinfo .uname { font-weight: 600; }
.admin-user-item .uinfo .udate { font-size: 11px; color: var(--text-secondary); }
.admin-user-actions { display: flex; gap: 4px; }
.admin-user-actions select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 4px 8px; border-radius: 4px; font-size: 12px;
}
.admin-user-actions .btn-del {
  background: none; border: none; color: var(--heart); cursor: pointer; font-size: 14px;
}
.admin-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.admin-tab-btn { background: none; border: none; color: var(--text-secondary); padding: 6px 14px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 13px; font-family: inherit; }
.admin-tab-btn.active { color: var(--accent); background: var(--bg-card); font-weight: 600; }
.admin-tab-btn:hover:not(.active) { color: var(--text); }
.admin-points-log-item { padding: 8px 10px; border-bottom: 1px solid var(--border-color); font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.admin-points-log-item .log-info { display: flex; flex-direction: column; gap: 2px; }
.admin-points-log-item .log-user { font-weight: 600; font-size: 13px; }
.admin-points-log-item .log-reason { color: var(--text-secondary); font-size: 11px; }
.admin-points-log-item .log-change.positive { color: #28a745; }
.admin-points-log-item .log-change.negative { color: var(--heart); }
.admin-points-log-item .log-time { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

/* ============ RESPONSIVE ============ */

/* === Tablet Portrait (641-1024px) === */
@media (min-width: 641px) and (max-width: 1024px) {
  :root { --topbar-h: 74px; --player-h: 88px; }

  /* Topbar - dropdown hamburger menu (like mobile) */
  .topbar {
    padding: 0 10px; gap: 6px;
    overflow: visible;
  }
  .topbar-left { gap: 6px; flex-shrink: 0; }
  .topbar-brand { font-size: 24px; }
  .topbar-brand img { width: 36px !important; height: 36px !important; }
  .version-tag { font-size: 8px; padding: 1px 4px; }

  /* Hamburger button */
  .menu-toggle {
    display: flex !important; align-items: center; justify-content: center;
    background: none; border: none; color: #f0f0f0;
    font-size: 20px; cursor: pointer; padding: 4px 8px;
    flex-shrink: 0; line-height: 1; z-index: 10;
    -webkit-tap-highlight-color: transparent;
  }
  /* Hide scrollable nav, show dropdown instead */
  .topbar-scroll { display: none; }

  /* Dropdown menu */
  .mobile-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    padding: 6px 10px;
    gap: 2px;
    z-index: 200;
  }
  .mobile-menu.open { display: flex; }
  .mobile-nav-link {
    display: block; padding: 11px 14px;
    font-size: 14px; font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
  }
  .mobile-nav-link:hover, .mobile-nav-link:active { background: var(--bg-hover); color: #fff; }
  .mobile-nav-link.active { color: #fff; background: rgba(255,255,255,0.12); }

  .topbar-actions { gap: 6px; flex-shrink: 0; margin-left: auto; }
  .btn-login { font-size: 11px; padding: 5px 10px; }

  /* about dropdown on tablet */
  .about-dropdown-menu { left: auto; right: 0; }

  /* Main - responsive auto-fill grid */
  .main { padding: 12px; overflow-x: hidden; max-width: 100vw; }
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 10px;
    max-width: 100%;
  }
  .album-card { padding: 8px; overflow: visible; }
  .album-card-name { font-size: 12px; white-space: normal; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .album-card-meta { font-size: 10px; }
  .album-card-cover { margin-bottom: 8px; border-radius: 6px; }

  .genre-albums {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
  .genre-album-cover { width: 56px; height: 56px; }
  .genre-album-name { font-size: 11px; }

  /* Track panel */
  .track-panel-cover { width: 48px; height: 48px; }
  .track-panel-title-row h3 { font-size: 15px; }
  .song-list-header, .song-item {
    grid-template-columns: 36px 1fr 46px 44px 82px;
    gap: 4px; padding: 8px 10px;
    min-height: 50px;
  }
  .song-item .col-title { font-size: 12px; }
  .song-item .col-artist { font-size: 10px; }
  .btn-icon-sm { font-size: 13px; padding: 4px; min-width: 30px; min-height: 30px; }

  /* Player - two-layer layout */
  .player-bar {
    flex-wrap: wrap;
    padding: 3px 12px 12px;
    gap: 2px 10px;
    height: auto;
    min-height: var(--player-h);
    align-content: center;
  }
  /* Layer 1: cover + info + like + controls */
  .player-cover { width: 46px; height: 46px; border-radius: 5px; flex-shrink: 0; }
  .player-info { flex: 1; min-width: 100px; max-width: 300px; }
  .player-title { font-size: 13px; line-height: 1.2; }
  .player-artist { font-size: 11px; }
  #playerLikeBtn { font-size: 15px; padding: 4px; flex-shrink: 0; }
  .player-controls { gap: 4px; flex-shrink: 0; }
  .btn-icon { font-size: 16px; width: 34px; height: 34px; padding: 4px; }
  .btn-play { width: 36px; height: 36px; font-size: 14px; }
  /* Show only queue button on mobile */
  .player-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-width: auto; }
  .player-right #loopBtn,
  .player-right #downloadBtn,
  .player-right #shortcutsHint,
  .player-right .player-volume { display: none; }
  .player-controls .mobile-queue-btn { display: inline-flex; font-size: 16px; width: 34px; height: 34px; padding: 4px; flex-shrink: 0; }
  /* Layer 2: progress bar full width */
  .player-progress {
    flex-basis: 100%;
    gap: 6px;
    padding: 2px 0 0;
  }
  .time { font-size: 11px; width: 30px; }
  .progress-bar { height: 48px; min-width: 80px; }

  /* Modals */
  .modal { max-width: 440px; }

  /* Toast */
  .toast { bottom: 80px; }
}

/* === Mobile (≤640px) === */
@media (max-width: 640px) {
  :root { --topbar-h: 66px; --player-h: 80px; }

  /* Topbar - hamburger menu */
  .topbar {
    display: flex; align-items: center; gap: 0;
    padding: 0 8px;
    overflow: visible;
  }
  .topbar-left { gap: 4px; }
  .topbar-brand img { width: 32px !important; height: 32px !important; }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: #f0f0f0;
    font-size: 22px; cursor: pointer; padding: 4px 6px;
    flex-shrink: 0; line-height: 1;
    position: relative; z-index: 10;
    -webkit-tap-highlight-color: transparent;
  }
  .topbar-scroll { display: none; }
  .topbar-brand { font-size: 22px; flex-shrink: 0; }
  .topbar-brand .version-tag { display: none; }
  .topbar-actions {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0; margin-left: auto;
    background: linear-gradient(to right, transparent 0%, var(--bg-card) 10px);
    padding-left: 10px;
  }

  /* Mobile dropdown menu */
  .mobile-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    gap: 2px;
    z-index: 200;
  }
  .mobile-menu.open { display: flex; }
  .mobile-nav-link {
    display: block; padding: 12px 14px;
    font-size: 15px; font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
  }
  .mobile-nav-link:hover, .mobile-nav-link:active { background: var(--bg-hover); color: #fff; }
  .mobile-nav-link.active { color: #fff; background: rgba(255,255,255,0.12); }

  /* about dropdown - align right on mobile */
  .about-dropdown-menu { left: auto; right: 0; }

  /* Albums - responsive grid */
  .main { padding: 8px; overflow-x: hidden; max-width: 100vw; }
  .albums-grid { grid-template-columns: repeat(var(--album-cols-mobile, 2), 1fr); gap: 8px; max-width: 100%; }
  .album-card { padding: 8px; border-radius: var(--radius); min-width: 0; overflow: hidden; }
  .album-card-name { font-size: 11px; white-space: normal; overflow-wrap: break-word; }
  .album-card-meta { font-size: 10px; }
  .album-card-cover { margin-bottom: 8px; border-radius: 6px; }

  .genre-section-title { font-size: 16px; }
  .genre-section-name { font-size: 13px; }
  .genre-albums { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
  .genre-album-card { padding: 8px; border-radius: var(--radius); }
  .genre-album-cover { width: 52px; height: 52px; border-radius: 6px; }
  .genre-album-name { font-size: 10px; }
  .genre-album-count { font-size: 10px; }

  /* Track panel - not full screen */
  .track-panel { --panel-open: 75vh; border-radius: 14px 14px 0 0; }
  .track-panel-header { padding: 4px 10px 8px; }
  .btn-back { font-size: 18px; padding: 8px 12px; margin-bottom: 4px; }
  .track-panel-album-info { gap: 10px; }
  .track-panel-cover { width: 42px; height: 42px; }
  .track-panel-title-row h3 { font-size: 14px; }
  .track-panel-meta p { font-size: 11px; }
  .track-panel-list-wrap { padding: 0 4px 4px; }

  /* Song list - compact two-line layout */
  .song-list-header, .song-item {
    grid-template-columns: 32px 1fr 38px 64px;
    gap: 4px 6px; padding: 8px; min-height: 48px;
  }
  .song-list-header .col-bitrate,
  .col-bitrate { display: none; }
  .song-item .col-title { font-size: 12px; font-weight: 500; }
  .song-item .col-artist { font-size: 10px; }
  .song-item .col-num { grid-row: 1 / 3; align-self: center; }
  .song-item .col-main { grid-row: 1 / 3; align-self: center; }
  .song-item .col-duration { grid-row: 1 / 3; align-self: center; text-align: center; font-size: 10px; }
  .song-item .col-actions { grid-row: 1 / 3; align-self: center; gap: 0; }
  .btn-icon-sm { font-size: 13px; padding: 5px; min-width: 32px; min-height: 32px; }

  /* Player - two-layer layout */
  .player-bar {
    flex-wrap: wrap;
    padding: 4px 10px 12px;
    gap: 2px 8px;
    height: auto;
    min-height: 88px;
    align-content: center;
  }
  /* Layer 1: cover + info (flexible) + like/controls (right-aligned) */
  .player-cover { width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0; }
  .player-info { flex: 1; min-width: 60px; }
  .player-title { font-size: 12px; line-height: 1.2; }
  .player-artist { font-size: 10px; }
  #playerLikeBtn { font-size: 15px; padding: 4px; flex-shrink: 0; margin-left: auto; }
  .player-controls { gap: 4px; }
  .btn-icon { font-size: 17px; width: 34px; height: 34px; padding: 4px; }
  .btn-play { width: 36px; height: 36px; font-size: 14px; }
  /* Show only queue button on mobile */
  .player-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-width: auto; }
  .player-right #loopBtn,
  .player-right #downloadBtn,
  .player-right #shortcutsHint,
  .player-right .player-volume { display: none; }
  .player-controls .mobile-queue-btn { display: inline-flex; font-size: 17px; width: 34px; height: 34px; padding: 4px; flex-shrink: 0; }
  /* Layer 2: progress bar full width */
  .player-progress {
    flex-basis: 100%;
    gap: 4px;
    padding: 2px 0 0;
  }
  .time { font-size: 10px; width: 28px; }
  .progress-bar { height: 44px; min-width: 60px; }

  /* Modals */
  .modal { max-width: 100%; margin: auto 0 0 0; padding: 20px; border-radius: 14px 14px 0 0; width: 100%; }
  .modal-overlay { align-items: flex-end; }
  .modal h3 { font-size: 16px; }
  .auth-form input, .collection-new input { font-size: 16px; padding: 12px 14px; } /* prevent iOS zoom */

  /* User area */
  .user-area { flex-shrink: 0; }
  .btn-login { font-size: 12px; padding: 6px 12px; flex-shrink: 0; }

  /* Action buttons */
  .btn-download-all { font-size: 11px; padding: 5px 14px; }
  .btn-primary-sm, .btn-secondary-sm { font-size: 12px; padding: 6px 14px; border-radius: 18px; }
}

/* === Small Phones (≤400px) === */
@media (max-width: 400px) {
  :root { --topbar-h: 52px; --player-h: 72px; }

  .topbar { padding: 0 6px; gap: 3px; overflow: visible; }
  .topbar-brand { font-size: 18px; }
  .nav-link { padding: 6px 10px; font-size: 11px; border-radius: 14px; }
  .nav-link:hover { transform: scale(1.05); }
  .nav-link:active { transform: scale(0.95); }
  .nav-dj { font-weight: 600; }
  .nav-dj:hover { transform: scale(1.05); }
  .user-area { gap: 4px; }
  .btn-login { font-size: 10px; padding: 5px 10px; flex-shrink: 0; }

  .main { padding: 6px; }
  .albums-grid { grid-template-columns: repeat(var(--album-cols-mobile, 2), 1fr); gap: 6px; max-width: 100%; }
  .album-card { padding: 8px; min-width: 0; overflow: hidden; }
  .album-card-name { font-size: 11px; white-space: normal; overflow-wrap: break-word; }
  .album-card-meta { font-size: 10px; }

  .genre-albums { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .genre-album-cover { width: 48px; height: 48px; }
  .genre-album-name { font-size: 10px; }

  .track-panel { --panel-open: 78vh; }
  .track-panel-cover { width: 36px; height: 36px; }
  .track-panel-title-row h3 { font-size: 13px; }
  .btn-primary-sm, .btn-secondary-sm { font-size: 11px; padding: 5px 12px; }

  /* Song list - ultra compact two-line layout */
  .song-list-header, .song-item {
    grid-template-columns: 28px 1fr 56px;
    gap: 2px 4px; padding: 7px 6px; min-height: 46px;
  }
  .song-list-header .col-bitrate,
  .song-list-header .col-duration,
  .col-bitrate,
  .col-duration { display: none; }
  .song-item .col-title { font-size: 11px; }
  .song-item .col-artist { font-size: 9px; }
  .song-item .col-num { grid-row: 1 / 3; align-self: center; }
  .song-item .col-main { grid-row: 1 / 3; align-self: center; }
  .song-item .col-actions { grid-row: 1 / 3; align-self: center; gap: 0; }
  .btn-icon-sm { font-size: 12px; padding: 4px; min-width: 28px; min-height: 28px; }

  /* Player - two-layer compact */
  .player-bar { padding: 3px 8px 12px; gap: 1px 6px; min-height: 78px; }
  .player-cover { width: 36px; height: 36px; border-radius: 4px; display: flex; }
  .player-info { flex: 1; min-width: 40px; }
  .player-title { font-size: 10px; }
  .player-artist { font-size: 9px; }
  .player-controls { gap: 2px; }
  .btn-icon { font-size: 14px; width: 28px; height: 28px; padding: 3px; }
  .btn-play { width: 30px; height: 30px; font-size: 12px; }
  #playerLikeBtn { font-size: 13px; padding: 2px; margin-left: auto; }
  /* Show only queue button on touch devices */
  .player-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; min-width: auto; }
  .player-right #loopBtn,
  .player-right #downloadBtn,
  .player-right #shortcutsHint,
  .player-right .player-volume { display: none; }
  .player-controls .mobile-queue-btn { display: inline-flex; font-size: 14px; width: 28px; height: 28px; padding: 3px; flex-shrink: 0; }
  .player-progress { gap: 2px; padding: 1px 0 0; }
  .time { font-size: 9px; width: 24px; }
  .progress-bar { height: 36px; min-width: 24px; }

  /* Toast */
  .toast { bottom: 60px; font-size: 12px; padding: 8px 16px; }
}

/* === Touch-aware tweaks === */
@media (hover: none) and (pointer: coarse) {
  .btn-icon-sm { opacity: 0.7; }
  .btn-icon:hover { background: transparent; }
  .song-item:hover { background: transparent; }
  .album-card:hover { background: var(--bg-elevated); transform: none; }
  .col-card-del { opacity: 0.7; }
  .topbar { scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  /* Ripple effect on touch */
  .album-card:active { transform: scale(0.97); transition: transform 0.1s; }
  .song-item:active { background: var(--bg-hover); }
}

/* === iOS safe areas === */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .player-bar { height: auto; min-height: var(--player-h); }
  .track-panel { padding-bottom: env(safe-area-inset-bottom); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ============ QUEUE PANEL ============ */
.queue-panel {
  position: fixed; bottom: var(--player-h); left: 0; right: 0; z-index: 99;
  max-height: 55vh; overflow-y: auto;
  background: var(--bg-card); border-top: 1px solid var(--border);
  transform: translateY(100%); transition: transform 0.25s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.queue-panel.open { transform: translateY(0); }
.queue-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.queue-empty { padding: 30px 16px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.queue-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
  user-select: none;
}
.queue-item:hover { background: var(--bg-hover); }
.queue-item.current { background: rgba(var(--accent-rgb,103,58,183),0.15); }
.queue-item.dragging { opacity: 0.5; }
.qi-index { width: 28px; text-align: center; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.qi-name { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-artist { width: 100px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.has-queue { color: var(--accent); }
#playerQueueBtn { position: relative; }
#playerQueueBtn::after {
  content: attr(data-count);
  position: absolute; top: -2px; right: -4px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px;
  border-radius: 8px; text-align: center; padding: 0 4px;
}
#playerQueueBtn[data-count=""]::after { display: none; }
.qi-up, .qi-down, .qi-del { opacity: 0.7 !important; font-size: 15px; padding: 4px 6px; min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.qi-up:hover, .qi-down:hover { opacity: 1 !important; background: var(--accent); color: #fff; }
.qi-del:hover { opacity: 1 !important; background: #dc3545; color: #fff; }
@media (max-width: 768px) {
  .queue-item { padding: 8px 12px; }
  /* .qi-artist hidden on mobile */
  .queue-panel { max-height: 50vh; }
}

/* === Lazy Cover Loading === */
.album-card {
  content-visibility: auto;
  contain-intrinsic-size: 220px;
}
.album-card-cover {
  background: var(--bg-hover);
  position: relative;
  overflow: hidden;
}
.album-card-cover img {
  opacity: 0;
  transition: opacity 0.4s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-card-cover img.lazy-loaded {
  opacity: 1;
}
.album-card-cover .card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: var(--bg-hover);
  transition: opacity 0.3s;
}
/* shimmer skeleton while loading */
.album-card-cover.lazy-loading {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
/* genre grid albums */
.genre-album-card {
  content-visibility: auto;
  contain-intrinsic-size: 72px;
}
.genre-album-cover img {
  opacity: 0;
  transition: opacity 0.3s;
}
.genre-album-cover img.lazy-loaded {
  opacity: 1;
}
.genre-album-cover {
  background: var(--bg-hover);
}
/* Ensure content-visibility doesn't break within the genre sections */
.genre-section {
  content-visibility: auto;
  contain-intrinsic-size: 280px;
}
@media (max-width: 640px) {
  .album-card { contain-intrinsic-size: 180px; }
  .genre-section { contain-intrinsic-size: 240px; }
}

/* === Playlist Cards === */
.pl-card { position:relative; }
.pl-card .pl-actions { position:absolute; top:6px; right:6px; display:flex; gap:4px; opacity:0; transition:opacity 0.15s; z-index:2; }
.pl-card:hover .pl-actions { opacity:1; }
.pl-card .pl-actions .btn-icon-sm { background:rgba(0,0,0,0.5); border-radius:50%; padding:4px; font-size:12px; opacity:1; }

/* === Playlist Edit Song Items === */
.pes-item { display:flex; align-items:center; padding:8px 12px; gap:8px; border-bottom:1px solid rgba(255,255,255,0.04); }
.pes-item:hover { background:var(--bg-hover); }
.pes-item .pes-num { width:24px; text-align:center; flex-shrink:0; font-size:12px; color:var(--text-secondary); }
.pes-item .pes-title { flex:1; font-size:13px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pes-item .pes-artist { font-size:11px; color:var(--text-secondary); max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pes-item .btn { flex-shrink:0; }

/* === Toggle === */
.toggle-wrap { display:flex; align-items:center; gap:10px; margin:8px 0; }
.toggle-label { font-size:13px; color:var(--text); }
.toggle { position:relative; width:44px; height:24px; background:var(--border); border-radius:12px; cursor:pointer; transition:background 0.2s; flex-shrink:0; }
.toggle.on { background:var(--accent); }
.toggle::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; background:#fff; border-radius:50%; transition:transform 0.2s; }
.toggle.on::after { transform:translateX(20px); }

@media (max-width:640px) {
  .pes-item .pes-artist { display:none; }
}

/* === Modal Forms === */
.form-group { margin-bottom: 12px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 14px; font-family: inherit;
}
.form-group input:focus { border-color: var(--accent); outline: none; }

.modal-wide { max-width: 560px !important; }
@media (max-width: 640px) {
  .modal-wide { max-width: 100% !important; border-radius: 14px 14px 0 0; }
}

/* === Buttons (shared) === */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s; font-family: inherit;
}
.btn-primary {
  background: var(--accent); color: #000;
  padding: 10px 24px; border-radius: 20px; font-size: 14px;
  font-weight: 700; cursor: pointer; border: none;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 10px 24px; border-radius: 20px;
  font-size: 14px; cursor: pointer;
}
.btn-outline:hover { background: var(--bg-hover); }
.btn-danger { background: transparent; color: var(--heart); border: 1px solid var(--heart); }
.btn-danger:hover { background: var(--heart); color: #fff; }
.btn-xs { padding: 3px 10px; font-size: 11px; border-radius: 12px; }

/* === Msg === */
.msg { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; display: none; }
.msg-success { background: rgba(34,197,94,0.12); color: #22c55e; display: block; }
.msg-error { background: rgba(239,68,68,0.12); color: #ef4444; display: block; }

.col-section-title { font-size: 11px; text-transform: uppercase; color: var(--text-secondary); padding: 8px 4px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
.col-section-title:first-child { border-top: none; margin-top: 0; }

.pl-section-title { grid-column: 1/-1; font-size: 16px; font-weight: 700; color: var(--text-primary); margin-top: 22px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); display: flex; align-items: center; gap: 8px; }
.pl-section-title:first-of-type { margin-top: 4px; }
.pl-section-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; }

.collection-new { border-top: 1px solid var(--border); }

/* === Edit checkboxes === */
.pes-item input[type="checkbox"] { width:16px; height:16px; accent-color: var(--accent); margin-right: 4px; flex-shrink:0; cursor:pointer; }
.pl-song-cb { margin: 0; }
#plSelectCount { margin-left: auto; }

/* === Album filter chips === */
.pl-chip {
  display: inline-block; padding: 4px 10px; border-radius: 14px;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
  background: var(--bg); color: var(--text-secondary); white-space: nowrap;
}
.pl-chip:hover { background: var(--bg-hover); }
.pl-chip.active { background: var(--accent); color: #000; font-weight: 600; }

/* === Playlist === */
.pl-card { position:relative; }
.pl-card .pl-actions { position:absolute; top:6px; right:6px; display:flex; gap:4px; opacity:0; transition:opacity 0.15s; z-index:2; }
.pl-card:hover .pl-actions { opacity:1; }
.pl-card .pl-actions .btn-icon-sm { background:rgba(0,0,0,0.5); border-radius:50%; padding:4px; font-size:12px; }
.pes-item { display:flex; align-items:center; padding:8px 12px; gap:8px; border-bottom:1px solid rgba(255,255,255,0.04); }
.pes-item:hover { background:var(--bg-hover); }
.pes-item .pes-num { width:24px; text-align:center; flex-shrink:0; font-size:12px; color:var(--text-secondary); }
.pes-item .pes-title { flex:1; font-size:13px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pes-item .pes-artist { font-size:11px; color:var(--text-secondary); max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pes-item .btn { flex-shrink:0; }
.toggle-wrap { display:flex; align-items:center; gap:10px; margin:8px 0; }
.toggle-label { font-size:13px; color:var(--text); }
.toggle { position:relative; width:44px; height:24px; background:var(--border); border-radius:12px; cursor:pointer; transition:background 0.2s; flex-shrink:0; }
.toggle.on { background:var(--accent); }
.toggle::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; background:#fff; border-radius:50%; transition:transform 0.2s; }
.toggle.on::after { transform:translateX(20px); }
/* ============ 我的喜欢（收藏网格） ============ */
.fav-toolbar {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  padding: 6px 2px 2px; margin-bottom: 4px;
}
.fav-toolbar-info { font-size:16px; font-weight:700; color:var(--text-primary); display:flex; align-items:center; gap:8px; }
.fav-count { font-size:12px; font-weight:600; color:var(--text-secondary); background:var(--bg-elevated); border:1px solid var(--border); border-radius:10px; padding:1px 8px; }
.fav-toolbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.fav-sort-sel { background:var(--bg-card); color:var(--text); border:1px solid var(--border); padding:5px 10px; border-radius:6px; font-size:13px; }
.fav-card {
  position:relative; background:var(--bg-elevated); border-radius:var(--radius-lg);
  padding:16px; cursor:pointer; transition:all var(--transition);
}
.fav-card:hover { background:var(--bg-hover); transform:translateY(-2px); }
.fav-card .album-card-cover { margin-bottom:10px; }
.fav-heart {
  position:absolute; top:22px; right:22px; z-index:3;
  width:34px; height:34px; border-radius:50%; border:1px solid rgba(255,255,255,0.15);
  background:rgba(0,0,0,0.55); backdrop-filter:blur(4px);
  font-size:16px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all var(--transition);
}
.fav-heart:hover { transform:scale(1.15); background:rgba(255,77,109,0.25); border-color:rgba(255,77,109,0.5); }
.fav-artist { font-size:12px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:4px; }
.fav-meta { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--text-secondary); flex-wrap:wrap; }
.fav-added { opacity:0.75; }
.fav-key { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:1px 6px; font-size:10px; }
.btn-active { background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; }
.fav-album-card .album-card-meta { display:flex; align-items:center; gap:6px; }
.fav-list-wrap {
  border:1px solid var(--border); border-radius:var(--radius); overflow:hidden;
  background:var(--bg-panel);
}
.fav-list-header {
  grid-template-columns:44px 1fr 56px 52px 96px;
  position:static; background:var(--bg-panel);
}
.fav-list-header .col-cb { display:flex; align-items:center; }
.fav-batch-bar {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  padding:10px 14px; border-top:1px solid var(--border); background:var(--bg-panel);
  font-size:13px; color:var(--text-secondary);
}
.fav-batch-actions { display:flex; gap:8px; }
.song-item.selected { background:rgba(29,185,84,0.08); }

/* Status badges on album cards */
.fav-status-badge {
  display:inline-flex;align-items:center;gap:2px;font-size:11px;
  padding:1px 6px;border-radius:8px;font-weight:600;vertical-align:middle;
}
.status-listened { color:#28a745;background:rgba(40,167,69,0.12); }
.status-collected { color:#17a2b8;background:rgba(23,162,184,0.12); }

/* Album batch management section */
.fav-album-batch-section { grid-column:1/-1;margin-bottom:16px; }
.fav-album-row {
  display:flex;align-items:center;justify-content:space-between;
  padding:6px 10px;border-radius:8px;margin-bottom:2px;
  transition:background 0.15s;
}
.fav-album-row:hover { background:var(--bg-hover); }
.fav-album-name {
  font-size:13px;font-weight:500;flex:1;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.fav-album-actions { display:flex;gap:4px;flex-shrink:0; }
.fav-album-tag {
  font-size:10px;font-weight:600;padding:1px 5px;border-radius:6px;margin-left:4px;
}
.fav-album-tag.status-listened { color:#28a745;background:rgba(40,167,69,0.15); }
.fav-album-tag.status-collected { color:#17a2b8;background:rgba(23,162,184,0.15); }
.btn-mini {
  padding:2px 6px;font-size:12px;border:1px solid var(--border);border-radius:6px;
  background:var(--bg-card);color:var(--text-secondary);cursor:pointer;
  transition:all 0.15s;
}
.btn-mini:hover { background:var(--bg-hover);color:var(--text);border-color:var(--accent); }

/* Status filter buttons */
.fav-toolbar-actions .btn-secondary-sm:not(.btn-active):hover {
  background:var(--bg-hover);
}

@media (max-width:768px) {
  .fav-album-row { flex-wrap:wrap;gap:4px; }
  .fav-album-name { font-size:12px; }
  .fav-album-actions { width:100%;justify-content:flex-end; }
}
@media (max-width:768px) {
  .fav-list-header, .fav-list-header .song-item { }
  .fav-list-header .col-bitrate, .fav-list-header .col-actions { }
}
.form-group { margin-bottom:12px; }
.form-group input { width:100%; padding:10px 12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); color:var(--text); font-size:14px; font-family:inherit; }
.form-group input:focus { border-color:var(--accent); outline:none; }
.modal-wide { max-width:560px !important; }
@media (max-width:640px) {
  .modal-wide { max-width:100% !important; border-radius:14px 14px 0 0; }
  .pes-item .pes-artist { display:none; }
}
.btn { display:inline-flex; align-items:center; gap:4px; padding:6px 14px; border-radius:var(--radius); font-size:13px; font-weight:600; cursor:pointer; border:none; transition:all 0.15s; font-family:inherit; }
.btn-primary { background:var(--accent); color:#000; padding:10px 24px; border-radius:20px; font-size:14px; font-weight:700; cursor:pointer; border:none; }
.btn-primary:hover { background:var(--accent-hover); }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text); padding:10px 24px; border-radius:20px; font-size:14px; cursor:pointer; }
.btn-outline:hover { background:var(--bg-hover); }
.btn-danger { background:transparent; color:var(--heart); border:1px solid var(--heart); }
.btn-danger:hover { background:var(--heart); color:#fff; }
.btn-xs { padding:3px 10px; font-size:11px; border-radius:12px; }
.msg { padding:10px 14px; border-radius:var(--radius); font-size:13px; margin-bottom:12px; display:none; }
.msg-success { background:rgba(34,197,94,0.12); color:#22c55e; display:block; }
.msg-error { background:rgba(239,68,68,0.12); color:#ef4444; display:block; }
.col-section-title { font-size:11px; text-transform:uppercase; color:var(--text-secondary); padding:8px 4px 4px; border-top:1px solid var(--border); margin-top:8px; }
.col-section-title:first-child { border-top:none; margin-top:0; }

/* === Batch Select === */
/* Batch checkbox - inside col-num, replaces idx/play icons */
.song-item .col-num .cb-song { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.song-item .col-num .idx-num { display: none; }
.song-list-header .col-cb { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
#selectAllCb { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.song-list-header .col-cb { display: flex; }

.song-item.selected { background: var(--accent); background: rgba(99,102,241,0.12); }
[data-theme="light"] .song-item.selected { background: rgba(99,102,241,0.08); }

/* Batch Bar */
.batch-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg-card);
  border-top: 1px solid var(--border); gap: 8px;
  flex-shrink: 0;
}
.batch-bar span { font-size: 13px; color: var(--text-secondary); }
.batch-bar strong { color: var(--accent); font-size: 14px; }
.batch-actions { display: flex; gap: 6px; }
.batch-actions .btn-outline {
  background: none; border: 1px solid var(--border); color: var(--text);
  padding: 5px 12px; border-radius: var(--radius); font-size: 12px; cursor: pointer;
}
.batch-actions .btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.batch-actions .btn-primary {
  background: var(--accent); border: none; color: #fff;
  padding: 6px 14px; border-radius: var(--radius); font-size: 13px;
  cursor: pointer; font-weight: 600; font-family: inherit;
}
.batch-actions .btn-primary:hover { background: var(--accent-hover); }

/* === Download Progress Bar === */
.download-progress {
  position: fixed; bottom: var(--player-h); left: 0; right: 0;
  z-index: 500; padding: 6px 12px;
  background: var(--bg-card); border-top: 1px solid var(--border);
}
.dl-progress-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 600px; margin: 0 auto;
}
.dl-progress-text {
  font-size: 13px; white-space: nowrap; flex-shrink: 0;
  min-width: 100px;
}
.dl-progress-track {
  flex: 1; height: 8px; background: var(--bg);
  border-radius: 4px; overflow: hidden;
}
.dl-progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 4px; transition: width 0.3s ease;
  min-width: 0;
}
.dl-progress-num {
  font-size: 12px; font-weight: 600; color: var(--accent);
  white-space: nowrap; min-width: 36px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.dl-progress-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-family: inherit;
  animation: pulse 1.5s ease infinite;
}
.dl-progress-btn:hover { background: var(--accent-hover); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
@media (max-width: 640px) {
  .download-progress { bottom: 88px; }
  .dl-progress-inner { gap: 6px; }
  .dl-progress-text { font-size: 11px; min-width: 70px; }
  .dl-progress-num { font-size: 11px; min-width: 30px; }
  .dl-progress-btn { font-size: 11px; padding: 5px 10px; }
}


/* ======== 充值 ======== */
.recharge-tag { transition: all .15s; }
.recharge-tag:hover { border-color: var(--accent) !important; transform: scale(1.03); }
.recharge-tag.active { background: var(--accent) !important; color: #000 !important; border-color: var(--accent) !important; }
.pay-method-btn.active { background: var(--accent) !important; color: #000 !important; border-color: var(--accent) !important; }

/* ======== 友链 ======== */
.friends-grid {
  padding-bottom: calc(var(--player-h) + 24px);
}
@media (max-width: 640px) {
  .friends-grid {
    padding-bottom: calc(var(--player-h) + 80px);
  }
}

/* ===== Site Footer ===== */
.site-footer {
  text-align: center;
  padding: 16px 20px;
  padding-bottom: 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a:hover { color: var(--accent); }
.footer-sep {
  margin: 0 10px;
  color: var(--border);
}
.footer-copy {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.6;
}

/* ===== 手机端修复 (max-width: 480px) ===== */
@media (max-width: 480px) {
  /* 顶栏：隐藏搜索框（通过菜单按钮进入），确保💿下拉可见 */
  .topbar-actions .search-box { display: none; }
  .topbar-actions { gap: 2px; padding-left: 6px; }
  .topbar-actions .btn-icon { font-size: 16px; width: 30px; height: 30px; padding: 2px; }

  /* 播放栏：三行布局，所有控件可见不溢出 */
  .player-bar {
    flex-wrap: wrap;
    padding: 4px 8px 6px;
    gap: 2px 6px;
    min-height: 100px;
  }
  .player-cover { width: 38px; height: 38px; }
  .player-info { flex: 1; min-width: 50px; }
  .player-title { font-size: 11px; }
  .player-artist { font-size: 9px; }
  .btn-icon { font-size: 14px; width: 28px; height: 28px; padding: 2px; }
  .btn-play { width: 30px; height: 30px; font-size: 12px; }
  .player-controls { gap: 2px; }
  .player-controls .mobile-queue-btn { display: inline-flex; font-size: 14px; width: 28px; height: 28px; padding: 2px; flex-shrink: 0; }
  #playerLikeBtn { font-size: 13px; padding: 2px; }
  .player-progress { flex-basis: 100%; gap: 4px; padding: 2px 0 0; }
  .time { font-size: 9px; width: 28px; }
}

/* 分享试听提示脉冲动画 */
@keyframes trialPulse {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: 0 6px 24px rgba(255,77,109,0.4); }
  50% { transform: translateX(-50%) scale(1.06); box-shadow: 0 8px 32px rgba(255,77,109,0.6); }
}

/* 分享链接定位：专辑卡片高亮闪烁 */
@keyframes sharedPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(94,234,212,0.25), 0 8px 30px rgba(0,0,0,0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(94,234,212,0.45), 0 10px 34px rgba(0,0,0,0.55); }
}
.shared-album-highlight {
  border: 2px solid var(--accent) !important;
  border-radius: var(--radius);
  animation: sharedPulse 0.8s ease-in-out 3;
  z-index: 5;
  position: relative;
}
