body {
    font-family: Arial, sans-serif; /* 设置字体为 Arial，备用字体为 sans-serif */
    margin: 0; /* 移除默认外边距 */
    padding: 0; /* 移除默认内边距 */
    background-color: #f7f7f7; /* 设置背景颜色 */
    color: #333; /* 设置文本颜色 */
}

header {
    background: linear-gradient(135deg, #FF6F61, #D32F2F); /* 设置线性渐变背景 */
    color: #fff; /* 设置文本颜色为白色 */
    padding: 1rem 0; /* 添加上下内边距 */
    text-align: center; /* 居中对齐文本 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
}

nav ul {
    list-style: none; /* 移除列表样式 */
    padding: 0; /* 移除内边距 */
}

nav ul li {
    display: inline; /* 使列表项水平排列 */
    margin: 0 10px; /* 添加左右外边距 */
}

nav ul li a {
    color: #fff; /* 设置链接文本颜色为白色 */
    text-decoration: none; /* 移除下划线 */
}

main {
    padding: 20px; /* 添加内边距 */
    max-width: 800px; /* 最大宽度 */
    margin: 0 auto; /* 居中对齐 */
    text-align: center; /* 居中对齐文本 */
}

.player {
    display: flex; /* 使用弹性盒子布局 */
    justify-content: space-between; /* 子元素之间均匀分布 */
    align-items: center; /* 垂直居中对齐子元素 */
    background-color: #fff; /* 背景颜色为白色 */
    padding: 20px; /* 添加内边距 */
    border-radius: 10px; /* 圆角边框 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
}

.album-cover {
    width: 250px; /* 设置宽度 */
    height: 250px; /* 设置高度 */
}

.album-cover img {
    width: 100%; /* 图片宽度为容器宽度 */
    height: 100%; /* 图片高度为容器高度 */
    border-radius: 50%; /* 圆形图片 */
    animation: rotate 20s linear infinite; /* 设置旋转动画 */
    animation-play-state: paused; /* 未播放时保持静止 */
}

.album-cover img.is-playing {
    animation-play-state: running; /* 播放时旋转，暂停后停在当前角度 */
}

@keyframes rotate {
    from {
        transform: rotate(0deg); /* 初始状态 */
    }
    to {
        transform: rotate(360deg); /* 结束状态 */
    }
}

.details {
    flex-grow: 1; /* 占据剩余空间 */
    text-align: left; /* 左对齐文本 */
    padding-left: 20px; /* 左侧内边距 */
}

.progress {
    margin-top: 20px; /* 上方外边距 */
}

#progress-bar {
    width: 100%; /* 宽度为父容器宽度 */
}

.controls {
    margin-top: 10px; /* 上方外边距 */
}

button {
    padding: 10px 20px; /* 内边距 */
    margin: 5px; /* 外边距 */
    border: none; /* 无边框 */
    border-radius: 5px; /* 圆角边框 */
    background-color: #333; /* 背景颜色 */
    color: #fff; /* 文字颜色 */
    cursor: pointer; /* 鼠标指针 */
}

button:hover {
    background-color: #555; /* 悬停时背景颜色 */
}

footer {
    text-align: center; /* 文本居中 */
    padding: 10px; /* 内边距 */
    background-color: #333; /* 背景颜色 */
    color: #fff; /* 文字颜色 */
    position: fixed; /* 固定在底部 */
    width: 100%; /* 占据全宽 */
    bottom: 0; /* 位于底部 */
}

/* 新增歌词部分样式 */
.lyrics-container {
    margin-top: 30px; /* 上方外边距 */
    max-height: 300px; /* 最大高度 */
    overflow-y: auto; /* 垂直滚动条 */
    background-color: #fff; /* 背景颜色 */
    padding: 15px; /* 内边距 */
    border-radius: 8px; /* 圆角边框 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
}

.lyrics {
    line-height: 1.5; /* 行高 */
    font-size: 1rem; /* 字体大小 */
    white-space: pre-wrap; /* 保留空白符 */
}

.lyrics p {
    margin: 0; /* 无外边距 */
    padding: 2px 0; /* 上下内边距 */
}

.lyrics p.highlight {
    color: #FF6F61; /* 高亮颜色 */
    font-weight: bold; /* 加粗 */
}

@media (max-width: 768px) {
    main {
        width: 100%;
        padding: 16px 14px 28px;
    }

    .player {
        flex-direction: column;
        gap: 18px;
        width: 100%;
        min-width: 0;
        padding: 18px 14px;
    }

    .album-cover {
        width: min(56vw, 210px);
        height: min(56vw, 210px);
        flex: 0 0 auto;
    }

    .details {
        width: 100%;
        min-width: 0;
        padding-left: 0;
        text-align: center;
    }

    .details h2 {
        margin: 0 0 8px;
    }

    .progress {
        width: 100%;
        margin-top: 16px;
    }

    .controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .controls button {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        margin: 0;
        padding: 10px 6px;
    }

    .lyrics-container {
        max-height: 40dvh;
        margin-top: 16px;
        padding: 12px 10px;
        scroll-padding-block: 40%;
    }

    .lyrics {
        font-size: 0.94rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .album-cover img {
        animation: none;
    }
}
