:root {
    --font-main: 'Noto Sans SC', 'Segoe UI', Arial, sans-serif;
    --bg-gradient: linear-gradient(140deg, #e8f8f0 0%, #d1f2e6 35%, #b3e8db 100%);
    --bg-gradient-next: var(--bg-gradient);
    --container-bg: rgba(255, 255, 255, 0.55);
    --container-shadow: rgba(0, 0, 0, 0.06);
    --backdrop-blur: 16px;
    --text-color: #2c3e50;
    --text-secondary-color: #8a9ba0;
    --primary-color: #16a085;
    --primary-color-dark: #0e7562;
    --warning-color: #e74c3c;
    --success-color: #27ae60;
    --success-color-hover: #219653;
    --item-hover-bg: rgba(22, 160, 133, 0.08);
    --item-current-bg: rgba(22, 160, 133, 0.15);
    --item-current-text: var(--text-color);
    --border-color: rgba(0, 0, 0, 0.08);
    --lyrics-highlight-bg: rgba(22, 160, 133, 0.1);
    --lyrics-highlight-text: #138d75;
    --lyrics-highlight-shadow: rgba(22, 160, 133, 0.12);
    --component-bg: rgba(255, 255, 255, 0.45);
    --scrollbar-thumb-bg: rgba(0, 0, 0, 0.15);
    --scrollbar-track-bg: transparent;
}
.dark-mode {
    --bg-gradient: linear-gradient(135deg, #0a1a18 0%, #0d2a27 45%, #103530 100%);
    --container-bg: rgba(28, 28, 28, 0.55);
    --container-shadow: rgba(0, 0, 0, 0.2);
    --text-color: #ecf0f1;
    --text-secondary-color: #8e9a9b;
    --primary-color: #1abc9c;
    --primary-color-dark: #17a589;
    --item-hover-bg: rgba(26, 188, 156, 0.08);
    --item-current-bg: rgba(26, 188, 156, 0.15);
    --border-color: rgba(255, 255, 255, 0.1);
    --lyrics-highlight-bg: rgba(26, 188, 156, 0.1);
    --lyrics-highlight-text: #34d1b6;
    --component-bg: rgba(40, 40, 40, 0.45);
    --scrollbar-thumb-bg: rgba(255, 255, 255, 0.15);
    --success-color-hover: #1f8a4f;
}
.dark-mode .source-menu {
    background: rgba(32, 32, 32, 0.95);
    border-color: var(--primary-color);
}
.dark-mode .source-option {
    color: #ecf0f1;
}
.dark-mode .source-option:hover,
.dark-mode .source-option.active {
    color: #ffffff;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb-bg); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }
body {
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--text-color);
    transition: color 0.5s;
    background-color: #0f0f0f;
}
.background-stage {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}
.background-stage__layer {
    position: absolute;
    inset: 0;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    filter: saturate(105%);
}
.background-stage__layer--base {
    background-image: var(--bg-gradient);
}
.background-stage__layer--transition {
    background-image: var(--bg-gradient-next);
    opacity: 0;
    transition: opacity 0.85s ease;
}
body.background-transitioning .background-stage__layer--transition {
    opacity: 1;
}
.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    background: var(--container-bg);
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 24px 80px var(--container-shadow);
    border: 1px solid var(--border-color);
    aspect-ratio: 16/9;
    height: 80vh;
    max-height: 720px;
    display: grid;
    grid-template-areas:
        "header header header"
        "search search search"
        "cover playlist lyrics"
        "controls controls controls";
    grid-template-rows: auto auto 1fr 88px;
    grid-template-columns: 320px 1fr 1fr;
    gap: 20px;
    transition: background 0.5s, box-shadow 0.5s;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
}
.container.search-mode {
    grid-template-areas: 
        "header header header"
        "search search search"
        "search search search"
        "controls controls controls";
}
.header { 
    grid-area: header;
    text-align: center; 
    position: relative; 
}
.header h1 { 
    margin: 0; 
    font-size: 2em; 
    font-weight: 700; 
    color: var(--primary-color); 
    letter-spacing: 0.5px;
    user-select: none;
    cursor: default;
}
.header .warning { 
    color: var(--text-secondary-color); 
    font-size: 0.88em; 
    margin-top: 8px; 
    font-style: italic; 
}
#openSettingsBtn i {
    font-size: 18px;
}
#openSettingsBtn:hover i {
    animation: gear-spin 0.6s linear;
}
@keyframes gear-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}
.search-area {
    grid-area: search;
    background: var(--component-bg);
    border-radius: 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.search-area *,
.search-area *::before,
.search-area *::after {
    box-sizing: border-box;
}
.container.search-mode .search-area {
    background: var(--component-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1.5px solid var(--primary-color);
}
.search-header {
    display: none;
}
.search-controls-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
    position: relative;
}
.search-bar-unified {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--component-bg);
    transition: all 0.3s ease;
}
.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.1);
}
.search-icon {
    color: var(--text-secondary-color);
    margin-right: 10px;
    font-size: 14px;
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    padding: 0;
}
.source-select-wrapper {
    position: relative;
    flex-shrink: 0;
}
.source-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--component-bg);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 140px;
    position: relative;
    box-shadow: none;
}
.source-select-btn:hover,
.source-select-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(22, 160, 133, 0.15);
    background: var(--component-bg);
}
.source-select-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.15);
}
.source-select-btn .caret-icon {
    font-size: 0.8em;
    transition: transform 0.25s ease;
}
.source-select-btn.active .caret-icon {
    transform: rotate(-180deg);
}
.source-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    bottom: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    min-width: 100%;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100000;
    pointer-events: none;
}
.source-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.source-menu.open-upwards {
    top: auto;
    bottom: calc(100% + 8px);
    transform-origin: bottom center;
}
.source-menu.open-downwards {
    top: calc(100% + 8px);
    bottom: auto;
    transform-origin: top center;
}
.source-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: 0.92em;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}
.source-option:hover,
.source-option.active {
    background: var(--primary-color);
    color: #ffffff;
}
.source-option i {
    font-size: 0.85em;
    opacity: 0.6;
}
.source-option.active i {
    opacity: 1;
}
.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 160, 133, 0.2);
}
.search-btn:disabled {
    background: var(--text-secondary-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.search-results {
    max-height: 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
    margin-left: -18px;
    margin-right: -18px;
    margin-bottom: -18px;
    padding-top: 0;
    padding-left: 18px;
    padding-right: 18px;
    position: relative;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 0 0 18px 18px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.search-results-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
    position: relative;
    z-index: 2;
    background: none;
}
.import-dropdown {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    z-index: 20000;
}
.import-selected-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    writing-mode: horizontal-tb;
    white-space: nowrap;
}
.import-dropdown-caret {
    font-size: 12px;
}
.import-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    min-width: 160px;
    z-index: 20000;
    pointer-events: auto;
}
.dark-mode .import-dropdown-menu {
    background: rgba(28, 28, 28, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
.import-dropdown-menu[hidden] {
    display: none;
}
.import-dropdown-item {
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.import-dropdown-item:hover {
    background: var(--item-hover-bg);
}
.search-results-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
}
.container.search-mode .search-results {
    max-height: none;
    height: 100%;
    padding-top: 12px;
    padding-bottom: 18px;
    opacity: 1;
    overflow-y: hidden;
    overflow-x: hidden;
}
.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 0.4s ease forwards;
    gap: 12px;
}
.search-result-item:nth-child(1) { animation-delay: 0.08s; }
.search-result-item:nth-child(2) { animation-delay: 0.12s; }
.search-result-item:nth-child(3) { animation-delay: 0.16s; }
.search-result-item:nth-child(4) { animation-delay: 0.2s; }
.search-result-item:nth-child(5) { animation-delay: 0.24s; }
@keyframes slideInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.search-result-item:hover:not(.selected) {
    background: var(--item-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.search-result-item.selected {
    background: var(--item-current-bg);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(22, 160, 133, 0.18);
    transform: translateY(0);
}
.search-result-item.selected .search-result-title {
    color: var(--primary-color);
}
.search-result-item.selected .search-result-select {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.25);
}
.search-result-item.selected .search-result-select i {
    opacity: 1;
    transform: scale(1);
}
.search-result-select {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.6);
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.search-result-select i {
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
    pointer-events: none;
}
.search-result-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.25);
}
.search-result-item .search-result-select:hover {
    border-color: var(--primary-color);
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-title {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    margin-bottom: 3px;
}
.search-result-artist {
    font-size: 12px;
    color: var(--text-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-actions {
    display: flex;
    gap: 4px;
    margin-left: 10px;
    flex-shrink: 0;
}
.search-result-actions .action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    justify-content: center;
    font-size: 13px;
    gap: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: auto;
    font-weight: normal;
    box-shadow: none;
    transition: color 0.18s ease, transform 0.18s ease;
}
.search-result-actions .action-btn i {
    margin: 0;
}
.search-result-actions .action-btn:hover {
    background: transparent;
    transform: scale(1.08);
    box-shadow: none;
}
.search-result-actions .action-btn.favorite:hover {
    color: #ff4d67;
    transform: scale(1.08);
}
.search-result-actions .action-btn.favorite.is-active {
    color: #ff4d67;
}
.search-result-actions .action-btn.favorite.is-active:hover {
    color: #ff4d67;
    transform: scale(1.08);
}
.search-result-actions .action-btn.play:hover {
    color: var(--primary-color);
    transform: scale(1.08);
}
.search-result-actions .action-btn.download {
    position: relative;
    background: transparent;
    padding: 0;
    font-size: 13px;
}
.search-result-actions .action-btn.download:hover {
    color: #2ecc71;
    background: transparent;
    transform: scale(1.08);
    box-shadow: none;
}
.import-selected-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 8px 20px rgba(22, 160, 133, 0.2);
}
.import-selected-btn:disabled {
    cursor: not-allowed;
    background: rgba(127, 140, 141, 0.4);
    box-shadow: none;
    filter: none;
}
.import-selected-btn:not(:disabled):hover,
.import-selected-btn:not(:disabled):focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(22, 160, 133, 0.25);
    filter: brightness(1.05);
}
.import-selected-btn:focus-visible {
    outline: none;
}
.import-selected-count {
    font-weight: 500;
}
.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 10000;
    font-weight: 500;
}
.action-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.2);
}
.action-btn.download {
    background: var(--success-color);
    padding: 4px 8px;
    font-size: 10px;
}
.action-btn.download:hover {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}
.main-content {
    display: contents;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.container.search-mode .main-content {
    display: none;
}
.cover-area {
    grid-area: cover;
    background: var(--component-bg);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    box-sizing: border-box;
    height: 100%;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.album-cover {
    width: 180px;
    height: 180px;
    flex-grow: 0;
    flex-shrink: 0;
    border-radius: 16px;
    background: linear-gradient(45deg, var(--primary-color), var(--success-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    overflow: hidden;
}
.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}
.album-cover.loading {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.album-cover .placeholder {
    font-size: 48px;
    color: white;
    opacity: 0.8;
}
.current-song-info {
    width: 100%;
}
.current-song-title-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 4px;
}
.current-song-title-row .current-song-title {
    flex: 0 1 auto;
    max-width: calc(100% - 40px);
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.current-song-title-row .current-favorite-btn {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
}
.current-song-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.current-song-artist {
    font-size: 13px;
    color: var(--text-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist, .lyrics {
    background: var(--component-bg);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border-color);
    height: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.playlist {
    grid-area: playlist;
    background: var(--component-bg);
    border-radius: 18px;
    padding: 64px 18px 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    box-sizing: border-box;
}
html.desktop-view .playlist {
    padding-top: 64px;
}
.playlist[hidden],
.playlist.favorites[hidden] {
    display: none !important;
}
.playlist-header {
    position: absolute;
    top: 14px;
    left: 18px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
    z-index: 5;
}
.playlist-header > * {
    pointer-events: auto;
}
.playlist-header .playlist-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.playlist-actions-tray {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
body.dark-mode .playlist-actions-tray {
    background: transparent;
    border: none;
    box-shadow: none;
}
.playlist-action-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary-color);
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
body.dark-mode .playlist-action-btn {
    background: rgba(24, 30, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: var(--text-secondary-color);
}
.playlist-action-btn i {
    pointer-events: none;
}
.playlist-action-btn:hover:not(:disabled),
.playlist-action-btn:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(22, 160, 133, 0.18);
    filter: brightness(1.05);
    border-color: rgba(22, 160, 133, 0.3);
    color: var(--primary-color);
}
.playlist-action-btn:focus-visible {
    outline: none;
}
.playlist-action-btn--export:hover:not(:disabled),
.playlist-action-btn--export:focus-visible:not(:disabled) {
    color: var(--primary-color-dark);
}
.playlist-action-btn--clear {
    color: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.2);
}
.playlist-action-btn--clear:hover:not(:disabled),
.playlist-action-btn--clear:focus-visible:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.2);
    color: var(--warning-color);
}
.playlist-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}
.playlist-action-btn:disabled:hover {
    background: transparent;
}
.playlist-import-input {
    display: none;
}
html.mobile-view .playlist-header {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
    pointer-events: auto;
}
html.mobile-view #playlist.playlist .playlist-header {
    display: none;
}
html.mobile-view #favorites.playlist .playlist-header {
    display: none;
}
html.mobile-view .playlist-header .playlist-tabs {
    display: none;
}
html.mobile-view .playlist-header .playlist-actions-tray {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
html.mobile-view .playlist-header .playlist-action-btn {
    width: 36px;
    height: 36px;
}
.playlist:not(.empty) {
    align-items: stretch;
    justify-content: flex-start;
}
.playlist.empty .playlist-scroll::before {
    content: "点击\"探索雷达\"加载在线音乐";
    color: var(--text-secondary-color);
    font-style: italic;
    opacity: 0.7;
    font-size: 0.9em;
}
html[lang="en"] .playlist.empty .playlist-scroll::before {
    content: 'Click "Explore Radar" to load online music';
}
.playlist.favorites.empty::before {
    content: "";
}
.playlist-scroll {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding-right: 6px;
    margin-right: -6px;
    overscroll-behavior: contain;
}
.playlist.empty .playlist-scroll {
    display: none;
}
.playlist-tabs {
    display: flex;
    gap: 8px;
}
.playlist-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex: 0 0 auto;
    min-width: 0;
}
.playlist-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.playlist-tab:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.playlist-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.mobile-panel-header .playlist-tabs {
    display: flex;
    gap: 4px;
    justify-self: flex-start;
    flex: 0 0 auto;
}
.mobile-panel-header .playlist-tab {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.mobile-panel-header .playlist-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.mobile-panel-header .playlist-tab:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.playlist.favorites {
    margin-top: 0;
    padding-top: 64px;
}
.playlist:not(.active) .playlist-header {
    display: none;
}
.favorites[hidden] {
    display: none !important;
}
.playlist-items {
    width: 100%;
}
.playlist-items .playlist-item {
    padding: 9px 12px;
    padding-right: 100px;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    font-size: 13px;
    margin-bottom: 2px;
}
.playlist-items .playlist-item:hover {
    background-color: var(--item-hover-bg);
    color: var(--item-current-text);
    transform: translateX(3px);
}
.playlist-items .playlist-item.current {
    color: var(--item-current-text);
    font-weight: 500;
    background-color: var(--item-current-bg);
}
body.dark-mode .playlist-items .playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
body.dark-mode .playlist-items .playlist-item.current {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.playlist-item-favorite,
.playlist-item-download,
.playlist-item-remove {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    background: transparent;
    color: var(--text-secondary-color);
    transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    z-index: 5;
}
.playlist-items .playlist-item:hover .playlist-item-favorite,
.playlist-items .playlist-item:hover .playlist-item-download,
.playlist-items .playlist-item:hover .playlist-item-remove,
.playlist-items .playlist-item:focus-within .playlist-item-favorite,
.playlist-items .playlist-item:focus-within .playlist-item-download,
.playlist-items .playlist-item:focus-within .playlist-item-remove {
    opacity: 1;
}
.playlist-item-favorite {
    right: 68px;
    box-shadow: none;
}
.playlist-item-favorite .fas,
.playlist-item-favorite .far {
    margin: 0;
    transition: color 0.18s ease;
}
.playlist-item-favorite.is-active {
    color: #ff4d67;
}
.playlist-item-favorite.is-active .fas,
.playlist-item-favorite.is-active .far {
    color: #ff4d67;
}
.playlist-item-download {
    right: 38px;
    box-shadow: none;
}
.playlist-item-remove {
    right: 10px;
    box-shadow: none;
}
.playlist-item-favorite:hover {
    color: #ff4d67;
    transform: translateY(-50%) scale(1.08);
}
.playlist-item-download:hover {
    color: #2ecc71;
    transform: translateY(-50%) scale(1.08);
}
.playlist-item-remove:hover {
    color: #e74c3c;
    transform: translateY(-50%) scale(1.08);
}
.favorite-toggle {
    border: none;
    background: none;
    color: var(--text-secondary-color);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.favorite-toggle:hover {
    color: var(--primary-color);
}
.favorite-toggle.is-active {
    color: #ff4d67;
}
.current-favorite-btn {
    font-size: 16px;
}
.favorites .playlist-items .playlist-item {
    padding-right: 140px;
}
.favorite-item-action {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    opacity: 0;
    font-size: 12px;
    background: transparent;
    color: var(--text-secondary-color);
    transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.favorite-item-action--add {
    right: 68px;
}
.favorite-item-action--download {
    right: 38px;
}
.favorite-item-action--remove {
    right: 10px;
}
.favorites .playlist-item:hover .favorite-item-action,
.favorites .playlist-items .playlist-item:focus-within .favorite-item-action {
    opacity: 1;
}
.favorite-item-action--add:hover {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.08);
}
.favorite-item-action--download:hover {
    color: #2ecc71;
    transform: translateY(-50%) scale(1.08);
}
.favorite-item-action--remove:hover {
    color: #e74c3c;
    transform: translateY(-50%) scale(1.08);
}
html.mobile-view .mobile-panel-header .playlist-tabs {
    gap: 6px;
    justify-self: flex-start;
    flex: 0 0 auto;
}
html.mobile-view .mobile-panel-header .playlist-tab {
    flex: 0 0 auto;
    min-width: 0;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
}
html.mobile-view .playlist-items .playlist-item {
    padding-right: 108px;
}
html.mobile-view .playlist-item-favorite,
html.mobile-view .playlist-item-download,
html.mobile-view .playlist-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    opacity: 1;
}
html.mobile-view .playlist-item-favorite {
    right: 88px;
}
html.mobile-view .playlist-item-download {
    right: 48px;
}
html.mobile-view .playlist-item-remove {
    right: 12px;
}
html.mobile-view .playlist-item-favorite:hover,
html.mobile-view .playlist-items .playlist-item:focus-within .playlist-item-favorite,
html.mobile-view .playlist-item-download:hover,
html.mobile-view .playlist-items .playlist-item:focus-within .playlist-item-download,
html.mobile-view .playlist-item-remove:hover,
html.mobile-view .playlist-items .playlist-item:focus-within .playlist-item-remove {
    transform: translateY(-50%);
    box-shadow: none;
    filter: none;
}
html.mobile-view .favorites .favorite-item-action {
    opacity: 1;
}
html.mobile-view .favorites .favorite-item-action:hover,
html.mobile-view .favorites .playlist-items .playlist-item:focus-within .favorite-item-action {
    transform: translateY(-50%);
    box-shadow: none;
    filter: none;
}
html.mobile-view .favorites .playlist-items .playlist-item {
    padding-right: 108px;
}
html.mobile-view .favorites .favorite-item-action {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}
html.mobile-view .favorites .favorite-item-action--add {
    right: 88px;
}
html.mobile-view .favorites .favorite-item-action--download {
    right: 48px;
}
html.mobile-view .favorites .favorite-item-action--remove {
    right: 12px;
}
.dynamic-quality-menu {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    min-width: 180px;
    overflow: hidden;
    z-index: 100000;
}
.dark-mode .dynamic-quality-menu {
    background: #1c1c1c;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
.lyrics {
    grid-area: lyrics;
    text-align: center;
    font-size: 0.95em;
    line-height: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}
.lyrics-scroll {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 6px;
    margin-right: -6px;
    overscroll-behavior: contain;
}
.lyrics:not(.empty) .lyrics-scroll {
    align-items: flex-start;
    justify-content: flex-start;
}
.lyrics-content {
    width: 100%;
}
.lyrics-content > div {
    white-space: pre-wrap;
    padding: 4px;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.lyrics.empty[data-placeholder="default"] .lyrics-content {
    display: none;
}
.lyrics.empty[data-placeholder="default"] .lyrics-scroll::before {
    content: "歌词将在此处同步显示";
    color: var(--text-secondary-color);
    font-style: italic;
    opacity: 0.7;
    font-size: 0.9em;
}
html[lang="en"] .lyrics.empty[data-placeholder="default"] .lyrics-scroll::before {
    content: "Lyrics will be displayed here";
}
.lyrics.empty[data-placeholder="message"] .lyrics-scroll::before {
    content: none;
}
.lyrics .current { 
    color: var(--lyrics-highlight-text); 
    font-weight: 700; 
    background-color: var(--lyrics-highlight-bg); 
    transform: scale(1.03); 
    box-shadow: 0 4px 12px var(--lyrics-highlight-shadow); 
    border-radius: 8px;
}
.controls {
    grid-area: controls;
    display: grid;
    grid-template-columns: 320px 1fr auto;
    grid-template-areas: "transport progress trailing";
    align-items: center;
    column-gap: 20px;
    row-gap: 12px;
    width: 100%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 8px;
}
.controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em; 
    width: 46px; 
    height: 46px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    transition: all 0.2s ease; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
}
.controls button:hover { 
    background: var(--primary-color-dark); 
    transform: translateY(-1px); 
    box-shadow: 0 6px 16px rgba(0,0,0,0.1); 
}
.controls button:active { 
    transform: translateY(0); 
    box-shadow: 0 2px 6px rgba(0,0,0,0.08); 
}
.controls button#loadOnlineBtn {
    width: auto;
    border-radius: 999px;
    padding: 0 20px;
    gap: 8px;
    height: 42px;
}
.controls button#loadOnlineBtn .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}
.controls button#loadOnlineBtn .btn-text i {
    line-height: 1;
}
.controls button#loadOnlineBtn .loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.controls button:disabled { 
    background: var(--text-secondary-color); 
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none; 
}
.transport-controls {
    grid-area: transport;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: flex-start;
}
html:not(.mobile-view) .transport-controls {
    justify-self: stretch;
    width: 100%;
    justify-content: space-between;
    gap: 0;
}
html:not(.mobile-view) #playModeBtn {
    margin-right: 0;
}
#mobileQueueToggle {
    display: none;
}
#shuffleToggleBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.transport-button--shuffle .shuffle-icon {
    display: inline-flex;
    transition: opacity 0.24s ease, filter 0.24s ease, text-shadow 0.24s ease;
    filter: none;
    text-shadow: none;
}
.transport-button--shuffle .shuffle-icon--off {
    opacity: 0.9;
}
.transport-button--shuffle .shuffle-icon--on {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
    text-shadow: 0 0 1px currentColor;
}
#playPauseBtn {
    width: 56px;
    height: 56px;
    font-size: 1.3em;
}
#playPauseBtn .fa-play {
    margin-left: 3px;
}
.transport-button--prev .fa-backward-step {
    margin-right: 2px;
}
.transport-button--next .fa-forward-step {
    margin-left: 2px;
}
.progress-container {
    grid-area: progress;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    width: 100%;
    justify-self: stretch;
}
.control-trailing {
    grid-area: trailing;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
}
.progress-container span {
    font-variant-numeric: tabular-nums;
    font-size: 0.82em;
    color: var(--text-secondary-color);
}
.progress-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--progress, 0%), rgba(255, 255, 255, 0.4) var(--progress, 0%), rgba(255, 255, 255, 0.15) 100%);
    cursor: pointer;
    transition: background 0.2s ease;
}
.audio-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex: 1 1 auto;
}
.control-trailing #loadOnlineBtn {
    margin-left: auto;
}
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.volume-container input[type="range"] {
    width: 100px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--volume-progress, 100%), rgba(255, 255, 255, 0.15) var(--volume-progress, 100%), rgba(255, 255, 255, 0.08) 100%);
    cursor: pointer;
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}
input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}
input[type="range"]:active::-webkit-slider-thumb,
input[type="range"]:active::-moz-range-thumb {
    transform: scale(1.1);
}
.player-quality {
    position: relative;
}
.controls .player-quality-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--component-bg);
    color: var(--text-color);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
    box-shadow: none;
}
.controls .player-quality-btn:hover,
.controls .player-quality-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(22, 160, 133, 0.15);
    background: var(--component-bg);
}
.player-quality-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border: 1px solid var(--border-color);
    min-width: 160px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100000;
    pointer-events: none;
}
.dark-mode .player-quality-menu {
    background: #1c1c1c;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
.player-quality-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.player-quality-menu.floating {
    position: fixed;
    right: auto;
    left: 0;
    top: 0;
    will-change: opacity, transform;
}
.player-quality-menu.floating:not(.show) {
    opacity: 0;
    visibility: hidden;
}
.player-quality-menu.open-upwards {
    transform-origin: bottom center;
}
.player-quality-menu.open-downwards {
    transform-origin: top center;
}
.player-quality-option,
.quality-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.88em;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}
.player-quality-option:hover,
.player-quality-option.active,
.quality-option:hover,
.quality-option.active {
    background: var(--primary-color);
    color: white;
}
.player-quality-option small,
.quality-option small {
    opacity: 0.7;
}
#audioPlayer {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
.play-mode-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}
.play-mode-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    width: 46px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.play-mode-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}
.play-mode-btn.active {
    background: var(--primary-color);
    color: white;
}
.quality-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    z-index: 100000;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    pointer-events: none;
    overflow: hidden;
}
.dark-mode .quality-menu {
    background: #1c1c1c;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
.search-result-item {
    position: relative;
    z-index: 1;
}
.search-result-item:has(.quality-menu.show) {
    z-index: 1000000;
}
.search-result-item.menu-active {
    z-index: 1000000;
}
.quality-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.load-more-btn {
    width: 100%;
    background: var(--component-bg);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.load-more-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 160, 133, 0.2);
}
.load-more-btn:disabled {
    background: var(--text-secondary-color);
    border-color: var(--text-secondary-color);
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.debug-info {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 10000;
    max-width: 300px;
    max-height: 40vh;
    overflow-y: auto;
    display: none;
}
.debug-info.show {
    display: block;
}
.loader { 
    width: 18px; 
    height: 18px; 
    border: 2.5px solid var(--primary-color); 
    border-bottom-color: transparent; 
    border-radius: 50%; 
    display: inline-block; 
    box-sizing: border-box; 
    animation: rotation 1s linear infinite; 
}
@keyframes rotation { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
.theme-switch-wrapper {
    position: absolute;
    top: 0px;
    right: 0px;
    display: flex;
    justify-content: flex-end;
}
.header-left-controls {
    position: absolute;
    top: 0px;
    left: 0px;
    display: flex;
    justify-content: flex-start;
}
.theme-toggle-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.35));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--primary-color);
}
.theme-toggle-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 160, 133, 0.2);
}
.theme-toggle-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.theme-toggle-button.is-dark {
    background: linear-gradient(160deg, rgba(36, 42, 54, 0.85), rgba(24, 30, 42, 0.65));
    border-color: rgba(26, 188, 156, 0.35);
}
.theme-toggle-button .theme-icon {
    position: absolute;
    font-size: 16px;
    transition: opacity 0.35s ease, transform 0.45s ease;
    opacity: 0;
    transform: scale(0.6) rotate(-20deg);
}
.theme-toggle-button .theme-icon--sun {
    color: #f5a623;
    text-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}
.theme-toggle-button .theme-icon--moon {
    color: #a29bfe;
    text-shadow: 0 0 8px rgba(162, 155, 254, 0.3);
    transform: scale(0.6) rotate(20deg);
}
.theme-toggle-button:not(.is-dark) .theme-icon--sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.theme-toggle-button.is-dark .theme-icon--moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-size: 14px;
}
.notification.show {
    transform: translateX(0);
}
.notification.error {
    background: var(--warning-color);
}
.notification.warning {
    background: #f39c12;
}
.view-toggle {
    display: none;
}
.mobile-panel {
    display: contents;
}
.mobile-turntable {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}
.mobile-turntable__platter {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--component-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    padding: 32px;
    box-sizing: border-box;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-content.settings-content {
    background: transparent;
    border: none;
    border-radius: 0;
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    transform: none;
}
.modal-header {
    padding: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    user-select: none;
}
.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-modal-btn:hover {
    background: var(--item-hover-bg);
    color: var(--warning-color);
}
.modal-body {
    padding: 20px 0;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
    margin-right: -8px;
}
.settings-section h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--text-color);
}
.settings-hint {
    font-size: 0.85rem;
    color: var(--text-secondary-color);
    margin-bottom: 16px;
}
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.genre-item {
    position: relative;
}
.genre-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.genre-label {
    display: block;
    padding: 10px 12px;
    background: var(--component-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.genre-item input[type="checkbox"]:checked + .genre-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 6px 16px rgba(22, 160, 133, 0.2);
    transform: translateY(-1px);
}
.genre-label:hover {
    border-color: var(--primary-color);
    background: var(--item-hover-bg);
}
.modal-footer {
    padding: 16px 0 0 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}
.save-settings-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(22, 160, 133, 0.2);
}
.save-settings-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(22, 160, 133, 0.25);
}
.save-settings-btn:active {
    transform: translateY(0);
}
@media (max-width: 820px) {
    .modal-content.settings-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-header {
        padding: 0 0 16px 0;
    }
    .modal-body {
        padding: 20px 0;
    }
    .modal-footer {
        padding: 16px 0 0 0;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}