.cs {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.cs__btn {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #b8f53d;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
  transition: transform .2s ease, box-shadow .2s ease;
}

.cs__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .34);
}

.cs__btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #08090b;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs__dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #0b0d10;
}

.cs__panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 364px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #0b0d10;
  color: #edeff2;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.cs__panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.cs__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: #0e1116;
}

.cs__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #b8f53d;
  color: #08090b;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
}

.cs__who {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.cs__who strong {
  font-size: 14px;
  font-weight: 600;
}

.cs__who span {
  font-size: 12px;
  color: #8a929b;
}

.cs__close {
  border: 0;
  background: transparent;
  color: #8a929b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.cs__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.cs__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: #2a2f36 transparent;
}

.cs__msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
  animation: cs-in .22s ease both;
}

.cs__msg--bot {
  align-self: flex-start;
  background: #171a1f;
  color: #e3e6ea;
  border-bottom-left-radius: 5px;
}

.cs__msg--user {
  align-self: flex-end;
  background: #b8f53d;
  color: #08090b;
  border-bottom-right-radius: 5px;
}

@keyframes cs-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.cs__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 8px;
}

.cs__chip {
  border: 1px solid rgba(184, 245, 61, .45);
  background: rgba(184, 245, 61, .08);
  color: #d8f7a0;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s, color .18s;
}

.cs__chip:hover {
  background: #b8f53d;
  color: #08090b;
}

.cs__form {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: #0e1116;
}

.cs__form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #141821;
  color: #fff;
  border-radius: 9px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.cs__form input::placeholder {
  color: #6b737d;
}

.cs__form input:focus {
  border-color: rgba(184, 245, 61, .6);
}

.cs__form button {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: #b8f53d;
  color: #08090b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cs__form button:disabled {
  opacity: .5;
  cursor: default;
}

.cs__note {
  margin: 0;
  padding: 0 14px 12px;
  background: #0e1116;
  color: #6b737d;
  font-size: 12px;
  text-align: center;
}

/* 留资表单蜜罐字段（正常用户不可见） */
.form__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 520px) {
  .cs {
    right: 14px;
    bottom: 14px;
  }

  .cs__btn {
    width: 54px;
    height: 54px;
  }

  .cs__panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 80px;
    width: auto;
    height: min(72vh, 560px);
    max-height: calc(100vh - 100px);
  }
}
