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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --muted: #444444;
  --r: 18px;
  --max: 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: Karla, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Playfair Display SC", "Songti SC", Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
}

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

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

/* 页头 */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "brand brand"
    "left right";
  gap: 0.25rem 0.5rem;
  padding: 0.4rem clamp(0.75rem, 3vw, 2rem) 0.6rem;
  align-items: start;
}

.brand {
  grid-area: brand;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.3rem 0.6rem;
  font-family: "Playfair Display SC", "Songti SC", Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.menu--left {
  grid-area: left;
}

.right-cluster {
  grid-area: right;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}

.menu ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.5rem;
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

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

.contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 0.15rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.22s ease, color 0.22s ease;
}

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

/* 主体网格 */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem clamp(0.9rem, 3vw, 2.5rem) 2.5rem;
  display: grid;
  gap: 1.25rem;
}

/* 左侧目录 */
.index {
  grid-row: 1;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 0.9rem 0.9rem 1rem;
  background: var(--paper);
}

.index__title {
  font-size: 1rem;
  letter-spacing: 0.16em;
}

.subtitle {
  margin: 0.15rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.index__list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.5rem;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 10px;
  transition: background-color 0.22s ease, color 0.22s ease;
}

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

/* 正文 */
.doc {
  grid-row: 2;
  min-width: 0;
}

.doc > div {
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
  background: var(--paper);
  scroll-margin-top: 7rem;
}

.doc > div.hero {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-height: 45vh;
  display: grid;
  gap: 1.25rem;
  align-content: center;
  text-align: right;
}

.hero__title {
  font-size: clamp(1.85rem, 6vw, 3.3rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.hero__lead {
  margin: 0 0 0 auto;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1rem;
}

.hero__figure {
  margin: 0;
}

.hero__figure img {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.band {
  height: clamp(26px, 6vw, 52px);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 0 100%);
  margin: 0 0 1.5rem;
}

.doc h2 {
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  margin: 0 0 0.5rem;
}

.doc h3 {
  font-size: 1.15rem;
  margin: 1.4rem 0 0.4rem;
}

.doc p {
  margin: 0 0 1rem;
}

.doc p.subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.doc ul,
.doc ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.doc li {
  margin: 0.25rem 0;
}

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

.doc a:hover,
.doc a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.doc img {
  width: 100%;
  height: auto;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.doc blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--ink);
  color: var(--muted);
}

.doc > div > :last-child {
  margin-bottom: 0;
}

/* 页脚 */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem clamp(0.9rem, 3vw, 2.5rem) 2.25rem;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.foot address {
  font-style: normal;
  font-size: 16px;
}

.foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.22s ease, color 0.22s ease;
}

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

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

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (min-width: 860px) {
  .masthead {
    grid-template-areas: "left brand right";
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem clamp(1rem, 3vw, 2.5rem);
  }

  .menu ol {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
  }

  .menu--left ol {
    justify-content: flex-end;
  }

  .menu a {
    padding: 0.4rem 0.55rem;
  }

  .right-cluster {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .contact {
    margin-top: 0;
  }

  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 2.25rem;
    align-items: start;
  }

  .index {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 6rem;
  }

  .index__list {
    grid-template-columns: 1fr;
  }

  .doc {
    grid-column: 2;
    grid-row: 1;
  }

  .doc > div {
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
  }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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