/* 设置网页背景图 */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-image: url('../img/background.png'); /* 背景图片文件名 */
    background-size: cover; /* 背景图覆盖整个页面 */
    background-position: center; /* 居中显示背景图 */
    background-repeat: no-repeat; /* 防止背景图重复 */
    overflow: hidden; /* 防止滚动条出现 */
}

/* 导航条样式 */
nav {
    background-color: rgba(51, 51, 51, 0.9); /* 半透明背景 */
    color: white;
    padding: 10px 20px;
    position: fixed; /* 固定导航条 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

nav ul li a:hover {
    text-decoration: underline;
}

nav ul .right-menu {
    display: flex;
    gap: 20px;
}

body {
    padding-top: 60px; /* 给内容留出空间，避免被导航条遮挡 */
}

/* 默认样式（适用于桌面端） */
.content-box {
    width: 80%; /* 内容框宽度 */
    margin: 50px auto; /* 调整顶部和底部间距 */
    background-color: rgba(255, 255, 255, 0.9); /* 半透明白色背景 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    padding: 30px; /* 增加内边距 */
    display: flex;
    gap: 30px; /* 增加头像和文本框之间的间距 */
    align-items: flex-start;
}

.content-text {
    max-height: 600px; /* 文本框最大高度 */
    overflow-y: auto; /* 启用垂直滚动条 */
    padding: 20px; /* 增加内边距 */
    font-size: 16px; /* 字体大小 */
    line-height: 1.8; /* 行高 */
    flex: 1; /* 占据剩余空间 */
}

/* 头像样式 */
.avatar {
    width: 100px; /* 头像宽度 */
    height: 100px; /* 头像高度 */
    border-radius: 50%; /* 圆形头像 */
    object-fit: cover; /* 确保图片适应框 */
}

.content-text h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.content-text p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

/* 点击特效样式 */
.click-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.6); /* 半透明白色 */
    border-radius: 50%; /* 圆形 */
    pointer-events: none; /* 不影响交互 */
    animation: click-animation 0.6s ease-out forwards;
}

@keyframes click-animation {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(10); /* 扩散效果 */
        opacity: 0; /* 渐隐 */
    }
}

/* 备案号样式 */
.footer-info {
    position: absolute; /* 绝对定位 */
    bottom: 10px; /* 距离底部 10px */
    width: 100%; /* 占满宽度 */
    text-align: center; /* 居中对齐 */
    font-size: 14px; /* 字体大小 */
    color: white; /* 白色字体，确保在背景图上可见 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* 添加文字阴影，增强可读性 */
}

.footer-info a {
    color: white; /* 链接文字为白色 */
    text-decoration: none; /* 去掉下划线 */
}

.footer-info a:hover {
    text-decoration: underline; /* 鼠标悬停时显示下划线 */
}

.footer-info img {
    vertical-align: middle; /* 图片与文字垂直居中对齐 */
    margin-right: 5px; /* 图片与文字间距 */
}

/* 圆形音乐播放器样式 */
.music-player {
    position: fixed; /* 固定在页面位置 */
    bottom: 20px; /* 距离底部 20px */
    right: 20px; /* 距离右侧 20px */
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000; /* 确保在最上层 */
}

/* 圆形播放/暂停按钮 */
.play-pause-button {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
    position: relative;
}

.play-pause-button:hover {
    background-color: rgba(255, 255, 255, 1);
}

/* 播放图标样式 */
.play-icon::before {
    content: '▶'; /* 播放符号 */
    font-size: 24px;
    color: #333;
}

/* 暂停图标样式 */
.pause-icon::before {
    content: '❚❚'; /* 暂停符号 */
    font-size: 24px;
    color: #333;
}

.music-player audio {
    width: 50px; /* 音乐播放器控件宽度 */
    height: 50px; /* 音乐播放器控件高度 */
    border-radius: 50%; /* 圆形控件 */
    outline: none; /* 去掉默认的边框 */
}

.music-player .lyrics {
    font-size: 14px; /* 歌词字体大小 */
    color: white; /* 白色字体 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* 添加文字阴影，增强可读性 */
    white-space: nowrap; /* 防止歌词换行 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
    max-width: 200px; /* 歌词最大宽度 */
}

/* 歌单按钮样式 */
.playlist-button {
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.playlist-button:hover {
    background-color: rgba(255, 255, 255, 1);
}

.playlist {
    display: none; /* 默认隐藏 */
    position: absolute;
    bottom: 70px; /* 距离播放器一定距离 */
    right: 20px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1001;
}

.playlist ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist li {
    padding: 5px 10px;
    cursor: pointer;
}

.playlist li:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 歌单弹窗样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #333;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-content li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

.modal-content li:hover {
    background-color: #f0f0f0;
}

.close-btn,
.close-about-btn,
.close-playlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

/* 歌单弹窗关闭按钮样式 */
.close-modal-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.close-modal-btn:hover {
    background-color: #0056b3;
}

/* 媒体查询：适配平板设备（屏幕宽度小于 1024px） */
@media screen and (max-width: 1024px) {
    .content-box {
        width: 90%; /* 内容框宽度调整为 90% */
        padding: 20px; /* 减小内边距 */
        flex-direction: column; /* 改为垂直布局 */
        gap: 20px; /* 减小头像和文本框之间的间距 */
    }

    .content-text {
        max-height: 500px; /* 减小文本框高度 */
        font-size: 15px; /* 缩小字体 */
    }

    .avatar {
        width: 80px; /* 缩小头像 */
        height: 80px;
    }
}

/* 媒体查询：适配手机设备（屏幕宽度小于 768px） */
@media screen and (max-width: 768px) {
    nav ul {
        flex-direction: column; /* 导航菜单垂直排列 */
        align-items: flex-start;
    }

    nav ul li {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .content-box {
        width: 95%; /* 内容框宽度调整为 95% */
        margin: 80px auto; /* 调整顶部间距 */
        padding: 15px; /* 减小内边距 */
    }

    .content-text {
        max-height: 400px; /* 减小文本框高度 */
        font-size: 14px; /* 缩小字体 */
    }

    .avatar {
        width: 60px; /* 缩小头像 */
        height: 60px;
    }

    .modal-content {
        width: 90%; /* 弹窗宽度调整为 90% */
    }
}