﻿/* 修复文字闪烁问题 - 添加初始隐藏规则 */
.mobile-text, .desktop-text {
    transition: opacity 0.2s ease;
}

/* 默认隐藏桌面文本 */
.desktop-text {
    display: none !important;
}

/* 默认显示移动文本 */
.mobile-text {
    display: inline !important;
}

/* 大屏幕显示桌面文本，隐藏移动文本 */
@media (min-width: 1200px) {
    .bottom-nav:not(.article-page) .mobile-text {
        display: none !important;
    }
    
    .bottom-nav:not(.article-page) .desktop-text {
        display: inline !important;
    }
}

/* 文章页面在大屏幕显示桌面文本，隐藏移动文本 */
@media (min-width: 1400px) {
    .bottom-nav.article-page .mobile-text {
        display: none !important;
    }
    
    .bottom-nav.article-page .desktop-text {
        display: inline !important;
    }
}

/* 修改：添加最大宽度限制为1400px */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    z-index: 1002; /* 提高z-index确保在最顶层 */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* 新增：最大宽度限制和居中 */
    max-width: 1400px;
    left: 50%;
    transform: translateX(-50%);
}

/* 修改：为返回按钮容器也添加最大宽度限制 */
.back-button-container {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1003;
    animation: fadeIn 0.3s ease;
    /* 新增：最大宽度限制和居中 */
    max-width: 1400px;
    left: 50%;
    transform: translateX(-50%);
}

/* 修改：隐藏动画需要覆盖居中的transform */
.bottom-nav.hidden {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* 文章页面特殊布局 */
.bottom-nav.article-page {
    justify-content: space-between;
    padding: 12px 10px;
}

.article-page .nav-left {
    display: flex;
    width: 50%;
    justify-content: space-around;
}

.article-page .nav-right {
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 大屏幕样式 - 修改按钮为横向排列并添加底色 */
@media (min-width: 1200px) { /* 增加断点到1200px */
    /* 非文章页面的样式 */
    .bottom-nav:not(.article-page) .nav-btn {
        flex-direction: row;
        background-color: rgba(240, 240, 240, 0.9);
        padding: 14px 24px;
        border-radius: 25px;
        margin: 0 8px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        min-width: 160px;
        max-width: 200px;
        justify-content: center;
    }
    
    /* 每个按钮不同的底色 - 非文章页面 */
    .bottom-nav:not(.article-page) .nav-btn.home {
        background-color: rgba(52, 152, 219, 0.1);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.category {
        background-color: rgba(155, 89, 182, 0.1);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.search {
        background-color: rgba(46, 204, 113, 0.1);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.my {
        background-color: rgba(231, 76, 60, 0.1);
    }
    
    .bottom-nav:not(.article-page) .nav-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .bottom-nav:not(.article-page) .nav-btn i {
        margin-bottom: 0;
        margin-right: 8px;
        font-size: 1.2rem;
    }
    
    .bottom-nav:not(.article-page) .nav-btn span {
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap; /* 防止文字换行 */
    }
    
    /* 鼠标悬停时的底色变化 - 非文章页面 */
    .bottom-nav:not(.article-page) .nav-btn.home:hover {
        background-color: rgba(52, 152, 219, 0.2);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.category:hover {
        background-color: rgba(155, 89, 182, 0.2);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.search:hover {
        background-color: rgba(46, 204, 113, 0.2);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.my:hover {
        background-color: rgba(231, 76, 60, 0.2);
    }
    
    /* 激活状态的样式 - 非文章页面 */
    .bottom-nav:not(.article-page) .nav-btn.active {
        background-color: rgba(52, 152, 219, 0.25);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.category.active {
        background-color: rgba(155, 89, 182, 0.25);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.search.active {
        background-color: rgba(46, 204, 113, 0.25);
    }
    
    .bottom-nav:not(.article-page) .nav-btn.my.active {
        background-color: rgba(231, 76, 60, 0.25);
    }
}

/* 文章页面在更宽屏幕下的样式 */
@media (min-width: 1400px) { /* 文章页面需要更宽的屏幕 */
    /* 文章页面在宽屏下的特殊处理 */
    .bottom-nav.article-page .nav-left .nav-btn {
        flex-direction: row;
        background-color: rgba(240, 240, 240, 0.9);
        padding: 12px 20px;
        border-radius: 25px;
        margin: 0 5px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        min-width: 140px;
        max-width: 160px;
        justify-content: center;
    }
    
    /* 每个按钮不同的底色 - 文章页面 */
    .bottom-nav.article-page .nav-left .nav-btn.home {
        background-color: rgba(52, 152, 219, 0.1);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.category {
        background-color: rgba(155, 89, 182, 0.1);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.search {
        background-color: rgba(46, 204, 113, 0.1);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.my {
        background-color: rgba(231, 76, 60, 0.1);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn i {
        margin-bottom: 0;
        margin-right: 8px;
        font-size: 1.2rem;
    }
    
    .bottom-nav.article-page .nav-left .nav-btn span {
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap; /* 防止文字换行 */
    }
    
    /* 鼠标悬停时的底色变化 - 文章页面 */
    .bottom-nav.article-page .nav-left .nav-btn.home:hover {
        background-color: rgba(52, 152, 219, 0.2);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.category:hover {
        background-color: rgba(155, 89, 182, 0.2);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.search:hover {
        background-color: rgba(46, 204, 113, 0.2);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.my:hover {
        background-color: rgba(231, 76, 60, 0.2);
    }
    
    /* 激活状态的样式 - 文章页面 */
    .bottom-nav.article-page .nav-left .nav-btn.active {
        background-color: rgba(52, 152, 219, 0.25);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.category.active {
        background-color: rgba(155, 89, 182, 0.25);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.search.active {
        background-color: rgba(46, 204, 113, 0.25);
    }
    
    .bottom-nav.article-page .nav-left .nav-btn.my.active {
        background-color: rgba(231, 76, 60, 0.25);
    }
    
    /* 在宽屏下调整文章页面的布局 */
    .bottom-nav.article-page .nav-left {
        width: 55%; /* 增加左侧宽度 */
        justify-content: space-between;
    }
    
    .bottom-nav.article-page .nav-right {
        width: 45%; /* 减少右侧宽度 */
    }
    
    /* 调整下载按钮的大小 */
    .download-resource-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        max-width: 220px;
    }
}

/* 超大屏幕下的进一步优化 */
@media (min-width: 1600px) {
    .bottom-nav.article-page .nav-left .nav-btn {
        min-width: 150px;
        max-width: 170px;
        padding: 12px 22px;
    }
    
    .bottom-nav.article-page .nav-left {
        width: 60%;
    }
    
    .bottom-nav.article-page .nav-right {
        width: 40%;
    }
    
    .download-resource-btn {
        padding: 14px 24px;
        font-size: 1rem;
        max-width: 240px;
    }
}

/* 下载资源按钮样式 */
.download-resource-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    width: 90%;
    max-width: 240px;
}

.download-resource-btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.4);
}

.download-resource-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.download-resource-btn i {
    font-size: 1.2rem;
}

/* 响应式调整 - 768px以下 */
@media (max-width: 768px) {
    .article-page .nav-left {
        width: 50%;
    }
    
    .article-page .nav-right {
        width: 50%;
    }
    
    .download-resource-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* 1200px-1400px之间的中间状态 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .bottom-nav.article-page .nav-left .nav-btn span.desktop-text {
        display: none !important;
    }
    
    .bottom-nav.article-page .nav-left .nav-btn span.mobile-text {
        display: inline !important;
    }
    
    /* 确保按钮不会太大 */
    .bottom-nav.article-page .nav-left .nav-btn {
        max-width: 100px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .article-page .nav-left {
        width: 50%;
    }
    
    .article-page .nav-right {
        width: 50%;
    }
    
    .download-resource-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .download-resource-btn i {
        font-size: 1rem;
    }
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 12px;
    flex: 1;
    max-width: 120px;
    position: relative;
    overflow: hidden;
}

.article-page .nav-btn {
    max-width: none;
    flex: 0 1 auto;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:hover {
    color: #3498db;
    transform: translateY(-3px);
}

.nav-btn.active {
    color: #3498db;
}

.nav-btn i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.nav-btn:hover i {
    transform: scale(1.1);
}

.nav-btn span {
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.nav-btn:hover span {
    transform: translateY(2px);
}

/* 每个按钮的独特颜色效果 */
/* 首页按钮 - 蓝色 */
.nav-btn.home {
    color: #3498db;
}

.nav-btn.home.active {
    color: #3498db;
}

.nav-btn.home:hover {
    color: #3498db;
}

.nav-btn.home::before {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), transparent);
}

.nav-btn.category {
    color: #9b59b6;
}

.nav-btn.category.active {
    color: #9b59b6;
}

.nav-btn.category:hover {
    color: #9b59b6;
}

.nav-btn.category::before {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), transparent);
}

.nav-btn.search {
    color: #2ecc71;
}

.nav-btn.search.active {
    color: #2ecc71;
}

.nav-btn.search:hover {
    color: #2ecc71;
}

.nav-btn.search::before {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), transparent);
}

.nav-btn.my {
    color: #e74c3c;
}

.nav-btn.my.active {
    color: #e74c3c;
}

.nav-btn.my:hover {
    color: #e74c3c;
}

.nav-btn.my::before {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), transparent);
}

/* 修改：返回按钮样式调整 */
.back-button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.back-button:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.5);
}

.back-button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
}

.back-button i {
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-btn {
        padding: 10px 12px;
        max-width: 110px;
    }
    
    .nav-btn span {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .bottom-nav {
        padding: 10px 0;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    
    .nav-btn {
        padding: 8px 10px;
        max-width: 100px;
    }
    
    .nav-btn i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .nav-btn span {
        font-size: 0.75rem;
    }
    
    /* 超小屏幕返回按钮 */
    .back-button {
        padding: 10px 25px;
        font-size: 0.95rem;
        bottom: 20px;
    }
}

/* 首次访问引导动画样式 */
.first-visit-guide {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    animation: guideEntrance 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    pointer-events: none;
    display: none; /* 默认隐藏，JS控制显示 */
}

.guide-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    pointer-events: auto; /* 允许内部元素响应鼠标事件 */
}

.guide-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

/* 新增：引导动画关闭按钮样式 */
.guide-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.guide-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.guide-close-btn:active {
    transform: scale(0.95);
}

.guide-arrow {
    font-size: 2.5rem;
    animation: bounce 1s infinite alternate;
    color: #ffde59;
}

.guide-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.guide-text p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 引导动画关键帧 */
@keyframes guideEntrance {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(50px) scale(0.5);
    }
    70% {
        transform: translateX(-50%) translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes bounce {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 引导动画消失效果 */
.first-visit-guide.fade-out {
    animation: guideExit 0.6s ease-in-out forwards;
}

@keyframes guideExit {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px) scale(0.8);
        visibility: hidden;
    }
}

/* 导航按钮在引导时的特效 */
.guide-active .nav-btn {
    animation: buttonPulse 0.5s ease-in-out 8;
    position: relative;
    z-index: 1003;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* 引导时的发光效果 */
.guide-active .bottom-nav {
    box-shadow: 0 -2px 20px rgba(52, 152, 219, 0.4), 0 -2px 40px rgba(52, 152, 219, 0.3);
}

/* 大屏幕下的引导动画调整 */
@media (min-width: 768px) {
    .guide-content {
        padding: 25px 30px;
        max-width: 450px;
    }
    
    .guide-close-btn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .guide-arrow {
        font-size: 3rem;
    }
    
    .guide-text h3 {
        font-size: 1.5rem;
    }
    
    .guide-text p {
        font-size: 1.1rem;
    }
}

/* 超小屏幕下的引导动画调整 */
@media (max-width: 480px) {
    .first-visit-guide {
        bottom: 80px;
        width: 90%;
    }
    
    .guide-content {
        padding: 15px;
        gap: 15px;
    }
    
    .guide-close-btn {
        top: 6px;
        right: 6px;
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .guide-arrow {
        font-size: 2rem;
    }
    
    .guide-text h3 {
        font-size: 1.1rem;
    }
    
    .guide-text p {
        font-size: 0.85rem;
    }
}