/* MedInnovateHub — global header & footer */

:root {
  --red: #c8102e;
  --text-on-red: #fff;
  --footer-bg: #222;
  --subfooter-bg: #1a1a1a;
  --muted: #b0b0b0;
  --container: min(1200px, 92vw);
  --header-z: 5000;
  --transition: 0.25s ease;
  /* utility ~36px + main bar ~64px */
  --header-stack-h: 101px;
  /* Unified placeholder artwork (path relative to this file in assets/css/) */
  --site-placeholder-img: url("../images/占位.jpg");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #fff;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--header-z);
  transition: background var(--transition), box-shadow var(--transition);
}

/* Over hero: header transparent by default; solid red bar + white nav on hover/focus */
.site-header--hero {
  background: transparent;
  box-shadow: none;
}

.site-header--hero .utility-bar,
.site-header--hero .main-bar {
  transition: background-color var(--transition), box-shadow var(--transition);
}

.site-header--hero .utility-bar {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.site-header--hero .main-bar {
  background: transparent;
  box-shadow: none;
}

.site-header--hero .logo,
.site-header--hero .nav-primary__link,
.site-header--hero .nav-primary__trigger {
  color: var(--text-on-red);
  transition: color var(--transition), text-shadow var(--transition);
}

.site-header--hero:not(:hover):not(:focus-within):not(.site-header--overlay-open) .logo,
.site-header--hero:not(:hover):not(:focus-within):not(.site-header--overlay-open) .nav-primary__link,
.site-header--hero:not(:hover):not(:focus-within):not(.site-header--overlay-open) .nav-primary__trigger {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.site-header--hero .header-actions .header-icon-link,
.site-header--hero .menu-toggle {
  color: var(--text-on-red);
  transition: color var(--transition), background var(--transition), text-shadow var(--transition);
}

.site-header--hero:not(:hover):not(:focus-within):not(.site-header--overlay-open) .menu-toggle {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Hover / focus / dropdown open → solid header */
.site-header--hero:hover .utility-bar,
.site-header--hero:focus-within .utility-bar,
.site-header--hero.site-header--overlay-open .utility-bar {
  background: var(--red);
  border-bottom: none;
}

.site-header--hero:hover .main-bar,
.site-header--hero:focus-within .main-bar,
.site-header--hero.site-header--overlay-open .main-bar {
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header--hero:hover .logo,
.site-header--hero:focus-within .logo,
.site-header--hero.site-header--overlay-open .logo {
  color: var(--red);
  text-shadow: none;
}

.site-header--hero:hover .nav-primary__link,
.site-header--hero:hover .nav-primary__trigger,
.site-header--hero:focus-within .nav-primary__link,
.site-header--hero:focus-within .nav-primary__trigger,
.site-header--hero.site-header--overlay-open .nav-primary__link,
.site-header--hero.site-header--overlay-open .nav-primary__trigger {
  color: #222;
  text-shadow: none;
}

.site-header--hero:hover .header-actions .header-icon-link,
.site-header--hero:focus-within .header-actions .header-icon-link,
.site-header--hero:hover .menu-toggle,
.site-header--hero:focus-within .menu-toggle,
.site-header--hero.site-header--overlay-open .header-actions .header-icon-link,
.site-header--hero.site-header--overlay-open .menu-toggle {
  color: #222;
  text-shadow: none;
}

/* Small screens: always solid header on hero (no hover precision) */
@media (max-width: 1023px) {
  .site-header--hero .utility-bar {
    background: var(--red);
    border-bottom: none;
  }

  .site-header--hero .main-bar {
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  }

  .site-header--hero .logo {
    color: var(--red);
    text-shadow: none;
  }

  .site-header--hero .nav-primary__link,
  .site-header--hero .nav-primary__trigger {
    color: #222;
    text-shadow: none;
  }

  .site-header--hero .header-actions .header-icon-link,
  .site-header--hero .menu-toggle {
    color: #222;
    text-shadow: none;
  }

  .site-header--hero .utility-inner a {
    text-shadow: none;
  }
}

/* Fig.2+: compact / scrolled — red strip + white bar */
.site-header--compact .utility-bar {
  background: var(--red);
  border-bottom: none;
}

.site-header--compact .main-bar {
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header--compact .logo {
  color: var(--red);
}

.site-header--compact .nav-primary__link,
.site-header--compact .nav-primary__trigger {
  color: #222;
}

.site-header--compact .header-actions .header-icon-link {
  color: #222;
}

.site-header--compact .menu-toggle {
  color: #222;
}

.utility-bar {
  font-size: 0.8125rem;
}

.utility-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  min-height: 36px;
  padding: 0.35rem 0;
}

.utility-inner a {
  color: var(--text-on-red);
  padding: 0.25rem 0.75rem;
  opacity: 0.95;
  transition: text-shadow var(--transition);
}

.site-header--hero:not(:hover):not(:focus-within):not(.site-header--overlay-open) .utility-inner a {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.site-header--hero:hover .utility-inner a,
.site-header--hero:focus-within .utility-inner a,
.site-header--hero.site-header--overlay-open .utility-inner a {
  text-shadow: none;
}

.utility-inner a:hover {
  opacity: 1;
  text-decoration: underline;
}

.utility-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.site-header--compact .utility-sep {
  background: rgba(255, 255, 255, 0.5);
}

.utility-globe {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.utility-globe svg {
  flex-shrink: 0;
}

/* Full-bleed bar; inner container holds content */
.main-bar {
  width: 100%;
  transition: background var(--transition), color var(--transition);
}

.main-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 64px;
  padding: 0.5rem 0;
}

.logo {
  font-weight: 700;
  font-size: clamp(0.9rem, 2.8vw, 1.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: min(12em, 42vw);
  flex-shrink: 1;
  transition: color var(--transition);
}

@media (min-width: 1024px) {
  .logo {
    max-width: none;
    font-size: 1.25rem;
  }
}

.nav-primary {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  .nav-primary {
    display: flex;
  }
}

.nav-primary__item {
  position: relative;
}

.nav-primary__link,
.nav-primary__trigger {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: color var(--transition);
}

a.nav-primary__trigger {
  text-decoration: none;
  color: inherit;
}

.nav-primary__link::after,
.nav-primary__trigger::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.35rem;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav-primary__link:hover::after,
.nav-primary__trigger:hover::after,
.nav-primary__item.is-open .nav-primary__trigger::after {
  transform: scaleX(1);
}

.nav-primary__item.is-open .nav-primary__trigger,
.nav-primary__link:hover,
.nav-primary__trigger:hover {
  font-weight: 700;
}

/* Dropdown (desktop) */
.nav-dropdown {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(0);
  min-width: 280px;
  max-width: 340px;
  padding: 0;
  margin: 0;
  list-style: none;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
  z-index: calc(var(--header-z) + 2);
}

.nav-primary__item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-dropdown li {
  border-bottom: 1px solid #eee;
}

.nav-dropdown li:last-child {
  border-bottom: none;
}

.nav-dropdown a {
  display: block;
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.nav-dropdown a:hover {
  background: #fafafa;
  color: var(--red);
}

/* Dim overlay */
.nav-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
  z-index: calc(var(--header-z) - 1);
}

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .header-actions {
    display: flex;
  }
}

.header-actions .header-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  color: inherit;
  padding: 0;
}

.header-actions .header-icon-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

.site-header--hero:not(.site-header--overlay-open) .header-actions .header-icon-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Mobile panel */
.nav-mobile {
  position: fixed;
  inset: 0;
  top: 0;
  z-index: calc(var(--header-z) + 5);
  background: #fff;
  padding: 5rem 1.25rem 2rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.nav-mobile.is-open {
  transform: translateX(0);
}

.nav-mobile__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-mobile__item {
  border-bottom: 1px solid #eee;
}

.nav-mobile__link,
.nav-mobile__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-mobile details {
  border-bottom: 1px solid #eee;
}

.nav-mobile details[open] .nav-mobile__chev {
  transform: rotate(180deg);
}

.nav-mobile__chev {
  transition: transform 0.2s;
}

.nav-mobile__sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem 0.5rem;
}

.nav-mobile__sub a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #444;
}

.nav-mobile__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #222;
}

/* ---------- Main spacing (fixed header) ---------- */

main {
  min-height: 40vh;
}

body:not(.has-hero-banner) main {
  padding-top: var(--header-stack-h);
}

body.has-hero-banner main > .hero:first-child {
  margin-top: calc(-1 * var(--header-stack-h));
  padding-top: calc(var(--header-stack-h) + 3rem);
  min-height: 100vh;
  box-sizing: border-box;
}

body.has-hero-banner main > .svc-hero:first-child {
  margin-top: calc(-1 * var(--header-stack-h));
  min-height: 100vh;
  box-sizing: border-box;
}

/* ---------- Hero demo ---------- */

.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  background-image: var(--site-placeholder-img);
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.92;
}

.content-block {
  padding: 3rem 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
}

.sitemap-list {
  line-height: 1.8;
  padding-left: 1.25rem;
}

.sitemap-list a {
  color: var(--red);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.footer-col h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: #e8e8e8;
  opacity: 0.9;
}

.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-col .footer-subhead {
  margin: 1.5rem 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
}

.subfooter {
  background: var(--subfooter-bg);
  color: #fff;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.subfooter__grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 900px) {
  .subfooter__grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
  }
}

.subfooter__left {
  flex: 1;
  min-width: 0;
}

.subfooter__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.subfooter__contact span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subfooter__contact a {
  color: inherit;
}

.subfooter__contact a:hover {
  text-decoration: underline;
}

.subfooter__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.subfooter__links a {
  color: #fff;
}

.subfooter__links .sep {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.4);
}

.subfooter__copy {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.subfooter__disclaimer {
  font-size: 0.6875rem;
  line-height: 1.55;
  color: #999;
  margin: 0;
  max-width: 52rem;
}

.subfooter__right {
  flex-shrink: 0;
  text-align: left;
}

@media (min-width: 900px) {
  .subfooter__right {
    text-align: right;
  }
}

.subfooter__logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
}

.subfooter__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
}

@media (min-width: 900px) {
  .subfooter__social {
    justify-content: flex-end;
  }
}

.subfooter__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #fff;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.subfooter__social a:hover {
  opacity: 1;
}

.subfooter__social svg {
  width: 22px;
  height: 22px;
}
