/* 顶栏：下滑后黑色背景保留 80% 不透明度，即 20% 透明度。 */
[hidden] {
  display: none !important;
}
body:not(.admin-page) > header {
  position: sticky;
  top: 0;
  z-index: 30;
  transition: background 180ms ease;
}
body:not(.admin-page) > header.scrolled {
  background: rgb(8 8 11 / 80%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
section[id] {
  scroll-margin-top: 120px;
}
.support-launch {
  display: flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  border: 0;
  border-radius: 50px;
  padding: 16px 22px;
  color: white;
  background: var(--purple);
  box-shadow: 0 8px 30px #6642ea50;
  cursor: pointer;
}
.support-launch svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.support-compose-tools {
  padding: 0 20px 8px;
  flex-shrink: 0;
}
.support-compose-tools button {
  font-size: 12px;
  padding: 6px 10px;
  color: #c8b5ff;
  border-color: #6642ea80;
}
.age-pending .support-launch {
  display: none;
}
.support-drawer {
  position: fixed;
  z-index: 60;
  inset: 0 0 0 auto;
  width: min(420px, 100%);
  background: #101016;
  border-left: 1px solid #383044;
  box-shadow: -20px 0 60px #0008;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden;
  transition:
    transform 220ms ease,
    visibility 220ms;
}
.support-drawer.open {
  transform: translateX(0);
  visibility: visible;
}
.support-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.support-head h2 {
  font-size: 18px;
  margin: 0;
}
.support-head p {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.support-head button,
.support-tools button {
  background: transparent;
  color: white;
  border: 1px solid #433651;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
.support-tools {
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.support-status,
.support-notice {
  padding: 0 20px;
  font-size: 12px;
  color: var(--muted);
}
.support-status {
  color: var(--pink);
}
.support-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.support-message {
  background: #211a30;
  border: 1px solid #332747;
  padding: 12px;
  border-radius: 12px;
  max-width: 90%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.support-message.customer {
  align-self: flex-end;
  background: #39266f;
}
.support-message.agent {
  border-color: var(--purple);
}
.support-message small {
  display: block;
  font-size: 10px;
  color: #bdb2d2;
  margin-bottom: 6px;
}
.support-product {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #08080b;
  margin-top: 8px;
  border-radius: 5px;
}
.support-product img {
  width: 42px;
  height: 48px;
  object-fit: cover;
}
.support-product span {
  font-size: 12px;
}
.support-compose {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  display: flex;
  gap: 8px;
}
.support-compose textarea {
  min-width: 0;
  flex: 1;
  resize: none;
  height: 70px;
  background: #08080b;
  border: 1px solid #42374d;
  border-radius: 6px;
  color: white;
  padding: 10px;
  font: inherit;
  font-size: 13px;
}
.support-compose button {
  background: var(--purple);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
}
.support-history {
  max-height: 200px;
  overflow: auto;
  padding: 0 20px;
}
.support-history button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: #191321;
  color: white;
  border: 1px solid #332747;
  border-radius: 5px;
  margin: 6px 0;
  padding: 8px;
  cursor: pointer;
}
.support-history img {
  width: 40px;
  height: 46px;
  object-fit: cover;
}
.support-selected {
  padding: 0 20px;
}
.support-selected button {
  background: none;
  border: 0;
  color: var(--pink);
  cursor: pointer;
}
@media (max-width: 580px) {
  .support-launch {
    right: 16px;
    bottom: 16px;
    padding: 13px 17px;
  }
  section[id] {
    scroll-margin-top: 90px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .support-drawer {
    transition: none;
  }
}
