/* ==========================================================================
 * Nova Music — 界面样式
 * 深色主题 · 主题色可切换 · 氛围背景跟随封面
 * ========================================================================== */

/* ---------- 设计变量(唯一 :root, 舞台尺寸令牌也在内) ---------- */
:root {
  --bg: #07080c;
  --bg-1: #0c0e14;
  --bg-2: #11141d;
  --bg-3: #171b26;
  --bg-4: #1e2331;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --tx-1: #f2f4f8;
  --tx-2: #a8afc2;
  /* 原 #6b7288 在 --bg-4 上仅 3.27:1; 提亮到 >=5.3:1(AA, 12px 正文可用) */
  --tx-3: #8f97ac;
  /* 语义色与主题色解耦: 玫瑰主题的主色 #f43f5e 曾与危险色重合, 琥珀主题的主色就是警告色 */
  --danger: #f2555a;
  --warn: #e8b23a;
  --shadow-lg: 0 18px 56px rgba(0, 0, 0, .5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-w: 232px;
  --topbar-h: 64px;
  --player-h: 92px;
  --stage-ratio: 1.6;
  --stage-h-cap: 86vh;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-soft: rgba(99, 102, 241, .15);
  --accent-glow: rgba(99, 102, 241, .4);
  /* 主题色填充上的前景色: 白字在青/绿/琥珀/玫红上只有 2.1-3.7:1 */
  --on-accent: #fff;
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}
html[data-accent="indigo"]  { --accent: #6366f1; --accent-2: #818cf8; --accent-soft: rgba(99,102,241,.15); --accent-glow: rgba(99,102,241,.4);  --on-accent: #fff; }
html[data-accent="violet"]  { --accent: #a855f7; --accent-2: #c084fc; --accent-soft: rgba(168,85,247,.15); --accent-glow: rgba(168,85,247,.4); --on-accent: #fff; }
html[data-accent="cyan"]    { --accent: #06b6d4; --accent-2: #22d3ee; --accent-soft: rgba(6,182,212,.15);  --accent-glow: rgba(6,182,212,.4);  --on-accent: #0b0d12; }
html[data-accent="green"]   { --accent: #10b981; --accent-2: #34d399; --accent-soft: rgba(16,185,129,.15); --accent-glow: rgba(16,185,129,.35); --on-accent: #0b0d12; }
html[data-accent="rose"]    { --accent: #f43f5e; --accent-2: #fb7185; --accent-soft: rgba(244,63,94,.15);  --accent-glow: rgba(244,63,94,.35);  --on-accent: #0b0d12; }
html[data-accent="amber"]   { --accent: #f59e0b; --accent-2: #fbbf24; --accent-soft: rgba(245,158,11,.15); --accent-glow: rgba(245,158,11,.35); --on-accent: #0b0d12; }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 显式 display 规则不得覆盖 hidden 属性(遮罩/徽标等依赖) */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx-1);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
img { display: block; background: var(--bg-3); }
/* 封面淡入(JS 加 .lazy/.loaded 才生效, 不加类则完全无变化) */
img.lazy { opacity: 0; transition: opacity .2s var(--ease); }
img.lazy.loaded { opacity: 1; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font-family: inherit; }
/* 可见焦点环: 只对键盘焦点/可交互元素显示, 提亮到 --accent-2 保证在深色底上可辨。
   不包含 [tabindex="-1"](#view 路由后程序化聚焦, 不该出现描边) */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
::selection { background: var(--accent); color: var(--on-accent); }

/* 仅供读屏(视觉上隐藏但不脱离无障碍树) */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* 曲目/歌手名可复制(整体禁选只针对外壳) */
.pb-title, .tr-title, .np-title, .detail-name, .info-table td:last-child { user-select: text; }
/* 选中态也可用 aria-selected 表达(JS 若切 aria-selected 一样有样式) */
.track-row[aria-selected="true"], .q-item[aria-selected="true"] { background: var(--accent-soft); }
/* 键盘焦点落到队列条目/行时给一圈内描边, 避免被滚动容器裁掉 */
.icon-btn:focus-visible, .pb-btn:focus-visible, .tabbar button:focus-visible { outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); border: 2px solid transparent; background-clip: content-box; }

/* ---------- 氛围背景 ---------- */
#ambient-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .4; transition: opacity .8s var(--ease);
  background:
    radial-gradient(1100px 700px at 18% -10%, var(--accent-glow), transparent 60%),
    radial-gradient(900px 600px at 108% 112%, var(--accent-glow), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
}
#ambient-bg.off { opacity: 0; }

/* ---------- 玻璃外框(宽高比留白时的封面大模糊) ---------- */
#glass-bg {
  position: fixed; inset: -90px; z-index: 0; pointer-events: none;
  background: center/cover var(--cover-img, none) no-repeat;
  filter: blur(64px) saturate(1.5) brightness(.4);
  transform: scale(1.06);
  opacity: 0;
  /* 渐变/背景图无法补间, 只过渡真正会变的 opacity */
  transition: opacity .7s var(--ease);
}
body.letterboxed.has-cover #glass-bg { opacity: 1; }
#glass-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,5,9,.34), rgba(4,5,9,.5));
}

/* ---------- 固定宽高比舞台 ---------- */
#stage {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: var(--stage-ratio);
  height: min(var(--stage-h-cap), calc(100vw / var(--stage-ratio)));
  z-index: 1;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
body.letterboxed #stage {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

/* ---------- 布局骨架 ---------- */
/* 不加 z-index: 否则 .app 成为层叠上下文, 队列侧板(z-index:60)永远盖不住播放条(z-index:5) */
.app {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1; min-height: 0;
}

/* ================= 侧边栏 ================= */
.sidebar {
  display: flex; flex-direction: column;
  background: #0a0c12;
  border-right: 1px solid var(--line);
  padding: 18px 14px 12px;
  gap: 4px;
  overflow: hidden;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.logo-text { font-size: 16.5px; letter-spacing: .2px; color: var(--tx-2); }
.logo-text b { font-weight: 700; color: var(--tx-1); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--tx-2); font-size: 14px; text-align: left;
  transition: background .18s, color .18s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--tx-1); }
.nav-item.active, .nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--tx-1); font-weight: 600; }
.nav-item.active::before, .nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-ic, .nav-ic svg { width: 19px; height: 19px; display: inline-flex; flex: none; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--on-accent); min-width: 20px; height: 17px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

.side-section { margin-top: 14px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 6px; color: var(--tx-3); font-size: 12px; font-weight: 600; letter-spacing: 1px;
}
.playlist-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 2px 8px; }
.playlist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--tx-2); transition: background .15s, color .15s; width: 100%; text-align: left;
}
.playlist-item:hover { background: rgba(255,255,255,.06); color: var(--tx-1); }
.playlist-item.active, .playlist-item[aria-current="page"] { background: var(--accent-soft); color: var(--tx-1); }
.playlist-item .pl-ic { width: 18px; height: 18px; color: var(--tx-3); flex: none; display: inline-flex; }
.playlist-item.active .pl-ic, .playlist-item[aria-current="page"] .pl-ic { color: var(--accent-2); }
.playlist-item .pl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.playlist-item .pl-count { font-size: 11px; color: var(--tx-3); }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-stat { font-size: 11.5px; color: var(--tx-3); text-align: center; padding-bottom: 2px; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--tx-1);
  background: var(--bg-3); border: 1px solid var(--line);
  transition: background .15s, border-color .15s, transform .1s, box-shadow .2s;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-2); }
.btn:active { transform: scale(.97); }
/* 禁用/忙态: OSS 未填清单时「同步曲库」是 disabled, 不能看起来和可点一样 */
.btn:disabled, .btn[aria-busy="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled:hover, .btn[aria-busy="true"]:hover { background: var(--bg-3); border-color: var(--line); filter: none; }
.btn-primary {
  background: var(--accent);
  border-color: transparent; color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); }
.btn-danger { color: var(--danger); border-color: rgba(242,85,90,.32); }
.btn-danger:hover { background: rgba(242,85,90,.12); }
.btn-block { width: 100%; }
/* 68px 收窄轨里只留图标: 隐藏文字标签, 不隐藏图标 */
.btn-block .btn-label { min-width: 0; }
.btn .btn-ic, .btn .btn-ic svg { display: inline-flex; flex: none; }
.btn svg { width: 16px; height: 16px; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tx-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--tx-1); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.active, .icon-btn[aria-pressed="true"] { color: var(--accent-2); }

/* ================= 主区域 ================= */
.main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  position: relative;
}
.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #0a0c12;
  position: relative; z-index: 5;
}
.searchbox {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 6px 0 12px; height: 40px;
  transition: border-color .2s, box-shadow .2s;
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox .search-ic { color: var(--tx-3); display: inline-flex; flex: none; }
.searchbox .search-ic svg { width: 16px; height: 16px; }
.searchbox input {
  flex: 1; background: none; border: none; outline: none; min-width: 0;
  color: var(--tx-1); font-size: 13.5px;
}
.searchbox input::placeholder { color: var(--tx-3); }
/* 清除按钮给足点击区域(原来只有 14px 字形) */
.search-clear { color: var(--tx-3); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; flex: none; }
.search-clear svg { width: 14px; height: 14px; }
.search-clear:hover { color: var(--tx-1); background: rgba(255,255,255,.06); }

/* contain: 视图内滚动/重排不再外溢到整页 */
.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px 26px 30px; min-height: 0; contain: layout paint; }
/* #view 是滚动容器(tabindex="-1"), 路由后由 JS 程序化聚焦; 浏览器默认会画 1px 焦点环,
   而它不在 Tab 序里, 所以直接去掉, 避免每次进页面/换视图都有一圈描边 */
#view:focus, #view:focus-visible { outline: none; }

/* ---------- 视图工具栏 ---------- */
.view-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar-title { font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.toolbar-sub { color: var(--tx-3); font-size: 12.5px; margin-top: 3px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.seg button {
  padding: 5px 11px; border-radius: 6px; font-size: 12.5px; color: var(--tx-2);
  display: inline-flex; align-items: center; gap: 5px;
}
.seg button:hover { color: var(--tx-1); }
.seg button.active { background: var(--bg-4); color: var(--tx-1); font-weight: 600; }
.seg svg { width: 14px; height: 14px; }

/* ================= 歌曲列表 ================= */
.tracklist { display: flex; flex-direction: column; }
.tracklist-head {
  display: grid; grid-template-columns: 34px minmax(0, 2.6fr) minmax(0, 1.6fr) minmax(0, 1.8fr) 92px 46px;
  gap: 12px; padding: 6px 14px; margin-bottom: 4px;
  color: var(--tx-3); font-size: 11.5px; font-weight: 600; letter-spacing: .8px;
  border-bottom: 1px solid var(--line);
}
.tl-col.sortable { cursor: pointer; border-radius: 4px; }
.tl-col.sortable:hover { color: var(--tx-2); }
.tl-col.sortable:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.tl-col .sort-arrow { font-size: 10px; margin-left: 3px; color: var(--accent-2); }
/* 排序状态指示: JS 已渲染 .sort-arrow 时不重复画箭头 */
.tl-col[aria-sort="ascending"], .tl-col[aria-sort="descending"] { color: var(--tx-1); }
.tl-col.sortable[aria-sort="ascending"]:not(:has(.sort-arrow))::after { content: "▲"; font-size: 9px; margin-left: 3px; color: var(--accent-2); }
.tl-col.sortable[aria-sort="descending"]:not(:has(.sort-arrow))::after { content: "▼"; font-size: 9px; margin-left: 3px; color: var(--accent-2); }
.track-row {
  display: grid; grid-template-columns: 34px minmax(0, 2.6fr) minmax(0, 1.6fr) minmax(0, 1.8fr) 92px 46px;
  gap: 12px; align-items: center;
  padding: 7px 14px; border-radius: 10px;
  cursor: default; position: relative;
  transition: background .13s;
  /* 长列表(整库)按需渲染: 屏幕外的行不参与布局/绘制 */
  content-visibility: auto;
  contain-intrinsic-size: auto 54px;
}
.track-row:hover { background: rgba(255,255,255,.055); }
.track-row.selected, .track-row[aria-selected="true"] { background: var(--accent-soft); }
.track-row:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.track-row.playing .tr-title { color: var(--accent-2); font-weight: 600; }
.track-row.missing { opacity: .45; }
.track-row .tr-num { color: var(--tx-3); font-size: 12.5px; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
.tr-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tr-cover {
  width: 40px; height: 40px; border-radius: 7px; flex: none;
  background: var(--bg-3); overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; color: var(--tx-3);
}
.tr-cover img { width: 100%; height: 100%; object-fit: cover; }
.tr-cover svg { width: 17px; height: 17px; opacity: .6; }
.tr-texts { min-width: 0; }
.tr-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.tr-sub { font-size: 12px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tr-artist, .tr-album {
  font-size: 13px; color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-dur { font-size: 12.5px; color: var(--tx-3); font-variant-numeric: tabular-nums; text-align: right; }
.tr-like { opacity: 0; transition: opacity .15s; }
.track-row:hover .tr-like, .tr-like.liked, .track-row:focus-within .tr-like { opacity: 1; }
.tr-like.liked { color: var(--accent-2); }
.tr-like svg { width: 16px; height: 16px; }
.tr-like.liked svg path { fill: currentColor; }

/* 播放中的动效条 */
.eq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq-bars i {
  width: 3px; border-radius: 2px; background: var(--accent);
  animation: eqb 1s ease-in-out infinite;
}
.eq-bars i:nth-child(2) { animation-delay: .25s; }
.eq-bars i:nth-child(3) { animation-delay: .5s; }
@keyframes eqb { 0%,100% { height: 4px; } 50% { height: 14px; } }

/* ================= 卡片网格 ================= */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.album-card, .artist-card {
  padding: 12px; border-radius: var(--radius-lg);
  background: var(--bg-1); border: 1px solid var(--line);
  cursor: pointer; position: relative;
  transition: background .18s, border-color .18s;
}
.album-card:hover, .artist-card:hover {
  background: var(--bg-2); border-color: var(--line-2);
}
.album-card:focus-visible, .artist-card:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
.card-cover {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
  display: flex; align-items: center; justify-content: center; color: var(--tx-3);
  position: relative; margin-bottom: 11px;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover svg { width: 34px; height: 34px; opacity: .5; }
.artist-card .card-cover { border-radius: 50%; }
.artist-card .card-cover .av-letter { font-size: 40px; font-weight: 700; color: #fff; opacity: .9; }
.card-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 12px; color: var(--tx-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 播放键贴封面右下角: 原来的 bottom:74px 是按"卡片整体"算的魔数, 但 .card-cover 才是
   定位父元素 —— 结果按钮被顶到封面中上部、离右下边距 (上 44 / 下 66 / 右 18) 完全不对称。
   改成相对封面定位后, 无论卡片文字几行、网格怎么缩放, 四边留白都稳定。 */
.card-hover-play {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.album-card:hover .card-hover-play, .artist-card:hover .card-hover-play { opacity: 1; transform: translateY(0); }
.card-hover-play:focus-visible { opacity: 1; transform: translateY(0); outline: 2px solid var(--tx-1); outline-offset: 2px; }
.card-hover-play svg { width: 18px; height: 18px; }
/* 艺术家封面是圆形(border-radius:50% + overflow:hidden): 贴右下角会被圆裁掉一半,
   所以圆形卡片把播放键放到底部正中(那里圆的弦最宽, 卡片再小也不会被裁);
   底色改为半透明深色遮罩 + 白色图标 —— 头像底色可能正好是主题色, 用主题色会糊成一片。 */
.artist-card .card-hover-play {
  right: auto; bottom: 10px; left: 50%;
  /* 圆形封面不做上滑入场: 多出的 8px 位移会让按钮贴到圆边上(触屏常显时尤其明显) */
  transform: translate(-50%, 0);
  background: rgba(9, 11, 17, .72); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.artist-card:hover .card-hover-play,
.artist-card .card-hover-play:focus-visible { transform: translate(-50%, 0); }

/* 异步补进来的封面(封面容器里原本只有占位图标): 垫满容器并淡入, 避免"硬切"感 */
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-img.cover-fade { opacity: 0; transition: opacity .16s linear; }
.cover-img.cover-fade.is-ready { opacity: 1; }
/* 正在播放页的兜底容器(圆形/圆角由 #np-cover 控制), 补进来的图片同样要垫满 */
#np-cover > .cover-img { border-radius: inherit; }

/* ================= 详情页头部 ================= */
.detail-head {
  display: flex; gap: 24px; align-items: flex-end;
  padding: 22px 4px 24px; margin-bottom: 8px; flex-wrap: wrap;
}
.detail-cover {
  width: 188px; height: 188px; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
  box-shadow: var(--shadow-lg); flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--tx-3);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover svg { width: 52px; height: 52px; opacity: .45; }
.detail-meta { flex: 1; min-width: 240px; }
.detail-kind { font-size: 11.5px; letter-spacing: 2px; color: var(--tx-3); font-weight: 700; text-transform: uppercase; }
/* 长标题不再整块换行/拆词: 最多两行 + 省略号 */
.detail-name {
  font-size: 34px; font-weight: 800; line-height: 1.2; margin: 6px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.detail-desc { color: var(--tx-2); font-size: 13px; }
.detail-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; flex-wrap: wrap; }

/* ================= 空状态 ================= */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 20px; text-align: center; gap: 6px;
}
.empty > svg { width: 54px; height: 54px; color: var(--tx-3); opacity: .5; margin-bottom: 10px; }
.empty b { font-size: 17px; color: var(--tx-1); }
.empty p { color: var(--tx-3); font-size: 13px; max-width: 420px; }
.empty .btn { margin-top: 16px; }

/* ================= 正在播放页 ================= */
.view.np-full { padding: 0; }
.np-wrap {
  position: relative;
  display: flex; justify-content: center;
  height: 100%; min-height: 0;
  overflow: hidden;
  background: var(--bg-1);
}
/* 封面模糊通铺整个正在播放页 */
.np-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(56px) brightness(.24) saturate(.55);
  transform: scale(1.2);
  opacity: .55;
  transition: opacity .6s var(--ease); z-index: 0;
}
.np-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,12,.3), rgba(7,8,12,.5));
}
.np-left { position: relative; z-index: 1; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.np-wrap.np-nolyr .np-left { flex: 1 0 auto; width: 100%; }
/* 封面尺寸只跟容器/视口走: 原来的 86vh-320px 在 900x500 上塌成 110px */
.np-cover-wrap { position: relative; width: min(360px, 72%, 42vh); aspect-ratio: 1; margin: 0 0 44px; }
.np-viz { position: absolute; inset: -56px; width: calc(100% + 112px); height: calc(100% + 112px); pointer-events: none; }
#np-cover {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 6px solid rgba(255,255,255,.06);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45), 0 0 0 1px var(--line-2);
  animation: spin 26s linear infinite; animation-play-state: paused;
  background: var(--bg-3);
}
body.playing #np-cover { animation-play-state: running; }
.np-cover-hole {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 22%; aspect-ratio: 1; border-radius: 50%;
  background: var(--bg);
  border: 6px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 18px rgba(0,0,0,.8);
}
@keyframes spin { to { transform: rotate(360deg); } }
.np-info { text-align: center; max-width: 90%; }
.np-title {
  font-size: 21px; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; user-select: text;
}
.np-artist { color: var(--tx-2); margin-top: 4px; font-size: 14px; }
.np-artist span { color: var(--tx-3); }
.np-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; margin-bottom: 6px; }
.np-actions .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
.np-actions .icon-btn svg { width: 19px; height: 19px; }
.np-actions .icon-btn.liked { color: var(--accent-2); }
.np-actions .icon-btn.liked svg path { fill: currentColor; }

/* ---------- 歌词面板(右侧栏, 唱片居中于剩余空间) ---------- */
.np-right {
  position: relative; z-index: 2; flex: 0 0 auto;
  width: min(460px, 38%); min-width: 0;
  padding: 24px 56px 24px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30px);
  mask-image: linear-gradient(90deg, transparent 0, #000 30px);
}
.np-wrap.np-nolyr .np-right { display: none; }
.np-right:empty { display: none; }
.lyrics-lines {
  position: relative; z-index: 1; height: 100%; overflow-y: auto;
  padding: 18% 10%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  scrollbar-width: none;
}
.lyrics-lines::-webkit-scrollbar { display: none; }
.lyr-line {
  font-size: var(--lyr-size, 19px); line-height: 1.6; font-weight: 600;
  color: var(--tx-3); padding: 8px 4px; border-radius: 8px;
  cursor: pointer; transition: color .3s, transform .3s var(--ease), text-shadow .3s;
  transform-origin: left center;
  text-align: left;
}
.lyr-line:hover { color: var(--tx-2); }
.lyr-line:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; color: var(--tx-1); }
.lyr-line.active {
  color: var(--tx-1); font-weight: 700; transform: scale(1.04);
}
.lyr-badge {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  font-size: 11px; color: var(--tx-3);
  background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 20px;
  pointer-events: none;
}

/* ================= 播放队列侧板(覆盖层, transform 滑动) ================= */
.queue-panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 60;
  width: 320px; max-width: 86vw;
  background: #0d0f16;
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column;
  min-height: 0;
  /* 收起: 移出 + 不可见(隐藏的按钮也不再进入 Tab 序) */
  transform: translateX(101%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility 0s linear .32s;
}
.queue-panel.open {
  transform: none;
  visibility: visible;
  transition: transform .32s var(--ease), visibility 0s;
}
/* JS 打开/关闭时切换 inert, 这里再兜一层: 不可交互 */
.queue-panel[inert] { pointer-events: none; }
.queue-panel:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px; font-weight: 700; font-size: 15px;
}
.queue-head-actions { display: flex; gap: 2px; }
.queue-list { flex: 1; overflow-y: auto; padding: 0 10px 14px; }
.q-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 9px; cursor: default;
  content-visibility: auto;
  contain-intrinsic-size: auto 52px;
}
.q-item:hover { background: rgba(255,255,255,.06); }
.q-item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.q-item.current .q-title { color: var(--accent-2); font-weight: 600; }
.q-item.played { opacity: .45; }
.q-sec { font-size: 11.5px; font-weight: 700; color: var(--tx-3); letter-spacing: .05em; padding: 14px 8px 6px; }
.q-sec:first-child { padding-top: 6px; }
.q-cover { width: 38px; height: 38px; border-radius: 6px; flex: none; background: var(--bg-3); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--tx-3); }
.q-cover img { width: 100%; height: 100%; object-fit: cover; }
.q-cover svg { width: 15px; height: 15px; opacity: .6; }
.q-texts { flex: 1; min-width: 0; }
.q-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: 11.5px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-remove { opacity: 0; color: var(--tx-3); flex: none; }
.q-item:hover .q-remove, .q-item:focus-within .q-remove { opacity: 1; }
.q-remove:hover { color: var(--tx-1); }
.q-remove svg { width: 13px; height: 13px; }

/* ================= 播放条 ================= */
.player-bar {
  position: relative; z-index: 5;
  height: var(--player-h); flex: none;
  display: grid; grid-template-columns: minmax(180px, 24%) 1fr minmax(200px, 24%);
  align-items: center; gap: 14px;
  padding: 0 calc(18px + env(safe-area-inset-right, 0px)) 0 calc(18px + env(safe-area-inset-left, 0px));
  background: #090b10;
  border-top: 1px solid var(--line);
}
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-cover {
  width: 56px; height: 56px; border-radius: 9px; flex: none;
  background: var(--bg-3); overflow: hidden; position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--tx-3);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }
.pb-cover-note { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.pb-cover-note svg { width: 20px; height: 20px; opacity: .55; }
.pb-cover:not(.has-img) .pb-cover-note { display: flex; }
.pb-meta { min-width: 0; flex: 1; }
.pb-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-artist { font-size: 12px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.pb-like { flex: none; }
.pb-like.liked { color: var(--accent-2); }
.pb-like.liked svg path { fill: currentColor; }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pb-controls { display: flex; align-items: center; gap: 6px; }
.pb-btn { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--tx-2); transition: color .15s, background .15s, transform .1s; position: relative; }
.pb-btn:hover { color: var(--tx-1); background: rgba(255,255,255,.06); }
.pb-btn:active { transform: scale(.92); }
.pb-btn svg { width: 17px; height: 17px; }
.pb-btn.active, .pb-btn[aria-pressed="true"] { color: var(--accent-2); }
.pb-btn:focus-visible, .pb-play:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.pb-btn .dot-badge {
  position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); display: none;
}
.pb-btn.badged .dot-badge { display: block; }
.pb-play {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 8px;
  background: var(--accent);
  color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s, filter .15s;
}
.pb-play:hover { filter: brightness(1.12); }
.pb-play:active { transform: scale(.93); }
.pb-play svg { width: 19px; height: 19px; }
.pb-label-btn { font-size: 12px; font-weight: 600; width: auto; padding: 0 10px; }

.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px; }
.pb-time { font-size: 11.5px; color: var(--tx-3); font-variant-numeric: tabular-nums; min-width: 38px; }
.pb-time:last-child { text-align: left; }
/* 进度/音量: 填充用 transform 驱动(JS 只写 --seek-p / --vol-p), 不再每帧改 width/left */
.pb-seek {
  flex: 1; height: 18px; display: flex; align-items: center; position: relative; cursor: pointer;
  touch-action: none; border-radius: 4px;
}
.pb-seek:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.pb-seek::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); }
.pb-seek-buf { position: absolute; left: 0; height: 4px; border-radius: 3px; background: rgba(255,255,255,.14); width: 0; }
.pb-seek-fill {
  position: absolute; left: 0; height: 4px; border-radius: 3px; width: 100%;
  background: var(--accent);
  transform: scaleX(var(--seek-p, 1)); transform-origin: left center;
  will-change: transform;
}
.pb-seek-thumb {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5);
  left: calc(var(--seek-p, 1) * 100%); transform: translateX(-50%) scale(0); transition: transform .15s;
}
.pb-seek:hover .pb-seek-thumb, .pb-seek:focus-visible .pb-seek-thumb, .pb-seek.dragging .pb-seek-thumb { transform: translateX(-50%) scale(1); }
.pb-seek-tip {
  position: absolute; bottom: 18px; transform: translateX(-50%);
  background: var(--bg-4); border: 1px solid var(--line-2); color: var(--tx-1);
  font-size: 11px; padding: 2px 8px; border-radius: 6px; pointer-events: none;
  opacity: 0; transition: opacity .12s; white-space: nowrap;
}
.pb-seek:hover .pb-seek-tip { opacity: 1; }

.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.pb-volume { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.vol-slider { width: 84px; height: 18px; display: flex; align-items: center; position: relative; cursor: pointer; touch-action: none; border-radius: 4px; }
.vol-slider:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.vol-slider::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); }
.vol-fill {
  position: absolute; left: 0; height: 4px; border-radius: 3px; background: var(--tx-2); width: 100%;
  transform: scaleX(var(--vol-p, .8)); transform-origin: left center;
  will-change: transform;
}
.vol-slider:hover .vol-fill, .vol-slider:focus-visible .vol-fill { background: var(--accent); }
.vol-thumb { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; left: calc(var(--vol-p, .8) * 100%); transform: translateX(-50%); }

/* ================= 右键菜单 / 弹出层 ================= */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 190px; max-width: 280px;
  background: rgba(22, 25, 34, .97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 5px; animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(4px); } }
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--tx-1); text-align: left;
}
.ctx-item:hover { background: var(--accent-soft); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(242,85,90,.12); }
.ctx-item svg { width: 15px; height: 15px; color: var(--tx-2); flex: none; }
.ctx-item.danger svg { color: var(--danger); }
.ctx-item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.ctx-item .ctx-right { margin-left: auto; color: var(--tx-3); font-size: 11px; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 8px; }
.ctx-title { padding: 7px 10px 5px; font-size: 11.5px; color: var(--tx-3); font-weight: 600; }

/* ================= 模态框 ================= */
.modal-root { position: absolute; inset: 0; z-index: 300; overflow: hidden; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(4, 5, 8, .66); backdrop-filter: blur(10px);
  display: flex; align-items: center;
  align-items: safe center; /* 内容超高时退化为 flex-start, 不会被裁掉顶部 */
  justify-content: center;
  /* 遮罩可滚动 + safe center: 内容超高时不会把 foot 裁掉 */
  overflow: auto; padding: 16px; overscroll-behavior: contain;
  animation: fade .18s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  /* 高度取自容器(遮罩)而不是 100vh: 原来 100vh-80px 在 571-650px 高的窗口里会裁掉底栏 */
  width: min(520px, calc(100vw - 48px)); max-height: calc(100% - 32px);
  margin: auto;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: pop .2s var(--ease);
}
.modal:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-title { font-size: 16.5px; font-weight: 700; }
.modal-body { padding: 16px 20px; overflow-y: auto; min-height: 0; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 4px 20px 18px; }
.modal input[type="text"] {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line);
  color: var(--tx-1); border-radius: 9px; padding: 10px 13px; font-size: 14px; outline: none;
}
.modal input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.info-table td:first-child { color: var(--tx-3); width: 96px; white-space: nowrap; }
.info-table td:last-child { word-break: break-all; user-select: text; }

/* ================= Toast ================= */
/* 位置: 右下、播放条上方。
   之前放在右上角会盖住视图工具栏(排序/导入按钮)和正在播放页的歌词,
   而底部右侧在两种布局下都是"空白安全区"。新的在最下面就靠 column-reverse。 */
.toasts {
  position: absolute; right: 18px; bottom: calc(var(--player-h) + 14px);
  z-index: 400; display: flex; flex-direction: column-reverse; gap: 10px;
  max-width: min(420px, calc(100% - 36px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(22, 25, 34, .96); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-md);
  font-size: 13px; max-width: 100%;
  animation: slideIn .25s var(--ease);
  pointer-events: auto;
}
.toast.leaving { animation: slideOut .25s var(--ease) forwards; }
.toast.warn { border-left-color: var(--warn); }
.toast.error { border-left-color: var(--danger); }
.toast svg { width: 16px; height: 16px; color: var(--accent-2); flex: none; }
.toast.warn svg { color: var(--warn); }
.toast.error svg { color: var(--danger); }
.toast .toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast .toast-btn {
  margin-left: 6px; color: var(--accent-2); font-weight: 600; font-size: 12.5px; flex: none;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes slideOut { to { opacity: 0; transform: translateY(12px); } }

/* ================= 设置 ================= */
.settings-wrap { max-width: 760px; display: flex; flex-direction: column; gap: 22px; }
.settings-group {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.settings-group > h3 { font-size: 14.5px; margin-bottom: 4px; }
.settings-group > .hint { color: var(--tx-3); font-size: 12.5px; margin-bottom: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 13.5px; }
.setting-label small { display: block; color: var(--tx-3); font-size: 12px; margin-top: 1px; }

/* 文本输入(设置页 OSS 清单地址等): 与模态框输入框保持同一套视觉 */
.txt-input {
  flex: 1 1 240px; min-width: 0; max-width: 420px;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--tx-1); border-radius: 9px; padding: 9px 12px; font-size: 13px; outline: none;
}
.txt-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal textarea {
  width: 100%; min-height: 138px; resize: vertical;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--tx-1); border-radius: 9px; padding: 10px 13px; font-size: 12.5px; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6;
}
.modal textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal .modal-hint { color: var(--tx-3); font-size: 12.5px; margin-bottom: 10px; }

/* ---- OSS 音乐 ---- */
.oss-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2);
}
.oss-badge.warn { background: rgba(240, 180, 80, .16); color: var(--warn); }
.oss-state { color: var(--tx-3); font-size: 12.5px; }
.oss-state b { color: var(--tx-2); font-weight: 600; }
.oss-state.fail { color: var(--danger); }

.switch { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.switch .knob {
  position: absolute; inset: 0; border-radius: 20px; background: var(--bg-4);
  border: 1px solid var(--line-2); transition: background .2s;
}
.switch .knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .2s var(--ease);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.switch input:checked + .knob { background: var(--accent); border-color: transparent; }
.switch input:checked + .knob::after { transform: translateX(18px); }

.accent-dots { display: flex; gap: 9px; }
.accent-dot {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s, border-color .15s;
  position: relative;
}
.accent-dot:hover { transform: scale(1.12); }
.accent-dot.active { border-color: #fff; }
.accent-dot.active::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--bg-1); }

/* 均衡器 */
.eq-panel { margin-top: 6px; }
.eq-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 5px 13px; border-radius: 18px; font-size: 12.5px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--tx-2);
  transition: all .15s;
}
.chip:hover { border-color: var(--line-2); color: var(--tx-1); }
.chip.active, .chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.eq-sliders { display: flex; justify-content: space-between; align-items: stretch; }
.eq-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.eq-val { font-size: 11px; color: var(--tx-2); font-variant-numeric: tabular-nums; height: 14px; }
.eq-slider { position: relative; width: 26px; height: 150px; }
.eq-slider input[type="range"] {
  position: absolute; left: 50%; top: 50%;
  width: 150px; height: 26px; transform: translate(-50%, -50%) rotate(-90deg);
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; margin: 0;
}
.eq-slider input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--bg-4), var(--bg-3)); }
.eq-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); margin-top: -5px;
}
.eq-slider input:disabled { opacity: .35; cursor: default; }
.eq-hz { font-size: 10.5px; color: var(--tx-3); }
.eq-hz small { font-size: 9.5px; }

/* 快捷键表 */
.kbd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kbd-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.kbd-table td:first-child { color: var(--tx-2); width: 55%; }
.kbd { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line-2); border-bottom-width: 2px; font-size: 11.5px; font-family: Consolas, monospace; margin-right: 4px; }

/* ================= 拖放遮罩 ================= */
.drop-overlay {
  position: absolute; inset: 0; z-index: 500;
  background: rgba(5, 6, 10, .8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fade .15s;
}
.drop-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed rgba(255, 255, 255, .25); border-radius: var(--radius-lg);
  padding: 52px 72px; color: var(--tx-1);
  background: rgba(12, 14, 20, .85);
}
.drop-box svg { width: 44px; height: 44px; color: var(--tx-2); }
.drop-box span { color: var(--tx-2); font-size: 13px; }

/* 进度环(导入中) */
.spin-ring {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

/* ================= 骨架屏(首屏/加载中) ================= */
.skeleton { display: block; padding: 4px 0; }
.skeleton .sk-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; }
.skeleton .sk-cover {
  width: 40px; height: 40px; border-radius: 7px; flex: none;
  background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-4) 50%, var(--bg-3) 100%);
  background-size: 220% 100%; animation: skShimmer 1.5s linear infinite;
}
.skeleton .sk-lines { flex: 1; min-width: 0; }
.skeleton .sk-bar {
  display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-4) 50%, var(--bg-3) 100%);
  background-size: 220% 100%; animation: skShimmer 1.5s linear infinite;
}
.skeleton .sk-bar.sm { height: 9px; }
.skeleton .sk-bar + .sk-bar { margin-top: 8px; }
@keyframes skShimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  /* 原来是 grid-template-columns(对 flex 容器无效的空规则) + 把歌词直接 display:none 掉;
     现在保持左右两栏, 只把宽度收一点: 900-1180 之间歌词依旧可读 */
  .np-right { width: min(400px, 40%); padding: 20px 28px 20px 0; }
  .np-cover-wrap { width: min(320px, 62%, 40vh); }
}

/* 矮窗口(<=640px 高): 唱片和间距整体收一点, 避免左栏内容被 .np-wrap 的 overflow:hidden 裁掉 */
@media (max-height: 640px) {
  .np-cover-wrap { width: min(200px, 46%, 26vh); margin-bottom: 14px; }
  .np-left { padding-top: 8px; }
  .np-title { font-size: 18px; }
  .np-actions { margin-top: 8px; margin-bottom: 2px; }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 68px; }
  /* 68px 收窄轨: 只留图标(+ 数字徽标), 文字标签全部收起 */
  .logo-text, .side-head, .playlist-nav, .side-stat, .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
  .nav-item .nav-badge {
    position: absolute; top: 3px; right: 7px; margin: 0;
    min-width: 15px; height: 15px; font-size: 10px; padding: 0 4px;
  }
  /* 导入按钮保留图标, 只藏文字 */
  .btn-block .btn-label { display: none; }
  .btn-block { padding: 10px 0; gap: 0; }
}

/* ================= 移动布局 (<900px): 底部标签栏 + 紧凑播放条 ================= */
.tabbar { display: none; }

@media (max-width: 899px) {
  :root { --player-h: 96px; --topbar-h: 56px; --sidebar-w: 0px; }
  /* 工具栏: 手机上把动作按钮压成一行横向滚动, 避免标题区被挤到换行 */
  .view-toolbar { gap: 10px; margin-bottom: 12px; align-items: center; }
  .toolbar-title { font-size: 20px; }
  .toolbar-actions {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 -2px; padding: 2px; max-width: 100%;
  }
  .toolbar-actions::-webkit-scrollbar { display: none; }
  .toolbar-actions .btn, .toolbar-actions .seg, .toolbar-actions .seg button { flex: none; white-space: nowrap; }
  /* 移动端取消固定比例舞台: 固定铺满视口(100dvh 跟随地址栏/Home 条收缩) */
  #stage {
    position: fixed; left: 0; top: 0; right: 0; bottom: 0;
    width: 100%; height: 100vh; aspect-ratio: auto;
    transform: none;
  }
  @supports (height: 100dvh) {
    #stage { height: 100dvh; }
  }
  body.letterboxed #stage { border-radius: 0; border: none; box-shadow: none; }
  #sidebar { display: none; }
  .app { grid-template-columns: 1fr; }
  .topbar { padding: 0 calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px)); }
  .topbar-queue { display: none; }
  .searchbox { max-width: none; height: 38px; }
  .view { padding: 14px 14px 22px; }

  /* 底部标签栏(下缘避开 Home 指示条) */
  .tabbar {
    display: flex; flex: none;
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line);
    background: #090b10;
  }
  /* Toast 在移动端要同时避开播放条与标签栏, 否则会压住播放控件 */
  .toasts { bottom: calc(var(--player-h) + 54px + env(safe-area-inset-bottom, 0px) + 12px); left: 12px; right: 12px; max-width: none; }
  .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--tx-3); font-size: 10.5px; letter-spacing: .5px;
    border-radius: 8px;
  }
  .tabbar button svg { width: 21px; height: 21px; }
  .tabbar button.active, .tabbar button[aria-current="page"] { color: var(--accent-2); }
  .tabbar button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -3px; }

  /* 紧凑播放条(左右避让刘海/圆角) */
  .player-bar {
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
    padding: 6px calc(10px + env(safe-area-inset-right, 0px)) 6px calc(10px + env(safe-area-inset-left, 0px));
    gap: 8px;
  }
  .pb-left { gap: 8px; }
  /* 心形按钮在正在播放页已有, 窄屏播放条里省掉给曲目名让位 */
  .pb-like { display: none; }
  .pb-cover { width: 44px; height: 44px; }
  .pb-title { font-size: 13px; }
  .pb-artist { font-size: 11px; }
  .pb-right .pb-volume, #btn-speed, #btn-timer, #btn-lyrics-view { display: none; }
  .pb-controls { gap: 0; }
  .pb-btn { width: 32px; height: 32px; }
  .pb-btn svg { width: 16px; height: 16px; }
  .pb-play { width: 40px; height: 40px; margin: 0 4px; }
  .pb-play svg { width: 17px; height: 17px; }
  .pb-progress { max-width: none; gap: 8px; }
  .pb-time { min-width: 32px; font-size: 10.5px; }

  /* 播放队列: 全屏覆盖(fixed 才能盖住播放条/标签栏, 抽屉用 transform 滑入) */
  .queue-panel {
    position: fixed; inset: 0; width: auto; max-width: none;
    border-left: none; box-shadow: none;
  }

  /* 详情页 */
  .detail-cover { width: 132px; height: 132px; }
  .detail-name { font-size: 24px; }
  .detail-actions { gap: 8px; }
  .detail-actions .btn { padding: 7px 12px; }

  /* 曲目列表列(隐藏艺术家/专辑列) */
  .tracklist-head, .track-row { grid-template-columns: 28px minmax(0, 1fr) 74px 40px; }
  .tr-album, .tracklist-head .tl-col:nth-child(4) { display: none; }
  .tracklist-head .tl-col:nth-child(3) { display: none; }
  .tr-artist { display: none; }

  /* 正在播放: 方形封面在上, 歌词铺满下方 */
  /* justify-content:flex-start: 竖向居中会让超高的左栏两头都被裁掉, 改成一端对齐 */
  .np-wrap { flex-direction: column; justify-content: flex-start; }
  .np-left { flex: 0 0 auto; min-height: 0; padding: 20px 16px 6px; }
  .np-cover-wrap { width: min(230px, 52vw, 30dvh); margin: 0 auto 14px; }
  #np-cover {
    border-radius: 14px; animation: none;
    border: none; box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
    width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  }
  .np-cover-hole { display: none; }
  .np-viz { display: none; }
  .np-title { font-size: 18px; }
  .np-artist { font-size: 13px; }
  .np-actions { margin-top: 10px; margin-bottom: 2px; }
  .np-right {
    display: block; flex: 1 1 auto; width: 100%; min-height: 0;
    padding: 0 20px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 24px);
    mask-image: linear-gradient(180deg, transparent 0, #000 24px);
  }
  .lyrics-lines { padding: 26px 8% 12%; }
  .lyr-line { text-align: center; transform-origin: center center; }

  .card-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
  .modal { width: calc(100vw - 40px); }
}

/* 矮手机(<=620px 高): 竖排塞不下封面+歌词, 让整页可滚动, 歌词区单独限高滚动 */
@media (max-width: 899px) and (max-height: 620px) {
  .np-wrap { overflow-y: auto; }
  .np-left { flex: 0 0 auto; }
  .np-right { flex: 0 0 auto; min-height: 0; }
  .lyrics-lines { height: auto; max-height: 44vh; }
}

/* 横屏手机(窄 + 矮): 竖向排布塞不下封面和歌词, 回到左右两栏 */
@media (max-width: 899px) and (max-height: 520px) {
  .np-wrap { flex-direction: row; justify-content: center; overflow: hidden; }
  .np-left { flex: 1 1 auto; justify-content: flex-start; padding: 8px 8px 8px 0; }
  .np-cover-wrap { width: min(150px, 30vw, 40vh); margin: 0 auto 8px; }
  .np-right {
    flex: 0 0 44%; width: 44%; height: 100%; min-height: 0;
    padding: 0 12px 0 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px);
  }
  .lyrics-lines { padding: 14px 4%; height: 100%; max-height: none; }
  .lyr-line { text-align: left; transform-origin: left center; }
}

/* ================= 触摸设备: 悬停才出现的控件必须常显 ================= */
@media (hover: none) {
  .tr-like, .q-remove { opacity: 1; }
  /* 卡片播放键在触屏上常显(原来 opacity:0 + translateY 完全不可见) */
  .card-hover-play { opacity: 1; transform: none; }
}

/* ================= 粗指针: 44px 命中区 ================= */
@media (pointer: coarse) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  /* 播放条按钮占地不变(中间列很窄), 用伪元素把命中区撑到 44px 高 /
     40px 宽(横向再大就会和相邻按钮的命中区重叠) */
  .pb-btn { min-height: 44px; }
  .pb-btn::after { content: ""; position: absolute; inset: -5px -3px; }
  .pb-play::after { content: ""; position: absolute; inset: -2px; }
  .q-remove { min-width: 40px; min-height: 40px; }
  .search-clear { width: 40px; height: 40px; }
  .pb-seek, .vol-slider { height: 28px; }
  .lyr-line { padding: 12px 6px; }
}

/* ================= 减少动效: 真正停掉动画, 而不是压缩成 0.01ms 的高频闪烁 ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  /* 明确写出的静态替代样式 */
  #np-cover { animation: none !important; }
  .eq-bars i { animation: none !important; height: 10px; }
  .skeleton .sk-bar, .skeleton .sk-cover { animation: none !important; }
  .toast.leaving { opacity: 0; }
}
