/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 添加旋转动画定义 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f0f0f0;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    width: 100vw; /* 确保body宽度为视口宽度 */
    max-width: 100vw; /* 确保body最大宽度为视口宽度 */
}

.container {
    max-width: 100%; /* 恢复为100%，撤回之前的1200px修改 */
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px; /* 从25px减小到20px */
    position: relative;
}

.header h1 {
    color: #ffffff;
    font-size: 2.6rem; /* 恢复为2.8rem，撤回之前的2.2rem修改 */
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(90deg, #ff7eee, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* 添加轻微的立体效果，但不过分夸张 */
    text-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 榜单导航样式 */
.chart-nav {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px; /* 从30px减小到15px以减小与播放歌单输入区域的间距 */
    flex-wrap: nowrap;
    overflow-x: auto; /* 允许水平滚动以防内容过多 */
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    padding: 5px 0; /* 添加内边距以改善视觉效果 */
}

.chart-btn {
    padding: 8px 15px;
    background: transparent;
    border: none;
    border-radius: 15px;
    color: #a0a0c0;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: none;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0; /* 防止按钮收缩 */
}

.chart-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.chart-btn.active {
    background: linear-gradient(90deg, #ff7eee, #4facfe);
    border: none;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* 从25px减小到10px */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* 添加调试信息 */
    /* background-color: yellow; */
}

/* 音乐播放器区域 */
.player-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 20px;
    padding: 20px; /* 从30px减小到20px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px; /* 从25px减小到15px */
    overflow-x: hidden; /* 防止水平滚动 */
}

.player-container {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 从20px减小到15px */
}

/* 为极小屏幕添加媒体查询 */
@media screen and (max-width: 400px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        /* 添加调试信息 */
        /* background-color: green !important; */
    }

    .player-section {
        padding: 10px !important;
        gap: 8px !important;
    }

    .player-container {
        gap: 8px !important;
    }

    .player-top {
        position: relative;
        min-height: 200px;
        display: flex;
        align-items: flex-start;
        gap: 10px; /* 从20px减小到10px */
        flex-wrap: nowrap; /* 不允许换行 */
    }

    .album-art {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
        margin: 0 auto; /* 居中显示 */
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: inherit;
        min-height: inherit;
    }
    
    .song-info-block {
        text-align: left;
        flex: 1;
        margin: 0 10px;
        order: 2; /* 确保在中间显示 */
        min-width: 150px; /* 确保有足够的显示空间 */
    }
    
    .player-controls {
        gap: 4px; /* 极小屏幕上进一步减小间距 */
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.2rem;
    }
    
    #play-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.2rem;
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 45px; /* 减小高度以适应小屏幕 */
        padding: 5px 45px 5px 12px; /* 调整padding */
    }
    
    .input-button {
        width: 35px; /* 减小按钮尺寸 */
        height: 35px; /* 减小按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.3rem; /* 调整图标大小 */
    }
}

/* 为超小屏幕添加媒体查询 */
@media screen and (max-width: 320px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 2px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        /* 添加调试信息 */
        /* background-color: purple !important; */
    }

    .player-section {
        padding: 5px !important;
        gap: 5px !important;
    }

    .player-container {
        gap: 5px !important;
    }

    .player-top {
        position: relative;
        min-height: 200px;
        display: flex;
        align-items: flex-start;
        gap: 10px; /* 从20px减小到10px */
        flex-wrap: nowrap; /* 不允许换行 */
    }

    .album-art {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
        margin: 0 auto; /* 居中显示 */
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: inherit;
        min-height: inherit;
    }
    
    .song-info-block {
        text-align: left;
        flex: 1;
        margin: 0 10px;
        order: 2; /* 确保在中间显示 */
        min-width: 150px; /* 确保有足够的显示空间 */
    }
    
    .player-controls {
        gap: 2px; /* 超小屏幕上进一步减小间距 */
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 1rem;
    }
    
    #play-btn {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 1rem;
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 40px; /* 进一步减小高度 */
        padding: 5px 40px 5px 10px; /* 调整padding */
    }
    
    .input-button {
        width: 30px; /* 进一步减小按钮尺寸 */
        height: 30px; /* 进一步减小按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.2rem; /* 调整图标大小 */
    }
}

/* 添加一个通用的媒体查询，确保在所有小屏幕设备上都应用单列布局 */
@media screen and (max-device-width: 768px) and (orientation: portrait), 
       screen and (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .player-section {
        padding: 15px !important;
        gap: 12px !important;
    }
    
    .player-container {
        gap: 12px !important;
    }
    
    .player-top {
        position: relative;
        min-height: 200px;
        display: flex;
        align-items: flex-start;
        gap: 10px; /* 从20px减小到10px */
        flex-wrap: nowrap; /* 不允许换行 */
    }

    .album-art {
        width: 160px;
        height: 160px;
        min-width: 160px;
        min-height: 160px;
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: inherit;
        min-height: inherit;
    }
    
    .player-controls {
        gap: 6px; /* 小屏幕设备上保持原有间距 */
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 48px; /* 适中高度 */
        padding: 5px 48px 5px 15px; /* 调整padding */
    }
    
    .input-button {
        width: 38px; /* 适中按钮尺寸 */
        height: 38px; /* 适中按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.4rem; /* 调整图标大小 */
    }
}

/* 响应式设计 - 平板和手机 */
@media screen and (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        /* 添加调试信息 */
        /* background-color: blue !important; */
    }

    .player-section {
        padding: 15px !important;
        gap: 10px !important;
    }

    .player-container {
        gap: 10px !important;
    }

    .player-top {
        position: relative;
        min-height: 200px;
        display: flex;
        align-items: flex-start;
        gap: 10px; /* 从20px减小到10px */
        flex-wrap: nowrap; /* 不允许换行 */
    }

    .album-art {
        width: 160px;
        height: 160px;
        min-width: 160px;
        min-height: 160px;
        margin: 0 auto; /* 居中显示 */
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: inherit;
        min-height: inherit;
    }
    
    .song-info-block {
        text-align: left;
        flex: 1;
        margin: 0 10px;
        order: 2; /* 确保在中间显示 */
        min-width: 150px; /* 确保有足够的显示空间 */
    }
    
    .player-controls {
        gap: 6px; /* 小屏幕设备上保持原有间距 */
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 50px; /* 标准高度 */
        padding: 5px 50px 5px 15px; /* 标准padding */
    }
    
    .input-button {
        width: 40px; /* 标准按钮尺寸 */
        height: 40px; /* 标准按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.5rem; /* 标准图标大小 */
    }
}

@media screen and (max-width: 480px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        /* 添加调试信息 */
        /* background-color: red !important; */
    }

    .player-section {
        padding: 10px !important;
        gap: 8px !important;
    }

    .player-container {
        gap: 8px !important;
    }

    .player-top {
        position: relative;
        min-height: 200px;
        display: flex;
        align-items: flex-start;
        gap: 10px; /* 从20px减小到10px */
        flex-wrap: nowrap; /* 不允许换行 */
    }

    .album-art {
        width: 140px;
        height: 140px;
        min-width: 140px;
        min-height: 140px;
        margin: 0 auto; /* 居中显示 */
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: 160px;
        min-height: 160px;
    }
    
    .song-info-block {
        text-align: left;
        flex: 1;
        margin: 0 10px;
        order: 2; /* 确保在中间显示 */
        min-width: 150px; /* 确保有足够的显示空间 */
    }
    
    .player-controls {
        gap: 4px; /* 极小屏幕上进一步减小间距 */
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 48px; /* 适中高度 */
        padding: 5px 48px 5px 15px; /* 调整padding */
    }
    
    .input-button {
        width: 38px; /* 适中按钮尺寸 */
        height: 38px; /* 适中按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.4rem; /* 调整图标大小 */
    }
}

/* 在双列布局下减小播放控件按钮间距 */
@media screen and (min-width: 769px) {
    .player-top {
        flex-wrap: nowrap; /* 大屏幕上不换行 */
        align-items: flex-start; /* 顶部对齐 */
    }
    
    .album-art {
        margin: 0; /* 大屏幕上不居中 */
        width: 200px;
        height: 200px;
        min-width: 200px;
        min-height: 200px;
        aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
        order: 1;
    }
    
    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        min-width: inherit;
        min-height: inherit;
    }
    
    .song-info-block {
        text-align: left;
        flex: 1;
        margin-left: 10px;
        align-self: center; /* 垂直居中对齐 */
        order: 2; /* 确保在中间显示 */
    }
    
    .player-controls {
        gap: 2px !important; /* 在大屏幕上进一步减小间距，但保持按钮大小不变 */
    }
    
    .control-btn {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        font-size: 1.5rem !important;
    }
    
    #play-btn {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        font-size: 1.5rem !important;
    }
    
    /* 添加输入框和按钮的响应式样式 */
    .input-with-button {
        height: 50px; /* 标准高度 */
        padding: 5px 50px 5px 15px; /* 标准padding */
    }
    
    .input-button {
        width: 40px; /* 标准按钮尺寸 */
        height: 40px; /* 标准按钮尺寸 */
        right: 5px; /* 保持右对齐 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%) !important; /* 精确垂直居中 */
        font-size: 1.5rem; /* 标准图标大小 */
    }
}

/* 大屏布局 - 歌曲信息在专辑封面右侧 */
.player-top {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: flex-start;
    gap: 10px; /* 从20px减小到10px */
    flex-wrap: nowrap; /* 不允许换行 */
}

.album-art {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    min-width: 180px;
    min-height: 180px;
    order: 1;
    aspect-ratio: 1 / 1; /* 确保始终是1:1比例 */
}

.album-art:hover {
    transform: scale(1.03);
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    min-width: inherit; /* 继承父元素的最小宽度 */
    min-height: inherit; /* 继承父元素的最小高度 */
}

.album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-art:hover .album-overlay {
    opacity: 1;
}

.album-overlay i {
    font-size: 2rem;
    color: white;
}

.song-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0; /* 最小行间距 */
    justify-content: center;
    margin: 0; /* 移除默认边距 */
    padding-top: 0; /* 确保顶部内边距为0 */
    min-width: 200px; /* 确保有足够的显示空间 */
    order: 2; /* 确保专辑信息在第二位 */
}

.song-info-block p {
    margin: 0; /* 最小间距 */
    margin-bottom: 1px; /* 进一步减小间距 */
    color: #a0a0c0;
    font-size: 1rem;
    text-align: left;
    word-wrap: break-word; /* 允许长单词换行 */
    word-break: break-all; /* 强制换行，避免内容被截断 */
    overflow-wrap: break-word; /* 确保长文本换行 */
    line-height: 1.3; /* 增加行高以提高可读性 */
    white-space: normal; /* 允许正常换行 */
    hyphens: auto; /* 自动添加连字符 */
}

.song-title-artist {
    width: 100%;
    text-align: center;
    margin: 10px 0;
}

.song-title-artist h2 {
    font-size: 1.8rem; /* 恢复为1.8rem，撤回之前的1.5rem修改 */
    margin: 0;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.song-title-artist p {
    margin: 0;
    color: #a0a0c0;
    font-size: 1.2rem; /* 恢复为1.2rem，撤回之前的1.1rem修改 */
}

/* 歌词区域 */
.lyrics-wrapper {
    width: 100%;
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(30, 30, 46, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(30, 30, 46, 0.8);
    border-bottom: 1px solid rgba(30, 30, 46, 0.8);
    margin-top: -10px;
}

/* 歌词操作按钮区域 - 现在放在原来"歌词"文字的位置 */
.lyrics-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap; /* 确保始终显示在一行 */
    align-items: center;
    width: 100%;
    background: rgba(30, 30, 46, 0.8);
}

/* 歌词区域按钮通用样式 */
.action-btn, .toggle-btn {
    padding: 8px 15px;
    background: transparent; /* 去除背景色 */
    border: none; /* 去除边框 */
    border-radius: 20px;
    color: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

/* 移除原来的歌词底部区域样式 */
.lyrics-container {
    max-height: 250px;
    overflow-y: auto;
    text-align: center;
    scroll-behavior: smooth;
    position: relative;
    background: rgba(30, 30, 46, 0.8);
}

.lyrics-container.collapsed {
    max-height: 100px;
    overflow-y: auto; /* 允许滚动以显示高亮歌词 */
    overflow-x: hidden;
}

.lyrics-container::-webkit-scrollbar {
    width: 6px;
}

.lyrics-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.lyrics-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ff7eee, #4facfe);
    border-radius: 3px;
}

.lyrics-content {
    padding: 20px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lyric-line {
    margin: 5px 0; /* 减小行距 */
    padding: 4px 8px; /* 减小内边距 */
    transition: all 0.3s ease;
    font-size: 1.1rem;
    line-height: 1.4; /* 减小行高 */
    border-radius: 8px;
    opacity: 0.6;
    transform: scale(0.95);
}

.lyric-line.active {
    color: #4facfe;
    font-weight: 700;
    font-size: 1.2rem; /* 稍微减小活动行字体大小 */
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
    background: rgba(79, 172, 254, 0.1);
    margin: 5px 0; /* 保持一致的间距 */
    padding: 4px 8px;
}

.lyric-line.prev {
    opacity: 0.8;
    transform: scale(0.98);
}

.lyric-line.next {
    opacity: 0.4;
    transform: scale(0.92);
}

.lyric-placeholder {
    color: #a0a0c0;
    font-style: italic;
}

/* 进度条 */
.player-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 5px 0; /* 减小上下间距到最小 */
}

.progress-bar {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(90deg, #ff7eee, #4facfe);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.8);
}

#current-time, #total-time {
    font-size: 1rem;
    color: #a0a0c0;
    min-width: 50px;
    text-align: center;
    font-weight: 500;
}

/* 播放控制和音质选项容器 */
.player-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 5px 0;
    overflow-x: hidden; /* 防止水平滚动 */
}

.player-controls {
    display: flex;
    gap: 6px; /* 默认间距 */
    align-items: center;
    flex-wrap: nowrap;
    width: auto;
    flex: 0 0 auto;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #f0f0f0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: none;
    flex-shrink: 0; /* 防止按钮缩小 */
    padding: 0; /* 移除内边距以适应小屏幕 */
    min-width: 50px; /* 设置最小宽度 */
}

.control-btn:hover {
    background: transparent;
    box-shadow: none;
}

#play-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: transparent;
    box-shadow: none;
    min-width: 50px;
}

/* 播放器选项 */
.player-options {
    flex: 0 0 auto; /* 不伸缩 */
    min-width: 100px; /* 恢复原来的最小宽度 */
    display: flex;
    align-items: center;
    margin-left: 10px; /* 与按钮保持间距 */
}

#quality-select {
    padding: 8px 12px; /* 减小内边距以适应更小的空间 */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    cursor: pointer;
    font-size: 1.0rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    min-width: 80px; /* 减小最小宽度以适应更小的空间 */
    flex-shrink: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

#quality-select:hover {
    background: rgba(255, 255, 255, 0.2);
}

#quality-select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.4);
}

#quality-select option {
    background: #1e1e2e;
    color: #f0f0f0;
}

/* 播放列表区域 */
.playlist-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 新增播放歌单和搜索区域样式 */
.playlist-input-section {
    margin-bottom: 5px; /* 从15px减小到10px以减小与榜单导航的间距 */
    overflow-x: hidden; /* 防止水平滚动 */
}

.input-group {
    position: relative !important;
    flex: 1 !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
}

.input-group-container {
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    overflow-x: hidden !important; /* 防止水平滚动 */
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.input-label {
    display: block !important;
    margin-bottom: 5px !important;
    color: #a0a0c0 !important;
    font-size: 1.1rem !important; /* 增大字体与热歌榜按钮一样大 */
    font-weight: 500 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.input-label i {
    margin-right: 8px !important; /* 为图标添加右边距 */
    color: #4facfe !important; /* 为图标添加颜色 */
}

.input-with-button {
    width: 100% !important;
    padding: 5px 40px 5px 15px !important; /* 调整padding为按钮留出空间 */
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f0f0f0 !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    min-width: 0 !important; /* 确保输入框可以收缩到适合容器的大小 */
    height: 40px !important; /* 设置固定高度 */
    box-sizing: border-box !important; /* 确保padding包含在高度内 */
    position: relative !important; /* 确保定位上下文 */
    display: block !important; /* 确保正确显示 */
    margin: 0 !important; /* 移除外边距 */
    outline: none !important; /* 移除外轮廓 */
    z-index: 1 !important; /* 确保输入框在正确层级 */
}

.input-button {
    position: absolute !important;
    right: -5px !important; /* 向右偏移 */
    top: 48px !important; /* 向下偏移5px，而不是垂直居中 */
    width: 40px !important; /* 按钮宽度 */
    height: 40px !important; /* 按钮高度 */
    border-radius: 50% !important; /* 圆形按钮 */
    border: none !important; /* 去除外框 */
    background: transparent !important; /* 去除背景色 */
    color: #f0f0f0 !important;
    font-size: 1.5rem !important; /* 图标大小 */
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important; /* 确保按钮在最上层 */
    margin: 0 !important; /* 移除可能的外边距 */
    padding: 0 !important; /* 移除可能的内边距 */
}

.input-button:hover {
    background: rgba(255, 255, 255, 0.1) !important; /* 悬停时轻微背景 */
    box-shadow: none !important;
}

.input-button:active {
    background: rgba(255, 255, 255, 0.2) !important; /* 按下时背景 */
}

.playlist-header h2 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.4rem; /* 从1.6rem进一步减小 */
    font-weight: 700;
}

.playlist-header h2 span {
    font-size: 0.9rem; /* 从1rem进一步减小 */
    color: #a0a0c0;
    font-weight: 400;
}

/* 添加榜单描述样式 */
.list-description {
    color: #a0a0c0;
    font-size: 1rem;
    margin-top: 5px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.chart-description, .search-description {
    color: #a0a0c0;
    font-size: 1rem;
    line-height: 1.4;
}

/* 歌单信息样式 */
.playlist-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.playlist-pic {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.playlist-details {
    flex: 1;
}

.playlist-details strong {
    color: #ffffff;
}

.song-list {
    list-style: none;
    max-height: 600px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.song-list::-webkit-scrollbar {
    width: 8px;
}

.song-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.song-list::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ff7eee, #4facfe);
    border-radius: 4px;
}

/* 调整歌曲项目行距为最小 */
.song-item {
    display: flex;
    align-items: center;
    padding: 1px 10px; /* 进一步减小内边距以实现最小高度 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px; /* 减小圆角 */
    margin-bottom: 1px; /* 最小行间距 */
    min-height: 20px; /* 设置最小高度 */
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.song-item.playing {
    background: rgba(79, 172, 254, 0.2);
    border-left: 4px solid #4facfe;
}

.song-index {
    width: 25px; /* 减小序号宽度 */
    color: #a0a0c0;
    font-size: 1.1rem; /* 增大字体大小 从0.8rem改为1.1rem */
    font-weight: 500;
}

.song-info {
    flex: 1;
    padding: 0 10px; /* 减小内边距 */
    text-align: left;
}

.song-info .song-title {
    font-weight: 600;
    font-size: 1rem; /* 减小字体大小 */
    margin-bottom: 2px; /* 减小下边距 */
    color: #ffffff;
}

.song-info .song-artist {
    color: #a0a0c0;
    font-size: 0.8rem; /* 减小字体大小 */
}

.song-info .song-artist.signature {
    color: #4facfe;
    font-size: 0.7rem;
    font-style: italic;
    margin-top: 2px;
}

.song-pay {
    padding: 0; /* 去除外框内边距 */
    border-radius: 0; /* 去除圆角 */
    font-size: 1.1rem; /* 增大字体大小 从0.8rem改为1.1rem */
    min-width: 0; /* 去除最小宽度 */
    text-align: left; /* 左对齐 */
    font-weight: 500;
    background: transparent; /* 去除背景色 */
    box-shadow: none; /* 去除阴影 */
    margin: 0; /* 去除外边距 */
}

.song-pay:empty {
    display: none;
}

.pay-song {
    color: #ffffff; /* 付费音乐使用白色文字 */
    background: transparent; /* 去除背景色 */
    box-shadow: none; /* 去除阴影 */
}

.free-song {
    color: #2e7d32; /* 免费音乐使用深绿色文字 */
    background: transparent; /* 去除背景色 */
    box-shadow: none; /* 去除阴影 */
}

/* 热门搜索面板右上角关闭按钮 */
.hot-search-close {
  position: absolute;
  top: 8px;
  right: 5px; /* 向右移动 */
  background: transparent;
  border: none;
  color: #888;
  font-size: 24px; /* 稍小一些 */
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.hot-search-close:hover {
  transform: scale(1.2);
  color: #333;
}

/* 深色主题下的关闭按钮样式 */
.dark-theme .hot-search-close {
  color: #aaa;
}

.dark-theme .hot-search-close:hover {
  color: #fff;
}

/* 深色主题热门搜索面板样式 */
.dark-theme .popup-panel {
    background: #252525;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.dark-theme .panel-header h3 {
    color: #c77dff;
}

.dark-theme .hot-tag {
    background: #3a3a3a;
    color: #d0d0d0;
}

.dark-theme .hot-tag:hover {
    background: #7b2cbf;
    color: #ffd700;
}

/* 深色主题下的面板内容滚动条样式 */
.dark-theme .panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark-theme .panel-content::-webkit-scrollbar-thumb {
    background: #7b2cbf;
}

.dark-theme .panel-content::-webkit-scrollbar-thumb:hover {
    background: #c77dff;
}

.dark-theme .panel-content {
    scrollbar-color: #7b2cbf rgba(255, 255, 255, 0.05);
}

/* 弹出面板样式 */
.popup-panel {
    display: none;
    position: absolute;
    max-height: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 5px;
}

.popup-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.panel-header h3 {
    margin: 0;
    color: #6a1b9a;
    font-size: 1.4rem;
    font-weight: 600;
}

/* 面板右上角关闭按钮 */
.panel-close {
    position: absolute;
    top: 8x;
    right: -5px; /* 向右移动 */
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px; /* 稍小一些 */
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
    width: 25px; /* 稍小一些 */
    height: 25px; /* 稍小一些 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    transform: scale(1.2);
    color: #333;
}

/* 深色主题下的面板关闭按钮样式 */
.dark-theme .panel-close {
    color: #aaa;
}

.dark-theme .panel-close:hover {
    color: #fff;
}

.panel-content {
    padding: 15px 0 0 0;
    max-height: 200px; /* 固定最大高度 */
    overflow-y: auto; /* 垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动条 */
    position: relative;
    margin-top: 0; /* 不再需要为关闭按钮留出空间 */
}

/* 为面板内容添加滚动条样式 */
.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #8e44ad;
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #6a1b9a;
}

/* Firefox滚动条样式 */
.panel-content {
    scrollbar-width: thin;
    scrollbar-color: #8e44ad rgba(0, 0, 0, 0.05);
}

.hot-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* 确保标签容器不会超出面板内容区域 */
    max-height: 100%;
}

.panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* 确保列表容器不会超出面板内容区域 */
    max-height: 100%;
}

.panel-list li, .hot-tag {
    background: #f5edff;
    color: #412f1f;
    padding: 3px 5px;
    border-radius: 18px;
    font-size: 18px; /* 恢复为18px，撤回之前的1.1rem修改 */
    cursor: pointer;
    transition: all 0.2s ease;
    /* 防止标签内容过长 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.panel-list li:hover, .hot-tag:hover {
    background: #8e44ad;
    color: #ffd700;
    transform: translateY(-2px);
}

/* 面板背景遮罩 */
.panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.panel-overlay.active {
    display: block;
}

/* 响应式设计 - 小屏幕 */
@media screen and (max-width: 768px) {
    .popup-panel {
        width: 95%;
        max-width: 95%;
    }
    
    .panel-list li, .hot-tag {
        padding: 3px 5px;
        font-size: 18px; /* 恢复为18px，撤回之前的1.1rem修改 */
    }
}

@media screen and (max-width: 480px) {
    .panel-list li, .hot-tag {
        padding: 3px 5px;
        font-size: 18px; /* 恢复为18px，撤回之前的1.1rem修改 */
    }
    
    .panel-header h3 {
        font-size: 1.2rem;
    }
}

/* 版权信息样式 */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer {
    text-align: center;
    padding: 15px 0 10px 0; /* 调整内边距 */
    margin-top: 10px; /* 减小与上方元素的间距 */
    color: #a0a0c0;
    font-size: 0.8rem; /* 从0.9rem减小到0.8rem，使其在大屏幕上更合适 */
    border-top: none; /* 移除顶部边框 */
}

.copyright p {
    margin: 5px 0;
}

.copyright a {
    color: #4facfe;
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}
