.ask-te-root {
  position: fixed;
  right: 20px;
  bottom: 18px;
  left: auto;
  z-index: 99999999;
  font-family:'Alibaba-PuHuiTi-R';
  color: #222;
  -webkit-font-smoothing: antialiased;
}

.ask-te-launcher {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #ff7828;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 120, 40, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ask-te-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 22px rgba(255, 120, 40, 0.5);
}

.ask-te-launcher svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.ask-te-panel {
  display: none;
  flex-direction: column;
  width: 370px;
  height: 560px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 36px);
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.22);
  box-sizing: border-box;
}

.ask-te-root.is-open .ask-te-panel {
  display: flex;
}

.ask-te-root.is-open .ask-te-launcher {
  display: none;
}

.ask-te-head {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  /* height: 80px; */
  background: rgb(255, 115, 45);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 18px 20px;
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
  box-shadow: 0 4px 10px rgba(85, 106, 160, .2);
}

.ask-te-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.ask-te-head-copy {
  min-width: 0;
  flex: 1;
}

.ask-te-head-copy strong {
  display: block;
  font-size: 18px;
  line-height: 22px;
  font-weight: 700;
}

.ask-te-head-copy span {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
  line-height: 22px;
}

.ask-te-collapse {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  svg {
    font-size: 20px;
    width: 28px;
    height: 28px; 
  }
}

.ask-te-collapse:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ask-te-messages {
  flex: 1;
  overflow-y: auto;
  /* Extra bottom padding so hover timestamps on the last message are not clipped. */
  padding: 18px 16px 28px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #d7ddee transparent;
}

.ask-te-messages::-webkit-scrollbar {
  width: 6px;
}

.ask-te-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ask-te-messages::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #d7ddee;
}

.ask-te-messages::-webkit-scrollbar-thumb:hover {
  background: #b8bec9;
}

.ask-te-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.ask-te-row.is-user {
  justify-content: flex-end;
}

.ask-te-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff3ea;
  color: #ff7828;
  font-size: 13px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
  flex: 0 0 auto;
  user-select: none;
}

.ask-te-msg {
  position: relative;
  max-width: 78%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.ask-te-row.is-user .ask-te-msg {
  align-items: flex-end;
}

.ask-te-bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ask-te-row.is-user .ask-te-bubble {
  background: #ff7828;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ask-te-row.is-user.is-quick .ask-te-bubble {
  background: #f3eee6;
  color: #4a4338;
  border-bottom-right-radius: 16px;
}

.ask-te-row.is-assistant .ask-te-bubble {
  background: #f0f2f5;
  color: #333;
  border-bottom-left-radius: 4px;
}

/* Absolutely positioned so hover does not shift layout (no jitter). */
.ask-te-time {
  position: absolute;
  /* top: calc(100% + 2px); */
  left: 0;
  /* line-height: 1.2; */
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  font-size: 12px;
  transform: scale(.9);
  color: #999;
  bottom: -17px;
}

.ask-te-row.is-user .ask-te-time {
  left: auto;
  right: 0;
}

.ask-te-msg:hover .ask-te-time {
  opacity: 1;
  visibility: visible;
}

.ask-te-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 42px;
  height: 16px;
}

.ask-te-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8bcc6;
  animation: ask-te-dot 1s infinite ease-in-out;
}

.ask-te-typing i:nth-child(2) { animation-delay: 0.15s; }
.ask-te-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ask-te-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.ask-te-composer {
  flex: 0 0 auto;
  border-top: 1px solid #eceef2;
  background: #fff;
  padding: 10px 12px 8px;
}

.ask-te-input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 0;
  resize: none;
  margin: 0;
  padding: 0;
  line-height: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 14px;
  min-height: 30px;
  scrollbar-width: thin;
  scrollbar-color: #d0d5de transparent;
  letter-spacing: -.24px;
  -webkit-font-smoothing: antialiased;
  -webkit-appearance: none;
  &::placeholder {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -.24px;
    -webkit-font-smoothing: antialiased;
    -webkit-appearance: none;
  }
}

.ask-te-input::-webkit-scrollbar {
  width: 6px;
}

.ask-te-input::-webkit-scrollbar-track {
  background: transparent;
}

.ask-te-input::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #d0d5de;
}

.ask-te-input::-webkit-scrollbar-thumb:hover {
  background: #b8bec9;
}

.ask-te-input::placeholder {
  color: #b7bbc4;
}

.ask-te-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 16px;
}

.ask-te-tool {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #9aa0ab;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ask-te-tool:hover {
  background: #f4f5f7;
  color: #666;
}

.ask-te-tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ask-te-send {
  margin-left: auto;
  width: 60px;
  line-height: 32px;
  height: 30px;
  border: 0;
  border-radius: 40px;
  background: rgb(255, 115, 45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 120, 40, 0.28);
}

.ask-te-send:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.ask-te-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transform: translateX(1px);
}

.ask-te-emoji {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 8px;
}

.ask-te-emoji.is-open {
  display: flex;
}

.ask-te-emoji button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  border-radius: 8px;
}

.ask-te-emoji button:hover {
  background: #f4f5f7;
}

.ask-te-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 8px 36px;
  margin-bottom: 8px;
}

.ask-te-chip {
  border: 1px solid #ff7828;
  background: #fff;
  color: #ff7828;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}

.ask-te-chip:hover {
  background: #fff7f1;
}

.ask-te-lead-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 0 8px 0px;
  margin-bottom: 8px;
}

.ask-te-skip-link {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.3;
  padding: 0;
  margin: 0;
  text-decoration: underline;
  cursor: pointer;
}

.ask-te-skip-link:hover {
  color: #ff7828;
}

.ask-te-skip-link:disabled {
  opacity: 0.5;
  cursor: default;
}

.ask-te-lead-card {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  border: 1px solid #ffd2b3;
  border-radius: 12px;
  background: #fff;
  padding: 14px 14px 12px;
  box-shadow: 0 2px 10px rgba(255, 120, 40, 0.08);
}

.ask-te-lead-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.ask-te-lead-head strong {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.ask-te-lead-optional {
  font-size: 12px;
  color: #b67d17;
  padding: 2px 8px;
  line-height: 1.3;
}

.ask-te-lead-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.ask-te-lead-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.3;
  color: #222;
  outline: none;
  background: #fff;
}

.ask-te-lead-input:focus {
  border-color: #ff7828;
  box-shadow: 0 0 0 3px rgba(255, 120, 40, 0.12);
}

.ask-te-lead-input:disabled {
  background: #f7f8fa;
  color: #9aa0ab;
}

.ask-te-lead-or {
  position: relative;
  text-align: center;
  margin: 2px 0 12px;
  color: #9aa0ab;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.ask-te-lead-or::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #eceef2;
}

.ask-te-lead-or span {
  position: relative;
  display: inline-block;
  padding: 0 8px;
  background: #fff;
}

.ask-te-lead-phone-row {
  display: flex;
  gap: 8px;
}

.ask-te-lead-code {
  flex: 0 0 88px;
  min-width: 0;
}

.ask-te-lead-phone {
  flex: 1;
  min-width: 0;
}

.ask-te-lead-error {
  margin: -2px 0 10px;
  color: #c2410c;
  font-size: 12px;
  line-height: 1.35;
}

.ask-te-lead-submit {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #ff7828;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  padding: 11px 12px;
  cursor: pointer;
}

.ask-te-lead-submit:hover {
  background: #f06b1c;
}

.ask-te-lead-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.ask-te-row.is-system .ask-te-bubble {
  background: #fff6e8;
  color: #8a5a2b;
}

.ask-te-foot {
  text-align: center;
  font-size: 11px;
  color: #a8adb8;
  padding: 6px 0 2px;
  line-height: 1.4;
}

.ask-te-foot a {
  color: #a8adb8;
  text-decoration: none;
}

.ask-te-foot a:hover {
  color: #888;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .ask-te-root {
    right: 10px;
    bottom: 10px;
  }

  .ask-te-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    border-radius: 10px;
  }
}
