* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root {
    --primary-color: #6b5bcc;
    --primary-light: #f0f0ff;
    --primary-dark: #5a4bc0;
    --accent-color: #ff3333;
    --success-color: #2ed573;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #f5f5f7;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
}

body {
    background: var(--bg-tertiary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 15px;
    padding-bottom: 110px;
    /* 为顶部导航留出空间 */
    padding-top: 80px;
}

.player-wrapper {
    background: var(--bg-primary);
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* 搜索区域优化 */
.search-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}
#musicSearchInput {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}
#musicSearchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}
#searchBtn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
#searchBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
#searchBtn:active {
    transform: translateY(0);
}

/* 表头区域优化 */
.table-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-secondary);
    gap: 20px;
}
.header-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.header-sort::after {
    content: '⇅';
    font-size: 12px;
    color: var(--text-tertiary);
    transition: var(--transition);
}
.header-sort:hover::after {
    color: var(--primary-color);
}

/* 榜单切换栏优化 */
.chart-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 4px;
}
.chart-tabs::-webkit-scrollbar {
    display: none;
}
.chart-tab {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
}
.chart-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(107, 91, 204, 0.2);
}
.chart-tab:hover:not(.active) {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 歌曲列表优化 */
.search-results {
    max-height: 80vh;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.search-results::-webkit-scrollbar {
    width: 8px;
}
.search-results::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}
.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.result-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.result-item:last-child {
    border-bottom: none;
}
.result-item:hover {
    background: var(--primary-light);
}
.result-item.playing {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.result-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.result-info {
    flex: 1;
    min-width: 0;
}
.result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-artist {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.result-artist::before {
    content: '🎤';
    font-size: 12px;
}
.result-pay {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    color: white;
    background: var(--success-color);
    width: fit-content;
    font-weight: 500;
}

/* 空状态样式 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-tertiary);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.empty-text {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}
.empty-desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* 底部播放器优化 */
.player-controls {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    flex-wrap: wrap;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-music-info {
    flex: 1;
    min-width: 120px;
    color: white;
    margin-right: 10px;
}
.bottom-music-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bottom-music-artist {
    font-size: 13px;
    color: #cccccc;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bottom-music-pay {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    margin-top: 4px;
    color: white;
    background: var(--success-color);
    font-weight: 500;
}

/* 控制按钮优化 */
.control-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}
.prev-btn, .next-btn, .loop-btn, .favorite-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.prev-btn:hover, .next-btn:hover, .loop-btn:hover, .favorite-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.loop-btn.active {
    background: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 51, 51, 0.3);
}
.favorite-btn.active {
    background: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 51, 51, 0.3);
}
.prev-btn svg, .next-btn svg, .loop-btn svg, .favorite-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}
.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.play-btn:hover {
    transform: scale(1.05);
}
.play-btn svg {
    width: 18px;
    height: 18px;
    fill: #333;
}

.time-info {
    font-size: 13px;
    color: white;
    min-width: 85px;
    text-align: right;
    font-weight: 500;
}

/* 进度条和歌词区域优化 */
.progress-lyrics-wrapper {
    flex: 2;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 10px;
}
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
}
.progress {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    position: relative;
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}
.progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--accent-color);
    transition: var(--transition);
}
.progress-bar:hover .progress::after {
    transform: translateY(-50%) scale(1.2);
}

/* 歌词容器优化 */
.lyrics-container {
    height: auto;
    min-height: 36px;
    overflow: hidden;
    position: relative;
    color: #cccccc;
    font-size: 15px;
    text-align: center;
    line-height: 1.5;
    padding: 6px 0;
    font-weight: 500;
}
.lyrics-line {
    position: relative;
    width: 100%;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    padding: 0 15px;
    white-space: normal;
    word-wrap: break-word;
}
.lyrics-line.active {
    opacity: 1;
    color: white;
    font-weight: 600;
    transform: translateY(0);
}

/* 音量控制优化 */
.volume-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}
.volume-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.volume-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.volume-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}
.volume-slider {
    width: 6px;
    height: 50px;
    -webkit-appearance: slider-vertical;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--accent-color);
    cursor: pointer;
    transition: var(--transition);
}
.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 循环提示样式 */
.loop-toast, .favorite-toast, .clear-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 101;
}
.loop-toast.show, .favorite-toast.show, .clear-toast.show {
    opacity: 1;
}

/* 右键菜单样式 */
.context-menu {
    position: absolute;
    width: 160px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    overflow: hidden;
}
.context-menu-item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.context-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}
.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* 移动端适配优化 */
@media (max-width: 768px) {
    /* 顶部导航移动端适配 */
    .top-nav {
        padding: 10px 15px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .nav-btn span {
        display: none;
    }
    
    body {
        padding-top: 70px;
        padding-bottom: 100px;
    }
    
    .table-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    .chart-tabs {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
        padding-right: 5px;
    }
    .chart-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .player-controls {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .volume-control-group {
        position: absolute;
        top: -60px;
        right: 15px;
        background: rgba(0, 0, 0, 0.85);
        padding: 10px;
        border-radius: var(--radius-md);
        display: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .volume-btn:hover + .volume-control-group,
    .volume-control-group:hover {
        display: flex;
    }
    
    .time-info {
        min-width: 75px;
        font-size: 12px;
    }
    
    .lyrics-container {
        font-size: 14px;
        min-height: 32px;
    }
    
    .control-buttons {
        gap: 8px;
        min-width: 160px;
    }
    
    .prev-btn, .next-btn, .loop-btn, .favorite-btn {
        width: 28px;
        height: 28px;
    }
    
    .play-btn {
        width: 36px;
        height: 36px;
    }
    
    .result-cover {
        width: 42px;
        height: 42px;
    }
    
    .result-title {
        font-size: 15px;
    }

    .empty-state {
        padding: 40px 15px;
    }
    .empty-icon {
        font-size: 40px;
    }

    /* 移动端提示位置调整 */
    .loop-toast, .favorite-toast, .clear-toast {
        bottom: 100px;
        font-size: 12px;
        padding: 6px 12px;
    }

    /* 移动端右键菜单适配 */
    .context-menu {
        width: 140px;
    }
    .context-menu-item {
        padding: 6px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .player-wrapper {
        padding: 15px;
    }
    
    .bottom-music-info {
        min-width: 100px;
    }
    
    .progress-lyrics-wrapper {
        min-width: 140px;
        margin: 0 4px;
    }
    
    .control-buttons {
        min-width: 140px;
    }
    
    .search-area {
        gap: 8px;
    }
    
    #searchBtn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* 隐藏默认元素 */
.music-info,
.more-btn,
.tips,
audio {
    display: none !important;
}