/* 本地云音乐 v2 —— 深色简约卡片风（Apple Music / Netflix 信息层级，原创实现） */
:root {
  --accent: #fa2d48;          /* Apple Music 红（品牌色，固定） */
  --accent-deep: #e0263f;
  /* 动态主题色（随封面，theme.js 注入；默认=品牌红） */
  --accent-dyn: hsl(352 96% 58%);
  --accent-dyn-2: hsl(10 96% 74%);
  --accent-dyn-soft: hsl(352 96% 58% / .28);
  --bg: #000000;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --surface-3: #2a2a2a;
  --ink: #f5f5f7;
  --ink-2: rgba(245,245,247,.62);
  --ink-3: rgba(245,245,247,.38);
  --line: rgba(255,255,255,.09);
  --bar-h: 84px;
  --top-h: 60px;
  --radius: 14px;
  --radius-lg: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* hidden 属性必须压过组件自身的 display（flex/grid 会覆盖 UA 默认样式） */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
               "Noto Sans CJK SC", "Noto Sans CJK JP", "WenQuanYi Zen Hei",
               "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
img { -webkit-user-drag: none; }
/* 滚动条：默认透明，滚动时淡入（.scrolling 由 util.js 绑定），静止画面更干净 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background .3s; }
.scrolling::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }
.scrolling::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }
/* Firefox */
.main, .rail-track, .drawer-list, .ap-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.main.scrolling, .rail-track.scrolling, .drawer-list.scrolling, .ap-scroll.scrolling { scrollbar-color: rgba(255,255,255,.16) transparent; }

/* 氛围背景：容器内两个 .ambient-layer 交叉淡入淡出（1s），
   模糊/暗角在容器上统一做，层本身只负责背景图与透明度。 */
.ambient-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s ease;
  pointer-events: none;
}
.ambient-layer.show { opacity: 1; }

/* ---------- 顶栏：毛玻璃 ---------- */
.topbar {
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 26px;
  padding: 0 24px;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.tabs { display: flex; gap: 4px; }
.tab {
  padding: 7px 16px; border-radius: 999px;
  color: var(--ink-2); font-size: 13.5px;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: #fff; background: var(--surface-3); font-weight: 600; }
.tab-n { font-size: 11px; color: var(--ink-3); margin-left: 5px; font-weight: 400; }
.tab.active .tab-n { color: var(--ink-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  width: 230px;
  color: var(--ink-3);
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: rgba(255,255,255,.22); background: var(--surface-3); color: var(--ink-2); }
.search input { background: none; border: 0; outline: 0; color: var(--ink); width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: invert(.7); }

/* ---------- 主区 ---------- */
.main { flex: 1; overflow-y: auto; min-width: 0; padding: 26px 28px 40px; scroll-behavior: smooth; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 26px;
  min-height: 220px;
}
.hero-bg {
  position: absolute; inset: 0;
  filter: blur(46px) saturate(1.3) brightness(.5);
  transform: scale(1.3);
  overflow: hidden;
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.55) 100%);
}
.hero-inner {
  position: relative;
  display: flex; align-items: center; gap: 28px;
  padding: 30px 34px;
}
.hero-cover {
  width: 160px; height: 160px; flex: none;
  border-radius: 12px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
}
.hero-meta { min-width: 0; }
.hero-kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 8px;
}
.hero-meta h1 {
  font-size: 30px; font-weight: 700; line-height: 1.2; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-sub { font-size: 13.5px; color: var(--ink-2); margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 9px 24px;
  font-size: 13.5px; font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:active { transform: scale(.96); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: var(--ink);
  border-radius: 999px; padding: 9px 20px;
  font-size: 13.5px; font-weight: 500;
  backdrop-filter: blur(8px);
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-ghost.on { color: var(--accent); }
.btn-ghost.small { padding: 5px 14px; font-size: 12.5px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 16px 5px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12.5px;
  transition: background .15s, color .15s;
}
/* 全部 / 最近 chip 无头像，左右内边距对称 */
.chip[data-artist=""] { padding-left: 16px; }
.chip-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; display: block;
  background: var(--surface-3);
}
.chip:hover { background: var(--surface-3); color: var(--ink); }
.chip.active { background: var(--ink); color: #000; font-weight: 600; }
.chip.active .tab-n { color: #555; }

/* ---------- 卡片 rail ---------- */
.rail { margin-bottom: 34px; }
.rail-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
/* rail 标题红色短竖条：视觉锚点 */
.rail-head h2 {
  font-size: 19px; font-weight: 700; letter-spacing: .2px;
  display: flex; align-items: center; gap: 10px;
}
.rail-head h2::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px;
  background: var(--accent); flex: none;
}
.rail-head h2.rail-link { cursor: pointer; }
.rail-head h2.rail-link:hover { color: var(--accent); }
.rail-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* 「播放全部」ghost 小胶囊 */
.rail-play {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-2); font-size: 12.5px;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.rail-play:hover { background: var(--surface-2); color: var(--accent); border-color: rgba(250,45,72,.4); }
.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  /* 不用 scroll-snap：proximity 会把 scrollLeft 吸附回卡片边界，
     导致滚到最左/最右时实际停在 2px 处，端点放行判断失效 */
  scrollbar-width: thin;
}
.card {
  scroll-snap-align: start;
  cursor: pointer;
  outline: none;
  border-radius: var(--radius);
}
.card-poster {
  position: relative;
  width: 168px; height: 168px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s cubic-bezier(.2,.7,.3,1);
}
/* 极细内描边：黑底上的"实体唱片"感 */
.card-poster::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.07);
  pointer-events: none;
}
.card:hover .card-poster, .card:focus-visible .card-poster {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
}
/* 歌手栏目：圆形头像卡（深色描边 + hover 上浮） */
.artist-card .card-poster, .artist-card .card-poster img { border-radius: 50%; }
.artist-card .card-poster::after { border: 2px solid rgba(255,255,255,.1); }
.artist-card .card-title { text-align: center; }
.artist-card .card-sub { text-align: center; }
.rail-empty { color: var(--ink-3); font-size: 13px; padding: 18px 4px; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.55) 100%);
  opacity: 0; transition: opacity .2s;
}
.card:hover .card-shade { opacity: 1; }
.card-play {
  position: absolute; right: 10px; bottom: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(250,45,72,.95); color: #fff;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(6px) scale(.8);
  transition: opacity .2s cubic-bezier(.2,.7,.3,1), transform .2s cubic-bezier(.2,.7,.3,1), background .15s;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.card:hover .card-play, .card.playing .card-play { opacity: 1; transform: none; }
.card-play:hover { background: var(--accent-deep); }
.card-badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  color: var(--ink); font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.card-fav {
  position: absolute; right: 8px; top: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.85);
  display: grid; place-items: center;
  transition: color .15s, transform .15s;
}
.card-fav.on { color: var(--accent); }
.card-fav:hover { color: var(--accent); transform: scale(1.12); }
.card-body { padding: 10px 2px 0; }
.card-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card.playing .card-title { color: var(--accent); }
/* 副标题降一级：12px + 半透明白，与标题拉开层级 */
.card-meta {
  font-size: 12px; color: rgba(255,255,255,.5); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-sub {
  font-size: 12px; color: rgba(255,255,255,.5); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 正在播放的均衡器小条 */
.card-eq { display: none; position: absolute; left: 10px; bottom: 12px; gap: 2.5px; align-items: flex-end; height: 14px; }
.card.playing .card-eq { display: inline-flex; }
.card-eq i { width: 3px; background: #fff; border-radius: 1.5px; animation: eq 1s ease-in-out infinite; }
.card-eq i:nth-child(1) { height: 60%; }
.card-eq i:nth-child(2) { height: 100%; animation-delay: .25s; }
.card-eq i:nth-child(3) { height: 45%; animation-delay: .5s; }
.card-eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* 栏目/网格进场：卡片依次淡入上浮（一次性，不循环；只动 transform/opacity）。
   只挂在 .enter 上：切视图/搜索时由 renderMain 加类触发；
   点播放等触发的重渲染不加类，卡片原地更新不重放进场动画（避免"刷新"闪动） */
@keyframes cardin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rail-track.enter .card, .grid.enter .card, .ap-grid.enter .card {
  animation: cardin .32s cubic-bezier(.2,.7,.3,1) backwards;
}
.rail-track.enter .card:nth-child(1), .grid.enter .card:nth-child(1), .ap-grid.enter .card:nth-child(1) { animation-delay: .00s; }
.rail-track.enter .card:nth-child(2), .grid.enter .card:nth-child(2), .ap-grid.enter .card:nth-child(2) { animation-delay: .03s; }
.rail-track.enter .card:nth-child(3), .grid.enter .card:nth-child(3), .ap-grid.enter .card:nth-child(3) { animation-delay: .06s; }
.rail-track.enter .card:nth-child(4), .grid.enter .card:nth-child(4), .ap-grid.enter .card:nth-child(4) { animation-delay: .09s; }
.rail-track.enter .card:nth-child(5), .grid.enter .card:nth-child(5), .ap-grid.enter .card:nth-child(5) { animation-delay: .12s; }
.rail-track.enter .card:nth-child(6), .grid.enter .card:nth-child(6), .ap-grid.enter .card:nth-child(6) { animation-delay: .15s; }
.rail-track.enter .card:nth-child(n+7), .grid.enter .card:nth-child(n+7), .ap-grid.enter .card:nth-child(n+7) { animation-delay: .18s; }

/* 数字等宽：时长/进度/计数不跳动 */
.tab-n, .rail-count, .section-sub, .card-badge, .q-dur, .drawer-sub, .ap-sub {
  font-variant-numeric: tabular-nums;
}

/* 心形点击"心跳"反馈 */
@keyframes heartbeat { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.card-fav.beat, .pb-fav.beat, .btn-ghost.beat { animation: heartbeat .22s cubic-bezier(.2,.7,.3,1); }

/* 网格模式（喜欢 / 最近 / 搜索） */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px 18px;
}
.grid .card-poster { width: 100%; height: auto; aspect-ratio: 1; }
.section-title { font-size: 19px; font-weight: 700; margin-bottom: 16px; }
.section-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-left: 10px; }

.empty { text-align: center; color: var(--ink-3); padding: 90px 0; font-size: 13.5px; line-height: 2; }

/* ---------- 底部播放条 ---------- */
.playerbar {
  height: var(--bar-h); flex: none;
  border-top: 1px solid var(--line);
  background: rgba(12,12,12,.72);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  display: grid;
  grid-template-columns: 300px 1fr 220px;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  z-index: 22;
}
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-cover-wrap { position: relative; width: 50px; height: 50px; flex: none; cursor: pointer; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.pb-cover { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; display: block; background: var(--surface-3); }
/* 未在播放：无 src 的 img 在部分浏览器会渲染破图图标/边框，idle 态直接隐藏 img，露出容器底色 */
.pb-cover.idle { visibility: hidden; }
.pb-cover-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.pb-cover-wrap:hover .pb-cover-mask { opacity: 1; }
.pb-info { 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(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pb-artist:hover { color: var(--ink-2); text-decoration: underline; }
.pb-fav { color: var(--ink-3); flex: none; }
.pb-fav.on { color: var(--accent); }
.pb-fav:hover { color: var(--accent); }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; width: 100%; }
.pb-controls { display: flex; align-items: center; gap: 22px; }
.icon-btn { color: var(--ink-2); padding: 4px; border-radius: 50%; display: grid; place-items: center; transition: color .12s; }
.icon-btn:hover { color: #fff; }
.play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: #000;
  display: grid; place-items: center;
  transition: transform .12s, background .15s;
}
.play-btn:hover { transform: scale(1.07); background: #fff; }
.play-btn:active { transform: scale(.95); }
.pb-progress { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); }
.time { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; width: 38px; text-align: center; flex: none; }

/* 进度条：默认 3px，hover/拖动变 6px 并露出拖柄；已播放段红色渐变 */
.bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.16); cursor: pointer; position: relative;
  touch-action: none;
  transition: height .15s cubic-bezier(.2,.7,.3,1);
}
.bar:hover, .bar.dragging { height: 6px; }
.bar::before { content: ""; position: absolute; inset: -8px 0; }
.bar-fill { height: 100%; width: 0%; border-radius: 3px; background: var(--ink-2); position: relative; pointer-events: none; transition: background .15s; }
.bar:hover .bar-fill, .bar.dragging .bar-fill { background: linear-gradient(90deg, var(--accent-dyn), var(--accent-dyn-2)); }
.bar-dot {
  position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%) scale(.7);
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .15s, transform .15s cubic-bezier(.2,.7,.3,1);
}
.bar:hover .bar-dot, .bar.dragging .bar-dot { opacity: 1; transform: translateY(-50%) scale(1); }
.bar-dot:hover { transform: translateY(-50%) scale(1.2); }
.pb-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.vol-bar { max-width: 100px; }

/* ---------- 播放队列抽屉 ---------- */
/* 抽屉：250ms 滑入 + 遮罩淡入（关闭由 JS 加 .closing 反向播放后隐藏） */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; animation: maskin .25s ease-out; }
.drawer-mask.closing { animation: maskout .22s ease-in forwards; }
@keyframes maskin { from { opacity: 0; } to { opacity: 1; } }
@keyframes maskout { from { opacity: 1; } to { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: var(--bar-h);
  width: 380px; max-width: 92vw;
  background: rgba(22,22,22,.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid var(--line);
  z-index: 31;
  display: flex; flex-direction: column;
  animation: slidein .25s cubic-bezier(.2,.7,.3,1);
}
.drawer.closing { animation: slideout .22s cubic-bezier(.4,0,.7,.3) forwards; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideout { from { transform: none; } to { transform: translateX(100%); } }
.drawer-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.drawer-head h2 { font-size: 16px; font-weight: 700; }
.drawer-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.drawer-list { flex: 1; overflow-y: auto; padding: 8px 0 14px; }
.q-row {
  display: grid; grid-template-columns: 30px 1fr auto;
  align-items: center; gap: 10px;
  padding: 10px 22px;
  cursor: pointer;
  transition: background .12s;
}
.q-row:hover { background: rgba(255,255,255,.06); }
.q-row.playing .q-title { color: var(--accent); }
.q-idx { font-size: 11.5px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.q-row.playing .q-idx { color: var(--accent); }
.q-main { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.q-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-artist { font-size: 11.5px; color: var(--ink-3); flex: none; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-dur { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 在线搜歌面板（歌曲宝） ---------- */
.online-panel .drawer-head { gap: 10px; align-items: center; }
.online-panel .drawer-head > div:first-child { flex: 1; min-width: 0; }
.online-search {
  display: flex; gap: 8px; padding: 14px 22px 10px;
}
.online-search input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; color: var(--ink); font-size: 13px; outline: 0;
}
.online-search input:focus { border-color: rgba(255,255,255,.25); }
.online-search input::placeholder { color: var(--ink-3); }
.btn-primary.small { padding: 7px 16px; font-size: 12.5px; flex: none; }
.online-login { padding: 4px 22px 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.online-login input {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; color: var(--ink); font-size: 13px; outline: 0;
}
.online-login input:focus { border-color: rgba(255,255,255,.25); }
.online-login input::placeholder { color: var(--ink-3); }
.online-login-row { display: flex; align-items: center; gap: 8px; }
.online-login-tip { font-size: 11px; color: var(--ink-3); }
.online-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px;
  transition: background .12s;
}
.online-row:hover { background: rgba(255,255,255,.06); }
.online-info { flex: 1; min-width: 0; }
.online-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-artist { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-row .btn-primary.small, .online-row .btn-ghost.small { flex: none; }
.online-empty { padding: 30px 22px; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

/* ---------- 全屏播放页 ---------- */
.nowplaying {
  position: fixed; inset: 0 0 var(--bar-h) 0;
  z-index: 25;
  background: #0a0a0a;
  display: flex; flex-direction: column;
  animation: npfade .25s ease-out;
  overflow: hidden;
}
@keyframes npfade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.np-bg {
  position: absolute; inset: -60px;
  filter: blur(70px) saturate(1.35) brightness(.42);
  transform: scale(1.2);
  overflow: hidden;
}
/* 全屏页暗角：中心透出封面色，四周压暗，更有纵深 */
.np-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 30%, rgba(0,0,0,.55) 100%);
}
/* 动态主题色光晕：随封面主色微变的氛围层（交叉淡入由 opacity 过渡） */
.np-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 38%, var(--accent-dyn-soft), transparent 70%);
  transition: opacity .8s ease;
}
.np-close {
  position: absolute; top: 16px; left: 18px; z-index: 2;
  color: var(--ink-2); padding: 8px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  transition: background .15s, color .15s;
  display: grid; place-items: center;   /* svg 块级居中，避免行内基线把按钮撑成椭圆 */
}
.np-close svg { display: block; }
.np-close:hover { background: rgba(255,255,255,.16); color: #fff; }
/* 全屏页左上角操作组：收起 + 全屏（歌手页仍单独用 .np-close 绝对定位） */
.np-topactions {
  position: absolute; top: 16px; left: 18px; z-index: 2;
  display: flex; gap: 10px;
}
.np-topactions .np-close { position: static; }
/* 全屏沉浸模式：底部播放条与左上角按钮组淡出隐藏，播放页铺满整屏；
   鼠标移到对应区域即淡入浮现（底部整条 / 左上角），移开自动隐去；
   按 Esc 退出全屏后恢复常显（fullscreenchange 同步）。
   隐藏用 opacity:0 而非 display:none / pointer-events:none：
   元素仍占位可命中 hover，鼠标移入自身即触发浮现，无需另设热区 */
body.is-fullscreen .playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  opacity: 0;
  transition: opacity .25s ease;
}
body.is-fullscreen .playerbar:hover { opacity: 1; }
body.is-fullscreen .np-topactions {
  opacity: 0;
  transition: opacity .25s ease;
}
body.is-fullscreen .np-topactions:hover { opacity: 1; }
body.is-fullscreen .nowplaying { bottom: 0; }
.np-body {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 34px; padding: 40px 30px; min-height: 0;
}
.np-cover-wrap {
  --np-size: min(320px, 52vh);
  --disc-size: calc(var(--np-size) * .92);
  position: relative; flex: none;
  width: var(--np-size); height: var(--np-size);
  transition: width .5s cubic-bezier(.2,.7,.3,1);
}
.np-cover {
  position: relative; z-index: 2;
  width: var(--np-size); height: 100%;
  border-radius: 14px; object-fit: cover;
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.nowplaying.paused .np-cover { transform: scale(.88); }
/* 封面形式三态：cover 纯封面 | vinyl 唱片抽出 | disc 网易云式黑胶（胶盘为主体，封面嵌中心） */
.nowplaying.vinyl .np-cover-wrap { width: calc(var(--np-size) * 1.6); }
/* disc：黑色胶盘（无沟槽纹，对齐网易云）+ 旋转高光，外圈半透明光晕环；
   半透明底 + backdrop blur = 毛玻璃胶盘（透出氛围背景色） */
.np-vinyl-disc {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 50%;
  display: none; place-items: center;
  background:
    conic-gradient(from 0deg, rgba(255,255,255,.10), transparent 22%,
      rgba(255,255,255,.05) 50%, transparent 74%, rgba(255,255,255,.10)),
    rgba(18,18,18,.55);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow:
    0 0 0 10px rgba(255,255,255,.04),
    0 0 0 11px rgba(255,255,255,.06),
    0 24px 70px rgba(0,0,0,.7);
  animation: spin 20s linear infinite;
  animation-play-state: paused;
}
.nowplaying.disc .np-vinyl-disc { display: grid; animation-play-state: running; }
.nowplaying.disc.paused .np-vinyl-disc { animation-play-state: paused; }
/* 封面嵌在唱片中心当标签，随盘一起转（占比 70%，胶盘露一圈） */
.nowplaying.disc .np-cover {
  position: absolute; z-index: 2;
  left: 50%; top: 50%;
  width: 70%; height: 70%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(10,10,10,.9), 0 0 0 4px rgba(255,255,255,.12);
  animation: spin-center 20s linear infinite;
  animation-play-state: running;
}
.nowplaying.disc.paused .np-cover { animation-play-state: paused; }
@keyframes spin-center {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
/* 唱臂：直接使用网易云原版素材 assets/needle.png（来自 jevonsflash/maui-samples，
   与 PangHaHa12138/MusicPlayer2.0、huoshulei/PonyMusic 的 ic_needle 同一素材）
   结构对应 Android 版：ImageView 顶部放置，绕支点旋钮旋转（素材内支点≈17.8%宽, 6.5%高，
   即参考实现 AnchorX=.18 / AnchorY=.059）；播放顺时针匀速 -30°→0° 落针，暂停逆时针抬回，盘停转 */
.np-tonearm {
  position: absolute; z-index: 4;
  width: calc(var(--np-size) * .36);
  height: auto;
  /* 支点在唱片正上方 12 点（水平居中），悬空盘缘外（距盘心 ≈1.47R）
     left = 50% - 宽×.178，top = -23.5% - 高×.065 */
  left: calc(50% - var(--np-size) * .064);
  top: calc(-23.5% - var(--np-size) * .039);
  transform-origin: 17.8% 6.5%;         /* 旋转轴 = 素材内支点旋钮 */
  transform: rotate(-30deg);            /* 抬起态 */
  transition: transform .3s linear;     /* 匀速旋转（对应属性动画 LinearInterpolator） */
  display: none; pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
}
.nowplaying.disc .np-tonearm { display: block; }
.nowplaying.disc:not(.paused) .np-tonearm { transform: rotate(-10deg); }  /* 落针态：针尖压外缘沟槽 */
.np-disc {
  position: absolute; z-index: 1;
  left: calc((var(--np-size) - var(--disc-size)) / 2);
  top: calc((var(--np-size) - var(--disc-size)) / 2);
  width: var(--disc-size); height: var(--disc-size);
  transform: translateX(0); opacity: 0;
  transition: transform .6s cubic-bezier(.2,.7,.3,1), opacity .4s ease;
  filter: drop-shadow(0 14px 34px rgba(0,0,0,.6));
}
.nowplaying.vinyl .np-disc { transform: translateX(calc(var(--np-size) * .62)); opacity: 1; }
.np-disc-face {
  width: 100%; height: 100%; border-radius: 50%;
  /* 同心纹 + 旋转高光（让转动可见） */
  background:
    conic-gradient(from 0deg, rgba(255,255,255,.09), transparent 22%,
      rgba(255,255,255,.05) 50%, transparent 74%, rgba(255,255,255,.09)),
    repeating-radial-gradient(circle at 50% 50%, #101010 0 2px, #1b1b1b 2px 4px);
  border: 1px solid rgba(255,255,255,.08);
  display: grid; place-items: center;
  animation: spin 20s linear infinite;
  animation-play-state: paused;
}
.nowplaying.vinyl .np-disc-face { animation-play-state: running; }
.nowplaying.vinyl.paused .np-disc-face { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 唱片中心标签：取封面主题色 */
.np-disc-label {
  width: 34%; height: 34%; border-radius: 50%;
  background: var(--accent-dyn);
  border: 3px solid rgba(10,10,10,.9);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
  display: grid; place-items: center;
}
.np-disc-label i {
  width: 16%; height: 16%; border-radius: 50%;
  background: #000; border: 1px solid rgba(255,255,255,.3);
}
.np-style-toggle {
  position: absolute; top: 18px; right: 20px; z-index: 2;
  font-size: 12px; color: var(--ink-2);
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  transition: color .15s, border-color .15s, background .15s;
}
.np-style-toggle:hover { color: #fff; background: rgba(255,255,255,.12); }
.np-style-toggle.on { color: var(--accent); border-color: rgba(250,45,72,.5); }
/* 切歌时歌名/歌手淡入上浮，与背景交叉淡入同步 */
@keyframes npmeta { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.np-meta.swap { animation: npmeta .5s cubic-bezier(.2,.7,.3,1); }
.np-meta { text-align: center; max-width: 640px; min-width: 0; }
.np-titlerow {
  display: flex; align-items: baseline; justify-content: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.np-titlerow h1 { font-size: 24px; font-weight: 700; line-height: 1.3; min-width: 0; }
.np-artist { font-size: 15px; color: var(--accent); font-weight: 500; flex: none; }
.np-artist:hover { text-decoration: underline; }
.np-details {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
}
/* 元数据标签：细边框 + 微底色；在线来源用小圆点前缀（替代虚线框） */
.np-tag {
  font-size: 11.5px; color: var(--ink-2);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.np-tag.online { color: var(--ink-3); }
.np-tag.online::before {
  content: ""; display: inline-block;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-3); margin-right: 6px; vertical-align: 1px;
}
.np-tag.online::after { content: " ·在线"; font-size: 10px; }

/* ---------- 歌手详情页 ---------- */
.artistpage {
  position: fixed; inset: 0 0 var(--bar-h) 0;
  z-index: 26;
  background: #0a0a0a;
  animation: npfade .25s ease-out;
  overflow: hidden;
}
.ap-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  filter: brightness(.4) saturate(1.1);
}
.ap-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,.25) 0%, rgba(10,10,10,.82) 46%, #0a0a0a 78%);
}
.ap-scroll {
  position: relative; z-index: 1;
  height: 100%; overflow-y: auto;
  padding: 60px 44px 40px;
}
.ap-head { display: flex; align-items: flex-end; gap: 26px; margin-bottom: 26px; }
.ap-avatar {
  width: 168px; height: 168px; border-radius: 50%;
  object-fit: cover; flex: none;
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  border: 3px solid rgba(255,255,255,.14);
}
.ap-kicker { font-size: 12px; letter-spacing: 2px; color: var(--ink-2); margin-bottom: 6px; }
.ap-headmeta h1 { font-size: 40px; font-weight: 800; line-height: 1.15; margin-bottom: 8px; }
.ap-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }
.ap-sub b { color: var(--ink); font-weight: 600; }
.ap-bio {
  max-width: 860px; font-size: 13px; line-height: 1.85;
  color: var(--ink-2); margin-bottom: 30px;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ap-bio.expanded { -webkit-line-clamp: unset; }
.ap-tracks .section-title { margin-bottom: 14px; }
.ap-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px 18px; max-width: 1100px;
}
@media (max-width: 680px) {
  .ap-scroll { padding: 54px 18px 30px; }
  .ap-head { gap: 16px; }
  .ap-avatar { width: 104px; height: 104px; }
  .ap-headmeta h1 { font-size: 26px; }
  .ap-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 24px);
  transform: translateX(-50%);
  background: rgba(40,40,40,.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 20px; border-radius: 999px; font-size: 13px;
  z-index: 50; pointer-events: none;
  animation: npfade .18s ease-out;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .main { padding: 20px 18px 34px; }
  .rail-track { grid-auto-columns: 148px; }
  .card-poster { width: 148px; height: 148px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .hero-inner { padding: 24px; gap: 20px; }
  .hero-cover { width: 120px; height: 120px; }
  .hero-meta h1 { font-size: 24px; }
  .playerbar { grid-template-columns: 230px 1fr 150px; }
}
@media (max-width: 680px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .search { width: 140px; }
  .tab { padding: 6px 12px; font-size: 12.5px; }
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero-cover { width: 100px; height: 100px; }
  .rail-track { grid-auto-columns: 132px; gap: 14px; }
  .card-poster { width: 132px; height: 132px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 14px; }
  .playerbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .pb-right { display: none; }
  .pb-progress { display: none; }
  .pb-controls { gap: 14px; }
  .np-cover-wrap { --np-size: min(260px, 44vh); }
}
@media (prefers-reduced-motion: reduce) {
  .card:hover .card-poster { transform: none; }
  .card-eq i { animation: none !important; }
  .rail-track .card, .grid .card, .ap-grid .card { animation: none; }
  .card-fav.beat, .pb-fav.beat, .btn-ghost.beat { animation: none; }
  .ambient-layer { transition: none; }
  .np-disc-face { animation: none; }          /* 唱片不转，抽出效果保留 */
  .nowplaying.disc .np-vinyl-disc, .nowplaying.disc .np-cover { animation: none; }
  .np-tonearm { transition: none; }   /* 唱针直接落/抬，不做摆动 */
  .np-glow { transition: none; }
  .np-meta.swap { animation: none; }
  /* 保留滑入滑出动画：.closing 靠 animationend 语义延时隐藏，不能置 none */
  .main { scroll-behavior: auto; }
}
