/**
 * 黑胶唱机播放器样式
 * 复古收音机造型，播放时唱片旋转
 */

/* 播放器容器 */
.vinyl-player {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 280px;
    background: linear-gradient(145deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 16px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
}

/* 播放器折叠 */
.vinyl-player.collapsed {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
}

.vinyl-player.collapsed .player-content {
    display: none;
}

/* 折叠时的图标 */
.vinyl-player.collapsed::after {
    content: '🎵';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

/* 播放器头部 */
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(90deg, #3d3d3d 0%, #2c2c2c 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.player-title {
    font-size: 0.75rem;
    color: #f39c12;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
}

.player-playing .player-title::before {
    background: #2ecc71;
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.player-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.player-close:hover {
    color: #fff;
}

/* 播放器内容 */
.player-content {
    padding: 20px;
}

/* 唱片区域 */
.record-area {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
}

/* 唱片 */
.record {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        #1a1a1a 0%,
        #2d2d2d 20%,
        #1a1a1a 40%,
        #3d3d3d 60%,
        #1a1a1a 80%,
        #2d2d2d 100%
    );
    box-shadow:
        0 4px 15px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

/* 唱片旋转动画 */
.record-spinning {
    animation: spin 2s linear infinite;
}

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

/* 唱片中心标签 */
.record-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.record-label::after {
    content: '';
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    border-radius: 50%;
    border: 2px solid #888;
}

/* 唱片纹理 */
.record::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 4px
    );
}

/* 唱针 */
.tonearm {
    position: absolute;
    top: 10px;
    right: 5px;
    width: 60px;
    height: 100px;
    transform-origin: 85% 10%;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tonearm-base {
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: #888;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.tonearm-rod {
    position: absolute;
    top: 8px;
    right: 6px;
    width: 4px;
    height: 80px;
    background: linear-gradient(180deg, #999 0%, #666 100%);
    border-radius: 2px;
    transform: rotate(-30deg);
    transform-origin: top center;
}

.tonearm-head {
    position: absolute;
    bottom: -5px;
    left: -8px;
    width: 15px;
    height: 10px;
    background: #666;
    border-radius: 2px;
}

/* 唱针落下状态 */
.vinyl-player.player-playing .tonearm {
    transform: rotate(15deg);
}

/* 当前歌曲信息 */
.now-playing {
    text-align: center;
    margin-bottom: 15px;
}

.now-playing-label {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.now-playing-title {
    font-size: 0.9rem;
    color: #fff;
    font-weight: normal;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #3d3d3d;
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #f39c12 100%);
    border-radius: 2px;
    width: 35%;
    transition: width 0.3s ease;
}

/* 控制按钮 */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.control-btn.play-pause {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
}

.control-btn.play-pause:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* 音量指示器 */
.volume-indicator {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.volume-bar {
    width: 4px;
    height: 12px;
    background: #3d3d3d;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.volume-bar.active {
    background: linear-gradient(180deg, #f39c12 0%, #e74c3c 100%);
}

.volume-indicator.playing .volume-bar {
    animation: volume-dance 0.5s ease-in-out infinite alternate;
}

.volume-indicator.playing .volume-bar:nth-child(1) { animation-delay: 0s; }
.volume-indicator.playing .volume-bar:nth-child(2) { animation-delay: 0.1s; }
.volume-indicator.playing .volume-bar:nth-child(3) { animation-delay: 0.2s; }
.volume-indicator.playing .volume-bar:nth-child(4) { animation-delay: 0.3s; }
.volume-indicator.playing .volume-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes volume-dance {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1.2); }
}

/* 播放列表展开按钮 */
.playlist-toggle {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c2c2c;
    border: none;
    color: #888;
    padding: 6px 16px;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.playlist-toggle:hover {
    color: #fff;
    background: #3d3d3d;
}

/* 播放列表 */
.playlist {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #222;
    margin-top: 10px;
    border-radius: 8px;
}

.playlist.expanded {
    max-height: 200px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background: rgba(255,255,255,0.05);
}

.playlist-item.active {
    background: rgba(231, 76, 60, 0.2);
}

.playlist-item .record-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #333;
    margin-right: 10px;
    flex-shrink: 0;
}

.playlist-item .song-title {
    font-size: 0.8rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item.active .song-title {
    color: #e74c3c;
}

/* 滚动条样式 */
.playlist::-webkit-scrollbar {
    width: 6px;
}

.playlist::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

/* 移动端适配 */
@media (max-width: 480px) {
    .vinyl-player {
        bottom: 70px;
        right: 10px;
        width: 260px;
    }
    .record-area {
        width: 150px;
        height: 150px;
    }
}
