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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --u: 8px;
  --pad: clamp(1rem, 4vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

article[id] {
  scroll-margin-top: 150px;
}

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

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

/* ---------- 页头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem var(--u);
  padding: 0.75rem var(--pad);
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand .mark {
  width: 14px;
  height: 14px;
  background: var(--ink);
  border-radius: 4px;
}

.brand .word {
  font-size: 1.05rem;
}

.find {
  flex: 0 1 260px;
}

.find input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.find input:focus-visible,
.pillnav a:focus-visible,
.rail a:focus-visible,
.col a:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.head-nav {
  padding: 0.5rem var(--pad);
  overflow-x: auto;
  scrollbar-width: thin;
}

.pillnav ol {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pillnav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.pillnav a:hover,
.pillnav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 主区 ---------- */

main {
  display: block;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr auto auto;
  gap: 1rem;
  min-height: 62vh;
  padding: 1.5rem 0 0;
  border-bottom: 2px solid var(--ink);
}

.tile {
  margin: 0;
  min-height: 150px;
  background: var(--ink);
  border-radius: 4px;
  overflow: hidden;
}

.tile .tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.4s ease;
}

.tile:hover .tile-img {
  transform: scale(1.03);
}

.tile.a {
  grid-column: 1 / 6;
  grid-row: 1;
  align-self: end;
  aspect-ratio: 4 / 3;
}

.tile.b {
  grid-column: 8 / 13;
  grid-row: 1;
  align-self: start;
  margin-top: 2.5rem;
  aspect-ratio: 5 / 4;
}

.hero-copy {
  grid-column: 1 / 13;
  grid-row: 2;
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

.band {
  grid-column: 1 / 13;
  grid-row: 3;
  display: block;
  height: 8px;
  margin-bottom: -2px;
  background: var(--ink);
  border-radius: 4px;
  transform: skewY(-1.4deg);
  transform-origin: left center;
}

.rig {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  padding: 2.5rem 0 3rem;
}

/* ---------- 正文 ---------- */

.content {
  min-width: 0;
}

.content article {
  padding: 2rem 0;
  border-top: 1px solid var(--ink);
}

.content article:first-child {
  border-top: 0;
  padding-top: 0.25rem;
}

.content small {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  font-weight: 500;
}

.content h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.content h3 {
  margin: 1.6rem 0 0.6rem;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 700;
}

.content p {
  margin: 0 0 1rem;
  max-width: 66ch;
}

.content ul,
.content ol {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
  max-width: 66ch;
}

.content li {
  margin-bottom: 0.4rem;
}

.content a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

.content figure {
  margin: 1.5rem 0;
}

.content figcaption {
  margin-top: 0.4rem;
  font-size: 0.78rem;
}

.content blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
}

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

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

.content th,
.content td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}

.content code,
.content pre {
  font-family: inherit;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
}

.content code {
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

.content pre {
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

.content pre code {
  padding: 0;
}

.content hr {
  border: 0;
  height: 2px;
  background: var(--ink);
  margin: 2rem 0;
}

/* ---------- 侧栏 ---------- */

.rail {
  position: sticky;
  top: 150px;
  align-self: start;
  padding-left: 1.25rem;
  border-left: 2px solid var(--ink);
  font-size: 0.88rem;
}

.rail small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
}

.rail h2 {
  margin: 0.2rem 0 0.8rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.rail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
}

.rail a:hover {
  background: var(--ink);
  color: var(--paper);
  padding-left: 0.4rem;
}

/* ---------- 页脚 ---------- */

footer {
  border-top: 2px solid var(--ink);
  margin-top: 1.5rem;
}

.cta {
  display: block;
  margin: 0 var(--pad);
  margin-top: 2rem;
  padding: 2.25rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  transition: opacity 0.18s ease;
}

.cta:hover {
  opacity: 0.85;
}

.cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.25rem var(--pad);
}

.col small {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
}

.col .word {
  font-weight: 700;
}

.col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.col a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  font-size: 0.9rem;
}

.col a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.col address {
  font-style: normal;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 0.4rem;
}

.colophon {
  border-top: 1px solid var(--ink);
  padding: 0.9rem var(--pad);
}

.colophon p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.colophon {
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  .rig {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .rail {
    position: static;
    border-left: 0;
    border-top: 2px solid var(--ink);
    padding-left: 0;
    padding-top: 1rem;
  }

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

@media (max-width: 640px) {
  article[id] {
    scroll-margin-top: 176px;
  }

  .hero {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto auto auto;
    min-height: 0;
    padding-top: 1rem;
  }

  .tile.a {
    grid-column: 1 / 4;
    grid-row: 1;
    aspect-ratio: 1 / 1;
  }

  .tile.b {
    grid-column: 4 / 7;
    grid-row: 1;
    margin-top: 1.75rem;
    aspect-ratio: 1 / 1;
  }

  .hero-copy {
    grid-column: 1 / 7;
    grid-row: 2;
    text-align: left;
    padding: 1.25rem 0 0.75rem;
  }

  .band {
    grid-column: 1 / 7;
    grid-row: 3;
  }

  .cta {
    padding: 1.75rem 1.15rem;
  }

  .find {
    flex: 1 1 100%;
  }
}

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

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

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