/* 全站统一排版：正文保持克制清晰，标题建立更稳定的层级与气质 */
:root {
  --ab-font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --ab-font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --ab-type-xs: 0.875rem;
  --ab-type-sm: 1rem;
  --ab-type-md: 1.125rem;
  --ab-type-lg: clamp(1.25rem, 1.14rem + 0.42vw, 1.5rem);
  --ab-type-xl: clamp(1.55rem, 1.38rem + 0.66vw, 1.95rem);
  --ab-type-2xl: clamp(1.95rem, 1.66rem + 1.08vw, 2.65rem);
  --ab-type-3xl: clamp(2.45rem, 1.98rem + 1.9vw, 3.95rem);
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body,
button,
input,
textarea,
select {
  font-family: var(--ab-font-sans) !important;
  font-kerning: normal;
}

body {
  line-height: 1.76;
  letter-spacing: 0.008em;
  text-rendering: optimizeLegibility;
  padding-top: 66px !important;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid color-mix(in srgb, #2563eb 78%, white);
  outline-offset: 3px;
}

.ab-skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.98);
  box-shadow: 0 18px 40px rgb(37 99 235 / 0.16);
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transform: translateY(calc(-100% - 16px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

.ab-skip-link:hover {
  transform: translateY(0);
}

.ab-skip-link:focus,
.ab-skip-link:focus-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

body.ab-mobile-nav-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ab-font-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 {
  line-height: 1.06 !important;
}

h2 {
  line-height: 1.12 !important;
}

h3 {
  line-height: 1.18 !important;
}

h4,
h5,
h6 {
  line-height: 1.28 !important;
}

p,
li {
  line-height: 1.76;
}

strong,
b {
  font-weight: 700 !important;
}

.font-medium {
  font-weight: 500 !important;
}

.font-semibold {
  font-weight: 600 !important;
}

.font-bold {
  font-weight: 700 !important;
}

.font-black {
  font-weight: 800 !important;
}

.text-sm {
  font-size: var(--ab-type-xs) !important;
  line-height: 1.62 !important;
}

.text-base {
  font-size: var(--ab-type-sm) !important;
  line-height: 1.72 !important;
}

.text-lg {
  font-size: var(--ab-type-md) !important;
  line-height: 1.72 !important;
}

.text-xl {
  font-size: var(--ab-type-lg) !important;
  line-height: 1.48 !important;
}

.text-2xl {
  font-size: var(--ab-type-xl) !important;
  line-height: 1.2 !important;
}

.text-3xl {
  font-size: var(--ab-type-2xl) !important;
  line-height: 1.12 !important;
}

.text-4xl {
  font-size: clamp(2.25rem, 1.92rem + 1.32vw, 3.2rem) !important;
  line-height: 1.09 !important;
  letter-spacing: -0.028em !important;
}

.text-5xl {
  font-size: clamp(2.7rem, 2.14rem + 2.18vw, 4.35rem) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.036em !important;
}

.text-6xl {
  font-size: clamp(3.4rem, 2.7rem + 2.82vw, 5.3rem) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.044em !important;
  font-variant-numeric: tabular-nums;
}

.text-7xl {
  font-size: clamp(4rem, 3.1rem + 3.55vw, 5.9rem) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.05em !important;
  font-variant-numeric: tabular-nums;
}

.text-gray-300,
.text-gray-400,
.text-white {
  letter-spacing: 0.008em;
}

.text-gray-300,
.text-gray-400 {
  line-height: 1.88 !important;
}

.about-number-display {
  font-family: var(--ab-font-serif) !important;
  font-weight: 800 !important;
  line-height: 0.94 !important;
  letter-spacing: -0.048em !important;
  font-variant-numeric: tabular-nums;
}

[class*="Pacifico"] {
  font-family: var(--ab-font-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

.article p,
.article li {
  max-width: 68ch;
}

.article h2,
.article h3 {
  margin-top: 2.1rem;
}

#contact p,
#contact li,
#contact a {
  max-width: none;
}

#contact a {
  text-decoration: none;
}

#contact .fa-map-marker-alt {
  width: 1rem;
  text-align: center;
}

.ab-header,
.ab-header * {
  box-sizing: border-box;
  font-family: var(--ab-font-sans) !important;
}

.ab-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  backdrop-filter: blur(12px);
  transform: translateZ(0);
  /* 隔离页面级排版规则，避免导航尺寸被当前页样式继承覆盖 */
  font-size: 16px !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
  text-wrap: normal;
}

.ab-header a,
.ab-header button,
.ab-header span,
.ab-header nav,
.ab-header svg {
  line-height: inherit !important;
  letter-spacing: inherit !important;
  text-wrap: normal;
}

.ab-header-inner {
  width: 100%;
  padding: 12px 24px !important;
}

.ab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ab-header-left {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.ab-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: none;
}

.ab-header-logo {
  display: block;
  width: auto !important;
  height: 42px !important;
  max-width: 135px !important;
  object-fit: contain !important;
  background: transparent !important;
}

.ab-header-nav {
  display: none;
  align-items: center;
  gap: 32px;
  margin-left: 64px;
}

.ab-mobile-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.92);
  color: #1f2937;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.06);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.ab-mobile-menu-toggle:hover {
  color: #2563eb;
  border-color: #bfdbfe;
}

.ab-mobile-menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 9999px;
  background: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

body.ab-mobile-nav-open .ab-mobile-menu-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.ab-mobile-nav-open .ab-mobile-menu-bar:nth-child(2) {
  opacity: 0;
}

body.ab-mobile-nav-open .ab-mobile-menu-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.ab-mobile-nav-shell[hidden] {
  display: none !important;
}

.ab-mobile-nav-shell {
  display: none;
}

.ab-mobile-nav-shell.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 70;
}

.ab-mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(15 23 42 / 0.32);
}

.ab-mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(88vw, 24rem);
  height: 100%;
  padding: 88px 20px 28px;
  background: rgb(255 255 255 / 0.98);
  box-shadow: -24px 0 60px rgb(15 23 42 / 0.18);
  overflow-y: auto;
}

.ab-mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ab-mobile-nav-heading {
  color: #111827;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  letter-spacing: 0.08em;
  font-weight: 600 !important;
  text-transform: uppercase;
}

.ab-mobile-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

.ab-mobile-nav-close:hover {
  color: #2563eb;
  border-color: #bfdbfe;
}

.ab-mobile-nav-close:active,
.ab-mobile-menu-toggle:active {
  transform: scale(0.98);
}

.ab-mobile-nav-body {
  display: grid;
  gap: 14px;
}

.ab-mobile-nav-group {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.ab-mobile-nav-title {
  color: #6b7280;
  font-size: 0.8125rem !important;
  line-height: 1.4 !important;
  letter-spacing: 0.06em;
  font-weight: 600 !important;
}

.ab-mobile-nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f9fafb;
  color: #374151;
  text-decoration: none;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.ab-mobile-nav-link.is-active {
  background: #eff6ff;
  color: #2563eb;
}

.ab-nav-link,
.ab-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: #4b5563;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.96875rem !important;
  line-height: 1.55 !important;
  letter-spacing: 0.014em;
  font-weight: 500 !important;
  transition: color 0.2s ease;
}

.ab-header i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ab-header a:hover,
.ab-header button:hover {
  transform: none !important;
}

.ab-nav-link:hover,
.ab-dropdown-trigger:hover {
  color: #2563eb;
}

.ab-nav-link.is-active,
.ab-dropdown-trigger.is-active {
  color: #2563eb;
}

.ab-nav-link:focus-visible,
.ab-dropdown-trigger:focus-visible,
.ab-dropdown-item:focus-visible,
.ab-mobile-nav-link:focus-visible,
.ab-mobile-menu-toggle:focus-visible,
.ab-mobile-nav-close:focus-visible {
  outline: 2px solid color-mix(in srgb, #2563eb 78%, white);
  outline-offset: 3px;
}

.dropdown {
  position: relative;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.is-open .dropdown-menu {
  display: block;
}

.dropdown-menu[hidden] {
  display: none !important;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  width: 224px;
  margin-top: 8px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.ab-dropdown-item {
  display: block;
  padding: 8px 16px;
  color: #4b5563;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.ab-dropdown-item:hover {
  background: #f9fafb;
  color: #2563eb;
}

.ab-dropdown-item.is-active {
  background: #eff6ff;
  color: #2563eb;
}

@media (min-width: 768px) and (max-width: 1023px) {
  body {
    padding-top: 78px !important;
  }

  .ab-header-inner {
    padding: 14px 32px !important;
  }

  .ab-header-logo {
    height: 52px !important;
    max-width: 156px !important;
  }

  .ab-mobile-nav-panel {
    width: min(26rem, 72vw);
    padding: 96px 24px 32px;
  }
}

@media (min-width: 1024px) {
  body {
    padding-top: 92px !important;
  }

  .ab-header-inner {
    padding: 16px 40px !important;
  }

  .ab-header-logo {
    height: 60px !important;
    max-width: 180px !important;
  }

  .ab-header-nav {
    display: flex !important;
  }

  .ab-mobile-menu-toggle,
  .ab-mobile-nav-shell {
    display: none !important;
  }

  .ab-header-inner {
    padding-left: 80px !important;
    padding-right: 80px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
