/* APlayer自定义样式 */
.aplayer {
    background: var(--btn-bg)!important;
}
.wp-aplayer-player {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 5px 5px 10px 5px var(--bg-shadow);
}
.aplayer .aplayer-body {
    padding: 15px!important;
}
.aplayer .aplayer-pic {
    border-radius: 100px;
    /* 防止封面旋转时超出容器 */
    overflow: hidden;
    /* 初始状态不旋转 */
    transform: rotate(0deg);
    transition: transform 0.3s ease-out;
    /* 为按钮定位提供相对定位容器 */
    position: relative;
}
/* 封面旋转动画 */
.aplayer .aplayer-pic.playing {
    animation: rotate 10s linear infinite;
}
/* 定义封面旋转动画 */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
/* 暂停时平滑停止旋转 */
.aplayer .aplayer-pic.paused {
    animation-play-state: paused;
}

/* 核心修复：重构按钮层级，分离定位和旋转 */
.aplayer .aplayer-pic .aplayer-button {
    /* 绝对定位到封面正中央 - 只负责定位，不做旋转 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 调整按钮大小和样式 */
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 24px;
    border-radius: 50%;
    /*background-color: rgba(0, 0, 0, 0.5);*/
    color: #fff;
    opacity: 1!important;
    /* 确保按钮始终可见 */
    display: flex!important;
    align-items: center;
    justify-content: center;
    border: none!important;
    box-shadow: none!important;
    /* 提高层级，确保按钮在最上层 */
    z-index: 10;
    /* 关键：禁用按钮自身的动画继承 */
    animation: none!important;
}

/* 新增：给按钮内部的SVG添加反向旋转（只旋转图标，不移动位置） */
.aplayer .aplayer-pic.playing .aplayer-button svg {
    animation: rotate-reverse 10s linear infinite;
    transform-origin: center center;
}
.aplayer .aplayer-pic.paused .aplayer-button svg {
    animation-play-state: paused;
}

/* 定义SVG反向旋转动画（只旋转，不影响位置） */
@keyframes rotate-reverse {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

/* 移除默认的hover效果，保持按钮始终居中显示 */
.aplayer .aplayer-pic:hover .aplayer-button {
    opacity: 1!important;
}

.aplayer .aplayer-info {
    padding: 0 0 0 15px!important;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {
    height: 8px!important;
    border-radius: 8px;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {
    height: 8px!important;
    border-radius: 8px;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
    height: 8px!important;
    border-radius: 8px;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {
    margin-top: 0px!important;
    height: 8px!important;
    width: 8px!important;
    display: none;
}
.aplayer .aplayer-info .aplayer-music {
    margin: 0 0 20px 5px!important;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-time {
    bottom: inherit!important;
}
.aplayer .aplayer-info .aplayer-icon-order,.aplayer .aplayer-info .aplayer-icon-loop,.aplayer .aplayer-info .aplayer-icon-menu,.aplayer .aplayer-info .aplayer-icon-lrc{
    display: none;
}
/* 隐藏底部的播放/暂停按钮（如果不需要） */
.aplayer .aplayer-info .aplayer-controller .aplayer-icon-play {
    display: none!important;
}
.aplayer .aplayer-pic .aplayer-play svg {
    position: static!important; /* 修复SVG定位问题 */
    height: 20px!important;
    width: 20px!important;
    transform-origin: center;
}
.aplayer .aplayer-pic .aplayer-pause svg {
    position: static!important; /* 修复SVG定位问题 */
    height: 20px!important;
    width: 20px!important;
    transform-origin: center;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .wp-aplayer-player {
        margin: 15px 0;
    }
    /* 移动端调整按钮大小 */
    .aplayer .aplayer-pic .aplayer-button {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 18px;
    }
    .aplayer .aplayer-pic .aplayer-play svg,
    .aplayer .aplayer-pic .aplayer-pause svg {
        height: 16px!important;
        width: 16px!important;
    }
}

/* 确保播放器在内容中正确显示 */
.wp-aplayer-player .aplayer {
    font-family: inherit;
    margin: 0;
}