/* ===== 左侧菜单栏公共样式（配合 sidebar.html / sidebar.js 使用） ===== */

/* ===== CSS 变量 ===== */
:root {
    --sidebar-width: 64px;
}

/* ===== 左侧菜单栏（固定定位，不随滚动） ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 20px 0 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: center;
    z-index: 100;
}

.sidebar-brand {
    padding: 0 0 15px 0;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
    width: 100%;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 16px;
    font-weight: 700;
    background: #ffffff;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.sidebar-brand .brand-icon:hover {
    border-color: #dc2626;
}

.sidebar-brand .brand-name {
    display: none;
}

/* ===== 菜单列表 ===== */
.menu-list {
    flex: 1;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    align-items: center;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 450;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: center;
    font-family: inherit;
    position: relative;
    text-decoration: none;
}

.menu-item .menu-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.menu-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.menu-item:hover .menu-icon {
    color: #4b5563;
}

.menu-item.active {
    background: #fef2f2;
    color: #dc2626;
}

.menu-item.active .menu-icon {
    color: #dc2626;
}

.menu-item .menu-label {
    display: none;
}

.menu-footer {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.menu-section {
    display: flex;
    flex-direction: column;
    padding: 8px 8px;
    gap: 2px;
}

.menu-section.profile-section {
    border-top: 1px solid #f0f0f0;
}

.menu-section.help-section {
    border-top: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

.menu-section .menu-item {
    color: #9ca3af;
}

.menu-section .menu-item:hover {
    color: #4b5563;
}

.menu-section .menu-item .menu-icon {
    color: #b0bcca;
}

/* 个人中心头像 */
.menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: none;
    border: 1.5px solid #e5e7eb;
    transition: border-color 0.15s ease;
}
.menu-item.has-avatar .profile-icon {
    display: none;
}
.menu-item.has-avatar .menu-avatar {
    display: block;
}
.menu-item.has-avatar:hover .menu-avatar {
    border-color: #4b5563;
}
.menu-item.has-avatar.active .menu-avatar {
    border-color: #dc2626;
}

/* ===== 个人中心下拉菜单 ===== */
.dropdown-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown-menu {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 12px 0;
    z-index: 9999;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.dropdown-user-text {
    flex: 1;
}

.dropdown-nickname {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.dropdown-phone {
    font-size: 13px;
    color: #6b7280;
}

.dropdown-divider {
    margin: 8px 0;
    border: none;
    height: 1px;
    background-color: #e5e7eb;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item.disabled {
    color: #c0c4cc;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-item.disabled:hover {
    background-color: transparent;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

/* ===== 版本号显示 ===== */
.version-info {
    padding: 12px 8px 16px 8px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.version-text {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.4;
}

.version-patch {
    color: #b6bdc8;
}