/* Site-wide announcement ticker. The fixed icon anchors a continuously moving message. */
.site-announcement {
  overflow: hidden;
  background: linear-gradient(90deg, var(--portal-navy) 0%, var(--portal-blue) 100%);
  color: #fff;
  border-bottom: 2px solid var(--portal-gold);
}
.site-announcement .container {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.announcement-icon {
  position: relative;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 14px;
}
.announcement-viewport {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.announcement-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: announcement-marquee 28s linear infinite;
}
.announcement-group {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
}
.announcement-copy {
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .015em;
  white-space: nowrap;
}
.announcement-link { color: inherit; text-decoration: none; }
.announcement-link:hover,
.announcement-link:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.announcement-divider { color: var(--portal-gold); font-size: 8px; }
.site-announcement:hover .announcement-track,
.announcement-viewport:focus .announcement-track { animation-play-state: paused; }
.announcement-viewport:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .65);
}
@keyframes announcement-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 720px) {
  .site-announcement .container { min-height: 38px; gap: 9px; padding: 0 10px; }
  .announcement-icon { width: 25px; height: 25px; font-size: 13px; }
  .announcement-copy { font-size: 12px; }
  .announcement-track { animation-duration: 23s; }
}
@media (prefers-reduced-motion: reduce) {
  .announcement-track { animation: none; }
  .announcement-group[aria-hidden="true"] { display: none; }
  .announcement-viewport { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
}

/* Site-wide contact rail: compact, official, and deliberately more tactile than the page chrome. */
.floating-contact {
  position: fixed;
  z-index: 90;
  top: 50%;
  right: 18px;
  color: var(--site-ink, #0d2b55);
  transform: translateY(-50%);
}
.floating-contact-actions {
  display: grid;
  width: 82px;
  overflow: visible;
  border: 1px solid #d7e1ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(8, 63, 145, .18);
}
.floating-contact-action {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 9px 5px;
  border: 0;
  border-bottom: 1px solid #e5ebf2;
  border-radius: 0;
  background: transparent;
  color: #174478;
  font: 700 12px/1.25 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  text-align: center;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
.floating-contact-actions > :first-child,
.floating-contact-actions > :first-child > .floating-contact-action { border-radius: 13px 13px 0 0; }
.floating-contact-actions > :last-child { border-bottom: 0; border-radius: 0 0 13px 13px; }
.floating-contact-action svg,
.floating-contact-toggle svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}
.facebook-official-logo {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.floating-contact-action:hover,
.floating-contact-action:focus-visible {
  z-index: 2;
  background: #eef6ff;
  color: var(--site-blue, #0f63c7);
  transform: scale(1.08);
}
.floating-contact-facebook { color: #1877f2; }
.floating-contact-top { color: #5d6f84; }
.floating-contact-phone { position: relative; }
.floating-contact-phone::before {
  position: absolute;
  top: 0;
  right: 100%;
  width: 6px;
  height: 100%;
  content: "";
}
.floating-contact-phone > .floating-contact-action { width: 100%; }
.floating-phone-popover {
  position: absolute;
  top: 50%;
  right: calc(100% + 5px);
  display: grid;
  width: min(390px, calc(100vw - 130px));
  min-width: 310px;
  gap: 10px;
  padding: 15px 18px;
  border: 1px solid #cfdeee;
  border-left: 4px solid var(--site-red, #f1272f);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(8, 63, 145, .2);
  color: var(--site-ink, #0d2b55);
  opacity: 0;
  pointer-events: none;
  transform: translate(10px, -50%) scale(.96);
  transform-origin: right center;
  transition: opacity .17s ease, transform .17s ease;
}
.floating-phone-popover::after {
  position: absolute;
  top: calc(50% - 7px);
  right: -8px;
  width: 14px;
  height: 14px;
  border-top: 1px solid #cfdeee;
  border-right: 1px solid #cfdeee;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}
.floating-phone-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.floating-phone-head b { color: #102f4d; font-size: 15px; }
.floating-phone-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf3f9;
  color: #536b84;
  font: 500 20px/1 sans-serif;
  cursor: pointer;
}
.floating-phone-list { display: grid; gap: 10px; max-height: min(58vh, 460px); overflow: auto; }
.floating-phone-entry { display: grid; gap: 3px; padding: 12px; border: 1px solid #dde6f0; border-radius: 7px; background: #f8fbff; }
.floating-phone-popover small { color: #66758a; font-size: 12px; }
.floating-phone-popover strong { color: #083f91; font-size: 21px; letter-spacing: .03em; white-space: nowrap; }
.floating-phone-entry p { margin: 1px 0 0; color: #66758a; font-size: 11px; }
.floating-phone-actions { display: flex; gap: 7px; margin-top: 7px; }
.floating-phone-app-link,
.floating-phone-copy {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #b9cbe0;
  border-radius: 6px;
  background: #fff;
  color: #174478;
  font: 700 11px/1.3 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.floating-phone-app-link { border-color: #0f63c7; background: #0f63c7; color: #fff; }
.floating-phone-app-link:hover,
.floating-phone-app-link:focus-visible { background: #083f91; color: #fff; }
.floating-phone-copy:hover,
.floating-phone-copy:focus-visible { border-color: #0f63c7; background: #eef6ff; color: #083f91; }
.floating-contact-phone:hover .floating-phone-popover,
.floating-contact-phone.is-open .floating-phone-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}
.floating-contact-toggle { display: none; }
.floating-contact-notice {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #102f4d;
  box-shadow: 0 10px 26px rgba(8, 43, 84, .25);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.floating-contact-notice.is-visible { opacity: 1; transform: none; }
.floating-contact.is-emphasized .floating-contact-actions { animation: contact-rail-attention .48s ease; }
@keyframes contact-rail-attention {
  0%, 100% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.075) rotate(-1.2deg); }
  58% { transform: scale(.985) rotate(1deg); }
  78% { transform: scale(1.025) rotate(-.35deg); }
}

@media (max-width: 720px) {
  /* Collapsed-by-default rail on small screens: only the toggle bubble shows,
     the action stack expands upward when tapped so it never sits off-viewport. */
  .floating-contact {
    top: auto;
    right: 14px;
    bottom: 18px;
    transform: none;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
  }
  .floating-contact-toggle {
    display: flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    margin-left: auto;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--site-navy, #083f91);
    box-shadow: 0 10px 28px rgba(8, 63, 145, .34), 0 0 0 4px rgba(241, 39, 47, .18);
    color: #fff;
    font: 750 10px/1 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  }
  .floating-contact-toggle > span { max-width: 50px; line-height: 1.1; }
  .floating-contact-toggle svg { width: 23px; height: 23px; flex: 0 0 auto; }
  .floating-contact-toggle .floating-contact-toggle-icon--close { display: none; }
  .floating-contact.is-open .floating-contact-toggle > span { display: none; }
  .floating-contact.is-open .floating-contact-toggle .floating-contact-toggle-icon--open { display: none; }
  .floating-contact.is-open .floating-contact-toggle .floating-contact-toggle-icon--close { display: block; }
  .floating-contact-actions {
    display: none;
    position: static;
    width: 76px;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }
  .floating-contact.is-open .floating-contact-actions {
    display: grid;
    animation: contact-rail-attention .3s ease;
  }
  .floating-contact.is-open { gap: 10px; }
  .floating-contact-action { min-height: 67px; font-size: 11px; }
  .floating-contact-phone::before { display: none; }
  .floating-phone-popover {
    position: fixed;
    inset: auto 88px 16px 12px;
    display: grid;
    width: auto;
    min-width: 0;
    max-height: 60vh;
    gap: 7px;
    padding: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(.98);
    transform-origin: bottom center;
  }
  .floating-phone-popover::after { display: none; }
  .floating-contact-phone:hover .floating-phone-popover { opacity: 0; pointer-events: none; transform: translateY(14px) scale(.98); }
  .floating-contact-phone.is-open .floating-phone-popover { opacity: 1; pointer-events: auto; transform: none; }
  .floating-phone-head b { font-size: 14px; }
  .floating-phone-close { width: 25px; height: 25px; font-size: 18px; }
  .floating-phone-list { max-height: calc(60vh - 46px); gap: 7px; }
  .floating-phone-entry { gap: 2px; padding: 9px; }
  .floating-phone-popover strong { font-size: 18px; }
  .floating-phone-entry p { font-size: 10px; }
  .floating-phone-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .floating-phone-app-link, .floating-phone-copy { min-height: 28px; padding: 5px 7px; }
  .floating-contact.is-emphasized .floating-contact-actions { animation: none; }
  .floating-contact-notice { position: fixed; top: 16px; right: 14px; width: calc(100vw - 28px); }
}

/* 体检咨询：与「就医咨询」是两种不同业务，用一点底色区分，避免用户以为点错了。 */
.floating-contact-checkup { background: #f2f7ff; }
.floating-contact-checkup:hover { background: #e6f0ff; color: var(--site-navy, #083f91); }

@media (prefers-reduced-motion: reduce) {
  .floating-contact *, .floating-contact *::before, .floating-contact *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
