:root[data-theme="light"],
:root {
    --bg-color: #f0f0f0;
    --player-bg: white;
    --text-color: #333;
    --button-text: #4CAF50;
    --progress-bg: #ddd;
    --translucent-bg: rgba(255, 255, 255, 0.5);
    --button-bg: var(--translucent-bg);
    --lyrics-bg: var(--translucent-bg);
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --player-bg: #2d2d2d;
    --text-color: #ffffff;
    --button-text: #66bb6a;
    --progress-bg: #404040;
    --translucent-bg: rgba(45, 45, 45, 0.8);
    --button-bg: var(--translucent-bg);
    --lyrics-bg: var(--translucent-bg);
}

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

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.music-player {
    position: relative;
    width: 400px;
    height: 700px;
    background: var(--player-bg);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: background-color 0.3s;
    min-width: 400px;
    max-width: 400px;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px);
    opacity: 0.4;
    z-index: 1;
    display: block;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

/* 暗色主题时的背景透明度 */
:root[data-theme="dark"] .background {
    opacity: 0.3;
}

/* 亮色主题时的背景透明度 */
:root[data-theme="light"] .background {
    opacity: 0.4;
}

.player-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.top-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.song-info {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
    width: 100%;
}

.song-title {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: var(--text-color);
    opacity: 0.75;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.artist {
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.65;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.controls button,
#themeBtn,
#speedBtn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--translucent-bg);
    color: var(--button-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

.controls button:hover,
#themeBtn:hover,
#speedBtn:hover {
    transform: scale(1.05);
    background: var(--translucent-bg);
    color: var(--button-text);
}

.controls button:active,
#themeBtn:active,
#speedBtn:active {
    transform: scale(0.95);
    background: var(--translucent-bg);
    color: var(--button-text);
}

.controls button:disabled,
#themeBtn:disabled,
#speedBtn:disabled {
    background: var(--translucent-bg);
    color: var(--button-text);
    opacity: 0.7;
    cursor: not-allowed;
}

.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: var(--progress-bg);
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
}

.progress {
    width: 0%;
    height: 100%;
    background: var(--button-text);
    border-radius: 5px;
    pointer-events: none;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--button-text);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.progress-bar:hover .progress::after {
    transform: translateY(-50%) scale(1.2);
}

.time {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    color: var(--text-color);
    opacity: 0.5;
}

.lyrics {
    flex: 1;
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    background: var(--lyrics-bg);
    border-radius: 10px;
    transition: background-color 0.3s;
    scroll-behavior: smooth;
    height: 350px;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    box-sizing: border-box;
}

/* 默认歌词文本样式 */
.lyrics p {
    padding: 6px 0;
    transition: all 0.3s ease-in-out;
    opacity: 0.5;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    border-radius: 15px;
    padding: 10px 15px;
    width: 100%;
    margin: 6px 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

/* 隐藏 Webkit 浏览器的滚动条 */
.lyrics::-webkit-scrollbar {
    display: none;
}

.lyric-line {
    padding: 10px 15px;
    transition: all 0.3s ease-in-out;
    opacity: 0.5;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    border-radius: 15px;
    width: 100%;
    margin: 6px 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-sizing: border-box;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.lyric-line.active {
    opacity: 1;
    font-size: 16px;
    color: var(--button-text);
    transform: scale(1.1);
}

/* 删除之前的滚动条相关样式 */
.lyrics::-webkit-scrollbar-track,
.lyrics::-webkit-scrollbar-thumb,
.lyrics::-webkit-scrollbar-thumb:hover {
    display: none;
}

.theme-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
}

#themeBtn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--translucent-bg);
    color: var(--button-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

/* 修改倍速控制样式 */
.speed-control {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
}

#speedBtn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--translucent-bg);
    color: var(--button-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.speed-options {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--translucent-bg);
    border-radius: 10px;
    z-index: 100;
    padding: 4px;
    width: auto;
    min-width: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 修改连接区域的位置 */
.speed-control::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 5px;
}

.speed-control:hover .speed-options {
    display: block;
}

.speed-option {
    padding: 4px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    white-space: nowrap;
    border-radius: 6px;
    margin: 0 2px;
    opacity: 0.5;
}

.speed-option:hover,
.speed-option.active {
    background: var(--translucent-bg);
    color: var(--button-text);
    opacity: 1;
}

/* 修改主题切换按钮样式 */
#themeBtn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--translucent-bg);
    color: var(--button-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

/* 移除统一按钮样式中的 min-width */
/* 删除或注释掉这部分 */
/* #speedBtn, #themeBtn {
    min-width: 80px;
    text-align: center;
} */

.speed-options {
    box-shadow: none;
}

.speed-option:hover,
.speed-option.active {
    background: var(--translucent-bg);
    color: var(--button-text);
    opacity: 1;
}

/* 播放/暂停按钮稍大一些 */
#playBtn {
    width: 50px;
    height: 50px;
}

/* 图标样式 */
.controls button i,
#themeBtn i,
#speedBtn i {
    font-size: 24px;
}

#playBtn i {
    font-size: 30px;
}

/* 添加歌词容器的内部包装 */
.lyrics-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding-top: 117px;
    padding-bottom: 233px;
    position: relative;
}

.lyrics-container {
    flex: 1;
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    text-align: center;
    background: var(--lyrics-bg);
    border-radius: 10px;
    height: 350px;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lyrics-container::-webkit-scrollbar {
    display: none;
}

.lyrics-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding-top: 117px;
    padding-bottom: 233px;
    position: relative;
}

.lyrics-line {
    margin: 20px 0;
    font-size: 16px;
    line-height: 24px;
    color: var(--text-color);
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.lyrics-line .line-content {
    position: relative;
    display: inline-block;
}

.lyrics-line .line-bg {
    color: var(--text-color);
}

.lyrics-line .line-fill {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--button-text);
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    transition: width 0.1s linear;
}

.lyrics-line.active .line-bg {
    opacity: 0.5;
}

.lyrics-line.active .line-fill {
    opacity: 1;
}

.lyrics-line:not(.active) .line-bg {
    opacity: 0.5;
}