:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-strong: #181e24;
  --line: #29313a;
  --text: #f1f4f6;
  --muted: #9aa6b2;
  --amber: #ffcb6b;
  --cyan: #7de2d1;
  --max: 1120px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 20px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 13, 16, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner,
.section,
.article-shell,
.footer-inner {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.brand-mark i {
  display: block;
  background: var(--amber);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(6),
.brand-mark i:nth-child(8) {
  background: var(--cyan);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-color: var(--amber);
}

.hero {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(44px, 7vw, 96px);
  padding-block: 88px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font: 700 0.78rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 34px;
  color: #bdc6ce;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 6px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: 650 0.75rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pixel-board {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pixel-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 12.5% 12.5%;
}

.pixel-board::after {
  content: "";
  position: absolute;
  inset: 25% 12.5% 12.5% 25%;
  background:
    linear-gradient(90deg, transparent 0 16.66%, var(--cyan) 16.66% 33.33%, transparent 33.33% 50%, var(--amber) 50% 66.66%, transparent 66.66%),
    linear-gradient(transparent 0 16.66%, var(--amber) 16.66% 33.33%, transparent 33.33% 50%, var(--cyan) 50% 66.66%, transparent 66.66%);
  opacity: 0.9;
  filter: drop-shadow(18px 18px 0 rgba(255, 203, 107, 0.14));
}

.section {
  padding-block: 96px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 480px;
  margin-bottom: 2px;
  color: var(--muted);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.note-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  transition: transform 160ms ease, border-color 160ms ease;
}

.note-card:hover {
  transform: translateY(-5px);
  border-color: #53606c;
}

.note-card time,
.article-meta {
  color: var(--muted);
  font: 600 0.75rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.note-card h3 {
  margin: 42px 0 14px;
  font-size: 1.45rem;
  line-height: 1.25;
}

.note-card p {
  color: var(--muted);
}

.card-arrow {
  margin-top: auto;
  color: var(--amber);
  font-weight: 700;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.method-item {
  min-height: 230px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(18, 22, 27, 0.72);
}

.method-item:last-child {
  border-right: 0;
}

.method-index {
  display: block;
  margin-bottom: 44px;
  color: var(--cyan);
  font: 700 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.method-item h3 {
  margin-bottom: 10px;
}

.method-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(180px, 1fr);
  gap: clamp(48px, 9vw, 120px);
  padding-block: 92px 120px;
}

.article-header {
  margin-bottom: 54px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 12px 0 24px;
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.article-lead {
  color: #bdc6ce;
  font-size: 1.18rem;
}

.prose h2 {
  margin: 56px 0 16px;
  font-size: 1.8rem;
  letter-spacing: -0.025em;
}

.prose h3 {
  margin: 34px 0 12px;
  font-size: 1.22rem;
}

.prose p,
.prose li {
  color: #c6cdd3;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose code {
  padding: 0.15em 0.38em;
  background: #20272e;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.callout {
  margin: 36px 0;
  padding: 24px 26px;
  border-left: 3px solid var(--cyan);
  background: var(--panel);
  color: #d9dfe3;
}

.article-aside {
  align-self: start;
  position: sticky;
  top: 110px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.article-aside strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
}

.article-aside a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.article-aside a:hover {
  color: var(--amber);
}

.simple-page {
  width: min(calc(100% - 40px), 820px);
  margin-inline: auto;
  padding-block: 100px 130px;
}

.simple-page h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}

.fact-list {
  display: grid;
  gap: 1px;
  margin-top: 48px;
  border: 1px solid var(--line);
  background: var(--line);
}

.fact-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 26px;
  padding: 22px 24px;
  background: var(--panel);
}

.fact-row dt {
  color: var(--muted);
}

.fact-row dd {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #090b0e;
}

.footer-inner {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a:hover {
  color: var(--text);
}

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 74px;
  }

  .pixel-board {
    width: min(100%, 460px);
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

  .note-card {
    min-height: 260px;
  }

  .method-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .method-item:nth-child(2) {
    border-right: 0;
  }

  .method-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
    order: -1;
    padding: 18px;
    border: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .header-inner {
    min-height: 82px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
    gap: 22px;
    font-size: 0.84rem;
  }

  .section {
    padding-block: 72px;
  }

  .section-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .method-item,
  .method-item:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .method-item:last-child {
    border-bottom: 0;
  }

  .fact-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-inner {
    justify-content: center;
    padding-block: 28px;
  }
}

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

  .note-card {
    transition: none;
  }
}
