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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.7;
  color: #202122;
  background-color: #fff;
}

.page-wrapper {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Sticky Table of Contents (left sidebar) ── */

.toc-sidebar {
  position: sticky;
  top: 24px;
  align-self: flex-start;
  width: 280px;
  min-width: 240px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px 24px 16px 0;
  flex-shrink: 0;
}

.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: #c8ccd1;
  border-radius: 2px;
}

.toc-title {
  font-size: 18px;
  font-weight: 700;
  color: #202122;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #a2a9b1;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
}

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

.toc-item {
  margin-bottom: 0;
}

.toc-item > a {
  display: block;
  padding: 4px 0;
  color: #0645ad;
  text-decoration: none;
  font-family: sans-serif;
  transition: color 0.15s;
}

.toc-item > a:hover {
  text-decoration: underline;
}

.toc-number {
  display: inline-block;
  min-width: 28px;
  font-weight: 700;
  color: #202122;
}

.toc-text {
  font-weight: 700;
  font-size: 15px;
}

.toc-sub {
  list-style: none;
  padding-left: 12px;
  margin: 0;
}

.toc-sub .toc-item > a {
  padding: 2px 0;
}

.toc-sub .toc-number {
  min-width: 34px;
  font-weight: 400;
  color: #202122;
  font-size: 14px;
}

.toc-sub .toc-text {
  font-weight: 400;
  font-size: 14px;
}

/* ── Main Article Content ── */

.article-content {
  flex: 1;
  min-width: 0;
  max-width: 960px;
  padding: 0 0 80px 32px;
}

.article-title {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
  color: #000;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin: 20px 0 12px;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
}

.article-meta {
  font-size: 13px;
  color: #72777d;
  margin-bottom: 20px;
  font-style: italic;
  font-family: sans-serif;
}

.lead-paragraph {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 24px;
}

/* ── Infobox ── */

.infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 0 0 16px 24px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: sans-serif;
  border-collapse: collapse;
}

.infobox-header {
  background: #1a1a2e;
  color: #fff;
  text-align: center;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.infobox table {
  width: 100%;
  border-collapse: collapse;
}

.infobox td {
  padding: 6px 10px;
  border-top: 1px solid #ddd;
  vertical-align: top;
}

.infobox td:first-child {
  font-weight: 600;
  width: 42%;
  color: #54595d;
}

/* ── Section headings ── */

h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 3px;
  margin: 32px 0 10px;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 24px 0 8px;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
}

h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 6px;
}

p {
  margin-bottom: 14px;
}

/* ── Tables ── */

.wiki-table {
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  font-family: sans-serif;
  width: 100%;
  max-width: 720px;
}

.wiki-table th,
.wiki-table td {
  border: 1px solid #a2a9b1;
  padding: 6px 10px;
  text-align: left;
}

.wiki-table th {
  background: #eaecf0;
  font-weight: 600;
}

.wiki-table tr:nth-child(even) {
  background: #f8f9fa;
}

/* ── Lists ── */

ul, ol {
  margin: 8px 0 14px 24px;
}

li {
  margin-bottom: 4px;
}

/* ── Misc ── */

strong {
  font-weight: 700;
}

.category-bar {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px solid #a2a9b1;
  font-size: 13px;
  color: #72777d;
  font-family: sans-serif;
}

.category-bar span {
  font-weight: 600;
  color: #54595d;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .page-wrapper {
    flex-direction: column;
  }

  .toc-sidebar {
    position: relative;
    top: 0;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #a2a9b1;
    padding: 12px 0;
    margin-bottom: 16px;
  }

  .article-content {
    padding-left: 0;
  }

  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 20px 0;
  }
}
