/* 移动端样式 */

/* 基础设置 - 确保底部菜单显示 */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    padding: 8px 0 4px;
    border-top: 1px solid #dee2e6;
}

/* 在桌面端隐藏底部菜单 */
@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6c757d;
    text-decoration: none;
    flex: 1;
    transition: all 0.3s;
    padding: 4px 0;
}

.bottom-nav-item.active {
    color: #007bff;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.bottom-nav-text {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-icon-wrapper {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@media (max-width: 991.98px) {
    /* 导航栏优化 */
    .main-header.navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-brand {
        margin-right: 0;
    }
    
    .brand-icon {
        font-size: 1.5rem;
        margin-right: 8px;
    }
    
    .brand-text {
        font-size: 1.2rem;
    }
    
    .brand-subtext {
        display: none;
    }
    
    /* 汉堡菜单按钮 */
    .navbar-toggler {
        position: relative;
        padding: 0.25rem 0.75rem;
        border: 1px solid transparent;
    }
    
    /* 汉堡菜单展开时的菜单 */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 3px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top: 1px solid #dee2e6;
        max-height: 70vh; /* 限制高度 */
        overflow-y: auto;
    }
    
    /* 移动端菜单项 - 确保文字显示 */
    .navbar-nav {
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f8f9fa;
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* 移动端菜单文字始终显示 */
    .navbar-nav .nav-text {
        display: inline !important;
        font-size: 0.9rem;
    }
    
    .navbar-nav .nav-link i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* 下拉菜单在移动端全宽显示 */
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        border: none;
        box-shadow: none;
        background-color: #f8f9fa;
        padding-left: 1.5rem;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.5rem 1rem;
        padding-left: 2rem;
    }
    
    /* 用户菜单调整 */
    .navbar-nav.ml-auto {
        flex-direction: row;
        justify-content: flex-end;
        padding: 0;
    }
    
    .navbar-nav.ml-auto .nav-item {
        width: auto;
    }
    
    .navbar-nav.ml-auto .nav-link {
        border-bottom: none;
        padding: 0.5rem 0.75rem;
    }
    
    .user-name {
        display: none;
    }
    
    .user-avatar,
    .user-icon {
        width: 28px;
        height: 28px;
        font-size: 1.3rem;
    }
    
    /* 内容区域调整 */
    .content-wrapper {
        padding-bottom: 70px; /* 为底部菜单留出空间 */
    }

    .content-wrapper .content {
        padding-left: 0;
        padding-right: 0;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .content-header .breadcrumb {
        font-size: 0.875rem;
        /* margin-top: 0.5rem; */
    }
    
    /* 隐藏桌面端Footer */
    .main-footer {
        display: none;
    }
}

/* 移动端卡片优化 */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 0.75rem;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .stats-card .card-body {
        padding: 0.75rem;
    }
    
    .stats-icon {
        font-size: 1.8rem;
    }
    
    .stats-value {
        font-size: 1.3rem;
    }
    
    .stats-label {
        font-size: 0.7rem;
    }
}

/* 移动端表单优化 */
@media (max-width: 767.98px) {
    .form-control, .select2-container--bootstrap4 .select2-selection {
        /* height: calc(2rem + 2px); */
        font-size: 0.875rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
}

/* 移动端表格优化 */
@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_length select {
        width: 70px;
    }
    
    .dataTables_filter input {
        width: 150px;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .navbar-brand .brand-text {
        font-size: 1rem;
    }
    
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-text {
        font-size: 0.65rem;
    }
    
    .navbar-nav .nav-text {
        font-size: 0.85rem;
    }
}

/* toast 移动端：屏幕宽度 ≤ 768px 时生效 */
@media (max-width: 768px) {
    /* 容器宽度减小，使其更紧凑 */
    #toast-container {
        width: 90%;
        max-width: 320px;
        font-size: 13px;
    }

    /* 单个通知条 */
    .toast {
        opacity: 0.9;          /* 调整透明度（0~1） */
        background-color: rgba(0, 0, 0, 0.85);  /* 半透明背景 */
        padding: 8px 12px;     /* 减小内边距 */
        border-radius: 8px;    /* 圆角更圆润 */
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    /* 标题字体略小 */
    .toast-title {
        font-size: 1rem;
        font-weight: bold;
    }

    /* 消息内容字体 */
    .toast-message {
        font-size: 0.85rem;
        word-break: break-word;
    }

    /* 关闭按钮大小调整（如果有） */
    .toast-close-button {
        font-size: 18px;
        opacity: 0.7;
    }
}