/**
 * Music Player Styles - Complete Enhanced Version
 * 音樂播放器專用樣式檔案 - 完整增強版
 */

/* ===== 播放器變數統一定義 ===== */
:root {
    /* 基本色彩 */
    --player-bg: rgba(255, 255, 255, 0.95);
    --player-bg-secondary: #f8f9fa;
    --player-border: #e1e5e9;
    --player-border-hover: #0073aa;
    
    /* 陰影效果 */
    --player-shadow: 0 8px 32px rgba(0,0,0,0.12);
    --player-shadow-hover: 0 12px 48px rgba(0,0,0,0.18);
    --player-shadow-mini: 0 4px 16px rgba(0,0,0,0.1);
    
    /* 主要色彩 */
    --player-primary: #0073aa;
    --player-primary-hover: #005a87;
    --player-accent: #e91e63;
    --player-success: #28a745;
    --player-warning: #ffc107;
    --player-danger: #dc3545;
    
    /* 文字色彩 */
    --player-text: #2c3e50;
    --player-text-muted: #6c757d;
    --player-text-light: #ffffff;
    
    /* 背景色彩 */
    --player-light: #f8f9fa;
    --player-dark: #343a40;
    
    /* 音量相關變數 */
    --volume-high-color: var(--player-primary);
    --volume-medium-color: var(--player-warning);
    --volume-low-color: var(--player-danger);
    --volume-muted-color: var(--player-text-muted);
    
    /* 幾何屬性 */
    --player-radius: 12px;
    --player-radius-small: 8px;
    --player-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --player-transition-fast: all 0.2s ease;
    
    /* 播放器尺寸 */
    --player-width-full: 420px;
    --player-width-mini: 320px;
    --player-height-full: auto;
    --player-height-mini: 80px;
}

/* ===== 深色模式變數重定義 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --player-bg: rgba(26, 26, 26, 0.95);
        --player-bg-secondary: #2a2a2a;
        --player-border: #404040;
        --player-text: #ffffff;
        --player-text-muted: #a0a0a0;
        --player-light: #2a2a2a;
        --player-dark: #ffffff;
        --player-shadow: 0 8px 32px rgba(0,0,0,0.4);
        --player-shadow-hover: 0 12px 48px rgba(0,0,0,0.6);
    }
}

/* ===== 浮動播放器主體 ===== */
.floating-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--player-bg);
    border: 1px solid var(--player-border);
    border-radius: var(--player-radius);
    box-shadow: var(--player-shadow);
    z-index: 9999;
    max-width: var(--player-width-full);
    min-width: var(--player-width-mini);
    transform: translateY(120px);
    transition: var(--player-transition);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

.floating-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--player-primary), var(--player-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* 播放器顯示狀態 */
.floating-player:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.floating-player:not(.hidden)::before {
    opacity: 1;
}

.floating-player:hover {
    box-shadow: var(--player-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--player-border-hover);
}

/* ===== 迷你模式樣式 - 完整修復 ===== */
.floating-player.mini-mode {
    max-width: var(--player-width-mini);
    height: var(--player-height-mini);
    overflow: hidden;
}

.floating-player.mini-mode .player-container {
    padding: 0px 15px;
}

/* 迷你模式隱藏元素 */
.floating-player.mini-mode #main-player-controls,
.floating-player.mini-mode #main-player-progress,
.floating-player.mini-mode #main-player-volume,
.floating-player.mini-mode #main-player-actions {
    display: none !important;
}

/* 迷你模式播放器資訊調整 */
.floating-player.mini-mode .player-info {
    margin-bottom: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 迷你模式控制按鈕顯示 */
.floating-player.mini-mode .player-info .mini-play-control {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.floating-player:not(.mini-mode) .player-info .mini-play-control {
    display: none !important;
}

/* 切換按鈕樣式調整 */
.floating-player.mini-mode .toggle-expand-btn .dashicons {
    transform: rotate(45deg);
}

.floating-player:not(.mini-mode) .toggle-expand-btn .dashicons {
    transform: rotate(0deg);
}

/* ===== 播放器容器 ===== */
.player-container {
    padding: 20px;
    background: var(--player-bg);
    border-radius: var(--player-radius);
    position: relative;
}

/* ===== 開闔切換按鈕 ===== */
.toggle-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 18px;
    background: var(--player-bg);
    border: 1px solid var(--player-border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--player-transition-fast);
    color: var(--player-text-muted);
    z-index: 10;
    padding: 8px 20px;
}

.toggle-expand-btn:hover {
    background: #E91E63;
    color: var(--player-text-light);
    border-color: #E91E63;
    transform: scale(1.1);
}

.toggle-expand-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* ===== 播放器資訊區域 ===== */
.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, var(--player-light) 0%, var(--player-bg) 100%);
    border-radius: var(--player-radius-small);
    border: 1px solid rgba(0, 115, 170, 0.1);
    position: relative;
    overflow: hidden;
}

.player-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s;
}

.player-info:hover::before {
    left: 100%;
}

.player-cover {
    width: 60px;
    height: 60px;
    border-radius: var(--player-radius-small);
    overflow: hidden;
    background: var(--player-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--player-border);
    box-shadow: var(--player-shadow-mini);
    transition: var(--player-transition);
    position: relative;
}

.player-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(0, 115, 170, 0.1), rgba(233, 30, 99, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-cover:hover::after {
    opacity: 1;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.player-details {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--player-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.player-artist {
    color: var(--player-text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.player-artist:hover {
    color: var(--player-primary);
}

/* ===== 迷你模式播放控制 ===== */
.mini-play-control {
    display: none;
    align-items: center;
    gap: 8px;
}

.mini-play-btn {
    width: 40px;
    height: 40px;
    background: var(--player-primary);
    color: var(--player-text-light);
    border: none;
    cursor: pointer;
    display: flex
;
    align-items: center;
    justify-content: center;
    transition: var(--player-transition);
    box-shadow: var(--player-shadow-mini);
    margin: 0px 30px 0px 0px;
    padding: 0;
    border-radius: 50%;
}

.mini-play-btn:hover {
    background: var(--player-primary-hover);
    transform: scale(1.1);
}

.mini-play-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.mini-expand-btn {
    width: 32px;
    height: 32px;
    background: var(--player-light);

    border: 1px solid var(--player-border);
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--player-transition-fast);
    color: var(--player-text);
}

.mini-expand-btn:hover {
    background: var(--player-primary);
    color: var(--player-text-light);
    border-color: var(--player-primary);
}

.mini-expand-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ===== 播放器控制區域 ===== */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--player-light);
    border-radius: var(--player-radius-small);
    border: 1px solid rgba(0, 115, 170, 0.1);
}

.control-btn {
    background: var(--player-bg);
    border: 1px solid var(--player-border);
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--player-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--player-text);
    box-shadow: var(--player-shadow-mini);
    position: relative;
    overflow: hidden;
    min-width: 40px;
    z-index: 1;
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--player-primary), var(--player-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.control-btn:hover::before {
    opacity: 0.1;
}

.control-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--player-primary);
}

.control-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--player-shadow-mini);
}

/* 小型控制按鈕 */
.control-btn.small {
    width: 40px;
    height: 40px;
}

.control-btn.small .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* 主播放按鈕 */
.play-btn {
    width: 56px;
    height: 56px;
    background: var(--player-primary) !important;
    color: var(--player-text-light) !important;
    border-color: var(--player-primary) !important;
}

.play-btn::before {
    background: var(--player-text-light) !important;
    opacity: 0 !important;
}

.play-btn:hover {
    background: var(--player-primary-hover) !important;
    border-color: var(--player-primary-hover) !important;
    transform: translateY(-2px) scale(1.1);
}

.play-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--player-text-light) !important;
}

/* 激活狀態的按鈕 */
.control-btn.active {
    background: var(--player-primary);
    color: var(--player-text-light);
    border-color: var(--player-primary);
}

.control-btn.active .dashicons {
    color: var(--player-text-light);
}

.control-btn.active:hover {
    background: var(--player-primary-hover);
    border-color: var(--player-primary-hover);
}

/* 重複播放按鈕狀態 */
.control-btn.repeat-none {
    opacity: 0.6;
}

.control-btn.repeat-all {
    background: var(--player-success);
    color: var(--player-text-light);
    border-color: var(--player-success);
}

.control-btn.repeat-one {
    background: var(--player-warning);
    color: var(--player-dark);
    border-color: var(--player-warning);
}

.control-btn.repeat-one::after {
    content: "1";
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--player-accent);
    color: var(--player-text-light);
    font-size: 8px;
    font-weight: bold;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

/* ===== 進度條區域 ===== */
.player-progress {
    margin-bottom: 20px;
    padding: 0 15px;
}

.progress-bar {
    height: 6px;
    background: var(--player-light);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--player-primary), var(--player-accent));
    opacity: 0.1;
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--player-primary), var(--player-accent));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 200%;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.progress-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--player-bg);
    border: 3px solid var(--player-primary);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    cursor: pointer;
    opacity: 0;
    transition: var(--player-transition);
    box-shadow: var(--player-shadow-mini);
    z-index: 2;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--player-text-muted);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 500;
}

/* ===== 音量控制區域（修正版） ===== */
.player-volume {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 15px;
}

/* ===== 音量按鈕文字圖示修復 ===== */

/* 音量按鈕基本樣式 */
#volume-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--player-bg);
    border: 1px solid var(--player-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--player-transition);
    color: var(--player-text);
    box-shadow: var(--player-shadow-mini);
    font-size: 16px;
    font-family: Arial, sans-serif;
}

/* 移除所有 dashicons 和偽元素 */
#volume-toggle::before,
#volume-toggle::after,
#volume-toggle .dashicons {
    display: none !important;
    content: none !important;
}

/* 使用偽元素顯示文字圖示 */
#volume-toggle::after {
    display: inline-block !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 預設狀態 - 音量開 */
#volume-toggle::after {
    content: '🔊' !important;
}

/* 高音量狀態 */
#volume-toggle.volume-high::after {
    content: '🔊' !important; /* 高音量喇叭 */
}

/* 中音量狀態 */
#volume-toggle.volume-medium::after {
    content: '🔉' !important; /* 中音量喇叭 */
}

/* 低音量狀態 */
#volume-toggle.volume-low::after {
    content: '🔈' !important; /* 低音量喇叭 */
}

/* 靜音狀態 */
#volume-toggle.volume-muted::after {
    content: '🔇' !important; /* 靜音喇叭 */
}

/* 替代方案：使用純文字符號 */
/*
#volume-toggle::after {
    content: '♪' !important;
}

#volume-toggle.volume-high::after {
    content: '♫' !important;
}

#volume-toggle.volume-medium::after {
    content: '♪' !important;
}

#volume-toggle.volume-low::after {
    content: '♩' !important;
}

#volume-toggle.volume-muted::after {
    content: '✕' !important;
}
*/

/* 或者使用更簡單的符號 */
/*
#volume-toggle::after {
    content: 'VOL' !important;
    font-size: 10px !important;
    font-weight: bold !important;
}

#volume-toggle.volume-muted::after {
    content: 'MUTE' !important;
    font-size: 8px !important;
    font-weight: bold !important;
}
*/

/* 顏色狀態管理 */
#volume-toggle.volume-high {
    color: var(--volume-high-color, #0073aa);
}

#volume-toggle.volume-medium {
    color: var(--volume-medium-color, #ffc107);
}

#volume-toggle.volume-low {
    color: var(--volume-low-color, #dc3545);
}

#volume-toggle.volume-muted {
    color: var(--volume-muted-color, #6c757d);
    background: #f8d7da;
    border-color: var(--player-danger);
}

/* 預設狀態顏色 */
#volume-toggle:not(.volume-muted) {
    color: var(--player-primary, #0073aa);
}

/* hover 效果 */
#volume-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--player-primary);
}

#volume-toggle:hover::after {
    transform: scale(1.1);
}

/* 靜音狀態 hover */
#volume-toggle.volume-muted:hover {
    background: #f5c6cb;
    border-color: #c62d2d;
}

/* 點擊效果 */
#volume-toggle:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

#volume-toggle:active::after {
    transform: scale(0.9);
}

/* 確保沒有其他內容干擾 */
#volume-toggle > * {
    display: none !important;
}

/* 響應式調整 */
@media (max-width: 480px) {
    #volume-toggle {
        width: 36px;
        height: 36px;
    }
    
    #volume-toggle::after {
        font-size: 14px !important;
    }
}
.volume-bar {
    flex: 1;
    height: 4px;
    background: var(--player-light);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: height 0.2s ease;
}

.volume-bar:hover {
    height: 6px;
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--player-primary), var(--player-accent));
    border-radius: 2px;
    width: 80%;
    transition: width 0.2s ease;
    position: relative;
}

/* 音量填充顏色根據音量大小變化 */
.volume-fill.volume-high {
    background: linear-gradient(90deg, var(--volume-high-color), var(--player-accent));
}

.volume-fill.volume-medium {
    background: linear-gradient(90deg, var(--volume-medium-color), var(--volume-high-color));
}

.volume-fill.volume-low {
    background: var(--volume-low-color);
}

.volume-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--player-bg);
    border: 2px solid var(--player-primary);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 80%;
    cursor: pointer;
    box-shadow: var(--player-shadow-mini);
    transition: var(--player-transition);
    opacity: 0;
}

.volume-bar:hover .volume-handle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3);
}

/* ===== 播放器動作區域 ===== */
.player-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--player-light);
    border-radius: var(--player-radius-small);
    border-top: 1px solid var(--player-border);
}

.player-actions .control-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.player-actions .control-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===== 播放清單容器 ===== */
.playlist-container {
    z-index: 1;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--player-bg);
    border: 1px solid var(--player-border);
    border-bottom: none;
    border-radius: var(--player-radius) var(--player-radius) 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow: hidden;
    transform: translateY(100%);
    transition: var(--player-transition);
}

.playlist-container:not(.hidden) {
    transform: translateY(0);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--player-light);
    border-bottom: 1px solid var(--player-border);
}

.playlist-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--player-text);
}

.playlist-controls {
    display: flex;
    gap: 8px;
}


/* ===== 播放清單按鈕文字樣式定義 ===== */

/* 播放清單控制按鈕基本樣式 */
.playlist-controls .control-btn {
    padding: 6px 30px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

/* 清空按鈕樣式 */
#clear-playlist {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    font-size: 12px; /* 文字大小 */
}

#clear-playlist:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
}

/* 清空按鈕中的文字 */
#clear-playlist .dashicons {
    font-size: 12px; /* 圖示大小 */
    width: 12px;
    height: 12px;
    margin-right: 2px;
}

/* 關閉按鈕樣式 */
#close-playlist {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
    font-size: 12px; /* 文字大小 */
}

#close-playlist:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
}

/* 關閉按鈕中的文字 */
#close-playlist .dashicons {
    font-size: 12px; /* 圖示大小 */
    width: 12px;
    height: 12px;
    margin-right: 2px;
}

/* 按鈕內文字樣式調整 */
.playlist-controls .control-btn span:not(.dashicons) {
    font-size: 11px !important; /* 強制設定文字大小 */
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .playlist-controls .control-btn {
        font-size: 10px;
        padding: 5px 10px;
        gap: 3px;
    }
    
    #clear-playlist,
    #close-playlist {
        font-size: 10px;
    }
    
    .playlist-controls .control-btn .dashicons {
        font-size: 11px !important;
        width: 11px !important;
        height: 11px !important;
    }
    
    .playlist-controls .control-btn span:not(.dashicons) {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .playlist-controls .control-btn {
        font-size: 9px;
        padding: 4px 8px;
        gap: 2px;
    }
    
    #clear-playlist,
    #close-playlist {
        font-size: 9px;
    }
    
    .playlist-controls .control-btn .dashicons {
        font-size: 10px !important;
        width: 10px !important;
        height: 10px !important;
    }
    
    .playlist-controls .control-btn span:not(.dashicons) {
        font-size: 9px !important;
    }
}



.playlist-items {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--player-border) transparent;
}

.playlist-items::-webkit-scrollbar {
    width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: var(--player-border);
    border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: var(--player-text-muted);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: var(--player-transition);
    cursor: pointer;
}

.playlist-item:hover,
.playlist-item.active {
    background: var(--player-light);
    border-left: 3px solid var(--player-primary);
}

.playlist-item .item-number {
    font-weight: 700;
    color: var(--player-text-muted);
    min-width: 25px;
    text-align: center;
    font-size: 12px;
}

.playlist-item .item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item .item-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .item-artist {
    font-size: 11px;
    color: var(--player-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .item-controls {
    display: flex;
    gap: 4px;
}

.playlist-item .item-controls button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--player-transition);
    font-size: 12px;
}

.playlist-play-btn {
    background: var(--player-primary);
    color: white;
}

.playlist-play-btn:hover {
    background: var(--player-primary-hover);
    transform: scale(1.1);
}

.playlist-remove-btn {
    background: var(--player-danger);
    color: white;
}

.playlist-remove-btn:hover {
    background: #c62d2d;
    transform: scale(1.1);
}

.playlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--player-text-muted);
}

.playlist-empty p {
    margin: 0 0 8px 0;
    font-weight: 600;
}

.playlist-empty small {
    font-size: 11px;
    opacity: 0.8;
}

/* ===== 載入和錯誤狀態 ===== */
.control-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {

    to { transform: rotate(360deg); }
}

/* 播放狀態指示 */
.playing .play-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 最愛按鈕狀態 */
#player-favorite {
    display: block !important;
}

#player-favorite.favorited {
    background: var(--player-accent) !important;
    color: var(--player-text-light) !important;
    border-color: var(--player-accent) !important;
}

#player-favorite.favorited .dashicons {
    color: var(--player-text-light) !important;
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 隨機和重複按鈕狀態 */
#player-shuffle.active,
#player-repeat.repeat-all,
#player-repeat.repeat-one {
    background: var(--player-primary);
    color: var(--player-text-light);
    border-color: var(--player-primary);
}

/* 按鈕點擊效果 */
.control-btn.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* ===== 繼續播放提示樣式 ===== */
.player-continue-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.prompt-content {
    background: var(--player-bg);
    padding: 30px;
    border-radius: var(--player-radius);
    box-shadow: var(--player-shadow-hover);
    text-align: center;
    max-width: 400px;
    margin: 20px;
    border: 1px solid var(--player-border);
}

.prompt-content p {
    margin: 0 0 20px 0;
    color: var(--player-text);
    font-size: 16px;
    font-weight: 500;
}

.prompt-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.prompt-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--player-radius-small);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--player-transition-fast);
    min-width: 100px;
}

.continue-yes {
    background: var(--player-primary);
    color: var(--player-text-light);
}

.continue-yes:hover {
    background: var(--player-primary-hover);
    transform: translateY(-1px);
}

.continue-no {
    background: var(--player-light);
    color: var(--player-text);
    border: 1px solid var(--player-border);
}

.continue-no:hover {
    background: var(--player-border);
}

/* ===== 播放器訊息樣式 ===== */
.player-message {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--player-radius-small);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 20;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.player-message.success {
    background: var(--player-success);
    color: white;
}

.player-message.error {
    background: var(--player-danger);
    color: white;
}

.player-message.info {
    background: var(--player-primary);
    color: white;
}

/* ===== 歌詞模態框樣式整合 ===== */
.lyrics-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.lyrics-modal {
    background: var(--player-bg);
    border-radius: var(--player-radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--player-shadow-hover);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid var(--player-border);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--player-border);
    background: var(--player-light);
}

.lyrics-header h3 {
    margin: 0;
    color: var(--player-text);
    font-size: 20px;
    font-weight: 700;
}

.close-lyrics {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--player-text-muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--player-transition);
}

.close-lyrics:hover {
    background: var(--player-border);
    color: var(--player-text);
}

.lyrics-content {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.song-info {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--player-border);
    text-align: center;
}

.song-info h4 {
    margin: 0 0 8px 0;
    color: var(--player-text);
    font-size: 18px;
    font-weight: 600;
}

.song-info p {
    margin: 0;
    color: var(--player-text-muted);
    font-size: 14px;
}

.lyrics-text {
    line-height: 2;
    color: var(--player-text);
    font-size: 16px;
    white-space: pre-line;
    text-align: center;
}

/* 載入動畫 */
.loading {
    text-align: center;
    color: var(--player-text-muted);
    padding: 20px;
    position: relative;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--player-border);
    border-radius: 50%;
    border-top-color: var(--player-primary);
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    .floating-player {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        min-width: 280px;
    }
    
    .player-container {
        padding: 15px;
    }
    
    .player-controls {
        gap: 8px;
        padding: 12px;
    }
    
    .playlist-container {
        max-height: 250px;
    }
    
    .playlist-items {
        max-height: 150px;
    }
    
    .lyrics-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .lyrics-header {
        padding: 15px 20px;
    }
    
    .lyrics-content {
        padding: 20px;
    }
    
    .lyrics-text {
        font-size: 14px;
        line-height: 1.8;
    }
}

@media (max-width: 480px) {
    .floating-player.mini-mode {
        max-height: 70px;
        min-width: 260px;
    }
    
    .mini-play-btn {
        width: 36px;
        height: 36px;
    }
    
    .mini-expand-btn {
        width: 28px;
        height: 28px;
    }
    
    .player-info {
        gap: 10px;
    }
    
    .player-cover {
        width: 50px;
        height: 50px;
    }
    
    .player-title {
        font-size: 14px;
    }
    
    .player-artist {
        font-size: 12px;
    }
    
    .playlist-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .prompt-content {
        margin: 10px;
        padding: 20px;
    }
    
    .prompt-buttons {
        flex-direction: column;
    }
    
    .prompt-buttons button {
        width: 100%;
    }
}

/* ===== 無障礙優化 ===== */
.control-btn:focus {
    outline: 2px solid var(--player-primary);
    outline-offset: 2px;
}

.progress-bar:focus-within,
.volume-bar:focus-within {
    outline: 2px solid var(--player-primary);
    outline-offset: 2px;
}

/* 高對比模式支援 */
@media (prefers-contrast: high) {
    :root {
        --player-border: #000000;
        --player-text: #000000;
        --player-text-muted: #444444;
        --player-primary: #0066cc;
        --player-accent: #cc0066;
    }
}

/* 減少動畫模式支援 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .progress-fill::after {
        animation: none;
    }
    
    .playing .play-btn {
        animation: none;
    }
}

/* ===== 打印樣式 ===== */
@media print {
    .floating-player,
    .lyrics-modal-overlay,
    .player-continue-prompt {
        display: none !important;
    }
}

/* ===== 深色主題額外樣式 ===== */
@media (prefers-color-scheme: dark) {
    .lyrics-modal {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .lyrics-header {
        background: #2a2a2a;
        border-color: #404040;
    }
    
    .song-info {
        border-color: #404040;
    }
    
    .prompt-content {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .playlist-container {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .playlist-header {
        background: #2a2a2a;
        border-color: #404040;
    }
}


/* ===== 播放器切換功能修復樣式 ===== */
.floating-player.mini-mode {
    max-height: 80px !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease;
}

.floating-player:not(.mini-mode) {
    max-height: none !important;
    transition: max-height 0.3s ease;
}

.control-btn.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* 確保切換按鈕動畫效果 */
.toggle-expand-btn .dashicons {
    transition: transform 0.3s ease;
}

.floating-player.mini-mode .toggle-expand-btn .dashicons {
    transform: rotate(45deg);
}

.floating-player:not(.mini-mode) .toggle-expand-btn .dashicons {
    transform: rotate(0deg);
}