@font-face {
    font-family: 'KNMaiyuan';
    src: url('KNMaiyuan.ttf') format('truetype');
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}

@font-face {
    font-family: 'Ubuntu';
    src: url('Ubuntu.ttf') format('truetype');
    unicode-range: U+0000-007F, U+0080-00FF, U+0100-017F, U+0180-024F, U+0250-02AF, U+02B0-02FF, U+0300-036F, U+0370-03FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'KNMaiyuan', 'Ubuntu', sans-serif;
    background-image: url('background.png');
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #e60026;
    font-size: 24px;
    margin: 0;
}

/* 播放控制样式 */
.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.play-pause-btn {
    background: rgba(230, 0, 38, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-pause-btn:hover {
    background: #e60026;
    transform: scale(1.05);
}

.song-info-display {
    min-width: 200px;
    text-align: center;
}

.song-info-display .song-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e60026;
    cursor: pointer;
}

.time {
    font-size: 12px;
    color: #666;
    min-width: 35px;
}

/* 歌单切换按钮样式 */
.playlist-buttons {
    display: flex;
    gap: 10px;
}

.playlist-btn {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.playlist-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

.playlist-btn.active {
    background: rgba(255, 255, 255, 0.8);
    color: #e60026;
    font-weight: bold;
}

/* 底部红条样式 */
.playlist-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: #e60026;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.playlist-btn:hover::after {
    width: 80%;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 歌单详情样式 */
.playlist-section, .songs-section {
    background: rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.playlist-section h2, .songs-section h2 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #e60026;
    padding-bottom: 10px;
}

.playlist-detail {
    min-height: 300px;
}

.playlist-info {
    text-align: center;
}

.playlist-cover {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    margin: 0 auto 15px;
    object-fit: cover;
}

.playlist-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.playlist-creator {
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.creator-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.playlist-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.playlist-stat {
    text-align: center;
}

.playlist-stat .number {
    font-size: 16px;
    font-weight: bold;
    color: #e60026;
}

.playlist-stat .label {
    font-size: 12px;
    color: #999;
}

.playlist-description {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 10px;
}

/* 歌曲列表样式 */
.songs-list {
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 自定义滚动条样式 */
.songs-list::-webkit-scrollbar {
    width: 8px;
}

.songs-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.songs-list::-webkit-scrollbar-thumb {
    background: rgba(230, 0, 38, 0.6);
    border-radius: 4px;
}

.songs-list::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 0, 38, 0.8);
}

.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.song-index {
    width: 30px;
    text-align: center;
    font-weight: bold;
    flex-shrink: 0;
}

.album-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-name {
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-album {
    font-size: 11px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-duration {
    font-size: 12px;
    color: #333;
    flex-shrink: 0;
    width: 50px;
    text-align: right;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 16px;
}

.error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    background: #ffeaea;
    border-radius: 5px;
    margin: 10px 0;
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-top: 20px;
}

.playlist-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(230, 0, 38, 0.5);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(230, 0, 38, 0.3);
}

.playlist-link:hover {
    background: #ff1a3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 0, 38, 0.4);
}

.playlist-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(230, 0, 38, 0.3);
}

/* 歌曲项高亮样式 */
.song-item.active {
    background: rgba(230, 0, 38, 0.1);
    border-left: 3px solid #e60026;
}

.song-item.active .song-name {
    color: #e60026;
    font-weight: bold;
}

.song-item:hover {
    background: rgba(230, 0, 38, 0.05);
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 12px;
        font-size: 16px; /* 增大基础字体 */
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .header {
        padding: 15px 12px;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .header h1 {
        font-size: 20px;
        order: 1;
        width: 100%;
    }
    
    .playlist-buttons {
        order: 2;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    }
    
    .playlist-btn {
        padding: 12px 18px; /* 增大触摸区域 */
        font-size: 16px;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 44px; /* 最小触摸目标尺寸 */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .player-controls {
        order: 3;
        flex-direction: row;
        gap: 15px;
        width: 100%;
        margin-top: 8px;
        align-items: center;
    }
    
    .play-pause-btn {
        width: 50px; /* 增大按钮尺寸 */
        height: 50px;
        font-size: 20px;
        flex-shrink: 0;
        min-width: 44px; /* 最小触摸目标 */
        min-height: 44px;
    }
    
    .song-info-display {
        min-width: 0;
        flex: 1;
        max-width: none;
        padding: 0 10px;
    }
    
    .song-info-display .song-name {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .progress-container {
        max-width: none;
        flex: 1;
        padding: 0 5px;
        align-items: center;
    }
    
    .progress-bar {
        height: 6px; /* 增大进度条高度 */
        min-height: 20px; /* 增大触摸区域 */
    }
    
    .progress-bar::-webkit-slider-thumb {
        width: 20px; /* 增大滑块 */
        height: 20px;
    }
    
    .time {
        font-size: 14px;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
    }
    
    .playlist-section, .songs-section {
        padding: 15px;
        border-radius: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .playlist-detail {
        width: 100%;
        overflow: hidden;
    }
    
    .playlist-info {
        width: 100%;
        padding: 0;
    }
    
    .playlist-cover {
        width: 180px;
        height: 180px;
        max-width: 80%;
    }
    
    .playlist-title {
        font-size: 18px;
        width: 100%;
        padding: 0 5px;
        word-break: break-word;
        margin-bottom: 12px;
    }
    
    .playlist-creator {
        width: 100%;
        padding: 0 5px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .creator-avatar {
        width: 28px;
        height: 28px;
    }
    
    .playlist-stats {
        flex-wrap: wrap;
        gap: 15px;
        width: 100%;
        padding: 0 10px;
        margin-bottom: 15px;
    }
    
    .playlist-stat {
        flex: 1;
        min-width: 70px;
    }
    
    .playlist-stat .number {
        font-size: 18px;
    }
    
    .playlist-stat .label {
        font-size: 14px;
    }
    
    .playlist-description {
        font-size: 15px;
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
        word-break: break-word;
        line-height: 1.4;
    }
    
    /* 歌曲列表部分 - 增大触摸目标 */
    .songs-section {
        width: 100%;
        overflow: hidden;
    }
    
    .songs-list {
        max-height: 50vh;
        min-height: 300px;
        width: 100%;
    }
    
    .song-item {
        padding: 15px 10px; /* 增大内边距 */
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
        min-height: 60px; /* 最小触摸高度 */
        border-bottom: 1px solid #ddd;
    }
    
    .song-item:active {
        background: rgba(230, 0, 38, 0.1); /* 触摸反馈 */
    }
    
    .song-index {
        width: 30px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .album-cover {
        width: 50px; /* 增大封面尺寸 */
        height: 50px;
        flex-shrink: 0;
    }
    
    .song-info {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }
    
    .song-name {
        font-size: 16px;
        width: 100%;
        margin-bottom: 4px;
    }
    
    .song-artist, .song-album {
        font-size: 14px;
        width: 100%;
    }
    
    .song-duration {
        font-size: 14px;
        width: 45px;
        flex-shrink: 0;
        text-align: right;
    }
    
    .footer {
        padding: 15px;
        margin-top: 15px;
        width: 100%;
    }
    
    .playlist-link {
        padding: 15px 25px; /* 增大按钮尺寸 */
        font-size: 16px;
        width: auto;
        display: inline-block;
        min-height: 50px; /* 最小触摸高度 */
        text-align: center;
    }
    
    /* 增大所有可点击元素的触摸目标 */
    button, .song-item, .playlist-link {
        cursor: pointer;
    }
    
    /* 底部安全区域适配 */
    @supports (padding: max(0px)) {
        body {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
    
    /* 防止点击高亮 */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}