/* ==========================================================================
   APlayer Custom Key Style for Butterfly Theme
   Theme Color: #6b5b7a
   Font: LXGW
   ========================================================================== */

/* ------------------------------------------------------------------
   通用样式 (普通模式 & 吸底模式共用)
   ------------------------------------------------------------------ */
.aplayer {
    font-family: 'LXGW', 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
    border-radius: 12px !important;
}

/* 进度条颜色 - 使用主题色 */
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
    background: #6b5b7a !important;
}

/* 进度球样式 */
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {
    background: #6b5b7a !important;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s;
}
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb:hover {
    transform: scale(1.1);
}

/* ------------------------------------------------------------------
   普通模式 (文章内嵌入) - 增加卡片感
   ------------------------------------------------------------------ */
.aplayer:not(.aplayer-fixed) {
    margin: 20px 0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.aplayer:not(.aplayer-fixed):hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* 封面圆角 */
.aplayer:not(.aplayer-fixed) .aplayer-pic {
    border-radius: 12px 0 0 12px;
}
.aplayer:not(.aplayer-fixed) .aplayer-info {
    border-radius: 0 12px 12px 0;
}

/* ------------------------------------------------------------------
   吸底模式 (Fixed) - 优化背景
   ------------------------------------------------------------------ */
.aplayer.aplayer-fixed .aplayer-body {
    background-color: #fff !important;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 6px 6px 0 0; /* 仅上方圆角 */
}

/* 吸底模式列表 */
.aplayer.aplayer-fixed .aplayer-list {
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
    border: none !important;
}

/* 去掉 fixed 模式 info 上沿灰色分割线 */
.aplayer.aplayer-fixed .aplayer-info {
    border-top-color: transparent !important;
}

/* ------------------------------------------------------------------
   歌词区域美化
   ------------------------------------------------------------------ */
.aplayer .aplayer-lrc {
    text-shadow: none !important;
}

/* 歌词上下遮罩 - 亮色模式透明渐变 */
.aplayer .aplayer-lrc:before {
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%) !important;
}
.aplayer .aplayer-lrc:after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%) !important;
}

/* 通用歌词字体 */
.aplayer .aplayer-lrc p {
    color: #666;
    font-size: 14px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* 当前播放歌词高亮 */
.aplayer .aplayer-lrc p.aplayer-lrc-current {
    color: #6b5b7a !important; /* 主题色 */
    font-size: 16px;
    font-weight: bold;
    opacity: 1;
}

/* ------------------------------------------------------------------
   播放列表美化
   ------------------------------------------------------------------ */
.aplayer .aplayer-list ol li {
    border-top: 1px solid transparent !important;
    padding: 0 15px;
    margin: 0;
    transition: background 0.2s ease;
}

/* 列表悬停色 */
.aplayer .aplayer-list ol li:hover {
    background: rgba(107, 91, 122, 0.08) !important;
}

/* 列表当前播放项高亮 */
.aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(107, 91, 122, 0.12) !important;
}

.aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-title {
    color: #6b5b7a;
    font-weight: bold;
}

.aplayer .aplayer-list ol li .aplayer-list-index {
    color: #999;
}
.aplayer .aplayer-list ol li .aplayer-list-author {
    color: #888;
}

/* 滚动条美化 */
.aplayer .aplayer-list ol::-webkit-scrollbar {
    width: 5px;
}
.aplayer .aplayer-list ol::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.1);
}
.aplayer .aplayer-list ol::-webkit-scrollbar-thumb:hover {
    background-color: rgba(107, 91, 122, 0.3);
}

/* ------------------------------------------------------------------
   深色模式适配 (Dark Mode)
   Butterfly 通常使用 [data-theme="dark"]
   ------------------------------------------------------------------ */
[data-theme="dark"] .aplayer {
    background: #282828 !important;
    color: #e0e0e0;
}

/* 修复吸底模式背景 */
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-body {
    background-color: #282828 !important;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

/* 歌词区域遮罩 - 深色 */
[data-theme="dark"] .aplayer .aplayer-lrc:before {
    background: linear-gradient(180deg, #282828 0%, rgba(40, 40, 40, 0) 100%) !important;
}
[data-theme="dark"] .aplayer .aplayer-lrc:after {
    background: linear-gradient(180deg, rgba(40, 40, 40, 0) 0%, #282828 100%) !important;
}

/* 歌词文字颜色 */
[data-theme="dark"] .aplayer .aplayer-lrc p {
    color: #aaa;
}
[data-theme="dark"] .aplayer .aplayer-lrc p.aplayer-lrc-current {
    color: #9b8baa !important; /* 深色模式下稍微亮一点的主题色 */
}

/* 信息区域文字 */
[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-title {
    color: #e0e0e0;
}
[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-author {
    color: #777;
}

/* ==================================================================
   图标 Icon 美化
   ================================================================== */

/* ---- 基础图标重置 ---- */
.aplayer .aplayer-icon {
    width: 19px;
    height: 19px;
    opacity: 0.55;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

/* 通用 hover 反馈 */
.aplayer .aplayer-icon:hover {
    opacity: 1;
}

/* 图标路径颜色 - 亮色模式 */
.aplayer .aplayer-icon path {
    fill: #6b5b7a;
    transition: fill 0.25s ease;
}

.aplayer .aplayer-icon:hover path {
    fill: #4a3d55;
}

/* ---- 封面播放/暂停按钮 ---- */
.aplayer .aplayer-pic .aplayer-button {
    background: rgba(107, 91, 122, 0.35) !important;
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0;
}

.aplayer .aplayer-pic:hover .aplayer-button {
    opacity: 1;
}

.aplayer .aplayer-pic .aplayer-button:hover {
    background: rgba(107, 91, 122, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    transform: scale(1.12);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.aplayer .aplayer-pic .aplayer-button:active {
    transform: scale(0.95);
}

/* 封面播放按钮 - 更大更居中 */
.aplayer .aplayer-pic .aplayer-play {
    width: 42px;
    height: 42px;
    margin: 0 -21px -21px 0;
    border-radius: 50%;
}

.aplayer .aplayer-pic .aplayer-play svg {
    position: absolute;
    top: 8px;
    left: 10px;
    height: 26px;
    width: 26px;
}

/* 封面暂停按钮 */
.aplayer .aplayer-pic .aplayer-pause {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    bottom: 6px;
    right: 6px;
}

.aplayer .aplayer-pic .aplayer-pause svg {
    position: absolute;
    top: 5px;
    left: 5px;
    height: 16px;
    width: 16px;
}

/* 封面按钮内图标始终白色 */
.aplayer .aplayer-pic .aplayer-button path {
    fill: #fff !important;
}

/* ---- 控制器区域图标 ---- */
.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {
    width: 17px;
    height: 17px;
    margin-left: 3px;
    opacity: 0.5;
}

/* forward 图标由 APlayer 原生 rotate(180deg) 控制，这里不加 transform */
.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:not(.aplayer-icon-forward):hover {
    opacity: 1;
    transform: scale(1.15);
}

.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon-forward:hover {
    opacity: 1;
}

.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path {
    fill: #6b5b7a !important;
}

.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover path {
    fill: #4a3d55 !important;
}

/* 控制器时间文字 */
.aplayer .aplayer-info .aplayer-controller .aplayer-time {
    color: #8a8a8a;
    font-size: 11px;
}

/* ---- 音量图标 ---- */
.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-icon {
    width: 17px;
    height: 17px;
    opacity: 0.5;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-icon {
    opacity: 1;
    transform: scale(1.12);
}

.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-icon path {
    fill: #6b5b7a !important;
}

.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-icon path {
    fill: #4a3d55 !important;
}

/* ---- Fixed 吸底模式图标 ---- */
.aplayer.aplayer-fixed .aplayer-icon-back,
.aplayer.aplayer-fixed .aplayer-icon-forward,
.aplayer.aplayer-fixed .aplayer-icon-menu,
.aplayer.aplayer-fixed .aplayer-icon-play {
    width: 22px;
    height: 22px;
    opacity: 0.55;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.aplayer.aplayer-fixed .aplayer-icon-back:hover,
.aplayer.aplayer-fixed .aplayer-icon-menu:hover,
.aplayer.aplayer-fixed .aplayer-icon-play:hover {
    opacity: 1;
    transform: scale(1.15);
}

.aplayer.aplayer-fixed .aplayer-icon-forward:hover {
    opacity: 1;
    transform: rotate(180deg) scale(1.15);
}

.aplayer.aplayer-fixed .aplayer-icon-back path,
.aplayer.aplayer-fixed .aplayer-icon-forward path,
.aplayer.aplayer-fixed .aplayer-icon-menu path,
.aplayer.aplayer-fixed .aplayer-icon-play path {
    fill: #6b5b7a;
}

.aplayer.aplayer-fixed .aplayer-icon-back:hover path,
.aplayer.aplayer-fixed .aplayer-icon-forward:hover path,
.aplayer.aplayer-fixed .aplayer-icon-menu:hover path,
.aplayer.aplayer-fixed .aplayer-icon-play:hover path {
    fill: #4a3d55;
}

/* ---- Mini switcher 折叠按钮 ---- */
.aplayer .aplayer-miniswitcher {
    background: transparent !important;
    width: 20px;
    border-radius: 0 6px 6px 0 !important;
    opacity: 0.45;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease;
}

.aplayer .aplayer-miniswitcher:hover {
    opacity: 1;
    background: rgba(107, 91, 122, 0.1) !important;
}

.aplayer .aplayer-miniswitcher .aplayer-icon {
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.aplayer .aplayer-miniswitcher .aplayer-icon path {
    fill: #6b5b7a !important;
    transition: fill 0.25s ease;
}

.aplayer .aplayer-miniswitcher:hover .aplayer-icon path {
    fill: #4a3d55 !important;
}

/* 深色模式 */
[data-theme="dark"] .aplayer .aplayer-miniswitcher:hover {
    background: rgba(155, 139, 170, 0.15) !important;
}

[data-theme="dark"] .aplayer .aplayer-miniswitcher .aplayer-icon path {
    fill: #b0a0bb !important;
}

[data-theme="dark"] .aplayer .aplayer-miniswitcher:hover .aplayer-icon path {
    fill: #d0c0dd !important;
}

/* ---- 深色模式 ---- */
[data-theme="dark"] .aplayer .aplayer-icon path {
    fill: #b0a0bb;
}
[data-theme="dark"] .aplayer .aplayer-icon:hover path {
    fill: #d0c0dd;
}

/* 深色模式 - 封面按钮 */
[data-theme="dark"] .aplayer .aplayer-pic .aplayer-button {
    background: rgba(155, 139, 170, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}
[data-theme="dark"] .aplayer .aplayer-pic .aplayer-button:hover {
    background: rgba(155, 139, 170, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* 深色模式 - 控制器时间区域 */
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time {
    color: #888;
}
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path {
    fill: #b0a0bb !important;
}
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover path {
    fill: #d0c0dd !important;
}

/* 深色模式 - 音量图标 */
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-icon path {
    fill: #b0a0bb !important;
}
[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-icon path {
    fill: #d0c0dd !important;
}

/* 深色模式 - Fixed 模式图标 */
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-back path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-forward path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-menu path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-play path {
    fill: #b0a0bb;
}
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-back:hover path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-forward:hover path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-menu:hover path,
[data-theme="dark"] .aplayer.aplayer-fixed .aplayer-icon-play:hover path {
    fill: #d0c0dd;
}

/* 列表颜色 */
[data-theme="dark"] .aplayer .aplayer-list ol li:hover {
    background: rgba(155, 139, 170, 0.15) !important;
}
[data-theme="dark"] .aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(155, 139, 170, 0.2) !important;
}
[data-theme="dark"] .aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-title {
    color: #9b8baa;
}
[data-theme="dark"] .aplayer .aplayer-list ol li .aplayer-list-title {
    color: #ddd;
}
[data-theme="dark"] .aplayer .aplayer-list ol li .aplayer-list-author {
    color: #666;
}
[data-theme="dark"] .aplayer .aplayer-list ol li .aplayer-list-index {
    color: #555;
}

/* 深色模式滚动条 */
[data-theme="dark"] .aplayer .aplayer-list ol::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .aplayer .aplayer-list ol::-webkit-scrollbar-thumb:hover {
    background-color: rgba(155, 139, 170, 0.4);
}

/* 上游 5.7.0 移除了主题内的深色滤镜，这里补回原来的观感 */
[data-theme="dark"] .aplayer {
    filter: brightness(.8);
}
