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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: #d8d8d8;
  --mute: #5f5f5f;
  --sans: 'Exo', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gut: clamp(1rem, 4vw, 3.25rem);
  --wide: 1200px;
}

*,
*::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: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

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

::selection { background: var(--ink); color: var(--paper); }

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

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

.site-head {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.brand-row {
  padding: 1rem var(--gut);
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.2em;
}

.brand-mark { width: 26px; height: 26px; }

.brand-name { border-bottom: 2px solid transparent; transition: border-color 0.22s ease; }
.brand:hover .brand-name { border-bottom-color: var(--ink); }

.menu-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--gut);
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav p {
  display: flex;
  gap: 0.15rem;
  margin: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.85rem 0.62rem;
  font-size: 0.88rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.22s ease, opacity 0.22s ease;
}

.site-nav a:hover { border-bottom-color: var(--ink); }

.ico {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  transition: background 0.22s ease;
}

.site-nav a:hover .ico { background: var(--ink); }

.search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--ink);
  flex: 0 0 auto;
}

.search input {
  width: 8.5rem;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.35rem 0.1rem;
}

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

.search button {
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
}

.search button:hover { background: var(--paper); color: var(--ink); }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: clamp(2.75rem, 8vw, 6rem) var(--gut);
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 24ch;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 5.25rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  word-break: break-word;
}

.hero-fig {
  position: absolute;
  margin: 0;
  width: clamp(6.5rem, 21vw, 15rem);
  z-index: 1;
}

.hero-fig img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--ink);
  filter: grayscale(1) contrast(1.06);
}

.hero-fig--a { left: var(--gut); bottom: 11%; }
.hero-fig--b { right: var(--gut); top: 11%; }

/* ---------- 内容区 ---------- */

.grid-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15.5rem;
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gut) clamp(3rem, 7vw, 5rem);
}

.grid-zone > aside { grid-column: 2; align-self: start; position: sticky; top: 1.25rem; }

.grid-zone > article {
  grid-column: 1;
  padding: clamp(2rem, 5vw, 3.25rem) 0;
  border-top: 1px solid var(--ink);
  scroll-margin-top: 2rem;
}

.grid-zone > article:first-of-type { border-top: 0; padding-top: 0; }

main article[id] { scroll-margin-top: 2rem; }

.grid-zone h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.grid-zone h2 > span {
  display: inline-block;
  position: relative;
  padding-bottom: 0.14em;
}

.grid-zone h2 > span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ink);
}

.grid-zone h2 > span > span { font-weight: 300; }

.grid-zone h3 {
  margin: 2rem 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.grid-zone h3 > span { border-bottom: 1px solid var(--ink); padding-bottom: 0.16em; }

.grid-zone p { margin: 0 0 1.05rem; }

.grid-zone ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }
.grid-zone li { margin-bottom: 0.5rem; }

.grid-zone ul {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.grid-zone ul li {
  position: relative;
  padding-left: 1.45rem;
}

.grid-zone ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 7px;
  height: 7px;
  background: var(--ink);
}

.grid-zone a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.grid-zone a:hover { border-bottom-color: var(--ink); }

.grid-zone blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 0 0.4rem 1.1rem;
  border-left: 3px solid var(--ink);
  font-weight: 300;
}

.grid-zone table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3rem;
  font-size: 0.94rem;
}

.grid-zone th,
.grid-zone td {
  border: 1px solid var(--ink);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.grid-zone th { background: var(--ink); color: var(--paper); font-weight: 500; }

.grid-zone hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

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

.rail {
  padding-top: 0.35rem;
  border-left: 1px solid var(--ink);
  padding-left: 1.15rem;
}

.rail-block + .rail-block { margin-top: 1.85rem; }

.grid-zone .rail h2 {
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.grid-zone .rail h2 > span { padding-bottom: 0.2em; }
.grid-zone .rail h2 > span::after { height: 1px; }

.rail-links {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.rail-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0;
  font-size: 0.89rem;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.22s ease, border-color 0.22s ease;
}

.rail-links a:hover { padding-left: 0.45rem; border-bottom-color: var(--ink); }

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

.site-foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem 2rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.25rem) var(--gut) 2rem;
  border-top: 1px solid var(--ink);
}

.foot-cta {
  grid-column: 1 / -1;
  margin: 0 0 1.5rem;
  font-size: clamp(1.9rem, 7vw, 4.4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.foot-cta a { border-bottom: 3px solid transparent; transition: border-color 0.22s ease; }
.foot-cta a:hover { border-bottom-color: var(--ink); }

.foot-col {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.foot-col a:hover { border-bottom-color: var(--ink); }

.foot-copy {
  grid-column: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--mute);
}

.foot-top {
  grid-column: 3 / -1;
  margin: 0;
  text-align: right;
}

.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.foot-top a:hover { border-bottom-color: var(--ink); }

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .hero-fig--a { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.06s both; }
  .hero-fig--b { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.14s both; }

  .site-nav a { animation: fade 0.45s ease both; }
  .site-nav a:nth-child(2) { animation-delay: 0.03s; }
  .site-nav a:nth-child(3) { animation-delay: 0.06s; }
  .site-nav a:nth-child(4) { animation-delay: 0.09s; }
  .site-nav a:nth-child(5) { animation-delay: 0.12s; }
  .site-nav a:nth-child(6) { animation-delay: 0.15s; }
  .site-nav a:nth-child(7) { animation-delay: 0.18s; }
}

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

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 断点 ---------- */

@media (max-width: 900px) {
  .grid-zone {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .grid-zone > aside {
    order: 3;
    position: static;
    margin-top: 2rem;
    padding-top: 1.75rem;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .rail-links { flex-direction: column; }
}

@media (max-width: 760px) {
  .search {
    order: 3;
    flex: 1 1 100%;
    border-left: 0;
    border-top: 1px solid var(--ink);
    padding: 0.55rem 0;
  }

  .search input { flex: 1 1 auto; width: auto; }

  .menu-row { flex-wrap: wrap; }

  .hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    padding: 2.5rem var(--gut) 3rem;
  }

  .hero-copy { order: -1; max-width: 20ch; }

  .hero-fig { position: static; width: 62%; }

  .hero-fig--a { align-self: flex-start; }
  .hero-fig--b { align-self: flex-end; }

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

  .foot-copy { grid-column: 1 / -1; }
  .foot-top { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .site-nav a { font-size: 0.84rem; }
}

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