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

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

:root {
  --paper: #fdfbf7;
  --ink: #1a1a1a;
  --zinc: #f5f5f5;
  --line: #e0e0e0;
  --mute: #5c5c5c;
  --head: "Bebas Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: "Source Sans 3", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  transition: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.55'/></svg>");
}

img { max-width: 100%; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink);
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--head);
  font-size: 19px;
  letter-spacing: .04em;
}

.bname {
  font-family: var(--head);
  font-size: 23px;
  letter-spacing: .16em;
  line-height: 1;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 14px;
  border-radius: 10px;
  background: var(--zinc);
  text-decoration: none;
  font-size: 16px;
}

.contact::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.menu { padding: 0 clamp(16px, 4vw, 40px); }

.menu p {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 2px 0 6px;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 11px;
  font-size: 16px;
  text-decoration: none;
  border-radius: 10px;
}

.menu a:hover { background: var(--zinc); }

.menu a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: var(--ink);
}

/* 首屏 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 45vh;
  padding: clamp(22px, 4vw, 46px) clamp(16px, 4vw, 40px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-color: var(--zinc);
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
  background-size: 13px 13px;
}

.hero-art { position: absolute; inset: 0; }

.hero-art img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art img:first-child { display: block; }

.hero--photo .hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, .62);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: right;
}

.hero--photo .hero-copy { color: var(--paper); }

.hero h1 {
  margin: 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(38px, 8.5vw, 74px);
  line-height: 1.05;
  letter-spacing: .04em;
}

.lead {
  max-width: 36ch;
  margin: 12px 0 0 auto;
  font-size: 17px;
  line-height: 1.6;
  color: var(--mute);
}

.hero--photo .lead { color: rgba(253, 251, 247, .88); }

/* 主体 */
.wrap {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 4vw, 52px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 56px) clamp(16px, 4vw, 40px);
}

.rail {
  position: sticky;
  top: 148px;
  align-self: start;
}

.rail h2 {
  margin: 0;
  font-family: var(--head);
  font-size: 21px;
  letter-spacing: .2em;
  line-height: 1.2;
}

.subtitle {
  margin: 2px 0 14px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--mute);
}

.rail ol {
  counter-reset: rail;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.rail li { counter-increment: rail; }

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--zinc);
  font-size: 16px;
  text-decoration: none;
}

.rail a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--head);
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--mute);
}

.rail a:hover { background: var(--line); }

.sheet { min-width: 0; }

.prose { max-width: 70ch; }

.prose section { scroll-margin-top: 24px; }

.prose h2 {
  margin: 46px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1.18;
  letter-spacing: .03em;
}

.prose section:first-child h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  margin: 30px 0 10px;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: .02em;
}

.prose p { margin: 0 0 18px; }

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li { margin: 0 0 8px; }

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

.prose img {
  display: block;
  height: auto;
  margin: 20px 0;
  border-radius: 10px;
}

.prose blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--zinc);
}

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

.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* 页脚 */
.site-foot {
  display: grid;
  grid-template-columns: 1.1fr 1fr .9fr 1.4fr;
  gap: 22px clamp(18px, 3vw, 34px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 40px) 14px;
  border-top: 1px solid var(--ink);
  background: var(--zinc);
}

.site-foot p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mute);
}

.fcol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.fh {
  font-family: var(--head);
  font-size: 19px;
  letter-spacing: .14em;
  color: var(--ink);
  margin-bottom: 4px;
}

.fcol a {
  display: inline-block;
  min-height: 40px;
  padding: 7px 10px;
  margin-left: -10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.fcol a:hover { background: var(--paper); }

.sub {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  margin-top: 4px;
}

.sub-i {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.sub-b {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.site-foot > small {
  grid-column: 1 / 3;
  grid-row: 2;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--mute);
}

.foot-links {
  grid-column: 3 / 5;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.foot-links a {
  display: inline-block;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.foot-links a:hover { background: var(--paper); }

/* 动效 */
.js .reveal { opacity: 0; }
.js .reveal.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; }
}

@media (min-width: 861px) {
  .prose section { scroll-margin-top: 160px; }
}

/* 窄屏 */
@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }

  .rail {
    position: static;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }

  .rail ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rail a { padding: 8px 12px; }

  .site-foot {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 18px;
  }

  .site-foot > small,
  .foot-links {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: flex-start;
  }

  .foot-links a { margin-left: -10px; }
}

@media (max-width: 560px) {
  .masthead { position: static; }

  .hero { min-height: 42vh; }

  .bname { font-size: 21px; letter-spacing: .12em; }

  .site-foot { grid-template-columns: 1fr; }

  .sub { max-width: none; }
}

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