/* MusicHub 播放器样式 —— 酷狗风格 · 蓝色主题 · 纯白界面 */

:root {
  --brand:      #0c73c2;
  --brand-dark: #0a5fa0;
  --brand-2:    #2b8cff;
  --brand-3:    #00c6ff;
  --brand-grad: linear-gradient(135deg, #2b8cff 0%, #00c6ff 100%);
  --brand-50:   #eef7ff;
  --brand-100:  #d9ecff;
  --brand-200:  #b8dcff;
  --bg:         #f4f6fa;
  --card:       #ffffff;
  --border:     #e8edf4;
  --border-2:   #f0f3f8;
  --text:       #1a2233;
  --text-2:     #4a5568;
  --muted:      #98a2b3;
  --radius:     10px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 2px rgba(16, 32, 56, .04);
  --shadow:     0 4px 16px rgba(16, 32, 56, .07);
  --shadow-lg:  0 14px 36px rgba(16, 32, 56, .14);
  --topbar-h:   64px;
  --topnav-h:   46px;
  --player-h:   84px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dbe6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #bcc7d6; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- 整体骨架 */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(43, 140, 255, .32);
}
.brand-logo svg { width: 19px; height: 19px; stroke-width: 1.9; }

.brand-text { display: flex; flex-direction: column; line-height: 1.22; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.brand-text small { font-size: 11px; color: var(--muted); }

.searchbox {
  flex: 1 1 auto;
  max-width: 640px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 5px 0 15px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.searchbox:focus-within {
  background: #fff;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(43, 140, 255, .12);
}
.searchbox-icon { color: var(--muted); flex: 0 0 auto; }
.searchbox input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
.searchbox input::placeholder { color: #a9b4c2; }
.searchbox-divider { width: 1px; height: 18px; background: #e2e8f0; flex: 0 0 auto; }

.searchbox select {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-2);
  max-width: 124px;
  cursor: pointer;
  padding: 0 4px;
  flex: 0 0 auto;
}

.topbar-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 移动端抽屉开关（桌面隐藏） */
.side-toggle { display: none; }

/* ---------------------------------------------------------- 顶部导航 */
.topnav {
  height: var(--topnav-h);
  flex: 0 0 var(--topnav-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 0 24px;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 29;
}
.topnav::-webkit-scrollbar { height: 0; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .16s, border-color .16s;
}
.nav-item svg { width: 16px; height: 16px; color: var(--muted); transition: color .16s; }
.nav-item:hover { color: var(--brand); }
.nav-item:hover svg { color: var(--brand); }
.nav-item.is-active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
.nav-item.is-active svg { color: var(--brand); }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(43, 140, 255, .3);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgba(43, 140, 255, .38); }
.btn-ghost {
  background: #fff;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--brand-200); color: var(--brand); background: var(--brand-50); }
.btn-danger-ghost { color: #ef4444; }
.btn-danger-ghost:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s, color .16s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }
.icon-btn.is-active { color: var(--brand); }
.icon-btn.is-active svg { fill: currentColor; stroke: currentColor; }
.icon-btn-play {
  width: 46px;
  height: 46px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 5px 16px rgba(43, 140, 255, .36);
}
.icon-btn-play:hover { background: var(--brand-grad); color: #fff; filter: brightness(1.06); }
.icon-btn-play svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------- 主体三栏 */
.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

.sidebar,
.content,
.nowpanel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

/* ---------------------------------------------------------- 左侧栏 */
.sidebar {
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 抽屉头部 / 遮罩：仅移动端出现 */
.side-head { display: none; }
.side-mask { display: none; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-50), #f7fbff);
  border: 1px solid var(--brand-100);
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 3px 10px rgba(43, 140, 255, .28);
}
.user-avatar svg { width: 20px; height: 20px; }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-info strong { font-size: 13.5px; font-weight: 600; }
.user-info small { font-size: 11px; color: var(--muted); }

.side-block { display: flex; flex-direction: column; gap: 6px; }

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 0 8px;
  margin-bottom: 2px;
}
.side-title .icon-btn { width: 24px; height: 24px; }
.side-title .icon-btn svg { width: 14px; height: 14px; }
.side-title .icon-btn.is-locked { opacity: .45; }

.playlist-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.playlist-nav li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.playlist-nav li:hover { background: var(--brand-50); color: var(--brand); }
.playlist-nav li.is-active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.playlist-nav li .pl-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-nav li .pl-count { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.playlist-nav li .pl-del {
  display: none;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.playlist-nav li .pl-del svg { width: 13px; height: 13px; }
.playlist-nav li:hover .pl-del { display: inline-flex; }
.playlist-nav li:hover .pl-count { display: none; }
.playlist-nav li .pl-del:hover { color: #ef4444; background: #fef2f2; }
.playlist-nav .pl-empty { color: var(--muted); font-size: 12px; cursor: default; justify-content: flex-start; }
.playlist-nav .pl-empty:hover { background: transparent; color: var(--muted); }

/* ---------------------------------------------------------- 内容区 */
.content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero {
  flex: 0 0 auto;
  margin: 16px 16px 0;
  padding: 18px 24px;
  border-radius: var(--radius);
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 22px rgba(43, 140, 255, .22);
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; position: relative; z-index: 1; }
.hero-badge {
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  letter-spacing: .5px;
}
.hero-title { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.hero-desc { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .88); }
.hero-art {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  color: #fff;
  opacity: .28;
  display: flex;
}
.hero-art svg { width: 62px; height: 62px; stroke-width: 1.3; }

.content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-2);
  flex: 0 0 auto;
}
.content-title h1 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.content-title p { margin: 0; font-size: 12.5px; color: var(--muted); }
.content-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.list-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(0, 190px) 84px 62px 72px;
  gap: 12px;
  align-items: center;
  padding: 10px 22px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border-2);
  flex: 0 0 auto;
}
.col-idx, .col-time { text-align: center; }
.col-ops { text-align: right; }

.songlist {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 10px 20px;
}

.song-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(0, 190px) 84px 62px 72px;
  gap: 12px;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .14s;
}
.song-row:hover { background: var(--brand-50); }
.song-row.is-current { background: var(--brand-50); }
.song-row.is-current .s-title { color: var(--brand); font-weight: 600; }

.s-idx {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  position: relative;
  height: 26px;
}
.s-idx .idx-num { display: block; }
.s-idx .idx-play { display: none; color: var(--brand); }
.song-row:hover .s-idx .idx-num { display: none; }
.song-row:hover .s-idx .idx-play { display: block; }
.s-idx .idx-play svg { width: 15px; height: 15px; }

.s-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.s-cover {
  width: 42px; height: 42px;
  border-radius: 7px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-2);
  overflow: hidden;
}
.s-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-cover svg { width: 17px; height: 17px; }
.s-text { min-width: 0; display: flex; flex-direction: column; }
.s-title { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-artist { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.s-album { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.s-source {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  background: var(--brand-50);
  color: var(--brand);
  border: 1px solid var(--brand-100);
  justify-self: start;
  white-space: nowrap;
}

.s-time { font-size: 12.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

.s-ops { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.s-ops .icon-btn { width: 28px; height: 28px; opacity: 0; }
.s-ops .icon-btn svg { width: 15px; height: 15px; }
.song-row:hover .s-ops .icon-btn { opacity: 1; }
.s-ops .icon-btn.is-active { opacity: 1; color: #ef4444; }
.s-ops .icon-btn.is-active:hover { background: #fef2f2; color: #ef4444; }
.s-ops .icon-btn.is-active svg { fill: currentColor; }

.empty-state {
  padding: 72px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; color: #cbd5e1; stroke-width: 1.3; margin-bottom: 12px; }
.empty-state p { margin: 0 0 4px; font-size: 14px; color: var(--text-2); }
.empty-state small { font-size: 12px; }

.loading-row { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------- 右侧正在播放 */
.nowpanel {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.now-cover {
  width: min(200px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-2);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(16, 32, 56, .14), inset 0 0 0 6px rgba(255, 255, 255, .55);
  flex: 0 0 auto;
}
.now-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-cover svg { width: 46px; height: 46px; stroke-width: 1.2; }

@keyframes disc-spin { to { transform: rotate(360deg); } }
.now-cover.is-playing img { animation: disc-spin 24s linear infinite; }

.now-title { margin: 0; font-size: 15px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-artist { margin: -8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lyric-box {
  flex: 1 1 auto;
  overflow-y: auto;
  border-top: 1px solid var(--border-2);
  padding: 14px 4px 0;
  text-align: center;
  scroll-behavior: smooth;
}
.lyric-line {
  padding: 5px 4px;
  font-size: 13px;
  color: var(--muted);
  transition: color .2s, font-size .2s;
  line-height: 1.6;
}
.lyric-line.is-active { color: var(--brand); font-weight: 600; font-size: 14px; }
.lyric-empty { color: var(--muted); font-size: 12.5px; padding: 20px 0; }

/* ---------------------------------------------------------- 底部播放条 */
.playerbar {
  height: var(--player-h);
  flex: 0 0 var(--player-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(320px, 2fr) minmax(200px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  z-index: 25;
}

.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-cover {
  width: 50px; height: 50px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-2);
  overflow: hidden;
  flex: 0 0 auto;
}
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }
.pb-cover svg { width: 20px; height: 20px; }
.pb-meta { display: flex; flex-direction: column; min-width: 0; }
.pb-meta strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-meta small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pb-controls { display: flex; align-items: center; gap: 16px; }
.pb-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 999px;
  background: #e6ecf5;
  cursor: pointer;
  position: relative;
}
.progress-sm { width: 76px; flex: 0 0 76px; }
.progress-bar {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--brand-grad);
  transition: width .12s linear;
}
.progress-bar::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand-2);
  box-shadow: 0 1px 4px rgba(43, 140, 255, .4);
  opacity: 0;
  transition: opacity .16s;
}
.progress:hover .progress-bar::after { opacity: 1; }

.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.volume { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------- 播放队列 */
.queue-panel {
  position: fixed;
  right: 24px;
  bottom: calc(var(--player-h) + 12px);
  width: 320px;
  max-height: 56vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}
.queue-panel.is-open { display: flex; }
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 12px 16px;
  border-bottom: 1px solid var(--border-2);
  font-size: 13px;
  font-weight: 600;
}
.queue-head em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; }
.queue-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.queue-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.queue-list li:hover { background: var(--brand-50); }
.queue-list li.is-current { color: var(--brand); font-weight: 600; background: var(--brand-50); }
.queue-list li .q-idx { width: 20px; color: var(--muted); font-size: 11.5px; flex: 0 0 auto; }
.queue-list li .q-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-list li .q-artist { color: var(--muted); font-size: 11.5px; flex: 0 0 auto; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 28px);
  transform: translate(-50%, 12px);
  background: rgba(26, 34, 51, .94);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: 70vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- 顶部账号区 */
.user-guest { display: flex; align-items: center; gap: 8px; }
.user-guest.is-hidden { display: none; }

.user-box { position: relative; display: none; }
.user-box.is-show { display: block; }

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.user-trigger:hover { border-color: var(--brand-200); background: var(--brand-50); }
.user-trigger svg { width: 14px; height: 14px; color: var(--muted); }

.user-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.user-chip-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 164px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 45;
}
.user-menu.is-open { display: block; }
.user-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.user-menu button:hover { background: var(--brand-50); color: var(--brand); }
.user-menu button svg { width: 16px; height: 16px; }

.avatar-initial { font-size: 15px; font-weight: 600; }

/* ---------------------------------------------------------- 登录 / 注册弹窗 */
.modal { position: fixed; inset: 0; z-index: 80; display: none; overflow-y: auto; }
.modal.is-open { display: block; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 56, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: calc(100% - 32px);
  max-width: 380px;
  margin: 8vh auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 24px;
  animation: modal-in .2s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg); color: var(--text-2); }
.modal-close svg { width: 16px; height: 16px; }

.modal-head { text-align: center; margin-bottom: 18px; }
.modal-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 13px;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(43, 140, 255, .3);
}
.modal-logo svg { width: 23px; height: 23px; }
.modal-head strong { display: block; font-size: 17px; font-weight: 600; }
.modal-head small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 999px;
  margin-bottom: 18px;
}
.modal-tab {
  flex: 1 1 0;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.modal-tab.is-active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; }
.auth-form.is-hidden { display: none; }
.auth-form label { margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.auth-form label em { font-style: normal; color: var(--muted); font-weight: 400; }
.auth-form input {
  height: 40px;
  padding: 0 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.auth-form input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(43, 140, 255, .12); }
.auth-err { min-height: 16px; margin: 0 0 8px; font-size: 12.5px; color: #ef4444; }
.btn-block { width: 100%; height: 42px; justify-content: center; }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .nowpanel { display: none; }
}

@media (max-width: 860px) {
  :root { --player-h: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* ---------------- 顶栏：品牌 + 账号一行，搜索框独占一行 ---------------- */
  .topbar {
    height: auto;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 14px;
  }
  .brand { order: 1; }
  .brand-logo { width: 32px; height: 32px; border-radius: 8px; }
  .brand-logo svg { width: 17px; height: 17px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { display: none; }
  .topbar-actions { order: 2; gap: 6px; }
  .side-toggle { display: inline-flex; }
  .user-chip-name { display: none; }
  .user-guest { gap: 6px; }
  .user-guest .btn { padding: 0 12px; height: 30px; }

  .searchbox {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    height: 38px;
  }
  .searchbox select,
  .searchbox-divider { display: none; }
  .searchbox input { font-size: 13.5px; }
  .searchbox .btn { padding: 0 13px; }

  /* ---------------- 顶部导航 ---------------- */
  .topnav { padding: 0 8px; gap: 2px; }
  .nav-item { padding: 0 12px; font-size: 13px; gap: 5px; }
  .nav-item svg { width: 15px; height: 15px; }

  /* ---------------- 主体单列 ---------------- */
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px;
  }

  /* ---------------- 侧边栏 → 抽屉 ---------------- */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 272px;
    max-width: 84vw;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 16px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    transform: translateX(-102%);
    transition: transform .24s ease;
    box-shadow: var(--shadow-lg);
    overscroll-behavior: contain;
    z-index: 70;
  }
  .sidebar.is-open { transform: none; }
  .side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
    border-bottom: 1px solid var(--border-2);
  }
  .side-head strong { font-size: 14px; font-weight: 600; }
  .side-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 32, 56, .42);
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s, visibility .24s;
    z-index: 69;
  }
  .side-mask.is-open { opacity: 1; visibility: visible; }

  /* ---------------- 内容区 ---------------- */
  .hero { display: none; }
  .content-head {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px 12px;
  }
  .content-title h1 { font-size: 16px; }
  .content-title p { font-size: 12px; }
  .content-actions { flex-wrap: wrap; gap: 6px; }
  .content-actions .btn { padding: 0 12px; font-size: 12.5px; }
  .list-head { padding: 8px 12px; }
  .songlist { padding: 6px 6px 18px; }

  /* 歌曲行：序号 / 歌曲 / 时长 / 操作 四列，避免换行错位 */
  .list-head,
  .song-row { grid-template-columns: 32px minmax(0, 1fr) 46px 62px; gap: 8px; }
  .song-row { padding: 6px 8px; }
  .col-album, .col-source, .s-album, .s-source { display: none; }
  .s-cover { width: 38px; height: 38px; border-radius: 6px; }
  .s-title { font-size: 13px; }
  .s-artist { font-size: 11.5px; }

  /* ---------------- 底部播放条：两行布局 ---------------- */
  .playerbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .pb-left { order: 1; flex: 1 1 0; min-width: 0; gap: 10px; }
  .pb-cover { width: 40px; height: 40px; border-radius: 8px; }
  .pb-cover svg { width: 17px; height: 17px; }
  .pb-meta strong { font-size: 13px; }
  .pb-meta small { font-size: 11.5px; }
  .pb-center { display: contents; }
  .pb-controls { order: 2; gap: 8px; }
  .pb-controls .icon-btn { width: 32px; height: 32px; }
  .pb-controls .icon-btn-play { width: 40px; height: 40px; }
  .pb-controls .icon-btn-play svg { width: 18px; height: 18px; }
  .pb-progress { order: 3; flex: 1 0 100%; max-width: none; gap: 8px; font-size: 11px; }
  .pb-right { display: none; }

  /* ---------------- 播放队列 ---------------- */
  .queue-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 56vh;
    bottom: calc(var(--player-h) + 10px);
  }

  /* ---------------- 弹窗 ---------------- */
  .modal-card { margin: 6vh auto; padding: 22px 18px 20px; }
  .auth-form input { height: 42px; }

  /* ---------------- Toast ---------------- */
  .toast { max-width: 86vw; font-size: 12.5px; }
}

/* 触屏设备没有 hover：操作按钮常显，否则无法收藏 / 加歌单 */
@media (hover: none) {
  .s-ops .icon-btn { opacity: 1; }
  .playlist-nav li .pl-del { display: inline-flex; }
  .playlist-nav li .pl-count { display: none; }
}

/* 超窄屏（≤400px）进一步精简 */
@media (max-width: 400px) {
  .topnav .nav-item span { display: none; }
  .topnav .nav-item { padding: 0 15px; }
  .content-actions .btn span { display: none; }
  .content-actions .btn { padding: 0 11px; }
  .pb-left > .icon-btn { display: none; }
  .list-head,
  .song-row { grid-template-columns: 28px minmax(0, 1fr) 42px 58px; gap: 6px; }
}

