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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mut: #5a5a5a;
  --line: #e3e3e3;
  --soft: rgba(0, 0, 0, .035);
  --r: 18px;
}

*, *::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: "Fira Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.015em;
}

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

.tick {
  display: inline-block;
  width: .48em;
  height: .48em;
  margin-left: .45em;
  background: var(--ink);
  vertical-align: .06em;
}

/* ---------- 顶栏 ---------- */
.hd {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem clamp(16px, 4vw, 40px);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.hd-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 42vw;
  overflow: hidden;
  white-space: nowrap;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.hd-logo img {
  height: 34px;
  width: auto;
  border-radius: 8px;
}

.hd-mark {
  display: inline-block;
  line-height: 1;
}

.hd-menu {
  margin-left: auto;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: none;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.hd-menu:hover { background: var(--ink); color: var(--paper); }

.hd-contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  transition: opacity .2s;
}

.hd-contact:hover { opacity: .78; }

/* ---------- 粘性锚点条 ---------- */
.bar {
  position: sticky;
  top: 61px;
  z-index: 55;
  display: flex;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  scrollbar-width: none;
}

.bar::-webkit-scrollbar { display: none; }

.bar-a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  font-size: 16px;
  transition: background .2s, color .2s;
}

.bar-a:hover,
.bar-a:focus-visible,
.bar-a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  min-height: calc(100svh - 106px);
  padding: clamp(30px, 6vw, 76px) clamp(16px, 4vw, 40px) 74px;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}

.hero-fig {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.fg {
  margin: 0;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  background: #f2f2f2;
}

.fg img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

.fg.b { margin-top: 36px; }

.hero-copy {
  min-width: 0;
  text-align: right;
}

.hero h1 {
  font-size: clamp(30px, 5.2vw, 64px);
  letter-spacing: -.035em;
}

.hero p {
  margin: 18px 0 0 auto;
  max-width: 44ch;
  color: var(--mut);
  font-size: 17px;
}

.slash {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -3px;
  height: 34px;
  background: var(--ink);
  transform: skewY(-1.7deg);
  transform-origin: left bottom;
  pointer-events: none;
}

/* ---------- 主体网格 ---------- */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.grid2 {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 4vw, 52px) 0 56px;
}

/* ---------- 侧栏 ---------- */
.side {
  align-self: start;
  position: sticky;
  top: 124px;
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

.side-t {
  font-size: 16px;
  letter-spacing: .05em;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}

.side-list { display: flex; flex-direction: column; }

.side-a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .2s, color .2s;
}

.side-a:last-child { border-bottom: 0; }

.side-a:hover,
.side-a:focus-visible { padding-left: 6px; color: var(--mut); }

.side-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 10px;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 正文 ---------- */
.post { min-width: 0; }

.post > div {
  padding: 6px 0 30px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.post > div:last-child { border-bottom: 0; }

.post h2 {
  font-size: clamp(22px, 2.6vw, 32px);
  margin: 32px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.post > div:first-child h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.post h3 { font-size: 20px; margin: 26px 0 0; }
.post h4 { font-size: 18px; margin: 22px 0 0; }

.post p { margin: 14px 0; }
.post ul, .post ol { margin: 14px 0; padding-left: 1.4em; }
.post li { margin: 6px 0; }

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

.post a:hover { background: var(--ink); color: var(--paper); }

.post img {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.post blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--soft);
}

.post blockquote p:first-child { margin-top: 0; }
.post blockquote p:last-child { margin-bottom: 0; }

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

.post th, .post td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.post th { background: var(--soft); }

.post code, .post pre {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 15px;
}

.post pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--soft);
}

.post hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

/* ---------- 页脚 ---------- */
.ft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 30px;
  margin-top: 44px;
  padding: 30px clamp(16px, 4vw, 40px) 26px;
  border-top: 2px solid var(--ink);
}

.ft-name { font-size: 18px; }

.ft-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin: 0;
}

.ft-nav dt { font-size: 16px; color: var(--mut); }
.ft-nav dd { margin: 0; }

.ft-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 3px;
  font-size: 16px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

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

.ft-cta { margin-left: auto; }

.ft-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0 26px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  font-size: 20px;
  font-weight: 600;
  transition: transform .22s;
}

.ft-cta a:hover { transform: translateX(5px); }

.ft-copy {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 15px;
  color: var(--mut);
  padding-left: 0;
}

/* ---------- 全屏菜单 ---------- */
.ov {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 6vw, 64px);
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s ease;
}

.ov.on { opacity: 1; visibility: visible; }

.ov-x {
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--paper);
  border-radius: var(--r);
  background: transparent;
  color: var(--paper);
  font-size: 16px;
  cursor: pointer;
}

.ov-in { display: flex; flex-direction: column; max-width: 760px; }

.ov-in a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-height: 54px;
  padding: 6px 0;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
}

.ov-n {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  opacity: .68;
}

.ov-in a:hover { letter-spacing: .02em; }

/* ---------- 滚动显现 ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}

.js .rv.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .grid2 { grid-template-columns: 1fr; }
  .side { position: static; top: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 58px; }
  .hero-copy { text-align: left; order: -1; }
  .hero p { margin-left: 0; max-width: none; }
  .hero-fig { margin-top: 22px; }
  .fg.b { margin-top: 0; }
  .ft-cta { margin-left: 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hd { gap: .5rem; }
  .hd-contact { padding: 0 12px; }
  .hd-menu { padding: 0 13px; }
  .hero h1 { font-size: clamp(28px, 9vw, 40px); }
  .fg img { aspect-ratio: 1 / 1; }
  .ft { gap: 14px 20px; }
  .ft-cta { width: 100%; }
  .ft-cta a { width: 100%; justify-content: center; }
  .post pre { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .bar-a, .side-a, .ft-cta a, .hd-menu, .hd-contact { transition: none; }
}

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