/* ============ 1. Reset & Base ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg {
  display: block;
  max-width: 100%;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--highlight-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent-orange);
}
ul, ol {
  list-style: none;
}
main {
  flex: 1 0 auto;
}

/* ============ 2. Variables ============ */
:root {
  --bg-primary: #0B1B2B;
  --bg-secondary: #12263A;
  --accent-orange: #FF6B35;
  --accent-green: #00D084;
  --text-primary: #F0F6FF;
  --text-secondary: #A8B9CC;
  --grid-line: #1E3A5F;
  --highlight-blue: #4CA8FF;
  --warning-amber: #FFC107;
  --overlay-dark: rgba(11, 27, 43, 0.85);

  --font-headline: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;

  --container-max: 1200px;
  --container-pad: 24px;
  --grid-gap: 24px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

/* ============ 3. Typography ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p {
  margin-bottom: 1rem;
}
::selection {
  background: var(--accent-orange);
  color: #fff;
}

/* ============ 4. Layout Helpers ============ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.section {
  padding: 96px 0;
}
.section-tight {
  padding: 64px 0;
}
.grid {
  display: grid;
  gap: var(--grid-gap);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ 5. Skip Link ============ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--accent-orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0;
  transition: top 0.3s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--highlight-blue);
  outline-offset: 2px;
}

/* ============ 6. Scroll Progress ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-green) 100%);
  z-index: 1000;
  pointer-events: none;
}

/* ============ 7. Header & Masthead ============ */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--grid-line);
  position: relative;
  z-index: 100;
}
.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 32px 0 20px;
  text-align: center;
}
.masthead-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
}
.masthead-brand:hover {
  color: var(--text-primary);
}
.brand-symbol {
  width: 48px;
  height: 48px;
}
.masthead-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.masthead-title {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}
.masthead-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.masthead-tools {
  position: absolute;
  right: 0;
  top: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.masthead-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border: 1px solid var(--grid-line);
  padding: 4px 12px;
  background: var(--bg-secondary);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: var(--accent-green);
  animation: live-pulse 2s ease-in-out infinite;
}
.live-text {
  white-space: nowrap;
}
@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 208, 132, 0);
  }
}

/* ============ 8. Navigation ============ */
.site-nav {
  border-top: 1px solid var(--grid-line);
  background: var(--bg-primary);
}
.nav-list {
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.nav-item {
  display: flex;
}
.nav-item + .nav-item {
  border-left: 1px solid var(--grid-line);
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 14px 28px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border-bottom: 2px solid transparent;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(76, 168, 255, 0.08);
}
.nav-link[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent-orange);
}

/* Nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--grid-line);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.nav-toggle:hover {
  border-color: var(--highlight-blue);
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ 9. Footer ============ */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--grid-line);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding: 64px 0 48px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
}
.footer-logo:hover {
  color: var(--accent-orange);
}
.footer-logo-symbol {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.footer-logo-text {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.footer-trust {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 320px;
  margin-top: 4px;
}
.footer-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--grid-line);
  position: relative;
}
.footer-heading::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 24px;
  height: 1px;
  background: var(--accent-orange);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.6;
  transition: color 0.2s ease;
}
.footer-links a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--highlight-blue);
  transform: rotate(45deg);
  flex-shrink: 0;
  align-self: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.footer-links a:hover {
  color: var(--accent-orange);
}
.footer-links a:hover::before {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}
.footer-address {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.footer-bottom {
  border-top: 1px solid var(--grid-line);
  background: var(--bg-primary);
  padding: 20px 0;
  text-align: center;
}
.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ============ 10. Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent-orange);
  color: #fff;
}
.btn-primary:hover {
  background: #E55A25;
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: var(--grid-line);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--highlight-blue);
  color: var(--highlight-blue);
  background: rgba(76, 168, 255, 0.06);
}

/* ============ 11. Card ============ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--grid-line);
  border-radius: 0;
  padding: 28px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--highlight-blue);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ============ 12. Data Card ============ */
.data-card {
  background: var(--bg-secondary);
  border: 1px solid var(--grid-line);
  border-radius: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.data-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 24px;
  height: 2px;
  background: var(--accent-orange);
}
.data-card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.data-card-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1.2;
}
.data-card-value[data-positive] {
  color: var(--accent-green);
}

/* ============ 13. Exhibit Label ============ */
.exhibit-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--grid-line);
  background: var(--bg-secondary);
  padding: 4px 12px;
}

/* ============ 14. Stat ============ */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
  border-top: 1px solid var(--grid-line);
}
.stat-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============ 15. Breadcrumb ============ */
.breadcrumb {
  padding: 24px 0;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.875rem;
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
}
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  display: inline-block;
  margin: 0 12px;
  color: var(--grid-line);
  font-family: var(--font-mono);
}
.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb-item a:hover {
  color: var(--accent-orange);
}
.breadcrumb-item[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 700;
}

/* ============ 16. Tabs ============ */
.tabs {
  border: 1px solid var(--grid-line);
  background: var(--bg-secondary);
}
.tab-list {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--grid-line);
  background: var(--bg-primary);
}
.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(76, 168, 255, 0.05);
}
.tab-btn[aria-selected="true"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent-orange);
}
.tab-panel {
  padding: 28px;
}
.tab-panel[hidden] {
  display: none !important;
}

/* ============ 17. Figure / Image Container ============ */
.figure {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--grid-line);
  border-radius: 0;
}
.figure > img,
.figure > .figure-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure-16x9 {
  aspect-ratio: 16 / 9;
}
.figure-4x3 {
  aspect-ratio: 4 / 3;
}
.figure-1x1 {
  aspect-ratio: 1 / 1;
}
.figure-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 19px,
      var(--grid-line) 20px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 19px,
      var(--grid-line) 20px
    ),
    var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 24px;
}
.figure-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-top: 1px solid var(--grid-line);
  background: var(--bg-primary);
}

/* ============ 18. Reveal on Scroll ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

/* ============ 19. Utilities ============ */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
[hidden] {
  display: none !important;
}

/* ============ 20. Responsive ============ */
@media (max-width: 1100px) {
  .nav-link {
    padding: 12px 18px;
  }
  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--grid-line);
  }
}
@media (max-width: 768px) {
  .masthead {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    text-align: left;
    gap: 12px;
  }
  .masthead-brand {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .brand-symbol {
    width: 32px;
    height: 32px;
  }
  .masthead-title {
    font-size: 1rem;
    letter-spacing: 0.04em;
  }
  .masthead-tagline {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }
  .masthead-tools {
    position: static;
    top: auto;
    right: auto;
  }
  .masthead-status {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    display: none;
    border-top: 1px solid var(--grid-line);
  }
  .site-nav[data-open] {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-item {
    display: block;
  }
  .nav-item + .nav-item {
    border-left: none;
    border-top: 1px solid var(--grid-line);
  }
  .nav-link {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: none;
  }
  .nav-link[aria-current="page"] {
    border-left: 3px solid var(--accent-orange);
    background: rgba(255, 107, 53, 0.06);
  }
  .section {
    padding: 64px 0;
  }
  .section-tight {
    padding: 40px 0;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 48px 0 40px;
  }
  .footer-brand {
    grid-column: auto;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 24px;
  }
  .footer-trust {
    max-width: 100%;
  }
  .tab-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 10px 12px;
  }
  .tab-panel {
    padding: 20px 16px;
  }
}
@media (max-width: 480px) {
  .masthead-title {
    font-size: 0.9rem;
    white-space: normal;
  }
  .masthead-tagline {
    font-size: 0.65rem;
  }
  .footer-bottom {
    text-align: center;
  }
  .footer-copyright {
    font-size: 0.75rem;
    line-height: 1.6;
  }
}

/* ============ 21. Focus ============ */
:focus-visible {
  outline: 2px solid var(--highlight-blue);
  outline-offset: 2px;
}

/* ============ 22. Reduced Motion ============ */
@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;
  }
  .live-dot {
    animation: none;
    box-shadow: none;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
