:root {
  --background: #ffffff;
  --ink: #071427;
  --body: #35414d;
  --muted: #69737d;
  --line: #dce2e5;
  --line-strong: #bdc9ce;
  --accent: #087f82;
  --accent-soft: #e9f4f3;
  --serif: "Iowan Old Style", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --page: 1248px;
  --article: 760px;
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

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

.page-width,
.header-inner,
.site-footer > div {
  width: min(calc(100% - 64px), var(--page));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  z-index: 80;
  inset: 0 0 auto;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

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

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  align-self: stretch;
  gap: 44px;
}

.site-header nav a {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--body);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
}

.site-header nav a:hover::after,
.site-header nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.home-hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  align-items: center;
  gap: 40px;
  padding-block: 44px 42px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  max-width: 750px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(50px, 4.6vw, 72px);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-copy > p {
  max-width: 640px;
  margin: 27px 0 28px;
  color: var(--body);
  font-size: 17px;
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
  font-weight: 680;
  text-decoration: underline;
  transition: gap 160ms ease;
}

.text-link:hover {
  gap: 22px;
}

.hero-visual {
  align-self: center;
  height: 390px;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-visual img {
  width: 138%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  gap: 68px;
  align-items: center;
  padding-block: 34px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.featured-copy h2 {
  max-width: 560px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3.2vw, 52px);
  line-height: 1.13;
  letter-spacing: -0.035em;
}

.featured-copy h2 a {
  text-decoration: none;
}

.featured-copy > p:not(.section-label) {
  max-width: 570px;
  margin: 18px 0 20px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.8;
}

.featured-visual {
  display: block;
  height: 248px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.featured-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  transition: transform 360ms ease;
}

.featured-visual:hover img {
  transform: scale(1.018);
}

.article-cover {
  margin: 0 0 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f7fafb;
}

.article-cover img {
  width: 100%;
  height: auto;
}

.article-index {
  padding-block: 34px 48px;
}

.index-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.index-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
}

.index-heading a {
  color: var(--muted);
  font-size: 13px;
}

.article-row {
  display: grid;
  grid-template-columns: 120px minmax(260px, 1fr) minmax(320px, 1.3fr) 130px;
  gap: 28px;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.article-row time {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  max-width: 100%;
  margin: 30px 0 34px;
  overflow-x: auto;
  border: 1px solid var(--line);
  outline: none;
}

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

.article-content table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

.article-content th,
.article-content td {
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 720;
}

.article-content tbody tr:nth-child(even) {
  background: #fafcfc;
}

.article-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
}

.article-row h3 a {
  text-decoration: none;
}

.article-row h3 a:hover {
  color: var(--accent);
}

.article-row > p {
  margin: 0;
  color: var(--body);
  font-size: 13px;
  line-height: 1.65;
}

.row-topic {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.row-topic a {
  text-decoration: none;
}

.listing-hero {
  padding-block: 72px 48px;
  border-bottom: 1px solid var(--line);
}

.listing-hero h1,
.about h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 7vw, 94px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.listing-hero p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--body);
  font-size: 17px;
  line-height: 1.8;
}

.listing-page .article-index {
  padding-top: 0;
}

.topic-groups {
  padding-block: 18px 72px;
}

.topic-group {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
  gap: 56px;
  padding-block: 38px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.topic-group h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
}

.topic-group ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-group li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.topic-group li:last-child {
  border-bottom: 0;
}

.topic-group time {
  color: var(--muted);
  font-size: 13px;
}

.topic-group a {
  font-family: var(--serif);
  font-size: 19px;
  text-decoration: none;
}

.about {
  padding-block: 78px 120px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 100px;
  margin-top: 70px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.about-lead {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.8vw, 50px);
  line-height: 1.36;
  letter-spacing: -0.03em;
}

.about-body {
  color: var(--body);
  font-size: 16px;
  line-height: 1.9;
}

.about-body p:first-child {
  margin-top: 0;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, var(--article)) 220px;
  justify-content: center;
  gap: 88px;
  padding-block: 40px 90px;
}

.article {
  min-width: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

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

.article-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.article-meta a {
  color: var(--accent);
}

.article-deck {
  margin: 26px 0 0;
  color: var(--body);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.65;
}

.article-content {
  color: #24313d;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.95;
}

.article-content > p {
  margin: 1.55em 0;
}

.article-content h2 {
  margin: 2.15em 0 0.7em;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.32;
  letter-spacing: -0.02em;
  scroll-margin-top: 32px;
}

.article-content h3 {
  margin: 1.8em 0 0.6em;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.4;
  scroll-margin-top: 32px;
}

.heading-anchor {
  text-decoration: none;
}

.heading-anchor:hover {
  color: var(--accent);
}

.article-content ul,
.article-content ol {
  margin: 1.4em 0;
  padding-left: 1.45em;
}

.article-content li {
  margin: 0.6em 0;
  padding-left: 0.25em;
}

.article-content blockquote {
  margin: 1.8em 0;
  padding: 17px 22px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.article-content blockquote p {
  margin: 0;
}

.article-content code {
  padding: 0.12em 0.35em;
  border-radius: 3px;
  background: #eef1f3;
  color: #0b5361;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.87em;
}

.article-content hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.code-block {
  margin: 2em 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #f8fafb;
}

.code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding-inline: 14px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.copy-code {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: 650 12px/1 var(--sans);
}

.code-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: var(--ink);
  font: 13px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

.code-block pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  margin-top: 125px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.toc > p {
  margin: 0 0 15px;
  font-family: var(--serif);
  font-weight: 700;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}

.toc .toc-level-3 a {
  padding-left: 13px;
  font-size: 12px;
}

.toc a:hover,
.toc a.is-active {
  color: var(--accent);
  transform: translateX(3px);
}

.article-footer {
  margin-top: 58px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.next-article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
}

.next-article span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.next-article strong {
  font-family: var(--serif);
  font-size: 19px;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer > div {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.site-footer a {
  color: var(--accent);
}

.not-found {
  min-height: calc(100vh - 150px);
  display: grid;
  place-content: center;
  text-align: center;
}

.not-found > p {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.2em;
}

.not-found h1 {
  margin: 18px 0 28px;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 72px);
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 62px;
  }

  .hero-visual {
    height: 270px;
  }

  .hero-visual img {
    width: 115%;
  }

  .featured {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article-row {
    grid-template-columns: 100px minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  }

  .row-topic {
    display: none;
  }

}

@media (min-width: 861px) and (max-width: 1100px) {
  .article-shell {
    grid-template-columns: minmax(0, 700px) 155px;
    gap: 36px;
  }

  .toc {
    padding-left: 16px;
  }

  .toc a {
    font-size: 12px;
  }
}

@media (max-width: 860px) {
  .article-shell {
    grid-template-columns: minmax(0, var(--article));
  }

  .toc {
    display: none;
  }
}

@media (max-width: 720px) {
  .page-width,
  .header-inner,
  .site-footer > div {
    width: min(calc(100% - 36px), var(--page));
  }

  .header-inner {
    min-height: 64px;
    gap: 16px;
  }

  .brand {
    font-size: 15px;
  }

  .site-header nav {
    gap: 20px;
  }

  .site-header nav a {
    font-size: 12px;
  }

  .home-hero {
    min-height: 0;
    padding-block: 46px 26px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 12.5vw, 62px);
    letter-spacing: -0.06em;
  }

  .hero-copy > p {
    margin-block: 20px 22px;
    font-size: 15px;
  }

  .hero-visual {
    height: 210px;
  }

  .hero-visual img {
    width: 138%;
  }

  .featured {
    padding-block: 30px;
  }

  .featured-copy h2 {
    font-size: 35px;
  }

  .featured-visual {
    height: 190px;
  }

  .article-index {
    padding-block: 28px 38px;
  }

  .article-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 20px;
  }

  .article-row time {
    order: 2;
  }

  .article-row h3 {
    order: 1;
    font-size: 21px;
  }

  .article-row > p {
    order: 3;
  }

  .listing-hero {
    padding-block: 54px 38px;
  }

  .topic-group {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-block: 30px;
  }

  .topic-group li {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .about {
    padding-block: 58px 80px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 38px;
    margin-top: 45px;
  }

  .article-shell {
    padding-block: 28px 70px;
  }

  .back-link {
    margin-bottom: 25px;
  }

  .article-header h1 {
    font-size: clamp(34px, 9.7vw, 42px);
  }

  .article-deck {
    font-size: 18px;
  }

  .article-content {
    font-size: 17px;
    line-height: 1.9;
  }

  .article-content h2 {
    font-size: 29px;
  }

  .code-block {
    margin-inline: -8px;
  }

  .next-article {
    grid-template-columns: 1fr auto;
  }

  .next-article span:first-child {
    grid-column: 1 / -1;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
