:root {
  --wechat-white: #fff;
  --wechat-grey: #e0dee3;
  --wechat-background: #f3f3f3;
  --wechat-active: #dedede;

  --text-color: #161616;
  --text-light-color: #a8a8a8;

  --wechat-border-color: #e2e2e2;
  --wechat-icon-color: #6a686d;
  --wechat-icon-active-color: #53bf6a;
  --wechat-message-bg: #8be36a;
  --wechat-notice-color: #e85b52;
}

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

body, html {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #d0d0d0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 1112px;
  height: 784px;
  background-color: var(--wechat-white);
  display: flex;
}

/********** 左侧 sidebar **********/
.sidebar {
  position: relative;
  width: 60px;
  height: 784px;
  background-color: var(--wechat-grey);
  display:flex;
  flex-direction:column;
  align-items:center; 
}

/* 顶部圆点 */
.mac-icon {
  display:flex;
  gap:4px;
  margin-top:8px ;
}

/* 圆点尺寸 */
.circle{
  width:12px;
  height:12px;
  border-radius:50%;
}

/* 圆点颜色 */
.circle.red    { background:#ff605c; }
.circle.yellow { background:#ffbd44; }
.circle.green  { background:#00ca4e; }

/* 头像 + 功能图标 */
.nav-section { 
  display:flex;
  margin-top: 48px;
  flex-direction:column;
  align-items:center;
  gap:26px;
}

/* 底部 3 个图标 */
.foot-section {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:26px;
  margin-top: 100px;
}

/* 用户头像 */
#avatar img{
  width:36px;
  height:36px;
  border-radius:4px;
}

.nav-item img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display:flex;
  justify-content:center;
  align-items:center;
}

button {
  border: none;
  background: none;
}

/* 朋友圈未读消息 */
.pengyouquan {
  position: relative;
}

.notice {
  position: absolute;
  font-size: 12px;
  width: 16px;
  height: 16px;
  right: -4px;
  top: -4px;
  background-color: var(--wechat-notice-color);
  color: var(--wechat-white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/********** 中间 chat list **********/
.chat-list {
  width: 260px;
  display: flex;
  flex-direction: column;
  background-color: var(--wechat-white);
  border-right: 1px solid var(--wechat-border-color);
}

/* 搜索区域 */
.search {
  position: relative;
  height: 60px;
  width: 100%;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.search-icon {
  position: absolute;
  width: 14px;
  left: 24px;
}

.search-box {
  width: 196px;
  height: 28px;
  margin-left: 16px;
  border: none;
  border-radius: 4px;
  background-color: var(--wechat-grey);
  font-size: 12px;
  padding-left: 25px;
}

.create-group-chat {
  width: 28px;
  height: 28px;
  margin-left: 8px;
  border: none;
  border-radius: 4px;
  background-color: var(--wechat-grey);
  font-size: 24px;
}

/* 聊天列表 */
.chat-part {
  position: relative;
  height: 70px;
  width: 100%;
  display: flex;
  background-color: var(--wechat-white); 
}

/* 高亮 */
.chat-part.active {
  background: var(--wechat-active);
}

/* 绿线 */
.chat-part.active::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0; 
  bottom: 0;
  width: 4px;
  background: var(--wechat-icon-active-color);
}

/* 联系人列表 */
.users-part {
  height: 70px;
  width: 100%;
  display: flex;
  background-color: var(--wechat-white);
}

.users-part:hover { 
  background: var(--wechat-active); 
}

/* 联系人滚动条 */
.users-scroll, .chat-list-body { 
  scrollbar-width: thin;
  scrollbar-color: var(--wechat-grey) transparent;
  overflow-y: auto; 
}

/* 聊天对象头像 */
.chat-part-avatar {
  width: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 10px;
}

.chat-part-avatar img {
  border-radius: 4px;
  object-fit: cover;
}

.users-avatar {
  width: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 20px;  
}

.users-avatar img {
  border-radius: 4px;
  object-fit: cover;
}

/* 首字母色块头像 */
.user-badge {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: var(--text-color);
}

/* 接收信息 */
.chat-part-info{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 0 12px;
  row-gap: 2px;
  column-gap: 8px;
}

.chat-part-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
}

.chat-access-time {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-color);
  flex: 0 0 auto;
}

.last-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-light-color);
  flex: 0 0 100%;
  min-width: 0;
}

.user-info {
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-content: center;
  flex-wrap: wrap;
  padding-right: 13px;
  padding-left: 17px;
}

.user-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
}
/* 右侧 chat window */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--wechat-background);
}

#chat-icon {
  width: 120px;
  height: 120px;
  margin: auto;
}

/* 顶部聊天名称 */
.chat-name {
  height: 60px;
  display: flex;
  align-items: center;
  border: var(--wechat-border-color) solid 1px;
}

.chat-name p {
  font-size: 18px;
  color: var(--text-color);
  font-weight: 500;
  margin-left: 25px;
}

/* 聊天主页面 */
.chat-box {
  height: 400px;
  width: 100%;
  border: var(--wechat-border-color) solid 1px;
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wechat-grey) transparent;
}

/* 聊天时间 */
.chat-time {
  display: flex;
  height: 60px;
  width: 100%;
  justify-content: center;
  align-items:center ;
}
.chat-time time {
  font-size: 13px;
  letter-spacing: 0.04rem;
  color: var(--text-light-color);
}

/* 聊天头像 */
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: flex;
}

/* 聊天内容 */
.chat-message {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}

/* 聊天气泡 */
.chat-bubble {
  position: relative;
  display: flex;
  margin-right: 15px;
  margin-left: 15px;
  width: auto;
  max-width: 315px;
  background-color: var(--wechat-message-bg);
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
}

.chat-bubble p {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 500;
}

/* 气泡三角形 */
.triangle-right {
  position: absolute;
  width: 0px;
  height: 0px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid var(--wechat-message-bg);
  right: -4px;
  top: 8px;
}

/* 左白右绿 */
.bubble-left  { background: var(--wechat-white);}
.bubble-right { background: var(--wechat-message-bg); }

/* 左侧三角形 */
.triangle-left {
  position: absolute;
  left: -6px; 
  top: 10px; 
  width: 0; 
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--wechat-white);
}

/* 信息发送框 */
.send-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: var(--wechat-border-color) solid 1px;
}
/* 聊天工具栏 */
.tool {
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 16px;
  gap: 20px;
}

.tool img {
  height: 22px;
  width: 22px;
}
/* 输入框 */
.send-message {
  flex: 1;
  padding-left: 10px;
  background-color: transparent;
  border: none;
}

.send-message:focus {
  outline: none;
}

/* ---------- 右侧 user info ---------- */
.user-detail {
  padding: 24px 28px;
}

/* 顶部名片 */
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  margin-left: 200px;
}

.user-card .user-badge {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  font-size: 20px;
}

.user-all {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.user-all .uname {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.user-all .secondary {
  font-size: 13px;
  color: var(--text-light-color);
}

/* 分割线 */
.user-detail .line {
  height: 1px;
  background: var(--wechat-border-color);
  margin: 15px 200px;
}

.user-actions {
  display: flex;
  justify-content: center;
  gap: 120px;
}

.user-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.user-action .icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-action img {
  width: 26px;
  height: 26px;
}

.user-action .label {
  font-size: 13px;
  color: var(--text-color);
}

/* 左侧选中 */
.users-part {
  position: relative;
  transition: background .15s;
}

.users-part.active {
  background: var(--wechat-active);
}

.users-part.active::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: var(--wechat-icon-active-color);
  border-radius: 3px 0 0 3px;
}
