:root {
  --wiki-bg: #101711;
  --wiki-panel: rgba(239, 244, 234, 0.08);
  --wiki-panel-strong: rgba(239, 244, 234, 0.13);
  --wiki-line: rgba(224, 239, 220, 0.18);
  --wiki-text: #edf3e8;
  --wiki-muted: rgba(237, 243, 232, 0.66);
  --wiki-green: #7fbd84;
  --wiki-ink: #18231c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 24% 18%, rgba(122, 177, 126, 0.2), transparent 34%),
    linear-gradient(135deg, #0b100d, var(--wiki-bg) 52%, #182119);
  color: var(--wiki-text);
  font-family:
    Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.wiki-global-nav {
  display: none;
  align-items: center;
  gap: 12px;
  width: min(1320px, calc(100vw - 44px));
  height: 64px;
  min-height: 0;
  margin: 16px auto 0;
  padding: 9px 14px;
  border: 1px solid rgba(224, 239, 220, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(24, 35, 28, 0.88), rgba(18, 26, 21, 0.72)),
    rgba(15, 22, 17, 0.78);
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.wiki-standalone .wiki-global-nav {
  display: flex;
}

.wiki-home-link {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(237, 243, 232, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.wiki-home-link:hover {
  border-color: rgba(158, 221, 164, 0.55);
  background: rgba(126, 189, 132, 0.16);
  transform: translateY(-1px);
}

.wiki-home-link img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.wiki-nav-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.wiki-nav-title span {
  color: rgba(204, 232, 205, 0.62);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.22em;
}

.wiki-nav-title strong {
  overflow: hidden;
  color: var(--wiki-text);
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-shell {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  width: min(1320px, calc(100vw - 44px));
  height: calc(100vh - 118px);
  min-height: 0;
  margin: 14px auto 22px;
  overflow: hidden;
  border: 1px solid var(--wiki-line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(24, 35, 28, 0.94), rgba(18, 26, 21, 0.86)),
    rgba(15, 22, 17, 0.9);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.36),
    0 0 42px rgba(126, 189, 132, 0.12);
}

.wiki-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 24px;
  border-right: 1px solid var(--wiki-line);
  background: rgba(255, 255, 255, 0.035);
}

.wiki-brand span,
.wiki-topline span,
.wiki-empty span,
.wiki-article-kicker {
  color: rgba(204, 232, 205, 0.7);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.22em;
}

.wiki-brand h1 {
  margin: 8px 0 8px;
  font-size: 34px;
  line-height: 1.06;
}

.wiki-brand p {
  margin: 0;
  color: var(--wiki-muted);
  font-weight: 800;
}

.wiki-search {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  color: var(--wiki-muted);
  font-size: 13px;
  font-weight: 900;
}

.wiki-search input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(237, 243, 232, 0.18);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--wiki-text);
  padding: 0 13px;
  font-weight: 850;
}

.wiki-search input:focus {
  border-color: rgba(154, 215, 160, 0.62);
  box-shadow: 0 0 0 4px rgba(112, 183, 120, 0.12);
}

.wiki-categories {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.wiki-categories::-webkit-scrollbar {
  display: none;
}

.wiki-category-group {
  display: grid;
  gap: 0;
  min-width: 0;
}

.wiki-category-button,
.wiki-entry-button {
  width: 100%;
  border: 1px solid rgba(237, 243, 232, 0.13);
  color: var(--wiki-text);
  cursor: pointer;
  text-align: left;
}

.wiki-category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
  font-weight: 950;
  min-width: 0;
}

.wiki-category-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.wiki-category-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-category-title i {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid rgba(237, 243, 232, 0.72);
  transform: rotate(0deg);
  transform-origin: 45% 50%;
  transition: transform 220ms ease;
}

.wiki-category-group.open .wiki-category-title i {
  transform: rotate(90deg);
}

.wiki-category-button > span:last-child {
  flex: 0 0 auto;
  color: var(--wiki-muted);
  font-size: 12px;
}

.wiki-category-group.active > .wiki-category-button,
.wiki-entry-button.active {
  border-color: rgba(158, 221, 164, 0.58);
  background: rgba(126, 189, 132, 0.18);
}

.wiki-category-children {
  display: grid;
  gap: 8px;
  max-height: 0;
  overflow: hidden;
  padding: 0 0 0 14px;
  opacity: 0;
  transform: translateY(-4px);
  min-width: 0;
  transition:
    max-height 280ms ease,
    opacity 180ms ease,
    padding 220ms ease,
    transform 220ms ease;
}

.wiki-category-group.open .wiki-category-children {
  max-height: 1800px;
  padding: 8px 0 2px 14px;
  opacity: 1;
  transform: translateY(0);
}

.wiki-empty-entry {
  margin: 0;
  padding: 8px 10px;
  color: rgba(237, 243, 232, 0.46);
  font-size: 12px;
  font-weight: 850;
}

.wiki-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 22px 26px 28px;
}

.wiki-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}

.wiki-article::-webkit-scrollbar {
  display: none;
}

.wiki-entry-button {
  display: block;
  position: relative;
  min-height: 76px;
  max-height: 76px;
  overflow: hidden;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
  transition:
    max-height 220ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.wiki-entry-button:hover {
  z-index: 5;
  max-height: 220px;
  border-color: rgba(158, 221, 164, 0.44);
  background: rgba(126, 189, 132, 0.12);
  transform: translateX(3px);
}

.wiki-entry-button strong {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-entry-button span {
  display: block;
  max-height: calc(1.45em * 1.55);
  overflow: hidden;
  color: var(--wiki-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  transition: max-height 220ms ease;
}

.wiki-entry-button:hover span {
  max-height: 120px;
}

.wiki-article {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
  scrollbar-width: none;
}

.wiki-empty,
.wiki-article-body {
  min-height: 100%;
  border: 1px solid rgba(237, 243, 232, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
}

.wiki-empty {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 40px;
}

.wiki-empty h2 {
  margin: 10px 0;
  font-size: clamp(28px, 4vw, 52px);
}

.wiki-empty p {
  max-width: 640px;
  margin: 0;
  color: var(--wiki-muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.8;
}

.wiki-article-body {
  padding: clamp(24px, 4vw, 46px);
}

.wiki-article-body h2 {
  margin: 8px 0 12px;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.04;
}

.wiki-summary {
  max-width: 800px;
  margin: 0 0 24px;
  color: var(--wiki-muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.85;
}

.wiki-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.wiki-meta li {
  padding: 8px 11px;
  border: 1px solid rgba(237, 243, 232, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(237, 243, 232, 0.76);
  font-size: 13px;
  font-weight: 900;
}

.wiki-section {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(237, 243, 232, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.wiki-section h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.wiki-section p,
.wiki-section li {
  color: rgba(237, 243, 232, 0.76);
  font-weight: 780;
  line-height: 1.72;
}

.wiki-section p {
  margin: 0;
}

.wiki-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 19px;
}

.wiki-error {
  color: #ffd6a0;
}

.wiki-embed {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.wiki-embed .wiki-global-nav {
  display: none;
}

.wiki-embed .wiki-shell {
  width: 100%;
  height: 100vh;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wiki-embed .wiki-sidebar {
  padding: 18px;
}

.wiki-embed .wiki-brand h1 {
  font-size: 26px;
}

.wiki-embed .wiki-main {
  padding: 18px;
}

@media (max-width: 760px) {
  .wiki-shell {
    grid-template-columns: 1fr;
    width: 100%;
    height: calc(100vh - 80px);
    min-height: 0;
    margin: 0;
    border-radius: 0;
  }

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

  .wiki-embed .wiki-shell {
    grid-template-columns: minmax(210px, 38%) minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    min-height: 0;
    margin: 0;
    border-radius: 0;
  }

  .wiki-embed .wiki-sidebar {
    border-right: 1px solid var(--wiki-line);
    border-bottom: 0;
  }
}
