/* ================================================
   移动端导航 - 汉堡按钮 + 侧滑抽屉
   所有页面共享此样式
   ================================================ */

/* --- 汉堡按钮（手机端可见） --- */
.hamburger-btn {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: #f5f5f7;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}
.hamburger-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* --- 移动端抽屉遮罩 --- */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-overlay.active {
    opacity: 1;
}

/* --- 移动端抽屉主体 --- */
.mobile-drawer {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: 280px;
    height: 100%;
    background: #1d1d1f;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.mobile-drawer.open {
    transform: translateX(0);
}

/* 抽屉头部 */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}
.drawer-header .drawer-brand {
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f7;
}
.drawer-close {
    background: none;
    border: none;
    color: #f5f5f7;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.drawer-close:hover { opacity: 1; }

/* 抽屉用户区 */
.drawer-user {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.drawer-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0071e3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.drawer-user-info { flex: 1; min-width: 0; }
.drawer-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #f5f5f7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drawer-user-role {
    font-size: 11px;
    color: #86868b;
    margin-top: 1px;
}
.drawer-user-guest { color: #86868b; font-size: 13px; }

/* 抽屉菜单 */
.drawer-menu {
    padding: 8px 0;
}
.drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #f5f5f7;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    opacity: 0.85;
}
.drawer-menu-item:hover {
    background: rgba(255,255,255,0.08);
    opacity: 1;
}
.drawer-menu-item.active {
    background: rgba(0,113,227,0.2);
    border-left-color: #0071e3;
    opacity: 1;
    font-weight: 500;
}
.drawer-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* 抽屉底部 */
.drawer-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}
.drawer-logout-btn {
    width: 100%;
    background: rgba(255,59,48,0.15);
    border: 1px solid rgba(255,59,48,0.3);
    color: #ff453a;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: none;
    transition: background 0.2s;
}
.drawer-logout-btn:hover { background: rgba(255,59,48,0.25); }

/* 抽屉分区标签 */
.drawer-section-label {
    padding: 8px 16px 4px;
    font-size: 11px;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   响应式规则（≤768px 激活）
   ================================================ */
@media (max-width: 768px) {
    /* 显示汉堡按钮，隐藏横向菜单 */
    .hamburger-btn { display: block; }

    /* 横向菜单在手机端隐藏 */
    .navbar ul {
        display: none !important;
    }

    /* 用户选择器在手机端也藏（抽屉里有） */
    .navbar #user-selector {
        display: none;
    }

    /* 抽屉显示 */
    .mobile-overlay { display: block; }
    .mobile-drawer { display: block; }
}
