/* 固定联系方式组件：左下 QQ，右下微信，加载时自动展开 */
.ct-contact {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  max-width: calc(100vw - 2rem);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.ct-contact--left {
  left: 1rem;
  right: auto;
}

.ct-contact--right {
  right: 1rem;
  left: auto;
}

.ct-widget {
  position: relative;
}

.ct-summary {
  display: block;
  list-style: none;
  cursor: pointer;
  border-radius: 999px;
}

.ct-summary::-webkit-details-marker {
  display: none;
}

.ct-trigger {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  background: #ffffff;
  border: 1px solid #dbe7f3;
  border-radius: 999px;
  box-shadow: 0 14px 34px -14px rgba(11, 45, 77, 0.55);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ct-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px -14px rgba(11, 45, 77, 0.6);
}

.ct-summary:focus-visible {
  outline: 2px solid #1a5c9e;
  outline-offset: 3px;
}

.ct-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 1px solid #eaf3fb;
  background: #ffffff;
  flex: none;
}

.ct-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

.ct-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: #0f172a;
}

.ct-sub {
  margin-top: 0.1rem;
  font-size: 0.6875rem;
  color: #64748b;
}

.ct-caret {
  width: 1rem;
  height: 1rem;
  color: #1a5c9e;
  flex: none;
  transition: transform 0.2s ease;
}

.ct-widget[open] .ct-caret {
  transform: rotate(180deg);
}

.ct-panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  width: 18rem;
  max-height: calc(100vh - 7rem);
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2ecf6;
  border-radius: 1.25rem;
  box-shadow: 0 26px 70px -22px rgba(11, 45, 77, 0.55);
  animation: ct-panel-in 0.2s ease-out;
}

.ct-contact--left .ct-panel {
  left: 0;
  right: auto;
}

.ct-contact--right .ct-panel {
  right: 0;
  left: auto;
}

/* 底部 QQ / 微信卡片：与顶部公众号保持一致，缩至原尺寸一半 */
.ct-contact .ct-panel {
  width: 9rem;
  border-radius: 1rem;
}

.ct-contact .ct-panel-head {
  gap: 0.3rem;
  padding: 0.4rem 0.4rem 0.4rem 0.55rem;
}

.ct-contact .ct-panel-head > img,
.ct-contact .ct-head-sub {
  display: none;
}

.ct-contact .ct-head-title {
  font-size: 0.75rem;
}

.ct-contact .ct-close {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.75rem;
}

.ct-contact .ct-panel-body {
  padding: 0.5rem;
}

.ct-contact .ct-qr {
  border-radius: 0.55rem;
}

.ct-contact .ct-name {
  margin-top: 0.4rem;
  font-size: 0.75rem;
}

.ct-contact .ct-name span {
  display: none;
}

.ct-contact .ct-meta {
  margin-top: 0.1rem;
  font-size: 0.625rem;
}

.ct-contact .ct-tip {
  display: none;
}

@keyframes ct-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ct-panel-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  background: linear-gradient(135deg, #124571, #1a5c9e);
  color: #ffffff;
}

.ct-contact--wechat .ct-panel-head {
  background: linear-gradient(135deg, #0b6b43, #12a05a);
}

.ct-panel-head > img {
  width: auto;
  height: 1.25rem;
  flex: none;
}

.ct-head-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ct-head-title {
  font-size: 0.8125rem;
  font-weight: 800;
}

.ct-head-sub {
  margin-top: 0.1rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.78);
}

.ct-close {
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.ct-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ct-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.ct-panel-body {
  padding: 0.9rem 1rem 1rem;
}

.ct-panel picture {
  display: contents;
}

.ct-qr {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border: 1px solid #e2ecf6;
  border-radius: 0.9rem;
}

.ct-name {
  margin: 0.7rem 0 0;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0f172a;
}

.ct-name span {
  margin-left: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
}

.ct-meta {
  margin: 0.2rem 0 0;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.ct-tip {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.65;
  color: #475569;
}

@media (min-width: 640px) {
  .ct-contact {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .ct-contact--left {
    left: 1.5rem;
  }

  .ct-contact--right {
    right: 1.5rem;
  }
}

@media (max-width: 639px) {
  .ct-contact {
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    max-width: calc(50vw - 1.25rem);
  }

  .ct-contact--left {
    left: 0.75rem;
  }

  .ct-contact--right {
    right: 0.75rem;
  }

  .ct-trigger {
    gap: 0.4rem;
    padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  }

  .ct-thumb {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
  }

  .ct-title {
    font-size: 0.8125rem;
  }

  .ct-sub {
    display: none;
  }

  .ct-caret {
    width: 0.875rem;
    height: 0.875rem;
  }

  .ct-panel {
    width: calc(50vw - 1rem);
    border-radius: 1rem;
  }

  .ct-panel-head {
    gap: 0.4rem;
    padding: 0.5rem 0.55rem;
  }

  .ct-panel-head > img,
  .ct-head-sub {
    display: none;
  }

  .ct-head-title {
    font-size: 0.75rem;
  }

  .ct-close {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.875rem;
  }

  .ct-panel-body {
    padding: 0.5rem;
  }

  .ct-qr {
    border-radius: 0.6rem;
  }

  .ct-name {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
  }

  .ct-name span {
    display: none;
  }

  .ct-meta {
    font-size: 0.625rem;
  }

  .ct-tip {
    display: none;
  }
}

/* 顶部右侧公众号组件：刷新展开，10 秒后收缩为图标 */
.ct-account {
  position: fixed;
  top: calc(5.25rem + env(safe-area-inset-top, 0px));
  right: 0.75rem;
  z-index: 44;
  max-width: calc(100vw - 1.5rem);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.ct-account .ct-trigger {
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
}

.ct-account .ct-thumb {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
}

.ct-account .ct-widget:not([open]) .ct-text,
.ct-account .ct-widget:not([open]) .ct-caret {
  display: none;
}

.ct-account .ct-widget:not([open]) .ct-trigger {
  gap: 0;
  padding: 0.28rem;
  border-radius: 0.95rem;
}

.ct-account .ct-panel {
  top: calc(100% + 0.6rem);
  bottom: auto;
  right: 0;
  left: auto;
  width: 8.5rem;
  max-height: none;
  border-radius: 0.95rem;
}

.ct-account .ct-panel-head {
  gap: 0;
  padding: 0.3rem 0.3rem 0.3rem 0.45rem;
  background: linear-gradient(135deg, #0b6b43, #12a05a);
}

.ct-account .ct-panel-head > img,
.ct-account .ct-head-sub {
  display: none;
}

.ct-account .ct-head-title {
  font-size: 0.625rem;
}

.ct-account .ct-close {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.6875rem;
}

.ct-account .ct-panel-body {
  padding: 0.4rem;
}

.ct-account .ct-qr {
  border-radius: 0.45rem;
}

.ct-account .ct-name,
.ct-account .ct-meta,
.ct-account .ct-tip {
  display: none;
}

@media (min-width: 640px) {
  .ct-account {
    top: calc(5.5rem + env(safe-area-inset-top, 0px));
    right: 1.5rem;
  }
}

@media (max-width: 639px) {
  .ct-account {
    top: calc(5.25rem + env(safe-area-inset-top, 0px));
    right: 0.75rem;
  }
}

/* 页脚居中联系方式：固话 + 邮箱 */
.footer-contact {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 2.25rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.35rem 1rem;
  text-align: center;
}

.footer-contact__item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #bfdbfe;
}

.footer-contact__item svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  color: #93c5fd;
}

.footer-contact__label {
  font-weight: 600;
  color: #ffffff;
}

.footer-contact__item a {
  color: #e0f2fe;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-contact__item a:hover,
.footer-contact__item a:focus-visible {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.footer-contact__sep {
  color: rgba(191, 219, 254, 0.55);
}

.footer-contact__tip {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(191, 219, 254, 0.78);
}

.footer-contact__tip::before {
  content: "·";
  margin-right: 0.5rem;
  color: rgba(147, 197, 253, 0.8);
}

.footer-contact__search {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.7;
  color: rgba(191, 219, 254, 0.72);
}

.footer-contact__search strong {
  font-weight: 700;
  color: #e0f2fe;
}

/* 页脚“返回首页”：悬停/聚焦显示提示 */
.footer-nav__home {
  position: relative;
}

.footer-nav__home::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translate(-50%, 0.25rem);
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  background: #0f172a;
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.75);
  color: #e2e8f0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}

.footer-nav__home:hover::after,
.footer-nav__home:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 639px) {
  .footer-contact__inner {
    gap: 0.35rem 1rem;
    padding: 1.1rem 1rem;
  }

  .footer-contact__item {
    font-size: 0.8125rem;
  }

  .footer-contact__item svg {
    width: 0.875rem;
    height: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-panel {
    animation: none;
  }

  .ct-trigger,
  .ct-caret {
    transition: none;
  }
}

@media print {
  .ct-contact,
  .ct-account {
    display: none;
  }
}
