/* ========== reset & base ========== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* 与 body 同色，避免 iOS/Android 橡皮筋回弹时露出另一块底色 */
  background-color: #f0f0f0;
  /* 部分浏览器仅靠 body 无法完全消除横向滚动，右侧会露出空白 */
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  /* 100vh 在移动端常包含地址栏收起时的高度，易产生“多出一截”的上下空白滚动 */
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  background: #f0f0f0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  /* 避免横向橡皮筋露出侧向空白（不影响纵向下拉刷新） */
  overscroll-behavior-x: none;
}
img { max-width: 100%; height: auto; vertical-align: middle; }
a:focus-visible { outline: 2px solid #003366; outline-offset: 2px; }
button:focus-visible, select:focus-visible { outline: 2px solid #003366; outline-offset: 2px; }

/* ========== header ========== */
.site-header {  backdrop-filter: saturate(140%) blur(2px);position: relative;z-index: 9; }

.nav-sub {
  background: #ebebeb;
  border-bottom: 1px solid #1a1a1a;
  box-shadow: none;
}
.nav-sub-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px max(32px, env(safe-area-inset-left)) 10px max(32px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.logo-sub { display: block; flex-shrink: 0; }
.logo-sub img { display: block; max-height: 80px;}
.nav-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-size: 15px;
}
.nav-secondary > a {
  color: #333;
  text-decoration: none;
  padding: 30px 0;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
}
.nav-secondary > a:hover { text-decoration: underline; color: #003366; }
.nav-search {
  color: #222;
  font-size: 1.3rem;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color .2s ease, color .2s ease;
}
.nav-search:hover { background: rgba(0, 0, 0, 0.06); color: #111; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform .25s, opacity .25s;
}
.site-header.menu-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.menu-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.menu-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile-panel,
.nav-mobile-backdrop {
  display: none;
}
.nav-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 92vw);
  max-width: 92vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  z-index: 102;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .3s ease;
  visibility: hidden;
  pointer-events: none;
}
.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 101;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.site-header.menu-open .nav-mobile-panel {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.site-header.menu-open .nav-mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-inner {
  padding: 24px 0 40px;
}
.nav-mobile-item {
  border-bottom: 1px solid #eee;
}
.nav-mobile-head {
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}
.nav-mobile-head::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(45deg);
  margin-left: 8px;
  transition: transform .25s;
}
.nav-mobile-item.open .nav-mobile-head::after {
  transform: rotate(-135deg);
}
.nav-mobile-sub {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: #f8f8f8;
}
.nav-mobile-item.open .nav-mobile-sub {
  max-height: 600px;
}
.nav-mobile-sub li { border-bottom: none; }
.nav-mobile-sub a {
  display: block;
  padding: 12px 20px 12px 32px;
  font-size: 14px;
  color: #003366;
  text-decoration: none;
  border-bottom: 1px solid #eee;
}
.nav-mobile-sub a:hover { background: #eee; }
.nav-mobile-item.has-sub > a { display: none; }
.nav-mobile-item:not(.has-sub) a {
  display: block;
  padding: 14px 20px;
  font-size: 15px;
  color: #333;
  text-decoration: none;
}
.nav-mobile-item:not(.has-sub) a:hover { background: #f5f5f5; }
.nav-mobile-divider {
  height: 1px;
  background: #ddd;
  margin: 16px 20px;
}
.nav-mobile-link {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}
.nav-mobile-link:hover { background: #f5f5f5; color: #003366; }
.nav-mobile-search { font-weight: 600; }

/* ========== desktop nav dropdown ========== */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-dropdown-trigger {
  color: #333;
  text-decoration: none;
  padding: 30px 0;
  background: none;
  border: none;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: color .22s ease, transform .22s ease;
}
.nav-dropdown-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 22px;
  width: 100%;
  height: 2px;
  background: #0b75c9;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger:focus-visible {
  color: #0b75c9;
  text-decoration: none;
  transform: translateY(-1px);
}
.nav-dropdown-trigger:hover::after,
.nav-dropdown-trigger:focus-visible::after {
  transform: scaleX(1);
}
.nav-dropdown.open .nav-dropdown-trigger { color: #003366; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  padding: 8px 0;
  list-style: none;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: #f5f5f5; color: #003366; }

/* PC: ANSI-style primary + secondary nav (reference layout) */
@media (min-width: 769px) {
  .nav-secondary {
    font-family: "Arial Narrow", "Helvetica Neue Condensed", "Franklin Gothic Medium", "Liberation Sans Narrow", Arial, sans-serif;
    font-stretch: condensed;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    gap: 4px 26px;
  }
  .nav-secondary > a {
    position: relative;
    color: #111;
    padding: 30px 4px 30px;
    text-decoration: none;
  }
  .nav-secondary > a:hover {
    color: #111;
    text-decoration: none;
  }

  .nav-secondary > a:hover::before {
    opacity: 1;
  }
  .nav-dropdown-trigger {
    position: relative;
    color: #111;
    padding: 30px 2px 30px 4px;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
  }
  .nav-dropdown-trigger:hover,
  .nav-dropdown.open .nav-dropdown-trigger {
    color: #0b75c9;
    text-decoration: none;
    transform: translateY(-1px);
  }
  
  .nav-dropdown:hover .nav-dropdown-trigger::before,
  .nav-dropdown.open .nav-dropdown-trigger::before {
    opacity: 1;
  }
  .nav-dropdown-menu {
    min-width: 300px;
    max-width: min(380px, 92vw);
    margin:0;
    padding: 10px 0 12px;
    border: 1px solid #c8c8c8;
    border-top: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  }
  /* 填补与触发器之间的空隙，避免鼠标下移时 :hover 断开 */
  .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
  }
  .nav-dropdown-menu a {
    padding: 14px 26px;
    font-size: 14px;
    font-weight: 400;
    font-family: Arial, Helvetica, sans-serif;
    font-stretch: normal;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #111;
    line-height: 1.35;
  }
  .nav-dropdown-menu a:hover {
    background: #f0f0f0;
    color: #111;
  }
}

/* ========== header responsive ========== */
@media (max-width: 768px) {
  .nav-sub-inner {
    padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
    gap: 14px;
    min-height: 48px;
  }
  .logo-sub img { height: 32px; }
  .nav-toggle { display: flex; }
  .nav-secondary,
  .nav-search { display: none; }
  .nav-mobile-panel,
  .nav-mobile-backdrop {
    display: block;
    height: 100vh;
  }
}
@media (max-width: 480px) {
  .nav-sub-inner {
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  }
  .logo-sub img { height: 30px; }
}

/* ========== footer ========== */
.footer {
  position: relative;
  margin: 0;
  padding: 0;
  background: #000;
}

/* Black top bar */
.footer-topbar {
  background: #000;
  color: #fff;
  border-bottom: 1px solid #222;
}
.footer-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px max(28px, env(safe-area-inset-left)) 14px max(28px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 20px 24px;
}
.footer-topbar-nav {
  flex:1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  justify-self: start;
}
.footer-topbar-nav a {
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.footer-topbar-nav a:hover { text-decoration: underline; color: #e8e8e8; }
.footer-membership {
  justify-self: center;
  display: inline-block;
  padding: 10px 24px;
  background: #0066b3;
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.footer-membership:hover { background: #005091; color: #fff !important; }
.footer-social {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.footer-social-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2a2a2a;
  color: #fff;
  text-decoration: none;
  transition: background .2s ease;
}
.footer-social-btn:hover { background: #444; color: #fff; }
.footer-social-btn svg { display: block; }

/* Light main area */
.footer-main {
  background: #ececec;
  color: #333;
}
.footer-main-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px max(32px, env(safe-area-inset-left)) 72px max(32px, env(safe-area-inset-right));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 36px 48px;
}
.footer-brand { flex: 0 0 auto; }
.footer-brand-logo { display: inline-block; line-height: 0; }
.footer-brand-logo img {
  display: block;
  height: auto;
  max-height: 48px;
  width: auto;
}
.footer-legal {
  flex: 1 1 0px;
  text-align: right;
  min-width: 0;
}
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.footer-legal-links a {
  color: #333;
  font-size: 14px;
  text-decoration: none;
}
.footer-legal-links a:hover { text-decoration: underline; color: #003366; }
.footer-copyright {
  margin: 0;
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}

/* Back to top (bottom-right of footer) */
.footer-a11y {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0066b3;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 5;
  transition: background .2s ease, transform .2s ease;
}
.footer-a11y:hover {
  background: #005091;
  color: #fff;
  transform: translateY(-2px);
}
.footer-a11y-text {
  font-size: 9px;
  font-weight: 700;
  margin-top: 1px;
  letter-spacing: 0.02em;
}

/* Legacy single-block footer (empty include fallback) */
.footer-inner { max-width: 800px; margin: 0 auto; padding: 24px; text-align: center; }
.footer-inner .footer-links { margin-bottom: 14px; }
.footer-inner .footer-links a { margin: 0 10px; color: #fff; }

@media (max-width: 992px) {
  .footer-topbar-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 16px max(20px, env(safe-area-inset-left)) 16px max(20px, env(safe-area-inset-right));
  }
  .footer-topbar-nav { justify-content: center; justify-self: center; }
  .footer-social { justify-content: center; justify-self: center; }
  .footer-main-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 44px max(24px, env(safe-area-inset-left)) max(32px, calc(20px + env(safe-area-inset-bottom))) max(24px, env(safe-area-inset-right));
  }
  .footer-legal { text-align: left; width: 100%; }
  .footer-legal-links { justify-content: flex-start; }
  /* 避免为 absolute 按钮预留整行底部空白；固定到视口右下角 */
  .footer-a11y {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99;
  }
}

@media (max-width: 480px) {
  .footer-topbar-inner {
    padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  }
  .footer-topbar-nav { gap: 8px 14px; }
  .footer-membership { padding: 9px 18px; font-size: 11px; }
  .footer-main-inner {
    padding: 36px max(16px, env(safe-area-inset-left)) max(28px, calc(16px + env(safe-area-inset-bottom))) max(16px, env(safe-area-inset-right));
  }
  .footer-legal-links { gap: 8px 16px; }
}
