:root {
    --bg-color: #050608;
    --neon-cyan: #00f2ff;
    --neon-magenta: #ff007f;
    --neon-purple: #b53cff;
    --glass-bg: rgba(15, 10, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --font-cyber: 'Orbitron', sans-serif;
    --font-normal: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-normal);
}

/* ==========================================
   WebGL Canvas 背景
   ========================================== */
#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    /* 极致高斯模糊，融合液态极光，防止任何线条撕裂，消除突发亮暗 */
    filter: blur(50px) saturate(1.35);
    transform: scale(1.08); /* 补偿边缘 */
}

#spectre-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: block;
    pointer-events: none; 
}

/* ==========================================
   进场遮罩 Intro Overlay
   ========================================== */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a0b2e 0%, #050508 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.intro-content {
    text-align: center;
}

/* Glitch 文字效果 */
.glitch-text {
    font-family: var(--font-cyber);
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 15px;
}

.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-magenta);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(100px, 450px, 120px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.intro-subtitle {
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--neon-cyan);
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.glow-pulse {
    font-size: 2.5rem;
    color: var(--neon-magenta);
    text-shadow: 0 0 15px var(--neon-magenta);
    animation: pulse 1.5s infinite ease-in-out;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 25px var(--neon-magenta); }
}


/* ==========================================
   主应用容器
   ========================================== */
#app {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#app.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================
   卡片式播放器核心 Player Card
   ========================================== */
#player-container {
    perspective: 1000px;
    z-index: 20;
}

.player-card {
    width: 380px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-card:hover {
    box-shadow: 0 0 30px rgba(181, 60, 255, 0.15),
                0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* 专辑封面 */
.cover-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 25px;
    position: relative;
    border-radius: 50%;
}

#cover-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    animation: rotate 20s infinite linear;
    animation-play-state: paused; /* 默认暂停 */
}

/* 播放时的旋转类 */
.playing #cover-img {
    animation-play-state: running;
}

.glow-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-cyan);
    border-bottom-color: var(--neon-magenta);
    opacity: 0.6;
    animation: rotate-reverse 10s infinite linear;
}

/* 歌曲信息 */
.song-info {
    margin-bottom: 25px;
}

#song-title {
    font-family: var(--font-cyber);
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

#album-title {
    font-size: 0.85rem;
    color: var(--neon-cyan);
    font-weight: 300;
    opacity: 0.8;
}

/* 进度条 */
.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-cyber);
}

.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 3px;
    position: relative;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.progress-handle {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%; /* JS 动态改变 */
    box-shadow: 0 0 8px var(--neon-cyan);
    transition: transform 0.1s;
}

.progress-track:hover .progress-handle {
    transform: translate(-50%, -50%) scale(1.2);
}

/* 操控区 */
.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 25px;
}

.btn-ctrl {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-ctrl:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.btn-play {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta));
    color: #fff;
    font-size: 1.3rem;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--neon-magenta);
}

.btn-play:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--neon-magenta);
}

/* 社交平台 */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.social-icon {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: all 0.3s;
}

.social-icon.netease {
    color: #e60026;
    text-shadow: 0 0 8px rgba(230, 0, 38, 0.4);
}

.social-icon.spotify {
    color: #1DB954;
    text-shadow: 0 0 8px rgba(29, 185, 84, 0.4);
}

.social-icon:hover {
    transform: translateY(-3px);
}

.footer-copyright {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
    opacity: 0.7;
    letter-spacing: 0.04em;
    font-family: var(--font-sub);
}

.progress-fill, .progress-handle {
    transition: none !important; /* 强制依靠 JS 的 60fps 阻尼缓动 */
}

.social-icon.netease:hover {
    color: #e60026;
    text-shadow: 0 0 10px #e60026;
}

.social-icon.spotify:hover {
    color: #1DB954;
    text-shadow: 0 0 10px #1DB954;
}

/* ==========================================
   歌单抽屉 Drawer (更新为悬浮 & Bottom Sheet)
   ========================================== */
#drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 490;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#songs-drawer {
    position: fixed;
    top: 10vh; /* 悬浮状态 */
    right: -340px; 
    width: 300px;
    height: 80vh;
    background: rgba(20, 15, 35, 0.45);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--neon-purple);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(181, 60, 255, 0.25);
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    z-index: 500;
    overflow: hidden;
}

#songs-drawer.open {
    right: 30px; /* 侧边悬浮出位 */
}

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

.drawer-header h3 {
    font-family: var(--font-cyber);
    color: var(--neon-cyan);
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(0,242,255,0.4);
}

#close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.song-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.song-list-container::-webkit-scrollbar { width: 4px; }
.song-list-container::-webkit-scrollbar-thumb { background: var(--neon-purple); border-radius: 2px; }

.song-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(181, 60, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(40px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    transition-delay: calc(var(--delay, 0) * 0.04s);
}

/* 抽屉打开时，启动 Staggered 级联动画 */
#songs-drawer.open .song-item {
    transform: translateX(0);
    opacity: 1;
}

.song-item:hover {
    background: rgba(0, 242, 255, 0.05);
    color: var(--neon-cyan);
}

.song-item.active {
    background: rgba(181, 60, 255, 0.12);
    color: var(--neon-magenta);
    border-left: 3px solid var(--neon-magenta);
}

.song-index {
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 25px;
}

.song-item-title {
    font-size: 0.9rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 手机端响应式 Bottom Sheet 底部抽屉 */
@media (max-width: 480px) {
    #songs-drawer {
        top: auto;
        bottom: -62vh; /* 默认向下隐藏 */
        right: 0 !important; 
        width: 100%;
        height: 60vh; /* 只覆盖下侧 60% */
        border-radius: 24px 24px 0 0;
        border-left: none;
        border-top: 2px solid var(--neon-purple);
        transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    #songs-drawer.open {
        bottom: 0; /* 弹上来 */
        right: 0;
    }

    .song-item {
        transform: translateY(30px); /* 手机端自下而上滑入 */
    }

    #songs-drawer.open .song-item {
        transform: translateY(0);
    }
}

/* ==========================================
   一键分享海报 Share Modal
   ========================================== */
#share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.hidden-modal {
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-box {
    position: relative;
    background: rgba(15, 10, 25, 0.9);
    border: 1px solid var(--neon-purple);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px var(--neon-purple);
    z-index: 1010;
}

#close-modal-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    background: var(--bg-color);
    border-radius: 50%;
}

#poster-container {
    background: #000;
    min-height: 480px; /* 预估比例 */
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#poster-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.share-hint {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    margin-top: 10px;
    font-family: var(--font-cyber);
    letter-spacing: 1px;
}

/* ==========================================
   响应式设计 Media Queries (适配手机)
   ========================================== */
@media (max-width: 480px) {
    .player-card {
        width: 90vw;
        padding: 20px;
        border-radius: 20px;
    }
    
    .cover-wrapper {
        width: 160px;
        height: 160px;
    }
    
    #song-title {
        font-size: 1.2rem;
    }
    
    .btn-ctrl {
        font-size: 1rem;
    }
    
    .btn-play {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    #poster-container {
        min-height: 400px;
    }
}

/* ==========================================
   Keyframes
   ========================================== */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes glitch-anim {
    0% { clip: rect(2px, 9999px, 31px, 0); }
    20% { clip: rect(44px, 9999px, 16px, 0); }
    40% { clip: rect(81px, 9999px, 99px, 0); }
    60% { clip: rect(11px, 9999px, 58px, 0); }
    80% { clip: rect(76px, 9999px, 35px, 0); }
    100% { clip: rect(23px, 9999px, 83px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(12px, 9999px, 12px, 0); }
    40% { clip: rect(45px, 9999px, 55px, 0); }
    60% { clip: rect(32px, 9999px, 78px, 0); }
    80% { clip: rect(98px, 9999px, 11px, 0); }
    100% { clip: rect(14px, 9999px, 44px, 0); }
}

.progress-fill, .progress-handle { transition: width 0.15s linear, left 0.15s linear; }
body.dragging .progress-fill, body.dragging .progress-handle { transition: none !important; }

.progress-bar-wrapper { display: flex; align-items: center; gap: 12px; }
#current-time { display: inline-block; width: 45px; text-align: right; font-variant-numeric: tabular-nums; }
#duration-time { display: inline-block; width: 45px; text-align: left; font-variant-numeric: tabular-nums; }

#album-title { font-family: 'Orbitron', 'PingFang SC', sans-serif !important; font-size: 0.82rem !important; color: #00f2ff !important; text-shadow: 0 0 8px rgba(0, 242, 255, 0.45); opacity: 0.88; letter-spacing: 0.04em; margin-top: 4px; }

/* 方案 A: 邮箱图标悬停效果 */
.social-icon.mail:hover {
    color: var(--neon-cyan) !important;
    text-shadow: 0 0 10px var(--neon-cyan);
}


