:root {
  --brand: #1e4d91;
  --brand-600: #1769aa;
  --brand-700: #14568c;
  --brand-900: #0b2f4d;
  --brand-50: #eff6ff;
  --ink: #0f2740;
  --muted: #5b6b7c;
  --line: #e6edf5;
  --white: #fff;
  --max: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

.wrap { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }

/* 顶栏 */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), backdrop-filter .3s var(--ease);
}
.nav.is-scrolled,
.nav.nav--solid {
  background: rgba(255, 255, 255, .94);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(15, 39, 64, 0.04);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-900); text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; display: block; }
.brand-wordmark {
  display: none;
  height: 28px;
  width: auto;
  max-width: min(132px, 36vw);
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
}
.brand-text {
  font-size: 24px; line-height: 44px; height: 44px;
  letter-spacing: -.02em; display: none; align-items: center;
}
html[lang="zh-CN"] .brand-wordmark--nav { display: block; }
html:not([lang="zh-CN"]) .brand-text--nav { display: inline-flex; }
.nav-links {
  display: flex; gap: 28px; font-size: .95rem; font-weight: 500; color: var(--muted);
}
.nav-links a { color: inherit; text-decoration: none; }
.nav-links a:hover { color: var(--brand); }
.nav-links a.is-active { color: var(--brand); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang { position: relative; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; background: transparent;
  padding: 7px 10px; border-radius: 999px;
  cursor: pointer; color: var(--brand-900);
  font-weight: 700; font-size: .84rem; line-height: 1;
  font-family: inherit;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.lang-toggle:hover,
.lang.is-open .lang-toggle {
  color: var(--brand);
  background: rgba(30, 77, 145, .06);
  border-color: rgba(30, 77, 145, .12);
}
.lang-flag {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.lang-chevron {
  width: 10px; height: 10px; flex: 0 0 auto;
  opacity: .75; transition: transform .2s var(--ease);
}
.lang.is-open .lang-chevron { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 50;
  width: min(280px, calc(100vw - 32px));
  max-height: min(420px, 70vh);
  overflow-y: auto;
  margin: 0; padding: 8px;
  list-style: none; border-radius: 16px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(15, 39, 64, 0.16);
  backdrop-filter: blur(12px);
  -webkit-overflow-scrolling: touch;
}
.lang-menu[hidden] { display: none; }
.lang-menu button,
.lang-menu a.lang-option {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0; background: transparent;
  text-align: left; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; color: var(--ink); font-family: inherit;
  text-decoration: none; box-sizing: border-box;
}
.lang-menu button:hover,
.lang-menu a.lang-option:hover { background: var(--brand-50); }
.lang-menu button[aria-selected="true"],
.lang-menu a.lang-option[aria-selected="true"] {
  background: var(--brand-50);
  box-shadow: inset 0 0 0 1px rgba(30, 77, 145, .18);
}
.lang-menu .lang-name {
  font-weight: 600; font-size: .9rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lang-menu .lang-code {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  letter-spacing: .02em;
}
.lang-menu button[aria-selected="true"] .lang-name,
.lang-menu a.lang-option[aria-selected="true"] .lang-name { color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; cursor: pointer;
  text-decoration: none; font-family: inherit;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 12px 28px rgba(30, 77, 145, .28);
}
.btn-primary:hover { background: #163a73; transform: translateY(-1px); }
.nav-cta { padding: 11px 18px; font-size: .9rem; }

/* 页脚 */
footer.site-footer {
  padding: 42px 0 28px;
  background: #071a2c;
  color: rgba(255,255,255,.78);
  position: relative;
  overflow: hidden;
}
footer.site-footer::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(30, 77, 145, .75), transparent);
  opacity: .7;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand-mark { width: 48px; height: 48px; flex: 0 0 auto; display: block; }
.footer-brand-name {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 6px;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
}
.brand-wordmark--footer { height: 32px; max-width: 148px; }
html[lang="zh-CN"] .brand-wordmark--footer { display: block; }
html:not([lang="zh-CN"]) .brand-text--footer {
  display: inline-flex; height: auto; line-height: 1.2; font-size: 1.05rem;
}
.footer-brand p { margin: 0; color: rgba(255,255,255,.62); font-size: .86rem; max-width: 26rem; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  justify-content: flex-end; color: rgba(255,255,255,.7); font-size: .9rem; font-weight: 500;
}
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-links a.is-active { color: #fff; }
.footer-copy {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.45); font-size: .8rem;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

@media (max-width: 960px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .brand-text--nav { font-size: 20px; }
  .brand-wordmark--nav { height: 24px; }
}

/* ——— 阿语 RTL ——— */
[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}
[dir="rtl"] .lang-menu button,
[dir="rtl"] .lang-menu a.lang-option {
  text-align: right;
}
[dir="rtl"] .footer-links {
  justify-content: flex-start;
}
@media (max-width: 960px) {
  [dir="rtl"] .footer-links {
    justify-content: flex-start;
  }
}
