﻿/* Shared navigation, buttons, and utility components. Extracted from test-tmp/index.html. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid #e3edf6;
  backdrop-filter: blur(12px);
}
.nav {
  width: min(var(--max), calc(100% - 44px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo { flex: 0 0 auto; }
.logo img { width: 172px; height: auto; }
.nav-toggle,
.menu-toggle { display: none; }
.links {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  font-size: 14px;
  font-weight: 600;
  color: #162f48;
  white-space: nowrap;
}
.links a.is-active { color: var(--blue); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn.primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 88, 168, .18);
}
.btn.secondary {
  color: var(--blue);
  background: #fff;
  border-color: #8fb8dc;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0, 88, 168, .2); }
.back-top {
  position: fixed;
  right: clamp(18px, 2.6vw, 34px);
  bottom: clamp(22px, 4vw, 42px);
  z-index: 40;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #4e5966;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 30px rgba(15, 35, 55, .10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease, box-shadow .24s ease, background .24s ease;
}
.back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.back-top:hover {
  background: #fff;
  color: #263849;
  box-shadow: 0 16px 34px rgba(15, 35, 55, .14);
  transform: translateY(-2px);
}
.back-top svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .72s ease, transform .72s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

footer { background: #05264d; color: #fff; }
.footer {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr 325px 118px;
  gap: 38px;
  align-items: end;
  padding: 32px 0;
}
.footer-logo img { width: 168px; filter: brightness(0) invert(1); }
.footer-logo > p:first-of-type { width: 168px; margin: 10px 0 0; color: rgba(255,255,255,.82); font-size: 14px; font-weight: 400; letter-spacing: .02em; text-align: justify; line-height: 1.25; }
.footer-logo > p:first-of-type:after { content: ""; display: inline-block; width: 100%; }
.copyright { margin: 6px 0 0; color: rgba(255,255,255,.68); font-size: 13px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.beian-links {
  display: grid;
  gap: 3px;
  margin: 8px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
.beian-links a {
  width: fit-content;
  display: block;
  color: inherit;
  text-decoration: none;
  font-weight: 400;
}
.beian-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.foot-links { columns: 2; column-gap: 44px; font-size: 14px; font-weight: 400; color: rgba(255,255,255,.78); }
.foot-links a { display: block; margin: 0 0 7px; }
.contact-lines { display: grid; gap: 8px; font-size: 14px; font-weight: 400; line-height: 1.55; color: rgba(255,255,255,.82); }
.contact-lines div { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; }
.contact-lines img { width: 16px; height: 16px; margin-top: 3px; opacity: .82; }
.qr {
  width: 104px;
  height: 104px;
  object-fit: cover;
  background: #fff;
  border: 6px solid #fff;
  border-radius: 4px;
}
.qr-text { margin-top: 8px; text-align: center; color: rgba(255,255,255,.78); font-size: 14px; }

@media (max-width: 1120px) {
  .nav {
    height: auto;
    min-height: 64px;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: space-between;
  }
  .menu-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid #d5e5f3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 45, 95, .06);
  }
  .menu-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: #12345d;
    transition: transform .2s ease, opacity .2s ease;
  }
  .links {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    box-shadow: none;
    transition: max-height .24s ease, padding .24s ease, border-color .24s ease, box-shadow .24s ease;
  }
  .links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid #edf3f9;
    line-height: 1.35;
  }
  .links a:last-child { border-bottom: 0; }
  .links a.is-active {
    color: var(--blue);
    background: #f1f8ff;
  }
  .nav-toggle:checked ~ .links {
    max-height: 440px;
    padding: 6px 0;
    border: 1px solid #dce8f6;
    box-shadow: 0 18px 42px rgba(15, 45, 95, .12);
  }
  .nav-toggle:checked ~ .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .footer { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .nav, .footer { width: min(100% - 28px, var(--max)); }
  .nav {
    padding: 10px 0;
    gap: 8px 12px;
  }
  .footer {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    padding: 28px 0 max(28px, env(safe-area-inset-bottom));
  }
  .foot-links { columns: 1; }
  .footer-logo img { width: 146px; }
  .footer-logo > p:first-of-type { width: 146px; font-size: 14px; }
  .copyright { white-space: normal; }
  .beian-links { font-size: 12px; }
  .qr {
    width: 96px;
    height: 96px;
    border-width: 5px;
  }
  .qr-text { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .back-top {
    transition: none;
  }
  .back-top:hover {
    transform: none;
  }
}
