/* ====================================================================
移动端导航栏专用样式
======================================================================= 

主要特性：
1. 触摸友好的交互设计
2. 流畅的动画效果
3. 响应式布局优化
4. 深色模式支持
5. 无障碍访问优化

版本：1.0
更新日期：2024年
======================================================================= */

/* ====== 移动端导航栏基础样式 ====== */
@media (max-width: 991px) {
    .navbar-new {
        /* 移动端基础设置 */
        min-height: 70px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* 移动端容器优化 */
    .navbar-new .container {
        height: 70px;
        padding: 0 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* 移动端品牌区域优化 */
    .navbar-new .navbar-brand {
        font-size: 1.4rem;
        flex-shrink: 0;
        max-width: 60%;
    }
    
    .navbar-new .brand-logo {
        height: 45px;
        margin-right: 10px;
        transition: all 0.3s ease;
    }
    
    .navbar-new .brand-text-container {
        max-width: 200px;
        overflow: hidden;
    }
    
    .navbar-new .brand-text-chinese {
        font-size: 16px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .navbar-new .brand-text-english {
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 移动端折叠按钮样式 */
    .navbar-new .navbar-toggler {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: rgba(0, 123, 255, 0.1);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-left: auto;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
    }
    
    .navbar-new .navbar-toggler:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    }
    
    .navbar-new .navbar-toggler:hover {
        background: rgba(0, 123, 255, 0.15);
        transform: scale(1.05);
    }
    
    .navbar-new .navbar-toggler.active {
        background: rgba(0, 123, 255, 0.2);
        transform: scale(1.05);
    }
    
    .navbar-new .navbar-toggler-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        color: #007bff;
        font-size: 16px;
        transition: all 0.3s ease;
    }
    
    .navbar-new .navbar-toggler.active .navbar-toggler-icon {
        transform: rotate(180deg);
    }
    
    /* 触摸状态样式 */
    .navbar-new .navbar-toggler.touch-active {
        background: rgba(0, 123, 255, 0.25);
        transform: scale(0.95);
    }
    
    /* 移动端折叠菜单样式 */
    .navbar-new .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
        visibility: hidden;
        z-index: 1020;
    }
    
    .navbar-new .navbar-collapse.show {
        max-height: 80vh;
        opacity: 1;
        visibility: visible;
        padding: 20px 0;
    }
    
    /* 移动端导航菜单样式 */
    .navbar-new .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding: 0 20px;
        margin: 0;
    }
    
    .navbar-new .nav-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: relative;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .navbar-new .navbar-collapse.show .nav-item {
        opacity: 1;
        transform: translateY(0);
    }
    
    .navbar-new .navbar-collapse.show .nav-item:nth-child(1) { transition-delay: 0.1s; }
    .navbar-new .navbar-collapse.show .nav-item:nth-child(2) { transition-delay: 0.15s; }
    .navbar-new .navbar-collapse.show .nav-item:nth-child(3) { transition-delay: 0.2s; }
    .navbar-new .navbar-collapse.show .nav-item:nth-child(4) { transition-delay: 0.25s; }
    .navbar-new .navbar-collapse.show .nav-item:nth-child(5) { transition-delay: 0.3s; }
    
    .navbar-new .nav-item:last-child {
        border-bottom: none;
    }
    
    /* 移动端导航链接样式 */
    .navbar-new .nav-link {
        width: 100%;
        padding: 18px 20px;
        border-radius: 0;
        color: #1a1a1a !important;
        font-weight: 600;
        font-size: 16px;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        min-height: 44px;
    }
    
    .navbar-new .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 100%;
        background: linear-gradient(90deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
        transition: width 0.3s ease;
        z-index: -1;
    }
    
    .navbar-new .nav-link:hover::before,
    .navbar-new .nav-link.active::before {
        width: 100%;
    }
    
    .navbar-new .nav-link:hover {
        color: #007bff !important;
        background: transparent;
        transform: none;
        padding-left: 25px;
    }
    
    .navbar-new .nav-link.active {
        color: #007bff !important;
        background: transparent;
        padding-left: 25px;
    }
    
    /* 移动端语言切换按钮样式 */
    .navbar-new .language-switch-container {
        margin: 20px 20px 0 20px;
        padding: 16px 20px;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border: 2px solid rgba(0, 123, 255, 0.2);
        border-radius: 16px;
        width: calc(100% - 40px);
        text-align: center;
        box-shadow: 0 4px 16px rgba(0, 123, 255, 0.1);
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-new .language-switch-container:hover {
        background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
        border-color: rgba(0, 123, 255, 0.3);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
        transform: translateY(-2px);
    }
    
    .navbar-new .language-button {
        justify-content: center;
        gap: 20px;
        display: flex;
        align-items: center;
    }
    
    .navbar-new .chinese-btn,
    .navbar-new .english-text {
        font-size: 15px;
        font-weight: 600;
        padding: 8px 16px;
        border-radius: 12px;
        transition: all 0.3s ease;
        cursor: pointer;
        user-select: none;
    }
    
    .navbar-new .chinese-btn:hover,
    .navbar-new .english-text:hover {
        background: rgba(0, 123, 255, 0.1);
        color: #007bff;
    }
    
    .navbar-new .separator {
        width: 2px;
        height: 20px;
        background: linear-gradient(180deg, transparent 0%, rgba(0, 123, 255, 0.3) 50%, transparent 100%);
        border-radius: 1px;
        flex-shrink: 0;
    }
}

/* ====== 小屏幕优化 ====== */
@media (max-width: 576px) {
    .navbar-new {
        min-height: 65px;
    }
    
    .navbar-new .container {
        height: 65px;
        padding: 0 12px;
    }
    
    .navbar-new .brand-text-container {
        max-width: 180px;
    }
    
    .navbar-new .navbar-brand {
        font-size: 1.3rem;
    }
    
    .navbar-new .brand-logo {
        height: 40px;
        margin-right: 8px;
    }
    
    .navbar-new .brand-text-chinese {
        font-size: 15px;
    }
    
    .navbar-new .brand-text-english {
        font-size: 10px;
    }
    
    .navbar-new .navbar-toggler {
        width: 40px;
        height: 40px;
    }
    
    .navbar-new .navbar-toggler-icon {
        width: 18px;
        height: 18px;
        font-size: 15px;
    }
    
    .navbar-new .nav-link {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .navbar-new .language-switch-container {
        margin: 18px 18px 0 18px;
        padding: 14px 18px;
        width: calc(100% - 36px);
    }
    
    .navbar-new .chinese-btn,
    .navbar-new .english-text {
        font-size: 14px;
        padding: 6px 14px;
    }
}

/* ====== 超小屏幕优化 ====== */
@media (max-width: 480px) {
    .navbar-new {
        min-height: 60px;
    }
    
    .navbar-new .container {
        height: 60px;
        padding: 0 10px;
    }
    
    .navbar-new .brand-text-container {
        max-width: 160px;
    }
    
    .navbar-new .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-new .brand-logo {
        height: 35px;
        margin-right: 6px;
    }
    
    .navbar-new .brand-text-chinese {
        font-size: 14px;
    }
    
    .navbar-new .brand-text-english {
        font-size: 9px;
    }
    
    .navbar-new .navbar-toggler {
        width: 36px;
        height: 36px;
    }
    
    .navbar-new .navbar-toggler-icon {
        width: 16px;
        height: 16px;
        font-size: 14px;
    }
    
    .navbar-new .nav-link {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .navbar-new .language-switch-container {
        margin: 16px 16px 0 16px;
        padding: 12px 16px;
        width: calc(100% - 32px);
    }
    
    .navbar-new .chinese-btn,
    .navbar-new .english-text {
        font-size: 13px;
        padding: 5px 12px;
    }
}

/* ====== 触摸优化 ====== */
@media (hover: none) and (pointer: coarse) {
    .navbar-new .nav-link {
        min-height: 48px;
        padding: 16px 20px;
    }
    
    .navbar-new .navbar-toggler {
        min-height: 48px;
        min-width: 48px;
    }
    
    .navbar-new .language-switch-container {
        min-height: 48px;
    }
    
    /* 触摸反馈 */
    .navbar-new .nav-link:active {
        background: rgba(0, 123, 255, 0.1);
        transform: scale(0.98);
    }
    
    .navbar-new .navbar-toggler:active {
        transform: scale(0.95);
    }
    
    .navbar-new .language-switch-container:active {
        transform: scale(0.98);
    }
}

/* ====== 深色模式支持 ====== */
@media (prefers-color-scheme: dark) {
    .navbar-new {
        background: rgba(18, 18, 18, 0.98);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-new .navbar-collapse {
        background: rgba(18, 18, 18, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-new .nav-link {
        color: #ffffff !important;
    }
    
    .navbar-new .nav-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-new .language-switch-container {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        border-color: rgba(0, 123, 255, 0.3);
    }
    
    .navbar-new .chinese-btn,
    .navbar-new .english-text {
        color: #ffffff;
    }
    
    .navbar-new .chinese-btn:hover,
    .navbar-new .english-text:hover {
        background: rgba(0, 123, 255, 0.2);
        color: #ffffff;
    }
}

/* ====== 高对比度模式支持 ====== */
@media (prefers-contrast: high) {
    .navbar-new {
        background: #ffffff;
        border-bottom: 2px solid #000000;
    }
    
    .navbar-new .navbar-collapse {
        background: #ffffff;
        border-top: 2px solid #000000;
    }
    
    .navbar-new .nav-link {
        color: #000000 !important;
        border-bottom: 1px solid #cccccc;
    }
    
    .navbar-new .nav-link:hover,
    .navbar-new .nav-link.active {
        background: #000000;
        color: #ffffff !important;
    }
    
    .navbar-new .navbar-toggler {
        background: #000000;
        color: #ffffff;
    }
    
    .navbar-new .language-switch-container {
        background: #ffffff;
        border: 2px solid #000000;
    }
}

/* ====== 减少动画模式支持 ====== */
@media (prefers-reduced-motion: reduce) {
    .navbar-new *,
    .navbar-new .navbar-collapse,
    .navbar-new .nav-item,
    .navbar-new .nav-link,
    .navbar-new .navbar-toggler {
        transition: none !important;
        animation: none !important;
    }
    
    .navbar-new .navbar-collapse.show .nav-item {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ====== 遮罩层样式 ====== */
.navbar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1015;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.navbar-overlay:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* ====== 滚动条样式 ====== */
.navbar-new .navbar-collapse::-webkit-scrollbar {
    width: 6px;
}

.navbar-new .navbar-collapse::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.navbar-new .navbar-collapse::-webkit-scrollbar-thumb {
    background: rgba(0, 123, 255, 0.3);
    border-radius: 3px;
}

.navbar-new .navbar-collapse::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 123, 255, 0.5);
}

/* ====== 焦点样式优化 ====== */
.navbar-new .nav-link:focus,
.navbar-new .language-switch-container:focus,
.navbar-new .navbar-toggler:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.navbar-new .chinese-btn:focus,
.navbar-new .english-text:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ====== 打印样式 ====== */
@media print {
    .navbar-new {
        position: static !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border-bottom: 1px solid #000000 !important;
    }
    
    .navbar-new .navbar-collapse {
        display: block !important;
        position: static !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .navbar-new .navbar-toggler {
        display: none !important;
    }
    
    .navbar-new .nav-item {
        border-bottom: 1px solid #cccccc !important;
        page-break-inside: avoid;
    }
}
