/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 16px; line-height: 1.6; color: #E8EDF4; background-color: #0A1F3D; -webkit-font-smoothing: antialiased; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; transition: color 0.25s ease; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; transition: all 0.25s ease; }
:focus-visible { outline: 2px solid #F5A623; outline-offset: 3px; border-radius: 2px; }
::selection { background-color: #1F8B4C; color: #fff; }

/* ===== CSS Variables ===== */
:root {
  --color-primary: #0A1F3D;
  --color-accent: #1F8B4C;
  --color-gold: #F5A623;
  --color-surface-dark: #121E2D;
  --color-surface-light: #1C2E44;
  --color-text-primary: #E8EDF4;
  --color-text-secondary: #8FA0B0;
  --color-border: rgba(31, 139, 76, 0.25);
  --gradient-hero: linear-gradient(135deg, #0A1F3D, #1F8B4C);
  --gradient-progress: linear-gradient(90deg, #1F8B4C, #F5A623);
  --font-heading: 700 2.25rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: 300 1rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-data: 400 0.875rem/1.4 "Roboto Mono", "SF Mono", "Fira Code", "Consolas", monospace;
  --max-width: 1200px;
  --header-z: 200;
  --progress-z: 300;
  --nav-z: 250;
  --spacing-section: 4rem;
  --transition-default: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 500;
  padding: 0.5rem 1.2rem;
  background-color: #F5A623;
  color: #0A1F3D;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* ===== Header ===== */
.header {
  position: relative;
  z-index: var(--header-z);
  background-color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  position: relative;
}
.header-left, .header-right {
  flex: 0 0 3rem;
  display: flex;
  align-items: center;
}
.header-right {
  justify-content: flex-end;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}
.brand-name {
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
}
.brand-dot {
  color: var(--color-gold);
  margin: 0 0.05em;
  display: inline-block;
}
.brand-tagline {
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

/* ===== Nav Toggle (Mobile) ===== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(232,237,244,0.15);
  border-radius: 4px;
  padding: 0.4rem;
  transition: border-color 0.25s ease;
}
.nav-toggle:hover, .nav-toggle:focus-visible {
  border-color: var(--color-gold);
}
.nav-toggle-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Primary Nav ===== */
.primary-nav {
  background-color: var(--color-surface-dark);
  border-top: 1px solid var(--color-border);
}
.primary-nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}
.primary-nav a {
  display: inline-block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.06em;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.25s ease;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width 0.3s ease;
}
.primary-nav a:hover {
  color: var(--color-text-primary);
}
.primary-nav a:hover::after {
  width: 100%;
}
.primary-nav a[aria-current="page"] {
  color: var(--color-gold);
  font-weight: 600;
}
.primary-nav a[aria-current="page"]::after {
  width: 100%;
  background: var(--color-gold);
}

/* ===== Mobile Nav (slide-out) ===== */
@media (max-width: 767px) {
  .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 320px);
    z-index: var(--nav-z);
    background-color: var(--color-surface-dark);
    border-top: none;
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 5rem;
    overflow-y: auto;
  }
  .primary-nav[data-open] {
    transform: translateX(0);
  }
  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 2rem;
  }
  .primary-nav li {
    border-bottom: 1px solid rgba(232,237,244,0.06);
  }
  .primary-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    color: var(--color-text-primary);
  }
  .primary-nav a::after {
    display: none;
  }
  .primary-nav a[aria-current="page"] {
    color: var(--color-gold);
    border-left: 3px solid var(--color-gold);
    padding-left: 1rem;
  }
  /* overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--nav-z) - 1);
    background-color: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  .nav-overlay[data-open] {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== Footer ===== */
.footer {
  background-color: var(--color-surface-dark);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.5rem;
}
.footer-brand-name {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
}
.footer-tagline {
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  letter-spacing: 0.08em;
}
.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: 0.25rem 0;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1.5rem 0;
}
.footer-link {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
  position: relative;
}
.footer-link:hover {
  color: var(--color-gold);
}
.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width 0.25s ease;
}
.footer-link:hover::after {
  width: 100%;
}
.footer-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding: 1.5rem 0;
}
.footer-contact-item {
  font-weight: 300;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}
.footer-note {
  text-align: center;
  font-weight: 300;
  font-size: 0.75rem;
  color: rgba(143,160,176,0.6);
  padding: 1rem 0 1.5rem;
  line-height: 1.5;
  max-width: 540px;
  margin: 0 auto;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--color-border);
  padding: 1.2rem 0;
}
.footer-icp {
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}
.footer-copy {
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--progress-z);
  height: 3px;
  width: 0%;
  background: var(--gradient-progress);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  transition: width 0.05s linear;
  box-shadow: 0 0 6px rgba(245,166,35,0.3);
}

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Generic Section ===== */
.section {
  padding: var(--spacing-section) 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.8rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
  gap: 0.5rem;
}
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background-color: var(--color-gold);
  border-color: var(--color-gold);
  color: #0A1F3D;
}
.btn-ghost {
  background-color: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}
.btn-ghost:hover {
  background-color: var(--color-gold);
  color: #0A1F3D;
}

/* ===== Typography Utilities ===== */
.heading-h1 { font: var(--font-heading); font-size: clamp(1.75rem, 4vw, 3rem); }
.heading-h2 { font: var(--font-heading); font-size: clamp(1.4rem, 3vw, 2.25rem); }
.heading-h3 { font: var(--font-heading); font-size: clamp(1.1rem, 2vw, 1.5rem); }
.body-text { font: var(--font-body); }
.data-text { font: var(--font-data); }

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .primary-nav { transition: none; }
  .nav-toggle-line { transition: none; }
  .scroll-progress { transition: none; }
  .primary-nav a::after { transition: none; }
  .footer-link::after { transition: none; }
}

/* ===== Responsive: Tablet & Up ===== */
@media (min-width: 768px) {
  .header-inner { padding: 1.5rem 2rem; }
  .brand-name { font-size: 2rem; }
  .brand-tagline { font-size: 0.8125rem; }
  .nav-toggle { display: none; }
  .primary-nav ul { padding: 0.85rem 2rem; gap: 2.5rem; }
  .primary-nav a { font-size: 0.9375rem; }
  .footer-inner { padding: 0 2rem; }
  .footer-brand-name { font-size: 1.75rem; }
  .footer-links { gap: 3rem; }
  .footer-bottom { flex-direction: row; }
}

/* ===== Responsive: Desktop ===== */
@media (min-width: 1025px) {
  .header-inner { padding: 2rem 2rem 1.2rem; }
  .brand-name { font-size: 2.25rem; }
  .primary-nav ul { gap: 3rem; padding: 1rem 2rem; }
  .footer { padding: 4rem 0 0; }
  .footer-inner { padding: 0 2rem; }
  .footer-links { gap: 4rem; }
}

/* ===== Responsive: Large Desktop ===== */
@media (min-width: 1400px) {
  .header-inner, .primary-nav ul, .footer-inner { padding-left: 0; padding-right: 0; }
}

/* ===== Focus visible enhancement ===== */
.primary-nav a:focus-visible,
.footer-link:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Print ===== */
@media print {
  .header { border-bottom: 1px solid #ccc; box-shadow: none; }
  .nav-toggle, .primary-nav { display: none; }
  .footer { border-top: 1px solid #ccc; background: #fff; }
  .footer-link, .footer-contact-item, .footer-icp, .footer-copy { color: #333; }
  .scroll-progress { display: none; }
  .skip-link { display: none; }
}
