.lc-root {
  --lc-blue: #1769e0;
  --lc-line: #e3e8ef;
  --lc-muted: #66778a;
  color: #243346;
  font:
    14px/1.55 system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;
  text-align: left;
}
.lc-root * {
  box-sizing: border-box;
}
.lc-root [hidden] {
  display: none !important;
}
.lc-root button,
.lc-root input,
.lc-root textarea,
.lc-root select {
  font: inherit;
}
.lc-root button {
  cursor: pointer;
  border: 1px solid var(--lc-line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 11px;
  color: inherit;
  line-height: 1.5;
}
.lc-root button:hover {
  background: #eef5ff;
  border-color: #94b9ed;
}
.lc-root button:focus-visible,
.lc-root a:focus-visible,
.lc-root input:focus-visible,
.lc-root textarea:focus-visible,
.lc-root select:focus-visible {
  outline: 3px solid #88b8ff;
  outline-offset: 2px;
}
.lc-root button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.lc-launch {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 9998;
  background: var(--lc-blue) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 18px #1234;
  border-radius: 28px !important;
  padding: 13px 19px !important;
}
.lc-badge {
  margin-left: 6px;
  background: #e93946;
  color: #fff;
  border-radius: 12px;
  padding: 0 6px;
}
.lc-visitor .lc-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 430px;
  height: min(650px, calc(100dvh - 44px));
  z-index: 10000;
  box-shadow: 0 12px 60px #142d4a40;
  border-radius: 14px;
  overflow: hidden;
}
.lc-panel {
  background: #fff;
  border: 1px solid var(--lc-line);
}
.lc-admin .lc-panel {
  height: var(--lc-workbench-height, calc(100dvh - 100px));
  min-height: 360px;
  overflow: hidden;
}
.content-right.lc-workspace-page,
.content-right.lc-workspace-page > .content {
  min-height: 0;
}
.lc-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}
.lc-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.lc-main > :not(.lc-log) {
  flex-shrink: 0;
}
.lc-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--lc-line);
  background: #fff;
}
.lc-header strong {
  font-size: 17px;
}
.lc-header-tools {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.lc-connection {
  color: var(--lc-muted);
  font-size: 12px;
}
.lc-info {
  background: #f2f7ff;
  padding: 8px 16px;
  color: #49627f;
  font-size: 12px;
}
.lc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
}
.lc-actions:empty {
  display: none;
}
.lc-actions button,
.lc-actions input {
  font-size: 12px;
}
.lc-actions input {
  min-width: 100px;
  width: 155px;
  border: 1px solid var(--lc-line);
  border-radius: 6px;
  padding: 4px;
}
.lc-log {
  flex: 1;
  min-height: 100px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  overscroll-behavior: contain;
}
.lc-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.lc-message.lc-mine {
  align-items: flex-end;
}
.lc-meta {
  font-size: 11px;
  color: var(--lc-muted);
  margin-bottom: 4px;
}
.lc-bubble {
  max-width: 88%;
  border: 1px solid var(--lc-line);
  background: white;
  border-radius: 4px 12px 12px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.lc-mine .lc-bubble {
  background: #e6f1ff;
  border-color: #d5e7ff;
  border-radius: 12px 4px 12px 12px;
}
.lc-bubble img {
  max-width: 220px;
  max-height: 200px;
  object-fit: contain;
  display: block;
}
.lc-state {
  font-size: 10px;
  color: var(--lc-muted);
  margin-top: 3px;
}
.lc-goods {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  max-width: 240px;
}
.lc-goods img {
  max-width: 90px;
  max-height: 90px;
}
.lc-goods span {
  color: #d84135;
}
.lc-root form.lc-composer {
  /* ShopXO applies min-height:100% and flex-grow:1 to backend forms. */
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  border-top: 1px solid var(--lc-line);
  padding: 10px 12px;
  margin: 0;
  background: #fff;
}
.lc-composer textarea {
  display: block;
  width: 100%;
  border: 0;
  resize: none;
  padding: 6px;
  min-height: 66px;
  height: 84px;
  max-height: 140px;
  background: #fff;
  color: inherit;
}
.lc-compose-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}
.lc-compose-tools button {
  font-size: 12px;
}
.lc-compose-tools .lc-send {
  margin-left: auto;
  background: var(--lc-blue);
  border-color: var(--lc-blue);
  color: white;
  padding: 7px 20px;
}
.lc-notice {
  font-size: 12px;
  padding: 3px 14px;
  color: #a34512;
  white-space: pre-wrap;
}
.lc-notice:empty {
  display: none;
}
.lc-older {
  align-self: center;
  margin: 7px !important;
  font-size: 12px !important;
}
.lc-quick {
  display: flex;
  gap: 5px;
  padding: 5px 12px;
  max-height: 75px;
  overflow: auto;
  flex-wrap: wrap;
}
.lc-quick:empty {
  display: none;
}
.lc-quick button {
  font-size: 12px;
  padding: 3px 8px;
}
.lc-sidebar {
  width: 285px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--lc-line);
  padding: 12px;
  background: #fff;
  min-height: 0;
}
.lc-sidebar h3 {
  margin: 0 0 5px;
  font-size: 17px;
}
.lc-sidebar input,
.lc-sidebar select {
  border: 1px solid var(--lc-line);
  padding: 7px 9px;
  border-radius: 6px;
  width: 100%;
  min-height: 36px;
}
.lc-inbox {
  flex: 1;
  overflow-y: auto;
}
.lc-session {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
  padding: 12px !important;
}
.lc-session span {
  font-size: 12px;
  color: var(--lc-muted);
}
.lc-session.lc-selected {
  background: #eaf3ff;
  border-color: #87b5f0;
}
.lc-paging {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 4px;
}
.lc-pending {
  text-align: right;
  font-size: 12px;
  color: var(--lc-muted);
  margin: 10px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lc-retry {
  margin-left: 6px;
  color: #b53926 !important;
}
.lc-close {
  font-size: 12px !important;
}
@media (max-width: 640px) {
  .lc-visitor .lc-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .lc-launch {
    right: 14px;
    bottom: 80px;
  }
  .lc-header {
    padding: 12px;
  }
  .lc-sidebar {
    width: 36%;
    min-width: 130px;
    padding: 7px;
  }
  .lc-sidebar h3 {
    font-size: 14px;
  }
  .lc-sidebar input,
  .lc-sidebar select,
  .lc-session,
  .lc-paging button {
    font-size: 11px;
  }
  .lc-session {
    padding: 7px !important;
  }
  .lc-admin .lc-panel {
    min-height: 360px;
  }
  .lc-admin .lc-header-tools {
    margin-left: 0;
  }
  .lc-log {
    padding: 10px;
  }
  .lc-actions {
    gap: 4px;
    padding: 7px;
  }
  .lc-bubble {
    max-width: 92%;
  }
  .lc-bubble img {
    max-width: min(180px, 100%);
  }
  .lc-paging {
    flex-wrap: wrap;
  }
  .lc-compose-tools {
    flex-wrap: wrap;
  }
}
