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

* {
  margin: 0;
  padding: 0;
}

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

body {
  margin: 0;
  margin-left: var(--rail-width);
  background: var(--ivory);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

:root {
  --pitch-deep-green: #0B3B2E;
  --trophy-gold: #D4A017;
  --energy-orange: #FF6B35;
  --ivory: #F9F6F0;
  --mineral-slate: #4B5563;
  --clay-red: #B3541E;
  --moss-green: #6A8D73;
  --pale-teal: #DFEBE3;
  --night-black: #111827;
  --pure-white: #FFFFFF;

  --rail-width: 180px;
  --header-h-mobile: 64px;

  --font-heading: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Microsoft YaHei", sans-serif;
  --font-data: "DIN Alternate", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;

  --color-text: var(--mineral-slate);
  --color-text-invert: rgba(249, 246, 240, 0.85);
  --shadow-card: 8px 8px 0 rgba(11, 59, 46, 0.14);
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

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

a {
  color: inherit;
}

::selection {
  background: rgba(255, 107, 53, 0.35);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: calc(var(--rail-width) + 8px);
  z-index: 3000;
  background: var(--energy-orange);
  color: var(--night-black);
  font-weight: 800;
  padding: 8px 16px;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  transform: translateY(-220%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--night-black);
}

.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--pitch-deep-green);
  border-right: 3px solid var(--trophy-gold);
  overflow: visible;
}

.brand-block {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo toggle"
    "sub toggle";
  align-items: center;
  flex-shrink: 0;
  padding: 24px 16px 18px;
  border-bottom: 2px solid rgba(212, 160, 23, 0.28);
}

.brand-block::before,
.brand-block::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-block::before {
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(212, 160, 23, 0.5);
}

.brand-block::after {
  top: 22px;
  right: 22px;
  width: 10px;
  height: 10px;
  background: rgba(255, 107, 53, 0.55);
}

.brand-logo {
  grid-area: logo;
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--ivory);
  text-decoration: none;
}

.brand-logo strong {
  color: var(--trophy-gold);
  font-weight: 900;
}

.brand-sub {
  grid-area: sub;
  margin-top: 8px;
  padding-left: 8px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(249, 246, 240, 0.62);
  border-left: 2px solid var(--trophy-gold);
}

.nav-toggle {
  grid-area: toggle;
  display: none;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(212, 160, 23, 0.6);
  background: transparent;
  transition: border-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--trophy-gold);
}

.nav-toggle__box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 14px;
  align-items: stretch;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--trophy-gold);
  transition: transform 0.25s ease;
}

.nav-toggle.is-active .nav-toggle__bar:first-child {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

.rail-nav-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 160, 23, 0.35) transparent;
}

.rail-menu {
  counter-reset: rail-item;
}

.rail-menu li {
  counter-increment: rail-item;
}

.rail-menu__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(249, 246, 240, 0.82);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rail-menu__link::before {
  content: counter(rail-item, decimal-leading-zero);
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(212, 160, 23, 0.8);
}

.rail-menu__link:hover {
  background: rgba(212, 160, 23, 0.12);
  color: var(--trophy-gold);
  border-left-color: var(--trophy-gold);
}

.rail-menu__link[aria-current="page"] {
  background: rgba(212, 160, 23, 0.18);
  color: var(--trophy-gold);
  border-left-color: var(--trophy-gold);
}

.rail-actions {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-top: 2px solid rgba(212, 160, 23, 0.25);
}

.rail-meta {
  position: relative;
  margin: 12px 16px;
  padding: 12px 12px 12px 16px;
  background: rgba(6, 32, 25, 0.6);
  border: 2px solid rgba(212, 160, 23, 0.28);
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(249, 246, 240, 0.72);
}

.rail-meta::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  bottom: -2px;
  width: 4px;
  background: var(--energy-orange);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  right: 0;
  height: 4px;
  z-index: 2000;
  background: linear-gradient(90deg, var(--trophy-gold), var(--energy-orange));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--ivory);
  border: 2px solid var(--pitch-deep-green);
  color: var(--pitch-deep-green);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--trophy-gold);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 var(--trophy-gold);
}

.btn-score {
  background: var(--energy-orange);
  border-color: var(--energy-orange);
  color: var(--pure-white);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.btn-score .btn__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pure-white);
}

.btn-score:hover {
  background: #E95F2F;
  border-color: #E95F2F;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.btn-legacy {
  background: transparent;
  border-color: var(--trophy-gold);
  color: var(--trophy-gold);
  box-shadow: none;
}

.btn-legacy:hover {
  background: rgba(212, 160, 23, 0.15);
  box-shadow: none;
}

.site-main {
  min-height: 65vh;
}

.content-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-head {
  margin-bottom: 40px;
}

.page-head__label {
  font-family: var(--font-data);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay-red);
}

.page-head__title {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
  color: var(--pitch-deep-green);
}

.page-head__lead {
  margin-top: 16px;
  max-width: 72ch;
  font-size: 1.125rem;
  color: var(--mineral-slate);
}

.section {
  margin: 64px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-index {
  font-family: var(--font-data);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  color: var(--trophy-gold);
}

.section-title {
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  color: var(--pitch-deep-green);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 20px;
  font-size: 0.75rem;
  color: var(--mineral-slate);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--moss-green);
}

.breadcrumbs a {
  color: var(--pitch-deep-green);
  text-decoration: none;
  border-bottom: 1px solid var(--moss-green);
}

.breadcrumbs a:hover {
  color: var(--clay-red);
  border-bottom-color: var(--clay-red);
}

.breadcrumbs [aria-current="page"] {
  color: var(--clay-red);
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--ivory);
  border: 3px solid var(--pitch-deep-green);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card--teal {
  background: var(--pale-teal);
  border-color: var(--moss-green);
}

.card--dark {
  background: var(--night-black);
  border-color: var(--trophy-gold);
  color: rgba(249, 246, 240, 0.85);
}

.card--gold {
  background: var(--trophy-gold);
  border-color: var(--night-black);
}

.tile {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--pale-teal);
  border: 2px solid var(--moss-green);
}

.tile__index {
  font-family: var(--font-data);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--trophy-gold);
}

.tile__title {
  font-weight: 800;
  color: var(--pitch-deep-green);
}

.tile__text {
  font-size: 0.875rem;
  color: var(--mineral-slate);
}

.image-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--pale-teal);
  border: 3px solid var(--pitch-deep-green);
  box-shadow: 8px 8px 0 rgba(11, 59, 46, 0.16);
}

.image-frame::before {
  content: "";
  display: block;
  padding-top: 62.5%;
}

.image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-frame--square::before {
  padding-top: 100%;
}

.image-frame--wide::before {
  padding-top: 46.8%;
}

.image-frame--tall::before {
  padding-top: 125%;
}

.image-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 6px 12px 6px 14px;
  background: rgba(11, 59, 46, 0.88);
  color: var(--ivory);
  font-size: 0.75rem;
  line-height: 1.4;
  border-left: 3px solid var(--energy-orange);
}

.patch-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-areas:
    "hero side-a"
    "hero side-b";
  gap: 16px;
}

.patch-grid__main {
  grid-area: hero;
}

.patch-grid__side-a {
  grid-area: side-a;
}

.patch-grid__side-b {
  grid-area: side-b;
}

.prose {
  max-width: 76ch;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--mineral-slate);
}

.prose h2,
.prose h3,
.prose h4 {
  font-weight: 900;
  color: var(--pitch-deep-green);
  margin: 1.6em 0 0.4em;
}

.prose h2 {
  font-size: 1.75rem;
}

.prose h3 {
  font-size: 1.35rem;
}

.prose p {
  margin-bottom: 1.2em;
}

.prose a {
  color: var(--clay-red);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose a:hover {
  color: var(--pitch-deep-green);
}

.prose strong {
  font-weight: 800;
  color: var(--pitch-deep-green);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em 1.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose blockquote {
  padding-left: 16px;
  border-left: 4px solid var(--trophy-gold);
  font-size: 1.125rem;
  color: var(--mineral-slate);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ivory);
  border: 3px solid var(--pitch-deep-green);
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 2px solid var(--pale-teal);
  text-align: left;
}

.data-table thead th {
  background: var(--pitch-deep-green);
  color: var(--ivory);
  font-size: 0.75rem;
  font-weight: 800;
}

.data-table .num {
  font-family: var(--font-data);
  font-size: 1rem;
  font-weight: 700;
  color: var(--trophy-gold);
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-filter a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--pale-teal);
  border: 2px solid var(--moss-green);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pitch-deep-green);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tag-filter a:hover,
.tag-filter a[aria-current="true"] {
  background: var(--pitch-deep-green);
  border-color: var(--pitch-deep-green);
  color: var(--trophy-gold);
}

.accordion {
  display: grid;
  gap: 12px;
}

.accordion details {
  background: var(--ivory);
  border: 2px solid var(--moss-green);
  box-shadow: 4px 4px 0 rgba(11, 59, 46, 0.1);
}

.accordion summary {
  position: relative;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--pitch-deep-green);
  cursor: pointer;
}

.accordion summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  font-family: var(--font-data);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--trophy-gold);
}

.accordion details[open] summary::after {
  content: "–";
}

.accordion-content {
  padding: 0 16px 14px;
  color: var(--mineral-slate);
  border-top: 2px solid var(--pale-teal);
}

.site-footer {
  margin-top: 72px;
  background: var(--night-black);
  color: rgba(249, 246, 240, 0.78);
  border-top: 4px solid var(--trophy-gold);
}

.footer-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 0;
}

.footer-logo {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--ivory);
}

.footer-logo span {
  color: var(--trophy-gold);
}

.footer-slogan {
  font-size: 0.875rem;
  color: rgba(249, 246, 240, 0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding: 28px 0;
  border-top: 2px solid rgba(212, 160, 23, 0.25);
  border-bottom: 2px solid rgba(212, 160, 23, 0.25);
}

.footer-title {
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--trophy-gold);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  color: rgba(249, 246, 240, 0.84);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--trophy-gold);
}

.footer-contact-line,
.footer-address {
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: rgba(249, 246, 240, 0.65);
}

.footer-icp {
  margin-top: 14px;
  font-size: 0.75rem;
  color: rgba(249, 246, 240, 0.55);
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding-top: 20px;
  font-size: 0.75rem;
  color: rgba(249, 246, 240, 0.55);
}

.footer-copy {
  margin: 0;
}

@media (max-width: 900px) {
  body {
    margin-left: 0;
    padding-top: 108px;
  }

  .skip-link {
    left: 8px;
  }

  .scroll-progress {
    left: 0;
  }

  .site-header {
    inset: 0 0 auto 0;
    width: auto;
    height: auto;
    flex-direction: column;
    border-right: none;
    border-bottom: 3px solid var(--trophy-gold);
  }

  .brand-block {
    flex: none;
    height: var(--header-h-mobile);
    padding: 0 8px 0 16px;
    border-bottom: 2px solid rgba(212, 160, 23, 0.25);
    align-items: center;
  }

  .brand-block::before,
  .brand-block::after {
    display: none;
  }

  .brand-sub {
    display: none;
  }

  .brand-logo {
    font-size: 1.25rem;
  }

  .nav-toggle {
    display: none;
  }

  .rail-nav-panel {
    position: static;
    flex: none;
    width: 100%;
    height: 44px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    padding: 0;
    transform: none;
    box-shadow: none;
    border: none;
    background: rgba(6, 32, 25, 0.5);
  }

  .rail-nav {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .rail-menu {
    display: flex;
    justify-content: space-around;
    white-space: nowrap;
  }

  .rail-menu__link {
    padding: 10px 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .rail-menu__link:hover,
  .rail-menu__link[aria-current="page"] {
    border-left-color: transparent;
    border-bottom-color: var(--energy-orange);
  }

  .rail-actions,
  .rail-meta {
    display: none;
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 600px) {
  body {
    padding-top: var(--header-h-mobile);
  }

  .site-header {
    height: var(--header-h-mobile);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .rail-nav-panel {
    position: fixed;
    top: var(--header-h-mobile);
    left: 0;
    bottom: 0;
    width: 280px;
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 16px;
    background: var(--pitch-deep-green);
    border-right: 3px solid var(--trophy-gold);
    transform: translateX(-103%);
    transition: transform 0.3s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    z-index: 1100;
  }

  .rail-nav-panel[data-open] {
    transform: translateX(0);
  }

  .rail-nav {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
  }

  .rail-menu {
    display: block;
    white-space: normal;
  }

  .rail-menu__link {
    padding: 11px 16px;
    border-left: 4px solid transparent;
    border-bottom: none;
  }

  .rail-menu__link:hover,
  .rail-menu__link[aria-current="page"] {
    border-left-color: var(--trophy-gold);
    border-bottom-color: transparent;
  }

  .rail-actions {
    display: grid;
  }

  .rail-meta {
    display: block;
  }

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

  .patch-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "side-a"
      "side-b";
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-legal {
    flex-direction: column;
  }
}

@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;
    transition-delay: 0ms !important;
  }

  .scroll-progress {
    display: none !important;
  }
}
