/* ============================================================
   background-music.css · 背景音乐列表与播放状态
   ============================================================ */

.background-music-sheet {
    z-index: 27;
    padding-bottom: 26px;
}

.background-music-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: 344px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.background-music-list::-webkit-scrollbar {
    display: none;
}

.background-music-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.background-music-item:last-child {
    border-bottom: 0;
}

.background-music-item:focus-visible {
    outline: 1px solid rgba(var(--brand-3-rgb), 0.56);
    outline-offset: -2px;
    border-radius: 10px;
}

.background-music-cover {
    position: relative;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 5px 14px rgba(0, 0, 0, 0.2);
}

.background-music-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.background-music-cover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 7, 12, 0.56);
    opacity: 0;
    transition: opacity 180ms ease;
}

.background-music-item.is-current .background-music-cover-overlay {
    opacity: 1;
}

.background-music-wave {
    height: 16px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.background-music-wave i {
    --wave-low: 3px;
    --wave-high: -4px;
    --wave-duration: 620ms;
    --wave-delay: -180ms;
    width: 4px;
    height: 4px;
    display: block;
    border-radius: 50%;
    background: var(--brand-3);
    box-shadow: 0 0 5px var(--brand-dot-glow);
    opacity: 0.9;
    transform: translateY(0) scale(1);
}

.background-music-item.is-playing .background-music-wave i {
    animation: background-music-dot-wave var(--wave-duration)
        cubic-bezier(0.37, 0, 0.63, 1) var(--wave-delay) infinite alternate;
}

.background-music-wave i:nth-child(2) {
    --wave-low: 2px;
    --wave-high: -5px;
    --wave-duration: 790ms;
    --wave-delay: -510ms;
}

.background-music-wave i:nth-child(3) {
    --wave-low: 4px;
    --wave-high: -3px;
    --wave-duration: 530ms;
    --wave-delay: -340ms;
}

.background-music-wave i:nth-child(4) {
    --wave-low: 2px;
    --wave-high: -4px;
    --wave-duration: 710ms;
    --wave-delay: -620ms;
}

@keyframes background-music-dot-wave {
    0% {
        opacity: 0.64;
        transform: translateY(var(--wave-low)) scale(0.82);
    }

    100% {
        opacity: 1;
        transform: translateY(var(--wave-high)) scale(1.08);
    }
}

.background-music-meta {
    min-width: 0;
}

.background-music-name {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.94);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.background-music-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
}

.background-music-separator {
    color: rgba(var(--brand-3-rgb), 0.72);
}

.background-music-control {
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease;
}

.background-music-item.is-current .background-music-control {
    opacity: 1;
    visibility: visible;
}

.background-music-control svg {
    width: 19px;
    height: 19px;
}

.background-music-control svg path,
.background-music-control svg rect {
    fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .background-music-cover-overlay,
    .background-music-control {
        transition-duration: 1ms;
    }

    .background-music-wave i {
        animation: none;
        opacity: 0.9;
        transform: translateY(0) scale(1);
    }
}
