.ctc-root {
  --ctc-bg: #fffdf8;
  --ctc-ink: #1f2933;
  --ctc-muted: #697386;
  --ctc-line: rgba(31, 41, 51, 0.12);
  --ctc-accent: #0f8b6f;
  --ctc-accent-strong: #096b56;
  --ctc-warm: #ffe6bd;
  font-family: HarmonyOS, "Microsoft YaHei", sans-serif;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99998;
}

.pvr_chat_button,
.pvr_chat_wrapper {
  display: none !important;
}

.ctc-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--ctc-accent), #1fa786);
  box-shadow: 0 12px 28px rgba(15, 139, 111, 0.32);
  font-size: 15px;
  font-weight: 700;
}

.ctc-launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #a8ffcf;
  box-shadow: 0 0 0 5px rgba(168, 255, 207, 0.2);
}

.ctc-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(360px, calc(100vw - 28px));
  height: 560px;
  max-height: calc(100vh - 94px);
  display: none;
  overflow: hidden;
  border: 1px solid var(--ctc-line);
  border-radius: 8px;
  background: var(--ctc-bg);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.28);
}

.ctc-open .ctc-panel {
  display: flex;
  flex-direction: column;
}

.ctc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  color: #fff;
  background: #123c34;
}

.ctc-header strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.ctc-header span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.ctc-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-size: 25px;
  line-height: 28px;
}

.ctc-profile {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ctc-line);
  background: linear-gradient(180deg, #fff8ec, #fffdf8);
}

.ctc-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #123c34;
  background: var(--ctc-warm);
  font-weight: 800;
}

.ctc-profile b {
  display: block;
  color: var(--ctc-ink);
  font-size: 14px;
}

.ctc-profile p {
  margin: 3px 0 0;
  color: var(--ctc-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ctc-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ctc-line);
}

.ctc-fields input,
.ctc-input {
  width: 100%;
  border: 1px solid var(--ctc-line);
  border-radius: 7px;
  color: var(--ctc-ink);
  background: #fff;
  outline: none;
}

.ctc-fields input {
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.ctc-fields input:focus,
.ctc-input:focus {
  border-color: rgba(15, 139, 111, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 139, 111, 0.1);
}

.ctc-field-error {
  border-color: #d92d20 !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12) !important;
}

.ctc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(15, 139, 111, 0.035) 10px 11px);
}

.ctc-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}

.ctc-message-customer {
  margin-left: auto;
  color: #fff;
  background: var(--ctc-accent);
}

.ctc-message-agent {
  color: var(--ctc-ink);
  background: #fff;
  border: 1px solid var(--ctc-line);
}

.ctc-message-image {
  display: block;
  max-width: 210px;
  max-height: 180px;
  margin-bottom: 6px;
  border-radius: 6px;
  object-fit: cover;
}

.ctc-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 12px 16px 8px;
  border-top: 1px solid var(--ctc-line);
  background: #fffdf8;
}

.ctc-input {
  min-height: 42px;
  max-height: 110px;
  resize: vertical;
  padding: 9px 10px;
  font-size: 14px;
}

.ctc-actions {
  display: grid;
  grid-template-columns: 42px 72px;
  gap: 7px;
}

.ctc-upload,
.ctc-send {
  height: 42px;
  border: 0;
  border-radius: 7px;
  font-weight: 700;
}

.ctc-upload {
  color: var(--ctc-accent);
  background: #e9f7f2;
  font-size: 24px;
  line-height: 1;
}

.ctc-send {
  color: #fff;
  background: var(--ctc-accent);
}

.ctc-upload:hover {
  background: #d6f0e8;
}

.ctc-send:hover {
  background: var(--ctc-accent-strong);
}

.ctc-upload:disabled,
.ctc-send:disabled {
  opacity: 0.65;
}

.ctc-status {
  min-height: 28px;
  padding: 0 16px 10px;
  color: var(--ctc-muted);
  font-size: 12px;
}

@media (max-width: 520px) {
  .ctc-root {
    right: 12px;
    bottom: 12px;
  }

  .ctc-panel {
    right: -4px;
    bottom: 56px;
    height: min(560px, calc(100vh - 84px));
  }
}
