/* 官网（yaoplay88.com）与推广落地页（/go/）共用的页内在线客服悬浮小窗（零内联样式、最小字号 >= 12px） */
.yp-live-chat-drawer[hidden] {
  display: none !important;
}

.yp-live-chat-drawer {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(392px, calc(100vw - 24px));
  height: min(580px, calc(100dvh - 36px));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1.5px solid rgba(247, 207, 117, 0.52);
  background: linear-gradient(180deg, #24150b 0%, #140b05 100%);
  color: #fff6e5;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 224, 150, 0.08) inset;
  overflow: hidden;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 540px) {
  .yp-live-chat-drawer {
    right: 8px;
    left: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(80dvh, 580px);
    border-radius: 16px;
  }
}

.yp-lc-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #352010 0%, #221309 100%);
  border-bottom: 1px solid rgba(247, 207, 117, 0.24);
}

.yp-lc-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.yp-lc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3bd16f;
  box-shadow: 0 0 8px rgba(59, 209, 111, 0.7);
  flex: 0 0 auto;
}

.yp-lc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #ffe29a;
  overflow-wrap: anywhere;
}

.yp-lc-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(247, 207, 117, 0.36);
  background: rgba(255, 255, 255, 0.05);
  color: #ffe29a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.yp-lc-close:hover {
  background: rgba(247, 207, 117, 0.16);
}

.yp-lc-channels {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 214, 128, 0.06);
  border-bottom: 1px solid rgba(247, 207, 117, 0.16);
}

.yp-lc-channels[hidden] {
  display: none !important;
}

.yp-lc-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(247, 207, 117, 0.34);
  background: rgba(247, 207, 117, 0.12);
  color: #ffe29a;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.yp-lc-channel-pill:hover {
  background: rgba(247, 207, 117, 0.22);
}

.yp-lc-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.yp-live-chat-drawer .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.yp-live-chat-drawer .chat-page,
.yp-live-chat-drawer .chat-box {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.yp-live-chat-drawer .feature-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px 18px;
}

.yp-live-chat-drawer .feature-empty h2 {
  margin: 0;
  font-size: 15px;
  color: #ffe29a;
}

.yp-live-chat-drawer .feature-empty p {
  margin: 0;
  font-size: 13px;
  color: #cbb89d;
}

.yp-live-chat-drawer .chat-guest-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.yp-live-chat-drawer .chat-retention,
.yp-live-chat-drawer .chat-status {
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #d7c3a3;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(247, 207, 117, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.yp-live-chat-drawer .chat-status.is-ai {
  background: rgba(247, 207, 117, 0.09);
  color: #ffe6ad;
}

.yp-live-chat-drawer .chat-status.is-replaced,
.yp-live-chat-drawer .chat-status.is-offline {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.yp-live-chat-drawer .chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.yp-live-chat-drawer .chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yp-live-chat-drawer .chat-older,
.yp-live-chat-drawer .chat-day,
.yp-live-chat-drawer .chat-system,
.yp-live-chat-drawer .chat-empty {
  text-align: center;
  font-size: 12px;
  color: #bfa989;
}

.yp-live-chat-drawer .chat-day span,
.yp-live-chat-drawer .chat-system > span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow-wrap: anywhere;
}

.yp-live-chat-drawer .chat-system.has-handoff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.yp-live-chat-drawer .chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  gap: 3px;
}

.yp-live-chat-drawer .chat-msg.is-theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.yp-live-chat-drawer .chat-msg.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}

.yp-live-chat-drawer .chat-who {
  font-size: 12px;
  font-weight: 700;
  color: #f3c86a;
  padding: 0 2px;
}

.yp-live-chat-drawer .chat-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.yp-live-chat-drawer .chat-msg.is-theirs .chat-bubble {
  background: rgba(255, 248, 232, 0.09);
  border: 1px solid rgba(247, 207, 117, 0.22);
  color: #fff6e5;
  border-top-left-radius: 4px;
}

.yp-live-chat-drawer .chat-msg.is-mine .chat-bubble {
  background: linear-gradient(180deg, #f6cf73 0%, #d89b2b 100%);
  color: #231204;
  font-weight: 600;
  border-top-right-radius: 4px;
}

.yp-live-chat-drawer .chat-time,
.yp-live-chat-drawer .chat-pending {
  font-size: 12px;
  color: #ad9778;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.yp-live-chat-drawer .chat-fail,
.yp-live-chat-drawer .form-error {
  margin: 0;
  font-size: 12px;
  color: #fca5a5;
}

.yp-live-chat-drawer .gold-button {
  padding: 7px 14px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, #f9d982 0%, #d99b29 100%);
  color: #241203;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yp-live-chat-drawer .gold-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.yp-live-chat-drawer .secondary-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(247, 207, 117, 0.42);
  background: rgba(247, 207, 117, 0.1);
  color: #ffe29a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.yp-live-chat-drawer .text-button {
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: #ffd778;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.yp-live-chat-drawer .chat-handoff-inline {
  margin-top: 4px;
}

.yp-live-chat-drawer .chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}

.yp-live-chat-drawer .chat-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f6cf73;
  opacity: 0.4;
  animation: ypChatDot 1.2s infinite ease-in-out;
}

.yp-live-chat-drawer .chat-typing i:nth-child(2) {
  animation-delay: 0.2s;
}

.yp-live-chat-drawer .chat-typing i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ypChatDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

.yp-live-chat-drawer .chat-selfhelp {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(247, 207, 117, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yp-live-chat-drawer .chat-selfhelp-title,
.yp-live-chat-drawer .chat-selfhelp-foot {
  margin: 0;
  font-size: 12px;
  color: #d7c3a3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.yp-live-chat-drawer .kb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yp-live-chat-drawer .kb-item {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(247, 207, 117, 0.16);
  overflow: hidden;
}

.yp-live-chat-drawer .kb-question {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: #ffe29a;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}

.yp-live-chat-drawer .kb-answer {
  padding: 0 10px 9px;
  font-size: 12.5px;
  color: #efe1c8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.yp-live-chat-drawer .chat-image {
  padding: 0;
  border: 1px solid rgba(247, 207, 117, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  cursor: pointer;
  max-width: 210px;
}

.yp-live-chat-drawer .chat-image img,
.yp-live-chat-drawer .chat-image canvas {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: cover;
}

.yp-live-chat-drawer .chat-form {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 6px;
  border-top: 1px solid rgba(247, 207, 117, 0.2);
  background: rgba(18, 10, 4, 0.96);
}

.yp-live-chat-drawer .chat-attach {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(247, 207, 117, 0.35);
  background: rgba(247, 207, 117, 0.08);
  color: #ffe29a;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
}

.yp-live-chat-drawer .chat-attach:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.yp-live-chat-drawer .chat-attach span {
  width: 16px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  position: relative;
  display: block;
}

.yp-live-chat-drawer .chat-attach span::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: currentColor;
}

.yp-live-chat-drawer .chat-attach span::after {
  content: "";
  position: absolute;
  right: 1.5px;
  bottom: 1px;
  width: 7px;
  height: 5px;
  border-left: 1.6px solid currentColor;
  border-top: 1.6px solid currentColor;
  transform: rotate(45deg);
}

.yp-live-chat-drawer #chat-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  max-height: 96px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid rgba(247, 207, 117, 0.32);
  background: rgba(255, 255, 255, 0.06);
  color: #fff8eb;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
}

.yp-live-chat-drawer #chat-input:focus {
  outline: none;
  border-color: #f7cf75;
}

.yp-live-chat-drawer .chat-send {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
}

.yp-live-chat-drawer .chat-foot {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 12px 8px;
  background: rgba(18, 10, 4, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.yp-live-chat-drawer .chat-count {
  color: #bfa989;
  font-size: 12px;
}

.yp-live-chat-drawer .chat-count.is-over {
  color: #fca5a5;
}

.yp-live-chat-drawer .chat-rate {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(247, 207, 117, 0.08);
  border: 1px solid rgba(247, 207, 117, 0.24);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.yp-live-chat-drawer .chat-rate p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yp-live-chat-drawer .chat-stars {
  display: flex;
  gap: 6px;
}

.yp-live-chat-drawer .chat-star {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.28);
  font-size: 20px;
  padding: 0 2px;
  cursor: pointer;
}

.yp-live-chat-drawer .chat-star.is-on {
  color: #f7cf75;
}

.yp-live-chat-drawer .chat-viewer {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 20px;
}

.yp-live-chat-drawer .chat-viewer img {
  max-width: min(92vw, 960px);
  max-height: 84dvh;
  border-radius: 10px;
  object-fit: contain;
}

.yp-live-chat-drawer .chat-viewer-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(247, 207, 117, 0.5);
  background: rgba(24, 14, 6, 0.9);
  color: #ffe29a;
  font-size: 20px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .yp-live-chat-drawer .chat-typing i {
    animation: none;
    opacity: 0.8;
  }
}
