﻿
/* ========== 页脚 Footer ========== */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--iphone-width);
    height: var(--footer-total-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 左侧滑动导航 */
.footer-nav-scroll {
    flex: 5;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .footer-nav-scroll::-webkit-scrollbar {
        display: none;
    }

.footer-nav-list {
    display: flex;
    height: var(--footer-height);
    padding: 0 4px;
    align-items: center;
}

.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: var(--nav-item-min-width);
    max-width: var(--nav-item-max-width);
    width: var(--nav-item-width);
    height: 100%;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

    .footer-nav-item:active {
        transform: scale(0.95);
    }

    .footer-nav-item .nav-icon-wrapper {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-tertiary);
        border-radius: 50%;
        margin-bottom: 5px;
        transition: all 0.3s ease;
        position: relative;
    }

    .footer-nav-item .nav-icon {
        font-size: 22px;
        color: var(--text-muted);
        transition: all 0.3s ease;
    }

    .footer-nav-item .nav-text {
        font-size: 11px;
        color: var(--text-muted);
        white-space: nowrap;
        transition: all 0.2s ease;
        font-weight: 500;
    }

    .footer-nav-item .nav-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
        color: white;
        font-size: 10px;
        font-weight: 600;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
        border: 2px solid var(--bg-primary);
        z-index: 10;
    }

    /* 激活状态 */
    .footer-nav-item.active .nav-icon-wrapper {
        background: linear-gradient(135deg, var(--tech-blue) 0%, var(--discovery-blue) 100%);
        box-shadow: 0 4px 12px rgba(0, 102, 204, 0.35);
        transform: translateY(-2px);
    }
    /* ai */
    .footer-nav-item.ai .nav-icon-wrapper {
        background: linear-gradient(135deg, var(--tech-green) 0%, var(--discovery-green) 100%);
        box-shadow: 0 4px 12px rgba(0, 204, 102, 0.35);
        transform: translateY(-2px);
    }

    .footer-nav-item.ai i {
        color: white;
    }

    .footer-nav-item.active .nav-icon {
        color: white;
    }

    .footer-nav-item.active .nav-text {
        color: var(--tech-blue);
        font-weight: 600;
    }

/* 右侧"全部"按钮 - 与左侧导航项尺寸一致 */
.footer-all-btn {
    min-width: var(--nav-item-min-width);
    max-width: var(--nav-item-max-width);
    width: var(--nav-item-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lighter-blue) 0%, var(--light-blue) 100%);
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

    .footer-all-btn:active {
        background: linear-gradient(135deg, var(--light-blue) 0%, #d4e9ff 100%);
    }

    .footer-all-btn .nav-icon-wrapper {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--tech-blue) 0%, var(--discovery-blue) 100%);
        border-radius: 50%;
        margin-bottom: 5px;
        box-shadow: 0 3px 10px rgba(0, 102, 204, 0.3);
        transition: all 0.2s ease;
    }

    .footer-all-btn:active .nav-icon-wrapper {
        transform: scale(0.95);
        box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
    }

    .footer-all-btn .nav-icon {
        font-size: 20px;
        color: white;
    }

    .footer-all-btn .nav-text {
        font-size: 11px;
        color: var(--tech-blue);
        font-weight: 600;
    }

/* ========== 全部导航弹出层 ========== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.nav-popup {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    bottom: 0;
    width: 100%;
    max-width: var(--iphone-width);
    max-height: 75vh;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    z-index: 2001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

    .nav-popup.active {
        transform: translateX(-50%) translateY(0);
    }

.nav-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.nav-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .nav-popup-close:active {
        background: var(--border-color);
        transform: scale(0.95);
    }

.nav-popup-content {
    overflow-y: auto;
    padding: 16px 20px calc(16px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}

.nav-popup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.nav-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .nav-popup-item:active {
        background: var(--bg-tertiary);
        transform: scale(0.95);
    }

    .nav-popup-item.active {
        background: linear-gradient(135deg, var(--light-blue) 0%, var(--lighter-blue) 100%);
    }

    .nav-popup-item .nav-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-tertiary);
        border-radius: 14px;
        margin-bottom: 8px;
        font-size: 22px;
        color: var(--text-secondary);
        transition: all 0.2s ease;
    }

    .nav-popup-item.active .nav-icon {
        background: linear-gradient(135deg, var(--tech-blue) 0%, var(--discovery-blue) 100%);
        color: white;
        box-shadow: var(--shadow-md);
    }
    /* ai */
    .nav-popup-item.ai .nav-icon {
        background: linear-gradient(135deg, var(--tech-green) 0%, var(--discovery-green) 100%);
        box-shadow: 0 4px 12px rgba(0, 204, 102, 0.35);
        box-shadow: var(--shadow-md);
    }

    .nav-popup-item.ai i {
        color: white;
    }

    .nav-popup-item .nav-text {
        font-size: 12px;
        color: var(--text-secondary);
        font-weight: 500;
    }

    .nav-popup-item.active .nav-text {
        color: var(--tech-blue);
        font-weight: 600;
    }

/* ========== 响应式适配 ========== */
@media (max-width: 360px) {
    .footer-nav-item {
        min-width: 56px;
    }

    .nav-popup-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 441px) {
    .mobile-container,
    .mobile-header,
    .mobile-footer,
    .nav-popup {
        max-width: 440px;
    }
}

/* ========== 动画效果 ========== */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideInUp 0.3s ease forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ========== 工具类 ========== */
.text-tech-blue {
    color: var(--tech-blue) !important;
}

.bg-tech-blue {
    background-color: var(--tech-blue) !important;
}

.gradient-tech {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
}

.shadow-tech {
    box-shadow: var(--shadow-glow) !important;
}