:root {
  --article-ink: #111827;
  --article-muted: #5b6573;
  --article-line: #e6eaf0;
  --article-accent: #ff6600;
  --article-bg: #fbfcfe;
  --article-card: #ffffff;
}

body.article-page {
  margin: 0;
  background: var(--article-bg);
  color: var(--article-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Songti SC", "Noto Serif SC", Georgia, serif;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--article-accent);
  z-index: 40;
}

.article-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(251, 252, 254, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--article-line);
}

.article-topbar a,
.back-link {
  color: var(--article-muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
}

.article-topbar-actions {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.article-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.article-toc {
  position: sticky;
  top: 4.2rem;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  font-family: system-ui, sans-serif;
  font-size: 0.84rem;
}

.article-toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--article-muted);
}

.article-toc a {
  display: block;
  color: var(--article-muted);
  text-decoration: none;
  padding: 0.28rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.55rem;
}

.article-toc a.active,
.article-toc a:hover {
  color: var(--article-ink);
  border-left-color: var(--article-accent);
}

.article-toc .toc-h3 {
  padding-left: 1rem;
  font-size: 0.8rem;
}

.article-hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--article-line);
}

.article-kicker {
  margin: 0 0 0.5rem;
  color: var(--article-accent);
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-meta {
  margin: 0 0 1rem;
  color: var(--article-muted);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

.article-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-family: system-ui, sans-serif;
}

.article-controls select {
  min-width: 220px;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--article-line);
  background: var(--article-card);
}

.article-body {
  font-size: 1.08rem;
  line-height: 1.75;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.015em;
  scroll-margin-top: 4.5rem;
}

.article-body h2 {
  margin-top: 2.2rem;
  font-size: 1.45rem;
}

.article-body h3 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}

.article-body a {
  color: #b34700;
}

.article-body blockquote {
  margin: 1.1rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--article-accent);
  color: #374151;
}

.article-body .markdown-table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--article-line);
  border-radius: 8px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
}

.article-body th,
.article-body td {
  border-bottom: 1px solid var(--article-line);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.language-switch button {
  border: 1px solid var(--article-line);
  background: #fff;
  padding: 0.3rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}

.language-switch button.active {
  border-color: var(--article-accent);
  color: var(--article-accent);
  font-weight: 600;
}

@media (max-width: 900px) {
  .article-shell {
    grid-template-columns: 1fr;
  }
  .article-toc {
    position: static;
    max-height: none;
    margin-bottom: 0.5rem;
  }
}
