/* =========================================================================
   白毛 · 音乐馆（全屏沉浸式）
   左=信息/歌词/均衡器 · 中=黑胶封面+进度+控制 · 右=目录式歌单
   音乐馆固定深色沉浸空间，不跟随日间模式（body.page-music）
   ========================================================================= */

/* ------------------------------------------------------- 整页沉浸外壳 */
body.page-music {
  background: #0a0d16;
  color: #eef1fa;
}
body.page-music::before { display: none; }          /* 关掉全站顶部氛围光，交给音乐自己的背景层 */
body.page-music .footer { display: none; }          /* 沉浸页不放页脚 */

/* 背景三层：封面主色微渐变 → 色调层 → 暗化遮罩 */
.music-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.music-bg__color,
.music-bg__tint,
.music-bg__veil { position: absolute; inset: 0; display: block; }

.music-bg__color {
  background:
    radial-gradient(120% 90% at 18% 8%, var(--cover-c1, #1b2450) 0%, transparent 55%),
    radial-gradient(110% 90% at 85% 92%, var(--cover-c2, #2a1740) 0%, transparent 58%),
    #0a0d16;
  opacity: .85;
  transition: background 1.2s ease;
}
.music-bg__tint { background: linear-gradient(160deg, rgba(109, 140, 255, .12), rgba(160, 107, 255, .06) 60%, transparent); }
.music-bg__veil {
  background:
    radial-gradient(90% 70% at 50% 45%, transparent 30%, rgba(6, 8, 14, .72) 100%),
    rgba(6, 8, 14, .42);
}

/* --------------------------------------------------------- 三栏主体 */
.music-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 340px;
  gap: 34px;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 34px 34px;
  min-height: calc(100dvh - 64px);        /* 64 = 顶栏高度，桌面端占满一屏 */
}

/* ------------------------------------------------------------- 左栏 */
.np-info { display: flex; flex-direction: column; min-width: 0; justify-content: center; }

.np-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.np-eyebrow span {
  font-size: 12px; font-weight: 600; letter-spacing: .42em;
  color: rgba(238, 241, 250, .5); text-transform: uppercase;
}
.np-rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(238,241,250,.28), transparent); }

.np-song {
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.15; font-weight: 800; letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np-artist { margin-top: 10px; font-size: 15px; color: rgba(238, 241, 250, .62); }

/* 歌词：遮罩上下渐隐 + 滚动高亮（此前该区块完全没有样式） */
.lyric {
  position: relative;
  margin-top: 26px;
  height: clamp(180px, 30vh, 300px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.lyric::-webkit-scrollbar { display: none; }
.lyric__inner { display: flex; flex-direction: column; gap: 12px; padding: 60px 0; }

.lyric__hint { color: rgba(238, 241, 250, .4); font-size: 14px; }

.lyric__line {
  font-size: 16px; line-height: 1.7; color: rgba(238, 241, 250, .38);
  cursor: pointer;
  transition: color .3s, transform .3s, font-size .3s;
  transform-origin: left center;
}
.lyric__line:hover { color: rgba(238, 241, 250, .7); }
.lyric__line--blank { cursor: default; }
.lyric__line.is-past { color: rgba(238, 241, 250, .22); }
.lyric__line.is-active {
  color: #fff; font-size: 19px; font-weight: 600;
  text-shadow: 0 0 26px rgba(109, 140, 255, .55);
}

/* 均衡器：播放时 16 根音条起伏 */
.eq { display: flex; align-items: flex-end; gap: 5px; height: 46px; margin-top: 26px; }
.eq span {
  width: 4px; height: 8px; border-radius: 99px;
  background: linear-gradient(180deg, #6d8cff, #a06bff);
  opacity: .55;
  transition: height .3s ease;
}
.is-playing .eq span { opacity: 1; animation: eq-rise 1.1s ease-in-out infinite; }
.eq span:nth-child(1)  { animation-delay: 0s; }
.eq span:nth-child(2)  { animation-delay: .09s; }
.eq span:nth-child(3)  { animation-delay: .18s; }
.eq span:nth-child(4)  { animation-delay: .27s; }
.eq span:nth-child(5)  { animation-delay: .36s; }
.eq span:nth-child(6)  { animation-delay: .45s; }
.eq span:nth-child(7)  { animation-delay: .05s; }
.eq span:nth-child(8)  { animation-delay: .14s; }
.eq span:nth-child(9)  { animation-delay: .23s; }
.eq span:nth-child(10) { animation-delay: .32s; }
.eq span:nth-child(11) { animation-delay: .41s; }
.eq span:nth-child(12) { animation-delay: .5s; }
.eq span:nth-child(13) { animation-delay: .07s; }
.eq span:nth-child(14) { animation-delay: .16s; }
.eq span:nth-child(15) { animation-delay: .25s; }
.eq span:nth-child(16) { animation-delay: .34s; }
@keyframes eq-rise { 0%, 100% { height: 8px; } 50% { height: 42px; } }

.np-status {
  margin-top: 20px; font-size: 12.5px; letter-spacing: .06em;
  color: rgba(238, 241, 250, .42);
}

/* ------------------------------------------------------------- 中栏 */
.np-stage { display: flex; flex-direction: column; align-items: center; gap: 26px; min-width: 0;
             width: min(46vh, 400px); margin: 0 auto; }

/* 黑胶唱片：封面圆裁嵌入中心标，盘面沟槽；播放时整盘旋转 */
.np-art-wrap {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #121218 0 2px, #191922 2px 4px),
    #121218;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .5s ease;
}
/* 中心标 = 专辑封面 */
.np-art {
  position: absolute; left: 50%; top: 50%; width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  object-fit: cover; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .14);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  z-index: 1;
}
/* 中孔 */
.np-art-wrap::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5%; height: 5%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #0b0f19; box-shadow: 0 0 0 2px rgba(255, 255, 255, .2);
  z-index: 2;
}
.is-playing .np-art-wrap { animation: disc-spin 12s linear infinite; }
@keyframes disc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .is-playing .np-art-wrap { animation: none; }
}

/* 进度条：带缓冲层 */
.np-progress { display: flex; align-items: center; gap: 14px; width: 100%; }
.np-time {
  font-size: 12.5px; color: rgba(238, 241, 250, .55);
  font-variant-numeric: tabular-nums; min-width: 44px; text-align: center;
}

.range { position: relative; flex: 1; height: 6px; border-radius: 99px;
         background: rgba(255, 255, 255, .14); cursor: pointer; }
.range--sm { flex: 0 0 92px; }
.range__buf {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .22);
}
.range__fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #6d8cff, #a06bff);
  transition: width .16s linear;
}
.range__knob {
  position: absolute; top: 50%; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5); transition: transform .18s;
}
.range:hover .range__knob, .range:focus-visible .range__knob { transform: translate(-50%, -50%) scale(1); }

/* 控制条 */
.np-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }

.np-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  color: rgba(238, 241, 250, .78);
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.np-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.np-btn svg { width: 18px; height: 18px; }
.np-btn.is-on { color: #8ea8ff; border-color: rgba(109, 140, 255, .6); background: rgba(109, 140, 255, .16); }
.np-btn--sm { width: 36px; height: 36px; }
.np-btn--sm svg { width: 16px; height: 16px; }

.np-btn--play {
  width: 62px; height: 62px; color: #0a0d16; border: 0;
  background: linear-gradient(135deg, #6d8cff, #a06bff);
  box-shadow: 0 14px 34px rgba(109, 140, 255, .42);
}
.np-btn--play:hover { color: #0a0d16; transform: translateY(-2px) scale(1.04); }
/* 播放三角是实心块，暂停两条竖线是描边——分开给，否则暂停键会隐形 */
.np-btn--play .i-play { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.np-btn--play .i-pause { width: 24px; height: 24px; stroke-width: 2.6; }

/* 图标状态互斥：SVG 上的 hidden 属性不可靠，统一用显式规则切换 */
.np-btn--play .i-pause { display: none; }
[data-player].is-playing .np-btn--play .i-play { display: none; }
[data-player].is-playing .np-btn--play .i-pause { display: block; }

.np-volume { display: flex; align-items: center; gap: 8px; }
.np-volume .i-vol, .np-volume .i-mute { fill: none; }
.np-volume .i-mute { display: none; }
.np-volume .np-btn.is-on .i-vol { display: none; }
.np-volume .np-btn.is-on .i-mute { display: block; }

/* 桌面端隐藏播放列表按钮（右栏常驻），移动端才需要抽屉开关 */
@media (min-width: 1025px) {
  .np-btn--pl { display: none; }
}

/* ----------------------------------------------------------- 右栏歌单 */
.pl-area {
  display: flex; flex-direction: column; min-height: 0;
  max-height: calc(100dvh - 130px);
  background: rgba(14, 18, 32, .62);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.pl-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.pl-head__title { font-size: 15px; font-weight: 700; color: #fff; }
.pl-head__count { font-size: 12.5px; color: rgba(238, 241, 250, .48); }
.pl-head__close {
  margin-left: auto; width: 32px; height: 32px; display: none;
  place-items: center; border-radius: 50%; color: rgba(238, 241, 250, .7);
  background: rgba(255, 255, 255, .07);
}
.pl-head__close svg { width: 15px; height: 15px; }

.pl-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px 18px; }
.pl-body::-webkit-scrollbar { width: 6px; }
.pl-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }
.pl-body::-webkit-scrollbar-track { background: transparent; }

.pl-group { margin-bottom: 16px; }
.pl-group__title {
  font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(238, 241, 250, .4); padding: 4px 8px 8px;
}
.pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.track {
  display: grid; grid-template-columns: 26px 44px minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 13px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.track:hover { background: rgba(255, 255, 255, .07); }
.track.is-active { background: rgba(109, 140, 255, .16); border-color: rgba(109, 140, 255, .4); }

.track__no { color: rgba(238, 241, 250, .42); font-size: 12px; font-variant-numeric: tabular-nums; }
.track__cover { width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
                border: 1px solid rgba(255, 255, 255, .12); }
.track__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.track__title { font-size: 14px; color: #eef1fa; overflow: hidden;
                text-overflow: ellipsis; white-space: nowrap; }
.track__artist { font-size: 12px; color: rgba(238, 241, 250, .48); overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
.track__dur { font-size: 12px; color: rgba(238, 241, 250, .42); font-variant-numeric: tabular-nums; }
.track.is-active .track__title { color: #9db4ff; }

/* 播放中：序号换成跳动音条 */
.track__eq { display: none; gap: 2.5px; align-items: flex-end; height: 14px; }
.track.is-active .track__no { display: none; }
.track.is-active .track__eq { display: flex; }
.track__eq i { width: 3px; height: 5px; border-radius: 2px; background: #8ea8ff;
               animation: eq-sm .9s ease-in-out infinite; }
.track__eq i:nth-child(2) { animation-delay: .15s; }
.track__eq i:nth-child(3) { animation-delay: .3s; }
@keyframes eq-sm { 0%, 100% { height: 5px; } 50% { height: 14px; } }

.pl-empty { color: rgba(238, 241, 250, .45); font-size: 13.5px; line-height: 1.8; padding: 10px 8px; }
.pl-empty code {
  display: block; margin-top: 8px; padding: 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .4); color: #9db4ff; font-size: 11.5px;
  overflow-wrap: anywhere; line-height: 1.6;
}

/* 移动端歌单遮罩 */
.pl-mask {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(4, 6, 12, .6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s;
}
.pl-mask.is-open { opacity: 1; visibility: visible; }

/* ----------------------------------------------------------- 响应式 */
@media (max-width: 1240px) {
  .music-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 24px; padding: 24px; }
}

@media (max-width: 1024px) {
  /* 手机端不能锁死滚动：竖排高于一屏，锁了播放键就够不到 */
  body.page-music { overflow: auto; }
  .music-shell {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: auto;
    padding: 26px 18px 44px;
  }
  .np-info { order: 1; align-items: center; text-align: center; }
  .np-eyebrow { justify-content: center; }
  .np-eyebrow .np-rule { display: none; }
  .np-stage { order: 2; width: min(74vw, 340px); }
  .eq { justify-content: center; }
  .np-status { text-align: center; }

  /* 歌单改为右侧抽屉 */
  .pl-area {
    position: fixed; top: 0; right: 0; z-index: 50;
    width: min(84vw, 360px); max-height: 100dvh; height: 100dvh;
    border-radius: 0; border-top: 0; border-bottom: 0; border-right: 0;
    transform: translateX(102%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    background: rgba(10, 13, 22, .96);
  }
  .pl-area.is-open { transform: translateX(0); }
  .pl-head__close { display: grid; }
  .pl-body { padding-bottom: 30px; }
}

@media (max-width: 560px) {
  .np-song { font-size: 1.75rem; }
  .lyric { height: 190px; }
  .np-controls { gap: 10px; }
  .np-btn { width: 40px; height: 40px; }
  .np-btn--play { width: 56px; height: 56px; }
  .range--sm { flex: 0 0 70px; }
  .np-progress { gap: 8px; }
  .np-time { min-width: 40px; }
}
