/* === Music Player FAB === */
.mp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--lake, #3c8078);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

.mp-fab:hover {
  transform: scale(1.08);
  background: #2f6b64;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.mp-fab.active {
  background: var(--ember, #a94732);
}

.mp-fab.active:hover {
  background: #8e3c2a;
}

/* === Panel === */
.mp-panel {
  position: fixed;
  bottom: 92px;
  right: 28px;
  z-index: 899;
  width: 380px;
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  background: var(--paper, #fbf8f0);
  border: 1px solid var(--line, #ded6c8);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s ease;
  overflow: hidden;
}

.mp-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* === Header === */
.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line, #ded6c8);
  flex-shrink: 0;
}

.mp-heading {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #202326);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted, #667079);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.mp-close:hover {
  color: var(--ember, #a94732);
}

/* === Player Area === */
.mp-player-area {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line, #ded6c8);
}

.mp-now {
  padding: 10px 18px;
  font-size: 13px;
  color: var(--muted, #667079);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.mp-now.playing {
  font-weight: 600;
  color: var(--ink, #202326);
  border-bottom: 1px solid var(--line, #ded6c8);
}

.mp-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

/* === Playlist === */
.mp-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.mp-loading,
.mp-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted, #667079);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.mp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mp-item:hover {
  background: rgba(60, 128, 120, 0.06);
}

.mp-item.active {
  background: rgba(60, 128, 120, 0.1);
}

.mp-item.active .mp-title {
  color: var(--lake, #3c8078);
}

.mp-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-soft, #f4efe4);
}

.mp-info {
  flex: 1;
  min-width: 0;
}

.mp-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #202326);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.mp-artist {
  font-size: 12px;
  color: var(--muted, #667079);
  margin-top: 2px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* === Scrollbar === */
.mp-list::-webkit-scrollbar {
  width: 5px;
}

.mp-list::-webkit-scrollbar-track {
  background: transparent;
}

.mp-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

/* === Dark theme === */
:root[data-theme="dark"] .mp-panel {
  background: var(--paper, #17222c);
  border-color: var(--line, rgba(213, 224, 222, 0.18));
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .mp-item:hover {
  background: rgba(127, 198, 185, 0.06);
}

:root[data-theme="dark"] .mp-item.active {
  background: rgba(127, 198, 185, 0.1);
}

:root[data-theme="dark"] .mp-item.active .mp-title {
  color: var(--lake, #7fc6b9);
}

:root[data-theme="dark"] .mp-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

/* === Mobile === */
@media (max-width: 560px) {
  .mp-fab {
    bottom: 20px;
    right: 16px;
    width: 46px;
    height: 46px;
  }

  .mp-panel {
    bottom: 78px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 110px);
  }
}
