/* CSS Document */

/* chat.css 客服弹窗独立样式 */
* {
    margin: 0;
    padding: 1px;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* 底部悬浮客服按钮 缩放锁定右下角 */
#openChat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 18px;
  background: #1677ff;
  color: #fff;
  border-radius: 30px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  transform-origin: right bottom;
  touch-action: none;
  min-width: 110px;
  text-align: center;
  transform: translateZ(0);
  will-change: transform;
}
#openChat p {
    margin:0;
    font-size: 18px;
    line-height: 1.4;
}
#openChat:hover {
  background: #4096ff;
}
/* 遮罩层 */
.chat-mask {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 99998;
  transform-origin: center;
  transform: translateZ(0);
}
/* 聊天弹窗 */
.chat-box {
  width: 500px;
  max-width: calc(100vw - 26px);
  max-height: 60vh;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: #fff;
  display: none;
  flex-direction: column;
  z-index: 99999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  overflow: hidden;
  transform-origin: right bottom;
  transform: translateZ(0);
  will-change: transform;
}
@media (max-width: 768px) {
  #openChat {
    bottom: 16px;
    right: 16px;
    padding: 12px 16px;
    min-width: 100px;
  }
  .chat-box {
    right: 16px;
    bottom: 80px;
    max-width: calc(100vw - 24px);
    max-height: 58vh;
  }
}
.chat-box.active {
    display: flex;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #1677ff;
  color: white;
  font-size: 17px;
}
.header-btns {
  display: flex;
  gap: 6px;
}
.chat-min, .chat-close {
  cursor: pointer;
  font-size: 24px;
  width: 34px;
  height: 34px;
  text-align: center;
  line-height: 34px;
}
.chat-min:hover, .chat-close:hover {
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
}
.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-size: 15px;
}
.msg-list::-webkit-scrollbar {
  width: 4px;
}
.msg-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}
.msg-row {
  width: 100%;
  margin: 10px 0;
}
.row-visitor {
  text-align: right;
}
.row-service {
  text-align: left;
}
.item-visitor {
  padding: 8px 12px;
  background: #e6f7ff;
  border-radius: 10px 3px 10px 10px;
  display: inline-block;
  max-width: 82%;
  word-break: break-all;
}
.item-service {
  padding: 8px 12px;
  background: #f0f0f0;
  border-radius: 3px 10px 10px 10px;
  display: inline-block;
  max-width: 82%;
  word-break: break-all;
}
.input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #eee;
  gap: 8px;
}
#msgInput {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none; 
  font-size: 15px;
}
#msgInput:focus {
  border-color: #1677ff;
}
.input-area button {
  padding: 8px 16px;
  border: none;
  background: #1677ff;
  color: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 15px;
}
.input-area button:hover {
  background: #4096ff;
}