/**
 * USA SIM 前台客服悬浮窗口样式。
 *
 * 使用不透明深色面板，不对页面背景做模糊处理；移动端自动铺满安全区域。
 */

.support-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}
.support-launcher {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(111, 247, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(100deg, #6ff7ff, #568cff, #9d71ff);
  color: #061020;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.42);
  transition: width 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.support-launcher-icon {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 22px;
  place-items: center;
}
.support-launcher-icon svg {
  width: 22px;
  height: 22px;
  fill: #061020;
}
.support-launcher-label {
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 180ms ease, margin-left 180ms ease, opacity 120ms ease;
}
/* 仅在支持鼠标悬停的设备上展开，手机端始终保持小圆形按钮。 */
@media (hover: hover) and (pointer: fine) {
  .support-launcher:hover,
  .support-launcher:focus-visible {
    width: 132px;
    box-shadow: 0 18px 50px rgba(46, 132, 255, 0.4);
    transform: translateY(-1px);
  }
  .support-launcher:hover .support-launcher-label,
  .support-launcher:focus-visible .support-launcher-label {
    max-width: 74px;
    margin-left: 8px;
    opacity: 1;
  }
}
.support-launcher:focus-visible {
  outline: 3px solid rgba(111, 247, 255, 0.3);
  outline-offset: 3px;
}
.support-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff5578;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 0 0 3px #071126;
}
.support-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(390px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 110px));
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border: 1px solid rgba(126, 249, 255, 0.2);
  border-radius: 20px;
  background: #0a1329;
  color: #eef7ff;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}
.support-widget.open .support-panel {
  display: grid;
}
.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 18px;
  background: #101d3a;
  border-bottom: 1px solid rgba(126, 249, 255, 0.15);
}
.support-header div {
  display: grid;
  gap: 4px;
}
.support-header strong {
  font-size: 16px;
}
.support-header small {
  color: #8fa4bd;
  font-size: 11px;
}
.support-header button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(126, 249, 255, 0.18);
  border-radius: 10px;
  background: #081127;
  color: #eef7ff;
  font-size: 23px;
  cursor: pointer;
}
.support-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 17px;
  background: #081127;
  border-bottom: 1px solid rgba(126, 249, 255, 0.12);
  font-size: 11px;
  color: #8fa4bd;
}
.support-customer strong {
  max-width: 230px;
  color: #6ff7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.support-messages {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.support-welcome {
  padding: 12px 14px;
  border: 1px solid rgba(126, 249, 255, 0.14);
  border-radius: 13px;
  background: #111d37;
  color: #b9c8db;
  font-size: 13px;
  line-height: 1.55;
}
.support-message {
  max-width: 84%;
  display: grid;
  gap: 5px;
}
.support-message.customer {
  align-self: flex-end;
}
.support-message.admin {
  align-self: flex-start;
}
.support-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: #182642;
  color: #eef7ff;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.support-message.customer .support-bubble {
  background: linear-gradient(135deg, #3e87d7, #6c63d8);
}
.support-message time {
  padding: 0 4px;
  color: #71849e;
  font-size: 10px;
}
.support-message.customer time {
  text-align: right;
}
.support-image-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(126, 249, 255, 0.18);
  background: #061020;
}
.support-image-link img {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: contain;
}
.support-error {
  margin: 0 14px 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 85, 120, 0.12);
  color: #ff7894;
  font-size: 12px;
}
.support-form {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(126, 249, 255, 0.14);
  background: #081127;
}
.support-form textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(126, 249, 255, 0.2);
  border-radius: 12px;
  background: #050c1d;
  color: #eef7ff;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.support-form textarea:focus {
  border-color: #6ff7ff;
}
.support-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}
.support-image-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.support-image-button span,
.support-send {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.support-image-button span {
  border: 1px solid rgba(126, 249, 255, 0.2);
  color: #9db1c9;
}
.support-send {
  border: 0;
  background: linear-gradient(90deg, #6ff7ff, #568cff);
  color: #061020;
}
.support-send:disabled {
  opacity: 0.5;
  cursor: wait;
}
.support-form-note {
  display: block;
  margin-top: 7px;
  color: #647892;
  font-size: 10px;
}
.support-file-preview {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(111, 247, 255, 0.08);
  color: #6ff7ff;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-loading,
.support-empty {
  text-align: center;
  color: #71849e;
  font-size: 12px;
  padding: 24px 8px;
}
@media (max-width: 560px) {
  .support-widget {
    right: 12px;
    bottom: 12px;
  }
  .support-panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    border-radius: 18px;
  }
  .support-widget.open .support-launcher {
    display: none;
  }
  .support-message {
    max-width: 90%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .support-launcher,
  .support-launcher-label {
    transition: none;
  }
}
