.wr-chat-toggle {
  position: fixed;
  bottom: 0px;
  right: 20px;

  display: inline-flex;
  align-items: center;
  padding: 10px 18px 8px 12px;               
  background-color: #00ADA4; 
  color: #ffffff;      

  border-radius: 6px 6px 0 0;     
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  z-index: 1001;

  font-size: 20px;
  user-select: none;

    transform: translateY(100px);
  opacity: 0;
    animation: wrChatSlideUp 0.6s ease-out 0.3s forwards;
}

@keyframes wrChatSlideUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.wr-chat-toggle svg {
  width: 40px;
  height: 40px;
  margin-right: 8px;        /* icon 与文字间距 */
  flex-shrink: 0;
  padding-top: 7px;
}

.wr-chat-toggle:hover {
  background-color: #009b95; /* hover 色 */
}
.wr-chat-widget {
  position: fixed;
  bottom: 0px;
  right: 20px;
  width: 350px;
  height: 70%;
  background: #fff;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1002;
    transform: translateY(100px);
  opacity: 0;

  /* 添加动画 */
  animation: wrChatToggleUp 0.3s ease-out 0.3s forwards;
}

@keyframes wrChatToggleUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.wr-chat-title{
  font-size: 1.2rem;
  padding: 4px;
  left: -60%;
}
.wr-chat-header {
  background: #00a99d;
  color: #fff;
  padding: 10px 10px 6px 10px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wr-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.wr-chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
  padding-bottom: 60px;
}
.wr-chat-input {
  padding: 8px;
  border-top: 1px solid #eee;
  display: flex;
}
.wr-chat-input input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
}
.wr-chat-input button {
  margin-left: 8px;
  padding: 6px 12px;
  background: #00a99d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.msg {
  margin: 8px 0;
}
.msg.bot {
  text-align: left;
  color: #333;
}
.msg.user {
  text-align: right;
  color: #FFFFFF;;
}
.hidden { display: none; }

/* 气泡共通 */
.msg {
  display: inline-block;
  position: relative;
  max-width: 80%;
  margin: 8px 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

/* 公用气泡基础 */
.msg {
  position: relative;
  display: block;      /* 块级 */
  clear: both;         /* 新消息始终另起一行 */
  max-width: 80%;
  margin: 8px 0;
  padding: 10px 12px;
  background: #ECECEC;
  color: #333;
  line-height: 1.4;
}

/* Bot 气泡：左侧浮动，左下尖角 */
.msg.bot {
  float: left;
  border-radius: 10px 10px 10px 0;
}
.msg.bot::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ECECEC;
  transform: rotate(45deg);
  left: -4px;
  bottom: 8px;
}

/* User 气泡：右侧浮动，右下尖角 */
.msg.user {
  float: right;
  border-radius: 10px 10px 0 10px;
  background: #585858;
}
.msg.user::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #585858;
  transform: rotate(45deg);
  right: -4px;
  bottom: 8px;
}

/* 包裹按钮的容器，自动换行 */
.choice-container {
  /* 清除前面所有浮动，让容器另起一行 */
  clear: both;

  display: flex;
  flex-wrap: wrap;       /* 多行排列 */
  justify-content: flex-start; /* 按钮左对齐，可改成 center 居中 */
  gap: 8px;              /* 按钮间距 */
  margin: 12px 0;        /* 和上下内容留空 */
  padding-top: 10px;
}


/* 单个选项按钮 */
.choice-btn {
  flex: 0 0 calc(50% - 8px);  /* 两列布局，减去 gap */
  text-align: center;
  padding: 6px 0;
  border: 2px solid #eee;
  border-radius: 8px;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.choice-btn:hover {
  background-color: #f5f5f5;
}


/* 给 .msg.typing 自动套用 Bot 气泡样式 */
.msg.typing {
  /* 继承 .msg.bot 的外观 */
  position: relative;
  display: block;
  clear: both;
  float: left;
  background: #ECECEC;
  color: #333;
  border-radius: 10px 10px 10px 0;
  margin: 8px 0;
  padding: 10px 12px;
  max-width: 60%;
  /* 禁止用户选中里面的点 */
  user-select: none;
}

/* 尾巴 */
.msg.typing::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ECECEC;
  transform: rotate(45deg);
  left: -4px;
  bottom: 8px;
}

/* 三个小点 */
.msg.typing .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #999;
  border-radius: 50%;
  opacity: 0;
  animation: typingBlink 1s infinite both;
}
.msg.typing .dot:nth-child(1) { animation-delay: 0s; }
.msg.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.msg.typing .dot:nth-child(3) { animation-delay: 0.4s; }

/* 点的闪烁关键帧 */
@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0; }
  40%           { opacity: 1; }
}

/* 整个输入区出错时变淡红 */
.wr-chat-input.error {
  background-color: #ffecec;
}

#w r-chat-text.error,
.wr-chat-input input.error {
  background-color: #ffecec !important;
  border-color: #ff9c9c !important;
}

@keyframes wrChatSlideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100px);
    opacity: 0;
  }
}

.wr-chat-widget.closing {
  animation: wrChatSlideDown 0.2s ease-out forwards;
}

@media screen and (max-width: 767px) {
    .chat-label {
        display: none;
    }
    .wr-chat-toggle {  padding: 2px 0px 3px 6px    }
    .wr-chat-widget { width: 100%; height: 100%;  right: 0px;     border-radius: 0}
   
}
