/* ============ 01 RESET & VARIABLES ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(57, 255, 20, 0.04) 0%, transparent 30%),
    linear-gradient(210deg, rgba(255, 107, 53, 0.03) 0%, transparent 40%),
    #0D1B2A;
  color: #E0E1DD;
  font-family: "Noto Sans SC", "Source Sans Pro", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: #39FF14;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus-visible {
  color: #FF6B35;
}

ul, ol {
  list-style: none;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  color: #F4EAE0;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #39FF14;
  color: #0D1B2A;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0D1B2A;
}

::-webkit-scrollbar-thumb {
  background: #22374B;
  border-radius: 2px;
}

:root {
  --bg: #0D1B2A;
  --bg-card: #1B2A3A;
  --bg-raised: #22374B;
  --green: #39FF14;
  --green-dim: rgba(57, 255, 20, 0.14);
  --orange: #FF6B35;
  --moss: #6A8D73;
  --terracotta: #E07A5F;
  --steel: #4A6D8C;
  --text: #E0E1DD;
  --heading: #F4EAE0;
  --border-glass: rgba(224, 225, 221, 0.12);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font-heading: "Oswald", Impact, "Arial Black", sans-serif;
  --font-body: "Noto Sans SC", "Source Sans Pro", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "Courier New", monospace;
  --content-max: 1280px;
  --radius: 2px;
}

/* ============ 02 TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F4EAE0;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

.mono {
  font-family: "Roboto Mono", "Courier New", monospace;
}

.num {
  font-family: "Roboto Mono", "Courier New", monospace;
  font-weight: 700;
  color: #39FF14;
}

.text-green { color: #39FF14; }
.text-orange { color: #FF6B35; }
.text-steel { color: #4A6D8C; }

.prose p {
  text-align: justify;
  margin-bottom: 1.2rem;
}

.prose h2, .prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ============ 03 LAYOUT HELPERS ============ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-space {
  padding: 64px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.list-check li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 5px;
  border-left: 2px solid #39FF14;
  border-bottom: 2px solid #39FF14;
  transform: rotate(-45deg);
}

/* ============ 04 SKIP LINK ============ */
.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 200;
  background: #FF6B35;
  color: #0D1B2A;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 12px;
  color: #0D1B2A;
}

/* ============ 05 HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 27, 42, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(224, 225, 221, 0.12);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: repeating-linear-gradient(90deg,
    #39FF14 0px, #39FF14 40px,
    #4A6D8C 40px, #4A6D8C 80px,
    #FF6B35 80px, #FF6B35 100px,
    transparent 100px, transparent 128px);
  opacity: 0.85;
  pointer-events: none;
}

.header-shell {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(224, 225, 221, 0.12);
  font-size: 13px;
}

.header-tagline {
  margin: 0;
  color: #4A6D8C;
  letter-spacing: 0.4px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #39FF14;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #39FF14;
  border-radius: 50%;
  box-shadow: 0 0 8px #39FF14;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 0 10px;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #F4EAE0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #39FF14;
  color: #0D1B2A;
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  border-radius: 2px;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%);
}

.brand-text {
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-brand:hover .brand-text {
  color: #39FF14;
}

/* ============ 06 NAV ============ */
.site-nav {
  position: relative;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 12px;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #E0E1DD;
  border-radius: 2px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: #39FF14;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: #39FF14;
  background: rgba(57, 255, 20, 0.14);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: #39FF14;
}

/* ============ 07 FOOTER ============ */
.site-footer {
  position: relative;
  background: #0A1520;
  border-top: 1px solid rgba(224, 225, 221, 0.12);
  margin-top: 80px;
}

.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg,
    #39FF14 0px, #39FF14 80px,
    #4A6D8C 80px, #4A6D8C 160px,
    #FF6B35 160px, #FF6B35 200px,
    transparent 200px, transparent 100%);
}

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

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 32px;
}

.footer-brand-name {
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #F4EAE0;
  margin-bottom: 6px;
}

.footer-tagline {
  color: #4A6D8C;
  font-size: 14px;
  margin-bottom: 0;
}

.footer-heading {
  font-size: 13px;
  letter-spacing: 2px;
  color: #4A6D8C;
  margin-bottom: 14px;
  position: relative;
  padding-left: 12px;
  text-transform: uppercase;
}

.footer-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: #FF6B35;
}

.footer-list li + li {
  margin-top: 8px;
}

.footer-list a {
  color: #E0E1DD;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: #39FF14;
}

.footer-contact-line {
  font-size: 14px;
  margin-bottom: 8px;
  color: #E0E1DD;
  word-break: break-all;
}

.footer-trust {
  border-top: 1px solid rgba(224, 225, 221, 0.12);
  padding: 20px 0;
  color: #4A6D8C;
  font-size: 13px;
  text-align: center;
  margin-bottom: 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 20px;
  border-top: 1px solid rgba(224, 225, 221, 0.06);
  color: #4A6D8C;
  font-size: 13px;
}

.footer-bottom p {
  margin-bottom: 0;
}

.footer-icp {
  color: #4A6D8C;
}

/* ============ 08 BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  color: #0D1B2A;
  background: #39FF14;
  border: 1px solid #39FF14;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  line-height: 1.4;
}

.btn:hover {
  opacity: 0.9;
  color: #0D1B2A;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

.btn:active {
  transform: scale(0.97);
}

.btn-outline {
  background: transparent;
  color: #39FF14;
  border-color: #39FF14;
}

.btn-outline:hover {
  background: rgba(57, 255, 20, 0.14);
  color: #39FF14;
  box-shadow: none;
}

.btn-cta {
  background: #FF6B35;
  border-color: #FF6B35;
}

.btn-cta:hover {
  color: #0D1B2A;
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.35);
}

/* ============ 09 BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 16px 0;
  font-size: 13px;
  color: #4A6D8C;
}

.breadcrumb a {
  color: #4A6D8C;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: #39FF14;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: 8px;
  color: #4A6D8C;
  opacity: 0.5;
}

.breadcrumb [aria-current="page"] {
  color: #F4EAE0;
}

/* ============ 10 CHAPTERS ============ */
.chapter {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 32px;
  margin-top: 64px;
  border-left: 1px solid rgba(224, 225, 221, 0.12);
  padding-left: 24px;
}

.chapter:first-of-type {
  margin-top: 0;
}

.chapter-num {
  font-family: "Roboto Mono", "Courier New", monospace;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  letter-spacing: -2px;
  color: transparent;
  -webkit-text-stroke: 1px #39FF14;
}

.chapter-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.chapter-sub {
  color: #4A6D8C;
  font-size: 14px;
  margin-bottom: 16px;
}

.chapter-body {
  min-width: 0;
}

/* ============ 11 DATA CARDS & BENTO ============ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-item {
  grid-column: span 4;
  min-width: 0;
}

.bento-item.wide {
  grid-column: span 8;
}

.bento-item.full {
  grid-column: span 12;
}

.data-card {
  background: #1B2A3A;
  border: 1px solid rgba(224, 225, 221, 0.12);
  border-radius: 2px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%;
}

.data-card:hover {
  border-color: rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.15), 0 8px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.data-score {
  font-family: "Roboto Mono", "Courier New", monospace;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  color: #39FF14;
  letter-spacing: -1px;
}

.data-label {
  display: inline-block;
  font-family: "Roboto Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4A6D8C;
  margin-bottom: 8px;
  border: 1px solid rgba(224, 225, 221, 0.12);
  padding: 2px 6px;
  border-radius: 2px;
}

.chip {
  display: inline-block;
  background: #E07A5F;
  color: #0D1B2A;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

/* ============ 12 FILTER ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 16px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-family: "Noto Sans SC", "Source Sans Pro", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #E0E1DD;
  background: #1B2A3A;
  border: 1px solid rgba(224, 225, 221, 0.12);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
  border-color: #39FF14;
  color: #39FF14;
}

.filter-btn.is-active {
  background: #39FF14;
  border-color: #39FF14;
  color: #0D1B2A;
  font-weight: 700;
}

/* ============ 13 TABLES ============ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(224, 225, 221, 0.12);
  border-radius: 2px;
  background: #1B2A3A;
}

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

.table th,
.table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(224, 225, 221, 0.12);
  white-space: nowrap;
}

.table th {
  background: #22374B;
  color: #F4EAE0;
  font-family: "Oswald", Impact, "Arial Black", sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

.table .num {
  color: #39FF14;
  font-family: "Roboto Mono", "Courier New", monospace;
  font-weight: 700;
}

/* ============ 14 MEDIA FRAME & FRAME SCREEN ============ */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(135deg, #22374B, #1B2A3A);
  border: 1px solid rgba(224, 225, 221, 0.12);
  aspect-ratio: 16 / 9;
}

.media-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.media-frame:hover::before {
  opacity: 1;
}

.frame-screen {
  position: relative;
  border: 1px solid rgba(224, 225, 221, 0.12);
  border-radius: 2px;
  padding: clamp(20px, 4vw, 48px);
  background: #1B2A3A;
  overflow: hidden;
}

.frame-screen::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(224, 225, 221, 0.14);
  pointer-events: none;
  z-index: 0;
}

.frame-screen::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 5px;
  background: repeating-linear-gradient(90deg,
    #39FF14 0 6px, transparent 6px 8px,
    #4A6D8C 8px 14px, transparent 14px 16px,
    #FF6B35 16px 22px, transparent 22px 24px,
    #4A6D8C 24px 30px, transparent 30px 40px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.frame-screen > * {
  position: relative;
  z-index: 1;
}

.measure-bar {
  height: 6px;
  background: repeating-linear-gradient(90deg, #4A6D8C 0 6px, transparent 6px 12px);
  opacity: 0.4;
}

/* ============ 15 FIELDS & NOTICE ============ */
.field {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(224, 225, 221, 0.12);
}

.field:last-child {
  border-bottom: none;
}

.field-label {
  color: #4A6D8C;
  font-size: 13px;
}

.field-value {
  color: #E0E1DD;
  font-size: 14px;
  font-weight: 600;
}

.notice-box {
  border-left: 3px solid #6A8D73;
  background: rgba(106, 141, 115, 0.08);
  padding: 16px 20px;
  font-size: 14px;
  color: #E0E1DD;
  margin: 16px 0;
}

/* ============ 16 UTILITIES ============ */
.section-space {
  padding: 64px 0;
}

/* ============ 17 SCROLL PROGRESS ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 300;
  background: transparent;
  pointer-events: none;
}

.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #39FF14, #FF6B35);
}

/* ============ 18 FOCUS & REDUCED MOTION ============ */
:focus-visible {
  outline: 2px solid #39FF14;
  outline-offset: 2px;
}

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

  .status-dot {
    animation: none;
  }
}

/* ============ 19 RESPONSIVE ============ */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .bento-item {
    grid-column: span 6;
  }

  .bento-item.wide {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .header-shell {
    padding: 0 16px;
  }

  .header-main {
    padding: 12px 0;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(224, 225, 221, 0.12);
    border-radius: 2px;
    background: #1B2A3A;
    cursor: pointer;
    flex-shrink: 0;
  }

  .nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #39FF14;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

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

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

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0D1B2A;
    border-bottom: 1px solid rgba(224, 225, 221, 0.12);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, visibility 0s linear 0.3s;
  }

  .site-nav[data-open] {
    max-height: 520px;
    visibility: visible;
    transition: max-height 0.3s ease, visibility 0s;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
  }

  .nav-link {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(224, 225, 221, 0.12);
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .brand-text {
    font-size: 17px;
    letter-spacing: 0.5px;
  }

  .chapter {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 16px;
  }

  .chapter-num {
    text-align: left;
    font-size: 36px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .header-tagline {
    font-size: 12px;
  }

  .header-status {
    font-size: 11px;
  }

  .filter-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .container {
    padding: 0 16px;
  }
}
