:root {
  color-scheme: light;
  --bg: #faf8f5;
  --ink: #1c1917;
  --muted: #44403c;
  --line: #e6e1d8;
  --link: #14532d;
  --focus: #14532d;
  --measure: 40rem;
}

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

html {
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC",
    "Source Han Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  padding: 0.45rem 0.7rem;
  background: var(--ink);
  color: #fff;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  width: 1px;
  white-space: nowrap;
}

.skip:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  color: #fff;
  text-decoration: none;
}

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

main:focus {
  outline: none;
}

.wrap {
  width: min(100% - 2rem, var(--measure));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  min-height: 3.25rem;
  padding: 0.35rem 0;
}

.brand,
.site-nav a {
  padding: 0.55rem 0;
  color: var(--ink);
  text-decoration: none;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.brand:hover,
.site-nav a:hover,
.index-list a:hover .item-title,
.index-list a:focus-visible .item-title {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

main {
  padding: 2.25rem 0 3rem;
}

.page-head {
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
.item-title {
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2rem);
  line-height: 1.3;
}

h2 {
  margin: 1.5rem 0 0.65rem;
  font-size: 1.25rem;
  line-height: 1.4;
}

section > h2,
.toc > h2 {
  margin-top: 0;
}

.en,
.lede,
.dates,
.item-note,
.site-footer {
  color: var(--muted);
}

.en {
  margin: 0.2rem 0 0;
}

.lede {
  margin: 1rem 0 0;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0.9rem 0 0;
}

a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

section {
  margin-top: 2rem;
}

:target {
  scroll-margin-top: 1rem;
}

p,
ul,
ol,
dl {
  margin: 0.65rem 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

.toc {
  margin-top: 1.75rem;
}

.toc ol {
  margin-top: 0.4rem;
}

.identity {
  margin: 1rem 0 0;
}

.identity div {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.identity dt {
  margin: 0;
  color: var(--muted);
}

.identity dd {
  margin: 0;
}

.page-head .identity div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.blocks {
  list-style: none;
  padding: 0;
}

.blocks li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.blocks li:last-child {
  border-bottom: 1px solid var(--line);
}

.blocks strong {
  display: block;
  font-weight: 600;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  border-top: 1px solid var(--line);
}

.index-list a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.2rem 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.item-title {
  flex: 1 1 12rem;
}

.item-note {
  flex: 0 1 auto;
}

@media (max-width: 42rem) {
  .index-list a {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.15rem;
  }

  .item-title,
  .item-note {
    flex: 0 1 auto;
  }
}

code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

address {
  font-style: normal;
}

.related {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.related h2 {
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2.25rem;
}

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

.site-footer a {
  color: inherit;
}

::selection {
  background: #d9e8df;
}

@media (max-width: 28rem) {
  .identity div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media print {
  :root {
    --bg: #fff;
    --ink: #000;
    --muted: #222;
    --link: #000;
    --line: #ccc;
  }

  @page {
    margin: 16mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .skip,
  .site-header,
  .related {
    display: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
  }

  main {
    padding: 0;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  li,
  .identity div,
  .blocks li {
    break-inside: avoid;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }
}
