* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 1000px;
    height: 700px;
    background-color: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
}

/* 左侧联系人列表 */
.sidebar {
    width: 280px;
    height: 100%;
    background-color: #eee;
    border-right: 1px solid #d9d9d9;
    display: flex;
    flex-direction: column;
}

/* 用户信息栏 */
.user-info {
    height: 80px;
    padding: 15px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #d9d9d9;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #07c160;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    margin-right: 10px;
    overflow: hidden;
}

.user-name {
    font-size: 16px;
    font-weight: 500;
}

.user-status {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* 搜索框 */
.search-box {
    padding: 10px;
    background-color: #f9f9f9;
}

.search-input {
    width: 100%;
    height: 32px;
    border: none;
    border-radius: 3px;
    background-color: #fff;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
}

/* 联系人列表 */
.contact-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

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

.contact-item.active {
    background-color: #d9d9d9;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #07c160;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    margin-right: 10px;
    overflow: hidden;
}
.contact-avatar img{
    height: 100%;
}
.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 15px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-last-msg {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* 未读消息计数 */
.unread-count {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* 右侧区域 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 标题栏 */
.chat-header {
    height: 80px;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #d9d9d9;
    display: flex;
    align-items: center;
}

.chat-title {
    font-size: 16px;
    font-weight: 500;
}

.chat-status {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* 消息显示区域 */
.message-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    display: flex;
    width: 650px;
}
.message img{
    width: 100%;
}
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #07c160;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    margin-right: 10px;
    overflow: hidden;
}
.message-avatar img{
    height: 100%;
}
.message-content {
    max-width: 60%;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 3px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    word-break: break-word;
}

.message-bubble::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #fff;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.message-self {
    flex-direction: row-reverse;
}

.message-self .message-avatar {
    margin-right: 0;
    margin-left: 10px;
}

.message-self .message-bubble {
    background-color: #95ec69;
}

.message-self .message-bubble::before {
    left: auto;
    right: -6px;
    border-right: none;
    border-left: 6px solid #95ec69;
}

/* 输入区域 */
.input-area {
    height: 185x;
    padding: 15px;
    border-top: 1px solid #d9d9d9;
    background-color: #f9f9f9;
}

.message-input {
    width: 100%;
    height: 80px;
    border: none;
    border-radius: 3px;
    padding: 10px;
    font-size: 14px;
    outline: none;
    resize: none;
    margin-bottom: 10px;
}

.send-btn {
    padding: 8px 20px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    float: right;
}

.send-btn:hover {
    background-color: #06ad56;
}

.send-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 登录弹窗 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    width: 400px;
    background-color: #fff;
    border-radius: 5px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.login-input {
    width: 100%;
    height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
}

.login-btn {
    width: 100%;
    height: 40px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.login-btn:hover {
    background-color: #06ad56;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-online {
    background-color: #07c160;
}

.status-offline {
    /* background-color: #999; */
}

.error-message {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
}

/* 在现有的CSS中添加以下样式 */
.contact-item.selected {
    background-color: white;
    border-left: 3px solid #07c160;
}

/* 调整原有的active状态 */
.contact-item.active {
    background-color: #f0f0f0;
    /* 改为更浅的灰色 */
}

/* 调整hover效果，避免与选中状态冲突 */
.contact-item:hover:not(.selected) {
    background-color: #f5f5f5;
}

.message-read-status {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 2px;
    padding-right: 5px;
}

.unread-count {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

#emptyChatState {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    flex: 1;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-text {
    font-size: 16px;
    color: #888;
}

.contact-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.contact-time {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
    white-space: nowrap;
}

/* 消息操作菜单样式 */
.message-action-menu {
    position: fixed;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 120px;
}

.menu-item {
    padding: 8px 16px;
    cursor: pointer;
}

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

/* 消息气泡增加长按反馈 */
.message-bubble {
    user-select: none;
    -webkit-user-select: none;
}

.message-bubble:active {
    background-color: rgba(0, 0, 0, 0.05);
}

#chatArea {
    display: none;
}
.search-box {
    position: relative;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.search-clear {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: none;
}

.search-clear:hover {
    color: #333;
}