/* ── 音乐播放器 ── */

body { padding-bottom: 68px; }

/* ── 播放器主体（固定底部）── */
#mp-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.4rem;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-sepia);
  box-shadow: 0 -2px 16px rgba(44, 36, 22, 0.10);
  font-family: var(--font-sans);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* ── 控制按钮组 ── */
.mp-controls {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.mp-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.mp-btn:hover { background: var(--color-bg-dark); color: var(--color-ink); }

#mp-play-btn {
  width: 40px;
  height: 40px;
  background: var(--color-sichuan-red);
  color: #FAF7F2;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(139, 74, 60, 0.35);
}
#mp-play-btn:hover { filter: brightness(1.12); background: var(--color-sichuan-red); }

/* ── 曲目信息 ── */
.mp-track {
  min-width: 0;
  flex: 0 0 160px;
}
.mp-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-ink);
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-artist {
  font-size: 0.72rem;
  color: var(--color-ink-faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 进度条区域 ── */
.mp-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.mp-time {
  font-size: 0.72rem;
  color: var(--color-ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

/* ── 滑块通用 ── */
.mp-range {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--color-sichuan-red) 0%,
    var(--color-sepia) 0%
  );
}
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-sichuan-red);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--color-bg-alt);
  transition: transform 0.15s ease;
}
.mp-range::-webkit-slider-thumb:hover { transform: scale(1.3); }
.mp-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-sichuan-red);
  border: none;
  cursor: pointer;
}
.mp-progress { flex: 1; }

/* ── 音量区域 ── */
.mp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.mp-vol-icon {
  font-size: 0.85rem;
  color: var(--color-ink-faint);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.mp-volume { width: 68px; }

/* ── 曲目列表按钮 ── */
#mp-list-btn {
  flex-shrink: 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
#mp-list-btn.open { color: var(--color-sichuan-red); }

/* ── 曲目列表面板 ── */
#mp-playlist {
  position: fixed;
  bottom: 68px;
  left: 0;
  right: 0;
  z-index: 8999;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-sepia);
  box-shadow: 0 -4px 24px rgba(44, 36, 22, 0.12);
  max-height: 340px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-sepia) transparent;
}
#mp-playlist.open { transform: translateY(0); }

#mp-playlist::-webkit-scrollbar { width: 4px; }
#mp-playlist::-webkit-scrollbar-thumb { background: var(--color-sepia); border-radius: 2px; }

.mp-playlist-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.4rem;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-sepia);
  font-size: 0.82rem;
  color: var(--color-ink-muted);
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
}
.mp-playlist-header span { color: var(--color-ink-faint); font-size: 0.72rem; }

.mp-playlist-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.62rem 1.4rem;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background var(--transition);
}
.mp-playlist-item:hover { background: var(--color-bg-dark); }
.mp-playlist-item.active {
  background: rgba(139, 74, 60, 0.06);
  border-bottom-color: transparent;
}

.mp-playlist-num {
  width: 20px;
  text-align: right;
  font-size: 0.72rem;
  color: var(--color-ink-faint);
  flex-shrink: 0;
}
.mp-playlist-item.active .mp-playlist-num { color: var(--color-sichuan-red); }

.mp-playlist-title {
  flex: 1;
  font-size: 0.86rem;
  color: var(--color-ink);
  font-family: var(--font-serif);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-playlist-item.active .mp-playlist-title {
  color: var(--color-sichuan-red);
  font-weight: 600;
}

.mp-playlist-artist {
  font-size: 0.72rem;
  color: var(--color-ink-faint);
  flex-shrink: 0;
}

/* ── 响应式 ── */
@media (max-width: 640px) {
  #mp-bar { gap: 0.6rem; padding: 0 0.8rem; }
  .mp-track { flex-basis: 100px; }
  .mp-time { display: none; }
  .mp-volume-wrap { display: none; }
  .mp-volume { width: 50px; }
}
