@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS 变量 & 基础重置
   ============================================================ */
:root {
  --c-primary: #99ffcc;
  --c-accent: #00ff41;
  --c-dark: #001e3c;
  --c-dark-2: #002a55;
  --c-dark-3: #003366;
  --c-glass: rgba(0, 255, 65, 0.06);
  --c-glass-border: rgba(153, 255, 204, 0.18);
  --c-text: #c8ffe8;
  --c-text-muted: rgba(200, 255, 232, 0.55);
  --c-h: #99ffcc;
  --nav-w: 220px;
  --radius: 0px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background-color: var(--c-dark);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   仿生细胞底纹（伪元素全局）
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 120px 80px at 15% 25%, rgba(0,255,65,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 200px 140px at 80% 60%, rgba(153,255,204,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 80px 120px at 50% 80%, rgba(0,255,65,0.03) 0%, transparent 70%),
    radial-gradient(circle 1px at 20% 10%, rgba(0,255,65,0.6) 0%, transparent 1px),
    radial-gradient(circle 1px at 40% 30%, rgba(153,255,204,0.4) 0%, transparent 1px),
    radial-gradient(circle 1px at 65% 70%, rgba(0,255,65,0.5) 0%, transparent 1px),
    radial-gradient(circle 1px at 85% 15%, rgba(153,255,204,0.4) 0%, transparent 1px),
    radial-gradient(circle 1px at 10% 75%, rgba(0,255,65,0.5) 0%, transparent 1px),
    radial-gradient(circle 1px at 92% 85%, rgba(153,255,204,0.3) 0%, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   布局骨架
   ============================================================ */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   左侧固定竖排导航
   ============================================================ */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: rgba(0, 20, 50, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-right: 1px solid var(--c-glass-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  overflow: hidden;
}

.brand-block {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--c-glass-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-logo-link {
  display: block;
  margin-bottom: 4px;
}

.brand-logo {
  max-height: 36px;
  width: auto;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-primary);
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  min-height: 44px;
  word-break: break-all;
  padding: 4px 0;
}

.brand-name:hover {
  color: var(--c-accent);
}

/* nav > p > a 结构 */
.sidebar-nav nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-nav nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav nav::-webkit-scrollbar-thumb {
  background: var(--c-glass-border);
  border-radius: 2px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  border-left: 2px solid transparent;
  line-height: 1.4;
  min-height: 44px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--c-primary);
  background: rgba(0, 255, 65, 0.07);
  border-left-color: var(--c-accent);
  padding-left: 26px;
  outline: none;
}

.nav-deco {
  padding: 12px;
  flex-shrink: 0;
}

.cell-deco {
  width: 100%;
  height: 120px;
  opacity: 0.6;
}

/* ============================================================
   主内容区推进（跟侧边导航同宽）
   ============================================================ */
.main-stage {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   Hero 区块
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--c-glass-border);
}

/* 点阵网格底纹 */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,65,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,65,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.fluid-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-fluid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 细胞呼吸动效 */
@keyframes cell-breathe {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.25); opacity: 0.9; }
}
@keyframes cell-breathe-2 {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.18); opacity: 0.75; }
}
@keyframes cell-breathe-3 {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.cell-pulse {
  transform-origin: 120px 130px;
  animation: cell-breathe 4s ease-in-out infinite;
}
.cell-pulse-2 {
  transform-origin: 680px 220px;
  animation: cell-breathe-2 5.5s ease-in-out infinite;
}
.cell-pulse-3 {
  transform-origin: 400px 80px;
  animation: cell-breathe-3 3.8s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 24px;
  max-width: 680px;
}

.hero-icon-wrap {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.hero-icon {
  width: 64px;
  height: 64px;
  animation: cell-breathe 3.5s ease-in-out infinite;
}

.hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================================
   正文 + aside 并排
   ============================================================ */
.content-with-aside {
  display: flex;
  flex: 1;
  gap: 0;
  align-items: flex-start;
}

/* ============================================================
   main > div > section 正文容器
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 48px 40px 64px;
}

.page-article {
  max-width: 780px;
}

.content-body {
  font-size: 1rem;
  line-height: 1.8;
}

/* 正文内容样式 */
.content-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 48px 0 0;
  letter-spacing: -0.01em;
}

.content-body h2 + hr {
  border: none;
  border-top: 1px solid var(--c-accent);
  margin: 10px 0 20px;
  opacity: 0.5;
}

.content-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 32px 0 12px;
}

.content-body h3 + hr {
  border: none;
  border-top: 1px solid rgba(153, 255, 204, 0.3);
  margin: 8px 0 16px;
}

.content-body p {
  margin-bottom: 1.2em;
  color: var(--c-text);
}

.content-body ul,
.content-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.content-body li {
  margin-bottom: 0.5em;
}

.content-body a {
  color: var(--c-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,255,65,0.3);
  transition: border-color var(--transition), color var(--transition);
}

.content-body a:hover {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

/* section 区块（来自 page.content 内部）*/
.content-body section {
  scroll-margin-top: 80px;
  padding-bottom: 32px;
}

/* 通用 hr */
hr {
  border: none;
  border-top: 1px solid rgba(153, 255, 204, 0.2);
  margin: 24px 0;
}

/* ============================================================
   aside 侧边栏（内容右侧）
   ============================================================ */
.sidebar-aside {
  width: 260px;
  flex-shrink: 0;
  padding: 48px 20px 48px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.sidebar-aside::-webkit-scrollbar {
  width: 3px;
}
.sidebar-aside::-webkit-scrollbar-thumb {
  background: var(--c-glass-border);
}

/* 玻璃拟态卡片（圆角 0） */
.aside-card {
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: 18px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.aside-card:hover {
  border-color: rgba(0,255,65,0.3);
  box-shadow: 0 0 20px rgba(0,255,65,0.08);
}

.aside-card--glow {
  border-color: rgba(0,255,65,0.25);
  box-shadow: inset 0 0 20px rgba(0,255,65,0.04);
}

.aside-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.aside-title + hr {
  margin: 0 0 12px;
  border-top: 1px solid rgba(0,255,65,0.25);
}

.aside-nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-nav-list li a {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  border-left: 2px solid transparent;
  min-height: 32px;
}

.aside-nav-list li a:hover {
  color: var(--c-primary);
  background: rgba(0,255,65,0.06);
  border-left-color: var(--c-accent);
}

.aside-text {
  font-size: 0.83rem;
  color: var(--c-text-muted);
  line-height: 1.65;
}

.aside-tips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-tips li {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.aside-tips li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--c-accent);
  font-size: 1.2em;
  line-height: 1;
  top: 1px;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: rgba(0, 10, 28, 0.9);
  border-top: 1px solid var(--c-glass-border);
  padding: 48px 40px 28px;
}

.footer-brand-row {
  margin-bottom: 32px;
  overflow: hidden;
}

.footer-brand-big {
  display: block;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: rgba(153, 255, 204, 0.1);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* footer 三列 dl */
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

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

.footer-dl dt {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.footer-dl dd {
  font-size: 0.83rem;
  color: var(--c-text-muted);
  line-height: 1.55;
  margin-left: 0;
}

.footer-dl dd a {
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer-dl dd a:hover {
  color: var(--c-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(153,255,204,0.1);
  padding-top: 20px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

/* ============================================================
   Scroll Reveal 动效
   ============================================================ */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: reveal-up 0.6s var(--transition) both;
}

.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }

/* ============================================================
   流体算法线条动效
   ============================================================ */
@keyframes path-flow {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

.fluid-path-1 {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: path-flow 6s ease-in-out infinite alternate;
}
.fluid-path-2 {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: path-flow 8s 1s ease-in-out infinite alternate;
}
.fluid-path-3 {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: path-flow 10s 0.5s ease-in-out infinite alternate;
}

/* ============================================================
   section scroll-margin（固定侧边导航）
   ============================================================ */
section[id] {
  scroll-margin-top: 24px;
}

/* ============================================================
   Parallax 层（轻量 JS 驱动，降级安全）
   ============================================================ */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ============================================================
   移动端响应式
   ============================================================ */
@media (max-width: 900px) {
  :root {
    --nav-w: 0px;
  }

  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--c-glass-border);
    padding: 0;
    overflow: visible;
    z-index: 200;
  }

  .brand-block {
    border-bottom: none;
    border-right: 1px solid var(--c-glass-border);
    padding: 0 16px;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    height: 52px;
  }

  .brand-name {
    font-size: 0.95rem;
    white-space: nowrap;
    min-height: 44px;
    padding: 0;
  }

  .sidebar-nav nav {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0 4px;
  }

  .nav-links a {
    white-space: nowrap;
    padding: 0 14px;
    height: 52px;
    min-height: 52px;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.83rem;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    padding-left: 14px;
    border-left: none;
    border-bottom-color: var(--c-accent);
  }

  .nav-deco {
    display: none;
  }

  .main-stage {
    margin-left: 0;
    margin-top: 52px;
  }

  .content-with-aside {
    flex-direction: column;
  }

  .main-content {
    padding: 32px 20px 40px;
  }

  .page-article {
    max-width: 100%;
  }

  .sidebar-aside {
    width: 100%;
    position: static;
    padding: 0 20px 40px;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .aside-card {
    flex: 1;
    min-width: 240px;
  }

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

  .footer-brand-big {
    font-size: 2rem;
  }

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

  .hero-section {
    min-height: auto;
    padding: 40px 0;
  }

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

@media (max-width: 480px) {
  .hero-content {
    padding: 32px 16px;
  }

  .sidebar-aside {
    flex-direction: column;
  }

  .aside-card {
    min-width: unset;
  }

  .main-content {
    padding: 24px 16px 32px;
  }

  .content-body h2 {
    font-size: 1.2rem;
  }
}

/* ============================================================
   prefers-reduced-motion：关闭所有动效
   ============================================================ */
@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;
  }

  .cell-pulse,
  .cell-pulse-2,
  .cell-pulse-3,
  .hero-icon,
  .fluid-path-1,
  .fluid-path-2,
  .fluid-path-3 {
    animation: none;
  }
}

/* ============================================================
   辅助：focus 可见性
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ============================================================
   图片
   ============================================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   选中颜色
   ============================================================ */
::selection {
  background: rgba(0, 255, 65, 0.25);
  color: var(--c-primary);
}
