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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--color-night-900);
  color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

ul[class], ol[class] {
  list-style: none;
}

/* ========== VARIABLES ========== */
:root {
  --color-night-900: #0a1428;
  --color-night-700: #12264a;
  --color-neon: #39ff14;
  --color-orange: #ff6b00;
  --color-paper: #f5efe6;
  --color-ink: #0d1117;
  --color-steel: #8899aa;
  --color-white: #ffffff;
  --color-border-light: #e0e5ec;

  --font-head: 'Archivo Black', 'Noto Sans SC', 'Arial', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Roboto Mono', 'SFMono-Regular', 'Consolas', monospace;

  --container-width: 1200px;
  --header-height: 72px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

/* ========== FOCUS ========== */
:focus-visible {
  outline: 3px solid var(--color-neon);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 2000;
  background: var(--color-neon);
  color: var(--color-ink);
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}

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

/* ========== LAYOUT CONTAINER ========== */
.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ========== MAIN CONTENT OFFSET ========== */
#main-content {
  margin-top: var(--header-height);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

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

.btn-download {
  background: var(--color-neon);
  color: var(--color-ink);
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.35);
}

.btn-download:hover {
  box-shadow: 0 0 44px rgba(57, 255, 20, 0.7);
  transform: translateY(-2px);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--color-white);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--color-neon);
  color: var(--color-neon);
}

/* ========== GRID ========== */
.grid {
  display: grid;
  gap: 32px;
}

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

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

@media (max-width: 960px) {
  .grid-cols-2, .grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ========== SECTION ========== */
.section {
  padding-block: var(--space-2xl);
}

.section-dark {
  background: var(--color-night-900);
  color: var(--color-white);
}

.section-light {
  background: var(--color-paper);
  color: var(--color-ink);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-neon);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--color-neon);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--color-white);
  letter-spacing: -0.5px;
}

.section-light .section-title {
  color: var(--color-ink);
}

.section-light .section-label {
  color: var(--color-orange);
}

.section-light .section-label::before {
  background: var(--color-orange);
}

/* ========== CARD ========== */
.card {
  background: var(--color-night-700);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border-color: var(--color-neon);
}

.card-light {
  background: var(--color-paper);
  color: var(--color-ink);
  border-color: var(--color-border-light);
}

.card-light:hover {
  border-color: var(--color-orange);
}

/* ========== TAG ========== */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 2px;
  background: var(--color-orange);
  color: var(--color-night-900);
}

.tag-outline {
  background: transparent;
  border: 1px solid var(--color-orange);
  color: var(--color-orange);
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.9rem;
  color: var(--color-steel);
}

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

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  opacity: 0.5;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-neon) 0%, var(--color-orange) 100%);
  z-index: 2000;
  pointer-events: none;
}

/* ========== HEADER ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
}

.site-header[data-scrolled] {
  background: var(--color-night-900);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.brand-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-text {
  font-family: var(--font-head);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-white);
  letter-spacing: 1px;
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-neon);
  white-space: nowrap;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--color-steel);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-white);
}

.nav-link[aria-current="page"] {
  border-bottom-color: var(--color-neon);
}

.header-download {
  margin-left: auto;
  padding: 10px 22px;
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.3s, opacity 0.3s;
}

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

/* ========== FOOTER ========== */
.site-footer {
  background: var(--color-night-900);
  color: var(--color-steel);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 64px;
  padding-bottom: 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--color-white);
  text-decoration: none;
}

.footer-desc {
  margin-top: 12px;
  max-width: 32ch;
  font-size: 0.95rem;
}

.footer-heading {
  font-family: var(--font-head);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-neon);
  margin-bottom: 16px;
}

.footer-links,
.footer-contact-list {
  display: grid;
  gap: 12px;
}

.footer-links a {
  color: var(--color-steel);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-contact-list span {
  display: inline-block;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.support-note {
  font-size: 0.85rem;
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  color: var(--color-steel);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-icp {
  margin-top: 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .brand-tagline {
    display: none;
  }

  .header-inner {
    gap: 16px;
  }

  .header-download {
    margin-left: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-night-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 24px;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  .main-nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .nav-link {
    font-size: 1.1rem;
    border: none;
    padding: 4px 0;
  }

  .nav-link[aria-current="page"] {
    color: var(--color-neon);
  }

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

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

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .header-download {
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  .brand-text {
    font-size: 1.15rem;
  }

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

  .footer-legal {
    flex-wrap: wrap;
  }

  .grid {
    gap: 20px;
  }
}

/* ========== UTILITIES ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ========== MOTION PREFERENCES ========== */
@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;
  }
}
