/* 基础样式 */
:root {
    --primary-color: #00ffcc; /* 赛博朋克主色调 */
    --secondary-color: #ff00ff; /* 赛博朋克辅助色 */
    --bg-color: #0a0a12; /* 深色背景 */
    --surface-color: #1a1a2e; /* 表面颜色 */
    --text-color: #e0e0e0; /* 文本颜色 */
    --accent-color: #ff006e; /* 强调色 */
    --neon-pink: #ff00c8; /* 霓虹粉色 */
    --gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* 紫色主题 */
[data-theme="purple"] {
    --primary-color: #b794f6;
    --secondary-color: #9f7aea;
    --accent-color: #805ad5;
    --gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* 蓝色主题 */
[data-theme="blue"] {
    --primary-color: #63b3ed;
    --secondary-color: #4299e1;
    --accent-color: #3182ce;
    --gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* 绿色主题 */
[data-theme="green"] {
    --primary-color: #68d391;
    --secondary-color: #48bb78;
    --accent-color: #38a169;
    --gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    zoom: 0.85;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.header-left {
    display: flex;
    align-items: center;
}

h1 {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    display: flex;
    align-items: center;
}

#emoji-subtitle {
    font-size: 1.2rem;
    margin-left: 15px;
    color: var(--text-color);
    opacity: 0.8;
}

.theme-selector {
    display: flex;
    gap: 10px;
}

.theme-btn {
    padding: 8px 15px;
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.theme-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* 主内容区域 */
main {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 播放器部分 */
.player-section {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 12px 15px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.player-info {
    text-align: center;
    margin-bottom: 10px;
}

.song-info-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
}

.song-title {
    font-size: 1.8rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.song-title:hover {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
}

.artist-name {
    font-size: 1.2rem;
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color), 0 0 10px var(--secondary-color);
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.artist-name:hover {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
}

/* 加载状态指示器 */
.loading-indicator {
    margin-top: 10px;
    text-align: center;
}

.loading-text {
    color: var(--primary-color);
    font-size: 1rem;
    text-shadow: 0 0 5px var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    animation: blink 1.5s infinite;
}

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

/* 控制按钮 */
.control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

.control-buttons-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 40px;
    border-radius: 8px; /* 改为方形按钮，但保持轻微圆角 */
    background-color: var(--surface-color);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.control-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-color);
}

.play-btn {
    width: 60px;
    height: 50px;
    font-size: 1.2rem;
    border-radius: 10px; /* 播放按钮也改为方形但保持更大圆角 */
}

/* 频谱可视化 */
.visualizer {
    height: 50px;
    width: 500px;
    margin: 0 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#visualizer {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
}

/* 音量控制 */
.volume-container {
    display: flex;
    align-items: center;
    width: 150px;
    flex-shrink: 0;
}

.volume-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.volume-slider {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.volume-bar {
    height: 100%;
    width: 100%;
    position: relative;
}

.volume {
    height: 100%;
    width: 70%;
    background: var(--gradient);
    border-radius: 4px;
}

/* 进度条 */
.progress-container {
    margin-bottom: 15px;
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-text {
    font-size: 0.9rem;
    color: var(--text-color);
    min-width: 35px;
    text-align: center;
}

.time-display {
    display: none;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -3.5px;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.progress-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    margin-top: -3.5px;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

/* 频谱可视化 */
.visualizer {
    height: 60px;
    margin-top: 20px;
}

#visualizer {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
}

/* 内容包装器 - 左右布局 */
.content-wrapper {
    display: flex;
    gap: 15px;
    flex: 1;
    max-height: calc(100vh - 300px);
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        max-height: unset;
    }
    
    /* 隐藏频谱显示 */
    .visualizer {
        display: none;
    }
    
    /* 隐藏主题切换按钮 */
    .theme-selector {
        display: none;
    }
    
    /* 隐藏emoji副标题 */
    #emoji-subtitle {
        display: none;
    }
}

/* 播放列表部分 */
.playlist-section {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.2);
    border: 1px solid rgba(255, 0, 110, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.playlist-selector {
    min-width: 150px;
    flex: 1;
}

.playlist-select {
    padding: 8px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    color: var(--text-color);
    width: 100%;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
}

.playlist-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.playlist-select option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.search-box {
    display: flex;
    gap: 10px;
    min-width: 200px;
    max-width: 300px;
}

#search-input {
    padding: 8px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    color: var(--text-color);
    width: 100%;
    outline: none;
    font-family: 'Arial', sans-serif;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

#search-btn {
    padding: 8px 15px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
}

#search-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary-color);
}

.playlist {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: calc(100vh - 360px);
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1);
    /* 防止播放列表滚动影响页面滚动 */
    overscroll-behavior: contain;
}

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

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.playlist-item {
    padding: 8px 10px;
    background-color: var(--bg-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.playlist-item.active {
    background-color: rgba(0, 255, 204, 0.1);
    border-left-color: var(--primary-color);
}

.playlist-item-info {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    gap: 8px;
}

.playlist-item-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-size: 0.8rem;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 歌词部分 */
.lyrics-section {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
    border: 1px solid rgba(255, 0, 255, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lyrics-container {
    flex: 1;
    overflow-y: auto;
    text-align: center;
    padding: 20px 5px 20px 0;
    /* 恢复最大高度，确保容器可以正确滚动 */
    max-height: calc(100vh - 240px);
    /* 移除之前添加的flex属性，避免影响滚动 */
}

.lyrics-container::-webkit-scrollbar {
    width: 8px;
}

.lyrics-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.lyrics-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.lyrics-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.lyrics-line {
    margin-bottom: 15px;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    padding: 0 10px;
    width: 100%;
}

.lyrics-line.active {
    font-size: 1.3rem;
    opacity: 1;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    opacity: 0.7;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
