/* =========================================================
   Sakurairo APlayer 魔改样式 - 终极修复版 (解决黑纸片与白底冲突)
   ========================================================= */

/* ==========================================
   1. 整体面板与毛玻璃 (日间模式默认)
   ========================================== */
.aplayer.aplayer-fixed {
    max-width: 400px;
    bottom: 20px !important;
    left: 20px !important;
    border-radius: 16px !important;
    /* 日间加深一点白色背景层，防止在纯白博客背景上太透 */
    background: rgba(255, 255, 255, 0.65) !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease;
}

/* 强制清除内部纯白背景与残留边框 */
.aplayer.aplayer-fixed .aplayer-body,
.aplayer.aplayer-fixed .aplayer-info,
.aplayer.aplayer-fixed .aplayer-list {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 日间模式下播放器内部文字辨识度 (深色) */
.aplayer .aplayer-info .aplayer-music .aplayer-title { color: #222 !important; font-weight: bold; }
.aplayer .aplayer-info .aplayer-music .aplayer-author { color: #555 !important; }
.aplayer .aplayer-info .aplayer-controller .aplayer-time,
.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon { color: #444 !important; fill: #444 !important; }

/* 日间模式进度条颜色 (配合主题使用樱花粉) */
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played,
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb { 
    background: #ff4e6a !important; 
}


/* ==========================================
   2. 左侧封面图优化 (旋转唱片)
   ========================================== */
.aplayer-fixed .aplayer-pic {
    border-radius: 50% !important;
    margin: 10px;
    height: 46px !important;
    width: 46px !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    animation: spin 10s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.aplayer-fixed .aplayer-pic.aplayer-pause { animation-play-state: paused; }


/* ==========================================
   3. 悬浮歌词核心修复 (纯黑文字 + 长文本平移)
   ========================================== */
.aplayer-fixed .aplayer-lrc {
    position: absolute !important; 
    bottom: 80px !important; 
    left: 0;
    width: 800px !important; 
    max-width: 90vw !important;
    height: 80px !important; 
    overflow: hidden !important; 
    text-align: center;
    z-index: 99999 !important; 
    pointer-events: none; 
}

.aplayer.aplayer-fixed .aplayer-lrc-contents {
    transform: none !important;
    width: 100%;
    height: 100%;
}

/* 所有歌词默认绝对居中，并隐藏 */
.aplayer-fixed .aplayer-lrc p {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-50%); 
    
    font-size: 18px !important;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 26px !important;
    white-space: nowrap !important;
    
    opacity: 0; 
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}

.aplayer .aplayer-lrc:before, 
.aplayer .aplayer-lrc:after { display: none !important; }

/* 激活的歌词 (日间模式：纯黑文字，无扫光) */
.aplayer-fixed .aplayer-lrc p.aplayer-lrc-current {
    opacity: 1;
    visibility: visible;
    
    /* 彻底去除渐变，回归纯黑 */
    color: #111111 !important; 
    background: none !important;
    -webkit-background-clip: unset !important;
    
    /* 强力白边防背景干扰 */
    text-shadow: 
        -1px -1px 0 rgba(255, 255, 255, 0.9),
         1px -1px 0 rgba(255, 255, 255, 0.9),
        -1px  1px 0 rgba(255, 255, 255, 0.9),
         1px  1px 0 rgba(255, 255, 255, 0.9),
         0px  2px 10px rgba(255, 255, 255, 0.8) !important;
         
    -webkit-text-stroke: 0px transparent !important;
    filter: none !important;
    
    /* 只保留长歌词的左右平移 */
    animation: pan-text 8s linear alternate infinite;
}

/* 动画：超长歌词的视差平移 */
@keyframes pan-text {
    0%, 10% { transform: translateY(-50%) scale(1.15) translateX(5%); }
    90%, 100% { transform: translateY(-50%) scale(1.15) translateX(-5%); }
}

.aplayer.aplayer-fixed.aplayer-narrow .aplayer-lrc { display: none !important; }
.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body { background: transparent !important; }


/* ==========================================
   4. 夜间模式强力覆盖 (修复黑纸片与夜间配色)
   ========================================== */
/* 强行注入毛玻璃属性，覆盖主题自身的霸道样式 */
html.dark .aplayer.aplayer-fixed,
body.dark .aplayer.aplayer-fixed,
html[data-theme="dark"] .aplayer.aplayer-fixed,
body[data-theme="dark"] .aplayer.aplayer-fixed {
    /* 【核心修复】透明度压低到0.45，并强制清除任何可能干扰毛玻璃的主题背景图 */
    background-color: rgba(20, 20, 20, 0.45) !important; 
    background-image: none !important; 
    
    backdrop-filter: blur(15px) !important; /* 稍微加强一点模糊度 */
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6) !important;
}

/* 夜间模式播放器内部文字恢复浅色 */
html.dark .aplayer .aplayer-info .aplayer-music .aplayer-title,
body.dark .aplayer .aplayer-info .aplayer-music .aplayer-title,
html[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-title { color: #eee !important; }

html.dark .aplayer .aplayer-info .aplayer-music .aplayer-author,
body.dark .aplayer .aplayer-info .aplayer-music .aplayer-author,
html[data-theme="dark"] .aplayer .aplayer-info .aplayer-music .aplayer-author { color: #bbb !important; }

html.dark .aplayer .aplayer-info .aplayer-controller .aplayer-time,
body.dark .aplayer .aplayer-info .aplayer-controller .aplayer-time,
html[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time,
html.dark .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon,
body.dark .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon,
html[data-theme="dark"] .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon { color: #aaa !important; fill: #aaa !important; }

/* 修复：夜间模式下，未激活的普通歌词变回浅半透明 */
html.dark .aplayer-fixed .aplayer-lrc p,
body.dark .aplayer-fixed .aplayer-lrc p,
html[data-theme="dark"] .aplayer-fixed .aplayer-lrc p {
    color: rgba(255, 255, 255, 0.4) !important; 
}

/* 【关键】夜间模式激活歌词，保持纯白发光，无扫光 */
html.dark .aplayer-fixed .aplayer-lrc p.aplayer-lrc-current,
body.dark .aplayer-fixed .aplayer-lrc p.aplayer-lrc-current,
html[data-theme="dark"] .aplayer-fixed .aplayer-lrc p.aplayer-lrc-current {
    color: #ffffff !important; 
    background: none !important;
    
    /* 你最满意的纯白发光效果 */
    text-shadow: 0 4px 16px rgba(255, 255, 255, 0.8) !important; 
    
    -webkit-text-stroke: 0px transparent !important; 
    filter: none !important; 
}
