/* ========== 基础变量 ========== */
:root {
  --c-primary: #0A1E3F;
  --c-primary-deep: #051224;
  --c-primary-2: #1B4F72;
  --c-accent: #FF6B35;
  --c-neon: #39FF14;
  --c-bg: #F5F7FA;
  --c-text: #0A1E3F;
  --c-muted: #4A5A70;
  --c-white: #FFFFFF;
  --c-success: #2ECC71;
  --c-warning: #F1C40F;
  --c-glass: rgba(255, 255, 255, 0.08);
  --c-glass-border: rgba(255, 255, 255, 0.12);
  --grad-speed: linear-gradient(135deg, #FF6B35 0%, #39FF14 100%);
  --grad-ocean: linear-gradient(180deg, #0A1E3F 0%, #1B4F72 100%);
  --font-display: Impact, 'Microsoft YaHei', sans-serif;
  --font-body: Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Courier New', monospace;
  --header-h: 72px;
  --content-gutter: 24px;
  --container-w: 1200px;
  --section-space: 72px;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--c-text);
  background-color: var(--c-bg);
  background-image:
    linear-gradient(rgba(10, 30, 63, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 30, 63, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--c-accent);
}

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

:focus-visible {
  outline: 3px solid var(--c-neon);
  outline-offset: 2px;
}

::selection {
  background: var(--c-neon);
  color: var(--c-primary-deep);
}

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

/* ========== 容器 ========== */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--content-gutter);
}

.container-narrow {
  max-width: 840px;
  margin-inline: auto;
  padding-inline: var(--content-gutter);
}

/* ========== 通用按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  border: 2px solid transparent;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--c-accent);
  color: var(--c-white);
  box-shadow: 0 4px 18px rgba(255, 107, 53, 0.32);
}

.btn-primary:hover {
  background: #e85825;
  color: var(--c-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.38);
}

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

.btn-outline:hover {
  border-color: var(--c-neon);
  color: var(--c-neon);
  transform: translateY(-2px);
}

/* ========== 头部 ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: var(--grad-ocean);
  border-bottom: 1px solid var(--c-glass-border);
}

.header-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding-inline: 16px;
  max-width: var(--container-w);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 2000;
  background: var(--c-accent);
  color: var(--c-white);
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}

.skip-link:focus {
  left: 10px;
  outline: none;
}

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

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--grad-speed);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary-deep);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark-line {
  position: absolute;
  left: -80%;
  top: 0;
  width: 60%;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  transform: skewX(-20deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--c-white);
  white-space: nowrap;
}

.brand-tagline {
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-live {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--c-glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 8px var(--c-neon);
  animation: pulse-dot 1.6s ease-out infinite;
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  width: 100%;
  z-index: 5;
  pointer-events: none;
}

.header-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad-speed);
  border-radius: 0 2px 2px 0;
}

/* ========== 导航按钮 ========== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-white);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

/* ========== 侧边导航 / 抽屉 ========== */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  background: var(--grad-ocean);
  border-left: 1px solid var(--c-glass-border);
  z-index: 1100;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s ease, opacity 0.3s ease, visibility 0.3s ease;
}

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

.nav-backdrop {
  display: none;
}

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-glass-border);
  margin-bottom: 14px;
}

.nav-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}

.nav-close {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--c-glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-white);
  font-size: 13px;
  line-height: 1;
  transition: background 0.2s ease;
}

.nav-close:hover {
  background: rgba(255, 107, 53, 0.2);
}

.nav-body {
  flex: 1;
  overflow-y: auto;
}

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

.nav-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--c-accent) 20%, var(--c-neon) 80%, transparent);
  opacity: 0.35;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 28px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--c-neon);
  opacity: 0.65;
}

.nav-label {
  flex: 1;
  font-size: 16px;
  letter-spacing: 1px;
  font-weight: 500;
}

.nav-arrow {
  font-size: 14px;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-white);
}

.nav-link:hover .nav-arrow,
.nav-link[aria-current="page"] .nav-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--c-accent);
}

.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.08), rgba(255, 107, 53, 0.04));
  border-left-color: var(--c-neon);
  color: var(--c-white);
}

.nav-link[aria-current="page"] .nav-num {
  opacity: 1;
  color: var(--c-accent);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--c-glass-border);
  margin-top: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 10px var(--c-neon);
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-out infinite;
}

.status-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ========== 页脚 ========== */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--grad-ocean);
  color: rgba(255, 255, 255, 0.78);
  padding-bottom: 28px;
  border-top: 1px solid var(--c-glass-border);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--grad-speed);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 48px;
  padding-block: 56px 36px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--c-white);
  display: inline-block;
}

.footer-logo:hover {
  color: var(--c-neon);
}

.footer-tagline {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-trust {
  margin-top: 22px;
  max-width: 380px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  border-left: 3px solid var(--c-accent);
  padding-left: 14px;
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-neon);
  margin-bottom: 16px;
}

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

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 5px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a::before {
  content: "›";
  font-family: var(--font-mono);
  color: var(--c-accent);
  font-size: 14px;
  line-height: 1;
}

.footer-links a:hover {
  color: var(--c-neon);
  transform: translateX(4px);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
}

.footer-contact-list li {
  display: flex;
  gap: 12px;
  padding-block: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.contact-label {
  flex: 0 0 38px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  padding-top: 2px;
}

.contact-value {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* ========== 面包屑 ========== */
.breadcrumbs {
  padding-block: 18px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-muted);
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumbs-item a:hover {
  color: var(--c-accent);
}

.breadcrumbs-item + .breadcrumbs-item::before {
  content: "·";
  margin-right: 6px;
  color: var(--c-accent);
}

.breadcrumbs-item[aria-current] {
  color: var(--c-primary);
  font-weight: 600;
}

/* ========== 章节与卡片 ========== */
.section {
  padding-block: var(--section-space);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 30px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--c-accent);
  letter-spacing: 2px;
  white-space: nowrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-primary);
}

.card {
  background: var(--c-white);
  border: 1px solid rgba(10, 30, 63, 0.08);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 12px rgba(10, 30, 63, 0.05);
}

.card-glass {
  background: var(--c-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: 28px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1px solid var(--c-primary);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-primary);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tag-pill:hover {
  background: var(--c-primary);
  color: var(--c-white);
}

/* ========== 编辑网格 ========== */
.note-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.note-column {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-muted);
  line-height: 1.7;
}

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

/* ========== 页面首屏 ========== */
.page-hero {
  position: relative;
  padding: 72px 0 52px;
  background: var(--grad-ocean);
  color: var(--c-white);
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.12), transparent 65%);
  pointer-events: none;
}

.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: 2px;
  color: var(--c-white);
}

.page-hero-sub {
  max-width: 560px;
  margin-top: 16px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}

/* ========== 图片容器 ========== */
.image-frame,
.image-frame-dynamic {
  position: relative;
  overflow: hidden;
  background: var(--c-primary-deep);
  border-radius: var(--radius);
  min-height: 220px;
}

.image-frame::after,
.image-frame-dynamic::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 107, 53, 0.16), transparent 32%),
    repeating-linear-gradient(135deg, transparent 0, transparent 10px, rgba(255, 255, 255, 0.04) 10px, rgba(255, 255, 255, 0.04) 12px);
  pointer-events: none;
  z-index: 2;
}

.image-frame-dynamic {
  min-height: 280px;
  transform: skewY(-1.2deg);
}

.image-frame img,
.image-frame-dynamic img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== 数据流背景 ========== */
.data-stream {
  position: relative;
  overflow: hidden;
}

.data-stream::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0,
    transparent 32px,
    rgba(255, 107, 53, 0.08) 32px,
    rgba(255, 107, 53, 0.08) 34px,
    transparent 34px,
    transparent 68px,
    rgba(57, 255, 20, 0.06) 68px,
    rgba(57, 255, 20, 0.06) 70px,
    transparent 70px,
    transparent 104px
  );
  background-size: 208px 100%;
  animation: data-flow 14s linear infinite;
  pointer-events: none;
}

.data-stream > * {
  position: relative;
  z-index: 1;
}

/* ========== 显现动画 ========== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}

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

/* ========== 动画关键帧 ========== */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

@keyframes data-flow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 208px 0;
  }
}

/* ========== 平板 ========== */
@media (min-width: 768px) {
  .header-panel {
    padding-inline: 28px;
  }

  .header-live {
    display: inline-flex;
  }

  .brand-tagline {
    display: inline;
  }

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

  .note-grid {
    grid-template-columns: 180px 1fr;
  }

  .btn {
    padding: 13px 30px;
  }
}

/* ========== 桌面端 ========== */
@media (min-width: 1024px) {
  body {
    padding-right: 200px;
  }

  .site-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 120px;
    height: 3px;
    background: var(--grad-speed);
    z-index: 2;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    top: calc(var(--header-h) + 24px);
    right: 12px;
    bottom: 28px;
    left: auto;
    width: 176px;
    padding: 18px 14px;
    background: rgba(5, 18, 36, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--c-glass-border);
    border-radius: 16px;
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
    box-shadow: 0 12px 48px rgba(5, 15, 30, 0.18);
  }

  .site-nav[data-open] {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-close {
    display: none;
  }

  .nav-head {
    padding-bottom: 12px;
    margin-bottom: 10px;
  }

  .nav-title {
    font-size: 11px;
  }

  .nav-link {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 26px;
    font-size: 15px;
  }

  .nav-status {
    padding-top: 12px;
    margin-top: 8px;
  }

  .nav-backdrop {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr 1.3fr;
  }

  .page-hero {
    padding-top: 96px;
  }
}

/* ========== 宽屏 ========== */
@media (min-width: 1400px) {
  body {
    padding-right: 220px;
  }

  .site-nav {
    width: 192px;
    right: 14px;
    padding: 22px 16px;
  }
}

/* ========== 移动端遮罩与锁定 ========== */
@media (max-width: 1023px) {
  body.nav-locked {
    overflow: hidden;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(3, 10, 20, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: flex;
  }
}

/* ========== 减少动态偏好 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .data-stream::before {
    animation: none;
  }

  .live-dot,
  .status-dot {
    animation: none;
  }
}
