/* General styles */
/*body {*/
/*    font-family: Arial, sans-serif;*/
/*    background-color: #000;*/
/*    color: #fff;*/
/*    margin: 0;*/
/*    padding: 0;*/
/*    min-height: 100vh;*/
/*}*/



/* Music list styles */
.music-list {
    display: flex;
    flex-direction: column;
    background-color: var(--body-bg-color);
    padding: 2px; /* 添加内边距 */
}

.music-item {
    display: flex;
    align-items: center;
    background-color: var(--muted-bg-color);
    padding: 20px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.music-item + .music-item {
    margin-top: 2px; /* 使用margin-top替代margin-bottom */
}

.music-item:last-child {
    margin-bottom: 0;
}

.music-item:hover {
    background-color: var(--muted-2-color);
}

.music-item.active {
    background-color: var(--muted-2-color);
}

/* Cover container styles */
.cover-container {
    position: relative;
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
}

.cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.info {
    flex: 3;
    display: flex;
    flex-direction: column;
    min-width: 200px; /* Add minimum width to prevent deformation */
}

.info .title {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 0;
    box-sizing: border-box;
    width: 100%;
    display: block;
}

.info .title a {
    color: inherit;
    text-decoration: none;
}

.info .title a:hover {
    color: #4527a0; /* Theme color for hover state */
}

.info .artist {
    font-size: 14px;
    color: #aaa;
}

.waveform {
    flex: 3;
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 30%; /* Add minimum width to prevent deformation */
}

.waveform-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    min-width: 200px; /* Ensure waveform image has minimum width */
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: rgba(76, 175, 80, 0.5);
    pointer-events: none;
    transition: width 0.1s linear;
}

.mood {
    flex: 2;
    }

.instruments {
    flex: 3;
    
}

.length {
    flex: 1;
    
}

.actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.share-btn, .favorite-btn {
    background-color: transparent;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 18px;
}

.share-btn::before {
    content: "⇱";
}

.favorite-btn::before {
    content: "♡";
}

.favorite-btn.active::before {
    content: "♥";
    color: #4527a0;
}

/* Player bar styles */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #000;
    display: none; /* Hidden by default, shown when playing */
    align-items: center;
    padding: 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-top: 1px solid #222;
}

/* Desktop layout styling */
.player-top {
    display: flex;
    align-items: center;
    flex: 1;
}

.player-waveform-container {
    display: flex;
    align-items: center;
    flex: 2;
}

.player-cover {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    display: block;
}

.player-cover img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.player-info {
    display: flex;
    align-items: center;
    width: 250px;
    min-width: 150px;
}

.player-song-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.current-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.artist-name {
    color: #aaa;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 15px;
}

.prev-btn, .next-btn, .shuffle-btn, .repeat-btn {
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover, .next-btn:hover, .shuffle-btn:hover, .repeat-btn:hover,
.play-pause-btn:hover, .heart-btn:hover, .share-btn:hover, .volume-btn:hover {
    color: #fff;
}

.shuffle-btn.active, .repeat-btn.active, .heart-btn.active {
    color: #4527a0;
}

.repeat-btn.repeat-one {
    position: relative;
}

.repeat-btn.repeat-one::after {
    content: "1";
    position: absolute;
    font-size: 8px;
    top: 2px;
    right: 0;
    color: #4527a0;
    font-weight: bold;
}

.play-pause-btn {
    width: 30px;
    height: 30px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.play-pause-btn i {
    font-size: 16px;
    display: block;
}

.play-pause-btn.paused i.fa-play {
    display: block;
}

.play-pause-btn.paused i.fa-pause {
    display: none;
}

.play-pause-btn:not(.paused) i.fa-play {
    display: none;
}

.play-pause-btn:not(.paused) i.fa-pause {
    display: block;
}

.current-time, .total-time {
    width: 50px;
    text-align: center;
    font-size: 12px;
    color: #aaa;
}

.player-waveform {
    flex: 1;
    margin: 0 5px;
    height: 55px;
    position: relative;
    overflow: visible;
    width: 100%;
}

.player-waveform .waveform-img {
    filter: brightness(0.7) grayscale(0.3);
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    position: relative;
    z-index: 1;
}

.player-waveform .progress-overlay {
    /*background-color: rgba(30, 215, 96, 0.6);*/
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    pointer-events: none;
    transition: width 0.1s linear;
    z-index: 2;
}

.player-actions {
    display: flex;
    gap: 12px;
    margin-left: 10px;
}

.heart-btn, .share-btn {
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart-btn.active .fa-heart {
    color: #4527a0;
    font-weight: 900;
}

/* Volume Control */
.volume-btn {
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.volume-container {
    position: absolute;
    bottom: 50px;
    left: 98%;
    transform: translateX(-50%);
    width: 24px;
    height: 120px;
    background-color: #222;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    transition: opacity 0.3s ease;
}

.volume-container::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #222;
}

.volume-container.active {
    display: flex;
}

.volume-slider-container {
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: #555;
    border-radius: 2px;
    transform: rotate(-90deg);
    cursor: pointer;
    position: absolute;
    left: -38px; /* Center the slider horizontally */
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4527a0;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4527a0;
    cursor: pointer;
    border: none;
}

/* Update music list buttons to use Font Awesome */
.music-item .share-btn, .music-item .favorite-btn {
    background-color: transparent;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.music-item .share-btn::before, 
.music-item .favorite-btn::before {
    display: none;
}

/* Remove previous pseudo-element content and use Font Awesome instead */
.share-btn::before,
.favorite-btn::before,
.prev-btn::before,
.next-btn::before,
.shuffle-btn::before,
.repeat-btn::before,
.volume-btn::before {
    content: none;
}

/* Hide native audio controls */
audio {
    display: none;
}

/* Add a highlight to the active state when volume is adjusted */
.volume-slider::-webkit-slider-thumb:active {
    background: #6a42d4;
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb:active {
    background: #6a42d4;
    transform: scale(1.2);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .music-container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Simplify header for mobile */
    .header {
        padding: 10px;
    }
    
    .header .mood, 
    .header .instruments {
        display: none;
    }
    
    .header .title {
        flex: 2;
    }
    
    .header .length {
        flex: 0.5;
    }
    
    /* Adjust music items for mobile */
    .music-item {
        padding: 10px;
        flex-wrap: wrap;
        position: relative;
    }
    
    .cover-container {
        width: 45px;
        height: 45px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    /* Title container for mobile */
    .info {
        flex: 1;
        min-width: 0;
        max-width: 100%;
        padding-right: 10px;
        width: calc(100% - 130px); /* Account for space taken by other elements */
    }
    
    .info .title {
        font-weight: bold;
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 3px 0;
        box-sizing: border-box;
        width: 100%;
        display: block;
    }
    
    .info .artist {
        font-size: 14px;
        color: #aaa;
    }
    
    /* Hide mood, instruments and length columns on mobile */
    .mood, 
    .instruments,
    .length,
    .header .length {
        display: none;
    }
    
    /* Move actions to right of screen */
    .actions {
        position: absolute;
        right: 15px;
        top: 40px;
        margin-left: 0;
        flex: none;
    }
    
    /* Full width waveform below title and cover */
    .waveform {
        order: 3;
        width: 100%;
        flex: none;
        margin-top: 10px;
        height: 55px;
    }
    
    /* Mobile player bar - simplified with only song info, cover and waveform */
    .player-bar {
        height: 60px;
        padding: 0 10px;
        display: none; /* Hidden by default, JS will show it when playing */
        flex-direction: row;
        align-items: center;
        background-color: #000;
    }
    
    /* Show only cover, song info and waveform on mobile */
    .player-top {
        display: flex;
        align-items: center;
        flex: none;
        margin-right: 10px;
        max-width: 40%;
    }
    
    .player-cover {
        width: 45px;
        height: 45px;
        margin-right: 10px;
        display: block;
        flex-shrink: 0;
    }
    
    .player-info {
        width: auto;
        min-width: 0;
        overflow: hidden;
    }
    
    .current-title {
        max-width: 100%;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .artist-name {
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Hide all controls */
    .player-controls, 
    .player-actions,
    .volume-btn,
    .current-time,
    .total-time {
        display: none;
    }
    
    /* Show only waveform */
    .player-waveform-container {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 0;
        order: 3;
    }
    
    .player-waveform {
        flex: 1;
        height: 55px;
        margin: 0;
        width: 100%;
        overflow: visible;
        position: relative;
    }
    
    .player-waveform .waveform-img {
        filter: brightness(0.7) grayscale(0.3);
        width: 100%;
        height: 100%;
        object-fit: fill;
        display: block;
        position: relative;
        z-index: 1;
    }
    
    .player-waveform .progress-overlay {
        background-color: rgba(30, 215, 96, 0.6);
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 0;
        pointer-events: none;
        transition: width 0.1s linear;
        z-index: 2;
    }
    
    /* Hide volume slider for mobile */
    .volume-container {
        display: none !important;
    }
    
    /* Styles for very small screens */
    @media screen and (max-width: 399px) {
        .music-item {
            padding: 10px 8px;
        }
        
        .info {
            width: calc(100% - 90px);
        }
        
        .info .title {
            font-size: 14px;
        }
        
        .actions {
            right: 8px;
        }
    }
    
    /* Ensure title has minimum width on larger mobile screens */
    @media screen and (min-width: 400px) and (max-width: 768px) {
        .info .title {
            min-width: 300px;
        }
    }
    
    .play-pause-btn {
        width: 30px;
        height: 30px;
        background-color: transparent;
        border: none;
        cursor: pointer;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .play-pause-btn i {
        font-size: 16px;
        display: block;
    }
    
    .play-pause-btn.paused i.fa-play {
        display: block;
    }
    
    .play-pause-btn.paused i.fa-pause {
        display: none;
    }
    
    .play-pause-btn:not(.paused) i.fa-play {
        display: none;
    }
    
    .play-pause-btn:not(.paused) i.fa-pause {
        display: block;
    }
    
    .music-list {
        background-color: var(--body-bg-color);
        padding: 2px;
    }
    
    .music-item + .music-item {
        margin-top: 2px;
    }
    
    /* 在移动端始终显示播放/暂停按钮 */
    .play-overlay {
        opacity: 1; /* 移动端始终显示按钮 */
    }
    
    /* 播放状态下显示暂停按钮 */
    .cover-container.playing .play-overlay .fa-play {
        display: none !important;
    }
    
    .cover-container.playing .play-overlay .fa-pause {
        display: block !important;
    }
    
    /* 非播放状态下显示播放按钮 */
    .cover-container:not(.playing) .play-overlay .fa-play {
        display: block !important;
    }
    
    .cover-container:not(.playing) .play-overlay .fa-pause {
        display: none !important;
    }
    
    /* 修改列表模式中的分类显示，使其完整显示 */
    .music-item .mood, 
    .music-item .instruments {
        white-space: normal;
        overflow: visible;
        max-width: none;
        display: inline-block;
        margin-right: 10px;
    }
    
    /* 移除分类信息文字截断，允许完整显示 */
    .item-category a, .mood a {
        display: inline-block;
        max-width: none; /* 移除最大宽度限制 */
        white-space: normal; /* 允许文本换行 */
        overflow: visible;
        text-overflow: clip;
    }
    
    /* 确保分类信息在右侧显示，但允许显示完整内容 */
    .item-body {
        position: relative;
        min-height: 80px; /* 增加高度确保有足够空间显示底部信息 */
        padding-bottom: 40px; /* 增加底部padding，为标签和分类提供更多空间 */
    }
    
    .item-tags, .item-author {
        position: absolute;
        bottom: 10px;
        left: 10px;
        max-width: 65%; /* 增加宽度允许更多内容 */
        text-align: left;
    }
    
    .item-category {
        position: absolute;
        bottom: 10px;
        right: 10px;
        max-width: 50%; /* 限制宽度为容器的一半 */
        text-align: right; /* 右对齐文本 */
    }
}

/* Desktop-specific styles */
@media screen and (min-width: 769px) {
    /* Title truncation for desktop */
    .info .title {
        max-width: 270px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }
    
    .player-bar {
        flex-wrap: nowrap;
        height: 60px;
        padding: 0;
        flex-direction: row;
        align-items: center;
        background-color: #000;
        border-top: 1px solid #222;
        justify-content: flex-start;
    }
    
    .player-top {
        display: flex;
        align-items: center;
        margin-right: 0;
        padding: 0 10px 0 15px;
        width: auto;
        order: 1;
        flex-shrink: 0;
        max-width: 220px;
    }
    
    .player-cover {
        width: 40px;
        height: 40px;
        margin-right: 10px;
        display: block;
        flex-shrink: 0;
    }
    
    .player-cover img {
        border-radius: 0;
    }
    
    .player-info {
        width: 160px;
        min-width: 0;
        margin-right: 0;
        overflow: hidden;
    }
    
    .current-title {
        font-weight: 600;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }
    
    .player-controls {
        display: flex;
        align-items: center;
        width: auto;
        gap: 15px;
        margin: 0;
        padding: 0;
        order: 2;
        justify-content: flex-start;
        flex-shrink: 0;
        margin-left: 5px;
    }
    
    .player-controls .prev-btn, 
    .player-controls .next-btn,
    .player-controls .shuffle-btn,
    .player-controls .repeat-btn {
        font-size: 14px;
    }
    
    .play-pause-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .player-waveform-container {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 0 15px;
        margin-left: 20px;
        order: 3;
        height: 100%;
        max-width: none;
    }
    
    .current-time, .total-time {
        width: 40px;
        font-size: 12px;
        color: #aaa;
        flex-shrink: 0;
    }
    
    .player-waveform {
        flex: 1;
        margin: 0 5px;
        height: 60px;
        width: 100%;
        overflow: hidden;
    }
    
    .player-waveform .waveform-img {
        filter: brightness(0.7) grayscale(0.3);
        width: 100%;
        height: 100%;
        object-fit: fill;
        display: block;
    }
    
    .player-actions {
        display: flex;
        gap: 15px;
        margin: 0;
        padding: 0 10px;
        order: 4;
        flex-shrink: 0;
    }
    
    .player-actions .heart-btn,
    .player-actions .share-btn {
        font-size: 14px;
    }
    
    .volume-btn {
        padding: 0 15px;
        margin: 0;
        order: 5;
        font-size: 14px;
        flex-shrink: 0;
    }
    
    /* Volume control position for desktop */
   
}

/* 播放按钮覆盖层 */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    color: white;
    font-size: 20px;
    z-index: 1;
}

/* 鼠标悬停显示按钮 */
.cover-container:hover .play-overlay {
    opacity: 1;
}

/* 播放状态始终显示暂停按钮 */
.cover-container.playing .play-overlay {
    opacity: 1;
}

.cover-container.playing .play-overlay .fa-play {
    display: none;
}

.cover-container.playing .play-overlay .fa-pause {
    display: block;
}

/* 非播放状态显示播放按钮 */
.cover-container:not(.playing) .play-overlay .fa-play {
    display: block;
}

.cover-container:not(.playing) .play-overlay .fa-pause {
    display: none;
}

/* 标签和分类共用样式 */
.item-tags, .item-category {
    color: var(--muted-2-color);
    font-size: 12px;
    margin: 8px 0;
    word-break: break-word; /* 允许在单词内换行 */
    word-wrap: break-word; /* 兼容旧浏览器 */
}

.item-tags a, .item-category a {
    color: var(--muted-2-color);
    text-decoration: none;
    margin-right: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: inline-block; /* 使链接可以换行 */
    margin-bottom: 5px; /* 链接之间的垂直间距 */
}

.item-tags a:hover, .item-category a:hover {
    opacity: 1;
}

.item-tags {
    float: left;
    max-width: 60%; /* 限制最大宽度，避免与分类重叠 */
}

.item-category {
    float: right;
    max-width: 100%; /* 限制最大宽度，避免与标签重叠 */
    text-align: right;
}

.item-author {
    color: var(--muted-2-color);
    font-size: 12px;
    margin: 8px 0;
    float: left;
    max-width: 60%; /* 限制最大宽度，避免与分类重叠 */
}

.item-author a {
    color: var(--muted-2-color);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.item-author a:hover {
    opacity: 1;
}

/* 分类和Mood样式统一 */
.mood a, .instruments a {
    color: var(--muted-2-color);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: inline-block; /* 使链接可以换行 */
}

.mood a:hover, .instruments a:hover {
    opacity: 1;
}

/* 音乐列表中的分类列 */
.music-item .mood, 
.music-item .instruments,
.music-item .length {
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 0 5px;
}