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

:root {
  --acc: #00ff80;
  --blu: #0000ff;
  --ink: #000000;
  --line: #2c2c2c;
  --panel: #0a0a0a;
  --fg: #f4f4f4;
  --mute: #9a9a9a;
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.005em;
}

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

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

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* 左侧固定竖排 */

.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 218px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px 26px;
  background: var(--ink);
  border-right: 3px solid var(--acc);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px;
  border: 3px solid var(--acc);
  background: var(--ink);
  color: var(--acc);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: none;
}

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

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.search {
  display: flex;
  border: 3px solid var(--line);
  background: var(--ink);
}

.search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: var(--ink);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  appearance: none;
}

.search input::placeholder {
  color: var(--mute);
}

.search input:focus {
  outline: 3px solid var(--acc);
  outline-offset: -3px;
}

.nav ol,
.nav .sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav ol {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav li {
  position: relative;
  animation: rise 0.18s ease-out both;
}

.nav li:nth-child(2) { animation-delay: 0.04s; }
.nav li:nth-child(3) { animation-delay: 0.08s; }
.nav li:nth-child(4) { animation-delay: 0.12s; }

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-left: 6px solid var(--line);
  background: #0c0c0c;
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: none;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--acc);
  border-left-color: var(--ink);
  color: var(--ink);
}

.nav .has-sub > a {
  border-left-color: var(--blu);
}

.nav .sub {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding-left: 8px;
  border-left: 2px dashed var(--line);
}

.nav .has-sub:hover .sub,
.nav .has-sub:focus-within .sub {
  display: flex;
}

/* 主体 */

main {
  margin-left: 218px;
}

.hero {
  position: relative;
  min-height: 45vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background-color: var(--blu);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 44px);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
}

.hero-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  filter: grayscale(0.25) contrast(1.15);
}

.hero-txt {
  position: relative;
  padding: 22px 20px 52px;
  text-align: right;
}

.hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.9rem, 5vw, 3.9rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-shadow: 4px 4px 0 #000000;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  align-items: start;
  border-top: 3px solid var(--acc);
}

.prose {
  min-width: 0;
  padding: 10px 22px 48px;
}

.prose > div {
  padding: 26px 0 30px;
  border-top: 3px solid var(--line);
  scroll-margin-top: 14px;
}

.prose > div:first-child {
  border-top: 0;
  padding-top: 22px;
}

.prose h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  line-height: 1.18;
}

.prose h3 {
  margin: 22px 0 10px;
  color: var(--acc);
  font-size: 1.12rem;
  line-height: 1.3;
}

.prose p {
  margin: 0 0 15px;
  max-width: 66ch;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.prose li {
  margin: 0 0 8px;
}

.prose strong {
  color: #ffffff;
}

.prose a {
  color: var(--acc);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover {
  background: var(--acc);
  color: var(--ink);
  text-decoration: none;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 6px solid var(--blu);
  background: #0b0b16;
}

.prose figure {
  margin: 0 0 18px;
}

.prose img {
  width: 100%;
  height: auto;
  border: 3px solid var(--line);
}

.prose table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 16px;
}

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

.prose th {
  background: #111111;
  color: var(--acc);
}

hr {
  height: 0;
  margin: 10px 0 16px;
  border: 0;
  border-top: 3px solid var(--acc);
}

/* 右侧栏 */

.side-rail {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 22px 16px 26px;
  border-left: 3px solid var(--line);
  background: var(--panel);
}

.side-rail h2 {
  margin: 0 0 6px;
  color: var(--acc);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.side-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rail;
}

.side-rail li {
  counter-increment: rail;
  border-bottom: 2px solid var(--line);
}

.side-rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 2px;
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: none;
}

.side-rail a::before {
  content: counter(rail, decimal-leading-zero);
  color: var(--acc);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.side-rail a:hover,
.side-rail a:focus-visible {
  background: var(--acc);
  color: var(--ink);
}

/* 页脚 */

footer {
  margin-left: 218px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 4px solid var(--acc);
  background: var(--ink);
}

footer div {
  padding: 22px 18px;
  border-right: 2px solid var(--line);
  animation: rise 0.18s ease-out both;
}

footer div:nth-of-type(2) { animation-delay: 0.05s; }
footer div:nth-of-type(3) { animation-delay: 0.1s; }

footer div:last-of-type {
  border-right: 0;
}

.f-brand {
  grid-column: span 2;
}

.giant {
  margin: 0 0 12px;
  color: var(--acc);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  word-break: keep-all;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  border: 3px solid var(--acc);
  color: var(--acc);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: none;
}

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

footer h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0.06em;
}

footer ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer ol a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 0;
  border-bottom: 2px solid #171717;
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: none;
}

footer ol a:hover,
footer ol a:focus-visible {
  background: var(--blu);
  color: #ffffff;
}

.kw {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  word-break: break-word;
}

.foot-bar {
  grid-column: 1 / -1;
  padding: 12px 18px 18px;
  border-top: 3px solid var(--line);
  color: var(--mute);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 16px;
  }

  .side {
    position: static;
    width: auto;
    inset: auto;
    gap: 10px;
    padding: 12px 12px 14px;
    border-right: 0;
    border-bottom: 3px solid var(--acc);
    overflow: visible;
  }

  .brand {
    justify-content: flex-start;
    min-height: 46px;
  }

  main,
  footer {
    margin-left: 0;
  }

  .nav ol {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav li {
    flex: 0 0 auto;
  }

  .nav a {
    border-left: 0;
    border-bottom: 5px solid var(--line);
    white-space: nowrap;
  }

  .nav .has-sub > a {
    border-left: 0;
    border-bottom-color: var(--blu);
  }

  .nav .sub {
    display: flex;
    padding-left: 0;
    padding-top: 6px;
    border-left: 0;
    border-top: 2px dashed var(--line);
  }

  .nav a,
  .side-rail a,
  footer ol a {
    font-size: 16px;
  }

  .hero {
    min-height: 42vh;
  }

  .hero-txt {
    padding: 18px 16px 44px;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose {
    padding: 8px 16px 34px;
  }

  .side-rail {
    position: static;
    border-left: 0;
    border-top: 3px solid var(--line);
    padding: 20px 16px 26px;
  }

  footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .f-brand {
    grid-column: 1 / -1;
  }

  footer div:nth-of-type(2) {
    border-right: 0;
  }
}

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

  * {
    animation: none !important;
    transition: none !important;
  }
}

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