/* 东至门户 · 右侧浮动快捷联系框
   配色沿用门户体系：深绿 --g900/#14532D · 主绿 --g700/#15803D · 金 --gold2/#C9A227
   层级：header 20 < floating 40 < skip-link 50 */
.floating-contact {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink, #1c2b24);
}

/* 主卡片 */
.fc-card {
  position: relative;
  width: 80px;
  background: var(--surface, #fdfefd);
  border: 1px solid var(--line, #d6e0d7);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(20, 83, 45, 0.13);
  animation: fc-in 0.28s ease-out;
}

@keyframes fc-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fc-minimize {
  position: absolute;
  top: -10px;
  right: -6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line, #d6e0d7);
  border-radius: 50%;
  background: var(--surface, #fdfefd);
  color: var(--muted, #526258);
  box-shadow: 0 3px 8px rgba(20, 83, 45, 0.12);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.fc-minimize:hover {
  background: var(--soft, #edf3ed);
  color: var(--primary, #166534);
}
.fc-minimize:focus-visible {
  outline: 2px solid var(--gold2, #c9a227);
  outline-offset: 2px;
}

/* 功能项 */
.fc-body {
  padding: 6px 4px;
  overflow: hidden;
  border-radius: inherit;
}
.fc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 4px 1px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink, #1c2b24);
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.fc-item + .fc-item {
  border-top: 1px solid var(--line, #d6e0d7);
  border-radius: 0;
  margin-top: 0;
}
.fc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--soft, #edf3ed);
  color: var(--primary, #166534);
  transition:
    background 0.15s,
    color 0.15s;
}
.fc-icon svg {
  width: 18px;
  height: 18px;
}
.fc-item b {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-wrap: balance;
}
.fc-item small {
  display: none;
}
.fc-item:hover {
  background: var(--soft, #edf3ed);
}
.fc-item:hover .fc-icon {
  background: var(--primary, #166534);
  color: #fff;
}
.fc-item:hover b {
  color: var(--primary, #166534);
}
.fc-item:focus-visible {
  outline: 2px solid var(--gold2, #c9a227);
  outline-offset: -2px;
}

/* 收起后的小圆钮 */
.fc-mini {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--g900, #14532d),
    var(--g700, #15803d)
  );
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 83, 45, 0.3);
  cursor: pointer;
  line-height: 1;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.fc-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(20, 83, 45, 0.36);
}
.fc-mini:focus-visible {
  outline: 2px solid var(--gold2, #c9a227);
  outline-offset: 3px;
}
.fc-mini-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.fc-mini .fc-mini-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}
.floating-contact.is-minimized .fc-card {
  display: none;
}
.floating-contact.is-minimized .fc-mini {
  display: inline-flex;
  animation: fc-in 0.25s ease-out;
}

/* 热线与企业微信共用左侧弹层 */
.fc-popup {
  position: absolute;
  right: calc(100% + 14px);
  top: 12px;
  width: 212px;
  padding: 16px 16px 14px;
  background: var(--surface, #fdfefd);
  border: 1px solid var(--line, #d6e0d7);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(20, 83, 45, 0.18);
  text-align: center;
  animation: fc-pop-in 0.22s ease-out;
}
.fc-popup::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 100%;
  border: 8px solid transparent;
  border-left-color: var(--surface, #fdfefd);
}
@keyframes fc-pop-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.fc-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--soft, #edf3ed);
  color: var(--muted, #526258);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.fc-popup-close:hover {
  background: var(--line, #d6e0d7);
  color: var(--ink, #1c2b24);
}
.fc-popup-close:focus-visible {
  outline: 2px solid var(--gold2, #c9a227);
  outline-offset: 2px;
}
.fc-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--g900, #14532d);
  margin: 0 0 10px;
  line-height: 1.5;
}
.fc-popup-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 168px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--line, #d6e0d7);
  border-radius: 10px;
  background: #fff;
}
.fc-popup-qr img {
  width: 160px;
  height: 160px;
  border-radius: 6px;
}
.fc-popup-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted, #526258);
  font-size: 13px;
}
.fc-popup-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--primary, #166534);
}
.fc-popup-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted, #526258);
}

.fc-phone-number {
  display: block;
  color: var(--primary, #166534);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fc-phone-number:focus-visible {
  outline: 2px solid var(--gold2, #c9a227);
  outline-offset: 3px;
}
.fc-phone-hours {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted, #526258);
}

/* 移动端：置于底部操作栏上方（先给固定值兜底，再叠加安全区） */
@media (max-width: 767px) {
  .floating-contact {
    right: 8px;
    top: auto;
    bottom: 92px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    transform: none;
  }
  .fc-card {
    width: 68px;
    max-height: calc(100vh - 112px);
    border-radius: 10px;
  }
  .fc-minimize {
    top: -10px;
    right: -2px;
    width: 24px;
    height: 24px;
  }
  .fc-body {
    padding: 5px 4px;
  }
  .fc-item {
    gap: 2px;
    box-sizing: border-box;
    height: 47px;
    min-height: 47px;
    padding: 3px 1px;
  }
  .fc-item + .fc-item {
    margin-top: 0;
    padding-top: 3px;
  }
  .fc-icon {
    width: 23px;
    height: 23px;
  }
  .fc-icon svg {
    width: 16px;
    height: 16px;
  }
  .fc-item b {
    font-size: 11px;
    line-height: 1.2;
  }
  .fc-mini {
    width: 44px;
    height: 44px;
  }
  .fc-popup {
    top: auto;
    bottom: 0;
    right: calc(100% + 10px);
    width: min(212px, calc(100vw - 100px));
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
  }
  .fc-popup::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-card,
  .fc-mini,
  .fc-popup {
    animation: none !important;
    transition: none !important;
  }
}
