.lab-customer-service-widget {
  --lab-cs-blue: #1378ce;
  --lab-cs-border: #d9e4f1;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.lab-customer-service-trigger {
  position: fixed;
  right: 0;
  bottom: 20px;
  z-index: 900;
  box-sizing: border-box;
  width: 78px;
  min-height: 88px;
  padding: 10px 8px 8px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(21, 78, 128, .16);
  color: var(--lab-cs-blue);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.lab-customer-service-trigger:hover,
.lab-customer-service-trigger:focus-visible {
  border-color: var(--lab-cs-blue);
  box-shadow: 0 10px 30px rgba(19, 120, 206, .24);
  outline: none;
}

.lab-customer-service-trigger img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.lab-customer-service-trigger span {
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.lab-customer-service-panel {
  display: none;
  position: fixed;
  right: 84px;
  bottom: 20px;
  z-index: 910;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 92px));
  height: min(600px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid var(--lab-cs-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 42, 70, .2);
}

.lab-customer-service-panel.open {
  display: flex;
  flex-direction: column;
}

.lab-customer-service-head {
  min-height: 50px;
  padding: 0 15px;
  border-bottom: 1px solid #e4ebf4;
  background: #f5f8fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #20364d;
}

.lab-customer-service-head button {
  border: 0;
  background: transparent;
  color: #66778a;
  font-size: 24px;
  cursor: pointer;
}

.lab-customer-service-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #f9fbfe;
}

.lab-customer-service-message {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lab-customer-service-message.mine {
  flex-direction: row-reverse;
}

.lab-customer-service-message img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
}

.lab-customer-service-bubble {
  max-width: 78%;
  padding: 9px 11px;
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  background: #fff;
  color: #334b62;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.lab-customer-service-message.mine .lab-customer-service-bubble {
  border-color: var(--lab-cs-blue);
  background: var(--lab-cs-blue);
  color: #fff;
}

.lab-customer-service-typing .lab-customer-service-bubble {
  color: #64748b;
  font-size: 13px;
}

.lab-customer-service-typing span {
  display: inline-block;
  min-width: 22px;
  letter-spacing: 2px;
  animation: lab-customer-service-blink 1s steps(3, end) infinite;
}

@keyframes lab-customer-service-blink {
  0% { opacity: .25; }
  50% { opacity: 1; }
  100% { opacity: .25; }
}

.lab-customer-service-login {
  align-self: flex-start;
  margin: 4px 0 0 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--lab-cs-blue);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.lab-customer-service-login:hover {
  filter: brightness(.92);
}

.lab-customer-service-input {
  padding: 10px;
  overflow: hidden;
  border-top: 1px solid #e4ebf4;
  background: #fff;
}

.lab-customer-service-input textarea {
  box-sizing: border-box;
  width: 100%;
  height: 70px;
  padding: 8px;
  resize: none;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  outline: none;
}

.lab-customer-service-input textarea:focus {
  border-color: var(--lab-cs-blue);
}

.lab-customer-service-input button {
  float: right;
  height: 32px;
  margin-top: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 5px;
  background: var(--lab-cs-blue);
  color: #fff;
  cursor: pointer;
}

.lab-customer-service-input button:disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 640px) {
  .lab-customer-service-trigger {
    right: 12px;
    bottom: 12px;
    width: 62px;
    min-height: 66px;
    padding: 7px 5px 5px;
  }

  .lab-customer-service-trigger img {
    width: 34px;
    height: 34px;
  }

  .lab-customer-service-trigger span {
    font-size: 12px;
    line-height: 16px;
  }

  .lab-customer-service-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: min(560px, calc(100vh - 16px));
  }
}
