/* ====== 性能优化 ====== */
.content-auto {
    content-visibility: auto;
}

/* ====== 浏览器兼容性检测和降级方案 ====== */
/* 检测backdrop-filter支持 */
@supports (backdrop-filter: blur(1px)) {
    .backdrop-supported {
        --backdrop-support: 1;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .backdrop-not-supported {
        --backdrop-support: 0;
    }
}

/* Firefox特殊处理 */
@-moz-document url-prefix() {
    .pill-nav {
        background-color: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    #themeToggle, #hideButton, #soundToggle {
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Internet Explorer和Edge Legacy兼容性 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .pill-nav {
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .blur-text {
        background-color: rgba(255, 255, 255, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.4);
    }
}

/* ====== 简洁鼠标拖尾效果 ====== */
.mouse-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: rgba(255, 105, 180, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: trail-fade 0.6s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
}

/* ====== 自定义滚动条样式 ====== */
/* 桌面端自定义滚动条 */
@media (min-width: 769px) {
    /* Webkit浏览器滚动条样式 */
    .page::-webkit-scrollbar,
    .overflow-y-auto::-webkit-scrollbar {
        width: 8px;
    }
    
    .page::-webkit-scrollbar-track,
    .overflow-y-auto::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
        margin: 4px 0;
    }
    
    .page::-webkit-scrollbar-thumb,
    .overflow-y-auto::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(255, 182, 217, 0.6), rgba(255, 105, 180, 0.4));
        border-radius: 4px;
        transition: all 0.3s ease;
    }
    
    .page::-webkit-scrollbar-thumb:hover,
    .overflow-y-auto::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, rgba(255, 182, 217, 0.8), rgba(255, 105, 180, 0.6));
        box-shadow: 0 0 8px rgba(255, 105, 180, 0.3);
    }
    
    .page::-webkit-scrollbar-thumb:active,
    .overflow-y-auto::-webkit-scrollbar-thumb:active {
        background: linear-gradient(180deg, rgba(255, 182, 217, 1), rgba(255, 105, 180, 0.8));
    }
    
    /* 滚动条角落 */
    .page::-webkit-scrollbar-corner,
    .overflow-y-auto::-webkit-scrollbar-corner {
        background: transparent;
    }
}

/* 隐藏滚动条类 */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 防选中复制样式 */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 主题切换动画 */ 
 .theme-transition-overlay { 
     position: fixed; 
     width: 60px; 
     height: 60px; 
     border-radius: 50%; 
     z-index: 9999; /* 动画过程中在最上层 */ 
     pointer-events: none; 
     opacity: 1; 
     transform: scale(1); 
     transform-origin: center center; 
     left: var(--button-x, 50%); 
     top: var(--button-y, 50%); 
     margin-left: -30px; 
     margin-top: -30px; 
 } 
 
 /* 动画完成后降低z-index */ 
 .theme-transition-overlay[data-persistent="true"] { 
     z-index: 0 !important; /* 确保在内容之下 */ 
 } 
 
 /* 深色模式覆盖层 - 透明渐变，与原有深色主题一致 */ 
 .theme-transition-overlay.dark-overlay { 
     background: linear-gradient( 
         135deg, 
         rgba(30, 30, 50, 0.2) 0%, 
         rgba(50, 30, 60, 0.15) 30%, 
         rgba(60, 30, 50, 0.1) 70%, 
         transparent 100% 
     ); 
     backdrop-filter: none; /* 移除模糊效果，保持透明 */ 
 } 
 
 /* 扩展动画 */
.theme-transition-overlay.expanding {
    animation: expand-to-fullscreen 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 收缩动画 */
.theme-transition-overlay.contracting {
    animation: contract-from-fullscreen 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 确保覆盖层在深色模式下保持展开状态 */ 
 .theme-transition-overlay.dark-overlay.expanding { 
     animation-fill-mode: forwards; 
 } 
 
 @keyframes expand-to-fullscreen { 
     0% { 
         transform: scale(1); 
         opacity: 0; 
     } 
     10% { 
         opacity: 1; 
     } 
     100% { 
         transform: scale(150); /* 增大到足够覆盖任何屏幕尺寸 */ 
         opacity: 1; 
     } 
 } 
 
 @keyframes contract-from-fullscreen { 
     0% { 
         transform: scale(150); 
         opacity: 1; 
     } 
     80% { 
         opacity: 0.8; 
     } 
     100% { 
         transform: scale(0); 
         opacity: 0; 
     } 
 }

/* 主题切换按钮动画 */
#themeToggle {
    transition: all 0.3s ease;
}

#themeToggle:active {
    transform: scale(0.9);
}

#themeToggle.animating {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* 页面内容过渡动画 */
body {
    transition: background-color 0.8s ease, color 0.8s ease;
}

body.theme-transitioning {
    overflow: hidden;
}

/* ====== 导航栏样式 ====== */
.pill-nav {
    position: relative;
}

.pill-nav a {
    border-radius: 20px;
    padding: 8px 20px;
    display: inline-block;
    /* 增强过渡效果配合液态玻璃动画 */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
    /* 添加轻微的变换效果 */
    transform: scale(1);
}

.pill-nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    /* 悬停时轻微放大 */
    transform: scale(1.02);
    /* 添加轻微的阴影 */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.pill-nav a.active {
    font-weight: 600;
    color: white;
    /* 激活状态下的轻微放大 */
    transform: scale(1.05);
    /* 增强文字阴影 */
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* 滑动指示器 - iOS液态玻璃弹性效果 */
.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    /* 使用弹性缓动函数实现液态玻璃效果 */
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    pointer-events: none;
    /* 添加轻微的模糊效果增强液态感 */
    backdrop-filter: blur(2px);
    /* 添加渐变背景增强玻璃质感 */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.15) 100%);
    /* 添加边框增强玻璃效果 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* 添加阴影增强立体感 */
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 导航指示器兼容性降级 */
@supports not (backdrop-filter: blur(1px)) {
    .nav-indicator {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.35) 0%, 
            rgba(255, 255, 255, 0.25) 50%, 
            rgba(255, 255, 255, 0.3) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* ====== 模糊文本容器 ====== */
.blur-text {
    /* 现代浏览器使用backdrop-filter */
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
}

/* 不支持backdrop-filter的浏览器降级方案 */
@supports not (backdrop-filter: blur(1px)) {
    .blur-text {
        background-color: rgba(255, 255, 255, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

/* ====== 页面过渡效果 ====== */
.fade-transition {
    transition: opacity 0.5s ease-in-out;
}

.page {
    opacity: 0;
    display: none;
    position: absolute;
    width: 100%;
}

.page.active {
    opacity: 1;
    display: block;
    z-index: 1;
}

/* ====== 背景样式 ====== */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -2;
}

/* 背景图片样式 */
#bgImage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

/* ====== 黑夜模式样式 ====== */
.night-mode .background-overlay,
.night-mode #bgImage {
    filter: brightness(0.4);
}

.night-mode .blur-text {
    background-color: rgba(36, 36, 36, 0.2);
}

.night-mode .pill-nav {
    background-color: rgba(36, 36, 36, 0.2);
}

.night-mode footer {
    color: rgba(255, 255, 255, 0.4);
}

/* ====== 界面隐藏动画 ====== */
.hidden-content {
    opacity: 0;
    pointer-events: none;
}

/* ====== 初始隐藏元素 ====== */
#mainContent, #bgOverlay {
    display: none;
}

/* ====== 其他工具类 ====== */

.flex-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    height: 20px;
}

/* ====== 赞助弹窗样式 ====== */
.donate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.donate-modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
    text-align: left;
}

.legal-text {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
}

.legal-text p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.legal-text strong {
    color: #2c3e50;
}

.donate-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.donate-btn-cancel {
    background: #e0e0e0;
}

.donate-btn-confirm {
    background-color: #bdc3c7;
    color: white;
    cursor: not-allowed;
}

.donate-btn-confirm:not([disabled]) {
    background-color: #ff69b4 !important;
    cursor: pointer !important;
}

#agreeCheckbox {
    cursor: pointer;
}

/* ====== 二维码弹窗样式 ====== */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.qr-modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
}

.qr-image {
    width: 250px;
    height: 300px;
    display: block;
    margin: 0 auto 15px;
}

.qr-close-btn {
    padding: 8px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ====== 响应式设计 - 平板和小屏幕 ====== */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .blur-text {
        padding: 16px;
    }
    

    
    .pill-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pill-nav a {
        width: auto;
        text-align: center;
        margin: 0 4px 8px 4px;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ====== 移动设备适配 ====== */
@media (max-width: 768px) {
    /* 视口适配 - 移除底部多余空间 */
    body {
        padding-bottom: env(safe-area-inset-bottom, 0px); /* 移除底部内边距 */
    }
    
    /* 导航栏调整 */
    .pill-nav {
        position: relative;
        width: 100%;
        border-radius: 20px;
        padding: 5px;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0);
        z-index: 50;
        margin: 0 auto 10px auto;
        max-width: 90%;
    }
    
    /* 移动端header调整 */
    header {
        margin-bottom: 0.2rem !important;
    }
    
    header .mb-6 {
        margin-bottom: 0.2rem !important;
    }
    
    /* 导航栏与header更紧密 */
    .pill-nav {
        margin-top: -38px !important;
    }
    
    .pill-nav a {
        margin: 0 2px;
        font-size: 12px;
        padding: 6px 10px;
        min-height: auto;
        min-width: auto;
    }
    
    /* 内容区域高度调整 - 增加可滚动空间 */
    .page {
        max-height: calc(100vh - 80px); /* 进一步减少底部预留空间，增加内容显示区域 */
        overflow-y: auto;
        min-height: 280px;
    }
    
    /* 公告区域特殊高度设置 */
    #announcement {
        max-height: calc(100vh - 100px) !important; /* 进一步减少底部预留空间 */
        min-height: 350px !important;
    }
    
    /* 主内容容器调整 - 移动端优化 */
    #mainContent {
        padding-top: 0.25rem !important;
        padding-bottom: 1rem !important; /* 减少底部内边距，增加内容显示空间 */
        margin-bottom: 4px !important; /* 减少底部外边距 */
    }
    
    /* 页面内容区域优化 */
    .page {
        margin-bottom: 12px !important; /* 为页面内容增加底部边距 */
    }
    
    /* 页脚调整 - 移动端优化，移除底部空白 */
    footer {
        margin-bottom: 0 !important; /* 确保无底部边距 */
        position: relative;
        padding: 6px 12px 2px 12px !important; /* 进一步缩小内边距 */
        margin-top: 8px !important; /* 减少上边距，为主内容留出更多空间 */
        font-size: 10px !important; /* 缩小字体 */
        line-height: 1.2 !important; /* 更紧凑的行高 */
    }
    
    /* 移动端脚页文字优化 */
    footer p {
        margin-bottom: 4px !important; /* 减少段落间距 */
        font-size: 10px !important;
    }
    
    /* 移除脚页最后一个段落的底部边距 */
    footer p:last-child {
        margin-bottom: 0 !important; /* 最后一个段落无底部边距 */
    }
    
    /* 移动端脚页链接优化 */
    footer .foot_text {
        font-size: 10px !important;
        font-weight: 400 !important; /* 减轻字重 */
    }
}

/* ====== 超小屏幕适配 (450px及以下) ====== */
@media (max-width: 450px) {
    /* 导航栏调整 - 避免与主内容重叠 */
    .pill-nav {
        margin-top: -20px !important; /* 减少负边距，避免重叠 */
        margin-bottom: 15px !important; /* 增加底部间距 */
    }
    
    /* 主内容区域调整 */
    #mainContent {
        padding-top: 1rem !important; /* 增加顶部内边距 */
    }
    
    /* 主页标题区域调整 - 保持左右布局 */
    .flex.justify-between.items-center.mb-6 {
        margin-bottom: 1rem !important; /* 减少底部边距 */
        flex-direction: row !important; /* 保持左右排列 */
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* 主页文字区域调整 */
    .flex.justify-between.items-center.mb-6 .text-white {
        flex: 1;
        margin-right: 8px !important; /* 与图片保持间距 */
    }
    
    /* 主页标题字体调整 */
    .flex.justify-between.items-center.mb-6 h1 {
        font-size: 1.5rem !important; /* 缩小标题字体 */
        margin-bottom: 0.25rem !important;
    }
    
    /* 主页副标题调整 */
    .flex.justify-between.items-center.mb-6 p {
        font-size: 0.75rem !important; /* 缩小副标题字体 */
        margin-bottom: 0.125rem !important;
    }
    
    /* 主页图片调整 - 等比例缩放 */
    .flex.justify-between.items-center.mb-6 img {
        max-width: 150px !important; /* 最大宽度限制 */
        max-height: 150px !important; /* 最大高度限制 */
        width: auto !important; /* 自动宽度 */
        height: auto !important; /* 自动高度 */
        flex-shrink: 0; /* 防止图片被压缩 */
        object-fit: contain; /* 保持宽高比 */
    }
}

@media (max-width: 768px) {
    /* 隐藏/主题/声音按钮位置调整 - 移动端增加间距 */
    #themeToggle, #hideButton, #soundToggle {
        top: 16px;
        z-index: 100;
        min-width: 32px !important; /* 设置最小宽度 */
        min-height: 32px !important; /* 设置最小高度 */
    }
    
    #soundToggle {
        right: 100px; /* 增加右边距，从84px增加到100px */
    }
    
    #themeToggle {
        right: 58px; /* 增加右边距，从50px增加到58px */
    }
    
    #hideButton {
        right: 16px; /* 保持原有位置 */
    }
}

/* ====== 点击波纹效果 ====== */
.ripple {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
    z-index: 9999;
}

@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ====== 主题切换、声音控制和隐藏按钮 ====== */
#themeToggle, #hideButton, #soundToggle {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* 控制按钮兼容性降级 */
@supports not (backdrop-filter: blur(1px)) {
    #themeToggle, #hideButton, #soundToggle {
        background: rgba(255, 255, 255, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    #themeToggle:hover, #hideButton:hover, #soundToggle:hover {
        background: rgba(255, 255, 255, 0.35);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    }
}

/* 移动端按钮优化 - 确保最小触控区域 */
@media (max-width: 768px) {
    #themeToggle, #hideButton, #soundToggle {
        width: 36px !important; /* 稍微缩小按钮 */
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        /* 确保触控区域足够大 */
        padding: 2px !important;
    }
}

#themeToggle:hover, #hideButton:hover, #soundToggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ====== 移除主页div的玻璃效果 ====== */
#mainContent {
    backdrop-filter: none;
    background: transparent !important;
    border: none;
    box-shadow: none;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* 移除主页div的伪元素效果 */
#mainContent::before {
    display: none;
}

footer {
    background: transparent !important;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 8px 16px;
    position: relative;
    z-index: 10;
    /* 防止选中复制 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 防止拖拽 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 桌面端页脚优化 - 减少空域 */
@media (min-width: 769px) {
    footer {
        padding: 6px 16px !important;
        margin-top: 0.5rem !important;
    }
    
    footer p {
        margin-bottom: 6px !important;
    }
    
    footer p:last-child {
        margin-bottom: 0 !important;
    }
    
    /* 桌面端内容区域高度优化 */
    .page {
        max-height: calc(100vh - 60px) !important; /* 桌面端进一步增加内容区域 */
    }
    
    #announcement {
        max-height: calc(100vh - 80px) !important; /* 桌面端公告区域高度优化 */
    }
}

/* 增强页脚文字可读性 */
footer p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    margin-bottom: 8px;
}

.foot_text {
    color: #ffb3d9 !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.foot_text:hover {
    color: #ff69b4 !important;
    text-shadow: 0 0 8px rgba(255, 105, 180, 0.7);
}

/* ====== 背景液态玻璃效果 ====== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 80%
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0.7;
    transition: opacity 0.5s ease;
}

/* 背景效果兼容性降级 */
@supports not (backdrop-filter: blur(1px)) {
    body::before {
        background: radial-gradient(
            circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 80%
        );
        opacity: 0.8;
    }
}

/* 背景液态流动动画 */
@keyframes liquid-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background: linear-gradient(
        135deg,
        rgba(100, 150, 255, 0.2) 0%,
        rgba(200, 100, 255, 0.15) 30%,
        rgba(255, 100, 150, 0.1) 70%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: liquid-flow 15s ease infinite;
}

/* ====== 保留其他元素的液态玻璃效果 ====== */
/* 卡片液态玻璃效果 */
/* ====== 修复页面显示问题 ====== */
.page {
    opacity: 0;
    display: none; /* 初始状态隐藏 */
    position: absolute;
    width: 100%;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page.active {
    opacity: 1;
    display: block; /* 激活时显示 */
    z-index: 1;
}

/* 液态进入动画 */
.page-entering {
    animation: page-enter 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes page-enter {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}



/* 指示器液态效果增强 */
.nav-indicator {
    transition: all 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: center;
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%
    ) !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* 卡片液态悬停效果 */
.bg-white\/10 {
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bg-white\/10:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.25),
        inset 0 2px 3px rgba(255, 255, 255, 0.4);
}

/* 导航栏液态玻璃效果 */
.pill-nav {
    backdrop-filter: blur(16px) saturate(200%);
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* 指示器液态玻璃效果 */
.nav-indicator {
    backdrop-filter: blur(12px) saturate(220%);
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%
    ) !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* 按钮液态玻璃效果 */
#themeToggle, #hideButton, #soundToggle {
    backdrop-filter: blur(16px) saturate(200%);
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#themeToggle:hover, #hideButton:hover, #soundToggle:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.25),
        inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* ====== 液态水波纹效果 ====== */
.liquid-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.2) 40%,
        transparent 70%
    );
    transform: scale(0);
    pointer-events: none;
    z-index: 9998;
    animation: liquid-ripple-animation 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes liquid-ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    70% {
        opacity: 0.7;
    }
    100% {
        transform: scale(8);
        opacity: 0;
    }
}

/* ====== 导航栏液态效果增强 ====== */
.pill-nav a {
    position: relative;
    overflow: hidden;
}



/* 页面液态过渡效果 */
.page {
    opacity: 0;
    display: none;
    position: absolute;
    width: 100%;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page.active {
    opacity: 1;
    display: block;
    z-index: 1;
    transform: translateY(0);
}

.page-entering {
    animation: page-enter 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.page-leaving {
    animation: page-leave 0.4s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

@keyframes page-enter {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes page-leave {
    0% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
        filter: blur(5px);
    }
}

/* 指示器液态效果增强 */
.nav-indicator {
    transition: all 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: center;
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%
    ) !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* 卡片液态悬停效果增强 */
.bg-white\/10 {
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bg-white\/10:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.25),
        inset 0 2px 3px rgba(255, 255, 255, 0.4);
}

/* ====== 液态背景动画增强 ====== */
@keyframes liquid-pulse {
    0% {
        opacity: 0.7;
        backdrop-filter: blur(20px) saturate(180%);
    }
    50% {
        opacity: 0.9;
        backdrop-filter: blur(25px) saturate(220%);
    }
    100% {
        opacity: 0.7;
        backdrop-filter: blur(20px) saturate(180%);
    }
}

body::before {
    animation: liquid-pulse 8s ease-in-out infinite;
}

/* 页面切换时背景液态效果增强 */
body.page-changing::before {
    animation: liquid-pulse 2s ease-in-out infinite;
}

/* 导航栏链接悬停液态效果 */
.nav-link {
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav-link:hover {
    transform: translateY(-2px) scale(1.05);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.nav-link.active {
    transform: translateY(-3px) scale(1.08);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}


/* ====== 声音按钮状态指示 ====== */
#soundToggle .fa-volume-high {
    color: #ff69b4; /* 粉色表示有声音 */
    text-shadow: 0 0 8px rgba(255, 105, 180, 0.7);
}

#soundToggle .fa-volume-xmark {
    color: #ccc; /* 灰色表示静音 */
}

/* 声音按钮悬停效果 */
#soundToggle:hover .fa-volume-high {
    color: #ffb3d9;
    transform: scale(1.2);
}

#soundToggle:hover .fa-volume-xmark {
    color: #fff;
    transform: scale(1.2);
}
/* 深色模式切换动画 */
.theme-transition-overlay {
    position: fixed;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: liquid-expand 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    top: var(--button-y);
    left: var(--button-x);
}

.night-transition {
    background: radial-gradient(circle, rgba(30,30,50,0.9) 0%, transparent 70%);
}

.day-transition {
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
}

@keyframes liquid-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    70% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}
/* 增强导航栏玻璃效果 */
.pill-nav {
    backdrop-filter: blur(12px) saturate(180%);
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.25),
        0 0 16px rgba(255, 182, 193, 0.3); /* 添加粉色光晕 */
    transition: all 0.4s ease;
}

/* 增强指示器效果 */
.nav-indicator {
    backdrop-filter: blur(10px) saturate(200%);
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%
    ) !important;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 3px rgba(255, 255, 255, 0.4);
    height: 90%;
    top: 5%;
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 导航链接悬停效果 */
.pill-nav a:hover {
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1) !important;
}

/* 深色模式导航调整 */
.night-mode .pill-nav {
    background: rgba(30, 30, 50, 0.2) !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.night-mode .nav-indicator {
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.1) 100%
    ) !important;
}
/* 16+ 模态框样式 */
#ageLimitModal {
    display: none;
}

#ageLimitModal.show {
    display: flex;
}

/* 条款模态框样式 */
.donate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.terms-modal-content {
    max-width: 90%; /* 增大模态框宽度 */
    max-height: 90vh; /* 增大模态框高度 */
    width: 100%;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terms-content {
    flex: 1;
    overflow-y: auto; /* 使条款内容区域可滚动 */
    margin-bottom: 20px;
    padding-right: 10px; /* 防止滚动条遮挡内容 */
}

.terms-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.terms-content strong {
    color: #333;
    font-weight: 600;
}

/* 滚动条美化 */
.terms-content::-webkit-scrollbar {
    width: 8px;
}

.terms-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 16+ 图标按钮 */
#ageLimitButton {
    position: fixed;
    bottom: 4px;
    left: 4px;
    z-index: 50;
    width: 16vw; /* 使用视口宽度百分比 */
    max-width: 80px; /* 最大宽度 */
    min-width: 1px; /* 最小宽度 */
    height: auto; /* 高度自适应 */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease; /* 添加过渡效果 */
}

#ageLimitButton img {
    width: 100%;
    height: auto;
    display: block;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #ageLimitButton {
        width: 9vw;
        max-width: 80px; /* 最大宽度 */
        min-width: 1px; /* 最小宽度 */
    }
}

/* 超小屏幕适配 (450px及以下) */
@media (max-width: 450px) {
    #ageLimitButton {
        width: 8vw;
        max-width: 30px; /* 最大宽度 */
        min-width: 1px; /* 最小宽度 */
    }
}

/* 加载进度条样式 */
#loadingContainer {
    transition: opacity 0.5s ease;
}

#progressBar {
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

/* 添加加载动画的动画效果 */
#loadingContainer {
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#loadingContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 10px 20px;
    backdrop-filter: blur(5px);
}

/* 加载容器兼容性降级 */
@supports not (backdrop-filter: blur(1px)) {
    #loadingContainer {
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.loading-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

#progressContainer {
    width: 160px;
}

/* 图片加载失败样式 */
.image-failed {
    opacity: 0.5;
    border: 2px solid red;
}








