:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body.public-shell {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--shell-bg);
  color: var(--shell-text);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.download-page {
  min-height: calc(100vh - var(--shell-header-height));
  padding: 112px 32px 92px;
}

.download-container {
  width: min(100%, var(--shell-width));
  margin-inline: auto;
}

.download-intro {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 104px;
}

.download-intro__icon {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  object-fit: contain;
}

.download-intro__eyebrow {
  margin: 0 0 10px;
  color: var(--shell-blue-light);
  font: 600 10px/1.2 Consolas, "SFMono-Regular", monospace;
  letter-spacing: .14em;
}

.download-intro h1 {
  margin: 0;
  color: var(--shell-text);
  font-size: clamp(30px, 2.5vw, 40px);
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.1;
}

.download-intro > div > p:last-child {
  margin: 10px 0 0;
  color: #a7b3bf;
  font-size: 17px;
  line-height: 1.5;
}

.release-browser {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 48px;
  margin-top: 38px;
}

.release-timeline {
  min-width: 0;
  padding: 0 48px 2px 0;
  border-right: 1px solid var(--shell-line);
}

.release-timeline__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.release-timeline__heading h2 {
  margin: 0;
  color: var(--shell-text);
  font-size: 18px;
  font-weight: 680;
  line-height: 1.3;
}

.release-count {
  color: var(--shell-muted);
  font: 11px/1.4 Consolas, "SFMono-Regular", monospace;
  white-space: nowrap;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 8px;
  padding: 0 0 0 30px;
  border-left: 1px solid #4b5865;
}

.timeline-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-content: center;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.timeline-item:hover {
  border-color: rgba(88, 172, 255, .24);
  background: #0c1218;
}

.timeline-item:focus-visible,
.timeline-more:focus-visible,
.primary-download:focus-visible,
.download-source:focus-visible,
.release-error button:focus-visible,
.detail-changelog-link:focus-visible {
  outline: 2px solid var(--shell-blue-light);
  outline-offset: 3px;
}

.timeline-item[aria-selected="true"] {
  border-color: rgba(51, 151, 250, .34);
  background: #111a24;
}

.timeline-item__marker {
  position: absolute;
  top: 50%;
  left: -39px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #718091;
  transform: translateY(-50%);
}

.timeline-item__marker i {
  font-size: 11px;
  transition: color 160ms ease, font-size 160ms ease;
}

.timeline-item[aria-selected="true"] .timeline-item__marker i {
  color: var(--shell-blue);
  font-size: 16px;
}

.timeline-item__version {
  min-width: 0;
  color: #e7edf4;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.25;
}

.timeline-item[aria-selected="true"] .timeline-item__version {
  color: var(--shell-blue-light);
}

.timeline-item__badge {
  align-self: center;
  padding: 4px 8px;
  border: 1px solid rgba(51, 151, 250, .4);
  border-radius: 999px;
  color: var(--shell-blue-light);
  font: 600 10px/1 Consolas, "SFMono-Regular", monospace;
  letter-spacing: .04em;
}

.timeline-item__date {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  color: var(--shell-muted);
  font: 12px/1.4 Consolas, "SFMono-Regular", monospace;
}

.timeline-item__date i {
  width: 14px;
  color: #718091;
  text-align: center;
}

.timeline-item.is-history-hidden {
  display: none;
}

.timeline-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0 38px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--shell-blue-light);
  cursor: pointer;
  font: 600 12px/1.4 "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

.timeline-more[hidden] {
  display: none;
}

.timeline-more i {
  font-size: 10px;
  transition: transform 180ms ease;
}

.timeline-more:hover i {
  transform: translateX(3px);
}

.timeline-more[aria-expanded="true"] i {
  transform: rotate(-90deg);
}

.release-detail {
  min-width: 0;
  padding: 10px 0 0;
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(51, 151, 250, .4);
  border-radius: 999px;
  color: var(--shell-blue-light);
  font: 600 10px/1 Consolas, "SFMono-Regular", monospace;
  letter-spacing: .06em;
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 14px;
}

.detail-version {
  margin: 0;
  color: var(--shell-text);
  font-size: clamp(40px, 4vw, 54px);
  font-weight: 730;
  letter-spacing: -.04em;
  line-height: 1;
}

.detail-version-name {
  margin: 10px 0 0;
  color: var(--shell-muted);
  font-size: 13px;
}

.primary-download {
  display: inline-flex;
  min-height: 50px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid #4ba8ff;
  border-radius: 8px;
  background: var(--shell-blue);
  box-shadow: 0 12px 32px rgba(51, 151, 250, .14);
  color: #06111b;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-download:hover {
  border-color: #76bdff;
  background: var(--shell-blue-light);
  transform: translateY(-1px);
}

.primary-download.is-disabled {
  border-color: var(--shell-line);
  background: #151d25;
  box-shadow: none;
  color: var(--shell-muted);
  cursor: not-allowed;
  transform: none;
}

.detail-meta {
  display: grid;
  grid-template-columns: minmax(140px, .7fr) minmax(180px, .8fr) minmax(250px, 1.45fr);
  margin-top: 26px;
  padding: 20px 0;
  border-top: 1px solid var(--shell-line);
  border-bottom: 1px solid var(--shell-line);
}

.detail-meta__item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 0 24px;
  border-right: 1px solid var(--shell-line);
}

.detail-meta__item:first-child {
  padding-left: 0;
}

.detail-meta__item:last-child {
  padding-right: 0;
  border-right: 0;
}

.detail-meta__item > i {
  grid-row: 1 / span 2;
  color: #9aa7b5;
  font-size: 20px;
  text-align: center;
}

.detail-meta__label {
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.3;
}

.detail-meta__value {
  overflow: hidden;
  color: #e7edf4;
  font: 600 13px/1.35 Consolas, "SFMono-Regular", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-section {
  margin-top: 24px;
}

.detail-section__title {
  margin: 0 0 12px;
  color: #dfe7ef;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.4;
}

.detail-changelog {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-changelog li {
  position: relative;
  padding-left: 18px;
  color: #a7b3bf;
  font-size: 13px;
  line-height: 1.55;
}

.detail-changelog li::before {
  position: absolute;
  top: .7em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--shell-blue);
  content: "";
}

.detail-changelog--empty {
  color: var(--shell-muted);
  font-size: 13px;
}

.detail-changelog-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--shell-blue-light);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.detail-changelog-link i {
  font-size: 10px;
}

.download-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.download-source {
  display: grid;
  min-width: 0;
  min-height: 84px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: #0c1218;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.download-source:hover {
  border-color: rgba(88, 172, 255, .62);
  background: #101923;
  transform: translateY(-1px);
}

.download-source__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #dce5ee;
  font-size: 22px;
}

.download-source__info {
  min-width: 0;
}

.download-source__name {
  overflow: hidden;
  color: #e8eef5;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-source__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  color: var(--shell-muted);
  font-size: 10px;
  line-height: 1.35;
}

.download-source__code {
  color: #9fcfff;
}

.download-source__action {
  color: var(--shell-blue-light);
  font-size: 16px;
}

.download-source-empty {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed var(--shell-line);
  border-radius: 8px;
  color: var(--shell-muted);
  font-size: 12px;
  text-align: center;
}

.download-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.5;
}

.download-hint i {
  color: #718091;
}

.download-loading,
.detail-loading,
.release-error {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--shell-muted);
  font-size: 12px;
}

.detail-loading {
  min-height: 420px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #34414e;
  border-top-color: var(--shell-blue);
  border-radius: 50%;
  animation: download-spin 800ms linear infinite;
}

.release-error {
  flex-direction: column;
  text-align: center;
}

.release-error i {
  color: #718091;
  font-size: 22px;
}

.release-error p {
  margin: 0;
}

.release-error button {
  padding: 8px 14px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #111820;
  color: var(--shell-text);
  cursor: pointer;
  font: inherit;
}

@keyframes download-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1040px) {
  .release-browser {
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 34px;
  }

  .release-timeline {
    padding-right: 34px;
  }

  .detail-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-meta__item:nth-child(2) {
    border-right: 0;
  }

  .detail-meta__item:last-child {
    grid-column: 1 / -1;
    margin-top: 16px;
    padding: 16px 0 0;
    border-top: 1px solid var(--shell-line);
  }

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

@media (max-width: 760px) {
  .download-page {
    padding: 96px 20px 64px;
  }

  .download-intro {
    gap: 18px;
  }

  .download-intro__icon {
    width: 70px;
    height: 70px;
  }

  .download-intro__eyebrow {
    margin-bottom: 7px;
  }

  .download-intro > div > p:last-child {
    margin-top: 7px;
    font-size: 14px;
  }

  .release-browser {
    display: block;
    margin-top: 30px;
  }

  .release-timeline {
    padding: 0 0 28px;
    border-right: 0;
    border-bottom: 1px solid var(--shell-line);
  }

  .release-timeline__heading {
    margin-bottom: 16px;
  }

  .timeline-list {
    display: grid;
    grid-auto-columns: minmax(188px, 68vw);
    grid-auto-flow: column;
    gap: 8px;
    overflow-x: auto;
    margin: 0;
    padding: 0 0 8px;
    border-left: 0;
    scrollbar-width: thin;
  }

  .timeline-item {
    min-height: 82px;
    border-color: var(--shell-line);
    background: #0c1218;
  }

  .timeline-item__marker {
    display: none;
  }

  .timeline-more {
    margin: 12px 0 0;
  }

  .release-detail {
    padding-top: 32px;
  }

  .detail-title-row {
    margin-top: 12px;
  }

  .primary-download {
    width: 100%;
  }

  .detail-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-meta__item,
  .detail-meta__item:first-child,
  .detail-meta__item:last-child {
    grid-column: auto;
    margin: 0;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
  }

  .detail-meta__item:last-child {
    border-bottom: 0;
  }

  .download-sources {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
