/* 移动端底部导航 - 仅在手机等小屏设备显示 */

/* 默认隐藏（PC端） */
.mobile-bottom-nav,
.mobile-submenu-overlay,
.mobile-submenu-panel,
.mobile-login-modal {
    display: none;
}

@media (max-width: 768px) {
    /* 防止底部导航遮挡页面内容，给 body 增加底部内边距 */
    body {
        padding-bottom: 80px;
    }

    /* 手机端隐藏顶部导航栏，使用底部导航替代 */
    .navbar {
        display: none;
    }

    /* 手机端统一隐藏非功能性元素 */
    .mobile-hide {
        display: none !important;
    }

    /* 手机端隐藏 PC 端 footer，因为已有底部导航 */
    .footer {
        display: none !important;
    }

    /* 底部导航容器 */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        height: 64px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-bottom-nav .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        border: none;
        background: transparent;
        color: #666;
        text-decoration: none;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav .mobile-nav-item:active {
        background: rgba(102, 126, 234, 0.08);
    }

    .mobile-bottom-nav .mobile-nav-item.active,
    .mobile-bottom-nav .mobile-nav-item.router-link-active {
        color: #667eea;
    }

    .mobile-bottom-nav .mobile-nav-icon {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-bottom-nav .mobile-nav-label {
        font-size: 11px;
        line-height: 1;
    }

    /* 二级菜单遮罩层 */
    .mobile-submenu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .mobile-submenu-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* 二级菜单面板 - 默认隐藏在下方，宽度随内容自适应并居中 */
    .mobile-submenu-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 50%;
        right: auto;
        bottom: 0;
        z-index: 10000;
        width: auto;
        min-width: 160px;
        max-width: 85vw;
        max-height: 70vh;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
        transform: translateX(-50%) translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-submenu-panel.show {
        transform: translateX(-50%) translateY(0);
    }

    /* 二级菜单头部 */
    .mobile-submenu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-submenu-title {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }

    .mobile-submenu-close {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        color: #666;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-submenu-close:active {
        background: #e8e8e8;
    }

    /* 二级菜单内容 */
    .mobile-submenu-content {
        padding: 4px 0 12px;
        overflow-y: auto;
    }

    .mobile-submenu-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 14px 20px;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        white-space: nowrap;
        transition: background 0.2s ease;
    }

    .mobile-submenu-link:active {
        background: rgba(102, 126, 234, 0.08);
    }

    .mobile-submenu-link-arrow {
        margin-left: 8px;
        color: #999;
        font-size: 14px;
    }

    /* 移动端登录弹窗 */
    .mobile-login-modal {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10001;
        align-items: flex-end;
        justify-content: center;
    }

    .mobile-login-modal.show {
        display: flex;
    }

    .mobile-login-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .mobile-login-modal.show .mobile-login-overlay {
        opacity: 1;
    }

    .mobile-login-panel {
        position: relative;
        z-index: 1;
        width: auto;
        min-width: 280px;
        max-width: 90vw;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-login-modal.show .mobile-login-panel {
        transform: translateY(0);
    }

    .mobile-login-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-login-title {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }

    .mobile-login-close {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        color: #666;
        font-size: 14px;
        cursor: pointer;
    }

    .mobile-login-body {
        padding: 20px;
    }

    .mobile-login-form-group {
        margin-bottom: 16px;
    }

    .mobile-login-form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 14px;
        color: #555;
    }

    .mobile-login-form-group input {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        font-size: 15px;
        outline: none;
        transition: border-color 0.2s ease;
    }

    .mobile-login-form-group input:focus {
        border-color: #667eea;
    }

    .mobile-login-error {
        min-height: 20px;
        margin-bottom: 12px;
        color: #e74c3c;
        font-size: 13px;
    }

    .mobile-login-submit {
        width: 100%;
        padding: 13px 0;
        border: none;
        border-radius: 10px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .mobile-login-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .mobile-login-links {
        margin-top: 16px;
        text-align: center;
    }

    .mobile-login-links a {
        color: #667eea;
        font-size: 13px;
        text-decoration: none;
    }
}
