.chat-box {
  margin-top: 16px;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.message-list {
  height: min(420px, 60vh);
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
}

.message-item {
  max-width: 80%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eee;
  font-size: 14px;
  line-height: 1.5;
}

.message-item.mine {
  margin-left: auto;
  background: #111;
  border-color: #111;
  color: #fff;
}

.message-meta {
  margin: 0 0 4px;
  font-size: 12px;
  opacity: 0.7;
}

.message-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
}

.chat-form input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.chat-form button {
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  background: #111;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-width: 100%;
}

.conversation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
  color: #222;
  text-decoration: none;
  overflow: hidden;
}

.conversation-item:hover {
  background: #fafafa;
}

.conversation-item.has-unread {
  border-color: #f0d0d0;
  background: #fffbfb;
}

.conversation-unread-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.conversation-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid #eee;
  border-radius: 50%;
  object-fit: cover;
  background: #f5f5f5;
}

.conversation-body {
  flex: 1 1 auto;
  min-width: 0;
}

.conversation-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.conversation-name {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  flex: 0 0 auto;
  color: #999;
  font-size: 12px;
  white-space: nowrap;
}

.conversation-product,
.conversation-preview {
  margin: 0;
  color: #777;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-product {
  margin-bottom: 4px;
  color: #555;
}

@media (max-width: 720px) {
  .conversation-item {
    padding: 12px;
    gap: 10px;
  }

  .conversation-avatar {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .conversation-name {
    font-size: 15px;
  }

  .conversation-time {
    font-size: 11px;
  }
}
