/* ===== 导航模块专用样式文件 ===== */

/* ========== 桌面端导航样式 ========== */
@media (min-width: 768px) {
    /* 头部容器样式 */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        background: linear-gradient(to right, #3494e6, #ec6ead);
        width: 100%;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        height: 60px;
        box-sizing: border-box;
        transition: all 0.3s ease;
    }
    
    /* 夜间模式下的头部容器样式 */
    body.dark-mode .header-container {
        background: linear-gradient(to right, #2c3e50, #4a5f7c);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .header-container img {
        width: 5%;
    }

    .title {
        font-size: 24px;
        color: #ffffff;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        font-family: 'ZCOOL QingKe HuangYou', sans-serif;
        font-weight: bold;
        letter-spacing: 1px;
    }

    /* 隐藏移动端搜索框 */
    .mobile-search-container {
        display: none;
    }

    /* 用户信息区域样式 */
    .user-profile {
        position: relative;
        cursor: pointer;
        padding: 10px 0;
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    /* 夜间模式开关容器 */
    .theme-switch-container {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* 夜间模式文字标签 */
    .theme-switch-label {
        color: #fff;
        font-size: 14px;
        white-space: nowrap;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    /* 夜间模式下的文字标签颜色 */
    body.dark-mode .theme-switch-label {
        color: #e0e0e0;
    }

    /* 夜间模式开关样式 */
    .theme-switch {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 24px;
    }

    .theme-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: .4s;
        border-radius: 24px;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

    input:checked + .slider {
        background-color: #2196F3;
    }

    input:focus + .slider {
        box-shadow: 0 0 1px #2196F3;
    }

    input:checked + .slider:before {
        transform: translateX(26px);
    }

    /* 夜间模式下的滑块外观 */
    body.dark-mode input:checked + .slider {
        background-color: #9c27b0;
    }

    body.dark-mode input:focus + .slider {
        box-shadow: 0 0 1px #9c27b0;
    }

    /* 用户头像样式 */
    .user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(45deg, #FF6B6B, #FFE66D);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #fff;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        border: 2px solid rgba(255,255,255,0.8);
    }

    .user-avatar:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    /* 下拉菜单样式 */
    .dropdown-menu {
        display: none;
        position: absolute;
        right: 0;
        top: 100%;
        background: rgba(255, 255, 255, 0.4);
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        border-radius: 12px;
        padding: 12px 0;
        min-width: 200px;
        z-index: 1001;
        margin-top: 8px;
        border: 1px solid rgba(0,0,0,0.08);
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        pointer-events: none;
        backdrop-filter: blur(10px);
    }

    .dropdown-menu.show {
        display: block;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ========== 移动端导航样式 ========== */
@media (max-width: 767px) {
    /* 头部容器样式 - 移动端 */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        background: linear-gradient(to right, #3494e6, #ec6ead);
        width: 100%;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        height: auto;
        min-height: 60px;
        box-sizing: border-box;
        flex-wrap: nowrap;
        align-content: center;
        transition: all 0.3s ease;
    }
    
    /* 夜间模式下的头部容器样式 - 移动端 */
    body.dark-mode .header-container {
        background: linear-gradient(to right, #2c3e50, #4a5f7c);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .header-container img {
        width: 12%;
        max-width: 40px;
    }

    .title {
        font-size: 18px;
        color: #ffffff;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        font-family: 'ZCOOL QingKe HuangYou', sans-serif;
        font-weight: bold;
        letter-spacing: 1px;
        flex: 1;
        text-align: center;
        margin: 0;
        padding: 0 8px;
    }

    /* 用户信息区域样式 - 移动端 */
    .user-profile {
        position: relative;
        cursor: pointer;
        margin-left: auto;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 夜间模式开关容器 */
    .theme-switch-container {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* 夜间模式文字标签 */
    .theme-switch-label {
        color: #fff;
        font-size: 12px;
        white-space: nowrap;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    /* 夜间模式下的文字标签颜色 */
    body.dark-mode .theme-switch-label {
        color: #e0e0e0;
    }

    /* 夜间模式开关样式 */
    .theme-switch {
        position: relative;
        display: inline-block;
        width: 45px;
        height: 22px;
    }

    .theme-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    /* 滑块样式 */
    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.3);
        transition: .4s;
        border-radius: 22px;
        border: 1px solid rgba(255, 255, 255, 0.4);
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    input:checked + .slider {
        background-color: #3494e6;
        border-color: #2980b9;
    }

    input:focus + .slider {
        box-shadow: 0 0 1px #3494e6;
    }

    input:checked + .slider:before {
        transform: translateX(23px);
    }

    /* 夜间模式下的滑块样式 */
    body.dark-mode .slider {
        background-color: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }

    body.dark-mode input:checked + .slider {
        background-color: #ec6ead;
        border-color: #d63384;
    }

    /* 用户头像样式 - 移动端 */
    .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: linear-gradient(45deg, #FF6B6B, #FFE66D);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #fff;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        border: 2px solid rgba(255,255,255,0.8);
    }

    .user-avatar:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    /* 极小屏幕设备优化 */
    @media (max-width: 480px) {
        .header-container {
            min-height: 55px;
            padding: 6px 10px;
        }
        
        .header-container img {
            width: 10%;
            max-width: 32px;
        }
        
        .title {
            font-size: 16px;
        }
        
        .user-avatar {
            width: 28px;
            height: 28px;
            font-size: 12px;
        }
        
        .theme-switch-container {
            gap: 4px;
        }
        
        .theme-switch {
            width: 40px;
            height: 20px;
        }
        
        .slider:before {
            height: 14px;
            width: 14px;
        }
        
        input:checked + .slider:before {
            transform: translateX(20px);
        }
    }
}

/* ========== 通用导航样式 ========== */
/* 下拉菜单项样式 */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 12px 0;
    min-width: 200px;
    z-index: 1001;
    margin-top: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu .user-info {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.dropdown-menu .user-info p {
    margin: 6px 0;
    font-size: 14px;
    color: #333;
}

.dropdown-menu .user-info a {
    color: #3494e6;
    text-decoration: none;
    font-size: 12px;
    margin-left: 8px;
}

.dropdown-menu .user-info .level-tag {
    color: #ec6ead;
    font-weight: bold;
}

.dropdown-menu .menu-items {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
}

.dropdown-menu .menu-items a {
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px 0;
}

.dropdown-menu .menu-items a:hover {
    background-color: rgba(255, 255, 255, 0.6);
    color: #3494e6;
}

.dropdown-menu .menu-items a.danger {
    color: #ff6b6b;
}

.dropdown-menu .menu-items a.danger:hover {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff4757;
}

/* 夜间模式下的下拉菜单样式 */
body.dark-mode .dropdown-menu {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .dropdown-menu .user-info {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .dropdown-menu .user-info p {
    color: #e0e0e0;
}

body.dark-mode .dropdown-menu .user-info a {
    color: #ec6ead;
}

body.dark-mode .dropdown-menu .user-info .level-tag {
    color: #3494e6;
}

body.dark-mode .dropdown-menu .menu-items a {
    color: #e0e0e0;
}

body.dark-mode .dropdown-menu .menu-items a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ec6ead;
}

body.dark-mode .dropdown-menu .menu-items a.danger {
    color: #ff6b6b;
}

body.dark-mode .dropdown-menu .menu-items a.danger:hover {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff4757;
}

/* 移动端搜索相关样式已移除，因为对应的HTML结构已删除 */

/* 确保页面内容不被固定导航栏遮挡 */
body {
    padding-top: 70px; /* 桌面端 */
}

@media (max-width: 767px) {
    body {
        padding-top: 70px; /* 移动端 */
    }
}

/* 极小屏幕设备优化 */
@media (max-width: 480px) {
    body {
        padding-top: 65px; /* 极小屏幕 */
    }
}