.coze-cs-root {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 80;
  font-family: Manrope, "Noto Sans SC", "Noto Sans TC", sans-serif;
  color: #1b3a4b;
}

.coze-cs-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.65rem 1rem 0.65rem 0.8rem;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.65), transparent 24%),
    linear-gradient(135deg, #d75aa8 0%, #29b8dc 58%, #1b3a4b 100%);
  box-shadow: 0 18px 45px rgba(27, 58, 75, 0.25);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.coze-cs-launcher:hover,
.coze-cs-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 55px rgba(27, 58, 75, 0.32);
  outline: none;
}

.coze-cs-launcher-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.coze-cs-launcher-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.coze-cs-launcher-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.coze-cs-launcher-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  opacity: 0.86;
}

.coze-cs-launcher-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #8df0bb;
  box-shadow: 0 0 0 3px rgba(141, 240, 187, 0.18);
}

.coze-cs-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.9rem);
  display: none;
  width: min(25rem, calc(100vw - 2rem));
  height: min(36rem, calc(100svh - 7rem));
  overflow: hidden;
  border: 1px solid rgba(27, 58, 75, 0.1);
  border-radius: 1.5rem;
  background: rgba(253, 252, 248, 0.96);
  box-shadow: 0 28px 70px rgba(27, 58, 75, 0.22);
  backdrop-filter: blur(22px);
}

.coze-cs-root.is-open .coze-cs-panel {
  display: flex;
  flex-direction: column;
}

.coze-cs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  color: #ffffff;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.55), transparent 22%),
    linear-gradient(135deg, #d75aa8 0%, #29b8dc 62%, #1b3a4b 100%);
}

.coze-cs-brand-mark {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.16);
}

.coze-cs-brand-mark img {
  width: 2.25rem;
  height: auto;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.12));
}

.coze-cs-heading {
  min-width: 0;
  flex: 1;
}

.coze-cs-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.coze-cs-subtitle {
  margin: 0.18rem 0 0;
  font-size: 0.72rem;
  opacity: 0.86;
}

.coze-cs-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.coze-cs-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(253, 252, 248, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(58, 124, 165, 0.12), transparent 34%);
}

.coze-cs-message {
  max-width: 86%;
  padding: 0.72rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.coze-cs-message.bot {
  align-self: flex-start;
  border-top-left-radius: 0.35rem;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(27, 58, 75, 0.08);
}

.coze-cs-message.user {
  align-self: flex-end;
  border-top-right-radius: 0.35rem;
  color: #ffffff;
  background: #1b3a4b;
}

.coze-cs-message.is-loading {
  color: rgba(27, 58, 75, 0.58);
  font-style: italic;
}

.coze-cs-disclaimer {
  margin: 0;
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(27, 58, 75, 0.08);
  color: rgba(27, 58, 75, 0.62);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  line-height: 1.45;
}

.coze-cs-form {
  display: flex;
  gap: 0.55rem;
  padding: 0.8rem;
  border-top: 1px solid rgba(27, 58, 75, 0.08);
  background: #ffffff;
}

.coze-cs-input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(27, 58, 75, 0.14);
  border-radius: 999px;
  padding: 0.72rem 0.9rem;
  color: #1b3a4b;
  background: #fdfcf8;
  font: inherit;
}

.coze-cs-input:focus {
  border-color: rgba(58, 124, 165, 0.62);
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 124, 165, 0.12);
}

.coze-cs-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 0 1rem;
  color: #ffffff;
  background: #3a7ca5;
  font-weight: 800;
  cursor: pointer;
}

.coze-cs-send:disabled,
.coze-cs-input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 767px) {
  .coze-cs-root {
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .coze-cs-launcher {
    min-height: 3rem;
    padding-right: 0.9rem;
  }

  .coze-cs-panel {
    position: fixed;
    right: 0.75rem;
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
    left: 0.75rem;
    width: auto;
    height: min(34rem, calc(100svh - 6.5rem));
    border-radius: 1.25rem;
  }
}
