/* 版本切换器：位于 Material 头部标题右侧的下拉。 */

.docs-version {
  position: relative;
  margin-left: 0.6rem;
  font-size: 0.7rem;
  flex: 0 0 auto;
}

.docs-version__summary {
  cursor: pointer;
  list-style: none;
  padding: 0.25rem 0.6rem;
  border-radius: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--md-primary-bg-color, #fff);
  white-space: nowrap;
  user-select: none;
}

.docs-version__summary::-webkit-details-marker {
  display: none;
}

.docs-version__summary::after {
  content: "▾";
  margin-left: 0.35rem;
  opacity: 0.75;
}

.docs-version__summary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.docs-version__menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 11rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.4rem 0;
  border-radius: 0.3rem;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color, #000);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.docs-version__section + .docs-version__section {
  margin-top: 0.3rem;
  border-top: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.08));
  padding-top: 0.3rem;
}

.docs-version__heading {
  padding: 0.25rem 0.9rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light, rgba(0, 0, 0, 0.55));
}

.docs-version__link {
  display: block;
  padding: 0.3rem 0.9rem;
  color: inherit;
  text-decoration: none;
}

.docs-version__link:hover {
  background: var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.06));
}

.docs-version__link[aria-current="page"] {
  font-weight: 700;
  color: var(--md-accent-fg-color, #1976d2);
}

.docs-version__empty {
  padding: 0.4rem 0.9rem;
  color: var(--md-default-fg-color--light, rgba(0, 0, 0, 0.55));
}

@media screen and (max-width: 44em) {
  /* 窄屏下头部空间紧张，只留版本号本身。 */
  .docs-version {
    margin-left: 0.3rem;
    font-size: 0.62rem;
  }
}
