/* 扫码联系悬浮弹窗 —— 自包含组件（主站 + CDN 页共用同款设计） */
/* 组件内部所用的 CSS 变量在此就近定义，脱离原站 :root 也能独立工作 */
.float-contact, .toast {
  --ink: #101828;
  --line: #e4eaf2;
  --white: #ffffff;
  --blue: #2273e6;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.09);
}

.float-contact {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.float-contact-panel {
  width: 378px;
  overflow: hidden;
  border: 1px solid rgba(30, 112, 233, 0.16);
  border-radius: 8px;
  padding: 0;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(7, 21, 37, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transform-origin: right bottom;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.float-contact:not(.is-open) .float-contact-panel {
  display: none;
}

.float-contact.is-open .float-contact-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.float-contact-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #071525 0%, #145bd7 58%, #35b8ff 100%);
  color: var(--white);
}

.float-contact-logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 1px 3px rgba(7, 21, 37, 0.18);
}

/* Telegram 联系列表（取代原二维码/邮箱地址） */
.float-tg-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #f4f9ff, #ffffff);
}

.float-tg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(30, 112, 233, 0.13);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--white);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.07);
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.float-tg-item:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 158, 217, 0.5);
  box-shadow: 0 16px 32px rgba(34, 158, 217, 0.18);
}

.float-tg-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.float-tg-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.float-tg-text strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.float-tg-text span {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.float-tg-go {
  flex: 0 0 auto;
  color: #229ed9;
  font-size: 13px;
  font-weight: 750;
}

.float-contact-head > div {
  flex: 1;
  min-width: 0;
}

.float-contact-head strong {
  display: block;
  color: var(--white);
  font-size: 17px;
  line-height: 1.3;
}

.float-contact-head div > span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.float-contact-close {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 160ms ease, transform 160ms ease;
}

.float-contact-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.float-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #f4f9ff, #ffffff);
}

.float-qr-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(30, 112, 233, 0.13);
  border-radius: 8px;
  padding: 12px 10px 11px;
  background: var(--white);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.07);
}

.float-qr-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--blue);
}

.float-qr-card.is-qq::before {
  background: linear-gradient(90deg, #b987ff, #35c7ff);
}

.float-qr-card.is-wechat::before {
  background: linear-gradient(90deg, #1fc86a, #63d98e);
}

.float-qr-card .qr-code-image {
  width: 100%;
  height: 178px;
  object-fit: contain;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.float-qr-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.float-qr-card .qr-service-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.float-qr-card span {
  color: #46566c;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.15;
}

.float-qr-card .qr-service-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.float-contact-lines {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  background: var(--white);
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}

.float-contact-lines div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.float-contact-lines b {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 12px;
}

.float-contact-lines span {
  word-break: break-all;
}

.float-contact-toggle {
  min-width: 148px;
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #2f86ff, #0d62df);
  color: var(--white);
  box-shadow: 0 18px 42px rgba(30, 112, 233, 0.36);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.float-contact-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(30, 112, 233, 0.42);
}

.float-contact-toggle span,
.float-contact-toggle strong {
  display: block;
}

.float-contact-toggle span {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.float-contact-toggle strong {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 750;
  opacity: 0.86;
}

.float-contact-toggle:focus-visible {
  outline: 3px solid rgba(30, 112, 233, 0.28);
  outline-offset: 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  min-width: 280px;
  border-radius: 8px;
  padding: 13px 18px;
  background: #071525;
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 窄屏适配（主站无 desktop-fit-mobile 缩放，需自行收窄） */
@media (max-width: 480px) {
  .float-contact { left: 12px; right: 12px; }
  .float-contact-panel { width: auto; }
  .float-qr-card .qr-code-image { height: 150px; }
}

