@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000000;
  --white: #ffffff;
  --yellow: #ffe566;
  --bg: #f5f5f5;
  --border: 3px solid #000;
  --shadow: 5px 5px 0px #000;
  --shadow-sm: 3px 3px 0px #000;
  --radius-card: 10px;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --nav-height: 64px;
  --sticky-height: 48px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--black);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
}

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

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

ul, menu {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
}

/* ============================================================
   Scroll margin for sticky nav
   ============================================================ */
article[id] {
  scroll-margin-top: calc(var(--nav-height) + var(--sticky-height) + 8px);
}

/* ============================================================
   Page Wrapper
   ============================================================ */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--blue);
  border-bottom: var(--border);
  height: var(--nav-height);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-block {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.logo-img {
  height: 40px;
  width: auto;
}

/* Nav details/summary structure */
.nav-details {
  flex: 1;
  position: relative;
}

.nav-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  min-height: 44px;
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.nav-summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: none;
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.nav-hamburger span {
  display: block;
  height: 3px;
  background: var(--black);
  width: 100%;
  border-radius: 0;
  transition: transform var(--transition);
}

/* Desktop: show nav inline, hide hamburger */
@media (min-width: 768px) {
  .nav-details {
    position: static;
  }

  .nav-details[open] .nav-summary,
  .nav-summary {
    pointer-events: none;
    padding: 0;
  }

  .nav-hamburger {
    display: none;
  }

  .nav-menu {
    display: flex !important;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .nav-details summary {
    display: none;
  }

  .nav-details .nav-menu {
    display: flex;
  }
}

.nav-menu {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
}

@media (max-width: 767px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: var(--white);
    border: var(--border);
    box-shadow: var(--shadow);
    padding: 12px;
    flex-direction: column;
    gap: 4px;
    z-index: 200;
  }

  .nav-details[open] .nav-menu {
    display: flex;
  }

  .nav-summary-label {
    display: block;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--black);
  border: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
  background: var(--yellow);
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.header-contact {
  flex-shrink: 0;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--red);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  min-height: 44px;
}

/* ============================================================
   Sticky Bar
   ============================================================ */
.sticky-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: var(--black);
  border-bottom: var(--border);
  height: var(--sticky-height);
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-bar::-webkit-scrollbar {
  display: none;
}

.sticky-list {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 0;
  min-width: max-content;
}

.sticky-list li {
  border-right: 2px solid #333;
}

.sticky-list li:last-child {
  border-right: none;
}

.sticky-link {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--sticky-height);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
}

.sticky-link:hover,
.sticky-link:focus {
  background: var(--blue);
  color: var(--black);
  outline: none;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 100vh;
  margin-top: calc(var(--nav-height) + var(--sticky-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border-bottom: var(--border);
}

/* Grid background */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--black) 1px, transparent 1px),
    linear-gradient(90deg, var(--black) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.06;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 40px 40px;
  max-width: 700px;
  text-align: left;
}

.hero-eyebrow {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--black);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #222;
  margin-bottom: 36px;
  max-width: 560px;
}

.hero-cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--blue);
  color: var(--black);
  border: var(--border);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 48px;
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
  outline: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--yellow);
  color: var(--black);
  border: var(--border);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 48px;
}

.btn-secondary:hover,
.btn-secondary:focus {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
  outline: none;
}

/* Hero media (image below text) */
.hero-media {
  position: relative;
  z-index: 2;
  padding: 0 40px 60px;
  display: flex;
  justify-content: flex-start;
}

.hero-img {
  max-height: 380px;
  width: auto;
  border: var(--border);
  box-shadow: var(--shadow);
}

.hero-media-placeholder {
  align-items: center;
}

.hero-geo-block {
  width: 320px;
  height: 260px;
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(-2deg);
}

.hero-geo-block::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--red);
  border: var(--border);
  top: -20px;
  right: -20px;
  transform: rotate(45deg);
}

.hero-decor-stripe {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--black) 0px,
    var(--black) 20px,
    var(--blue) 20px,
    var(--blue) 40px,
    var(--red) 40px,
    var(--red) 60px,
    var(--yellow) 60px,
    var(--yellow) 80px
  );
}

/* ============================================================
   Main Content
   ============================================================ */
.site-main {
  flex: 1;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 20px;
}

.content-section {
  /* direct child of .wrap */
}

.content-article {
  /* direct child of content-section */
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-aside {
    order: -1;
  }
}

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

/* ============================================================
   Page Content (injected HTML)
   ============================================================ */
.page-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--black);
}

.page-content h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  border-bottom: var(--border);
  padding-bottom: 12px;
}

.page-content h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 16px;
}

.page-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--blue);
  border: 2px solid var(--black);
}

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.page-content p {
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.75;
}

.page-content ul,
.page-content ol {
  margin: 0 0 18px 0;
  padding-left: 24px;
}

.page-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.page-content ul li {
  list-style: none;
  padding-left: 20px;
  position: relative;
}

.page-content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 0.75em;
  top: 0.25em;
}

.page-content ol {
  counter-reset: ol-counter;
  list-style: none;
  padding-left: 0;
}

.page-content ol li {
  counter-increment: ol-counter;
  padding-left: 40px;
  position: relative;
}

.page-content ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  padding: 1px 6px;
  top: 2px;
  font-size: 0.85em;
}

.page-content article {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 2px solid var(--black);
}

.page-content article:last-child {
  border-bottom: none;
}

.page-content article > h2:first-child {
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px 20px 12px 20px;
  display: inline-block;
  margin-bottom: 24px;
}

.page-content article > h2:first-child::before {
  display: none;
}

.page-content blockquote {
  border-left: 6px solid var(--red);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--yellow);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: normal;
  font-weight: 700;
}

.page-content strong {
  font-weight: 700;
  background: var(--yellow);
  padding: 0 3px;
}

.page-content a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
  transition: background var(--transition);
}

.page-content a:hover {
  background: var(--blue);
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: var(--border);
  box-shadow: var(--shadow);
}

.page-content th {
  background: var(--black);
  color: var(--white);
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.page-content td {
  padding: 10px 16px;
  border: 1px solid var(--black);
  font-size: 0.9rem;
}

.page-content tr:nth-child(even) td {
  background: #f0f0f0;
}

/* ============================================================
   Aside
   ============================================================ */
.article-aside {
  position: sticky;
  top: calc(var(--nav-height) + var(--sticky-height) + 20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.aside-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-card);
  padding: 20px;
}

.aside-card-red {
  background: var(--red);
  color: var(--white);
}

.aside-title,
.aside-highlight-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.aside-card .subtitle,
.aside-card-red .subtitle {
  font-size: 0.78rem;
  margin-bottom: 16px;
  opacity: 0.75;
}

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

.aside-link {
  display: block;
  padding: 6px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--black);
  border-bottom: 1px solid #e0e0e0;
  transition: color var(--transition), padding-left var(--transition);
}

.aside-link:hover,
.aside-link:focus {
  color: var(--blue);
  padding-left: 6px;
  outline: none;
}

.aside-feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-feature-list li {
  font-size: 0.85rem;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
  color: var(--white);
}

.aside-feature-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: var(--border);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  grid-template-rows: auto auto;
  gap: 0;
}

.footer-section {
  padding: 48px 32px;
  border-right: 2px solid #333;
}

.footer-section:last-of-type:not(.footer-bottom-section) {
  border-right: none;
}

.footer-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: var(--blue);
}

.footer-brand-desc {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #aaa;
  max-width: 280px;
}

.footer-logo {
  margin-bottom: 12px;
}

.footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #333;
}

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

.footer-link {
  font-size: 0.85rem;
  color: #ccc;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  padding: 4px 0;
  min-height: 44px;
}

.footer-link:hover,
.footer-link:focus {
  color: var(--blue);
  outline: none;
}

.footer-info-text {
  font-size: 0.8rem;
  color: #999;
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-bottom-section {
  grid-column: 1 / -1;
  background: #111;
  border-top: 2px solid #333;
  padding: 20px 32px;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: #666;
}

.footer-bottom-right {
  font-size: 0.78rem;
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 1024px) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }

  .footer-section {
    border-right: none;
    border-bottom: 2px solid #333;
  }
}

@media (max-width: 600px) {
  .site-footer {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Scroll Reveal Animation
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal-left.is-visible {
    opacity: 1;
    transform: none;
  }

  .reveal-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal-right.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Parallax helper
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .parallax-layer {
    will-change: transform;
  }
}

/* ============================================================
   Utility
   ============================================================ */
.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;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 768px) {
  .hero-content {
    padding: 40px 20px 24px;
  }

  .hero-media {
    padding: 0 20px 48px;
  }

  .hero-geo-block {
    width: 220px;
    height: 180px;
  }

  .wrap {
    padding: 40px 16px;
  }

  .aside-card {
    position: static;
  }

  .article-layout {
    gap: 24px;
  }

  .footer-section {
    padding: 32px 20px;
  }

  .footer-bottom-section {
    padding: 16px 20px;
  }

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

  .hero-cta-row {
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .sticky-list {
    padding: 0 12px;
  }

  .sticky-link {
    padding: 0 10px;
    font-size: 0.65rem;
  }

  .hero-h1 {
    font-size: 1.75rem;
  }
}
