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

:root {
  --green: #87ff71;
  --cyan: #01cdfe;
  --ink: #192617;
  --pink: #ff71ce;
  --deep: #0a1209;
  --paper: #e9ffe4;
  --body: #d7efd1;
  --muted: #9fbf9a;
  --line: rgba(135, 255, 113, 0.28);
  --font-head: "Calistoga", Georgia, "Songti SC", serif;
  --font-body: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--deep);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  color: var(--body);
  overflow-x: clip;
  background-color: var(--deep);
  background-image:
    radial-gradient(70vw 46vw at 94% -10%, rgba(1, 205, 254, 0.34), transparent 62%),
    radial-gradient(56vw 40vw at -6% 16%, rgba(135, 255, 113, 0.16), transparent 68%),
    radial-gradient(94vw 56vw at 50% 106%, rgba(255, 113, 206, 0.2), transparent 72%),
    linear-gradient(180deg, #0d1a0b 0%, #0a1209 46%, #101c0d 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.55;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0 1px,
    transparent 1px 3px
  );
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

a {
  color: var(--cyan);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- 底部固定条 ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(11, 21, 10, 0.95);
  border-top: 1px solid var(--line);
  box-shadow: 0 -16px 44px rgba(1, 205, 254, 0.18);
  backdrop-filter: blur(9px);
}

.bar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: 1080px;
  margin: 0 auto;
}

.bar-nav p {
  display: contents;
  margin: 0;
}

.bar-nav a {
  order: 1;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.bar-nav a:hover,
.bar-nav a:focus-visible {
  color: var(--green);
  background: rgba(135, 255, 113, 0.12);
}

.bar-nav .brand {
  order: 0;
  flex: 1 0 100%;
  justify-content: center;
  min-height: 30px;
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(1, 205, 254, 0.65);
}

/* ---------- 主体骨架 ---------- */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 44px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 24px;
}

div {
  max-width: 74ch;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  padding: 76px 0 6px;
  overflow: hidden;
  text-align: right;
}

.hero::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -6%;
  height: 58%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(135, 255, 113, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 205, 254, 0.3) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(320px) rotateX(63deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(transparent, #000 72%);
  mask-image: linear-gradient(transparent, #000 72%);
}

.badge {
  position: absolute;
  top: 18px;
  right: 0;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 15px;
  border: 1px solid rgba(1, 205, 254, 0.6);
  border-radius: 999px;
  background: rgba(1, 205, 254, 0.13);
  color: #cbF8ff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  box-shadow: 0 0 22px rgba(1, 205, 254, 0.35);
  transform: rotate(-2deg);
  animation: drift 7s ease-in-out infinite;
}

@keyframes drift {
  50% {
    transform: rotate(1.5deg) translateY(5px);
  }
}

.hero h1 {
  margin: 6px 0 14px;
  font-size: clamp(2rem, 7vw, 4.1rem);
  color: #f4fff0;
  text-shadow:
    0 0 22px rgba(135, 255, 113, 0.5),
    0 0 46px rgba(1, 205, 254, 0.35);
  animation: neon 6.5s ease-in-out infinite;
}

@keyframes neon {
  50% {
    text-shadow:
      -2px 0 0 rgba(255, 113, 206, 0.55),
      2px 0 0 rgba(135, 255, 113, 0.5),
      0 0 30px rgba(1, 205, 254, 0.45);
  }
}

.hero .lead {
  max-width: 44ch;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-fig {
  margin: 30px 0 0;
  width: 100%;
  will-change: transform;
}

.hero-fig img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--cyan);
  border-radius: 10px;
  box-shadow: 0 0 64px rgba(1, 205, 254, 0.22);
}

/* ---------- 正文 ---------- */
div > section {
  padding: 44px 0 30px;
  border-top: 1px dashed rgba(135, 255, 113, 0.3);
}

div > section[id] {
  scroll-margin-top: 20px;
  scroll-margin-bottom: 130px;
}

div small,
.side .kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

div h2 {
  margin: 0 0 0.6em;
  font-size: clamp(1.45rem, 4.4vw, 2.1rem);
  color: #f4fff0;
  text-shadow: 0 0 20px rgba(135, 255, 113, 0.25);
}

div h3 {
  margin: 1.7em 0 0.4em;
  font-size: 1.18rem;
  color: var(--green);
}

div p {
  margin: 0 0 1.1em;
  color: var(--body);
}

div a {
  color: var(--cyan);
  text-underline-offset: 3px;
}

div strong {
  color: var(--green);
}

div ul,
div ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

div li {
  margin: 0.4em 0;
}

div blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0;
  background: rgba(1, 205, 254, 0.08);
  color: #dff6ff;
}

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

div table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

div th,
div td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(135, 255, 113, 0.2);
  text-align: left;
}

div th {
  color: var(--green);
}

div img {
  border-radius: 10px;
}

/* ---------- 侧栏 ---------- */
.side {
  padding-top: 44px;
  border-top: 1px solid rgba(1, 205, 254, 0.28);
}

.side h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  color: #eafce6;
}

.side-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(1, 205, 254, 0.3);
  border-bottom: 3px solid var(--green);
  border-radius: 10px;
  background: rgba(20, 33, 18, 0.6);
  color: var(--paper);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: rgba(135, 255, 113, 0.12);
  border-color: var(--green);
  transform: translateX(-3px);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(135, 255, 113, 0.45);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.totop:hover,
.totop:focus-visible {
  background: rgba(135, 255, 113, 0.14);
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  padding: 26px 20px calc(104px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(9, 16, 8, 0.78);
}

.foot-brand a {
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-decoration: none;
  text-shadow: 0 0 16px rgba(1, 205, 254, 0.6);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  color: var(--green);
}

.foot-copy {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* ---------- 动效 ---------- */
.js div > section,
.js .side-list li {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js div > section.in,
.js .side-list li.in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (min-width: 820px) {
  .bar-nav {
    flex-wrap: nowrap;
  }

  .bar-nav p a:nth-child(-n + 4) {
    order: 1;
  }

  .bar-nav p a:nth-child(n + 5) {
    order: 3;
  }

  .bar-nav .brand {
    order: 2;
    flex: 0 0 auto;
    margin: 0 16px;
    min-height: 44px;
    font-size: 1.12rem;
  }

  .foot {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 960px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 258px;
    gap: 56px;
    align-items: start;
    padding-top: 8px;
  }

  .side {
    position: sticky;
    top: 24px;
    padding-top: 76px;
  }

  .hero {
    padding-top: 84px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js div > section,
  .js .side-list li {
    opacity: 1;
    transform: none;
  }
}

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