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

/* ===== CSS 自定义属性 ===== */
:root {
  --c-primary: #99ffcc;
  --c-accent: #00ff41;
  --c-dark: #001e3c;
  --c-dark-2: #002a54;
  --c-dark-3: #003366;
  --c-text: #c8ffe8;
  --c-text-muted: #6bbf99;
  --c-border: rgba(153,255,204,0.15);
  --c-glow: rgba(0,255,65,0.25);
  --c-glow-strong: rgba(0,255,65,0.5);
  --font-hud: 'Orbitron', 'Courier New', monospace;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 0;
  --header-h: 64px;
  --max-w: 1200px;
  --prose-w: 720px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-dark);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-accent); }
ul, ol { list-style: none; }

/* ===== 生物膜纹路背景 ===== */
.bio-root {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0,255,65,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(153,255,204,0.05) 0%, transparent 60%),
    var(--c-dark);
}

/* 仿生细胞纹路分割器 */
.bio-membrane {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(0,255,65,0.08) 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(153,255,204,0.06) 0%, transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(0,255,65,0.03) 0%, transparent 70%);
  pointer-events: none;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,30,60,0.92);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: var(--header-h);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.brand-icon:hover {
  border-color: var(--c-accent);
  box-shadow: 0 0 12px var(--c-glow);
  color: var(--c-accent);
}
.brand-glyph {
  font-family: var(--font-hud);
  font-size: 1rem;
  line-height: 1;
}
.logo-mark { width: 28px; height: 28px; object-fit: contain; }

/* 药丸胶囊按钮组 */
.pill-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 1rem;
  border: 1px solid var(--c-border);
  border-radius: 17px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.pill:hover,
.pill.active {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: rgba(153,255,204,0.07);
  box-shadow: 0 0 8px rgba(153,255,204,0.15);
}

/* ===== Hero (首页) ===== */
.hero-wrap {
  position: relative;
  height: 45vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0,255,65,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(0,30,60,0.9) 0%, transparent 70%),
    linear-gradient(180deg, var(--c-dark) 0%, var(--c-dark-2) 100%);
}

.hero-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,255,65,0.018) 3px,
    rgba(0,255,65,0.018) 4px
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.25rem;
  max-width: 800px;
}

.hero-h1 {
  font-family: var(--font-hud);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--c-primary);
  line-height: 1.2;
  text-shadow: 0 0 30px var(--c-glow-strong);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.hero-sub {
  font-size: 1rem;
  color: var(--c-text-muted);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* 斜切色带分割 */
.hero-slash {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--c-dark);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  z-index: 3;
}

/* ===== Feature Hero ===== */
.feat-hero {
  position: relative;
  padding: 3rem 1.25rem 2.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-dark-2), var(--c-dark));
  border-bottom: 1px solid var(--c-border);
}
.feat-hero-bg {
  position: absolute;
  inset: 0;
}
.bio-membrane--feat {
  opacity: 0.8;
}
.feat-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.feat-h1 {
  font-family: var(--font-hud);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--c-primary);
  text-shadow: 0 0 20px var(--c-glow);
  letter-spacing: 0.03em;
}

/* ===== About Hero ===== */
.about-hero {
  position: relative;
  padding: 3.5rem 1.25rem 3rem;
  overflow: hidden;
  background: linear-gradient(160deg, var(--c-dark-3) 0%, var(--c-dark) 100%);
  border-bottom: 1px solid var(--c-border);
}
.bio-membrane--about { opacity: 0.7; }
.about-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.about-h1 {
  font-family: var(--font-hud);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--c-primary);
  text-shadow: 0 0 20px var(--c-glow);
}

/* ===== Eyebrow Bar ===== */
.page-eyebrow {
  background: var(--c-dark-2);
  border-bottom: 1px solid var(--c-border);
  padding: 0.75rem 1.25rem;
}
.eyebrow-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.eyebrow-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--c-dark);
  background: var(--c-primary);
  padding: 0.2em 0.7em;
  font-weight: 500;
}
.pub-date, .mod-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

/* ===== CTA Button ===== */
.cta-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 1.75rem;
  background: var(--c-primary);
  color: var(--c-dark);
  font-family: var(--font-hud);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-transform: uppercase;
}
.cta-btn:hover {
  background: var(--c-accent);
  color: var(--c-dark);
  box-shadow: 0 0 20px var(--c-glow-strong);
  transform: translateY(-1px);
}
.cta-btn--light {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.cta-btn--light:hover {
  background: var(--c-primary);
  color: var(--c-dark);
}

/* ===== Main Layout ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

section { width: 100%; }

/* 正文区 + 侧边栏布局 */
.section-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

.faq-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

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

/* ===== Content Sections ===== */
.content-section {
  margin-bottom: 3rem;
}

.page-h1 {
  font-family: var(--font-hud);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 900;
  color: var(--c-primary);
  margin-bottom: 1.5rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-shadow: 0 0 16px rgba(153,255,204,0.2);
}

/* ===== Prose (page.content) ===== */
.page-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}
.page-content h2 {
  font-family: var(--font-hud);
  font-size: 1.15rem;
  color: var(--c-primary);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.04em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--c-border);
}
.page-content h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--c-accent);
  margin: 1.5rem 0 0.5rem;
}
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 0.35rem; }
.page-content a { color: var(--c-primary); border-bottom: 1px solid rgba(153,255,204,0.3); }
.page-content a:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.page-content strong { color: var(--c-primary); font-weight: 500; }
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(153,255,204,0.08);
  color: var(--c-accent);
  padding: 0.1em 0.4em;
  border: 1px solid var(--c-border);
}
.page-content blockquote {
  border-left: 3px solid var(--c-primary);
  padding-left: 1rem;
  color: var(--c-text-muted);
  margin: 1rem 0;
}
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.page-content th, .page-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--c-border);
  text-align: left;
}
.page-content th {
  background: rgba(153,255,204,0.08);
  color: var(--c-primary);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ===== Aside / Sidebar ===== */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  background: rgba(0,42,84,0.6);
  border: 1px solid var(--c-border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.aside-title {
  font-family: var(--font-hud);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--c-border);
}
.aside-title span { display: inline; }

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.aside-links li {
  border-bottom: 1px solid var(--c-border);
}
.aside-links li:last-child { border-bottom: none; }
.aside-links a {
  display: block;
  padding: 0.55rem 0;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}
.aside-links a:hover { color: var(--c-primary); }
.aside-links small {
  display: block;
  font-size: 0.72rem;
  color: var(--c-text-muted);
  opacity: 0.7;
  padding-bottom: 0.4rem;
}

.aside-cta { margin-top: 1rem; }
.aside-notice {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0,255,65,0.05);
  border-left: 2px solid var(--c-accent);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* DL nav links in sidebar */
.sidebar dl, .aside-cta dl { display: flex; flex-direction: column; }
.sidebar dt, .sidebar dd,
.aside-cta dt, .aside-cta dd {
  padding: 0;
}
.sidebar dt a, .sidebar dd a,
.aside-cta dt a, .aside-cta dd a {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.83rem;
  color: var(--c-text-muted);
  border-bottom: 1px solid rgba(153,255,204,0.06);
}
.sidebar dt a:hover, .sidebar dd a:hover,
.aside-cta dt a:hover, .aside-cta dd a:hover {
  color: var(--c-primary);
}

/* ===== Section Titles ===== */
.sec-title {
  font-family: var(--font-hud);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--c-primary);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sec-title span { display: inline; }
.sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--c-border), transparent);
}

/* ===== Cell / Guide Grid ===== */
.cell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  list-style: none;
  counter-reset: cell-counter;
}

.cell-card {
  background: var(--c-dark);
  transition: background var(--transition);
  animation: revealUp 0.5s ease both;
  animation-delay: var(--cell-delay, 0ms);
}
.cell-card:hover { background: rgba(0,42,84,0.9); }

.cell-card a {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  height: 100%;
  color: inherit;
}
.cell-index {
  font-family: var(--font-hud);
  font-size: 0.72rem;
  color: var(--c-accent);
  letter-spacing: 0.1em;
}
.cell-card strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-primary);
  line-height: 1.4;
}
.cell-card small {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ===== Guide Section ===== */
.guide-section {
  margin-bottom: 3rem;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--c-border);
  list-style: none;
  counter-reset: guide-counter;
}
.guide-list-item {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  gap: 0.25rem;
  counter-increment: guide-counter;
  position: relative;
  transition: background var(--transition);
  animation: revealUp 0.4s ease both;
}
.guide-list-item:last-child { border-bottom: none; }
.guide-list-item:hover { background: rgba(153,255,204,0.04); }
.guide-list-item.current { background: rgba(0,255,65,0.06); border-left: 2px solid var(--c-accent); }
.guide-list-item::before {
  content: counter(guide-counter, decimal-leading-zero);
  position: absolute;
  right: 1.25rem;
  top: 1rem;
  font-family: var(--font-hud);
  font-size: 0.7rem;
  color: var(--c-text-muted);
  opacity: 0.5;
}
.guide-list-item a {
  font-size: 0.9rem;
  color: var(--c-primary);
  font-family: var(--font-mono);
}
.guide-list-item small {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

/* ===== Feature Grid ===== */
.feature-section { margin-bottom: 3rem; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
}
.feat-grid--small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.feat-cell {
  background: var(--c-dark);
  transition: background var(--transition), box-shadow var(--transition);
  animation: revealUp 0.5s ease both;
  animation-delay: var(--cell-delay, 0ms);
}
.feat-cell:hover { background: rgba(0,42,84,0.85); box-shadow: inset 0 0 20px rgba(0,255,65,0.06); }
.feat-cell--active { background: rgba(0,42,84,0.7); border-left: 2px solid var(--c-accent); }

.feat-cell a {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
  height: 100%;
  color: inherit;
}
.feat-label {
  font-family: var(--font-hud);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--c-dark);
  background: var(--c-accent);
  padding: 0.15em 0.5em;
  align-self: flex-start;
  text-transform: uppercase;
}
.feat-cell strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--c-primary);
  line-height: 1.35;
}
.feat-cell p {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ===== Related Section ===== */
.related-section { margin-bottom: 2rem; }

/* ===== Footer ===== */
.site-footer {
  background: rgba(0,10,20,0.95);
  border-top: 1px solid var(--c-border);
  margin-top: 3rem;
}

.footer-cta {
  background: linear-gradient(135deg, rgba(0,255,65,0.1), rgba(153,255,204,0.05));
  border-bottom: 1px solid var(--c-border);
  padding: 2rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-align: center;
}
.footer-cta strong {
  font-family: var(--font-hud);
  font-size: 1rem;
  color: var(--c-primary);
  letter-spacing: 0.05em;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-tagline {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* 页脚导航：footer > nav > dl > dt/dd > a */
.footer-nav dl {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.footer-nav dt, .footer-nav dd {
  padding: 0;
}
.footer-nav dt a, .footer-nav dd a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  border-bottom: 1px solid rgba(153,255,204,0.06);
  transition: color var(--transition);
}
.footer-nav dt a:hover, .footer-nav dd a:hover {
  color: var(--c-primary);
}

.footer-legal {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.copyright {
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  opacity: 0.7;
}

/* ===== Animations ===== */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FAQ specific ===== */
.faq-content .faq-q,
.faq-content h2,
.faq-content h3 {
  cursor: default;
}
.faq-main { min-width: 0; }

/* ===== Privacy ===== */
.privacy-content { max-width: var(--prose-w); }

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .pill-nav {
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    max-width: calc(100vw - 80px);
  }
  .pill-nav::-webkit-scrollbar { display: none; }
  .pill {
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.72rem;
    flex-shrink: 0;
  }
  .brand-icon { width: 40px; height: 40px; }

  .hero-wrap { height: auto; min-height: 280px; padding: 3rem 0 3.5rem; }
  .hero-h1 { font-size: 1.3rem; }

  .section-with-aside,
  .faq-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cell-grid {
    grid-template-columns: 1fr;
  }
  .feat-grid {
    grid-template-columns: 1fr 1fr;
  }

  main { padding: 1.5rem 1rem; }

  .footer-cta { flex-direction: column; gap: 1rem; }
}

@media (max-width: 480px) {
  .feat-grid {
    grid-template-columns: 1fr;
  }
  body { font-size: 16px; }
  .hero-h1 { font-size: 1.2rem; }
}
