/* 基础重置 */
body, html {
    margin: 0; padding: 0;
    height: 100%; width: 100%;
    font-family: "Microsoft YaHei", sans-serif;
    overflow: hidden;
}

.wechat-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #f5f5f5;
}

/* 1. 左侧黑条 */
.wc-sidebar {
    width: 60px; background: #2e2e2e;
    display: flex; flex-direction: column; align-items: center; padding-top: 15px;
    flex-shrink: 0; /* 禁止压缩 */
}
.my-avatar { width: 35px; height: 35px; border-radius: 4px; margin-bottom: 20px; }
.sb-icon { font-size: 20px; color: #fff; margin-bottom: 20px; opacity: 0.6; }
.sb-icon.active { opacity: 1; color: #07c160; }

/* 2. 中间列表区 */
.wc-list {
    width: 250px; background: #e6e5e5;
    border-right: 1px solid #dcdcdc;
    display: flex; flex-direction: column;
    flex-shrink: 0;
}
.search-wrap { padding: 10px; }
.wc-search { width: 100%; border: none; background: #dcdcdc; padding: 5px; border-radius: 3px; box-sizing: border-box; }

.chat-item { 
    display: flex; padding: 12px; align-items: center; cursor: pointer; 
    border-bottom: 1px solid #dbdbdb; height: 64px; box-sizing: border-box;
}
.chat-item.selected { background-color: #c7c6c6; }
.chat-item.pinned { background: #d4d4d4; } /* 置顶底色 */
/* 关键修复：强制头像大小 */
.chat-avatar { width: 40px !important; height: 40px !important; border-radius: 4px; margin-right: 10px; object-fit: cover; }
.chat-info { flex: 1; overflow: hidden; }
.chat-name { font-size: 14px; color: #000; margin-bottom: 2px; }
.chat-preview { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 聊天图片通用样式 */
.chat-img {
    max-width: 150px; /* 限制最大宽度 */
    max-height: 300px;
    border-radius: 8px; /* 圆角美化 */
    cursor: pointer;   /* 鼠标悬停显示可点击 */
    margin-top: 6px;
    margin-left: 10px;
    margin-right: 10px;
    display: block;
}

/* 如果是对方发送的图片，可以加个边框区分 */
.message.received .chat-img {
    border: 1px solid #e0e0e0;
}

/* 3. 右侧主聊天区 */
.wc-main { flex: 1; display: flex; flex-direction: column; position: relative; background: #f5f5f5; overflow: hidden; }

.chat-panel { display: none; flex-direction: column; height: 100%; }
.chat-panel.active { display: flex; }

.chat-header { height: 50px; padding: 0 20px; display: flex; align-items: center; border-bottom: 1px solid #ddd; flex-shrink: 0; }
.chat-user-name { font-size: 16px; font-weight: bold; }

.chat-content { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; }
.chat-time { text-align: center; color: #b2b2b2; font-size: 12px; margin: 10px 0; }

/* 消息气泡美化 */
.message { display: flex; margin-bottom: 15px; align-items: flex-start; width: 100%; }
.message.right { justify-content: flex-end; }
.msg-avatar { width: 36px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.msg-bubble { 
    max-width: 70%; padding: 8px 12px; border-radius: 6px; font-size: 14px; 
    line-height: 1.5; word-wrap: break-word; position: relative;
}
.message.left .msg-bubble { background: white; margin-left: 10px; border: 1px solid #ebebeb; }
.message.right .msg-bubble { background: #95ec69; margin-right: 10px; border: 1px solid #82d358; }

/* 底部输入框美化 */
.chat-footer { height: 150px; border-top: 1px solid #ddd; padding: 10px 20px; flex-shrink: 0; }
.footer-icons { color: #666; margin-bottom: 5px; font-size: 18px; }
textarea { width: 100%; height: 70px; border: none; background: transparent; outline: none; resize: none; font-family: inherit; }
.send-btn { float: right; padding: 5px 15px; background: #e9e9e9; border: 1px solid #dcdcdc; color: #07c160; border-radius: 3px; }

/* 默认中间的“微信”水印 */
.wc-empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: #e0e0e0; font-size: 40px; font-weight: bold; }


/* 消息红点设置*/
/* 消息列表项容器，确保可以承载定位元素 */
.chat-avatar-wrapper {
    position: relative;
    margin-right:3px;
    display: flex;
}

/* 强制列表头像大小 */
.chat-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px;
    object-fit: cover;
}

/* 红点样式 */
.badge {
    position: absolute;
    top: -5px;
    right: -1px;
    background-color: #ff4d4f; /* 微信红 */
    color: white;
    font-size: 10px;
    min-width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6e5e5; /* 和背景融合的边框 */
    z-index: 10;
}

/* 当红点需要隐藏时的样式 */
.badge.hidden {
    display: none;
}

/* 朋友圈面板容器 */
.moments-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #fff;
    overflow-y: auto;
}
.moments-panel.active { display: flex; }

/* 顶部封面区 */
.moments-header {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 40px;
}
.moments-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-info-wrap {
    position: absolute;
    right: 20px;
    bottom: -20px;
    display: flex;
    align-items: center;
}
.user-nickname {
    color: white;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    border: 2px solid white;
}

/* 朋友圈内容单条记录 */
.moments-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #eee;
}
.moments-item .m-avatar {
    width: 45px;
    height: 45px;
    border-radius: 4px;
    margin-right: 12px;
}
.m-content { flex: 1; }
.m-name {
    color: #576b95; /* 微信专用蓝色 */
    font-weight: bold;
    margin-bottom: 5px;
}
.m-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 10px;
}
.m-img-song {
    max-width: 45%;
    border-radius: 4px;
    margin-bottom: 8px;
}
.m-img {
    max-width: 30%;
    border-radius: 4px;
    margin-bottom: 8px;
}
.m-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #b2b2b2;
    font-size: 13px;
}
.m-action-btn {
    background: #f7f7f7;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #576b95;
}
/* 时间戳美化：更细、颜色更淡 */
.m-time {
    color: #999;
    font-size: 13px;
    font-weight: 300; /* 让字体看起来更纤细 */
    margin-top: 4px;
}

/* 互动区域容器：浅灰色背景，圆角 */
.m-interaction-box {
    background-color: #f7f7f7;
    margin-top: 10px;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

/* 点赞列表样式 */
.m-likes {
    color: #576b95;
    font-weight: 500;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
}
.m-likes::before {
    content: "♡"; /* 或者使用 FontAwesome 的心形图标 */
    margin-right: 5px;
    font-size: 16px;
}

/* 评论列表样式 */
.m-comments {
    border-top: 1px solid #eee;
    padding-top: 4px;
    margin-top: 4px;
}
.m-comment-item {
    margin-bottom: 3px;
    line-height: 1.4;
}
.m-comment-user {
    color: #576b95;
    font-weight: 500;
}

/* 操作按钮(两个点)美化 */
.m-action-btn {
    background: #f7f7f7;
    color: #576b95;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 1px;
}
/* 图片放大遮罩层基础样式 */
.img-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* 黑色半透明背景 */
    z-index: 9999; /* 确保层级最高，能盖住所有聊天面板和任务栏 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out; /* 鼠标指针变成缩小状态 */
}

/* 放大后的图片样式 */
.viewer-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.25s ease; /* 顺滑的打开动画 */
}

/* 关闭按钮（右上角的大叉叉，不想要也可以不显示，因为点击空白处就能关闭） */
.viewer-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* 放大动画 */
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

