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

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
blockquote,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

:root {
  --deep-blue: #1A2A3A;
  --orange: #E8502A;
  --gold: #D4A93C;
  --cream: #F5F0E6;
  --brown: #2E1A12;
  --gray: #D9D0C5;
  --green: #2A9D8F;
  --dark-red: #B8122C;
  --header-width: 280px;
  --space: 24px;
  --border-w: 3px;
  --shadow: 6px 6px 0 rgba(46, 26, 18, 0.25);
  --font-body: "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:focus-visible {
  outline: 3px dashed var(--orange);
  outline-offset: 3px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--brown);
  background-color: var(--cream);
  padding-left: var(--header-width);
}

#main-content {
  display: block;
  min-height: 65vh;
}

.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;
}

.skip-link {
  position: fixed;
  top: 0;
  left: var(--header-width);
  z-index: 300;
  padding: 10px 16px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  border: 3px solid var(--brown);
  border-top: 0;
  transform: translateY(-200%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--header-width);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  background:
    linear-gradient(rgba(212, 169, 60, 0.06), rgba(212, 169, 60, 0.06)),
    var(--deep-blue);
  color: var(--cream);
  border-right: 4px solid var(--brown);
  box-shadow: inset -10px 0 0 rgba(0, 0, 0, 0.05);
}

.header-brand {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(245, 240, 230, 0.2);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--brown);
  box-shadow: 3px 3px 0 var(--gold);
  transition: background-color 0.15s, transform 0.15s;
}

.brand-lockup:hover .brand-mark {
  background: var(--dark-red);
  transform: rotate(-3deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.header-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  color: rgba(245, 240, 230, 0.85);
  font-weight: 600;
  font-size: 15px;
  border-left: 4px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(245, 240, 230, 0.08);
  border-left-color: var(--orange);
  color: #fff;
}

.nav-link[aria-current="page"] {
  background: rgba(232, 80, 42, 0.12);
  border-left-color: var(--orange);
  color: #fff;
}

.nav-index {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  opacity: 0.7;
}

.nav-link[aria-current="page"] .nav-index {
  opacity: 1;
}

.header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 2px solid rgba(245, 240, 230, 0.15);
}

.btn-action {
  display: block;
  text-align: center;
  padding: 9px 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  border: 2px solid var(--brown);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-action:hover {
  background: var(--dark-red);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}

.btn-action-quiet {
  background: var(--cream);
  color: var(--brown);
}

.btn-action-quiet:hover {
  background: var(--gold);
  color: var(--brown);
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid rgba(245, 240, 230, 0.15);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(245, 240, 230, 0.7);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.4);
}

.header-icp {
  color: rgba(245, 240, 230, 0.55);
}

.nav-toggle {
  display: none;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-toggle-box span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-text {
  font-size: 13px;
  font-weight: 700;
}

.header-progress {
  position: fixed;
  top: 0;
  left: var(--header-width);
  right: 0;
  height: 4px;
  z-index: 150;
  pointer-events: none;
}

.header-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.site-footer {
  background: var(--deep-blue);
  color: var(--cream);
  border-top: 4px solid var(--brown);
  padding: 40px var(--space) 24px;
  box-shadow: inset 0 8px 0 rgba(0, 0, 0, 0.06);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.4fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.footer-sub {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.footer-about {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(245, 240, 230, 0.8);
  border-left: 3px solid var(--orange);
  padding-left: 12px;
}

.footer-contact {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.footer-contact-cell {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}

.footer-contact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
}

.footer-contact dd {
  margin: 0;
  color: rgba(245, 240, 230, 0.9);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 2px solid rgba(245, 240, 230, 0.2);
}

.footer-copyright,
.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(245, 240, 230, 0.7);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

.footer-link {
  color: var(--cream);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 48px 0 24px;
  margin-bottom: 32px;
  border-bottom: 4px solid var(--brown);
}

.page-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--deep-blue);
}

.page-lede {
  max-width: 640px;
  font-size: 17px;
  border-left: 3px solid var(--orange);
  padding-left: 14px;
}

.section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gray);
}

.index-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--orange);
  letter-spacing: 0.06em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.grid-span-4,
.grid-span-5,
.grid-span-6,
.grid-span-7,
.grid-span-8 {
  grid-column: span 12;
}

.panel {
  background: var(--cream);
  border: 3px solid var(--brown);
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel-dark {
  background: var(--deep-blue);
  color: var(--cream);
}

.panel-orange {
  border-color: var(--orange);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-weight: 700;
  border: 2px solid var(--brown);
  box-shadow: 4px 4px 0 var(--brown);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--brown);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--brown);
}

.btn:active {
  transform: translate(0, 0);
  box-shadow: 2px 2px 0 var(--brown);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--deep-blue);
  border: 1px solid currentColor;
}

.tag-gold {
  background: var(--gold);
  border-color: var(--brown);
  color: var(--brown);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--deep-blue);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--orange);
}

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

.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--gray);
  border: 3px solid var(--brown);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.media-frame-4-3 {
  aspect-ratio: 4 / 3;
}

.media-frame-square {
  aspect-ratio: 1 / 1;
}

.media-frame-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  background: var(--deep-blue);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
}

.timeline {
  position: relative;
  margin: 24px 0;
  padding-left: 24px;
  border-left: 3px solid var(--deep-blue);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--orange);
  border: 2px solid var(--brown);
}

.timeline-item time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--orange);
}

.callout {
  padding: 16px 20px;
  background: var(--gray);
  border-left: 6px solid var(--orange);
  box-shadow: 4px 4px 0 var(--brown);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 1px solid var(--brown);
  vertical-align: 0;
}

.legend-dot--orange {
  background: var(--orange);
}

.legend-dot--green {
  background: var(--green);
}

.legend-dot--gold {
  background: var(--gold);
}

.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 32px;
  margin-bottom: 16px;
  padding-left: 12px;
  font-size: 24px;
  font-weight: 900;
  border-left: 4px solid var(--orange);
}

.prose p {
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table caption {
  caption-side: bottom;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--deep-blue);
}

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

.data-table thead th {
  background: var(--deep-blue);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: var(--gray);
}

.data-table .num {
  font-family: var(--font-mono);
  text-align: right;
}

.ticker {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--deep-blue);
  color: var(--cream);
  border: 3px solid var(--brown);
  box-shadow: 4px 4px 0 rgba(46, 26, 18, 0.2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.ticker__label {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  border-right: 2px solid var(--brown);
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 6px 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.ticker__item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ticker__item strong {
  color: var(--gold);
}

@media (min-width: 640px) {
  .grid-span-4,
  .grid-span-5,
  .grid-span-6,
  .grid-span-7,
  .grid-span-8 {
    grid-column: span 6;
  }
}

@media (min-width: 1024px) {
  .grid-span-4 {
    grid-column: span 4;
  }
  .grid-span-5 {
    grid-column: span 5;
  }
  .grid-span-6 {
    grid-column: span 6;
  }
  .grid-span-7 {
    grid-column: span 7;
  }
  .grid-span-8 {
    grid-column: span 8;
  }
}

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

  .skip-link {
    left: 16px;
  }

  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 3px solid var(--brown);
  }

  .header-brand {
    flex: 1;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .brand-name {
    font-size: 20px;
  }

  .brand-sub {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: #fff;
    background: var(--orange);
    border: 2px solid var(--brown);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
  }

  .header-nav {
    display: none;
    order: 10;
    flex-basis: 100%;
    width: 100%;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--brown);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .header-nav[data-open] {
    display: flex;
  }

  .header-actions {
    margin-top: 0;
  }

  .header-meta {
    display: none;
  }

  .header-progress {
    left: 0;
    right: auto;
    width: 100%;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-nav {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
