:root {
    --bg-body: #292d33;
    --bg-player: #292d33;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --accent-gold: #d4af37; 
    --shadow-light: #353b42; 
    --shadow-dark: #1d2024;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Helvetica Neue', 'Noto Sans TC', sans-serif;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; margin: 0;
    overflow: hidden;
}

.player-body {
    width: 360px;
    height: 700px;
    background: var(--bg-player);
    border-radius: 30px;
    box-shadow: 20px 20px 60px var(--shadow-dark), 
                -20px -20px 60px var(--shadow-light);
    padding: 30px;
    display: flex; flex-direction: column; gap: 20px;
    position: relative;
}

/* --- 頂部 --- */
.header-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
    height: 30px;
}
.brand-logo {
    font-family: 'Georgia', serif; font-weight: bold; font-size: 1.2rem; color: var(--text-primary);
    pointer-events: none;
}
.brand-logo small { font-size: 0.6rem; color: var(--accent-gold); text-transform: uppercase; margin-left: 5px; font-family: sans-serif;}

.header-actions { display: flex; gap: 15px; align-items: center; }

.icon-btn {
    background: none; border: none; color: var(--text-secondary); 
    font-size: 1.2rem; cursor: pointer; transition: 0.2s;
}
.icon-btn:hover { color: var(--accent-gold); transform: scale(1.1); }

/* --- 視窗切換區 --- */
.content-viewport {
    position: relative;
    width: 100%;
    height: 280px; 
    margin-bottom: 10px;
}

.view-container {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; 
    gap: 15px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.view-container.hidden { opacity: 0; transform: scale(0.95); pointer-events: none; z-index: -1; }
.view-container.active { opacity: 1; transform: scale(1); z-index: 1; }

/* 視圖 A */
.album-art-container {
    width: 160px; height: 160px;
    border-radius: 50%;
    background: var(--bg-player);
    box-shadow: inset 6px 6px 12px var(--shadow-dark), 
                inset -6px -6px 12px var(--shadow-light);
    display: flex; align-items: center; justify-content: center;
    border: 5px solid var(--bg-player);
    margin-top: 10px;
}
.art-circle {
    width: 100%; height: 100%; border-radius: 50%;
    background: var(--bg-player);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--text-secondary);
}
.art-circle.active {
    color: var(--accent-gold);
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2)); 
    box-shadow: 5px 5px 15px var(--shadow-dark);
}
.info-group { text-align: center; width: 100%; }
.info-group h2 { margin: 10px 0 5px; font-size: 1.1rem; color: var(--text-primary); font-weight: 600; }
.info-group h3 { margin: 0; font-size: 0.85rem; color: var(--text-secondary); font-weight: normal; }

/* 視圖 B: 播放清單 */
.playlist-header {
    width: 100%; 
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2); 
    padding-bottom: 5px; margin-bottom: 5px;
    font-size: 0.8rem; color: var(--accent-gold);
}

/* ★ 修改：SVG 清空按鈕樣式 ★ */
.clear-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); /* 預設灰色 */
    padding: 5px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.6;
}
.clear-btn svg {
    width: 18px; height: 18px; /* 設定 SVG 大小 */
}
.clear-btn:hover {
    color: #ff5f57; /* 懸停變紅色 (警示) */
    opacity: 1;
    transform: scale(1.1);
}

.elegant-list {
    width: 100%; height: 100%;
    margin: 0; padding: 5px; list-style: none;
    overflow-y: auto;
}
.elegant-list li {
    padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem; color: var(--text-secondary); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: 0.2s; text-align: left;
    scroll-margin-top: 5px;
}
.elegant-list li:hover { color: var(--text-primary); background: rgba(255,255,255,0.02); }
.elegant-list li.active { color: var(--accent-gold); font-weight: bold; border-left: 3px solid var(--accent-gold); padding-left: 7px;}

/* 捲軸設定 */
.elegant-list::-webkit-scrollbar { width: 8px; }
.elegant-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
.elegant-list::-webkit-scrollbar-thumb { background: #4a4e55; border-radius: 4px; border: 1px solid var(--bg-player); }
.elegant-list::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }

/* 其他通用 */
.elegant-viz { display: flex; justify-content: center; gap: 4px; height: 25px; margin-top: 15px; align-items: center; }
.line { width: 3px; height: 4px; background: var(--accent-gold); border-radius: 2px; opacity: 0.3; transition: height 0.2s; }
.elegant-viz.active .line { animation: wave 0.8s infinite ease-in-out; opacity: 1; box-shadow: 0 0 8px rgba(212, 175, 55, 0.4); }
.elegant-viz.active .line:nth-child(odd) { animation-duration: 0.6s; }
.elegant-viz.active .line:nth-child(2n) { animation-duration: 0.9s; }
.elegant-viz.active .line:nth-child(3n) { animation-duration: 1.1s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 25px; } }

.progress-area { margin-top: auto; }
.time-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 8px; }
.progress-track-wrapper, .vol-slider-wrapper {
    position: relative; height: 8px; width: 100%;
    background: var(--bg-player); border-radius: 4px;
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    display: flex; align-items: center;
}
#progress, #volume { -webkit-appearance: none; appearance: none; width: 100%; height: 100%; background: transparent; position: absolute; z-index: 3; cursor: pointer; border: none; margin: 0; }
.progress-fill, .vol-fill { position: absolute; height: 100%; background: var(--accent-gold); border-radius: 4px; pointer-events: none; box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }

.control-section { display: flex; flex-direction: column; gap: 20px; flex: 1; justify-content: flex-end;}
.transport-controls { display: flex; justify-content: center; align-items: center; gap: 25px; }
.circle-btn { border: none; background: var(--bg-player); border-radius: 50%; color: var(--text-secondary); cursor: pointer; box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light); display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.circle-btn:active { box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light); color: var(--accent-gold); }
.small { width: 50px; height: 50px; } .large { width: 80px; height: 80px; font-size: 1.5rem; color: var(--accent-gold); }
.option-controls { display: flex; justify-content: space-between; gap: 10px; }
.capsule-btn { flex: 1; padding: 10px; border: none; background: var(--bg-player); border-radius: 12px; color: var(--text-secondary); font-size: 0.8rem; cursor: pointer; box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light); }
.capsule-btn:active, .capsule-btn.active-state { box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light); color: var(--accent-gold); }
.volume-controls { display: flex; align-items: center; gap: 15px; color: var(--text-secondary); }
.system-controls { display: flex; justify-content: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; }

.file-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}
.file-wrapper input { display: none; }
.text-btn { background: none; border: none; color: var(--text-secondary); font-size: 0.85rem; cursor: pointer; }
.text-btn:hover { color: var(--accent-gold); }
.divider { color: rgba(255,255,255,0.1); font-size: 0.8rem; }

#progress::-webkit-slider-thumb, #volume::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: transparent; cursor: pointer; position: relative; z-index: 4; margin-top: -2px; }
#progress:hover::-webkit-slider-thumb, #progress:active::-webkit-slider-thumb, #volume:hover::-webkit-slider-thumb, #volume:active::-webkit-slider-thumb { background: var(--accent-gold); box-shadow: 0 0 15px var(--accent-gold); transform: scale(1.8); }