html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.support-viewer {
  width: min(980px, calc(100vw - 20px));
  background: rgba(18, 18, 20, .97);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.support-viewer::backdrop {
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(4px);
}

.support-viewer .detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.support-viewer .detail-head h3 {
  margin: 0;
  font-size: 20px;
}

.support-viewer .button {
  border: 0;
  border-radius: 999px;
  background: #d94a6f;
  color: #fff;
  padding: 9px 15px;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.support-viewer .button.muted {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .20);
  color: #f1f5ff;
}

.support-viewer-body {
  min-height: min(72vh, 760px);
  padding: 14px;
  display: grid;
  place-items: center;
}

.support-viewer-body img {
  max-width: 100%;
  max-height: calc(100vh - 132px);
  object-fit: contain;
}

.support {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  justify-items: end;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.support *,
.support *::before,
.support *::after {
  box-sizing: border-box;
}

.support button,
.support input,
.support label {
  -webkit-appearance: none;
  appearance: none;
}

.support-toggle,
.backtop-toggle {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(217, 74, 111, .28);
  font-weight: 700;
  cursor: pointer;
}

.backtop-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(15, 23, 42, .72);
  color: #eaf2ff;
  backdrop-filter: blur(14px);
  font-size: 22px;
  padding: 0;
}

.support-toggle {
  grid-row: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 74, 111, .24);
  background: linear-gradient(135deg, #d94a6f, #b03a5b);
  color: #fff;
  font: inherit;
  line-height: 1;
  padding: 0;
  white-space: nowrap;
}

.support-panel {
  position: absolute;
  right: 0;
  bottom: 142px;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(217, 74, 111, .28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 14, 29, .94), rgba(9, 11, 22, .92));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .04) inset;
  backdrop-filter: blur(24px) saturate(145%);
  transform: none;
  opacity: 1;
  display: none;
}

.support.open .support-panel {
  display: block;
  transform: none;
  opacity: 1;
}

.support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(217, 74, 111, .18);
  background: rgba(12, 16, 28, .94);
  color: #f8fafc;
}

.support-name {
  display: grid;
  gap: 2px;
}

.support-name strong {
  font-size: 16px;
}

.support-name span {
  color: #14a44d;
  font-size: 12px;
}

.support-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(217, 74, 111, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  color: #d94a6f;
  font: inherit;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.support-log {
  min-height: 170px;
  max-height: 280px;
  overflow: auto;
  padding: 14px;
  background: rgba(8, 12, 22, .82);
}

.support-bubble {
  width: max-content;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(28, 32, 48, .90);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #f8fafc;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-bubble.user {
  margin: 10px 0 0 auto;
  background: rgba(217, 74, 111, .18);
  color: #fff;
  border-color: rgba(217, 74, 111, .24);
}

.support-bubble a {
  display: block;
  color: inherit;
}

.support-bubble img,
.support-bubble video {
  max-width: 220px;
  max-height: 260px;
  object-fit: cover;
}

.support-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(217, 74, 111, .18);
  background: rgba(12, 16, 28, .94);
}

.support-form input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #f8fafc;
  padding: 0 13px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.support-form input[type="text"]:focus {
  border-color: rgba(217, 74, 111, .55);
  box-shadow: 0 0 0 3px rgba(217, 74, 111, .16);
}

.support-form input[type="text"]::placeholder {
  color: #8f9aad;
  font-size: 16px;
}

.support-form input[type="file"],
.support-upload [data-support-image] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.support-form button[type="submit"] {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d94a6f, #b03a5b);
  box-shadow: 0 14px 34px rgba(217, 74, 111, .28);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0 15px;
  cursor: pointer;
}

.support-form button[type="submit"]:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(217, 74, 111, .24);
}

.support-form button[type="submit"]:disabled {
  opacity: .64;
  cursor: wait;
}

.support-upload {
  position: relative;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(217, 74, 111, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  color: #d94a6f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  padding: 0 0 2px;
  cursor: pointer;
}

.support-note {
  grid-column: 1 / -1;
  color: #aeb8c7;
  font-size: 12px;
  min-height: 16px;
}

.support-note.error {
  color: #b42318;
}

.support-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 2147483647;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .92);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  transition: opacity .18s ease, transform .18s ease;
}

.support-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.support-toast.error {
  background: rgba(127, 29, 29, .94);
}

@media (max-width: 760px) {
  .support {
    right: 12px;
    bottom: 12px;
  }

  .support-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 150px;
    width: auto;
    max-width: calc(100vw - 20px);
  }

  .support-toggle,
  .backtop-toggle {
    width: 54px;
    height: 54px;
  }
}
