:root {
  --ink: #171714;
  --muted: #72716b;
  --paper: #f1f0eb;
  --rule: #bab9b2;
  --hairline: #d6d4cd;
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  font-size: 18px;
  line-height: 1.9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 42px 0 88px;
  background: var(--paper);
}

header#title-block-header,
main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.edition-line {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 10px;
  border-bottom: 8px solid var(--ink);
  color: var(--ink);
  font: 700 0.68rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead {
  margin-top: 5px;
  padding: 50px 0 34px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.masthead-en {
  margin: 0 0 8px;
  color: #8a8984;
  font: 600 0.82rem/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: 0.28em;
}

h1.title {
  max-width: none;
  margin: 0;
  font-family: "FZSongKeBenXiuKaiS-R-GB", "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  font-size: clamp(3.6rem, 9vw, 7.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.issue-title {
  margin: 26px 0 0;
  color: #4e4d49;
  font: 600 clamp(1rem, 2vw, 1.35rem)/1.5 "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  letter-spacing: 0.08em;
}

.repository {
  max-width: none;
  margin: 22px 0 0;
  color: var(--muted);
  font: 700 0.68rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.repository a {
  color: var(--ink);
}

main {
  counter-reset: section;
}

nav#TOC {
  margin: 46px 0 72px;
  padding: 20px 0 22px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
}

nav#TOC::before {
  content: "本期目录  /  CONTENTS";
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font: 700 0.72rem/1.2 Arial, "PingFang SC", sans-serif;
  letter-spacing: 0.12em;
}

nav#TOC ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 34px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

nav#TOC li {
  counter-increment: toc;
  margin: 0;
  border-bottom: 1px dotted var(--rule);
}

nav#TOC li::before {
  content: counter(toc, decimal-leading-zero);
  display: inline-block;
  width: 2.2em;
  color: var(--muted);
  font: 700 0.67rem/1 Arial, sans-serif;
  vertical-align: 0.12em;
}

nav#TOC a {
  display: inline-block;
  padding: 5px 0;
  color: var(--ink);
  font: 600 0.82rem/1.35 "Noto Sans SC", "PingFang SC", sans-serif;
  text-decoration: none;
}

nav#TOC a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

h2 {
  counter-increment: section;
  margin: 4.5em 0 1.55em;
  padding: 14px 0 12px;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  scroll-margin-top: 24px;
}

h2::before {
  content: counter(section, decimal-leading-zero) " // ";
  color: var(--muted);
  font: 700 0.72em/1 Arial, sans-serif;
  letter-spacing: 0.04em;
}

p,
blockquote,
main > ol,
main > ul {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

p {
  margin-top: 1.05em;
  margin-bottom: 1.05em;
}

a {
  color: inherit;
  text-decoration-color: #77756e;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #000;
  text-decoration-thickness: 2px;
}

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

strong {
  font-weight: 900;
  text-decoration: none;
}

img,
video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 36px auto;
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: grayscale(78%) contrast(0.96);
  mix-blend-mode: multiply;
}

blockquote {
  margin-top: 2em;
  margin-bottom: 2em;
  padding: 1.2em 0 1.2em 1.5em;
  border: 0;
  border-left: 5px double var(--ink);
  background: transparent;
  color: #3f3e39;
  font-size: 0.96rem;
}

blockquote p:first-child {
  margin-top: 0;
}

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

ol,
ul {
  padding-left: 1.5em;
}

li {
  margin: 0.45em 0;
}

.site-footer {
  margin-top: 100px;
  padding: 42px 0 12px;
  border-top: 6px double var(--ink);
  text-align: center;
}

.footer-brand {
  margin: 0 auto;
  font-family: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.footer-tagline {
  margin: 18px auto 0;
  color: var(--muted);
  font: 600 0.78rem/1.5 "Noto Sans SC", "PingFang SC", sans-serif;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
}

@media (max-width: 760px) {
  :root {
    font-size: 16px;
    line-height: 1.85;
  }

  body {
    width: min(100% - 32px, 1120px);
    padding-top: 24px;
  }

  .masthead {
    padding: 34px 0 24px;
  }

  .masthead-en {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }

  h1.title {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .issue-title {
    margin-top: 18px;
  }

  .repository {
    margin-top: 16px;
    overflow-wrap: anywhere;
  }

  nav#TOC {
    margin: 32px 0 54px;
  }

  nav#TOC ul {
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
  }

  h2 {
    margin-top: 3.5em;
  }
}

@media (max-width: 460px) {
  .edition-line {
    font-size: 0.58rem;
  }

  nav#TOC ul {
    grid-template-columns: 1fr;
  }

  h1.title {
    letter-spacing: -0.09em;
  }

  .site-footer {
    margin-top: 64px;
    padding-top: 32px;
  }
}

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

@media print {
  :root,
  body {
    background: white;
  }

  body {
    width: 100%;
    padding: 0;
  }

  nav#TOC {
    break-after: page;
  }

  h2,
  img,
  blockquote {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}
