/* ==========================================================================
   主界面布局
   ========================================================================== */
/**
 * 微信三栏布局样式
 * @selector #main - 主界面容器
 * @selector #left - 左侧边栏
 * @selector #myPic - 用户头像

 * @selector .set_title - 设置面板标题
 * @selector .set_content - 设置面板内容区域
 * @selector .music_cd - 音乐播放器样式
 */

#main {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-gray);
    overflow: hidden;
}

/* 左侧侧边栏 - 微信风格 */
#left {
    width: 60px;
    background: linear-gradient(180deg, #2aae67 0%, #07c160 100%);
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    z-index: 10;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

#myPic {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent; /* 透明背景 */
}

#myPic:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8); /* hover时边框更明显 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 桌面端隐藏当前用户名 */
.current-user-name,
#myName {
    display: none;
}

.set_title {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.set_content {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}

.set_content:last-child {
    border-bottom: none;
    margin-bottom: 20px;
}

.set_content .lable {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.set_content .content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 音乐播放器 */
.music_cd {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music_cd::before {
    content: '♪';
    font-size: 28px;
    color: white;
    font-weight: bold;
}

.music_cd:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(7, 193, 96, 0.4);
}

.music_cd:active {
    transform: scale(0.95);
}

.music_cd.music_playing {
    animation: music_playing 9s infinite linear;
}

/* 移动端布局调整 */
@media (max-width: 768px) {
    #main {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
    }
    
    /* 移动端 #left 作为顶部栏显示当前用户信息 */
    #left {
        width: 100% !important; /* 强制使用100%宽度，覆盖桌面端60px */
        height: 52px !important; /* 优化高度，更轻盈协调 (60px → 52px) */
        flex-direction: row !important;
        padding: 0 16px !important; /* 调整左右边距 (15px → 16px) */
        justify-content: flex-start !important; /* 改为左对齐 */
        align-items: center !important;
        z-index: 1001;
        position: fixed !important; /* 固定在顶部 */
        top: 0;
        left: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* 添加轻微阴影 */
    }
    
    #myPic {
        width: 34px;  /* 优化头像尺寸 (36px → 34px) */
        height: 34px;
        margin-bottom: 0;
        margin-right: 10px; /* 减少间距 (12px → 10px) */
        border-radius: 50%; /* 圆形头像 */
        border: 2px solid rgba(255, 255, 255, 0.6); /* 优化边框：更明显的白色边框 */
        background: transparent; /* ✅ 透明背景，与绿色背景融合 */
        object-fit: cover; /* 确保图片填充 */
        flex-shrink: 0; /* 防止头像被压缩 */
    }
    
    /* 移动端显示当前用户名 */
    .current-user-name,
    #myName {
        display: block !important;
        color: white;
        font-size: 15px; /* 优化字体大小 (16px → 15px) */
        font-weight: 500;
        flex: 1; /* 占据剩余空间 */
        max-width: calc(100vw - 90px); /* 留出空间：头像34px + 边距16px*2 + 头像右边距10px + 安全间距10px ≈ 90px */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        letter-spacing: 0.3px; /* 添加字间距，更精致 */
        line-height: 34px; /* 与头像高度对齐，垂直居中 */
    }

}