.blch-widget,
.blch-widget *,
.blch-mobile-bar,
.blch-mobile-bar * {
  box-sizing: border-box;
}

.blch-widget {
  position: fixed;
  z-index: 99990;
  bottom: var(--blch-bottom, 24px);
  color: #0f1b2d;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.blch-right {
  right: var(--blch-side, 24px);
}

.blch-left {
  left: var(--blch-side, 24px);
}

.blch-inline {
  position: relative;
  right: auto;
  left: auto;
  bottom: auto;
  display: inline-block;
  z-index: 1;
}

.blch-trigger {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--blch-brand, #0b2e4f);
  box-shadow: 0 14px 34px rgba(11, 46, 79, .24);
  cursor: pointer;
}

.blch-trigger-mark {
  position: relative;
  z-index: 2;
  font-weight: 800;
  letter-spacing: 0;
}

.blch-trigger-pulse {
  position: absolute;
  inset: -6px;
  border: 1px solid color-mix(in srgb, var(--blch-accent, #c9a961), transparent 45%);
  border-radius: inherit;
  animation: blch-pulse 1.8s ease-out infinite;
}

@keyframes blch-pulse {
  from {
    opacity: .8;
    transform: scale(.9);
  }
  to {
    opacity: 0;
    transform: scale(1.25);
  }
}

.blch-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transform-origin: bottom right;
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(11, 46, 79, .18);
  transition: opacity .18s ease, transform .18s ease;
}

.blch-left .blch-panel {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}

.blch-widget.is-open .blch-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.blch-panel-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 20px 20px 16px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--blch-accent, #c9a961), transparent 72%), transparent 40%),
    var(--blch-brand, #0b2e4f);
}

.blch-panel-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.blch-panel-head p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12.5px;
  line-height: 1.55;
}

.blch-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.blch-status {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  background: #f8fafb;
  border-bottom: 1px solid #e2e8ee;
}

.blch-status > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
}

.blch-status strong,
.blch-status small {
  display: block;
}

.blch-status strong {
  color: #0f1b2d;
  font-size: 12.5px;
}

.blch-status small {
  margin-top: 2px;
  color: #5b6b7c;
  font-size: 11.5px;
}

.blch-channel-list {
  display: grid;
  gap: 1px;
  background: #e2e8ee;
}

.blch-channel {
  width: 100%;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 16px 18px;
  text-align: left;
  text-decoration: none;
  color: #0f1b2d;
  background: #fff;
  border: 0;
  cursor: pointer;
  transition: background .14s ease;
}

.blch-channel:hover {
  background: #f8fafb;
}

.blch-channel-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 12px;
}

.blch-channel-icon svg {
  width: 22px;
  height: 22px;
}

.blch-wa .blch-channel-icon {
  background: #25d366;
}

.blch-wechat .blch-channel-icon {
  background: #07c160;
}

.blch-phone .blch-channel-icon {
  background: var(--blch-brand, #0b2e4f);
}

.blch-channel strong,
.blch-channel small {
  display: block;
}

.blch-channel strong {
  color: #0b2e4f;
  font-size: 14px;
}

.blch-channel small {
  margin-top: 3px;
  color: #5b6b7c;
  font-size: 12px;
}

.blch-wechat-card {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 276px;
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(11, 46, 79, .18);
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.blch-left .blch-wechat-card {
  left: 0;
  right: auto;
}

.blch-wechat-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.blch-wechat-card .blch-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #5b6b7c;
  background: #f8fafb;
}

.blch-wechat-card strong,
.blch-wechat-card small {
  display: block;
}

.blch-wechat-card strong {
  color: #0b2e4f;
  font-size: 15px;
}

.blch-wechat-card small {
  margin-top: 5px;
  color: #5b6b7c;
}

.blch-wechat-card img,
.blch-qr-placeholder {
  width: 190px;
  height: 190px;
  margin: 18px auto 0;
  border-radius: 10px;
}

.blch-wechat-card img {
  object-fit: cover;
  border: 1px solid #e2e8ee;
}

.blch-qr-placeholder {
  display: grid;
  place-items: center;
  color: #8a98a6;
  background: repeating-linear-gradient(135deg, #eef2f5 0 12px, #f8fafb 12px 24px);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.blch-mobile-bar {
  display: none;
}

@media (max-width: 720px) {
  .blch-display-desktop {
    display: none;
  }

  .blch-widget {
    bottom: calc(var(--blch-mobile-bottom, 14px) + 62px);
    right: 14px;
    left: auto;
  }

  .blch-panel,
  .blch-wechat-card {
    right: 0;
    left: auto;
    bottom: 70px;
  }

  .blch-mobile-bar {
    position: fixed;
    z-index: 99989;
    left: 12px;
    right: 12px;
    bottom: var(--blch-mobile-bottom, 14px);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8ee;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(11, 46, 79, .18);
  }

  .blch-mobile-bar a,
  .blch-mobile-bar button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 58px;
    color: #0b2e4f;
    background: #fff;
    border: 0;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 700;
  }

  .blch-mobile-bar svg {
    width: 21px;
    height: 21px;
  }

  .blch-mobile-bar > * + * {
    border-left: 1px solid #e2e8ee;
  }
}

@media (min-width: 721px) {
  .blch-display-mobile {
    display: none;
  }
}
