.wiki-library-hero,
.wiki-page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(88, 217, 239, 0.18);
  background:
    radial-gradient(circle at 77% 16%, rgba(98, 76, 175, 0.35), transparent 34%),
    linear-gradient(135deg, rgba(8, 13, 24, 0.98), rgba(13, 22, 39, 0.94));
}

.wiki-library-hero::before,
.wiki-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(88, 217, 239, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 217, 239, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

.wiki-library-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.wiki-library-hero h1,
.wiki-page-hero h1 {
  max-width: 930px;
  margin: 0.55rem 0 1.15rem;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 5.6rem);
  line-height: 0.96;
  color: var(--text-main);
}

.wiki-library-hero p:not(.eyebrow) {
  max-width: 720px;
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.8;
}

.wiki-library-hero .guide-library-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.wiki-library-hero .guide-library-stats > span {
  display: inline-flex;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  align-items: baseline;
  border: 1px solid rgba(138, 161, 196, 0.24);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(9, 13, 22, 0.72);
  font-size: 0.78rem;
}

.wiki-library-hero .guide-library-stats strong {
  color: var(--cyan);
  font-size: 1rem;
}

.wiki-feature-art {
  position: relative;
  min-height: 410px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(88, 217, 239, 0.32);
  border-radius: 30px;
  background: #090d17;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.wiki-feature-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(4, 7, 13, 0.96));
}

.wiki-feature-art img {
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
}

.wiki-feature-art div {
  position: absolute;
  z-index: 1;
  right: 1.5rem;
  bottom: 1.45rem;
  left: 1.5rem;
}

.wiki-feature-art span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wiki-feature-art strong {
  display: block;
  max-width: 470px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.12;
}

.wiki-browser {
  min-height: 72vh;
}

.wiki-tools {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.wiki-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.wiki-filter-row .filter-button span {
  margin-left: 0.4rem;
  color: var(--cyan);
}

.wiki-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.wiki-card {
  display: flex;
  min-height: 228px;
  flex-direction: column;
  padding: 1.35rem;
  border: 1px solid rgba(138, 161, 196, 0.23);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 22, 35, 0.96), rgba(11, 16, 27, 0.96));
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.wiki-card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 217, 239, 0.62);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.wiki-card > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.wiki-card-category,
.wiki-card-images {
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wiki-card-images {
  color: var(--text-muted);
}

.wiki-card h2 {
  margin: 1.25rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.08;
}

.wiki-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wiki-card a {
  margin-top: auto;
  color: var(--cyan);
  font-weight: 800;
}

.wiki-page-hero .container {
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.wiki-page-hero h1 {
  max-width: 1050px;
  font-size: clamp(2.65rem, 5.5vw, 5rem);
}

.wiki-source-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wiki-source-line a {
  color: var(--cyan);
  font-weight: 800;
}

.wiki-license-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(102, 212, 234, 0.2);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.wiki-reading-section {
  background: linear-gradient(180deg, rgba(12, 17, 28, 0.72), rgba(7, 9, 16, 1) 320px);
}

.wiki-reading-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 900px);
  gap: clamp(2rem, 5vw, 4.5rem);
  justify-content: center;
  align-items: start;
}

.wiki-toc {
  position: sticky;
  top: 115px;
  max-height: calc(100vh - 145px);
  overflow-y: auto;
}

.wiki-toc-inner {
  padding: 1rem;
  border: 1px solid rgba(88, 217, 239, 0.2);
  border-radius: 16px;
  background: rgba(12, 18, 30, 0.88);
}

.wiki-toc-heading {
  margin: 0 0 0.65rem;
  color: var(--text-main);
  font-weight: 900;
}

.wiki-toc-links {
  display: grid;
  gap: 0.25rem;
}

.wiki-toc-toggle {
  display: none;
}

.wiki-toc a {
  padding: 0.34rem 0.45rem;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.wiki-toc a:hover {
  color: var(--cyan);
  background: rgba(88, 217, 239, 0.08);
}

.wiki-toc-h3 {
  margin-left: 0.8rem;
}

.wiki-article {
  min-width: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.wiki-article .spoiler-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  margin-bottom: 2rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(231, 187, 106, 0.25);
  border-radius: 14px;
  color: #d5c6a6;
  background: rgba(70, 47, 19, 0.2);
  font-size: 0.82rem;
}

.wiki-article .spoiler-notice strong {
  color: var(--gold);
}

.wiki-language-note {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(231, 187, 106, 0.45);
  border-radius: 14px;
  background: rgba(231, 187, 106, 0.08);
}

.wiki-language-note strong {
  color: var(--gold);
}

.wiki-language-note p {
  margin: 0.35rem 0 0;
}

.wiki-source-content > :first-child {
  margin-top: 0;
}

.wiki-source-content h2,
.wiki-source-content h3,
.wiki-source-content h4 {
  scroll-margin-top: 130px;
  color: var(--text-main);
  font-family: var(--font-display);
  line-height: 1.15;
}

.wiki-source-content h2 {
  margin: 3rem 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(88, 217, 239, 0.2);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.wiki-source-content h3 {
  margin: 2.25rem 0 0.8rem;
  color: var(--gold);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.wiki-source-content h4 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.15rem;
}

.wiki-source-content a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(88, 217, 239, 0.35);
  text-underline-offset: 0.2em;
}

.wiki-source-content figure {
  max-width: 100%;
  margin: 1.75rem auto;
  text-align: center;
}

.wiki-source-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(138, 161, 196, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.wiki-source-content figcaption {
  max-width: 720px;
  margin: 0.65rem auto 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.wiki-source-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wiki-source-content th,
.wiki-source-content td {
  padding: 0.75rem;
  border: 1px solid rgba(138, 161, 196, 0.24);
  vertical-align: top;
  text-align: left;
}

.wiki-source-content th {
  color: var(--text-main);
  background: rgba(88, 217, 239, 0.1);
}

.wiki-source-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

.wiki-source-content pre,
.wiki-source-content code {
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #c9eff7;
}

.wiki-source-content code {
  padding: 0.12em 0.35em;
}

.wiki-source-content pre {
  overflow-x: auto;
  padding: 1rem;
}

@media (max-width: 980px) {
  .wiki-library-hero-inner,
  .wiki-reading-layout {
    grid-template-columns: 1fr;
  }

  .wiki-feature-art {
    min-height: 330px;
  }

  .wiki-feature-art img {
    min-height: 330px;
  }

  .wiki-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wiki-toc {
    position: static;
    max-height: none;
  }

  .wiki-toc-inner {
    padding: 0.75rem;
  }
}

@media (max-width: 720px) {
  .wiki-library-hero-inner {
    padding-block: 3.5rem;
  }

  .wiki-feature-art {
    min-height: 260px;
  }

  .wiki-feature-art img {
    min-height: 260px;
  }

  .wiki-tools {
    display: grid;
  }

  .wiki-card-grid {
    grid-template-columns: 1fr;
  }

  .wiki-toc-heading {
    display: none;
  }

  .wiki-toc-toggle {
    display: flex;
    width: 100%;
    padding: 0.3rem 0.35rem;
    align-items: center;
    justify-content: space-between;
    border: 0;
    color: var(--text-main);
    background: transparent;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
  }

  .wiki-toc-toggle span:last-child {
    color: var(--cyan);
    font-size: 1.35rem;
    transition: transform 160ms ease;
  }

  .wiki-toc.is-open .wiki-toc-toggle span:last-child {
    transform: rotate(45deg);
  }

  .wiki-toc-links {
    display: none;
    max-height: min(58vh, 470px);
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    overflow-y: auto;
    border-top: 1px solid rgba(88, 217, 239, 0.16);
  }

  .wiki-toc.is-open .wiki-toc-links {
    display: grid;
  }

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

  .wiki-reading-layout {
    gap: 1.5rem;
  }

  .wiki-article .spoiler-notice {
    grid-template-columns: 1fr;
  }
}
