.contact-widget {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  font-family: inherit;
}

.contact-trigger,
.contact-close,
.contact-copy {
  appearance: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.contact-trigger {
  width: 52px;
  height: 52px;
  padding: 0;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #101114;
  box-shadow: 0 12px 30px rgba(16, 17, 20, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.contact-trigger::before {
  padding: 8px 11px;
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  color: #34373d;
  background: #ffffff;
  box-shadow: 0 9px 24px rgba(16, 17, 20, 0.12);
  content: "联系我们";
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(7px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.contact-trigger:hover,
.contact-trigger:focus-visible,
.contact-widget.is-open .contact-trigger {
  background: #24262b;
  box-shadow: 0 16px 34px rgba(16, 17, 20, 0.25);
  transform: translateY(-2px);
}

.contact-trigger:active {
  transform: translateY(0);
}

.contact-trigger svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .contact-trigger:hover::before,
  .contact-trigger:focus-visible::before {
      opacity: 1;
      transform: translate(0, -50%);
    }

  .contact-trigger:hover svg,
  .contact-trigger:focus-visible svg {
      transform: scale(1.08) translateY(-1px);
    }

  .contact-widget.is-open .contact-trigger::before {
      opacity: 0;
      transform: translate(7px, -50%);
    }
}

.contact-panel {
  width: min(340px, calc(100vw - 36px));
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  overflow: hidden;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(16, 17, 20, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transform-origin: right bottom;
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.contact-widget.is-open .contact-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.contact-panel-header {
  min-height: 78px;
  padding: 18px 18px 17px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #eceef1;
}

.contact-panel-header h2 {
  margin: 0;
  color: #17191d;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.4;
}

.contact-panel-header p {
  margin: 5px 0 0;
  color: #777c85;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.5;
}

.contact-close {
  width: 32px;
  height: 32px;
  padding: 0;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #676c75;
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease;
}

.contact-close:hover,
.contact-close:focus-visible {
  color: #101114;
  background: #f3f4f6;
}

.contact-close svg,
.contact-copy svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.contact-close svg {
  width: 18px;
  height: 18px;
}

.contact-panel-content {
  padding: 18px 20px 20px;
}

.contact-empty {
  min-height: 68px;
  margin: 0;
  display: grid;
  place-items: center;
  color: #8a8f97;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
}

.contact-qr {
  margin: 0 0 18px;
  display: grid;
  justify-items: center;
  gap: 9px;
}

.contact-qr img {
  width: 132px;
  height: 132px;
  display: block;
  border: 1px solid #eceef1;
  border-radius: 6px;
  object-fit: cover;
}

.contact-qr figcaption {
  color: #6d727b;
  font-size: 12px;
  font-weight: 550;
}

.contact-methods {
  border-top: 1px solid #eceef1;
}

.contact-method:first-child {
  border-top: 0;
}

.contact-method {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #eceef1;
}

.contact-method-detail {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.contact-method-label {
  color: #8a8f97;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.3;
}

.contact-method-value {
  overflow: hidden;
  color: #24272c;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.contact-method-value:hover,
a.contact-method-value:focus-visible {
  color: #2167d9;
}

.contact-copy {
  min-width: 66px;
  height: 32px;
  padding: 0 10px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  color: #5f646d;
  background: #f4f5f6;
  font-size: 11px;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease;
}

.contact-copy:hover,
.contact-copy:focus-visible {
  color: #101114;
  background: #e9ebee;
}

.contact-copy.is-copied {
  color: #147a55;
  background: #edf8f3;
}

.contact-copy svg {
  width: 14px;
  height: 14px;
}

.contact-hours {
  margin: 16px 0 0;
  padding-top: 15px;
  border-top: 1px solid #eceef1;
  color: #767b84;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .contact-widget {
      right: 16px;
      bottom: 16px;
    }

  .contact-trigger {
      width: 48px;
      height: 48px;
    }

  .contact-panel {
      width: min(324px, calc(100vw - 32px));
    }
}

@media (prefers-reduced-motion: reduce) {
  .contact-trigger,
  .contact-trigger::before,
  .contact-trigger svg,
  .contact-panel,
  .contact-close,
  .contact-copy {
      transition: none;
    }
}
