:root {
  --ink: #172027;
  --ink-soft: #33424c;
  --muted: #65727b;
  --line: #d9e0e4;
  --line-strong: #bec9cf;
  --surface: #ffffff;
  --surface-soft: #f3f6f7;
  --accent: #9e3f2d;
  --accent-dark: #733022;
  --blue: #315f82;
  --max-width: 920px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a {
  color: var(--blue);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

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

.note-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

.note-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 2rem));
  min-height: 62px;
  margin: 0 auto;
}

.note-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.note-brand img {
  display: block;
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
}

.back-link {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.article-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 5.5rem;
}

.article-header {
  max-width: 850px;
  margin-bottom: 2.4rem;
}

.article-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0;
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: 2.65rem;
  line-height: 1.35;
}

.article-deck {
  max-width: 780px;
  margin: 1.25rem 0 1.2rem;
  color: var(--ink-soft);
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.9;
}

.lead-figure,
.inline-figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.lead-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
}

.lead-figure figcaption,
.inline-figure figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
  padding: 0.55rem 0.7rem;
}

.article-body {
  max-width: 760px;
  margin: 3.25rem auto 0;
}

.article-body h2 {
  margin: 2.5rem 0 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-strong);
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.45;
}

.article-body p {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: 1.02rem;
  line-height: 2;
}

.article-body strong {
  color: var(--ink);
}

.article-body ol,
.article-body ul {
  margin: 1rem 0 1.4rem;
  padding: 0;
  list-style: none;
}

.article-body ol {
  counter-reset: steps;
}

.article-body ol li,
.article-body ul li {
  position: relative;
  margin: 0;
  padding: 0.8rem 0 0.8rem 3.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: "Songti SC", STSong, Georgia, serif;
  line-height: 1.85;
}

.article-body ol li {
  counter-increment: steps;
}

.article-body ol li::before,
.article-body ul li::before {
  position: absolute;
  left: 0;
  top: 0.88rem;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.article-body ol li::before {
  content: "0" counter(steps);
}

.article-body ul li::before {
  content: "•";
  left: 0.35rem;
}

.article-body blockquote {
  margin: 1.6rem 0;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  padding: 1rem 1.25rem;
}

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

.article-body hr {
  margin: 2.2rem 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.inline-figure {
  margin: 2rem 0;
}

.inline-figure img {
  width: 100%;
  max-height: 780px;
  object-fit: contain;
}

.paper-reference {
  margin-top: 2.75rem;
  border-top: 3px solid var(--ink);
  background: var(--surface-soft);
  padding: 1.2rem 1.3rem;
}

.paper-reference h2 {
  margin: 0 0 0.8rem;
  border: 0;
  padding: 0;
  font-size: 1.12rem;
}

.paper-reference p {
  margin: 0 0 0.75rem;
  font-family: Georgia, "Times New Roman", "Songti SC", STSong, serif;
  font-size: 0.88rem;
  line-height: 1.7;
}

.paper-reference a {
  display: inline-block;
  margin-right: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.76rem;
  padding: 1.3rem 0 2rem;
}

@media (max-width: 620px) {
  .article-shell {
    padding: 3rem 0 4rem;
  }

  .article-header h1 {
    font-size: 2rem;
  }

  .article-deck {
    font-size: 1.08rem;
  }

  .article-body {
    margin-top: 2.4rem;
  }

  .article-body p {
    font-size: 1rem;
  }

  .article-footer {
    flex-direction: column;
  }
}
