@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --ink: #1a1a2e;
  --ink-soft: #3a3a52;
  --ink-muted: #6b6b80;
  --accent: #2d5a8e;
  --accent-light: #4a8fd1;
  --accent-bg: #eef4fb;
  --canvas: #fbf9f5;
  --paper: #fff;
  --rule: #e0dcd4;
  --rule-soft: #f0ede8;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --sans: "Inter", "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.progress-bar {
  background: var(--accent);
  height: 3px;
  left: 0;
  position: fixed;
  top: 0;
  transition: width 0.1s;
  width: 0;
  z-index: 200;
}

.topnav {
  backdrop-filter: blur(12px);
  background: rgb(251 249 245 / 92%);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1000px;
  padding: 16px 32px;
}

.topnav-brand {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.topnav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topnav-links a {
  border-radius: 6px;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 13px;
  padding: 4px 10px;
  text-decoration: none;
}

.topnav-links a:hover,
.topnav-links a.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.topnav-links a.active {
  font-weight: 600;
}

.article-wrap {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 32px;
}

article {
  padding: 64px 0 80px;
}

article h1 {
  font-size: 34px;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 8px;
}

article h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 64px 0 20px;
}

article h2::before {
  background: var(--accent);
  border-radius: 2px;
  content: "";
  display: block;
  height: 3px;
  margin-bottom: 16px;
  width: 32px;
}

article h3 {
  color: var(--accent);
  font-size: 20px;
  margin: 40px 0 14px;
}

article p {
  hyphens: auto;
  margin-bottom: 24px;
  text-align: justify;
}

article p:first-of-type {
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 2;
}

article p:first-of-type::first-letter {
  color: var(--accent);
  float: left;
  font-size: 3.2em;
  font-weight: 700;
  line-height: 0.9;
  margin: 6px 8px 0 0;
}

article strong {
  font-weight: 700;
}

article em {
  color: var(--accent);
}

article blockquote {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  font-size: 17px;
  margin: 28px 0;
  padding: 20px 26px;
}

article blockquote p {
  margin-bottom: 10px;
}

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

article ul,
article ol {
  margin: 20px 0 24px 28px;
}

article li {
  margin-bottom: 10px;
}

article li::marker {
  color: var(--accent);
}

article code {
  background: var(--rule-soft);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 3px 7px;
}

article pre {
  background: var(--ink);
  border-radius: 10px;
  color: #e0e0ec;
  font-size: 15px;
  line-height: 1.6;
  margin: 24px 0;
  overflow-x: auto;
  padding: 20px 24px;
}

article pre code {
  background: none;
  color: inherit;
  font-size: inherit;
  padding: 0;
}

article img {
  border-radius: 10px;
  box-shadow: 0 4px 24px rgb(26 26 46 / 8%);
  display: block;
  height: auto;
  margin: 28px auto;
  max-width: 100%;
}

article table {
  border-collapse: collapse;
  font-size: 15px;
  margin: 28px 0;
  width: 100%;
}

article th {
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 16px;
  text-align: left;
}

article td {
  border-bottom: 1px solid var(--rule);
  padding: 12px 16px;
}

article tr:nth-child(even) td {
  background: var(--rule-soft);
}

article hr {
  border: 0;
  margin: 48px 0;
  text-align: center;
}

article hr::after {
  color: var(--ink-muted);
  content: "· · ·";
  font-size: 20px;
  letter-spacing: 8px;
}

.article-nav {
  border-top: 1px solid var(--ink);
  display: flex;
  gap: 16px;
  margin-top: 72px;
  padding-top: 32px;
}

.nav-link {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  flex: 1;
  padding: 20px 24px;
  text-decoration: none;
  transition: 0.2s;
}

.nav-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgb(45 90 142 / 10%);
  transform: translateY(-2px);
}

.nav-link.prev {
  text-align: right;
}

.nav-label {
  color: var(--ink-muted);
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.index-hero {
  margin: 0 auto;
  max-width: 680px;
  padding: 100px 32px 60px;
  text-align: center;
}

.index-hero h1 {
  font-size: 42px;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.index-hero .lead {
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.8;
  margin: 0 auto;
  max-width: 560px;
}

.index-hero .thesis {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 18px;
  margin-top: 40px;
  padding: 22px 28px;
  text-align: left;
}

.index-hero .thesis strong {
  color: var(--accent);
}

.index-list {
  padding-bottom: 60px;
}

.article-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  display: block;
  margin-bottom: 14px;
  padding: 28px 32px;
  text-decoration: none;
  transition: 0.2s;
}

.article-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 8px 30px rgb(26 26 46 / 8%);
  transform: translateY(-2px);
}

.card-num {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 8px 0 10px;
}

.card-desc {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.7;
}

.footer {
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 14px;
  padding: 48px 32px;
  text-align: center;
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .topnav-inner {
    padding: 12px 16px;
  }

  .topnav-brand {
    font-size: 14px;
  }

  .topnav-links {
    gap: 2px;
  }

  .topnav-links a {
    font-size: 12px;
    padding: 3px 6px;
  }

  .article-wrap {
    padding: 0 20px;
  }

  article h1 {
    font-size: 26px;
  }

  article h2 {
    font-size: 21px;
  }

  article h3 {
    font-size: 18px;
  }

  article p:first-of-type {
    font-size: 17px;
  }

  article p:first-of-type::first-letter {
    font-size: 2.6em;
  }

  .index-hero {
    padding: 60px 20px 40px;
  }

  .index-hero h1 {
    font-size: 32px;
  }

  .index-hero .lead {
    font-size: 17px;
  }

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

  .nav-link.prev {
    text-align: left;
  }

  .article-card {
    padding: 20px 24px;
  }

  .card-title {
    font-size: 18px;
  }
}
