:root {
  color-scheme: light;
  --page: #f4f3f0;
  --surface: #ffffff;
  --surface-muted: #eceae5;
  --text: #202225;
  --muted: #686b70;
  --line: #d8d5ce;
  --line-strong: #b9b5ac;
  --red: #a6292d;
  --red-dark: #7e1f23;
  --teal: #147d7c;
  --ink: #181a1d;
  --focus: #147d7c;
  --radius: 6px;
  --shadow: 0 12px 30px rgba(32, 34, 37, 0.08);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand span {
  display: grid;
  min-width: 0;
}

.brand strong {
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.icon-link:hover {
  color: var(--text);
}

.icon-link svg,
.primary-button svg,
.secondary-button svg,
.release-download svg,
.copy-button svg,
.search-field svg,
.empty-state svg,
.error-state svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

main {
  display: block;
}

.latest-band {
  min-height: min(560px, calc(100vh - 78px));
  padding: clamp(54px, 9vh, 100px) max(24px, calc((100vw - 1180px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
  background:
    linear-gradient(90deg, rgba(20, 125, 124, 0.08) 0, transparent 34%),
    var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.latest-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.latest-summary {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
}

.latest-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.release-download {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button {
  min-width: 168px;
  padding: 0 20px;
  background: var(--red);
  color: #fff;
}

.primary-button:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.primary-button.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--text);
  background: var(--surface-muted);
}

.latest-meta {
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.latest-meta > div {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

dd {
  margin: 0;
}

.checksum-row dd,
.asset-sha-row dd {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

code {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.checksum-row code,
.asset-sha {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.copy-button:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
}

.copy-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.release-section {
  width: min(1020px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: 0;
}

.release-count {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.release-toolbar {
  margin: 30px 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-field {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 15%, transparent);
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.sort-field {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.sort-field select {
  height: 100%;
  padding: 0 34px 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

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

.release-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(32, 34, 37, 0.02);
}

.release-item-head {
  padding: 24px 24px 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.release-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.release-title-row h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.latest-badge {
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--teal) 42%, transparent);
  border-radius: 999px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.release-date {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.release-download {
  min-width: 92px;
  padding: 0 15px;
  border: 1px solid var(--red);
  color: var(--red);
}

.release-download:hover {
  background: var(--red);
  color: #fff;
}

.release-intro {
  margin: 18px 24px 0;
  color: var(--text);
}

.release-file-meta {
  margin: 20px 24px 24px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px minmax(260px, 1.2fr);
  gap: 14px 24px;
}

.release-file-meta > div {
  min-width: 0;
}

.release-file-meta dd {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-notes {
  border-top: 1px solid var(--line);
}

.release-notes h4 {
  margin: 0;
  padding: 18px 24px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.markdown-body {
  padding: 4px 24px 28px;
  color: #373a3e;
  font-size: 14px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 24px 0 8px;
  line-height: 1.35;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  font-size: 19px;
}

.markdown-body h3,
.markdown-body h4 {
  font-size: 16px;
}

.markdown-body p,
.markdown-body ul {
  margin: 10px 0;
}

.markdown-body ul {
  padding-left: 22px;
}

.markdown-body li + li {
  margin-top: 5px;
}

.markdown-body code {
  padding: 2px 5px;
  border: 1px solid #ddd9d1;
  border-radius: 3px;
  background: #f1efe9;
  color: #7d2227;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 4px;
  background: var(--ink);
  color: #f2f2f0;
}

.markdown-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.loading-state,
.empty-state,
.error-state {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.loading-state {
  padding: 30px;
}

.loading-line {
  width: 42%;
  height: 18px;
  display: block;
  border-radius: 3px;
  background: linear-gradient(90deg, #eceae5, #f7f6f3, #eceae5);
  background-size: 200% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

.loading-line.short {
  width: 68%;
  height: 12px;
  margin-top: 18px;
}

@keyframes loading {
  to { background-position: -200% 0; }
}

.empty-state,
.error-state {
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state:not([hidden]),
.error-state:not([hidden]) {
  display: flex;
}

.empty-state svg,
.error-state svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
}

.empty-state p,
.error-state p {
  margin: 2px 0 0;
}

.error-state {
  color: var(--red-dark);
  text-align: left;
}

footer {
  min-height: 96px;
  padding: 24px max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: #bfc0bd;
  font-size: 12px;
}

footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .latest-band {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .latest-meta {
    max-width: none;
  }

  .release-file-meta {
    grid-template-columns: 1fr 100px;
  }

  .asset-sha-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .site-header {
    width: min(100% - 28px, 1180px);
    min-height: 68px;
  }

  .brand strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small,
  .icon-link span {
    display: none;
  }

  .latest-band {
    padding: 48px 20px 54px;
    gap: 44px;
  }

  .latest-copy h1 {
    font-size: 40px;
  }

  .latest-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .latest-meta > div {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .release-section {
    width: min(100% - 28px, 1020px);
    padding: 54px 0 68px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .release-toolbar {
    grid-template-columns: 1fr;
  }

  .sort-field {
    justify-content: space-between;
  }

  .release-item-head {
    padding: 20px 18px 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .release-download {
    width: 100%;
  }

  .release-intro {
    margin: 16px 18px 0;
  }

  .release-file-meta {
    margin: 18px;
    grid-template-columns: 1fr;
  }

  .asset-sha-row {
    grid-column: auto;
  }

  .release-notes h4 {
    padding: 16px 18px 0;
  }

  .markdown-body {
    padding: 4px 18px 24px;
  }

  footer {
    min-height: 112px;
    align-items: start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
