/* 极简设计系统 */
:root {
    --bg: #000;
    --text: #fff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-subtle: rgba(255, 255, 255, 0.3);
    --accent: #fff;
    --accent-glow: rgba(255, 255, 255, 0.8);
    --transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --transition-fast: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    cursor: default;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 主容器 */
.player {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 背景层 - 增强沉浸感 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(120px) brightness(0.2) saturate(1.2);
    transform: scale(1.1);
    opacity: 0;
    transition: opacity 3s ease;
    z-index: -1;
}

.bg-layer.active {
    opacity: 1;
}

/* 背景渐变遮罩 */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: -1;
    pointer-events: none;
}

/* 遮罩层 (侧边栏打开时) */
.backdrop-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    opacity: 0; pointer-events: none; transition: opacity 0.4s; z-index: 90;
}
.backdrop-overlay.show { opacity: 1; pointer-events: auto; }

/* 主内容区 - 增加留白 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
}

/* 播放器内容容器 */
.player-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    transition: var(--transition);
}

/* 专辑封面 - 增强视觉效果 */
.artwork {
    width: min(70vw, 320px);
    height: min(70vw, 320px);
    border-radius: 12px;
    margin-bottom: 40px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: var(--shadow-strong);
}

.artwork::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-fast);
    pointer-events: none;
}

.artwork:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
}

.artwork:hover::before {
    opacity: 1;
}

.artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.artwork img.loaded {
    opacity: 1;
}

/* 歌曲信息和歌词容器 */
.track-info-lyrics {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 40px;
}

/* 歌曲信息 - 优化排版 */
.track-info {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.4s;
}

.track-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--text), var(--text-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.track-artist {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
    transition: color 0.2s;
}
.track-artist:hover { color: #fff; text-decoration: underline; }

/* 歌词显示 - 增强视觉效果 */
.lyrics {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
    animation-delay: 0.6s;
    position: relative;
}

.lyric-line {
    font-size: 18px;
    color: var(--text-subtle);
    transition: var(--transition);
    padding: 0 30px;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.4;
    position: relative;
}

.lyric-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    width: 2px;
    height: 1px;
    background: var(--text-subtle);
    opacity: 0.5;
}

.lyric-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    width: 2px;
    height: 1px;
    background: var(--text-subtle);
    opacity: 0.5;
}

.lyric-line.active {
    color: var(--text);
    font-size: 20px;
    font-weight: 300;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.lyric-line.active::before,
.lyric-line.active::after {
    width: 2px;
    background: var(--text);
    opacity: 0.8;
}

/* 控制区 - 增强设计感 */
.controls {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
    transition: var(--transition);
}

/* 进度条 - 优化设计 */
.progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
    animation-delay: 0.7s;
}

.time {
    font-size: 12px;
    color: var(--text-subtle);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-glow));
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s linear;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    opacity: 0;
    transition: var(--transition-fast);
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

/* 播放控制按钮 - 增强设计感 */
.play-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.8s;
}

.btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0;
    position: relative;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: -1;
}

.btn:hover {
    transform: scale(1.1);
    color: var(--accent-glow);
}

.btn:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.btn:active {
    transform: scale(0.95);
}

.btn-small {
    font-size: 22px;
    opacity: 0.7;
    width: 36px;  
    height: 36px;
    display: flex; 
    align-items: center;
    justify-content: center;
}

.btn-small:hover {
    opacity: 1;
}

.btn-play {
    font-size: 46px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play::before {
    width: 60px;
    height: 60px;
}

/* 播放列表按钮 - 优化设计 */
.playlist-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1s;
}

.playlist-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.25);
}

/* 分享按钮 - 优化设计 */
.share-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.1s;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.25);
}

/* 播放列表 - 增强设计感 */
.playlist {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(30px);
    transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist.open {
    left: 0;
}

.playlist-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-title {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.playlist-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.playlist-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.playlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.playlist-item {
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

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

.playlist-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item-index {
    width: 24px;
    text-align: center;
    color: var(--text-subtle);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.playlist-item.active .playlist-item-index {
    color: var(--accent);
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.playlist-item-artist {
    font-size: 12px;
    color: var(--text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-playing {
    width: 18px;
    height: 18px;
    display: none;
}

.playlist-item.active .playlist-item-playing {
    display: block;
}

.playlist-item.active .playlist-item-index {
    display: none;
}

/* 返回全部专辑按钮 */
.back-to-albums {
    display: flex; align-items: center; gap: 8px;
    padding: 12px; margin-bottom: 10px; border-radius: 8px;cursor: pointer;
    font-size: 13px; color: #ffffff; transition: 0.2s;
}
.back-to-albums:hover { 
    font-weight: 500;
}

/* 列表项 */
.list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: 8px; cursor: pointer; transition: 0.2s; margin-bottom: 4px;
}
.list-item:hover { background: rgba(100, 100, 255, 0.05); }
.list-item.active  {
    background: rgba(100, 100, 255, 0.1);
    border-left: 3px solid #a0a0ff; 
}
.list-item.active .list-title { color: var(--accent); font-weight: 500;}

.list-img { width: 44px; height: 44px; border-radius: 4px; background: #333; object-fit: cover; }
.list-text { flex: 1; min-width: 0; }
.list-title { font-size: 14px; margin-bottom: 2px; color: rgba(255,255,255,0.9); }
/* 专辑视图中不显示序号，歌曲视图显示 */
.list-index { width: 20px; font-size: 12px; color: var(--text-dim); text-align: center; }

/* 歌词面板 */
.lyrics-panel {
    position: fixed; top: 0; right: -400px; width: 100%; max-width: 400px; height: 100%;
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(30px);
    z-index: 100; transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255,255,255,0.1);
    display: flex; flex-direction: column;
}
.lyrics-panel.open { right: 0; }

.lyrics-content {
    flex: 1; overflow-y: auto; padding: 40px 30px;
    text-align: center; font-size: 16px; line-height: 2.2; color: var(--text-dim);
}
.lyrics-content p { margin: 12px 0; user-select: text; }

/* 分享提示框 - 优化设计 */
.share-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 0;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    max-width: 90%;
    width: 400px;
    overflow: hidden;
}

.share-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.share-toast-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-toast-title {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-toast-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.share-toast-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.share-toast-body {
    padding: 20px 25px;
}

.share-toast-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--text);
}

.share-toast-link-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
    position: relative;
}

.share-toast-link {
    font-size: 14px;
    color: var(--text-dim);
    word-break: break-all;
    line-height: 1.4;
    padding-right: 40px;
}

.share-toast-copy-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.share-toast-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.share-toast-copy-btn.copied {
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.share-toast-footer {
    padding: 15px 25px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-toast-countdown {
    font-size: 13px;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown-circle {
    width: 40px;
    height: 40px;
    position: relative;
}

.countdown-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-circle circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.countdown-circle .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.countdown-circle .progress {
    stroke: var(--accent);
    stroke-dasharray: 113;
    stroke-dashoffset: 113;
    transition: stroke-dashoffset 1s linear;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 500;
}

/* 简单提示 */
.toast {
    position: fixed; top: 40px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: rgba(30,30,30,0.95); padding: 10px 24px; border-radius: 20px;
    font-size: 13px; color: #fff; opacity: 0; pointer-events: none; transition: 0.3s;
    display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.15); z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 动画 */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    .main {
        padding: 30px 15px;
    }

    .artwork {
        width: min(75vw, 280px);
        height: min(75vw, 280px);
        margin-bottom: 30px;
    }

    .track-title {
        font-size: 24px;
    }

    .track-artist {
        font-size: 14px;
    }

    .lyric-line {
        font-size: 16px;
        padding: 0 15px;
    }

    .lyric-line.active {
        font-size: 18px;
    }

    .play-controls {
        gap: 30px;
    }

    .btn-small {
        font-size: 20px;
    }

    .btn-play {
        font-size: 42px;
        width: 42px;
        height: 42px;
    }

    .playlist-btn, .share-btn {
        bottom: 20px;
        width: 45px;
        height: 45px;
    }

    .playlist-btn {
        left: 20px;
    }

    .share-btn {
        right: 20px;
    }

    .playlist {
        width: 100%;
        left: -100%;
    }

    .main.playlist-open {
        transform: translateX(100%);
    }

    .share-toast {
        width: 95%;
        max-width: 350px;
    }

    .share-toast-header {
        padding: 15px 20px 10px;
    }

    .share-toast-body {
        padding: 15px 20px;
    }

    .share-toast-footer {
        padding: 10px 20px 15px;
    }
}

/* 响应式 - 平板和桌面端 */
@media (min-width: 769px) {
    .main {
        padding: 60px 40px;
    }

    .player-content {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 80px;
        max-width: 920px;
    }

    .artwork {
        width: min(32vw, 380px);
        height: min(32vw, 380px);
        margin-bottom: 0;
    }

    .track-info-lyrics {
        max-width: 500px;
        margin-bottom: 0;
        align-items: center;
        text-align: center;
    }

    .track-info {
        text-align: center;
        margin-bottom: 40px;
    }

    .lyrics {
        justify-content: center;
    }

    .controls {
        margin-top: 60px;
        max-width: 920px;
    }

    .playlist-btn, .share-btn {
        bottom: 50px;
        width: 56px;
        height: 56px;
    }

    .playlist-btn {
        left: 50px;
    }

    .share-btn {
        right: 50px;
    }
}

/* 响应式 - 大屏幕 */
@media (min-width: 1200px) {
    .player-content {
        max-width: 1100px;
        gap: 100px;
    }

    .artwork {
        width: min(28vw, 420px);
        height: min(28vw, 420px);
    }

    .track-info-lyrics {
        max-width: 600px;
    }

    .track-title {
        font-size: 36px;
    }

    .track-artist {
        font-size: 20px;
    }

    .lyric-line {
        font-size: 24px;
    }

    .lyric-line.active {
        font-size: 28px;
    }

    .controls {
        max-width: 1100px;
    }
}

/* 触摸优化 */
@media (hover: none) {
    .btn:active {
        transform: scale(0.9);
    }
}

/* 自定义滚动条样式 */
.playlist-content::-webkit-scrollbar,
.lyrics-content::-webkit-scrollbar {
    width: 4px; /* 滚动条宽度 */
}

.playlist-content::-webkit-scrollbar-track,
.lyrics-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); /* 滚动条轨道背景 */
    border-radius: 2px;
}

.playlist-content::-webkit-scrollbar-thumb,
.lyrics-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); /* 滚动条滑块颜色 */
    border-radius: 2px;
    transition: background 0.3s ease;
}

.playlist-content::-webkit-scrollbar-thumb:hover,
.lyrics-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3); /* 悬停时滑块颜色 */
}

/* Firefox 滚动条样式 */
.playlist-content,
.lyrics-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}