* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1db954;
    --primary-dark: #1aa34a;
    --bg-dark: #121212;
    --bg-secondary: #181818;
    --bg-hover: #282828;
    --bg-highlight: #333333;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #727272;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --accent-gradient: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    --card-bg: linear-gradient(145deg, #1e1e1e 0%, #141414 100%);
    --transition-speed: 0.3s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Styles */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    flex-shrink: 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 24px;
    transition: all var(--transition-speed);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    background: var(--bg-highlight);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.page {
    display: none;
    width: 100%;
    height: 100%;
    padding: 24px;
    overflow-y: auto;
}

.page.active {
    display: block;
}

/* Search Page */
.search-container {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 16px 24px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all var(--transition-speed);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(29, 185, 84, 0.1);
}

#search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    padding: 16px 28px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.search-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
}

.platform-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.filter-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border-radius: 20px;
    transition: all var(--transition-speed);
}

.filter-option:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.filter-option input:checked + span {
    color: var(--primary-color);
}

.quality-select {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-select label {
    color: var(--text-secondary);
    font-size: 14px;
}

#quality-select {
    padding: 10px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

/* Results Container */
.results-container {
    max-width: 900px;
    margin: 0 auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

#results-count {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Songs List */
.songs-list {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.song-item:last-child {
    border-bottom: none;
}

.song-item:hover {
    background: var(--bg-hover);
}

.song-item.playing {
    background: linear-gradient(90deg, rgba(29, 185, 84, 0.15) 0%, transparent 100%);
}

.song-item .song-index {
    width: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.song-item .song-index i {
    color: var(--primary-color);
}

.song-item .song-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
}

.song-item .song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-item .song-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.song-item:hover .song-cover-overlay {
    opacity: 1;
}

.song-item .song-cover-overlay i {
    color: white;
    font-size: 20px;
}

.song-item .song-info {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
}

.song-item .song-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.song-item .song-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item .song-album {
    width: 150px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item .song-duration {
    width: 60px;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
}

.song-item .song-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.song-item:hover .song-actions {
    opacity: 1;
}

.song-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-highlight);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.song-action-btn:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    transform: scale(1.1);
}

.song-action-btn.favorited {
    color: #e74c3c;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* Favorites & Playlist Pages */
.favorites-container,
.playlist-container {
    max-width: 900px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-highlight);
    border: none;
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.action-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
}

.action-btn.primary {
    background: var(--accent-gradient);
}

.action-btn.primary:hover {
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
}

/* Player Bar */
.player-bar {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.player-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    height: 90px;
    gap: 24px;
    padding: 0 24px;
    width: 100%;
}

/* Song Info in Player */
.song-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.album-art {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.album-art:hover .album-art-overlay {
    opacity: 1;
}

.song-details h3 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.song-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

.favorite-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.favorite-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #e74c3c;
}

/* Player Controls */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-speed);
}

.control-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.control-btn.play-btn {
    width: 48px;
    height: 48px;
    background: var(--text-primary);
    color: var(--bg-dark);
    font-size: 18px;
}

.control-btn.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-highlight);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.volume-slider-container {
    width: 100px;
}

.volume-slider {
    width: 100%;
    height: 4px;
    background: var(--bg-highlight);
    border-radius: 2px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Lyric Panel */
.lyric-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 20px var(--shadow-color);
    z-index: 2000;
    flex-direction: column;
}

.lyric-panel.active {
    display: flex;
}

@media (max-width: 768px) {
    .lyric-panel {
        width: 100%;
        max-width: none;
    }
}

.lyric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.lyric-header h3 {
    font-size: 18px;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-highlight);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.lyric-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    text-align: center;
}

.lyric-content p {
    padding: 12px 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    transition: all var(--transition-speed);
}

.lyric-content p.active {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 500;
    transform: scale(1.05);
}

.lyric-content .no-lyric {
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--shadow-color);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-body {
    padding: 24px;
    text-align: center;
}

.detail-pic {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.detail-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info h4 {
    font-size: 20px;
    margin-bottom: 8px;
}

.detail-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .action-btn {
    flex: 1;
    justify-content: center;
}

.setting-group {
    margin-bottom: 20px;
    text-align: left;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.setting-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-speed);
}

.setting-group select:focus {
    border-color: var(--primary-color);
}

.about-content {
    text-align: left;
    line-height: 2;
}

.about-content p {
    margin-bottom: 12px;
    font-size: 15px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--primary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 16px;
}

.loading-spinner p {
    color: var(--text-secondary);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 14px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    box-shadow: 0 8px 32px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--primary-color);
}

.toast.error {
    border-left: 4px solid #e74c3c;
    color: #ff6b6b;
}

.toast.error i {
    color: #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast.warning {
    border-left: 4px solid #f39c12;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

.toast.error {
    border-left: 4px solid #e74c3c;
    background: linear-gradient(135deg, #3a1a1a 0%, #2a0a0a 100%);
}

.toast.toast-long {
    padding: 16px 28px;
    font-size: 15px;
    max-width: 450px;
    border-radius: 12px;
    color: #ff6b6b;
}

.toast.toast-long i {
    font-size: 20px;
    color: #e74c3c;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Platform Badge */
.platform-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.platform-badge.netease {
    background: #e74c3c;
    color: white;
}

.platform-badge.migu {
    background: #1e88e5;
    color: white;
}

.platform-badge.kuwo {
    background: #f39c12;
    color: white;
}

.platform-badge.qq {
    background: #2ecc71;
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .player-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .player-controls {
        order: -1;
        grid-column: 1 / -1;
    }
    
    .volume-control {
        justify-content: flex-end;
    }
    
    .song-item .song-album {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 8px;
    }
    
    .header-content {
        flex-direction: row;
        height: auto;
        padding: 8px 0;
        gap: 8px;
    }
    
    .logo {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .logo i {
        font-size: 18px;
    }
    
    .nav-tabs {
        flex: 1;
        justify-content: flex-end;
        gap: 4px;
    }
    
    .nav-tab {
        padding: 8px 12px;
    }
    
    .nav-tab i {
        font-size: 16px;
    }
    
    .nav-tab span {
        display: none;
    }
    
    .page {
        padding: 8px;
    }
    
    .search-container {
        padding: 12px;
    }
    
    .platform-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-content {
        grid-template-columns: 1fr;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }
    
    .song-info {
        order: 1;
    }
    
    .player-controls {
        order: 2;
    }
    
    .volume-control {
        order: 3;
        justify-content: center;
    }
    
    .progress-container {
        max-width: 100%;
    }
    
    .song-item .song-actions {
        opacity: 1;
    }
    
    .song-item .song-album {
        width: 100px;
    }
    
    .modal-content {
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        padding: 8px 10px;
    }
    
    .nav-tab i {
        font-size: 16px;
    }
    
    .song-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .song-item .song-index {
        width: 20px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .song-item .song-cover {
        width: 40px;
        height: 40px;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .song-item .song-info {
        flex: 1;
        min-width: 0;
        margin-right: 4px;
    }
    
    .song-item .song-name {
        font-size: 13px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .song-item .song-artist {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .song-item .song-duration,
    .song-item .song-album {
        display: none;
    }
    
    .song-item .song-actions {
        opacity: 1;
        display: flex;
        gap: 4px;
    }
    
    .song-item .song-action-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 8px;
    }
    
    .volume-slider-container {
        display: none;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-highlight);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.playing .album-art {
    animation: pulse 2s infinite;
}

/* Custom Scrollbar for Webkit */
.songs-list::-webkit-scrollbar {
    width: 6px;
}

.songs-list::-webkit-scrollbar-thumb {
    background: var(--bg-highlight);
    border-radius: 3px;
}
