* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft Yahei", sans-serif;
}
body {
  background-color: #E9EDEF;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.kefu-root {
  width: 1000px;
  max-width: calc(100% - 40px);
  height: 640px;
  max-height: calc(100vh - 60px);
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  background: #ffffff;
}

/* 侧边栏样式（模拟微信左侧） */
.sidebar {
  width: 320px;
  background-color: #fff;
  border-right: 1px solid #E1E1E1;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  height: 50px;
  background-color: #F6F6F6;
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: space-between;
  border-bottom: 1px solid #E1E1E1;
}
.sidebar-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #07C160;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.sidebar-search {
  padding: 8px 10px;
  background-color: #F6F6F6;
}
.sidebar-search input {
  width: 100%;
  height: 32px;
  border: none;
  border-radius: 4px;
  padding: 0 10px;
  background-color: #E9EDEF;
}
.sidebar-convos {
  flex: 1;
  overflow-y: auto;
}
.convo-item {
  height: 64px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #F1F1F1;
}
.convo-item:hover {
  background-color: #F6F6F6;
}
.convo-item.active {
  background-color: #E9EDEF;
}
.convo-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #07C160;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 10px;
}
.convo-info {
  flex: 1;
  overflow: hidden;
}
.convo-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-lastmsg {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-unread {
  background-color: #07C160;
  color: #fff;
  font-size: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 聊天窗口样式（模拟微信右侧） */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #E9EDEF;
}
.chat-header {
  height: 50px;
  background-color: #F6F6F6;
  border-bottom: 1px solid #E1E1E1;
  display: flex;
  align-items: center;
  padding: 0 15px;
}
.chat-title {
  font-size: 16px;
  font-weight: 500;
}
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.msg {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 8px;
  word-wrap: break-word;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.msg-client {
  background-color: #07C160;
  color: #fff;
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-admin {
  background-color: #fff;
  align-self: flex-start;
}
.msg-system {
  background-color: transparent;
  color: #666;
  font-weight: bold;
  align-self: center;
  text-align: center;
  max-width: 100%;
  flex-direction: row;
  justify-content: center;
  padding: 8px 12px;
  margin: 10px 0;
}
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-input-area {
  padding: 10px 20px;
  background-color: #F6F6F6;
  border-top: 1px solid #E1E1E1;
}
.input-container {
  background-color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}
.input-container input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 5px 0;
}
.input-container button {
  background-color: #07C160;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  margin-left: 10px;
}
.input-container button:hover {
  background-color: #06B156;
}
.admin-status {
  font-size: 12px;
  color: #888;
  margin-left: 10px;
}

/* Responsive */
@media (max-width: 800px) {
  .sidebar { display: none; }
  body { flex-direction: column; height: auto; }
}
