#lc-widget,
#lc-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#lc-widget {
  --lc-brand: #2563eb;
  --lc-brand-dark: #1d4ed8;
  --lc-text: #1f2937;
  --lc-muted: #8b95a5;
  --lc-line: #e8ebf0;
  --lc-bg: #f6f7f9;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--lc-text);
}

#lc-widget .lc-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--lc-brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: lc-bubble-in .34s cubic-bezier(.22, 1, .36, 1) backwards;
}

/* 默认不显示，由脚本确认「页面上没有自定义入口」后才显示，避免先闪一下再消失 */
#lc-widget:not(.lc-bubble-on) .lc-bubble {
  display: none;
}

@keyframes lc-bubble-in {
  from { opacity: 0; transform: scale(.55); }
  to   { opacity: 1; transform: scale(1); }
}

#lc-widget .lc-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .42);
}

#lc-widget .lc-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #f5222d;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  font-style: normal;
}

#lc-widget .lc-tip {
  position: absolute;
  right: 68px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(260px, 62vw);
  padding: 9px 10px 9px 12px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  animation: lc-tip-in .3s cubic-bezier(.22, 1, .36, 1) backwards;
}

#lc-widget .lc-tip[hidden] {
  display: none;
}

#lc-widget .lc-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 16px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-top: 1px solid var(--lc-line);
  border-right: 1px solid var(--lc-line);
  transform: rotate(45deg);
}

#lc-widget .lc-tip-body {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lc-text);
  font: inherit;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

#lc-widget .lc-tip-x {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef1f5;
  color: #98a2b3;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
}

#lc-widget .lc-tip-x:hover {
  background: #e3e8ef;
  color: #667085;
}

@keyframes lc-tip-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: none; }
}

#lc-widget .lc-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  background: rgba(15, 23, 42, .45);
  animation: lc-fade .18s ease;
}
#lc-widget .lc-mask[hidden] {
  display: none;
}

#lc-widget.lc-open .lc-bubble {
  display: none;
}

#lc-widget .lc-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(640px, 92vw);
  height: min(720px, 90vh);
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
  transform: translate(-50%, -50%);
  animation: lc-in .22s cubic-bezier(.22, 1, .36, 1);
}

#lc-widget .lc-panel[hidden] {
  display: none;
}

@keyframes lc-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes lc-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#lc-widget .lc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--lc-line);
}

#lc-widget .lc-head-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .1);
  color: var(--lc-brand);
  flex: none;
}

#lc-widget .lc-head-info {
  flex: 1;
  min-width: 0;
}

#lc-widget .lc-head-info strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

#lc-widget .lc-head-avatar img,
#lc-widget .lc-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

#lc-widget .lc-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-style: normal;
  color: var(--lc-muted);
  font-size: 12px;
}

#lc-widget .lc-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd2dc;
  flex: none;
}

#lc-widget .lc-status em {
  font-style: normal;
}

#lc-widget.lc-online .lc-status i { background: #22c55e; }
#lc-widget.lc-online .lc-status em { color: #16a34a; }

#lc-widget.lc-offline .lc-status i { background: #cbd2dc; }
#lc-widget.lc-offline .lc-status em { color: #94a3b8; }

#lc-widget .lc-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lc-muted);
  cursor: pointer;
  flex: none;
}

#lc-widget .lc-close:hover {
  background: var(--lc-bg);
  color: var(--lc-text);
}

#lc-widget .lc-notice {
  padding: 8px 22px;
  background: #fff8ec;
  border-bottom: 1px solid #fbe6c4;
  color: #b0790f;
  font-size: 12.5px;
  line-height: 1.6;
}

#lc-widget .lc-notice[hidden] {
  display: none;
}

#lc-widget .lc-ended {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: #fff;
}

#lc-widget .lc-ended[hidden] {
  display: none;
}

#lc-widget .lc-ended span {
  color: var(--lc-muted);
  font-size: 13.5px;
}

#lc-widget .lc-restart {
  flex: none;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--lc-brand);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

#lc-widget .lc-restart:hover {
  opacity: .9;
}

#lc-widget .lc-end {
  flex: none;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(15, 23, 42, .05);
  color: #6b7484;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

#lc-widget .lc-end[hidden] {
  display: none;
}

#lc-widget .lc-end:hover {
  background: rgba(15, 23, 42, .1);
  color: var(--lc-text);
}

#lc-widget .lc-head-info + .lc-end {
  margin-left: auto;
}

#lc-widget .lc-input[hidden],
#lc-widget .lc-bar[hidden] {
  display: none;
}

#lc-widget .lc-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--lc-bg);
}

#lc-widget .lc-msgs {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 26px;
}

#lc-widget .lc-note {
  width: fit-content;
  max-width: 86%;
  margin: 0 auto 18px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .055);
  color: var(--lc-muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

#lc-widget .lc-day {
  margin: 18px 0;
  color: var(--lc-muted);
  font-size: 12px;
  text-align: center;
}

#lc-widget .lc-welcome {
  margin-bottom: 24px;
}

#lc-widget .lc-welcome-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#lc-widget .lc-welcome-text {
  max-width: 74%;
  padding: 12px 16px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-line;
}

#lc-widget .lc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  margin-left: 44px;
}

#lc-widget .lc-quick button {
  padding: 8px 15px;
  border: 1px solid #dde3ea;
  border-radius: 999px;
  background: #fff;
  color: #43506b;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

#lc-widget .lc-quick button:hover {
  border-color: var(--lc-brand);
  color: var(--lc-brand);
}

#lc-widget .lc-row {
  display: block;
  margin-bottom: 16px;
  animation: lc-row-in .24s cubic-bezier(.22, 1, .36, 1) backwards;
}

#lc-widget .lc-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

#lc-widget .lc-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(37, 99, 235, .1);
  color: var(--lc-brand);
  font-size: 14px;
  font-weight: 600;
}

#lc-widget .lc-name {
  color: #6b7484;
  font-size: 12.5px;
  font-weight: 500;
}

#lc-widget .lc-time {
  color: var(--lc-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

#lc-widget .lc-read {
  color: #b0b7c3;
  font-size: 11.5px;
  white-space: nowrap;
}

#lc-widget .lc-read.is-read {
  color: #1a9e6a;
}

#lc-widget .lc-read.is-fail {
  color: #e5484d;
}

#lc-widget .lc-row.lc-group {
  margin-top: -8px;
}

#lc-widget .lc-row.is-fail {
  cursor: pointer;
}

#lc-widget .lc-row.is-fail .lc-msg {
  box-shadow: 0 0 0 1px #f3b4b6;
}

#lc-widget .lc-row.lc-cardrow .lc-msg {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#lc-widget .lc-newline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #9aa4b2;
  font-size: 12px;
}

#lc-widget .lc-newline::before,
#lc-widget .lc-newline::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e4e8ef;
}

#lc-widget .lc-msg {
  width: fit-content;
  max-width: 74%;
  margin-left: 42px;
  padding: 11px 15px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

#lc-widget .lc-row.lc-me .lc-head-row {
  justify-content: flex-end;
}

#lc-widget .lc-row.lc-me .lc-msg {
  margin-left: auto;
  background: var(--lc-brand);
  color: #fff;
}

#lc-widget .lc-jump {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid #e2e6ec;
  border-radius: 999px;
  background: #fff;
  color: #56617a;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
  transform: translateX(-50%);
  animation: lc-fade .18s ease backwards;
}

#lc-widget .lc-jump[hidden] {
  display: none;
}

#lc-widget .lc-jump:hover {
  border-color: var(--lc-brand);
  color: var(--lc-brand);
}

#lc-widget .lc-typing .lc-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 15px 16px;
}

#lc-widget .lc-typing .lc-msg i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b6bdc9;
  animation: lc-dot 1.1s infinite ease-in-out;
}

#lc-widget .lc-typing .lc-msg i:nth-child(2) {
  animation-delay: .16s;
}

#lc-widget .lc-typing .lc-msg i:nth-child(3) {
  animation-delay: .32s;
}

#lc-widget .lc-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--lc-line);
  background: #fff;
}

#lc-widget .lc-pending {
  padding: 12px 20px 0;
}

#lc-widget .lc-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

#lc-widget .lc-bar-sp {
  flex: 1;
}

#lc-widget .lc-tool {
  width: 34px;
  height: 34px;
  margin-bottom: 0;
  align-self: center;
}

#lc-widget .lc-hint {
  margin-right: 10px;
  color: #b3bac6;
  font-size: 12px;
  white-space: nowrap;
}

#lc-widget .lc-promo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#lc-widget .lc-promo-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid #d9e2f2;
  border-radius: 999px;
  background: #f4f7fd;
  color: var(--lc-brand);
  font-size: 12.5px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}

#lc-widget .lc-promo-item:hover {
  background: #e8f0fd;
  border-color: var(--lc-brand);
}

#lc-widget button.lc-promo-item {
  font: inherit;
  font-size: 12.5px;
  line-height: 1.3;
  cursor: pointer;
}

#lc-widget .lc-copy {
  color: #b3bac6;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
}

#lc-widget .lc-pop {
  bottom: 168px;
}

#lc-widget .lc-input {
  width: 100%;
  min-height: 88px;
  max-height: 200px;
  padding: 12px 14px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: #fff;
  color: var(--lc-text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.75;
  resize: none;
  outline: none;
  transition: border-color .15s ease;
}

#lc-widget .lc-input:focus {
  border-color: var(--lc-brand);
}

#lc-widget .lc-send {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 38px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--lc-brand);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  flex: none;
  transition: background .15s ease, opacity .15s ease;
}

#lc-widget .lc-send:hover:not(:disabled) {
  background: var(--lc-brand-dark);
}

#lc-widget .lc-send:disabled {
  opacity: .45;
  cursor: default;
}

@media (max-width: 640px) {
  #lc-widget {
    right: 16px;
    bottom: 16px;
  }
  #lc-widget .lc-mask {
    display: none;
  }
  #lc-widget .lc-panel {
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    transform: none;
    animation: none;
  }
  #lc-widget .lc-head {
    padding: 14px 16px;
  }
  #lc-widget .lc-msgs {
    padding: 16px;
  }
  #lc-widget .lc-foot {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }
  #lc-widget .lc-pending {
    padding: 10px 14px 0;
  }
  #lc-widget .lc-input {
    min-height: 72px;
  }
  #lc-widget .lc-hint {
    display: none;
  }
  #lc-widget .lc-msg {
    max-width: 72%;
  }
  #lc-widget .lc-welcome-text {
    max-width: 88%;
  }
}

#lc-widget .lc-rate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: #f9fafc;
}

#lc-widget .lc-rate[hidden] {
  display: none;
}

#lc-widget .lc-rate-tip {
  color: var(--lc-text);
  font-size: 13.5px;
}

#lc-widget .lc-rate-stars {
  display: flex;
  gap: 4px;
}

#lc-widget .lc-rate-stars button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: #d6dae2;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color .12s ease, transform .12s ease;
}

#lc-widget .lc-rate-stars button:hover {
  transform: scale(1.08);
}

#lc-widget .lc-rate-stars button.is-on {
  color: #f5a623;
}

#lc-widget .lc-rate-text {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  background: #fff;
  color: var(--lc-text);
  font: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
}

#lc-widget .lc-rate-text:focus {
  border-color: var(--lc-brand);
}

#lc-widget .lc-rate-submit {
  align-self: flex-start;
  height: 32px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--lc-brand);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

#lc-widget .lc-rate-submit:disabled {
  opacity: .45;
  cursor: default;
}

#lc-widget .lc-rate-thanks {
  display: none;
  color: #1a7f5a;
  font-size: 13.5px;
}

#lc-widget .lc-rate.is-done .lc-rate-tip,
#lc-widget .lc-rate.is-done .lc-rate-stars,
#lc-widget .lc-rate.is-done .lc-rate-text,
#lc-widget .lc-rate.is-done .lc-rate-submit {
  display: none;
}

#lc-widget .lc-rate.is-done .lc-rate-thanks {
  display: block;
}

#lc-widget .lc-confirm {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .28);
  border-radius: inherit;
}

#lc-widget .lc-confirm[hidden] {
  display: none;
}

#lc-widget .lc-confirm-box {
  width: 82%;
  max-width: 320px;
  padding: 18px 18px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .22);
  text-align: center;
}

#lc-widget .lc-confirm-box p {
  margin: 0 0 14px;
  color: var(--lc-text);
  font-size: 14px;
  line-height: 1.6;
}

#lc-widget .lc-confirm-act {
  display: flex;
  gap: 8px;
  justify-content: center;
}

#lc-widget .lc-confirm-act button {
  min-width: 88px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

#lc-widget .lc-confirm-cancel {
  border: 1px solid var(--lc-line);
  background: #fff;
  color: var(--lc-text);
}

#lc-widget .lc-confirm-ok {
  border: 0;
  background: var(--lc-brand);
  color: #fff;
}

#lc-widget .lc-confirm-ok:hover {
  background: var(--lc-brand-dark);
}

#lc-widget .lc-inquiry[hidden] {
  display: none;
}

#lc-widget .lc-inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#lc-widget .lc-inquiry-form[hidden] {
  display: none;
}

#lc-widget .lc-inquiry-tip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--lc-muted);
  font-size: 13px;
  line-height: 1.6;
}

#lc-widget .lc-inquiry-tip::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: #cbd2dc;
}

#lc-widget .lc-inquiry-done {
  padding: 12px 14px;
  border: 1px solid #b7e2c8;
  border-radius: 10px;
  background: #eaf7f0;
  color: #1a7f5a;
  font-size: 13.5px;
  line-height: 1.6;
}

#lc-widget .lc-inquiry-done[hidden] {
  display: none;
}

#lc-widget .lc-inquiry-name,
#lc-widget .lc-inquiry-contact,
#lc-widget .lc-inquiry-msg {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--lc-line);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--lc-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
}

#lc-widget .lc-inquiry-msg {
  resize: none;
  line-height: 1.6;
}

#lc-widget .lc-inquiry-name:focus,
#lc-widget .lc-inquiry-contact:focus,
#lc-widget .lc-inquiry-msg:focus {
  border-color: var(--lc-brand);
  background: #fff;
}

#lc-widget .lc-inquiry-contact.is-error {
  border-color: #ef4444;
  background: #fff;
}

#lc-widget .lc-inquiry-submit {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--lc-brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease;
}

#lc-widget .lc-inquiry-submit:hover:not(:disabled) {
  background: var(--lc-brand-dark);
}

#lc-widget .lc-inquiry-submit:disabled {
  opacity: .5;
  cursor: default;
}

#lc-widget .lc-inquiry-attach {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed #d5dbe4;
  border-radius: 8px;
  background: #fff;
  color: #5b6472;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

#lc-widget .lc-inquiry-attach:hover {
  border-color: var(--lc-brand);
  color: var(--lc-brand);
}

#lc-widget .lc-inquiry-form .lc-pending {
  padding: 0;
}
