/* 右侧浮动联系栏 + 留言反馈弹窗 */

body.has-floating-contact .back-top-floating {
  display: none !important;
}

.floating-contact {
  position: fixed;
  right: 20px;
  top: 60%;
  /* transform: translateY(-50%); */
  z-index: 320;
  pointer-events: none;
}

.floating-contact__stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.floating-contact__item {
  position: relative;
}

.floating-contact__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 72px;
  min-height: 72px;
  padding: 10px 8px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 20px rgba(21, 93, 209, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-contact__btn:hover,
.floating-contact__btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(21, 93, 209, 0.28);
}

.floating-contact__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #2b6eff 0%, #6e3fff 100%);
}

.floating-contact__btn--light {
  color: #1d2129;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.floating-contact__btn--light:hover,
.floating-contact__btn--light:focus-visible {
  color: var(--color-primary);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.floating-contact__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floating-contact__label {
  font-weight: 500;
  white-space: nowrap;
}

.floating-contact__popover {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.floating-contact__popover::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #fff;
  filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.06));
}

.floating-contact__popover.is-open,
.floating-contact__item:hover .floating-contact__popover,
.floating-contact__item:focus-within .floating-contact__popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.floating-contact__popover-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 14px;
}

.floating-contact__popover-inner--qr {
  display: flex;
  gap: 12px;
}

.floating-contact__popover-inner--qr img {
  display: block;
  width: 108px;
  height: 108px;
  max-width: none;
  border-radius: 6px;
  object-fit: cover;
}

.floating-contact__popover-inner--phone {
  min-width: 200px;
  padding: 16px 18px;
}

.floating-contact__popover-inner--phone p {
  margin: 0;
}

.floating-contact__popover-inner--phone p + p {
  margin-top: 10px;
}

.floating-contact__popover-inner--phone a {
  color: var(--color-primary);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  font-family: "Microsoft YaHei", sans-serif;
}

.floating-contact__popover-inner--phone a:hover {
  text-decoration: underline;
}

.floating-contact__popover-inner--phone span {
  font-variant-numeric: tabular-nums;
}

/* 留言反馈弹窗 */
.floating-feedback-root {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.floating-feedback-root[hidden] {
  display: none !important;
}

.floating-feedback-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.floating-feedback-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: calc(100vh - 48px);
  margin: 16px;
}

.floating-feedback-dialog {
  width: 100%;
  max-height: calc(100vh - 62px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.floating-feedback-form {
  display: block;
}

.floating-feedback-form[hidden],
.floating-feedback-title[hidden],
.floating-feedback-success[hidden] {
  display: none !important;
}

.floating-feedback-success {
  padding: 28px 8px 8px;
  text-align: center;
}

.floating-feedback-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f6ee;
  color: #1a7f4b;
  font-size: 28px;
  font-weight: 700;
  animation: floating-feedback-success-pop 0.35s ease;
}

@keyframes floating-feedback-success-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.floating-feedback-success h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: #1d2129;
}

.floating-feedback-success p {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: #4e5969;
}

.floating-feedback-success-btn {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: none;
  border-radius: 8px;
  background: #005ae0;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.floating-feedback-success-btn:hover,
.floating-feedback-success-btn:focus-visible {
  background: #0049b8;
}

.floating-feedback-field,
.floating-feedback-field--type,
.floating-feedback-field--content {
  display: block;
  visibility: visible;
  opacity: 1;
}

.floating-feedback-close {
  position: absolute;
  top: 0px;
  right: -44px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #1d2129;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.floating-feedback-close:hover,
.floating-feedback-close:focus-visible {
  background: #4e5969;
}

.floating-feedback-title {
  margin: 0 0 22px;
  font-size: 20px;
  font-weight: 600;
  color: #1d2129;
  text-align: center;
  line-height: 1.4;
}

.floating-feedback-field {
  margin-bottom: 18px;
}

.floating-feedback-field > label,
.floating-feedback-type-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1d2129;
}

.floating-feedback-required {
  color: #f53f3f;
  margin-left: 2px;
}

.floating-feedback-field input:not([type="radio"]),
.floating-feedback-field textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #1d2129;
  background: #f5f5f5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-feedback-field textarea {
  display: block;
  resize: vertical;
  min-height: 120px;
  -webkit-appearance: none;
  appearance: none;
}

.floating-feedback-field input::placeholder,
.floating-feedback-field textarea::placeholder {
  color: #c9cdd4;
}

.floating-feedback-field input:not([type="radio"]):focus,
.floating-feedback-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: #005ae0;
  box-shadow: 0 0 0 2px rgba(0, 90, 224, 0.15);
}

.floating-feedback-field input.is-invalid,
.floating-feedback-field textarea.is-invalid,
.floating-feedback-chips.is-invalid {
  border-color: #f53f3f;
}

.floating-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 2px;
}

.floating-feedback-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dce3ee;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #4e5969;
  cursor: pointer;
}

.floating-feedback-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.floating-feedback-chip:has(input:checked),
.floating-feedback-chip.is-checked {
  border-color: #155dd1;
  background: #eef4ff;
  color: #155dd1;
  font-weight: 600;
}

.floating-feedback-chip:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(21, 93, 209, 0.16);
}

.floating-feedback-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: #f53f3f;
}

.floating-feedback-error[hidden] {
  display: none !important;
}

.floating-feedback-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: none;
  border-radius: 8px;
  background: #005ae0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.floating-feedback-submit:hover:not(:disabled) {
  background: #0049b8;
}

.floating-feedback-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.floating-feedback-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #c9cdd4;
  text-align: center;
  line-height: 1.6;
}

body.floating-feedback-open {
  overflow: hidden;
}

.floating-contact-message {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 450;
  min-width: 200px;
  max-width: min(90vw, 420px);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.floating-contact-message[hidden] {
  display: none !important;
}

.floating-contact-message.is-success {
  background: #00b42a;
}

.floating-contact-message.is-error {
  background: #f53f3f;
}

.floating-contact-message.is-warning {
  background: #ff7d00;
}

@media (max-width: 1024px) {
  .floating-contact {
    right: 12px;
  }

  .floating-contact__btn {
    width: 64px;
    min-height: 64px;
    font-size: 11px;
  }

  .floating-contact__popover-inner--qr img {
    width: 92px;
    height: 92px;
  }
}

@media (max-width: 768px) {
  .floating-contact {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }

  .floating-contact__stack {
    gap: 8px;
  }

  .floating-contact__btn {
    width: 56px;
    min-height: 56px;
    padding: 8px 6px;
    border-radius: 12px;
  }

  .floating-contact__icon svg {
    width: 20px;
    height: 20px;
  }

  .floating-contact__popover {
    right: calc(100% + 10px);
  }

  .floating-contact__popover-inner--qr {
    flex-direction: column;
    gap: 8px;
  }

  .floating-contact__popover-inner--qr img {
    width: 84px;
    height: 84px;
  }

  .floating-contact__popover-inner--phone {
    min-width: 168px;
    padding: 12px 14px;
  }

  .floating-contact__popover-inner--phone a {
    font-size: 13px;
    white-space: normal;
  }

  .floating-feedback-panel {
    margin: 12px;
  }

  .floating-feedback-dialog {
    padding: 24px 18px 20px;
    border-radius: 12px;
  }

  .floating-feedback-close {
    width: 28px;
    height: 28px;
    top: -10px;
    right: -10px;
  }

  .floating-feedback-title {
    font-size: 18px;
    margin-bottom: 18px;
  }

  .floating-feedback-chip {
    min-height: 40px;
    padding: 0 12px;
  }

  .floating-feedback-success {
    padding: 12px 0 4px;
  }

  .floating-feedback-success h3 {
    font-size: 20px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .floating-contact__item:hover .floating-contact__popover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .floating-contact__popover.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
