/**
 * 自定义音乐播放器样式
 * 控制歌曲名称显示的位置、样式和动画效果
 */

/* 歌曲标题的基本样式 */
#song-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw; /* 增加宽度 */
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: white;
    font-family: 'Jura', 'Microsoft YaHei', sans-serif;
    font-size: calc(30vh * 0.3); /* 缩小字体 */
    z-index: 1000;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-shadow: 8px 8px 16px rgba(0, 0, 0, 0.7);
    white-space: nowrap; /* 不自动换行 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
}

/* 当添加show类时，标题变为可见 */
#song-title.show {
    opacity: 1;
}

.song-title-tip {
    position: fixed;
    top: 32%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: white;
    font-family: 'Jura', 'Microsoft YaHei', sans-serif;
    font-size: calc(30vh * 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-shadow: 8px 8px 16px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
}

.song-title-tip.show {
    opacity: 1;
}

.song-title-tip, #song-title {
    pointer-events: none;
}

/* 播放历史记录样式 */
.play-history {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    max-width: 600px;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    color: white;
    font-family: 'Jura', 'Microsoft YaHei', sans-serif;
    font-size: 18px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.play-history.show {
    opacity: 1;
}

.history-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.history-item {
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    user-select: none;
    position: relative;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.history-item.selected {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    color: #4CAF50;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.history-item.selected:hover {
    background: rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

.history-item:active {
    transform: translateX(5px) scale(0.98);
    transition: transform 0.1s ease-in-out;
}

/* 滚动条样式 */
.play-history::-webkit-scrollbar {
    width: 8px;
}

.play-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.play-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.play-history::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
