:root {
  --deep-blue: #0B1E3A;
  --midnight-indigo: #1B2A4A;
  --jewel-teal: #0E5F6B;
  --bright-orange: #FF6B35;
  --warm-amber: #FFA733;
  --ice-white: #E8F0F8;
  --warm-gray: #F5F7FA;
  --ink: #1F2933;

  --font-heading: "Noto Sans SC", "DIN Alternate", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 18px;
  --text-lg: 24px;
  --text-xl: 36px;
  --text-2xl: 60px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  --header-width: 280px;
  --content-max: 1200px;
  --content-pad: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--warm-gray);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.25;
  color: var(--deep-blue);
  margin: 0 0 var(--space-3) 0;
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-md);
}

p {
  margin: 0 0 var(--space-3) 0;
}

a {
  color: var(--jewel-teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 200ms ease;
}

a:hover {
  color: var(--bright-orange);
}

:focus-visible {
  outline: 2px solid var(--bright-orange);
  outline-offset: 3px;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul,
ol {
  padding-left: 1.4em;
  margin-bottom: var(--space-3);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 3000;
  padding: 12px 20px;
  background: var(--bright-orange);
  color: var(--deep-blue);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  transition: top 200ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--header-width);
  background-color: var(--deep-blue);
  color: var(--ice-white);
  font-family: var(--font-heading);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(14, 95, 107, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(14, 95, 107, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--ice-white);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bright-orange);
  color: var(--deep-blue);
  font-weight: 900;
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  border-radius: 2px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: var(--text-lg);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--ice-white);
}

.brand-tagline {
  font-size: 11px;
  font-family: var(--font-mono);
  color: rgba(232, 240, 248, 0.55);
  letter-spacing: 0.12em;
  margin-top: 2px;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
}

.site-nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: var(--space-4) 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: rgba(232, 240, 248, 0.72);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.nav-link:hover {
  color: var(--ice-white);
  background-color: rgba(27, 42, 74, 0.55);
  border-left-color: var(--bright-orange);
  transform: translateX(3px);
}

.nav-link:focus-visible {
  outline: 2px solid var(--bright-orange);
  outline-offset: -2px;
}

.nav-link[aria-current="page"] {
  color: var(--ice-white);
  background-color: rgba(14, 95, 107, 0.25);
  border-left-color: var(--bright-orange);
  font-weight: 700;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(232, 240, 248, 0.4);
  letter-spacing: 0.08em;
  min-width: 24px;
}

.header-foot {
  padding: var(--space-4);
  border-top: 1px solid rgba(14, 95, 107, 0.3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.user-zone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.35);
  border-radius: 2px;
  color: var(--ice-white);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-heading);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.user-zone:hover {
  background: rgba(255, 107, 53, 0.22);
  border-color: var(--bright-orange);
  color: var(--ice-white);
}

.user-zone-badge {
  color: var(--bright-orange);
  font-size: var(--text-sm);
  line-height: 1;
}

.user-zone-label {
  letter-spacing: 0.04em;
}

.header-foot-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(232, 240, 248, 0.4);
  letter-spacing: 0.04em;
}

.site-footer {
  background-color: var(--deep-blue);
  color: rgba(232, 240, 248, 0.72);
  font-family: var(--font-heading);
  position: relative;
}

.site-footer::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--jewel-teal), rgba(14, 95, 107, 0.2));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1.3fr;
  gap: var(--space-6);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--content-pad) var(--space-5);
}

.footer-brand-name {
  display: block;
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--ice-white);
  letter-spacing: 0.04em;
}

.footer-brand-tagline {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: rgba(232, 240, 248, 0.5);
}

.footer-trust {
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: rgba(232, 240, 248, 0.55);
  max-width: 34em;
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm-amber);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(14, 95, 107, 0.35);
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.footer-list a {
  color: rgba(232, 240, 248, 0.7);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 200ms ease;
}

.footer-list a:hover {
  color: var(--bright-orange);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-3) var(--content-pad);
  border-top: 1px solid rgba(14, 95, 107, 0.25);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(232, 240, 248, 0.45);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bright-orange);
  color: var(--deep-blue);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--bright-orange);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.btn:hover {
  background: var(--warm-amber);
  border-color: var(--warm-amber);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--bright-orange);
  outline-offset: 3px;
}

.btn-secondary {
  background: transparent;
  color: var(--ice-white);
  border-color: rgba(232, 240, 248, 0.35);
}

.btn-secondary:hover {
  background: rgba(232, 240, 248, 0.1);
  border-color: var(--ice-white);
  color: var(--ice-white);
  transform: translateY(-2px);
}

.btn-teal {
  background: var(--jewel-teal);
  border-color: var(--jewel-teal);
  color: var(--ice-white);
}

.btn-teal:hover {
  background: #0a4a52;
  border-color: #0a4a52;
  color: var(--ice-white);
  transform: translateY(-2px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  list-style: none;
  margin: 0;
  color: rgba(15, 30, 58, 0.5);
}

.breadcrumb a {
  color: var(--jewel-teal);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--bright-orange);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: var(--space-2);
  color: rgba(15, 30, 58, 0.3);
}

.section-annotation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jewel-teal);
}

.section-index {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--bright-orange);
  letter-spacing: 0.06em;
}

.chapter {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-5);
}

.chapter::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: var(--space-2);
  width: 2px;
  background: var(--jewel-teal);
}

.annotation {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid rgba(14, 95, 107, 0.3);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--jewel-teal);
  background: transparent;
}

.card {
  background: var(--midnight-indigo);
  border: 1px solid rgba(14, 95, 107, 0.2);
  border-radius: 2px;
  padding: var(--space-4);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  border-color: rgba(14, 95, 107, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.grid-asym {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
}

.grid-1-3 {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--space-5);
}

.data-stat {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: var(--text-xl);
  color: var(--deep-blue);
  line-height: 1.1;
}

.data-stat[data-accent="orange"] {
  color: var(--bright-orange);
}

.figure {
  position: relative;
  margin: 0 0 var(--space-4) 0;
  background: var(--midnight-indigo);
  border: 1px solid rgba(14, 95, 107, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure-figcaption {
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(232, 240, 248, 0.65);
  background: rgba(11, 30, 58, 0.85);
  border-top: 1px solid rgba(14, 95, 107, 0.3);
}

[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 600ms ease, transform 600ms ease;
}

html.reveal-ready [data-reveal]:not([data-revealed="true"]) {
  opacity: 0;
  transform: translateY(18px);
}

html.reveal-ready [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(14, 95, 107, 0.35);
  }

  .header-inner {
    padding: 10px var(--space-4);
    position: relative;
    z-index: 1200;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .brand-name {
    font-size: var(--text-md);
  }

  .brand-tagline {
    font-size: 10px;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(232, 240, 248, 0.25);
    border-radius: 2px;
    transition: border-color 200ms ease, background-color 200ms ease;
  }

  .nav-toggle:hover {
    border-color: var(--bright-orange);
    background: rgba(255, 107, 53, 0.1);
  }

  .nav-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 18px;
  }

  .nav-toggle-icon span {
    display: block;
    height: 2px;
    background: var(--ice-white);
    border-radius: 1px;
    transition: transform 220ms ease, opacity 200ms ease, background-color 200ms ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    height: 100vh;
    flex: none;
    padding-top: 72px;
    background: var(--deep-blue);
    border-left: 1px solid rgba(14, 95, 107, 0.35);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 260ms ease;
    z-index: 1100;
    overflow-y: auto;
  }

  .site-nav[data-open="true"] {
    transform: translateX(0);
  }

  .nav-list {
    padding: var(--space-3) 0;
  }

  .nav-link {
    font-size: var(--text-md);
    padding: var(--space-3) var(--space-4);
  }

  .header-foot {
    display: none;
  }
}

@media (max-width: 767px) {
  :root {
    --content-pad: 18px;
    --text-2xl: 42px;
    --text-xl: 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-5) var(--content-pad) var(--space-4);
  }

  .grid-asym,
  .grid-1-3 {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  main,
  .site-footer {
    margin-left: var(--header-width);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html.reveal-ready [data-reveal]:not([data-revealed="true"]) {
    opacity: 1;
    transform: none;
  }

  .site-nav {
    transition: none;
  }

  .nav-toggle-icon span {
    transition: none;
  }
}
