/* 仅作用于客服入口和悬浮外框；实际聊天由配置的客服网页提供。 */
#J_pluginPortalBox.cs-launcher,
#customer-service-root {
  --cs-orange: #ff6000;
  --cs-orange-hover: #ec5800;
  --cs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
  font-family: var(--cs-font);
  -webkit-tap-highlight-color: transparent;
}

#J_pluginPortalBox.cs-launcher {
  position: fixed;
  z-index: 2147483000;
  top: min(63%, calc(100% - 94px));
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  margin: 0;
  padding: 6px;
  border: 0;
  border-radius: 9px;
  background: var(--cs-orange);
  box-shadow: 0 5px 18px rgb(255 96 0 / 22%);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 160ms, box-shadow 160ms;
}

#J_pluginPortalBox.cs-launcher:hover {
  background: var(--cs-orange-hover);
  box-shadow: 0 7px 22px rgb(255 96 0 / 30%);
}

#J_pluginPortalBox.cs-launcher.cs-dragging {
  cursor: grabbing;
}

#J_pluginPortalBox.cs-launcher > span {
  pointer-events: none;
}

#J_pluginPortalBox.cs-launcher > svg {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
}

#J_pluginPortalBox.cs-launcher:focus-visible,
#customer-service-root button:focus-visible,
#customer-service-root a:focus-visible {
  outline: 3px solid #ffb27f;
  outline-offset: 3px;
}

#customer-service-root {
  position: fixed;
  z-index: 2147483100;
  right: 110px;
  bottom: 56px;
  display: block;
  width: 600px;
  max-width: calc(100% - 130px);
  height: 660px;
  max-height: calc(100% - 80px);
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  color-scheme: light;
}

#customer-service-root[hidden],
#customer-service-root [hidden] {
  display: none !important;
}

#customer-service-root *,
#customer-service-root *::before,
#customer-service-root *::after {
  box-sizing: border-box;
}

#customer-service-root .cs-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 36px rgb(0 0 0 / 16%), 0 0 0 1px rgb(0 0 0 / 5%);
}

#customer-service-root .cs-content,
#customer-service-root .cs-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

#customer-service-root .cs-close {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: var(--cs-orange);
  color: #fff;
  cursor: pointer;
}

#customer-service-root .cs-close:hover {
  background: var(--cs-orange-hover);
}

#customer-service-root .cs-close svg {
  display: block;
  width: 23px;
  height: 23px;
  pointer-events: none;
}

#customer-service-root .cs-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: #fff;
  text-align: center;
}

#customer-service-root .cs-loading-text {
  margin: 0;
  color: #8b8f97;
  font-size: 14px;
}

#customer-service-root .cs-loading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

#customer-service-root .cs-retry {
  margin: 0;
  padding: 7px 16px;
  border: 0;
  border-radius: 5px;
  background: var(--cs-orange);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

#customer-service-root .cs-external {
  color: var(--cs-orange);
  font-size: 14px;
  text-decoration: underline;
}

@media (max-width: 600px) {
  #J_pluginPortalBox.cs-launcher {
    top: auto;
    right: 14px;
    bottom: max(100px, env(safe-area-inset-bottom));
    width: 66px;
    height: 66px;
    gap: 0;
    font-size: 12px;
    line-height: 16px;
  }

  #J_pluginPortalBox.cs-launcher > svg {
    width: 38px;
    height: 38px;
  }

  #customer-service-root {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
  }
}

@media (max-height: 520px) {
  #customer-service-root {
    bottom: 12px;
    max-height: calc(100% - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #J_pluginPortalBox.cs-launcher {
    transition: none;
  }
}
