/* ========== Right floating contact bar — premium gold ========== */
.fs-floatbar {
  --fs-fb-size: 72px;
  --fs-fb-gap: 18px;
  position: fixed;
  right: 22px;
  z-index: 1100;
  width: var(--fs-fb-size);
  pointer-events: none;
}

.fs-floatbar--rb {
  bottom: max(148px, calc(env(safe-area-inset-bottom, 0px) + 140px));
}

.fs-floatbar--rm {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.fs-floatbar__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--fs-fb-gap);
  pointer-events: auto;
}

.fs-floatbar__item {
  position: relative;
  margin: 0;
}

.fs-floatbar__item.is-hidden {
  display: none;
}

.fs-floatbar__btn {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: var(--fs-fb-size);
  height: var(--fs-fb-size);
  padding: 8px 6px 10px;
  box-sizing: border-box;
  border-radius: 14px;
  color: var(--fs-accent, #e8c96a) !important;
  background:
    linear-gradient(165deg, rgba(40, 36, 28, 0.92) 0%, rgba(18, 20, 26, 0.94) 100%);
  border: 1px solid rgba(232, 201, 106, 0.42);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(247, 229, 163, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none !important;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    background 0.22s ease;
  overflow: hidden;
}

.fs-floatbar__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 50% 0%, rgba(247, 229, 163, 0.16), transparent 55%);
  pointer-events: none;
  opacity: 0.85;
}

.fs-floatbar__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  line-height: 0;
  margin: 0 auto 2px;
}

.fs-floatbar__icon svg {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0;
}

.fs-floatbar__item--wechat .fs-floatbar__icon svg {
  width: 26px;
  height: 26px;
}

.fs-floatbar__item--app .fs-floatbar__label {
  font-size: 11px;
  letter-spacing: 0;
}

.fs-floatbar__item--find .fs-floatbar__label {
  font-size: 11px;
  letter-spacing: 0;
}

/* 资源帮找：整钮上下跳 + 图标弹跳 + 外侧双脉冲 */
.fs-floatbar__item--find {
  z-index: 3;
}

.fs-floatbar__item--find .fs-floatbar__btn {
  overflow: visible;
  color: #1a1408 !important;
  background: linear-gradient(180deg, #ffe9ad 0%, #e8c96a 45%, #c19549 100%);
  border-color: #f0d78a;
  box-shadow:
    0 10px 26px rgba(193, 149, 73, 0.5),
    0 0 22px rgba(247, 229, 163, 0.45),
    0 0 0 1px rgba(247, 229, 163, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: none;
  animation: fs-find-btn-hop 1.15s ease-in-out infinite !important;
  will-change: transform;
}

.fs-floatbar__item--find .fs-floatbar__btn::before {
  opacity: 0;
}

.fs-floatbar__item--find .fs-floatbar__icon {
  animation: none;
}

.fs-floatbar__item--find .fs-floatbar__icon svg {
  display: block;
  transform-origin: center bottom;
  animation: fs-find-icon-bob 1.15s ease-in-out infinite !important;
  will-change: transform;
}

.fs-floatbar__item--find .fs-floatbar__pulse {
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 2px solid rgba(247, 229, 163, 0.85);
  box-shadow: 0 0 12px rgba(232, 201, 106, 0.45);
  pointer-events: none;
  z-index: 0;
  animation: fs-find-pulse 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.fs-floatbar__item--find .fs-floatbar__pulse--delay {
  animation-delay: 0.9s;
}

.fs-floatbar__item--find .fs-floatbar__btn:hover,
.fs-floatbar__item--find .fs-floatbar__btn:focus-visible {
  filter: brightness(1.08);
  animation: none !important;
  transform: translateY(-4px) scale(1.04);
}

.fs-floatbar__item--find .fs-floatbar__btn:hover .fs-floatbar__icon svg,
.fs-floatbar__item--find .fs-floatbar__btn:focus-visible .fs-floatbar__icon svg {
  animation: none !important;
  transform: none;
}

@keyframes fs-find-pulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  75% {
    opacity: 0;
    transform: scale(1.38);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

@keyframes fs-find-btn-hop {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 10px 26px rgba(193, 149, 73, 0.5),
      0 0 16px rgba(247, 229, 163, 0.35),
      0 0 0 1px rgba(247, 229, 163, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
  40% {
    transform: translateY(-5px);
    box-shadow:
      0 14px 30px rgba(232, 201, 106, 0.62),
      0 0 22px rgba(247, 229, 163, 0.5),
      0 0 0 1px rgba(255, 233, 173, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  55% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(-2px);
  }
}

@keyframes fs-find-icon-bob {
  0%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px) scale(1.04);
  }
  55% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(-1.5px);
  }
}

/* ----- 资源帮找弹窗 ----- */
.fs-find-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.fs-find-modal[hidden] {
  display: none !important;
}

.fs-find-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fs-find-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  animation: fs-find-modal-in 0.28s ease;
}

.fs-find-modal__x {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #f7e5a3;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.fs-find-modal__x:hover {
  background: rgba(232, 201, 106, 0.2);
  color: #fff;
}

.fs-search-help--modal {
  margin: 0 !important;
}

/* 弹窗内二维码改为上下排列，并尽量占满右侧高度 */
.fs-search-help--modal .fs-search-help__right {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.fs-search-help--modal .fs-search-help__qrs {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  grid-template-columns: none;
  min-height: 0;
}

.fs-search-help--modal .fs-search-help__qr {
  flex: 1 1 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px 18px;
  text-align: left;
  min-height: 0;
}

.fs-search-help--modal .fs-search-help__qr-frame {
  width: clamp(148px, 38%, 188px);
  height: auto;
  aspect-ratio: 1;
  flex-shrink: 0;
  margin: 0;
  padding: 6px;
  box-sizing: border-box;
}

.fs-search-help--modal .fs-search-help__qr-frame img {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: 1;
  object-fit: cover;
}

.fs-search-help--modal .fs-search-help__qr figcaption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.fs-search-help--modal .fs-search-help__qr-brand {
  font-size: 15px;
}

.fs-search-help--modal .fs-search-help__qr-id {
  font-size: 13px;
  color: #c5ccd6;
}

html.fs-find-modal-open,
html.fs-find-modal-open body {
  overflow: hidden;
}

@keyframes fs-find-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fs-find-modal__dialog {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  .fs-find-modal {
    padding: 12px 10px;
    align-items: flex-end;
  }

  .fs-find-modal__dialog {
    max-height: 88vh;
    border-radius: 16px 16px 12px 12px;
  }
}


.fs-floatbar__label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-floatbar__item.is-hot .fs-floatbar__btn,
.fs-floatbar__item:hover .fs-floatbar__btn,
.fs-floatbar__btn:hover,
.fs-floatbar__btn:focus-visible {
  color: #1a1408 !important;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  border-color: #e8c96a;
  box-shadow:
    0 12px 28px rgba(193, 149, 73, 0.38),
    0 0 0 1px rgba(247, 229, 163, 0.25);
  transform: translateY(-2px);
  outline: none;
}

.fs-floatbar__item.is-hot .fs-floatbar__btn::before,
.fs-floatbar__item:hover .fs-floatbar__btn::before,
.fs-floatbar__btn:hover::before {
  opacity: 0;
}

.fs-floatbar__item--totop .fs-floatbar__btn {
  color: #1a1408 !important;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  border-color: #c19549;
}

.fs-floatbar__item--totop .fs-floatbar__btn:hover {
  filter: brightness(1.05);
}

/* ----- Hover card ----- */
.fs-floatbar__panel {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: calc(100% + 18px);
  transform: translateY(-50%) translateX(10px);
  padding: 0;
  margin: 0;
  width: 212px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

/* Invisible bridge: gap between button and card */
.fs-floatbar__panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 22px;
}

.fs-floatbar__card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 16px;
  text-align: center;
  color: var(--fs-text, #eef0f4);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(247, 229, 163, 0.14), transparent 55%),
    linear-gradient(165deg, rgba(32, 28, 22, 0.98) 0%, rgba(14, 16, 22, 0.98) 100%);
  border: 1px solid rgba(232, 201, 106, 0.4);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(247, 229, 163, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.fs-floatbar__card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -7px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: linear-gradient(135deg, transparent 50%, rgba(18, 16, 14, 0.98) 50%);
  border-right: 1px solid rgba(232, 201, 106, 0.4);
  border-bottom: 1px solid rgba(232, 201, 106, 0.4);
  transform: rotate(-45deg);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

.fs-floatbar__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 229, 163, 0.72);
}

.fs-floatbar__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 10px;
  width: 168px;
  height: 168px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(232, 201, 106, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.25);
}

.fs-floatbar__qr img {
  display: block;
  width: 148px;
  height: 148px;
  margin: 0;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

/* Art QR (already has dark bg) — flush frame, no white mat */
.fs-floatbar__qr--art {
  padding: 0;
  width: 168px;
  height: 168px;
  background: #1a1d24;
  overflow: hidden;
}

.fs-floatbar__qr--art img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: transparent;
}

.fs-floatbar__id {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f7e5a3;
  word-break: break-all;
}

.fs-floatbar__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  margin: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  color: #1a1408 !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(193, 149, 73, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.fs-floatbar__action:hover,
.fs-floatbar__copy.is-done {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.fs-floatbar__item.is-hot .fs-floatbar__panel,
.fs-floatbar__item:focus-within .fs-floatbar__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* QQ panel uses same QR card as WeChat */
.fs-floatbar__item--qq .fs-floatbar__id {
  font-size: 15px;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .fs-floatbar--desktop-only {
    display: none !important;
  }

  .fs-floatbar {
    --fs-fb-size: 70px;
    --fs-fb-gap: 12px;
    right: 10px;
    bottom: max(110px, calc(env(safe-area-inset-bottom, 0px) + 100px));
  }

  .fs-floatbar--rm {
    top: auto;
    transform: none;
  }

  .fs-floatbar__list {
    position: relative;
    z-index: 1103;
  }

  .fs-floatbar__btn {
    overflow: visible;
    height: auto;
    min-height: 64px;
    padding: 8px 4px 9px;
  }

  .fs-floatbar__icon {
    width: 24px;
    height: 24px;
  }

  .fs-floatbar__icon svg {
    width: 22px;
    height: 22px;
  }

  .fs-floatbar__item--wechat .fs-floatbar__icon svg {
    width: 24px;
    height: 24px;
  }

  .fs-floatbar__label {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }

  .fs-floatbar__panel {
    display: none;
  }

  /* Mobile: only is-open shows panel (ignore hover is-hot) */
  .fs-floatbar__item.is-hot .fs-floatbar__panel {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .fs-floatbar__item--qq.is-open .fs-floatbar__panel,
  .fs-floatbar__item--wechat.is-open .fs-floatbar__panel {
    display: block;
    position: fixed;
    top: auto;
    bottom: max(160px, calc(env(safe-area-inset-bottom, 0px) + 140px));
    left: 16px;
    right: 16px;
    width: auto;
    max-width: 280px;
    margin: 0 auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1102;
  }

  .fs-floatbar__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1101;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  .fs-floatbar.is-panel-open .fs-floatbar__backdrop {
    display: block;
  }

  .fs-floatbar__panel::before,
  .fs-floatbar__card::after {
    display: none;
  }
}
