/* 手机端固定显示，禁止滚动 */
@media (max-width: 768px) {
    html, body {
        overflow: hidden !important;
        position: fixed !important;
        height: 100vh !important;
        width: 100vw !important;
        touch-action: none !important;
        -webkit-overflow-scrolling: none !important;
        overscroll-behavior: none !important;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #8B0000;
    --secondary-color: #DAA520;
    --text-color: #5A3E36;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --nav-height: 60px;
    --bottom-nav-height: 60px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-gradient: linear-gradient(135deg, #F4F1DE 0%, #E7D7C1 100%);
    --font-family: "华文楷体", "Microsoft YaHei", sans-serif;
    --default-fill: #FFF3C7;
    --special-fill: #D4E157;
}
    

body {
    font-family: "华文楷体", "KaiTi", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 60px 0 80px 0;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 统一为个人中心的背景样式 */
    background: var(--bg-gradient);
    margin: 0;
    font-family: "华文楷体", "KaiTi", "Microsoft YaHei", sans-serif;
    overflow-x: hidden;
}

/* 手机端body样式 */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
        height: 100vh !important;
        overflow: hidden !important;
        display: block !important;
        justify-content: unset !important;
        align-items: unset !important;
    }
}

/* ===== 顶部导航栏 ===== */
.top-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.top-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 100%;
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.back-button i {
    font-size: 1rem;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.nav-title i {
    font-size: 1.3rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}








/* 新增内容容器 */
.content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    padding: 2vw; /* 使用视口单位，使内边距响应式 */
    transition: all 0.3s ease; /* 添加过渡效果 */
}

.text-content {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    width: 350px; /* 自动调整宽度 */
    height: 400px; /* 自动调整高度 */
    line-height: 1.6; /* 增加行高，提高可读性 */
    font-size: 1.1rem; /* 调整字体大小 */
}



.text-content h3 {
    font-size: 2.2em; /* 原约1.5em */
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 2px;
    font-family: '楷体', cursive;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* 段落文字优化 */
.text-content p {
    font-size: 1.1em;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
}


/* 第二个页面 */
.second-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: none; /* 移除原有背景 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 20px 20px 20px; /* 为顶部导航栏留出空间 */
    opacity: 1; /* 直接显示页面内容 */
    transition: opacity 0.5s ease;
    overflow-y: auto; /* 允许垂直滚动 */
}

 /* 视频背景样式 */
 .video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
}

#bgVideo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    opacity: 0.9;
    filter: grayscale(20%) contrast(1.1);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg, 
        rgba(245, 239, 230, 0.4) 0%,
        rgba(245, 239, 230, 0.7) 100%
    );
    mix-blend-mode: multiply;
}

/* GIF容器 */
.gif-container {
    width: 250px !important;
    height: 450px !important;
    margin: 0 420px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 移动端整体适配 */
@media (max-width: 768px) {
    /* 手机端固定显示，禁止滚动 */
    .second-page {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        max-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .content-wrapper {
        flex-direction: column !important;
        align-items: center;
        padding: 12px;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    .text-content {
        width: 100%;
        height: auto;
        max-width: 680px;
        font-size: 1rem;
        margin: 0 0 12px 0;
        text-align: left;
        max-height: 60vh;
        overflow-y: visible;
    }

    .gif-container {
        width: 200px !important;
        height: 300px !important;
        margin: 0 auto;
    }


    .main-container {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
        margin-top: 60px;
        height: calc(100vh - 140px);
        overflow: hidden;
        justify-content: center;
        align-items: center;
    }

    .main-card {
        width: 95%;
        max-width: 480px;
        padding: 16px 12px;
        flex-shrink: 0;
    }

    .card-container {
        width: 200px;
        height: 260px;
        margin: 0 auto;
    }

    .music-player {
        width: 100%;
        max-width: 480px;
        padding: 12px;
        margin-top: 8px;
    }

    .text-container {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        padding: 4px 8px;
        font-size: 0.9rem;
        text-align: center;
    }

    .left-text,
    .right-text {
        right: auto;
        left: auto;
        transform: none;
    }

    .music-title {
        font-size: 18px;
        margin: 4px 0;
    }
}






/* 主容器 */
.main-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
    padding: 50px 20px;
    z-index: 1; /* 确保内容在视频上方 */
}

/* 3D卡片容器 */
.card-container {
    position: relative;
    width: 300px;
    height: 400px;
    perspective: 1200px;
    margin-top: 20px;
    cursor: pointer; /* 添加指针样式表明可点击 */
    z-index: 2; /* 确保卡片在文字上层 */
}

/* 卡片通用样式 */
.card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    transform-style: preserve-3d;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
    pointer-events: none; /* 卡片本身不处理点击事件 */
}

/* 卡片初始状态 */
.front-card {
    transform: rotateX(0deg);
    z-index: 2;
    background: url('../assets/images/instruments/Background_music1.png') center/cover;
    filter: brightness(1);
    opacity: 1;
}

.back-card {
    transform: rotateX(-90deg) scale(0.8) translateY(15%);
    opacity: 0;
    background: url('../assets/images/instruments/jinhu.png') center/cover;
    filter: brightness(0.8) contrast(1.1); /* 降低亮度，增加对比度 */
    z-index: 1;
}


/* 播放状态下的卡片动画 */
.card-container.playing .front-card {
    transform: rotateX(45deg);
    filter: brightness(0.9);
    opacity: 0.7;
}


.card-container.playing .back-card {
    transform: rotateX(0deg) scale(1) translateY(-10%);
    opacity: 0.95; /* 提高透明度 */
    z-index: 3;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5); /* 增强阴影效果 */
    filter: brightness(0.85) contrast(1.2); /* 调整亮度和对比度 */
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s ease; /* 添加filter过渡 */
}

/* 音乐播放器样式 */
.music-player {
    width: 520px; /* 进一步增加宽度 */
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px; /* 增加内边距 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: white;
    margin-top: 30px; /* 增加与卡片的间距 */
}


.player-controls {
    display: flex;
    justify-content: center; /* 所有按钮居中 */
    align-items: center; /* 垂直居中 */
    width: 100%; /* 确保容器宽度占满父容器 */
    padding: 0 20px; /* 左右留出一些间距 */
    margin-top: 25px; /* 增加与进度条的间距 */
}

.control-group {
    display: flex;
    gap: 15px; /* 减少按钮间距，更紧凑 */
    align-items: center;
    justify-content: center;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.1);
}

.control-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.control-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}

/* 播放按钮特殊样式 */
#play-btn {
    width: 60px;
    height: 60px;
    font-size: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.15));
    border: 3px solid rgba(255,255,255,0.4);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

#play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

#play-btn:hover::before {
    transform: translateX(100%);
}

#play-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.25));
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

#play-btn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.3));
}

/* 左右切换按钮特殊样式 */
#prev-btn, #next-btn {
    position: relative;
    overflow: hidden;
}

#prev-btn::before, #next-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

#prev-btn:hover::before, #next-btn:hover::before {
    width: 100%;
    height: 100%;
}

.progress-container {
    background: rgba(255,255,255,0.1);
    height: 6px;
    border-radius: 3px;
    margin: 25px 0;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: #3498db;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-top: 8px; /* 增加与进度条的间距 */
    color: rgba(255,255,255,0.8);
}

/* 新增文字介绍样式 */
.text-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    padding: 25px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    pointer-events: none; /* 防止文字区域阻挡点击 */
}


.left-text {
    right: calc(100% + 40px);
    transform: translateY(-50%) translateX(-30px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.right-text {
    left: calc(100% + 40px);
    transform: translateY(-50%) translateX(30px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}


.text-container.active {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.text-title {
    font-size: 30px;
    color: #742525;
    margin-bottom: 12px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.text-desc {
    font-size: 18px;
    color: rgba(26, 8, 8, 0.9);
    line-height: 1.6;
}

/* 选项卡样式 */
.tab-container {
    display: none; /* 默认隐藏选项卡 */
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 10;
    width: 250px; /* 增加宽度 */
    max-height: 200px; /* 设置最大高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    scrollbar-width: thin; /* 适用于Firefox */
    scrollbar-color: rgba(255,255,255,0.3) transparent; /* 适用于Firefox */
}

/* 为Chrome等浏览器定制滚动条 */
.tab-container::-webkit-scrollbar {
    width: 6px;
}

.tab-container::-webkit-scrollbar-track {
    background: transparent;
}

.tab-container::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.tab-container.active {
    display: block; /* 点击后显示选项卡 */
}

.tab {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgb(10, 1, 1);
    margin-bottom: 8px;
    pointer-events: auto; /* 确保选项卡可以点击 */
}

.tab:last-child {
    margin-bottom: 0;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 点击图标样式 */
.menu-icon {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    margin-left: auto; /* 最后一个图标靠右 */
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/*音乐名称*/
.music-title {
    text-align: center;
    color: white;
    font-size: 28px;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    opacity: 1;
    transform: translateY(20px);
    transition: all 0.5s ease;
    padding: 0 20px; /* 增加左右内边距 */
}

.music-title.active {
    opacity: 1;
    transform: translateY(0);
}

/* 新增的大卡片样式 */
.main-card {
    cursor: pointer;
    position: relative;
    width: 580px; /* 增加宽度以匹配播放器 */
    padding: 40px 30px; /* 调整内边距 */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    z-index: 1;
    background: url('../assets/images/instruments/Background_music.jpg') center/cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.1); /* 可选：添加边框增强立体感 */
}



/* 播放状态下的文字动画 */
.main-card.active .left-text,
.main-card.active .right-text {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* 播放状态下的文字动画 */
.card-container.playing .left-text,
.card-container.playing .right-text {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ===== 导航菜单样式 ===== */
.nav-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1002;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.8rem 0;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--secondary-color);
}

.nav-item {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    transition: var(--transition);
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
    flex: 1;
    justify-content: center;
    min-height: 44px;
}

.nav-item i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.nav-item.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 移动端触摸时的:active伪类样式 */
.nav-item:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 确保只有当前页面的导航项保持高亮状态 */
.nav-item:not(.active) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

.nav-item:not(.active):hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.nav-item:hover i {
    color: var(--secondary-color);
    transform: scale(1.1);
}
/* 移除水袖动画效果，与主页保持一致 */
    
    /* 左侧分类导航 */
    .category-nav {
        position: fixed;
        right: 20px; /* 改为右侧 */
        top: 50%; /* 垂直居中 */
        transform: translateY(-50%); /* 垂直居中 */
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 18px; /* 增加间距以适应更大按钮 */
        background: rgba(255, 255, 255, 0.95);
        padding: 25px 15px; /* 增加内边距 */
        border-radius: 30px; /* 更圆润 */
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border: 2px solid #d4af37;
        backdrop-filter: blur(10px); /* 添加毛玻璃效果 */
        /* 拖拽相关样式 */
        cursor: move;
        user-select: none;
        touch-action: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    /* 拖拽状态样式 */
    .category-nav.dragging {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
        cursor: grabbing;
    }
    
    /* 拖拽时的视觉反馈 */
    .category-nav.drag-start {
        opacity: 0.8;
        transform: translateY(-50%) rotate(2deg);
    }
    
    .category-item {
        width: 60px; /* 增大宽度 */
        height: 60px; /* 增大高度 */
        border-radius: 50%; /* 圆形 */
        cursor: pointer;
        transition: all 0.3s ease;
        color: #9a3b26;
        text-align: center;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px; /* 增大字体 */
        line-height: 1.2; /* 调整行高 */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        position: relative;
        overflow: visible; /* 改为visible以显示子菜单 */
        background: rgba(255, 255, 255, 0.9);
    }
    
    .category-item:hover, 
    .category-item.active {
        background: linear-gradient(135deg, #9a3b26, #7a2e1a);
        color: white;
        transform: scale(1.1); /* 缩放效果 */
        box-shadow: 0 6px 20px rgba(154, 59, 38, 0.4);
        border-color: #d4af37;
    }
    
    /* 子菜单样式 */
    .category-submenu {
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%) translateX(20px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        min-width: 200px;
        max-height: 300px;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1001;
        margin-right: 15px;
        border: 2px solid rgba(212, 175, 55, 0.3);
    }
    
    .category-item:hover .category-submenu,
    .category-submenu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }
    
    .category-submenu-item {
        padding: 12px 16px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-color);
        font-size: 0.9rem;
        margin-bottom: 5px;
        border-left: 3px solid transparent;
        white-space: nowrap;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        min-height: 20px;
        display: flex;
        align-items: center;
    }
    
    .category-submenu-item:hover {
        background: rgba(154, 59, 38, 0.1);
        border-left-color: #9a3b26;
        transform: translateX(5px);
    }
    
    .category-submenu-item:active {
        background: rgba(154, 59, 38, 0.2);
        transform: translateX(3px) scale(0.98);
    }
    
    .category-submenu-item:last-child {
        margin-bottom: 0;
    }
    
    .category-submenu-item.active {
        background: rgba(154, 59, 38, 0.15);
        border-left-color: #9a3b26;
        color: #9a3b26;
        font-weight: 600;
    }
    
    /* 响应式设计 */
    @media (max-width: 992px) {
        .nav-menu {
            padding: 0.8rem 0;
        }
        .nav-item {
            padding: 0.6rem 1rem;
            font-size: 1rem;
        }
        .category-nav {
            right: 15px; /* 调整右侧位置 */
            padding: 15px 10px; /* 调整内边距 */
        }
        .category-item {
            width: 55px; /* 增大尺寸 */
            height: 55px;
            font-size: 12px; /* 增大字体 */
            line-height: 1.1; /* 调整行高 */
        }
    }
    
@media (max-width: 768px) {
    .nav-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 60px !important;
        z-index: 1002 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
        padding: 0.5rem 0 !important;
        box-shadow: var(--shadow) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 2px solid var(--secondary-color) !important;
    }
    
    .nav-item {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        margin: 0;
        flex: 1 1 auto;
        justify-content: center;
        border-radius: 20px;
        height: 50px;
        display: flex;
        align-items: center;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
        
    /* 隐藏手机端不需要的导航按钮 */
    .nav-item[href="roles.html"],
    .nav-item[href="costumes.html"],
    .nav-item[href="introduction.html"],
    .nav-item[href="history.html"],
    .nav-item[href="map.html"],
    .nav-item[href="data-analysis.html"] {
        display: none;
    }
        /* 主要内容区域紧凑化，保证播放器首屏可见 */
        .main-container {
            flex-direction: column;
            gap: 4px;
            padding: 4px;
            margin-top: 10px;
            justify-content: flex-start;
            align-items: center;
            height: auto;
            overflow: visible;
        }
        .main-card {
            width: 100%;
            max-width: 480px;
            padding: 24px 20px;
            margin: 0;
            flex-shrink: 0;
        }
        .card-container {
            width: 380px;
            height: 480px;
            margin: 0 auto;
        }
        .music-player {
            width: 100%;
            max-width: 480px;
            padding: 20px;
            margin: 0 auto;
        }
        
        .music-title {
            font-size: 28px;
            margin-bottom: 15px;
            padding: 0 10px;
        }
        
        .control-btn {
            width: 55px;
            height: 55px;
            font-size: 20px;
        }
        
        #play-btn {
            width: 70px;
            height: 70px;
            font-size: 26px;
        }
        
        .control-group {
            gap: 18px;
        }
        .category-nav {
            position: fixed;
            /* 不强制定位，允许JS设置 left/top 拖动 */
            right: auto;
            top: auto;
            transform: none;
            z-index: 1000;
            flex-direction: column;
            gap: 8px;
            background: rgba(255, 255, 255, 0.95);
            padding: 12px 8px;
            border-radius: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            border: 2px solid #d4af37;
            backdrop-filter: blur(10px);
            cursor: grab;
            touch-action: none; /* 允许自由拖动 */
            user-select: none;
        }
        .category-nav.dragging { cursor: grabbing; }
        
        /* 手机端拖拽状态 */
        .category-nav.dragging {
            transform: translateY(-50%) scale(1.1);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
            cursor: grabbing;
        }
        
        .category-nav.drag-start {
            opacity: 0.9;
            transform: translateY(-50%) rotate(3deg);
        }
        .category-item {
            width: 45px !important;
            height: 45px !important;
            font-size: 10px !important;
            line-height: 0.9 !important;
            border-radius: 50% !important;
            cursor: pointer !important;
            transition: all 0.3s ease !important;
            color: #9a3b26 !important;
            text-align: center !important;
            font-weight: bold !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
            border: 2px solid rgba(255, 255, 255, 0.3) !important;
            /* 手机端触摸优化 */
            touch-action: manipulation !important;
            pointer-events: auto !important;
            -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3) !important;
        }
        
        .category-submenu {
            min-width: 180px;
            max-height: 250px;
            margin-right: 10px;
        }
        
        .category-submenu-item {
            padding: 10px 12px;
            font-size: 0.8rem;
            /* 手机端触摸优化 */
            touch-action: manipulation !important;
            pointer-events: auto !important;
            -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
            min-height: 18px;
        }
        
        /* 手机端特殊样式 */
        .category-nav.mobile-enabled {
            touch-action: manipulation !important;
            pointer-events: auto !important;
        }
        
        .category-item.mobile-enabled {
            touch-action: manipulation !important;
            pointer-events: auto !important;
            -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
            cursor: pointer;
        }
        
        .category-item.mobile-enabled:active {
            transform: scale(0.95);
            opacity: 0.8;
            transition: all 0.1s ease;
        }
    }

    /* 更小屏幕进一步优化触控尺寸与排布 */
    @media (max-width: 480px) {
        /* 允许手机端滚动 */
        html, body {
            overflow-y: auto !important;
            position: static !important;
            height: auto !important;
            touch-action: pan-y !important;
            -webkit-overflow-scrolling: touch !important;
        }
        
        /* 小屏幕内容区域 */
    .content-wrapper {
        height: auto !important;
        max-height: none !important;
        padding: 8px;
    }
        
        .text-content {
            max-height: none;
        }
        
    .nav-item {
        padding: 0.6rem 0;
        border-radius: 15px;
        font-size: 0.8rem;
        margin: 0;
        flex: 1 1 auto;
        justify-content: center;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }
    
    /* 确保小屏幕也隐藏这些导航按钮 */
    .nav-item[href="roles.html"],
    .nav-item[href="costumes.html"],
    .nav-item[href="introduction.html"],
    .nav-item[href="history.html"],
    .nav-item[href="map.html"],
    .nav-item[href="data-analysis.html"] {
        display: none;
    }
        
        .category-nav {
            right: 8px; /* 更靠近边缘 */
            padding: 12px 8px; /* 减少内边距 */
            gap: 10px; /* 减少间距 */
        }
        
        .category-item {
            width: 45px; /* 增大尺寸 */
            height: 45px;
            font-size: 10px; /* 增大字体 */
            line-height: 0.9; /* 调整行高 */
        }
        
        .category-submenu {
            min-width: 160px;
            max-height: 200px;
            margin-right: 8px;
        }
        
        .category-submenu-item {
            padding: 8px 10px;
            font-size: 0.75rem;
            min-height: 16px;
        }
        
        .control-btn {
            width: 50px;
            height: 50px;
            font-size: 18px;
        }
        
        #play-btn {
            width: 65px;
            height: 65px;
            font-size: 24px;
        }
        
        .control-group {
            gap: 15px;
        }
        
        /* 小屏幕卡片布局优化 */
        .main-container {
            margin-top: 8px;
            gap: 3px;
            padding: 3px;
            height: auto;
        }
        
        .main-card {
            width: 100%;
            max-width: 420px;
            padding: 20px 16px;
            margin: 0;
        }
        
        .card-container {
            width: 340px;
            height: 420px;
        }
        
        .music-player {
            width: 100%;
            max-width: 420px;
            padding: 16px;
            margin: 0 auto;
        }
        
        .music-title {
            font-size: 26px;
            margin-bottom: 12px;
            padding: 0 8px;
        }
    }
    
    @media (max-width: 360px) {
        .nav-item i { font-size: 1.2rem; }
        
        .main-card {
            width: 100%;
            max-width: none;
            padding: 16px 8px;
            margin: 0 1px;
        }
        
        .card-container {
            width: 280px;
            height: 360px;
        }
        
        .music-player {
            width: 100%;
            max-width: none;
            padding: 16px;
        }
        
        .control-btn {
            width: 38px;
            height: 38px;
            font-size: 13px;
        }
        
        #play-btn {
            width: 48px;
            height: 48px;
            font-size: 16px;
        }
        
        .control-group {
            gap: 8px;
        }
    }
    
    /* 超窄屏幕优化 (320px以下) */
    @media (max-width: 320px) {
        .main-card {
            padding: 14px 6px;
            margin: 0;
        }
        
        .card-container {
            width: 260px;
            height: 340px;
        }
        
        .music-player {
            padding: 14px;
        }
        
        .control-btn {
            width: 36px;
            height: 36px;
            font-size: 12px;
        }
        
        #play-btn {
            width: 46px;
            height: 46px;
            font-size: 15px;
        }
        
        .control-group {
            gap: 6px;
        }
    }

/* 游戏导航按钮样式 - 与其他导航项保持一致 */
/* 使用标准导航项样式，无需特殊处理 */

/* 移动端游戏导航按钮 - 与其他导航项保持一致 */
/* 使用标准导航项样式，无需特殊处理 */

/* ===== 深色模式样式 ===== */
body.dark-theme {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
}

body.dark-theme .second-page {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* 自适应缩放并保持固定边距与居中（手机端） */
@media (max-width: 768px) {
    /* 页面四周固定边距，底部为导航栏预留空间 */
    .second-page {
        padding: calc(var(--nav-height) + env(safe-area-inset-top) + 55px) 12px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 20px) 12px;
        box-sizing: border-box;
    }

    /* 计算剩余高度，使内容在可视区域垂直水平居中 */
    .main-container {
        min-height: calc(100vh - (var(--nav-height) + env(safe-area-inset-top) + 55px) - (var(--bottom-nav-height) + env(safe-area-inset-bottom) + 20px));
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 0;
        margin: 0 auto;
    }

    /* 中心卡片：宽度根据屏幕自动缩放，左右固定12px边距（通过父级padding实现） */
    .main-card {
        width: calc(100vw - 24px);
        max-width: 520px;
        margin: 0;
        padding: 8px 14px 18px; /* 再次压缩：上8px，左右14px，下18px */
        border-radius: 16px;
        gap: 16px; /* 再缩小组件间距 */
    }

    /* 卡片内图片区域按比例缩放，避免裁切 */
    .card-container {
        width: 100%;
        height: auto;
        aspect-ratio: 5 / 7;
        margin: 0 auto 4px; /* 再缩短与标题空隙 */
    }

    /* 播放器与卡片同宽，四周不贴边 */
    .music-player {
        width: 100%;
        max-width: 520px;
        padding: 12px; /* 再压缩内边距 */
        border-radius: 14px;
        margin: 2px auto 0; /* 更贴标题 */
    }

    /* 标题与段落向上靠拢 */
    .music-title {
        margin: 4px 0 6px; /* 标题上下间距再减少 */
    }

    /* 播放控制区进一步紧凑 */
    .control-group { gap: 12px; }
    .control-btn { width: 48px; height: 48px; }
    #play-btn { width: 60px; height: 60px; }

    /* 将“文字与播放器”整体上移，保持二者相对间距不变 */
    .main-card .music-title,
    .main-card .music-player {
        transform: translateY(-6px);
    }
}

body.dark-theme .main-container {
    background: rgba(45, 45, 45, 0.9);
}

body.dark-theme .main-card {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-theme .card-container {
    background: #1a1a1a;
    border: 1px solid #404040;
}

body.dark-theme .music-player {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-theme .text-container {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .music-title {
    color: #e0e0e0;
}

body.dark-theme .nav-menu {
    background: rgba(45, 45, 45, 0.95);
    border-top-color: #DAA520;
}

body.dark-theme .nav-item {
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.4);
}

body.dark-theme .nav-item.active {
    background: linear-gradient(135deg, #DAA520, #FFD700);
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.4);
}

body.dark-theme .nav-item:hover {
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.5);
}

body.dark-theme .category-nav {
    background: rgba(45, 45, 45, 0.95);
    border-color: #DAA520;
}

body.dark-theme .category-item {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .category-item:hover {
    background: rgba(139, 0, 0, 0.2);
    color: #DAA520;
    border-color: #DAA520;
}

body.dark-theme .category-item.active {
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    color: #fff;
    border-color: #DAA520;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

body.dark-theme .category-submenu {
    background: rgba(45, 45, 45, 0.95);
    border-color: #404040;
}

body.dark-theme .category-submenu-item {
    color: #e0e0e0;
}

body.dark-theme .category-submenu-item:hover {
    background: rgba(139, 0, 0, 0.2);
    color: #DAA520;
}

body.dark-theme .category-submenu-item.active {
    background: rgba(139, 0, 0, 0.3);
    color: #DAA520;
}

/* 深色模式主题切换按钮 */
body.dark-theme .theme-toggle-btn {
    background: linear-gradient(135deg, #DAA520, #FFD700) !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.4) !important;
}

/* ===== 主题切换动画 ===== */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.second-page,
.main-container,
.main-card,
.card-container,
.music-player,
.text-container,
.nav-menu,
.nav-item,
.category-nav,
.category-item,
.category-submenu,
.category-submenu-item {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

