/* ===== 1. 变量 ===== */
:root {
  --deep-space: #0A1128;
  --panel: #111B3D;
  --neon-green: #39FF14;
  --electric-orange: #FF6B00;
  --text-primary: #EAEAF2;
  --text-muted: #8B93A7;
  --deep-blue-hud: #2152A3;
  --soft-blue-glow: #4D7FFF;
  --background-alt: #1B233A;
  --font-heading: "Noto Sans SC Black", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-numeric: "Oswald", "DIN Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --line-tight: 1.1;
  --line-normal: 1.6;
  --line-relaxed: 1.8;
  --header-h: 64px;
  --max-w: 1360px;
  --shadow-green: 0 0 20px rgba(57, 255, 20, 0.25);
  --shadow-orange: 0 0 20px rgba(255, 107, 0, 0.25);
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--line-normal);
  color: var(--text-primary);
  background-color: var(--deep-space);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-width: 320px;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--neon-green);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--soft-blue-glow);
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--neon-green);
  color: var(--deep-space);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--deep-space);
}
::-webkit-scrollbar-thumb {
  background: var(--deep-blue-hud);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--soft-blue-glow);
}

/* ===== 3. 基础排版 ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: var(--line-tight);
  color: var(--text-primary);
  margin: 0 0 16px;
}

h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: clamp(22px, 3vw, 32px); }
h4 { font-size: 20px; }

p {
  margin: 0 0 16px;
}

.text-muted {
  color: var(--text-muted);
}

.text-neon {
  color: var(--neon-green);
}

.text-orange {
  color: var(--electric-orange);
}

/* ===== 4. Skip Link ===== */
.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--electric-orange);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 2px;
  box-shadow: var(--shadow-orange);
  transition: top 0.2s var(--ease);
}

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

/* ===== 5. 容器 ===== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 6. 头部 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 17, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(33, 82, 163, 0.4);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.45), rgba(33, 82, 163, 0.15) 40%, rgba(255, 107, 0, 0.4));
  pointer-events: none;
  z-index: 2;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.scroll-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-green), var(--soft-blue-glow), var(--electric-orange));
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.35);
  z-index: 3;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ===== 7. 品牌 ===== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text-primary);
}

.brand:hover {
  color: var(--text-primary);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--neon-green);
  color: var(--deep-space);
  font-family: var(--font-numeric);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ===== 8. 导航 ===== */
.site-nav {
  background: rgba(17, 27, 61, 0.55);
  border: 1px solid rgba(33, 82, 163, 0.3);
  border-radius: 2px;
  padding: 0 4px;
}

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

.nav-item {
  margin: 0;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-primary);
  border-radius: 2px;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--neon-green);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover {
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.04);
}

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

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

.nav-index {
  font-family: var(--font-numeric);
  font-size: 12px;
  font-weight: 400;
  color: var(--soft-blue-glow);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

.nav-label {
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ===== 9. 版本通道 ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(57, 255, 20, 0.35);
  background: rgba(57, 255, 20, 0.08);
  color: var(--neon-green);
  border-radius: 2px;
  font-size: 11px;
  white-space: nowrap;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.version-chip:hover {
  background: rgba(57, 255, 20, 0.16);
  border-color: var(--neon-green);
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.25);
  color: var(--neon-green);
}

.version-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

.version-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.version-num {
  font-family: var(--font-numeric);
  font-size: 15px;
  font-weight: 700;
  color: var(--electric-orange);
  letter-spacing: 0.03em;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* ===== 10. 汉堡按钮 ===== */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--deep-blue-hud);
  border-radius: 2px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--neon-green);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.2);
}

.toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--neon-green);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle.is-active .toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== 11. 移动端抽屉 ===== */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 25, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  z-index: 999;
}

.nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.nav-locked {
  overflow: hidden;
}

@media (max-width: 1280px) {
  .nav-index {
    display: none;
  }
}

@media (max-width: 1024px) {
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: var(--panel);
    padding: 96px 28px 32px;
    border: none;
    border-left: 1px solid rgba(33, 82, 163, 0.5);
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 1001;
    overflow-y: auto;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.45);
  }

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

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item {
    border-bottom: 1px solid rgba(33, 82, 163, 0.22);
  }

  .nav-link {
    padding: 15px 8px;
    font-size: 16px;
    justify-content: flex-start;
    border-radius: 0;
  }

  .nav-link::after {
    left: 0;
    right: 0;
  }

  .nav-index {
    display: inline-block;
    font-size: 12px;
    color: var(--soft-blue-glow);
    min-width: 30px;
    opacity: 0.8;
  }

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

  .version-chip {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .version-label {
    display: none;
  }

  .version-chip {
    padding: 0 12px;
  }

  .brand-text {
    font-size: 16px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

/* ===== 12. 页脚 ===== */
.site-footer {
  position: relative;
  background: var(--deep-space);
  border-top: 1px solid rgba(33, 82, 163, 0.4);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-green) 0%, rgba(33, 82, 163, 0.2) 45%, var(--electric-orange) 100%);
  opacity: 0.75;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 56px;
  padding: 64px 0 48px;
}

.footer-brand .brand {
  margin-bottom: 18px;
}

.footer-desc {
  font-size: 14px;
  line-height: var(--line-relaxed);
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 360px;
}

.footer-trust {
  font-size: 12px;
  line-height: var(--line-relaxed);
  color: var(--text-muted);
  padding: 12px 16px;
  background: rgba(33, 82, 163, 0.12);
  border-left: 2px solid var(--deep-blue-hud);
  max-width: 400px;
}

.footer-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(33, 82, 163, 0.35);
  position: relative;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--neon-green);
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

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

.footer-link {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.footer-link:hover {
  color: var(--neon-green);
  padding-left: 4px;
}

.footer-link-legal {
  font-size: 13px;
}

.footer-list-contact {
  gap: 10px;
}

.footer-list-contact li {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: var(--line-normal);
}

.footer-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 32px;
  letter-spacing: 0.08em;
}

.footer-value {
  color: var(--text-primary);
}

.footer-service {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(33, 82, 163, 0.35);
  font-size: 12px;
  line-height: var(--line-relaxed);
  color: var(--text-muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 26px;
  border-top: 1px solid rgba(33, 82, 163, 0.25);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-legal-sep {
  color: var(--deep-blue-hud);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 0 36px;
  }

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

/* ===== 13. 通用按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--neon-green);
  color: var(--deep-space);
  border-color: var(--neon-green);
  box-shadow: var(--shadow-green);
}

.btn-primary:hover {
  background: #54ff35;
  color: var(--deep-space);
  box-shadow: 0 0 32px rgba(57, 255, 20, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--neon-green);
  border-color: rgba(57, 255, 20, 0.45);
}

.btn-outline:hover {
  background: rgba(57, 255, 20, 0.08);
  color: var(--neon-green);
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.15);
  transform: translateY(-2px);
}

/* ===== 14. 面包屑 ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 14px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(33, 82, 163, 0.28);
}

.breadcrumb-link {
  color: var(--neon-green);
  font-size: 14px;
}

.breadcrumb-link:hover {
  color: var(--soft-blue-glow);
}

.breadcrumb-sep {
  color: var(--deep-blue-hud);
  font-size: 12px;
}

.breadcrumb-current {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== 15. 章节标题 ===== */
.chapter {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 40px;
}

.chapter-index {
  font-family: var(--font-numeric);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  line-height: 0.9;
  color: var(--electric-orange);
  opacity: 0.8;
  text-shadow: 0 0 24px rgba(255, 107, 0, 0.25);
}

.chapter-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(22px, 3vw, 32px);
  color: var(--text-primary);
  line-height: var(--line-tight);
}

.chapter-title small {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== 16. 卡片 ===== */
.card {
  background: var(--panel);
  border: 1px solid rgba(33, 82, 163, 0.35);
  border-radius: 2px;
  padding: 24px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card:hover {
  border-color: rgba(57, 255, 20, 0.45);
  box-shadow: 0 4px 28px rgba(57, 255, 20, 0.08);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: var(--line-normal);
}

/* ===== 17. 媒体容器 ===== */
.media {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(33, 82, 163, 0.4);
}

.media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(33, 82, 163, 0.06) 2px,
    rgba(33, 82, 163, 0.06) 4px
  );
  pointer-events: none;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.18);
}

.media-16x9 { aspect-ratio: 16 / 9; }
.media-4x3 { aspect-ratio: 4 / 3; }
.media-1x1 { aspect-ratio: 1 / 1; }
.media-21x9 { aspect-ratio: 21 / 9; }

/* ===== 18. 左右分屏 ===== */
.split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.split-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.split-content {
  min-width: 0;
}

@media (max-width: 1024px) {
  .split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .split-sidebar {
    position: static;
  }
}

/* ===== 19. 扫描线纹理 ===== */
.scanlines {
  position: relative;
}

.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(33, 82, 163, 0.07) 2px,
    rgba(33, 82, 163, 0.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ===== 20. 滚动显现 ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ===== 21. 焦点与动效 ===== */
:focus-visible {
  outline: 2px solid var(--neon-green);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(57, 255, 20, 0.2);
}

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

  .scroll-progress {
    transition: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
