/* ============================================
   微信风格样式
   ============================================ */

/* 微信风格容器 */
.wechat-style {
    background-color: #ededed;
}

.wechat-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 100vw;
    overflow: hidden;
    background-color: #ededed;
}

.wechat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 50px; /* 为底部导航栏留出空间 */
}

/* 微信标签页 */
.wechat-tab {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    background-color: #ededed;
}

.wechat-tab.active {
    display: flex;
}

/* 微信头部 */
.wechat-header {
    background-color: #393a3e;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.wechat-header h1 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    color: white;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-icon {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.header-icon:hover {
    opacity: 0.8;
}

/* 聊天列表容器 */
.chat-list-container,
.contacts-container,
.discover-container,
.profile-container {
    flex: 1;
    overflow-y: auto;
    background-color: #ededed;
}

/* 微信聊天列表 */
.wechat-chat-list {
    background-color: white;
}

.wechat-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color 0.2s;
    background-color: white;
}

.wechat-chat-item:hover {
    background-color: #f5f5f5;
}

.wechat-chat-item.active {
    background-color: #e5e5e5;
}

.wechat-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    background-color: #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.wechat-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wechat-chat-info {
    flex: 1;
    min-width: 0;
}

.wechat-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.wechat-chat-name {
    font-size: 16px;
    font-weight: 500;
    color: #191919;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wechat-chat-time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    margin-left: 8px;
}

.wechat-chat-preview {
    font-size: 14px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wechat-chat-badge {
    background-color: #fa5151;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-left: 8px;
    flex-shrink: 0;
}

/* 好友列表 */
.wechat-friends-list {
    background-color: white;
}

.wechat-friend-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color 0.2s;
    background-color: white;
}

.wechat-friend-item:hover {
    background-color: #f5f5f5;
}

.wechat-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    background-color: #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.wechat-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wechat-friend-name {
    font-size: 16px;
    color: #191919;
    flex: 1;
}

.friend-request-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: white;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    font-size: 16px;
    color: #191919;
    cursor: pointer;
    transition: background-color 0.2s;
}

.friend-request-btn:hover {
    background-color: #f5f5f5;
}

/* 个人中心 */
.profile-header {
    background-color: white;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
    background-color: #d0d0d0;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h2 {
    font-size: 18px;
    font-weight: 500;
    color: #191919;
    margin: 0 0 4px 0;
}

.profile-meta {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.profile-edit-btn {
    color: #576b95;
    font-size: 14px;
    text-decoration: none;
    padding: 4px 8px;
}

.profile-menu {
    margin-top: 8px;
    background-color: white;
}

.menu-section {
    border-top: 1px solid #e5e5e5;
    margin-top: 8px;
}

.menu-section:first-child {
    border-top: none;
    margin-top: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
    text-decoration: none;
    color: #191919;
    font-size: 16px;
    background: none;
    border-left: none;
    border-right: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item.logout-btn {
    color: #fa5151;
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.menu-arrow {
    color: #999;
    font-size: 18px;
}

/* 底部导航栏 */
.wechat-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f7f7f7;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 0;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    z-index: 1000;
    height: 50px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    color: #7a7e83;
    transition: color 0.2s;
}

.nav-item.active {
    color: #07c160;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
}

/* 聊天界面 */
.chat-interface {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ededed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.chat-interface .chat-header {
    background-color: #393a3e;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-interface .chat-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    flex: 1;
}

.chat-interface .chat-header-actions {
    display: flex;
    gap: 12px;
}

.chat-interface .header-icon {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.chat-back-btn {
    background: none;
    border: none;
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
    font-weight: bold;
}

.chat-back-btn:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wechat-container {
        padding-bottom: 50px;
    }
    
    .wechat-main {
        padding-bottom: 50px;
    }
}

/* 桌面端显示侧边栏 */
@media (min-width: 769px) {
    .wechat-container {
        flex-direction: row;
    }
    
    .wechat-main {
        flex: 1;
    }
    
    .sidebar-left {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 300px;
        display: flex !important;
        z-index: 100;
    }
    
    .wechat-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
    }
    
    /* 聊天界面在桌面端也應該全屏覆蓋 */
    .chat-interface {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        z-index: 2000;
    }
}
