:root {
  color-scheme: light;
  color: #202a22;
  background: #f4f2e9;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid #137356;
  outline-offset: 5px;
}

/* 键盘用户可以跳过页首和目录。 */
.skip-link {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: 1rem;
  padding: .65rem 1rem;
  background: #f4f2e9;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* 页首、导语和正文共用一条内容边线。 */
.frame {
  width: min(100% - 5rem, 68rem);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid #d5d8c9;
}

.header-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-name,
.header-link {
  text-decoration: none;
}

.site-name {
  font-weight: 700;
  letter-spacing: .12em;
}

.header-link {
  color: #355d48;
  font-size: .875rem;
}

.header-link span {
  margin-inline-start: .35rem;
}

/* 首屏左侧是标题，右侧是可直接跳转的笔记目录。 */
.introduction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
  align-items: end;
  gap: clamp(2rem, 6vw, 5.5rem);
  padding-block: clamp(4.5rem, 10vw, 8rem) clamp(3.5rem, 7vw, 6rem);
}

.introduction h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Microsoft YaHei", serif;
  font-size: clamp(2.55rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.055em;
}

.introduction h1 span {
  color: #24664c;
  font-family: Georgia, serif;
  font-weight: 400;
}

.mobile-break {
  display: none;
}

.introduction p {
  max-width: 27rem;
  margin: 1.5rem 0 0;
  color: #4c584c;
  font-size: clamp(1rem, 1.9vw, 1.125rem);
  line-height: 1.9;
}

.contents {
  padding: .25rem 1.25rem;
  border: 1px solid #243e32;
  border-radius: .75rem;
  background: #243e32;
  color: #f9f7ed;
}

.contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents li + li {
  border-top: 1px solid #4b6456;
}

.contents a {
  display: flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .2rem;
  text-decoration: none;
}

.contents a span {
  color: #d3e5a2;
}

.contents a:focus-visible {
  outline-color: #d3e5a2;
}

.contents a:hover,
.header-link:hover,
.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: .3em;
}

/* 每篇笔记的主题与正文分栏，窄屏按阅读顺序堆叠。 */
.note {
  display: grid;
  grid-template-columns: minmax(13rem, .85fr) minmax(0, 1.4fr);
  gap: clamp(1.5rem, 6vw, 5.5rem);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid #c9cebf;
  scroll-margin-top: 1rem;
}

.topic {
  margin: 0 0 .9rem;
  color: #355d48;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .13em;
}

.note h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -.035em;
  line-height: 1.4;
}

.note-body {
  max-width: 39rem;
  color: #334137;
  line-height: 1.9;
}

.note-body p {
  margin: 0;
}

.note-body blockquote {
  margin: 1.15rem 0;
  padding: .85rem 1.2rem;
  border-left: 3px solid #568566;
  background: #e9eddf;
}

.takeaway strong {
  margin-inline-end: .35em;
  color: #286149;
}

/* 备案链接保留常驻下划线，并在所有屏幕宽度居中。 */
.site-footer {
  padding: 2rem 1rem 2.4rem;
  border-top: 1px solid #d5d8c9;
  color: #465648;
  text-align: center;
  font-size: .875rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 0 0 .4rem;
}

.site-footer a {
  text-underline-offset: .2em;
}

@media (max-width: 48rem) {
  .frame {
    width: calc(100% - 3rem);
  }

  .introduction,
  .note {
    grid-template-columns: minmax(0, 1fr);
  }

  .introduction {
    padding-top: 3.5rem;
  }

  .note {
    gap: 1.1rem;
  }
}

@media (max-width: 25rem) {
  .frame {
    width: calc(100% - 2rem);
  }

  .mobile-break {
    display: initial;
  }

  .introduction h1 {
    font-size: clamp(2.1rem, 12vw, 3.25rem);
  }
}
