/* 消息容器 */
#message-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999; /* 确保在最上层 */
  width: 320px;
  max-width: calc(100% - 40px); /* 响应式，两边留空 */
}

/* 单个消息框的通用样式 */
.message {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 消息框滑入动画 */
.message.show {
  opacity: 1;
  transform: translateY(0);
}

/* 消息图标 */
.message-icon {
  margin-right: 12px;
  font-size: 20px;
}

/* 消息内容 */
.message-content {
  flex: 1; /* 占满剩余空间 */
  color: #333;
  word-break: break-all; /* 长文本换行 */
}

/* 关闭按钮 */
.message-close {
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.message-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #666;
}

/* 使用 CSS 变量定义不同类型的颜色主题 */
/* 成功 */
.message-success {
  border-left: 4px solid #52c41a;
}
.message-success .message-icon {
  color: #52c41a;
}

/* 错误 */
.message-error {
  border-left: 4px solid #ff4d4f;
}
.message-error .message-icon {
  color: #ff4d4f;
}

/* 警告 */
.message-warning {
  border-left: 4px solid #faad14;
}
.message-warning .message-icon {
  color: #faad14;
}

/* 信息 */
.message-info {
  border-left: 4px solid #1890ff;
}
.message-info .message-icon {
  color: #1890ff;
}

/* 如果你想使用 Font Awesome 图标，可以这样替换 .message-icon 的内容 */
/*
.message-icon.success:before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.message-icon.error:before { content: "\f00d"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
...
*/