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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: #000000;
  --mist: #f1f1f1;
  --side: 224px;
  --pad: clamp(18px, 3vw, 48px);
  --serif: 'Cormorant', 'Songti SC', 'Source Han Serif SC', Georgia, serif;
  --sans: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

[hidden] {
  display: none !important;
}

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.7;
  font-weight: 400;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 1.25rem;
}

/* ---------- 左侧固定栏 ---------- */

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.4rem 1rem 2rem;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand svg {
  width: 22px;
  height: 22px;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0.02em;
  appearance: none;
}

.search input::placeholder {
  color: #000;
  opacity: 0.55;
}

.search input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 40px;
  padding: 0.4rem 0.5rem;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav a .ic {
  width: 7px;
  height: 7px;
  flex: none;
  fill: var(--ink);
}

.nav a:hover,
.nav a:focus-visible {
  border-bottom-color: var(--ink);
  background: var(--mist);
  outline: none;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--pad) * 1.4) var(--pad) calc(var(--pad) * 2);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -14% -2%;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.085) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.085) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: translateY(var(--py, 0px));
  pointer-events: none;
  will-change: transform;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: center;
}

.hero-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2.2rem);
  text-align: right;
}

.hero-mark {
  width: clamp(38px, 6vw, 68px);
  height: auto;
  flex: none;
  color: var(--ink);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 7.2vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 16ch;
}

.hero-lead {
  grid-column: 1 / -1;
  margin: 0;
  max-width: 62ch;
  margin-left: auto;
  text-align: right;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 300;
}

.scroll-cue {
  position: absolute;
  right: var(--pad);
  bottom: calc(var(--pad) * 0.6);
  width: 26px;
  color: var(--ink);
  opacity: 0.7;
}

/* ---------- 主体 ---------- */

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding: 0 var(--pad) 0;
  max-width: 1480px;
}

.prose {
  min-width: 0;
  max-width: 74ch;
}

.prose > div {
  padding-top: 2rem;
  border-top: 2px solid var(--line);
  margin-top: 3.5rem;
  scroll-margin-top: 100px;
}

.prose > div:first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-left: 4px solid var(--line);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.prose strong {
  font-weight: 600;
}

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

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

.rail {
  align-self: start;
  border-top: 2px solid var(--line);
  padding-top: 0.85rem;
}

.rail h3 {
  margin: 0 0 0.55rem;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.rail hr {
  margin-bottom: 0.9rem;
}

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

.rail li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.rail li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  text-decoration: none;
}

.rail li a:hover,
.rail li a:focus-visible {
  background: var(--mist);
  outline: none;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  font-size: 15px;
  text-decoration: none;
}

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

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

.foot {
  margin-top: 5rem;
  border-top: 2px solid var(--line);
  padding: 2.4rem var(--pad) 1.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
}

.foot-brand {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 11vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  word-break: break-word;
}

.foot-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  border-bottom-color: var(--ink);
  outline: none;
}

.foot small {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  font-size: 13px;
  letter-spacing: 0.08em;
}

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

.js .prose > div,
.js .rail,
.js .foot-brand,
.js .hero-row,
.js .hero-lead {
  opacity: 0;
  transform: translateY(14px);
}

.js .in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

  .js .prose > div,
  .js .rail,
  .js .foot-brand,
  .js .hero-row,
  .js .hero-lead {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero::before {
    transform: none;
  }
}

/* ---------- 桌面 ---------- */

@media (min-width: 1024px) {
  body {
    padding-left: var(--side);
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding-top: 1rem;
  }

  .rail {
    position: sticky;
    top: 2rem;
  }

  .hero-lead {
    grid-column: 4 / -1;
  }

  .foot {
    grid-template-columns: 1.5fr 1fr;
    align-items: start;
    column-gap: 2.5rem;
  }
}

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

@media (max-width: 1023px) {
  body {
    padding-left: 0;
  }

  .side {
    position: sticky;
    inset: auto;
    top: 0;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.55rem var(--pad) 0.6rem;
    overflow: visible;
  }

  .brand {
    width: 44px;
    height: 44px;
  }

  .side .search {
    flex: 1 1 130px;
    min-width: 0;
  }

  .nav {
    flex: 1 1 100%;
  }

  .nav a {
    font-size: 15px;
    padding: 0.3rem 0.42rem;
  }

  .hero {
    min-height: 76svh;
    padding-bottom: calc(var(--pad) * 2.6);
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .hero-row {
    align-items: flex-start;
  }

  .hero-lead {
    font-size: 16px;
  }

  .prose > div {
    scroll-margin-top: 170px;
    margin-top: 2.6rem;
  }

  .wrap {
    padding-top: 0;
  }

  .rail {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  .nav a span {
    font-size: 14px;
  }

  .foot-links {
    gap: 0 0.9rem;
  }
}

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