/* Tailwind 自定义工具类 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .text-shadow {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
    }
    .fade-in {
        animation: fadeIn 1s ease-in-out;
    }
    .scale-in {
        animation: scaleIn 0.8s ease-out;
    }
    .glass-effect {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 全局样式 */
body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.page.active {
    opacity: 1;
}

.gallery-img {
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: grayscale(100%); /* 默认灰色 */
}

.gallery-img:hover {
    transform: scale(1.05);
    filter: grayscale(0%); /* 鼠标悬停时恢复彩色 */
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
    /* 添加最大高度和滚动条 */
    max-height: 80vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* 添加模态框标题向上边距 */
#modal-title {
    margin-top: 1rem;
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
    width: 6px; /* 设置全局垂直滚动条宽度为6px */
    height: 6px; /* 设置全局水平滚动条宽度为6px */
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #706c6d; /* 使用主题粉色 */
    border-radius: 4px;
}

/* 模态框滚动条样式 - 保持与全局样式一致 */
.modal-content::-webkit-scrollbar {
    width: 6px; /* 将宽度从8px改为6px，使其更窄 */
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #706c6d;
    border-radius: 4px;
}

/* 音乐播放器样式 */
#music-player {
    transition: all 0.3s ease;
    transform: translateX(120%); /* 默认隐藏在右侧 */
    opacity: 0;
}

/* 添加播放器容器样式 */
#music-player-container {
    position: fixed;
    bottom: 6px;
    right: 6px;
    width: 60px;
    height: 60px;
    z-index: 50;
}

/* 鼠标移到容器时显示播放器 */
#music-player-container:hover #music-player {
    transform: translateX(0);
    opacity: 1;
}

#music-player:hover {
    box-shadow: 0 10px 25px -5px rgba(255, 107, 139, 0.4);
}

/* 响应式调整 */
@media (max-width: 640px) {
    #music-player {
        bottom: 4px;
        right: 4px;
        width: 44px;
        height: 44px;
    }
    #music-player-container {
        width: 50px;
        height: 50px;
        bottom: 4px;
        right: 4px;
    }
}
#player-progress {
    cursor: pointer;
}

/* 添加关闭按钮样式 */
.close-modal {
    background-color: #FF9BB3; /* 使用主题粉色 */
    color: white; /* 文字颜色改为白色 */
    width: 35px; /* 设置宽度 */
    height: 35px; /* 设置高度 */
    border-radius: 50%; /* 圆形背景 */
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    font-size: 1.2rem; /* 调整字体大小 */
    font-size: 1.4rem; /* 稍微增大字体大小 */
    transition: background-color 0.3s ease, transform 0.3s ease; /* 添加过渡效果 */
    line-height: 1; /* 行高设置为1，确保垂直居中 */
    line-height: 35px; /* 行高等于按钮高度，确保垂直居中 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
    padding-bottom: 2px; /* 微调垂直位置 */
}

.close-modal:hover {
    background-color: #FF6B8B; /* 悬停时颜色加深 */
    transform: scale(1.1); /* 悬停时稍微放大 */
    text-decoration: none; /* 移除下划线（如果有） */
    color: white; /* 确保悬停时文字仍为白色 */
}

