/* css/chat-list.css */

/* --- 页面通用布局容器 --- */
/* 这将确保每个页面都能正确地撑满容器并垂直布局 */
.page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- 页面顶部栏样式 --- */
.page-header {
    display: flex;
    justify-content: space-between; /* 让标题和按钮组左右分开 */
    align-items: center;
    padding: 10px 20px;
    flex-shrink: 0; /* 防止头部在内容多时被压缩 */
    border-bottom: 1px solid var(--soft-border-color); /* 添加一条分割线 */
}

/* --- 页面标题样式 --- */
.page-header .header-title {
    font-size: 20px;
    font-weight: 600;
}

/* --- 头部右侧的按钮容器 --- */
.page-header .header-actions {
    display: flex;
    gap: 15px; /* 设置按钮之间的间距 */
}

/* --- 通用图标按钮样式 --- */
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px; /* 控制图标大小 */
    color: var(--primary-text-color);
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.05); /* 鼠标悬停时给一个淡淡的背景 */
}

/* --- 页面内容占位符样式 --- */
.chat-list-container {
    flex-grow: 1; /* 让这个容器占据所有剩余空间 */
    overflow-y: auto; /* 如果内容多了可以滚动 */
    padding: 10px 0; /* 给列表一些上下内边距 */
}

.placeholder-message, .error-message {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 14px;
    padding: 20px;
}
/* css/chat-list.css */

/* ... (文件上方已有的 .page, .page-header 等样式保持不变) ... */


/* --- 单个聊天条目样式 --- */
.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--soft-border-color); /* 每个条目下的分割线 */
}

.chat-item:last-child {
    border-bottom: none; /* 最后一个条目不要分割线 */
}

.chat-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* 头像容器 */
.chat-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%; /* 圆形头像 */
    margin-right: 15px;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px; /* 控制占位图标大小 */
    color: #ccc;
    overflow: hidden; /* 防止图片溢出 */
    flex-shrink: 0;
}

.chat-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片不变形 */
}

/* 中间内容区域 (昵称 + 最后一条消息) */
.chat-item .content {
    flex-grow: 1;
    overflow: hidden; /* 防止文字过长溢出 */
}

.chat-item .name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

.chat-item .last-message {
    font-size: 14px;
    color: var(--secondary-text-color);
    white-space: nowrap; /* 不换行 */
    overflow: hidden; /* 溢出隐藏 */
    text-overflow: ellipsis; /* 显示省略号 */
}

/* 右侧元数据区域 (时间 + 未读数) */
.chat-item .meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-left: 10px;
    flex-shrink: 0;
}

.chat-item .time {
    margin-bottom: 8px;
}

/* 未读消息徽章 */
.unread-badge {
    background-color: #ff3b30; /* 醒目的红色 */
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    box-sizing: border-box;
    text-align: center;
}