* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: sans-serif;
}

#chat-container {
  width: 380px;
  height: 650px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

#header {
  padding: 16px;
  background: #ff8d28;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: bold;
}

#back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}


#chat-name {
  flex: 1;
  text-align: center;
}

#menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
}

#messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-wrapper.xiaoke {
  flex-direction: row;
}

.message-wrapper.xiaotong {
  flex-direction: row-reverse;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ff8d28;
}

.avatar.xiaotong {
  background: #f0c0a0;
}

.message {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message.xiaoke {
  background: #f0f0f0;
  border-radius: 4px 16px 16px 16px;
}

.message.xiaotong {
  background: #ff8d28;
  color: white;
  border-radius: 16px 4px 16px 16px;
}

#input-area {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #eee;
}

#input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

#send-btn {
  padding: 10px 18px;
  background: #ff8d28;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}
