@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

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

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

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

img { display: block; max-width: 100%; height: auto; }
a { color: #000000; }
a:focus-visible { outline: 2px solid #000000; outline-offset: 3px; }
.site-foot a:focus-visible { outline-color: #ffffff; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页头：两行，品牌独占一行 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 2px solid #000000;
}

.mast-top {
  padding: 14px clamp(16px, 4vw, 48px) 8px;
}

.brand {
  display: inline-block;
  min-height: 40px;
  padding: 0 6px;
  margin: 0 -6px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: clamp(19px, 3.4vw, 30px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.brand:hover { background: #000000; color: #ffffff; }

.mast-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(16px, 4vw, 48px) 12px;
}

.mast-nav nav {
  flex: 1 1 300px;
  min-width: 0;
}

.mast-nav nav p {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mast-nav nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #000000;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.35s ease, transform 0.35s ease;
}
.mast-nav nav a:hover { background: #000000; color: #ffffff; }

html.js .mast-nav nav a { opacity: 0; transform: translateY(-6px); }
html.js .mast-nav nav a.is-in { opacity: 1; transform: none; }

.search {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  border-bottom: 2px solid #000000;
}

.search input {
  font: inherit;
  font-size: 16px;
  width: 15ch;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
}
.search input:focus-visible { outline: 2px solid #000000; outline-offset: 2px; }

.search button {
  font: inherit;
  font-size: 16px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  background: #000000;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.search button:hover { background: #ffffff; color: #000000; box-shadow: inset 0 0 0 2px #000000; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  padding: clamp(28px, 7vw, 72px) clamp(16px, 4vw, 48px) clamp(48px, 9vw, 96px);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12);
  opacity: 0.5;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #000000 8%, rgba(0, 0, 0, 0.74) 46%, rgba(0, 0, 0, 0.24) 100%);
}

.hero::after {
  content: '';
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -2px;
  height: clamp(24px, 5vw, 56px);
  background: #ffffff;
  transform: skewY(-2.2deg);
  transform-origin: right bottom;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: min(760px, 100%);
  text-align: right;
}

.hero h1 {
  margin: 0 0 14px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: clamp(30px, 6.4vw, 68px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.hero .lede {
  margin: 0 0 0 auto;
  max-width: 48ch;
  color: #e8e8e8;
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- 两栏：侧栏在左 ---------- */
.wrap {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
}

.rail {
  position: sticky;
  top: 152px;
  align-self: start;
  border-top: 3px solid #000000;
  padding-top: 14px;
}

.rail-h {
  margin: 0 0 12px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.22em;
}
.rail-h span { display: inline-block; border-bottom: 2px solid #000000; padding-bottom: 2px; }

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid #dddddd;
  transition: background 0.18s ease, color 0.18s ease, padding 0.18s ease;
}
.rail-list a:hover { background: #000000; color: #ffffff; padding-left: 10px; }

.rail-top { margin: 18px 0 0; }
.rail-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px solid #000000;
}
.rail-top a:hover { background: #000000; color: #ffffff; }

/* ---------- 正文 ---------- */
.stream { min-width: 0; }
.prose { counter-reset: sec; }

.prose > div {
  counter-increment: sec;
  scroll-margin-top: 152px;
  margin: 0 0 clamp(28px, 5vw, 56px);
  padding-top: clamp(24px, 4vw, 48px);
  border-top: 1px solid #000000;
}
.prose > div:first-child { border-top: 0; padding-top: 0; }

.prose > div::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 16px;
  letter-spacing: 0.3em;
}

.prose h2 {
  margin: 0.15em 0 0.6em;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: clamp(22px, 3.6vw, 34px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0.01em;
}
.prose h2 span { display: inline-block; border-bottom: 3px solid #000000; padding-bottom: 4px; }

.prose h3 {
  margin: 1.5em 0 0.5em;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}
.prose h3 span { display: inline-block; border-bottom: 2px solid #000000; padding-bottom: 2px; }

.prose p { max-width: 64ch; margin: 0 0 1.15em; }
.prose ul, .prose ol { max-width: 62ch; margin: 0 0 1.2em; padding-left: 1.5em; }
.prose li { margin: 0.4em 0; }

.prose blockquote {
  margin: 1.7em 0;
  padding: 18px 22px;
  background: #000000;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.65;
}
.prose blockquote p { max-width: none; margin: 0; }

.prose figure { margin: 1.7em 0; }
.prose figcaption {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid #000000;
  font-size: 16px;
  color: #3a3a3a;
}

.prose > div:first-of-type > p:first-of-type::first-letter {
  float: left;
  padding: 6px 10px 0 0;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 3.6em;
  line-height: 0.8;
}

.prose .is-hidden { display: none; }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: clamp(40px, 7vw, 80px);
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 48px) 0;
  background: #000000;
  color: #ffffff;
}

.f-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  max-width: 1240px;
  margin: 0 auto;
}

.f-logo {
  margin: 0;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: clamp(28px, 7vw, 66px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.site-foot address {
  max-width: 26ch;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #3a3a3a;
  font-size: 16px;
  font-style: normal;
  color: #c9c9c9;
}

.f-col h3 {
  margin: 0 0 10px;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.2em;
}
.f-col h3 span { display: inline-block; border-bottom: 2px solid #ffffff; padding-bottom: 3px; }

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

.f-col li a {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid #333333;
  transition: background 0.18s ease, color 0.18s ease, padding 0.18s ease;
}
.f-col li a:hover { background: #ffffff; color: #000000; padding-left: 8px; }

.f-bottom {
  max-width: 1240px;
  margin: clamp(24px, 4vw, 44px) auto 0;
  padding: 18px 0;
  border-top: 1px solid #333333;
  text-align: center;
}
.f-bottom p { margin: 0; font-size: 16px; color: #c9c9c9; }

/* ---------- 动效 ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .rail { position: static; }
  .prose > div { scroll-margin-top: 24px; }
}

@media (max-width: 760px) {
  .masthead { position: static; }
  .mast-nav { flex-direction: column; align-items: stretch; }
  .search { margin-left: 0; width: 100%; }
  .search input { flex: 1 1 auto; width: auto; }
  .f-grid { grid-template-columns: 1fr; }
  .f-logo { font-size: clamp(26px, 9vw, 44px); }
  .hero { min-height: 42vh; padding-bottom: clamp(40px, 12vw, 64px); }
  .hero .lede { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .mast-nav nav a { opacity: 1; transform: none; transition: none; }
  .mast-nav nav a, .rail-list a, .f-col li a, .brand, .search button { transition: none; }
}

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