:root {
    --bg-color: #f5f5f7;
    --main-white: #ffffff;
    --primary-text-color: #ffffff;
    --secondary-text-color: rgba(255, 255, 255, 0.7);
    --highlight-color: #31c27c;
    --border-color: rgba(255, 255, 255, 0.2);
    --hover-bg-color: rgba(255, 255, 255, 0.15);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    --dolby-yellow: #ffc82c; 
}

#page-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
}

#page-background .bg-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: background-fade 120s infinite;
    will-change: opacity;
}

#page-background .bg-slide:nth-child(1) {
    background-image: url('background/5.JPG');
    animation-delay: 0s;
}
#page-background .bg-slide:nth-child(2) {
    background-image: url('background/6.JPG');
    animation-delay: 30s;
}
#page-background .bg-slide:nth-child(3) {
    background-image: url('background/8.JPG');
    animation-delay: 60s;
}
#page-background .bg-slide:nth-child(4) {
    background-image: url('background/9.JPG');
    animation-delay: 90s;
}

@keyframes background-fade {
    0% {
        opacity: 0;
    }
    2.5% {
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    27.5% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: transparent;
    color: var(--primary-text-color);
    font-weight: 500;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr;
    height: calc(100vh - 80px);
}

.sidebar {
    background-color: transparent;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    padding: 0 25px 20px 25px;
    display: flex;
    align-items: center;
}
.logo svg { width: 28px; height: 28px; margin-right: 10px; fill: var(--highlight-color); }

.navigation { padding: 0 15px; }
.nav-list { list-style: none; }
.nav-list li a {
    cursor: pointer; display: flex; align-items: center; padding: 12px 10px;
    border-radius: 6px; text-decoration: none; color: var(--primary-text-color);
    font-size: 15px; transition: background-color 0.2s, color 0.2s, font-weight 0.2s;
}
.nav-list li a.active, .nav-list li a:hover { background-color: var(--hover-bg-color); }
.nav-list li a.active { font-weight: 600; color: var(--highlight-color); }
.nav-list li a.active svg { fill: var(--highlight-color); }
.nav-list svg { width: 20px; height: 20px; margin-right: 15px; fill: var(--secondary-text-color); transition: fill 0.2s; }

.main-view { display: grid; grid-template-rows: 60px 1fr; overflow: hidden; }
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px; 
    border-bottom: 1px solid var(--border-color); 
    background-color: transparent;
}

.search-bar { position: relative; width: 300px; }
.search-bar input {
    width: 100%; height: 36px; border-radius: 18px; border: 1px solid var(--border-color);
    padding: 0 40px 0 15px; font-size: 14px; 
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--primary-text-color);
}
.search-bar input::placeholder { color: var(--secondary-text-color); }
.search-bar input:focus { outline: none; border-color: var(--highlight-color); background-color: rgba(0, 0, 0, 0.3); }
.search-bar button {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.search-bar svg { width: 16px; height: 16px; fill: var(--secondary-text-color); }

.content-area {
    overflow-y: auto; 
    padding: 30px; 
    position: relative; 
    background-color: transparent;
}

.content-section h2 { font-size: 22px; margin-bottom: 20px; }
.content-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.content-section .section-header h2 {
    margin-bottom: 0;
}

.message-area {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; text-align: center; color: var(--secondary-text-color); position: relative;
    background-color: transparent;
}
.message-area .bg-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 300px; fill: rgba(255,255,255,0.1); opacity: 0.5; z-index: 0;
}
.message-area h2, .message-area p { position: relative; z-index: 1; }
.message-area h2 { font-size: 2rem; color: var(--primary-text-color); margin-bottom: 10px;}

.results-table { width: 100%; border-collapse: collapse; }
.results-table thead { position: sticky; top: -30px; background-color: transparent; z-index: 10; }
.results-table th, .results-table td { padding: 15px 10px; text-align: left; border-bottom: 1px solid var(--border-color); }
.results-table th { color: var(--primary-text-color); font-weight: 600; font-size: 14px; }
.results-table tbody tr { transition: background-color 0.2s; position: relative; cursor: pointer;}
.results-table tbody tr:hover { background-color: var(--hover-bg-color); }
.results-table tbody tr.no-songs-row { cursor: default; }
.results-table tbody tr.no-songs-row:hover { background-color: transparent; }
.results-table td { font-size: 14px; color: var(--primary-text-color); }
.results-table td:first-child { color: var(--primary-text-color); font-weight: 500; }
.play-icon-cell svg { fill: var(--highlight-color); width: 20px; height: 20px; }
.results-table tbody tr.no-songs-row:hover td:first-child { transform: none; }

.actions-container {
    display: flex;
    align-items: center;
    display: inline-flex;
    gap: 8px;
}
.action-button {
    padding: 6px 12px; border: 1px solid var(--border-color);
    border-radius: 5px; background-color: transparent; color: var(--primary-text-color);
    cursor: pointer; transition: all 0.2s; font-size: 13px;
    white-space: nowrap; 
}
.action-button:hover { background-color: var(--hover-bg-color); }
.icon-button {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 5px; border-radius: 50%;
}
.icon-button:hover { background-color: rgba(255,255,255,0.1); }

.favorite-btn svg { width: 22px; height: 22px; }
.favorite-btn .unfavorited-path { fill: var(--secondary-text-color); }
.favorite-btn .favorited-path { fill: none; }
.favorite-btn.favorited .unfavorited-path { fill: none; }
.favorite-btn.favorited .favorited-path { fill: #e53935; }

.pagination { display: flex; justify-content: center; align-items: center; padding: 25px 0 10px; gap: 10px; }
.pagination button {
    padding: 8px 15px; border: 1px solid var(--border-color); background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-text-color); border-radius: 5px; cursor: pointer; transition: background-color 0.2s;
}
.pagination button:hover { background-color: var(--hover-bg-color); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

.loader {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    border: 4px solid var(--hover-bg-color); border-top: 4px solid var(--highlight-color);
    border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; display: none;
}
@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }

.settings-form-group { display: flex; align-items: center; margin-bottom: 25px; gap: 15px; }
.settings-form-group label { font-weight: 600; font-size: 16px; min-width: 120px; }

.custom-select, .custom-number-input { position: relative; width: 117px; }
.custom-select-trigger, .custom-number-input-display {
    display: flex; justify-content: space-between; align-items: center;
    height: 40px; background-color: rgba(0,0,0,0.2); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 0 15px; cursor: pointer; transition: border-color 0.2s;
}
.custom-select-trigger { justify-content: center; position: relative; }
.custom-select.open .custom-select-trigger, .custom-select-trigger:hover { border-color: var(--highlight-color); }
.custom-select-trigger::after {
    content: '';
    border: solid var(--secondary-text-color);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transition: transform 0.3s;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.custom-select.open .custom-select-trigger::after { transform: translateY(-50%) rotate(-135deg); }
.custom-options {
    position: absolute; top: 110%; left: 0; right: 0; background-color: rgba(30,30,30,0.9);
    border: 1px solid var(--border-color); border-radius: 8px; z-index: 100;
    max-height: 200px; overflow-y: auto; opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.fullscreen-player .custom-options {
    top: auto; bottom: 110%; transform: translateY(10px);
}
.custom-select.open .custom-options { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-option { padding: 10px 15px; cursor: pointer; text-align: center;}
.custom-option:hover, .custom-option.selected { background-color: var(--hover-bg-color); }
.custom-option.selected { color: var(--highlight-color); font-weight: 500; }

.custom-number-input { display: flex; align-items: center; }
.custom-number-input-display { cursor: default; }
.custom-number-input input { border: none; outline: none; text-align: center; width: 50px; background: transparent; font-size: 14px; }
.custom-number-input button {
    background: none; border: none; cursor: pointer; font-size: 20px;
    color: var(--secondary-text-color); padding: 0 10px;
}
.custom-number-input button:hover { color: var(--highlight-color); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.player-bar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 80px;
    background-color: transparent; border-top: 1px solid var(--border-color);
    display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: center;
    padding: 0 30px; z-index: 1000; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.song-info { display: flex; align-items: center; }
.song-info .album-art {
    width: 56px; height: 56px; background-color: var(--hover-bg-color);
    background-size: cover; background-position: center; border-radius: 6px; margin-right: 15px;
    background-repeat: no-repeat;
}
.song-details .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.song-details .artist { font-size: 14px; color: var(--secondary-text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.player-controls { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.control-buttons { display: flex; align-items: center; margin-bottom: 8px; }
.control-buttons button { background: none; border: none; cursor: pointer; margin: 0 15px; z-index: 1001; }
.control-buttons .play-pause-btn {
    width: 42px;
    height: 42px;
    background-color: transparent;
    border: 1px solid white; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.control-buttons .play-pause-btn svg {
    width: 20px;
    height: 20px;
    fill: white; 
}
.control-buttons .side-btn svg { width: 24px; height: 24px; fill: var(--primary-text-color); }

.progress-container { display: flex; align-items: center; width: 100%; max-width: 500px; }
.progress-bar { flex-grow: 1; height: 4px; background-color: rgba(255,255,255,0.3); border-radius: 2px; cursor: pointer; margin: 0 10px; z-index: 1001; }
.progress-fill { width: 0%; height: 100%; background-color: white; border-radius: 2px; pointer-events: none; }
.time-display { font-size: 12px; color: var(--secondary-text-color); min-width: 40px; text-align: center; }

.player-extras { display: flex; align-items: center; justify-content: flex-end; }
.player-extras button { background: none; border: none; cursor: pointer; margin-left: 20px; z-index: 1001; }
.player-extras svg { width: 20px; height: 20px; fill: var(--secondary-text-color); }

.fullscreen-player {
    --fp-bg-color: #f5f5f7;
    --fp-text-color: #333333;
    --fp-secondary-text-color: #888888;
    --fp-shadow-color: rgba(0,0,0,0.15);
    --fp-blob-color-1: #31c27c;
    --fp-blob-color-2: #33a3ff;
    --fp-blob-color-3: #ff8c33;
    --fp-blob-color-4: #8e44ad;
    position: fixed; bottom: 0; left: 0; width: 100%; height: 100vh;
    z-index: 2000; transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 1s ease;
    display: flex; align-items: center; justify-content: center;
    padding: 5vh 5vw; overflow: hidden;
    background-color: var(--fp-bg-color);
    will-change: transform;
}
.fullscreen-player.visible { transform: translateY(0); }

#background-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; z-index: 0; opacity: 0;
}

.fullscreen-player.visible #background-container {
    transition: opacity 1s ease 0.5s;
}

.fullscreen-player.dynamic-bg-active #background-container {
    opacity: 1;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(120px); opacity: 0.6; will-change: transform;
}
#blob1 { background-color: var(--fp-blob-color-1); width: 60vmax; height: 60vmax; top: -20%; left: -20%; animation: move1 45s infinite alternate; }
#blob2 { background-color: var(--fp-blob-color-2); width: 50vmax; height: 50vmax; top: 20%; right: -15%; animation: move2 55s infinite alternate; }
#blob3 { background-color: var(--fp-blob-color-3); width: 45vmax; height: 45vmax; bottom: -20%; left: 30%; animation: move3 50s infinite alternate; }
#blob4 { background-color: var(--fp-blob-color-4); width: 40vmax; height: 40vmax; bottom: 30%; right: 20%; animation: move4 60s infinite alternate; }

@keyframes move1 { from { transform: translate(-20%, -10%) scale(1); } to { transform: translate(30%, 20%) scale(1.2); } }
@keyframes move2 { from { transform: translate(10%, 20%) scale(1); } to { transform: translate(-20%, -30%) scale(1.3); } }
@keyframes move3 { from { transform: translate(20%, -20%) scale(1.1); } to { transform: translate(-15%, 15%) scale(1); } }
@keyframes move4 { from { transform: translate(-10%, 10%) scale(1.2); } to { transform: translate(10%, -10%) scale(1); } }

.fp-close-btn, .fp-toggle-playlist-btn {
    position: absolute; width: 44px; height: 44px;
    background-color: rgba(0,0,0,0.05); border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 20;
}
.fp-close-btn { top: 30px; right: 30px; }
.fp-toggle-playlist-btn { bottom: 30px; right: 30px; }
.fp-close-btn svg, .fp-toggle-playlist-btn svg {
    width: 24px; height: 24px; fill: var(--fp-text-color);
    transition: fill 1s ease;
}

.fp-content-wrapper {
    width: 100%; height: 100%; display: grid;
    grid-template-columns: 1fr;
    transition: grid-template-columns 0.5s ease-in-out;
    max-width: 1400px; max-height: 85vh;
    position: relative; z-index: 1;
}
.fullscreen-player.lyrics-visible .fp-content-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 5vw;
}

.fp-main-panel {
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; text-align: center; width: 100%;
    height: 100%; padding: 5vh 0; min-width: 0;
}
.fullscreen-player.local-mode .fp-main-panel {
    justify-content: center; 
}

.fp-album-art {
    width: 35vh; max-width: 300px; aspect-ratio: 1 / 1; border-radius: 20px;
    background-color: var(--hover-bg-color); background-size: 25%; background-position: center;
    box-shadow: 0 15px 40px var(--fp-shadow-color); margin-bottom: 25px;
    flex-shrink: 0; background-repeat: no-repeat;
    transition: box-shadow 1s ease;
}
.fp-album-art[style*="url("] {
    background-size: cover;
}
.fp-song-info { margin-bottom: 20px; flex-shrink: 0; width: 100%;}
.fp-title-wrapper { display: flex; align-items: center; justify-content: center; gap: 15px; }
#fp-title {
    font-size: 2.2rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--fp-text-color); transition: color 1s ease;
}
#fp-artist {
    font-size: 1.1rem;
    margin-top: 5px;
    color: var(--fp-secondary-text-color);
    transition: color 1s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%; 
    margin-left: auto;
    margin-right: auto;
}

#fp-favorite-btn { flex-shrink: 0; }
#fp-favorite-btn .unfavorited-path {
    fill: var(--fp-secondary-text-color);
    transition: fill 1s ease;
}
#fp-favorite-btn:hover .unfavorited-path {
    fill: var(--fp-text-color);
}

.fp-progress-container { width: 100%; max-width: 400px; margin-bottom: 15px; }
.fp-progress-display {
    display: flex; justify-content: space-between; font-size: 0.8rem;
    margin-bottom: 5px; color: var(--fp-secondary-text-color);
    transition: color 1s ease;
}
.fp-progress-bar {
    width: 100%; height: 6px; background-color: rgba(128, 128, 128, 0.3);
    border-radius: 3px; cursor: pointer;
}
.fp-progress-fill { width: 0%; height: 100%; background-color: var(--fp-text-color); border-radius: 3px; transition: background-color 1s ease; }

.fp-playback-controls {
    display: flex; align-items: center; justify-content: center; gap: 30px;
    width: 100%; margin-bottom: 25px;
}
.fp-playback-controls button { background: none; border: none; cursor: pointer; }
.fp-playback-controls .side-btn svg { width: 32px; height: 32px; fill: var(--fp-secondary-text-color); transition: fill 1s ease; }
.fp-playback-controls .play-pause-btn {
    width: 70px;
    height: 70px;
    background-color: transparent; 
    border: 2px solid var(--fp-secondary-text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; 
    transition: background-color 0.2s ease, transform 0.1s ease; 
}

.fp-playback-controls .play-pause-btn svg {
    width: 30px;
    height: 30px;
    fill: var(--fp-secondary-text-color);
    transition: fill 1s ease; 
}

.fp-controls {
    display: flex; align-items: center; gap: 20px;
    background-color: transparent; flex-shrink: 0; justify-content: center;
}
.fp-controls label { font-weight: 500; color: var(--fp-text-color); transition: color 1s ease; }
.fp-controls .custom-select { width: 200px; }
.fp-controls .action-button {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--fp-text-color);
    border: 1px solid var(--fp-secondary-text-color);
    border-radius: 5px;
    transition: color 1s ease, border-color 1s ease, background-color 0.3s ease;
}
.fp-controls .action-button:hover {
    background-color: rgba(128, 128, 128, 0.2);
}
.fp-controls .action-button:focus,
.fp-controls .custom-select-trigger:focus {
    outline: none;
}
.fp-controls .custom-select-trigger {
    background-color: transparent;
    color: var(--fp-text-color);
    border-color: var(--fp-secondary-text-color);
    transition: color 1s ease, border-color 1s ease;
}
.fp-controls .custom-select-trigger::after {
    border-color: var(--fp-secondary-text-color);
    transition: border-color 1s ease, transform 0.3s;
}
.fp-controls .action-button.wide {
    width: 200px;
    justify-content: center;
}


.fp-lyrics-panel {
    display: none; flex-direction: column; height: 100%; overflow: hidden;
}
.fullscreen-player.lyrics-visible .fp-lyrics-panel { display: flex; }
.fp-lyrics-container {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-mask-image: linear-gradient(transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(transparent 0%, black 15%, black 85%, transparent 100%);
    overscroll-behavior-y: contain; 
}
.lyric-line {
    padding: 10px 0; font-size: 1.8rem; line-height: 1.6;
    color: var(--fp-secondary-text-color); font-weight: 500;
    transition: color 0.4s, font-size 0.4s, font-weight 0.4s, opacity 0.4s;
    opacity: 0.7;
    cursor: pointer;
}
.active-lyric {
    color: var(--fp-text-color);
    font-weight: 700;
    font-size: 2rem;
    opacity: 1;
    transition: color 0.4s, font-size 0.4s, font-weight 0.4s, opacity 0.4s;
}

.playlist-overlay {
    position: fixed; inset: 0; background-color: rgba(0,0,0,0.3);
    z-index: 3000; opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.playlist-overlay.visible { opacity: 1; visibility: visible; }
.playlist-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 100%; max-width: 380px; background-color: var(--main-white);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
    display: flex; flex-direction: column;
}
.playlist-overlay.visible .playlist-panel { transform: translateX(0); }
.playlist-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
    transition: border-bottom-color 0.5s ease;
}
.playlist-header h3 { font-size: 1.2rem; transition: color 0.5s ease; }
.playlist-header .close-btn { background: none; border: none; cursor: pointer; }
.playlist-header .close-btn svg { width: 20px; height: 20px; fill: var(--secondary-text-color); transition: fill 0.5s ease; }
.playlist-list { list-style: none; flex-grow: 1; overflow-y: auto; padding: 10px; }
.playlist-item {
    display: flex; align-items: center; padding: 10px; border-radius: 6px;
    cursor: pointer; transition: background-color 0.2s;
}
.playlist-item:hover { background-color: var(--hover-bg-color); }
.playlist-item .album-art {
    width: 40px; height: 40px; border-radius: 4px; background-color: var(--hover-bg-color);
    margin-right: 15px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background-size: cover;
    background-position: center;
}
.playlist-item .album-art svg {
    width: 24px; height: 24px; fill: var(--secondary-text-color);
}
.playlist-item .details { flex-grow: 1; overflow: hidden; }
.playlist-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.5s ease; }
.playlist-item .artist { font-size: 0.9rem; color: var(--secondary-text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.5s ease; }
.playlist-item .delete-btn {
    background: none; border: none; cursor: pointer; opacity: 0;
    margin-left: 10px; padding: 5px; flex-shrink: 0;
}
.playlist-item:hover .delete-btn { opacity: 1; }
.playlist-item .delete-btn svg { width: 16px; height: 16px; fill: var(--secondary-text-color); transition: fill 0.2s ease; }
.playlist-item .delete-btn:hover svg { fill: var(--primary-text-color); }

.playlist-panel.dark-theme { background-color: #262626; }
.playlist-panel.dark-theme .playlist-header { border-bottom-color: #404040; }
.playlist-panel.dark-theme .playlist-header h3 { color: #ffffff; }
.playlist-panel.dark-theme .close-btn svg { fill: #a0a0a0; }
.playlist-panel.dark-theme .playlist-item:hover { background-color: #383838; }
.playlist-panel.dark-theme .playlist-item .title { color: #e0e0e0; }
.playlist-panel.dark-theme .playlist-item .artist { color: #a0a0a0; }
.playlist-panel.dark-theme .delete-btn svg { fill: #a0a0a0; }
.playlist-panel.dark-theme .delete-btn:hover svg { fill: #ffffff; }

#fp-interactive-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 140px; 
    transition: min-height 0.3s ease;
}

.native-visible-player {
    width: 100%;
    max-width: 450px; 
}
.fp-playback-controls .play-pause-btn:active {
    transform: scale(0.95); 
    background-color: rgba(128, 128, 128, 0.2);
}
.truncate-text {
    display: block; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px; 
}

@media (max-width: 1200px) {
    .truncate-text {
        max-width: 180px;
    }
}
@media (max-width: 900px) {
    .truncate-text {
        max-width: 120px;
    }
}
.results-table td:last-child,
.results-table th:last-child {
    text-align: center;
}

.fp-controls .action-button#fp-local-details-btn.toggled-on {
    color: var(--dolby-yellow);
}
.header {
    justify-content: space-between;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-controls .icon-button svg {
    fill: var(--secondary-text-color);
    width: 22px;
    height: 22px;
}
.header-controls .icon-button:hover svg {
    fill: var(--primary-text-color);
}


/* --- 新增：头部布局调整 --- */
.header {
    justify-content: space-between;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-controls .icon-button svg {
    fill: var(--secondary-text-color);
    width: 22px;
    height: 22px;
}
.header-controls .icon-button:hover svg {
    fill: var(--primary-text-color);
}

.announcement-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4); 
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(5px);
}

.announcement-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.announcement-popup {
    background-color: var(--main-white); 
    color: #333; 
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); 
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-overlay.visible .announcement-popup {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eeeeee; 
    flex-shrink: 0;
}

.popup-header h2 {
    font-size: 18px;
    margin: 0;
    color: #1d1d1f; 
}

.popup-header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.popup-header .close-btn svg {
    width: 20px;
    height: 20px;
    fill: #888888; 
    transition: fill 0.2s;
}

.popup-header .close-btn:hover svg {
    fill: #333333; 
}

.popup-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.announcement-item {
    margin-bottom: 20px;
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--highlight-color); 
}

.announcement-item p {
    font-size: 14px;
    line-height: 1.6;
    color: #555555; 
}

.popup-footer {
    padding: 15px 20px;
    border-top: 1px solid #eeeeee; 
    text-align: center;
    flex-shrink: 0;
}

.popup-footer p {
    font-size: 12px;
    color: #999999; 
    margin: 0;
}
.playlist-panel .playlist-header h3 {
    color: #1d1d1f; 
}
.playlist-panel .close-btn svg {
    fill: #888888; 
}
.playlist-panel .playlist-item .title {
    color: #333333; 
}
.playlist-panel .playlist-item .artist {
    color: #777777; 
}
.playlist-panel .delete-btn svg {
    fill: #999999; 
}
.playlist-panel .delete-btn:hover svg {
    fill: #333333; 
}
.fp-controls .custom-select .custom-options {
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.fp-controls .custom-select .custom-option {
    color: #333; 
}

.fp-controls .custom-select .custom-option:hover,
.fp-controls .custom-select .custom-option.selected {
    background-color: rgba(0, 0, 0, 0.05); 
}
.fp-controls .custom-select .custom-option.selected {
    color: var(--highlight-color); 
}
.fp-controls .custom-select.dark-theme .custom-options {
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.fp-controls .custom-select.dark-theme .custom-option {
    color: #e0e0e0; 
}
.fp-controls .custom-select.dark-theme .custom-option:hover,
.fp-controls .custom-select.dark-theme .custom-option.selected {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--highlight-color); 
}
#fp-download-btn {
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent; 
}

#fp-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--progress-width, 0%); 
    height: 100%;
    background-color: #007aff; 
    z-index: -1;
    transition: width 0.1s linear; 
}

#fp-download-btn.downloading {
    color: #ffffff; 
    pointer-events: none; 
}
#fp-save-local-btn, #batch-save-favorites-btn {
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

#fp-save-local-btn::before, #batch-save-favorites-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--progress-width, 0%);
    height: 100%;
    background-color: var(--highlight-color); 
    z-index: -1;
    transition: width 0.1s linear;
}

#fp-save-local-btn.downloading, #batch-save-favorites-btn.downloading {
    color: #ffffff; 
    pointer-events: none; 
}
#api-console-overlay {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 600px;
    max-width: 90vw;
    height: 400px;
    max-height: 50vh;
    z-index: 3500;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#api-console-overlay.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#api-console-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
}
