﻿:root {
  --bg: #f7f7f4;
  --paper: #ffffff;
  --ink: #202122;
  --muted: #54595d;
  --line: #a2a9b1;
  --soft-line: #d8dde3;
  --link: #0645ad;
  --link-visited: #0b0080;
  --table-head: #eaecf0;
  --aside: #f8f9fa;
  --accent: #2f6f62;
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 24px;
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.global-search input {
  width: min(420px, 45vw);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  padding: 0 10px;
}

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 58px);
}

.nav {
  border-right: 1px solid var(--soft-line);
  background: var(--aside);
  padding: 20px 18px;
}

.nav section + section {
  margin-top: 24px;
}

.nav h2 {
  margin: 0 0 10px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav a,
.link-stack a {
  display: block;
  padding: 5px 0;
  line-height: 1.4;
}

.article {
  min-width: 0;
  background: var(--paper);
  padding: 26px 34px 48px;
}

.page-title {
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.infobox {
  border: 1px solid var(--line);
  background: var(--aside);
  font-size: 14px;
}

.infobox-title {
  background: #dbe9e5;
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
}

.infobox img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid var(--soft-line);
}

.infobox dl,
.fact-list {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0;
  margin: 0;
}

.infobox dt,
.infobox dd,
.fact-list dt,
.fact-list dd {
  border-top: 1px solid var(--soft-line);
  margin: 0;
  padding: 7px 9px;
  line-height: 1.55;
}

.infobox dt,
.fact-list dt {
  color: var(--muted);
  font-weight: 700;
}

.section-title {
  margin: 28px 0 10px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 4px;
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 23px;
  font-weight: 400;
}

.prose {
  line-height: 1.85;
  white-space: pre-wrap;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.index-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  min-height: 78px;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  padding: 8px;
}

.index-item img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: var(--aside);
}

.index-item strong {
  display: block;
  line-height: 1.35;
}

.index-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wiki-table th,
.wiki-table td {
  border: 1px solid var(--soft-line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.wiki-table th {
  background: var(--table-head);
}

.note-list {
  display: grid;
  gap: 14px;
}

.note-entry {
  border-bottom: 1px solid var(--soft-line);
  padding: 0 0 14px;
}

.note-entry h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.note-link {
  margin: 8px 0 0;
}

.note-tags {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.pill {
  border: 1px solid var(--soft-line);
  background: var(--aside);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 13px;
}

.variant-list {
  display: grid;
  gap: 16px;
}

.variant-entry {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--soft-line);
  background: var(--aside);
  padding: 12px;
}

.variant-entry figure {
  margin: 0;
  border: 1px solid var(--soft-line);
  background: var(--paper);
}

.variant-entry img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #fff;
}

.variant-entry figcaption {
  border-top: 1px solid var(--soft-line);
  padding: 7px 9px;
  font-weight: 700;
  line-height: 1.4;
}

.variant-body {
  min-width: 0;
}

.variant-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.variant-body h3:not(:first-child) {
  margin-top: 18px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 3px;
  font-size: 16px;
}

.skill-entry {
  margin: 0 0 18px;
}

.skill-entry h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.inherited {
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .layout,
  .article-grid {
    display: block;
  }

  .global-search {
    margin-top: 10px;
  }

  .global-search input {
    width: 100%;
  }

  .nav {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .article {
    padding: 20px;
  }

  .infobox {
    margin-bottom: 20px;
  }
}

@media (max-width: 560px) {
  .page-title {
    font-size: 26px;
  }

  .index-grid,
  .variant-list,
  .variant-entry {
    grid-template-columns: 1fr;
  }

  .wiki-table {
    display: block;
    overflow-x: auto;
  }
}
