/* ============================================================
   APlayer 底部播放栏 -> 悬浮胶囊
   用法：本文件放在 blog-demo/source/css/ 下，
   并在 _config.butterfly.yml 的 inject.head 里加一行：
   <link rel="stylesheet" href="/css/music-capsule.css">
   ============================================================ */

/* 播放栏本体：悬浮、收窄、两头全圆、加阴影 */
.aplayer.aplayer-fixed .aplayer-body {
  left: 14px;
  bottom: 28px;
  max-width: 356px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

/* 去掉播放栏信息区顶部那条生硬的分隔线 */
.aplayer.aplayer-fixed .aplayer-info {
  border-top: none;
}

/* 歌单列表：圆角卡片，悬浮在胶囊上方 */
.aplayer.aplayer-fixed .aplayer-list {
  margin-bottom: 108px;
  margin-left: 14px;
  max-width: 356px;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

/* 歌词：显示两行（当前行大字 + 下一行小字预览），不滚动。
   当前行由 lrc-karaoke.js 按进度做逐字扫色（卡拉OK 效果）。
   歌词条悬浮在页面底部正中、离底抬高，像桌面歌词那样独立于播放器 */
.aplayer.aplayer-fixed .aplayer-lrc {
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: 900px;
  max-width: 92vw;
  bottom: 136px;
  height: 56px;
  overflow: hidden;
}
.aplayer .aplayer-lrc-contents {
  transform: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aplayer .aplayer-lrc p {
  display: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
/* 当前行：大字，宽度贴合文字（扫色渐变才能对准字） */
.aplayer .aplayer-lrc p.aplayer-lrc-current {
  display: block;
  width: fit-content;
  max-width: 92vw;
  margin: 0 auto;
  font-size: 20px;
  font-weight: 600;
  line-height: 30px !important;
  height: 30px !important;
  min-height: 30px;
  color: rgba(120, 120, 120, 0.55);
  text-shadow: none;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 下一行：小字灰色预览 */
.aplayer .aplayer-lrc p.aplayer-lrc-current + p {
  display: block;
  font-size: 14px;
  line-height: 22px !important;
  height: 22px !important;
  color: #999;
  opacity: 0.55;
}

/* 播放器加载占位：歌单数据回来之前，先在原位显示一个胶囊，
   免得进页面时左下角空着；播放器建好后占位自动消失 */
meting-js:empty::after {
  content: "♪ 音乐加载中…";
  position: fixed;
  left: 14px;
  bottom: 28px;
  z-index: 98;
  height: 66px;
  line-height: 66px;
  padding: 0 26px;
  border-radius: 999px;
  background: #fff;
  color: #999;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] meting-js:empty::after {
  background: #2d2d2d;
  color: #aaa;
}

/* 小屏幕别撑出屏幕 */
@media (max-width: 420px) {
  .aplayer.aplayer-fixed .aplayer-body,
  .aplayer.aplayer-fixed .aplayer-list {
    max-width: calc(100vw - 28px);
  }
}

/* 暗色模式（Butterfly 切换到 dark 时） */
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-body {
  background: #2d2d2d;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-info .aplayer-music .aplayer-title {
  color: #eee;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-info .aplayer-music .aplayer-author {
  color: #aaa;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-list {
  background: #2d2d2d;
  color: #ddd;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-list ol li {
  border-top-color: #3d3d3d;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-list ol li:hover {
  background: #3a3a3a;
}

/* 去掉胶囊背后那层白板：那是播放器外层容器自带的白底（小圆角、
   最大宽 400），只让胶囊本体有底色，外层改透明；
   顺带把容器收窄到 370，让右侧收起小舌头贴到胶囊右缘、同色融合 */
.aplayer.aplayer-fixed {
  background: transparent;
  box-shadow: none;
  max-width: 370px;
}
.aplayer.aplayer-fixed .aplayer-miniswitcher {
  background: #fff;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-miniswitcher {
  background: #2d2d2d;
}
