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

:root {
  --ink: #001e3c;
  --ink-lift: #01284c;
  --mint: #99ffcc;
  --acid: #00ff41;
  --txt: #e2f7ee;
  --dim: #a3c3bb;
  --line: rgba(153, 255, 204, 0.18);
  --glass: rgba(153, 255, 204, 0.06);
  --r: 10px;
  --rail: 232px;
  --pad: clamp(18px, 4vw, 54px);
  --disp: 'Space Grotesk', 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--txt);
  background-color: var(--ink);
  background-image:
    radial-gradient(58% 44% at 84% 6%, rgba(0, 255, 65, 0.17), transparent 70%),
    radial-gradient(46% 36% at 6% 94%, rgba(153, 255, 204, 0.14), transparent 72%),
    radial-gradient(72% 62% at 52% 48%, rgba(1, 40, 76, 0.92), rgba(0, 30, 60, 1) 78%);
  background-attachment: fixed;
  font-family: 'Archivo', 'Space Grotesk', system-ui, -apple-system, 'Noto Sans SC', sans-serif;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: -12vh -12vw;
  z-index: 0;
  pointer-events: none;
  filter: blur(34px);
  background:
    radial-gradient(closest-side at 32% 28%, rgba(0, 255, 65, 0.12), transparent 72%),
    radial-gradient(closest-side at 74% 66%, rgba(153, 255, 204, 0.12), transparent 72%);
  animation: drift 28s ease-in-out infinite alternate;
}

main,
footer {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin-left: var(--rail);
  margin-right: auto;
}

main { padding: 0 var(--pad); }
footer { padding: 0 var(--pad) 34px; }

/* 左侧固定导航 */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.95), rgba(0, 30, 60, 0.76));
  border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 6px;
  color: var(--mint);
  text-decoration: none;
  font-family: var(--disp);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.mark-cell {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 52% 46% 50% 48%;
  background: radial-gradient(circle at 34% 30%, var(--mint), var(--acid) 62%, rgba(0, 255, 65, 0.15));
  box-shadow: 0 0 0 1px rgba(153, 255, 204, 0.42), 0 0 18px rgba(0, 255, 65, 0.6);
  animation: breathe 5.5s ease-in-out infinite;
}

.rail nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail nav li {
  opacity: 0;
  animation: rise 0.5s ease forwards;
}
.rail nav li:nth-child(1) { animation-delay: 0.05s; }
.rail nav li:nth-child(2) { animation-delay: 0.1s; }
.rail nav li:nth-child(3) { animation-delay: 0.15s; }
.rail nav li:nth-child(4) { animation-delay: 0.2s; }
.rail nav li:nth-child(5) { animation-delay: 0.25s; }
.rail nav li:nth-child(6) { animation-delay: 0.3s; }
.rail nav li:nth-child(7) { animation-delay: 0.35s; }

.rail nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 11px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: color 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.rail nav a:hover,
.rail nav a:focus-visible {
  color: var(--mint);
  background: var(--glass);
  border-color: var(--line);
}

.rail nav a[aria-current='true'] {
  color: #001e3c;
  font-weight: 600;
  border-color: transparent;
  background: linear-gradient(100deg, var(--mint), var(--acid));
}

/* 顶部紧凑带 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(110px, 200px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 44px);
  min-height: 45vh;
  padding: clamp(28px, 6vh, 58px) 0 clamp(32px, 7vh, 62px);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 8px;
  background: linear-gradient(90deg, var(--acid), var(--mint) 46%, rgba(153, 255, 204, 0));
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
}

.hero-figure {
  margin: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}

.hero-figure > * { grid-area: 1 / 1; }

.cell {
  width: 100%;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 0 26px rgba(0, 255, 65, 0.32));
}

.cell .b1,
.cell .b2,
.cell .b4 { transform-origin: 110px 110px; }

.cell .b1 { animation: breathe 7s ease-in-out infinite; }
.cell .b2 { animation: breathe 9s ease-in-out infinite reverse; }
.cell .b3 { transform-origin: 110px 110px; animation: spin 44s linear infinite; }
.cell .b4 { animation: breathe 4.5s ease-in-out infinite; }

.hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.hero-copy { text-align: right; }

.hero-copy h1 {
  margin: 0;
  font-family: var(--disp);
  font-size: clamp(30px, 4.6vw, 54px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--mint);
  text-shadow: 0 0 34px rgba(0, 255, 65, 0.26);
  overflow-wrap: anywhere;
}

.lede {
  margin: 14px 0 0 auto;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--dim);
}

/* 正文 */
.prose {
  position: relative;
  padding: clamp(26px, 6vh, 50px) 0 0;
}

.prose > article {
  position: relative;
  padding: clamp(24px, 5vh, 42px) 0 clamp(28px, 6vh, 50px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 26px;
}

.prose > article::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.8);
}

.prose > article:first-child {
  border-top: 0;
  padding-top: 0;
}

.prose > article:first-child::before { display: none; }

.prose small,
footer small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--disp);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.2em;
  color: var(--acid);
}

.prose h2 {
  margin: 0 0 14px;
  font-family: var(--disp);
  font-size: clamp(23px, 3vw, 33px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--mint);
}

.prose h3 {
  margin: 26px 0 10px;
  font-family: var(--disp);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--mint);
}

.prose p { margin: 0 0 1.05em; }

.prose a {
  color: var(--mint);
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--acid); }

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.prose li { margin: 0.35em 0; }

.prose strong { color: var(--mint); font-weight: 600; }

.prose blockquote {
  margin: 0 0 1.2em;
  padding: 16px 18px;
  color: var(--txt);
  background: var(--glass);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acid);
  border-radius: 0 var(--r) var(--r) 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose figure {
  margin: 0 0 1.2em;
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.1);
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.2em;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

/* 页脚 */
footer article {
  padding: clamp(22px, 4vh, 36px) 0;
  border-top: 1px solid var(--line);
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: clamp(28px, 6vh, 54px);
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(100deg, rgba(0, 255, 65, 0.13), rgba(153, 255, 204, 0.04));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.foot-cta small {
  width: 100%;
  margin-bottom: 0;
}

.foot-cta h2 {
  margin: 0;
  font-family: var(--disp);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.foot-cta h2 a {
  color: var(--mint);
  text-decoration: none;
}

.foot-cta h2 a:hover { color: var(--acid); }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 16px;
  color: var(--acid);
  text-decoration: none;
  border: 1px solid rgba(0, 255, 65, 0.45);
  border-radius: var(--r);
  transition: background 0.24s ease, color 0.24s ease;
}

.back:hover,
.back:focus-visible {
  color: var(--ink);
  background: var(--acid);
}

.foot-map ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}

.foot-map a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border-radius: var(--r);
  transition: color 0.24s ease, background 0.24s ease;
}

.foot-map a:hover { color: var(--mint); background: var(--glass); }

.foot-base p {
  margin: 0;
  font-size: 16px;
  color: var(--dim);
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rise {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

@media (max-width: 860px) {
  .rail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(0, 30, 60, 0.96);
  }

  .mark {
    flex: 0 0 auto;
    padding: 4px 8px;
    font-size: 16px;
    white-space: nowrap;
  }

  .rail nav { flex: 1 1 auto; min-width: 0; }

  .rail nav ul { flex-direction: row; gap: 2px; }

  .rail nav a {
    padding: 9px 12px;
    white-space: nowrap;
  }

  main,
  footer { margin-left: 0; }

  main { padding: 0 18px; }
  footer { padding: 0 18px 30px; }

  body { padding-bottom: 74px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 24px;
    gap: 14px;
  }

  .hero-figure { aspect-ratio: auto; }

  .cell { max-width: 128px; }

  .hero-copy { text-align: right; }

  .lede { max-width: none; }

  .prose > article { scroll-margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
