@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

:root {
  --paper: #fdfbf7;
  --wash: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e0e0e0;
  --line-soft: #e8e3da;
  --mut: #5c5c5c;
  --deco: 'Poiret One', 'Songti SC', SimSun, serif;
  --sans: 'Didact Gothic', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --serif: 'Songti SC', 'Noto Serif SC', SimSun, serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #fdfbf7;
  color: #1a1a1a;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

a {
  color: #1a1a1a;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 30px;
}

.board {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

.sheet {
  min-width: 0;
}

/* 侧栏 */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 22px 28px 0;
  border-right: 1px solid var(--line);
}

.rail-top {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--deco);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
}

.brand::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--ink);
  transform: rotate(45deg);
}

.rail-title {
  margin: 24px 0 10px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.34em;
  color: var(--mut);
}

.rail-top hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 0 0 16px;
}

.rail-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rail-nav li {
  animation: rise 0.4s ease both;
}

.rail-nav li:nth-child(1) { animation-delay: 0.02s; }
.rail-nav li:nth-child(2) { animation-delay: 0.06s; }
.rail-nav li:nth-child(3) { animation-delay: 0.1s; }
.rail-nav li:nth-child(4) { animation-delay: 0.14s; }
.rail-nav li:nth-child(5) { animation-delay: 0.18s; }
.rail-nav li:nth-child(6) { animation-delay: 0.22s; }
.rail-nav li:nth-child(7) { animation-delay: 0.26s; }

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

.rail-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  text-decoration: none;
  transition: none;
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-nav a.is-active {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.rail-foot {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.contact-host {
  margin: 4px 0 14px;
  font-size: 16px;
  color: var(--ink);
  word-break: break-all;
}

.to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  cursor: pointer;
  transition: none;
}

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

/* 头部 */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 45vh;
  padding: 54px 0 34px;
  border-bottom: 1px solid var(--ink);
}

.hero h1 {
  margin: 0;
  font-family: var(--deco), var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 74px);
  line-height: 1.08;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.lede {
  margin: 20px 0 0;
  max-width: 52ch;
  font-size: 17px;
  color: var(--mut);
}

/* 正文 */
.body {
  padding-top: 8px;
}

.body section {
  padding: 40px 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 28px;
}

.body section:first-child {
  border-top: 0;
  padding-top: 30px;
}

.body h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--deco), var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.35;
  letter-spacing: 0.03em;
}

.body h2::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  background: var(--ink);
  transform: rotate(45deg);
}

.body hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 0 0 22px;
}

.body h3 {
  margin: 30px 0 8px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.body p {
  margin: 0 0 1em;
  max-width: 68ch;
}

.body ul,
.body ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
  max-width: 66ch;
}

.body li {
  margin: 0 0 0.45em;
}

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

.body a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.body strong {
  font-weight: 700;
}

.body blockquote {
  margin: 26px 0;
  padding: 14px 20px;
  background: var(--wash);
  border-left: 3px solid var(--ink);
  border-radius: 4px;
}

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

.body figure {
  margin: 26px 0;
}

.body figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: var(--mut);
}

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

.body th,
.body td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}

.body th {
  background: var(--wash);
  font-weight: 400;
}

/* 页脚 */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 64px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--ink);
}

.foot-brand a {
  font-family: var(--deco);
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.foot-copy {
  flex: 1 1 200px;
  text-align: center;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--mut);
}

.foot-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: flex-end;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: var(--mut);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

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

@media (max-width: 900px) {
  .shell {
    padding: 0 18px;
  }

  .board {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rail {
    position: static;
    height: auto;
    padding: 16px 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    gap: 12px;
  }

  .brand {
    font-size: 24px;
    min-height: 40px;
  }

  .rail-title {
    margin: 14px 0 8px;
  }

  .rail-nav ol {
    gap: 6px;
  }

  .rail-nav a {
    padding: 7px 12px;
  }

  .rail-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border-top: 0;
    padding-top: 0;
    margin-top: 12px;
  }

  .contact-host {
    margin: 0;
  }

  .to-top {
    width: auto;
  }

  .hero {
    min-height: 0;
    padding: 28px 0 22px;
  }

  .body section {
    padding: 30px 0;
    scroll-margin-top: 16px;
  }

  .foot {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    margin-top: 46px;
  }

  .foot-copy {
    flex: none;
  }

  .foot-nav ol {
    justify-content: center;
  }
}

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

  .rail-nav li {
    animation: none;
  }
}

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