:root {
    --bg-color: #f5f6fa;
    --text-color: #2f3640;
    --accent-color: #00d2d3;
    --secondary-color: #dcdde1;
    --highlight-color: #ff6b6b;
    --window-bg: rgba(255, 255, 255, 0.85);
    --button-bg: #f5f6fa;
    --button-text: #2f3640;
    --spectrum-color: #00d2d3;
    --spectrum-height: 100px;
    --blur-intensity: 20px;
    --ui-opacity: 0.85;
}

body.theme-dark {
    --bg-color: #1e272e;
    --text-color: #f5f6fa;
    --accent-color: #00d2d3;
    --secondary-color: #485460;
    --highlight-color: #ff5e57;
    --window-bg: rgba(43, 58, 66, 0.85);
    --button-bg: #485460;
    --button-text: #f5f6fa;
    --spectrum-color: #00d2d3;
}

body.theme-blackgold {
    --bg-color: #0b0c10;
    --text-color: #c5a059;
    --accent-color: #ffd700;
    --secondary-color: #1f2833;
    --highlight-color: #f4b41a;
    --window-bg: rgba(26, 26, 29, 0.9);
    --button-bg: #1f2833;
    --button-text: #ffd700;
    --spectrum-color: #ffd700;
}

body.theme-pink {
    --bg-color: #fff0f5;
    --text-color: #d1345b;
    --accent-color: #ff85a2;
    --secondary-color: #f7cad0;
    --highlight-color: #f15bb5;
    --window-bg: rgba(255, 240, 245, 0.85);
    --button-bg: #f7cad0;
    --button-text: #d1345b;
    --spectrum-color: #ff85a2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#dynamic-background {
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(var(--blur-intensity));
    opacity: 0.35;
    transition: background-image 0.8s ease-in-out, filter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#video-background, #image-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    object-fit: cover;
    display: none;
}

#titleBar {
    height: 45px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    padding: 0 15px;
    opacity: var(--ui-opacity);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.title-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.title-btn:hover { background-color: rgba(255,255,255,0.2); }
#titleLabel { flex: 1; text-align: center; font-weight: 700; letter-spacing: 1px; }

#mainContainer { display: flex; flex: 1; overflow: hidden; position: relative; }

#menuWidget {
    width: 180px;
    background-color: var(--window-bg);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: var(--ui-opacity);
    border-right: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.menu-btn {
    height: 42px;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    text-align: left;
    padding: 0 15px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-btn i { font-size: 16px; width: 20px; text-align: center; }
.menu-btn:hover { background-color: var(--accent-color); color: #fff; transform: translateX(3px); }
.menu-btn.active { background-color: var(--accent-color); color: #fff; font-weight: 600; }

#contentArea {
    flex: 1;
    background-color: rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}

.page { position: absolute; width: 100%; height: 100%; padding: 20px; overflow-y: auto; display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease-out; }

#bottomBar {
    height: 75px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    opacity: var(--ui-opacity);
    backdrop-filter: blur(15px);
}

#songInfo { width: 180px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-controls { display: flex; align-items: center; gap: 8px; }

.control-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.control-btn:hover { background-color: var(--accent-color); color: #fff; transform: scale(1.05); }
.control-btn:active { transform: scale(0.95); }

.progress-box { flex: 1; display: flex; align-items: center; gap: 12px; }
#progressSlider, #volumeSlider {
    flex: 1; -webkit-appearance: none; height: 6px; background: rgba(0, 0, 0, 0.15); border-radius: 3px; outline: none;
}
#progressSlider::-webkit-slider-thumb, #volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-color); cursor: pointer;
}
#timeLabel { font-size: 12px; font-family: monospace; width: 85px; text-align: center; }
.volume-box { width: 130px; display: flex; align-items: center; gap: 8px; }

.playing-layout { display: flex; height: 100%; gap: 20px; }
.player-left { width: 320px; display: flex; flex-direction: column; align-items: center; background: var(--window-bg); padding: 20px; border-radius: 16px; backdrop-filter: blur(10px); }
.cover-container { width: 180px; height: 180px; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.15); margin-bottom: 15px; }
.cover-image { width: 100%; height: 100%; object-fit: cover; }
#songTitle { font-size: 18px; font-weight: 700; margin-bottom: 4px; text-align: center; }
#artistName { font-size: 14px; opacity: 0.7; margin-bottom: 15px; }

.visualizer-container { width: 100%; height: 80px; margin-top: auto; }
#visualizerCanvas { width: 100%; height: 100%; display: block; }

.player-right { flex: 1; background: var(--window-bg); border-radius: 16px; padding: 20px; backdrop-filter: blur(10px); }
#lyricsContainer { height: 100%; overflow-y: auto; scroll-behavior: smooth; padding-right: 5px; text-align: center; }
.lyric-item { padding: 10px 0; font-size: 15px; opacity: 0.5; transition: all 0.25s ease; color: var(--text-color); }
.lyric-item.lyric-highlight { opacity: 1; color: var(--highlight-color); font-weight: 700; font-size: 18px; text-shadow: 0 0 12px rgba(255,107,107,0.3); }

.search-container { display: flex; gap: 10px; margin-bottom: 20px; }
#sourceSelect { padding: 0 12px; border-radius: 8px; border: 1px solid var(--secondary-color); background: var(--window-bg); color: var(--text-color); outline: none; }
#searchInput { flex: 1; padding: 10px 15px; border-radius: 8px; border: 1px solid var(--secondary-color); background: var(--window-bg); color: var(--text-color); outline: none; }
#searchBtn, .primary-btn, .success-btn { padding: 0 20px; height: 40px; border: none; border-radius: 8px; background: var(--accent-color); color: #fff; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.danger-btn { padding: 0 15px; height: 35px; border: none; border-radius: 8px; background: var(--highlight-color); color: #fff; cursor: pointer; font-weight: 600; }

.result-item { padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; background: var(--window-bg); margin-bottom: 6px; border-radius: 8px; }
.result-info { flex: 1; font-weight: 500; font-size: 14px; }
.result-actions { display: flex; gap: 6px; }
.result-actions button { padding: 6px 12px; border: none; background: var(--button-bg); color: var(--button-text); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.result-actions button:hover { background: var(--accent-color); color: #fff; }

.settings-group, .tag-editor, .theme-editor { margin-bottom: 20px; background: var(--window-bg); border-radius: 12px; padding: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.03); }
.settings-title { font-weight: 700; margin-bottom: 12px; border-bottom: 1px solid var(--secondary-color); padding-bottom: 6px; }
.settings-option { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tag-input { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid var(--secondary-color); background: var(--bg-color); color: var(--text-color); }
.background-selector { display: flex; gap: 8px; margin-bottom: 15px; }
.bg-option { flex: 1; padding: 10px; text-align: center; border: 2px solid var(--secondary-color); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.bg-option.active { border-color: var(--accent-color); background-color: rgba(0,210,211,0.1); }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: var(--window-bg); padding: 25px; border-radius: 16px; max-width: 480px; width: 90%; max-height: 75vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-list-area { margin: 15px 0; max-height: 250px; overflow-y: auto; }
.modal-foot-actions { display: flex; justify-content: flex-end; gap: 10px; }
.secondary-btn { padding: 0 15px; height: 35px; border: 1px solid var(--secondary-color); border-radius: 8px; background: transparent; color: var(--text-color); cursor: pointer; }

.gradient-preview { width: 100%; height: 60px; border-radius: 8px; margin-bottom: 10px; }
.gradient-controls { display: flex; gap: 10px; margin-bottom: 10px; }
.gradient-type-selector { display: flex; gap: 6px; margin-bottom: 10px; }
.gradient-type-btn { padding: 6px 12px; border: none; background: var(--button-bg); border-radius: 6px; cursor: pointer; font-size: 12px; }
.gradient-type-btn.active { background: var(--accent-color); color: #fff; }

.page-header-action { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--secondary-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }