/* 主音乐播放器样式 */
.music-section {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.music-section > * {
    width: 70%;
    max-width: 900px;
}

.music-section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #2c5f7c;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* 音乐标题艺术字 */
.music-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: #000000;
    letter-spacing: 0.3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: musicTitleFloat 3s ease-in-out infinite;
    font-family: 'Arial Black', 'Impact', sans-serif;
}

.music-title::before {
    content: '🎵 MUSIC';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 0, 0, 0.1);
    filter: blur(8px);
    z-index: -1;
}

@keyframes musicTitleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.main-player-container {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4f8 100%);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.main-player-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
}

.main-player-cover-wrapper {
    width: 160px;
    height: 160px;
    min-width: 160px; /* 防止被压缩 */
    min-height: 160px;
    aspect-ratio: 1 / 1; /* 确保1:1比例 */
    margin-bottom: 1rem;
    position: relative;
    flex-shrink: 0;
    border-radius: 50%; /* 容器也设为圆形 */
    overflow: hidden;
}

.main-player-cover {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(135, 206, 235, 0.4);
    border: 3px solid white;
    display: block;
}

.main-player-cover.rotating {
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.main-player-cover.rotating.playing {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.main-player-info {
    text-align: center;
    margin-bottom: 1rem;
    width: 100%;
}

.main-song-name {
    font-size: 1.1rem;
    color: #2c5f7c;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.main-song-artist {
    font-size: 0.9rem;
    color: #7ba3b8;
}

.main-player-controls {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.main-control-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    aspect-ratio: 1 / 1;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: #4a90a4;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.main-control-btn:hover {
    background: linear-gradient(135deg, #98D8C8 0%, #87CEEB 100%);
    color: white;
    transform: scale(1.1);
}

.main-play-btn {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
}

.main-player-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}

.main-time-current,
.main-time-total {
    font-size: 0.75rem;
    color: #7ba3b8;
    min-width: 35px;
}

.main-progress-bar {
    flex: 1;
    height: 5px;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.main-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #87CEEB 0%, #98D8C8 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

/* 播放列表 */
.main-player-right {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e8f4f8;
}

.playlist-header h3 {
    font-size: 1.1rem;
    color: #2c5f7c;
    margin: 0;
}

.playlist-count {
    font-size: 0.85rem;
    color: #7ba3b8;
}

.playlist-container {
    max-height: 240px;
    overflow-y: auto;
}

.playlist-container::-webkit-scrollbar {
    width: 6px;
}

.playlist-container::-webkit-scrollbar-track {
    background: #f0f8ff;
    border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: #98D8C8;
    border-radius: 3px;
}

.playlist-item {
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.playlist-item:hover {
    background: #f0f8ff;
}

.playlist-item.active {
    background: linear-gradient(135deg, #e8f4f8 0%, #d0e8f0 100%);
}

.playlist-item-index {
    width: 25px;
    text-align: center;
    font-size: 0.9rem;
    color: #7ba3b8;
}

.playlist-item.active .playlist-item-index {
    color: #4a90a4;
    font-weight: 600;
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-name {
    font-size: 0.9rem;
    color: #2c5f7c;
    margin-bottom: 0.15rem;
}

.playlist-item-artist {
    font-size: 0.75rem;
    color: #7ba3b8;
}

.playlist-item-duration {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* 歌词面板 */
.lyrics-panel {
    grid-column: 1 / -1;
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e8f4f8;
}

.lyrics-header h3 {
    font-size: 1.1rem;
    color: #2c5f7c;
    margin: 0;
}

.lyrics-toggle {
    background: linear-gradient(135deg, #e8f4f8 0%, #d0e8f0 100%);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #4a90a4;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.lyrics-toggle:hover {
    background: linear-gradient(135deg, #98D8C8 0%, #87CEEB 100%);
    color: white;
}

.lyrics-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative;
}

.lyrics-content.expanded {
    max-height: 400px;
    overflow-y: auto;
    padding: 3rem 0; /* 上下留白，让歌词可以滚动到中间 */
}

.lyrics-content::-webkit-scrollbar {
    width: 6px;
}

.lyrics-content::-webkit-scrollbar-track {
    background: #f0f8ff;
    border-radius: 3px;
}

.lyrics-content::-webkit-scrollbar-thumb {
    background: #98D8C8;
    border-radius: 3px;
}

.lyrics-content::-webkit-scrollbar-thumb:hover {
    background: #87CEEB;
}

/* 歌词行样式 - 网易云风格 */
.lyrics-line {
    padding: 0.8rem 1rem;
    color: #a0aec0;
    font-size: 0.95rem;
    line-height: 2;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.4;
    transform: scale(0.95);
    cursor: pointer;
    user-select: none;
}

/* 当前播放的歌词 */
.lyrics-line.active {
    color: #2c5f7c;
    font-weight: 700;
    font-size: 1.15rem;
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 1px 3px rgba(44, 95, 124, 0.1);
}

/* 即将播放的歌词（下一句） */
.lyrics-line.active + .lyrics-line {
    opacity: 0.7;
    color: #7ba3b8;
    transform: scale(0.98);
}

/* 刚播放过的歌词（上一句） */
.lyrics-line.active ~ .lyrics-line:not(.active) {
    opacity: 0.3;
}

/* 鼠标悬停效果 */
.lyrics-line:hover {
    opacity: 0.8;
    color: #4a90a4;
}

/* 歌词渐变遮罩效果（顶部和底部） */
.lyrics-content.expanded::before,
.lyrics-content.expanded::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 1;
}

.lyrics-content.expanded::before {
    top: 0;
    background: linear-gradient(to bottom, white 0%, transparent 100%);
}

.lyrics-content.expanded::after {
    bottom: 0;
    background: linear-gradient(to top, white 0%, transparent 100%);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .music-section > * {
        width: 85%;
    }
    
    .main-player-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .music-section > * {
        width: 95%;
    }
    
    .main-player-cover-wrapper {
        width: 130px;
        height: 130px;
    }
    
    .main-song-name {
        font-size: 1rem;
    }
    
    .main-control-btn {
        width: 38px;
        height: 38px;
    }
    
    .main-play-btn {
        width: 46px;
        height: 46px;
    }
}
