/* --- 主要内容区域的调整 --- */
body {
    /* 为底部导航栏预留空间，并考虑底部安全区域和额外10px的间距 */
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 10px);
}


/* --- 响应式应用导航栏 --- */
.app-nav {
    /* 移动端优先：从底部导航栏的样式开始 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0; 
    height: calc(70px + env(safe-area-inset-bottom, 0px)); 
    padding-bottom: env(safe-area-inset-bottom, 0px); 
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid rgba(0, 0, 0, 0.05);

    /* --- 新增/修改的样式 --- */
    opacity: 0; /* 初始状态：完全透明 */
    transform: translateY(20px); /* 初始状态：稍微向下偏移20像素 */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out; /* 添加平滑过渡效果 */
}

/* 当页面加载完成后，为body添加.loaded类，触发导航栏出现动画 */
body.loaded .app-nav {
    opacity: 1; /* 最终状态：完全不透明 */
    transform: translateY(0); /* 最终状态：回到原始位置 */
}


.app-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    /* 取消 translateY，因为父元素已经上移 */
}

.app-nav a .icon {
    font-size: 24px; 
    margin-bottom: 4px;
}

/* 当前激活链接的样式 */
.app-nav a.active {
    color: #667eea;
    transform: scale(1.1);
}


/* --- 电脑端布局 (侧边栏) --- */
@media (min-width: 769px) {
    /* 重置为电脑端样式 */
    body {
        padding-bottom: 0;
        padding-left: 220px;
    }

    .app-nav {
        top: 0;
        left: 0;
        right: auto; 
        bottom: auto; 
        width: 220px;
        height: 100vh;
        padding-bottom: 0; 
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding-top: 50px;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.08);
        border-top: none;
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        
        /* 电脑端直接显示，无需动画 */
        opacity: 1;
        transform: translateY(0);
    }

    .app-nav a {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        font-size: 16px;
        padding: 20px 30px;
        border-radius: 10px;
        margin: 5px 15px;
    }

    .app-nav a .icon {
        font-size: 22px;
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .app-nav a.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        transform: scale(1.02);
    }
}