﻿/* 底部导航栏样式 - 高级设计 */
.bottom-navigation {
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    height: 68px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    backdrop-filter: blur(30px) saturate(200%);
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 16px;
    z-index: 9999 !important;
    box-shadow:
        0 -8px 32px rgba(0, 0, 0, 0.12),
        0 -2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
}

/* 导航项 */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    min-width: 68px;
    height: auto;
    overflow: visible;
}

/* 导航图标容器 */
.nav-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.04) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
}

.nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.7s ease;
}

/* 导航图片 */
.nav-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
    filter: brightness(1) saturate(1);
}

/* 导航标签 */
.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8b92a9;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.3px;
    text-align: center;
    white-space: nowrap;
}

/* 活跃状态指示器 */
.nav-active-indicator {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 活跃状态 */
.nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateY(-1px);
}

.nav-item.active .nav-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow:
        0 8px 24px rgba(102, 126, 234, 0.35),
        0 4px 12px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}

.nav-item.active .nav-img {
    filter: brightness(1.2) saturate(1.3);
    transform: scale(1.05);
}

.nav-item.active .nav-label {
    color: #667eea;
    font-weight: 700;
}

.nav-item.active .nav-active-indicator {
    transform: translateX(-50%) scaleX(1);
}

/* 悬停效果 */
.nav-item:hover:not(.active) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.04) 100%);
    transform: translateY(0px);
}

.nav-item:hover:not(.active) .nav-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.12) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.nav-item:hover:not(.active) .nav-icon::before {
    left: 100%;
}

.nav-item:hover:not(.active) .nav-img {
    filter: brightness(1.1) saturate(1.15);
    transform: scale(1.02);
}

.nav-item:hover:not(.active) .nav-label {
    color: #667eea;
    font-weight: 700;
}

/* 点击效果 */
.nav-item:active {
    transform: scale(0.92);
}

.nav-item:active .nav-icon {
    transform: scale(0.95);
}

/* 不同导航项的个性化颜色 */
.nav-item[data-page="create"].active .nav-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.35),
        0 4px 12px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.nav-item[data-page="ai"].active .nav-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.35),
        0 4px 12px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.nav-item[data-page="template"].active .nav-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow:
        0 8px 24px rgba(139, 92, 246, 0.35),
        0 4px 12px rgba(139, 92, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.nav-item[data-page="profile"].active .nav-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow:
        0 8px 24px rgba(245, 158, 11, 0.35),
        0 4px 12px rgba(245, 158, 11, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* 在大屏幕上居中显示 */
@media (min-width: 431px) {
    .bottom-navigation {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 24px 24px 0 0;
        border-left: 1px solid rgba(102, 126, 234, 0.2);
        border-right: 1px solid rgba(102, 126, 234, 0.2);
        box-shadow: 
            0 -12px 40px rgba(0, 0, 0, 0.15), 
            0 -4px 16px rgba(0, 0, 0, 0.08),
            0 0 0 1px rgba(255, 255, 255, 0.3);
    }
}



/* 确保body为导航栏留出空间 */
body {
    padding-bottom: 0 !important; /* 移除body的padding */
}

/* 确保所有内容容器都为导航栏留出空间 */
.main-content,
.page-container,
.container {
    margin-bottom: 0 !important;
    padding-bottom: 68px !important; /* 与导航栏高度一致 */
}

/* 移除任何可能影响导航栏的样式 */
.app-container {
    padding-bottom: 68px !important; /* 与导航栏高度一致 */
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .bottom-navigation {
        background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.95) 100%);
        border-top-color: rgba(75, 85, 99, 0.3);
    }
    
    .nav-icon {
        background: linear-gradient(135deg, rgba(75, 85, 99, 0.2) 0%, rgba(55, 65, 81, 0.1) 100%);
    }
    
    .nav-icon i {
        color: #9ca3af;
    }
    
    .nav-label {
        color: #9ca3af;
    }
    
    .nav-item.active {
        background: rgba(102, 126, 234, 0.15);
    }
    
    .nav-item.active .nav-label {
        color: #667eea;
    }
}

/* 动画效果 */
/* 移除底部导航栏的从下到上动画效果 */
/* @keyframes navItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-item {
    animation: navItemFadeIn 0.6s ease-out forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; } */

/* 波纹效果 */
.nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.nav-item:active::after {
    width: 60px;
    height: 60px;
}

/* 炫酷的选中动画 */
@keyframes navIconPulse {
    0% {
        box-shadow:
            0 8px 24px rgba(102, 126, 234, 0.35),
            0 4px 12px rgba(102, 126, 234, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow:
            0 12px 32px rgba(102, 126, 234, 0.45),
            0 6px 16px rgba(102, 126, 234, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    100% {
        box-shadow:
            0 8px 24px rgba(102, 126, 234, 0.35),
            0 4px 12px rgba(102, 126, 234, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* 指示器动画 */
@keyframes indicatorExpand {
    0% {
        transform: translateX(-50%) scaleX(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 1;
    }
}

.nav-item.active .nav-active-indicator {
    animation: indicatorExpand 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 图标旋转效果 */
@keyframes iconRotate {
    0% {
        transform: scale(1) rotateY(0deg);
    }
    50% {
        transform: scale(1.08) rotateY(180deg);
    }
    100% {
        transform: scale(1.08) rotateY(360deg);
    }
}

.nav-item.active .nav-icon {
    animation: iconRotate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}