/* 摘自参考站 style.css：背景音乐播放器（磁带机悬浮球） */


/* Background music player */
.bgm-player-shell[hidden],
.bgm-player-empty[hidden] {
    display: none !important;
}


.bgm-player-shell {
    position: fixed;
    left: clamp(16px, 3vw, 30px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 1300;
    width: 76px;
    height: 76px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease, width 0.28s ease;
}


.bgm-player-shell.is-ready {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


.bgm-player-shell.is-expanded {
    width: min(392px, calc(100vw - 32px));
}


.bgm-vinyl-trigger {
    position: absolute;
    left: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 18px 38px rgba(66, 45, 35, 0.16), 0 4px 14px rgba(255, 255, 255, 0.42) inset;
    cursor: pointer;
    backdrop-filter: blur(18px) saturate(1.24);
    -webkit-backdrop-filter: blur(18px) saturate(1.24);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}


.bgm-vinyl-trigger:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 22px 46px rgba(66, 45, 35, 0.2), 0 4px 14px rgba(255, 255, 255, 0.5) inset;
}


.bgm-vinyl-trigger:focus-visible,
.bgm-panel-close:focus-visible {
    outline: 2px solid rgba(196, 142, 153, 0.7);
    outline-offset: 4px;
}


.bgm-vinyl-disc {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(92, 76, 70, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    box-shadow:
        0 0 0 7px rgba(255, 255, 255, 0.18) inset,
        0 0 0 15px rgba(95, 80, 74, 0.07) inset,
        0 8px 22px rgba(96, 74, 64, 0.15);
}


.bgm-vinyl-disc::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(121, 96, 86, 0.12);
    content: "";
    transform: translate(-50%, -50%);
}


.bgm-vinyl-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    background-color: rgba(244, 217, 224, 0.54);
    background-position: center;
    background-size: cover;
    color: rgba(126, 97, 90, 0.78);
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(96, 74, 64, 0.13);
}


.bgm-vinyl-cover.has-cover i {
    display: none;
}


.bgm-player-shell.is-playing .bgm-vinyl-disc {
    animation: bgmCoverSpin 18s linear infinite;
}


/* 自动播放被浏览器拦下时，给唱片加一圈很轻的呼吸光，提示「点一下就有声音」 */
.bgm-player-shell.is-autoplay-blocked .bgm-vinyl-trigger {
    animation: bgmNeedTap 2.4s ease-in-out infinite;
}

@keyframes bgmNeedTap {
    0%, 100% {
        box-shadow: 0 10px 26px rgba(96, 74, 64, 0.16), 0 0 0 0 rgba(199, 155, 122, 0.0);
    }
    50% {
        box-shadow: 0 10px 26px rgba(96, 74, 64, 0.22), 0 0 0 8px rgba(199, 155, 122, 0.14);
    }
}



.bgm-player-panel {
    position: absolute;
    left: 0;
    bottom: 92px;
    width: min(410px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 124px));
    overflow: visible;
    padding: 18px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.64);
    box-shadow: 0 24px 62px rgba(66, 45, 35, 0.16), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transform-origin: left bottom;
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    transition: opacity 0.22s ease, transform 0.22s ease;
}


.bgm-player-shell.is-expanded .bgm-player-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}


.bgm-panel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(121, 96, 86, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    color: rgba(68, 53, 48, 0.72);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}


.bgm-panel-close:hover {
    background: rgba(255, 255, 255, 0.74);
    transform: translateY(-1px);
}


.bgm-player-shell .aplayer {
    margin: 0;
    min-height: 126px;
    overflow: visible;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: none;
    color: rgba(58, 47, 43, 0.92);
}


.bgm-player-shell .aplayer.aplayer-withlist .aplayer-info {
    border-bottom: 0;
}


.bgm-player-shell .aplayer .aplayer-body {
    height: 126px;
    min-height: 126px;
    overflow: hidden;
    border-radius: 18px;
}


.bgm-player-shell .aplayer .aplayer-pic {
    width: 60px;
    height: 60px;
    margin: 18px 12px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(91, 70, 60, 0.14);
}


.bgm-player-shell .aplayer .aplayer-pic .aplayer-button {
    background: rgba(68, 53, 48, 0.28);
}


.bgm-player-shell .aplayer .aplayer-info {
    display: flex;
    flex-direction: column;
    height: 126px;
    margin-left: 84px;
    padding: 18px 40px 15px 0;
    border-bottom: 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-music {
    height: 21px;
    flex: 0 0 auto;
    margin: 0 0 16px 0;
    color: rgba(58, 47, 43, 0.94);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-music .aplayer-title {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-music .aplayer-author {
    color: rgba(100, 80, 73, 0.62);
    font-size: 0.78rem;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller {
    display: grid;
    grid-template-rows: 16px 26px;
    row-gap: 12px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {
    display: block;
    flex: none;
    margin-left: 0;
    padding: 6px 0;
    width: 100%;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {
    height: 3px;
    border-radius: 999px;
    background: rgba(121, 96, 86, 0.16);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {
    height: 3px;
    border-radius: 999px;
    background: rgba(121, 96, 86, 0.13);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
    height: 3px;
    border-radius: 999px;
    background: #c48e99 !important;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {
    background: #c48e99 !important;
    box-shadow: 0 0 0 4px rgba(196, 142, 153, 0.18);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 26px;
    margin-top: 0;
    padding-left: 0;
    color: rgba(100, 80, 73, 0.58);
    white-space: nowrap;
}


.bgm-player-shell .aplayer .aplayer-icon-back,
.bgm-player-shell .aplayer .aplayer-icon-play,
.bgm-player-shell .aplayer .aplayer-icon-forward {
    display: inline-block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: 0;
}


.bgm-player-shell .aplayer .aplayer-icon-play {
    width: 21px;
    height: 21px;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {
    margin-right: auto;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path,
.bgm-player-shell .aplayer .aplayer-icon path {
    fill: rgba(68, 53, 48, 0.7);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover path,
.bgm-player-shell .aplayer .aplayer-icon:hover path {
    fill: rgba(68, 53, 48, 0.95);
}


.bgm-player-shell .aplayer .aplayer-lrc {
    height: 46px;
    margin: 8px 0 0;
    color: rgba(78, 60, 54, 0.72);
}


.bgm-player-shell .aplayer .aplayer-lrc::before,
.bgm-player-shell .aplayer .aplayer-lrc::after {
    display: none;
}


.bgm-player-shell .aplayer .aplayer-lrc p {
    color: rgba(78, 60, 54, 0.54);
}


.bgm-player-shell .aplayer .aplayer-lrc p.aplayer-lrc-current {
    color: rgba(58, 47, 43, 0.9);
}


.bgm-player-shell .aplayer .aplayer-list {
    overflow: hidden;
    margin-top: 12px;
    border: 1px solid rgba(121, 96, 86, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow: none;
}


.bgm-player-shell .aplayer .aplayer-list ol {
    max-height: 220px;
}


.bgm-player-shell .aplayer .aplayer-list ol li {
    height: 38px;
    line-height: 38px;
    color: rgba(58, 47, 43, 0.84);
    border-top: 1px solid rgba(121, 96, 86, 0.09);
}


.bgm-player-shell .aplayer .aplayer-list ol li:hover,
.bgm-player-shell .aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(196, 142, 153, 0.13);
}


.bgm-player-shell .aplayer .aplayer-list ol li .aplayer-list-author,
.bgm-player-shell .aplayer .aplayer-list ol li .aplayer-list-index {
    color: rgba(100, 80, 73, 0.52);
}


.bgm-player-empty {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 8px 12px;
    border: 1px solid rgba(121, 96, 86, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.34);
    color: rgba(58, 47, 43, 0.88);
}


.bgm-empty-cover {
    display: inline-flex;
    grid-row: 1 / span 2;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 50%;
    background: rgba(244, 217, 224, 0.48);
    color: rgba(126, 97, 90, 0.78);
}


.bgm-empty-main {
    align-self: end;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
}


.bgm-empty-sub {
    overflow: hidden;
    align-self: start;
    color: rgba(100, 80, 73, 0.58);
    font-size: 0.76rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 640px) {
    .bgm-player-shell {
        left: 14px;
        bottom: 14px;
    }

    .bgm-player-shell.is-expanded {
        width: calc(100vw - 28px);
    }

    .bgm-player-panel {
        bottom: 86px;
        width: calc(100vw - 28px);
        max-height: calc(100vh - 112px);
        padding: 14px;
        border-radius: 22px;
    }

    .bgm-vinyl-trigger {
        width: 70px;
        height: 70px;
    }

    .bgm-vinyl-disc {
        width: 54px;
        height: 54px;
    }

    .bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {
        display: none;
    }
}


@media (prefers-reduced-motion: reduce) {
    .bgm-player-shell,
    .bgm-player-panel,
    .bgm-vinyl-trigger,
    .bgm-player-shell.is-playing .bgm-vinyl-disc {
        animation: none;
        transition: none;
    }
}


/* BGM player layout correction: keep APlayer controls inside the glass card. */
.bgm-player-shell .aplayer,
.bgm-player-shell .aplayer * {
    box-sizing: border-box;
}


.bgm-player-shell .aplayer {
    min-height: 122px;
    overflow: hidden;
}


.bgm-player-shell .aplayer .aplayer-body {
    display: flex;
    align-items: stretch;
    height: 122px;
    min-height: 122px;
    overflow: hidden;
}


.bgm-player-shell .aplayer .aplayer-pic {
    float: none;
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    margin: 18px 12px 0 12px;
}


.bgm-player-shell .aplayer .aplayer-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    height: 122px;
    margin-left: 0;
    padding: 18px 42px 14px 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-music {
    flex: 0 0 auto;
    width: 100%;
    height: 22px;
    margin: 0 0 16px;
    padding-bottom: 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller {
    display: grid;
    flex: 1 1 auto;
    grid-template-rows: 18px 28px;
    gap: 12px;
    min-height: 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {
    display: block;
    width: 100%;
    margin: 0;
    padding: 7px 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    height: 28px;
    padding-left: 0;
    color: rgba(100, 80, 73, 0.58);
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {
    flex: 1 1 auto;
    min-width: 72px;
    margin-right: 0;
    text-align: left;
}


.bgm-player-shell .aplayer .aplayer-icon-back,
.bgm-player-shell .aplayer .aplayer-icon-play,
.bgm-player-shell .aplayer .aplayer-icon-forward,
.bgm-player-shell .aplayer .aplayer-icon-menu {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}


.bgm-player-shell .aplayer .aplayer-icon-play {
    width: 22px;
    height: 22px;
}


.bgm-player-shell .aplayer .aplayer-icon-lrc,
.bgm-player-shell .aplayer .aplayer-icon-loop,
.bgm-player-shell .aplayer .aplayer-icon-order,
.bgm-player-shell .aplayer .aplayer-volume-wrap {
    display: none !important;
}


/* Final BGM control layout: keep transport buttons in a dedicated visible dock. */
.bgm-control-dock[hidden] {
    display: none !important;
}


.bgm-player-panel {
    width: min(420px, calc(100vw - 32px));
    padding: 18px 16px 14px;
    overflow: visible;
}


.bgm-player-shell .aplayer {
    min-height: 100px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.28);
}


.bgm-player-shell .aplayer .aplayer-body {
    display: flex;
    height: 100px;
    min-height: 100px;
    overflow: visible;
    border-radius: 18px;
}


.bgm-player-shell .aplayer .aplayer-pic {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    margin: 18px 12px 0 12px;
}


.bgm-player-shell .aplayer .aplayer-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    height: 100px;
    margin-left: 0;
    padding: 18px 38px 12px 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-music {
    flex: 0 0 auto;
    height: 24px;
    margin: 0 0 18px;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller {
    display: block;
    flex: 0 0 auto;
    height: 18px;
    min-height: 18px;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 0;
}


.bgm-player-shell .aplayer .aplayer-info .aplayer-controller .aplayer-time {
    display: none !important;
}


.bgm-player-shell .aplayer .aplayer-icon-back,
.bgm-player-shell .aplayer .aplayer-icon-play,
.bgm-player-shell .aplayer .aplayer-icon-forward,
.bgm-player-shell .aplayer .aplayer-icon-menu {
    display: none !important;
}


.bgm-control-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(121, 96, 86, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.34);
}


.bgm-control-btn {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(121, 96, 86, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    color: rgba(68, 53, 48, 0.76);
    box-shadow: 0 8px 18px rgba(82, 61, 52, 0.08);
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}


.bgm-control-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.82);
    color: rgba(68, 53, 48, 0.95);
}


.bgm-control-btn:focus-visible {
    outline: 2px solid rgba(196, 142, 153, 0.62);
    outline-offset: 3px;
}


.bgm-control-play {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    background: rgba(196, 142, 153, 0.18);
    color: rgba(112, 71, 81, 0.94);
    font-size: 1rem;
}


@media (max-width: 640px) {
    .bgm-control-dock {
        gap: 10px;
    }

    .bgm-control-btn {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .bgm-control-play {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }
}