/* Tier.SC Tech Wiki — Wikipedia-inspired styling */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #f8f9fa;
  color: #202122;
  font-size: 14.5px;
  line-height: 1.65;
}
a { color: #36c; text-decoration: none; }
a:visited { color: #795cb2; }
a:hover { text-decoration: underline; }
a.new { color: #ba0000; }

/* Header */
#wiki-header {
  background: #fff;
  border-bottom: 1px solid #a2a9b1;
  padding: 10px 0;
  position: sticky; top: 0; z-index: 100;
}
.hdr-inner {
  max-width: 1300px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.hdr-logo {
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 22px; color: #202122; font-weight: 600;
}
.hdr-logo:hover { text-decoration: none; }
.hdr-logo span {
  font-size: 13px; color: #54595d; margin-left: 6px; font-weight: 400;
  font-family: inherit;
}
.hdr-home { font-size: 13px; color: #36c; }

/* Layout */
#wiki-layout {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: start;
}

/* Sidebar nav */
#wiki-nav {
  padding: 20px 16px;
  border-right: 1px solid #eaecf0;
  position: sticky; top: 51px;
  align-self: start;
  max-height: calc(100vh - 51px);
  overflow-y: auto;
  font-size: 13px;
}
.nav-title {
  font-size: 11px; color: #54595d; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 700;
}
#wiki-nav ul { list-style: none; padding: 0; margin: 0 0 12px 0; }
#wiki-nav li { margin: 3px 0; }
#wiki-nav li a { display: block; padding: 3px 6px; border-radius: 2px; color: #202122; }
#wiki-nav li a:hover { background: #eaecf0; text-decoration: none; }
#wiki-nav li a.active { background: #eaf3ff; color: #0645ad; font-weight: 600; }
#wiki-nav .nav-section-title {
  font-weight: 700; font-size: 12px; color: #54595d;
  margin: 10px 0 4px 0; text-transform: none;
}
#wiki-nav .nav-children { margin-left: 10px; border-left: 1px solid #eaecf0; padding-left: 6px; }

/* Main content */
#wiki-main {
  background: #fff;
  padding: 20px 28px 48px;
  min-height: calc(100vh - 52px);
  border-left: 1px solid #eaecf0;
}
.breadcrumb {
  font-size: 12px; color: #54595d;
  margin-bottom: 4px;
}
.breadcrumb a { color: #54595d; }
.breadcrumb .sep { margin: 0 4px; color: #a2a9b1; }
h1.page-title {
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 28px; font-weight: 400;
  margin: 4px 0 4px 0; padding-bottom: 6px;
  border-bottom: 1px solid #a2a9b1;
}
.page-meta {
  font-size: 12px; color: #72777d; margin: 6px 0 18px 0;
}

/* Content typography */
.wiki-content h2 {
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 22px; font-weight: 400;
  margin: 28px 0 10px 0; padding-bottom: 4px;
  border-bottom: 1px solid #a2a9b1;
}
.wiki-content h3 {
  font-size: 17px; font-weight: 600;
  margin: 20px 0 8px 0;
}
.wiki-content h4 {
  font-size: 14.5px; font-weight: 700;
  margin: 14px 0 6px 0;
}
.wiki-content p { margin: 0 0 10px 0; }
.wiki-content ul, .wiki-content ol { margin: 0 0 10px 0; padding-left: 24px; }
.wiki-content li { margin: 3px 0; }
.wiki-content strong { font-weight: 700; }
.wiki-content em { font-style: italic; }

/* Links */
.wiki-content a { color: #36c; }

/* Code */
.wiki-content code {
  background: #f8f9fa; border: 1px solid #eaecf0;
  padding: 1px 4px; border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.wiki-content pre {
  background: #f8f9fa; border: 1px solid #eaecf0;
  padding: 10px 12px; border-radius: 2px;
  overflow-x: auto; font-size: 13px;
}
.wiki-content pre code { background: none; border: none; padding: 0; }

/* Tables */
.wiki-content table {
  border-collapse: collapse;
  margin: 12px 0;
  background: #f8f9fa;
}
.wiki-content table th,
.wiki-content table td {
  border: 1px solid #a2a9b1;
  padding: 6px 10px; text-align: left;
  vertical-align: top;
}
.wiki-content table th {
  background: #eaecf0; font-weight: 700;
}

/* Blockquote */
.wiki-content blockquote {
  border-left: 3px solid #c8ccd1;
  padding: 2px 14px; margin: 10px 0;
  color: #54595d;
}

/* Images / figures */
.wiki-content img {
  max-width: 100%; height: auto;
  border: 1px solid #eaecf0; border-radius: 2px;
  background: #fff; padding: 4px;
}
.wiki-content figure {
  margin: 14px 0; padding: 0;
  border: 1px solid #a2a9b1; border-radius: 2px;
  background: #f8f9fa; display: inline-block;
  max-width: 100%;
}
.wiki-content figure img { border: none; padding: 0; display: block; }
.wiki-content figure figcaption {
  font-size: 12px; color: #54595d; padding: 6px 10px;
  border-top: 1px solid #eaecf0;
}

/* TOC */
.toc {
  background: #f8f9fa; border: 1px solid #a2a9b1;
  padding: 10px 14px 10px 14px; margin: 16px 0 20px 0;
  display: inline-block; min-width: 280px;
  font-size: 14px;
}
.toctitle { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: #202122; }
.toctitle h2 { all: unset; font-weight: 700; font-size: 13px; }
.toc ul { list-style: none; padding-left: 16px; margin: 2px 0; }
.toc > ul { padding-left: 0; }
.toc li { margin: 2px 0; }
.toc a { color: #36c; }

/* Infobox (optional right-float) */
.infobox {
  float: right; clear: right;
  width: 260px; margin: 0 0 12px 18px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 13px;
}
.infobox .infobox-title {
  background: #eaecf0; font-weight: 700;
  padding: 6px 10px; text-align: center;
  border-bottom: 1px solid #a2a9b1;
}
.infobox table { width: 100%; border-collapse: collapse; background: none; margin: 0; }
.infobox th, .infobox td {
  padding: 4px 8px; border-bottom: 1px solid #eaecf0;
  vertical-align: top; font-size: 12px;
}
.infobox th { background: #eaecf0; text-align: left; width: 40%; }

/* Footnotes */
.footnote {
  font-size: 12px; color: #54595d;
  margin-top: 28px; padding-top: 10px; border-top: 1px solid #eaecf0;
}
.footnote ol { padding-left: 18px; }
sup.footnote-ref a { text-decoration: none; }

/* Page footer */
.page-footer {
  margin-top: 40px; padding-top: 12px;
  border-top: 1px solid #eaecf0;
  font-size: 12px; color: #72777d; text-align: center;
}
.page-footer a { color: #36c; }

/* PDF embed */
.pdf-embed {
  width: 100%; height: 800px;
  border: 1px solid #a2a9b1; margin: 10px 0;
}
.pdf-download {
  display: inline-block; padding: 6px 12px;
  background: #0645ad; color: #fff; border-radius: 2px;
  font-size: 13px; margin: 6px 0;
}
.pdf-download:visited { color: #fff; }
.pdf-download:hover { background: #0b398a; text-decoration: none; }

/* Responsive */
@media (max-width: 900px) {
  #wiki-layout { grid-template-columns: 1fr; }
  #wiki-nav { position: static; max-height: none; border-right: none; border-bottom: 1px solid #eaecf0; }
  #wiki-main { border-left: none; padding: 16px 14px 28px; }
  .infobox { float: none; width: 100%; margin: 0 0 12px 0; }
}
