* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background: #f5f7fa;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

/* 主容器 */
.chat-wrapper {
  width: 100%;
  max-width: 450px;
  height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 头部 */
.chat-header {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: white;
  text-align: center;
  padding: 18px;
}
.chat-header h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.chat-header p {
  font-size: 12px;
  opacity: 0.9;
}

/* 消息区域 */
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 消息气泡 */
.message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
}
/* 自己发送的消息 */
.message.self {
  align-self: flex-end;
  background: #007AFF;
  color: white;
  border-bottom-right-radius: 6px;
}
/* 对方发送的消息 */
.message.other {
  align-self: flex-start;
  background: #e5e7eb;
  color: #333;
  border-bottom-left-radius: 6px;
}

/* 输入框区域 */
.chat-footer {
  display: flex;
  padding: 12px;
  gap: 10px;
  background: white;
  border-top: 1px solid #eee;
}
.chat-footer input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  outline: none;
  font-size: 15px;
  transition: 0.2s;
}
.chat-footer input:focus {
  border-color: #007AFF;
}
.chat-footer button {
  padding: 12px 20px;
  background: #007AFF;
  color: white;
  border: none;
  border-radius: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}
.chat-footer button:hover {
  background: #0066dd;
}

/* 房间提示 */
.room-tip {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: #888;
  background: white;
}