:root {
  color-scheme: dark;
  --page: #0d0f11;
  --surface: #15181b;
  --surface-hover: #1b1f23;
  --surface-soft: #111417;
  --ink: #f3f5f7;
  --muted: #9299a2;
  --line: #292e34;
  --line-strong: #3a4149;
  --blue: #4d8df7;
  --blue-hover: #6aa0fa;
  --green: #49ad78;
  --coral: #df745e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-size: 15px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.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 {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgb(17 20 23 / 94%);
  backdrop-filter: blur(18px);
}

.header-inner,
.page-shell,
.site-footer > div {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  min-height: calc(100vh - 143px);
  padding: 52px 0 78px;
}

.catalog-overview {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}

.overview-copy,
.overview-tools {
  animation: content-enter 380ms var(--ease-out) both;
}

.overview-tools {
  width: min(360px, 42vw);
  animation-delay: 45ms;
}

.catalog-overview h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 730;
  line-height: 1.2;
}

.catalog-meta {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.model-filters {
  display: flex;
  gap: 8px;
  margin: -12px 0 30px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.model-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: #171b1f;
  color: #929aa4;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 130ms var(--ease-out);
}

.filter-button:hover {
  background: #20262c;
  color: var(--ink);
}

.filter-button:active {
  transform: scale(0.97);
}

.filter-button.is-active {
  background: #294d86;
  color: #ffffff;
}

.search-field {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
}

.search-symbol {
  position: absolute;
  left: 15px;
  width: 15px;
  height: 15px;
  border: 1.7px solid #7f8791;
  border-radius: 50%;
  pointer-events: none;
  transition:
    border-color 140ms ease,
    transform 170ms var(--ease-out);
}

.search-symbol::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: #7f8791;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
  transition: background 140ms ease;
}

.search-field:focus-within .search-symbol {
  border-color: #b9d2ff;
  transform: scale(1.06);
}

.search-field:focus-within .search-symbol::after {
  background: #b9d2ff;
}

.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 47px 0 44px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: #1a1e22;
  color: var(--ink);
  caret-color: var(--blue);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.search-field input::placeholder {
  color: #747c86;
}

.search-field input:hover {
  background: #20252a;
}

.search-field input:focus {
  background: #242a31;
  box-shadow: 0 0 0 3px rgb(77 141 247 / 18%);
}

.clear-search {
  position: absolute;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 120ms var(--ease-out);
}

.clear-search:hover {
  background: #272c32;
  color: var(--ink);
}

.clear-search:active {
  transform: scale(0.93);
}

.firmware-list {
  display: grid;
  gap: 24px;
}

.model-section {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #14171a;
  box-shadow: 0 14px 34px rgb(0 0 0 / 16%);
  opacity: 1;
  transform: translateY(0);
}

.model-section.will-reveal {
  opacity: 0.001;
  transform: translateY(12px);
}

.model-section.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 300ms var(--ease-out),
    transform 360ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.model-heading {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  background: #1b2026;
}

.model-section[data-tone="blue"] .model-heading {
  background: #182235;
}

.model-section[data-tone="green"] .model-heading {
  background: #18271f;
}

.model-section[data-tone="coral"] .model-heading {
  background: #2a1f1c;
}

.model-heading h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 710;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-heading span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #aab1ba;
  font-size: 11px;
  font-weight: 650;
}

.firmware-table {
  min-width: 0;
}

.firmware-table-header,
.firmware-row {
  display: grid;
  grid-template-columns:
    minmax(100px, 0.68fr) minmax(116px, 0.8fr) minmax(82px, 0.58fr)
    minmax(200px, 1.4fr) minmax(180px, 1.15fr) 100px;
  column-gap: 20px;
  align-items: start;
}

.firmware-table-header {
  padding: 11px 20px;
  background: #101316;
  color: #737b85;
  font-size: 10px;
  font-weight: 680;
}

.firmware-row {
  position: relative;
  min-height: 112px;
  padding: 22px 20px;
  transition: background 160ms ease;
}

.firmware-row + .firmware-row {
  margin-top: 2px;
}

.firmware-row:nth-child(even) {
  background: #15191c;
}

.firmware-row:nth-child(odd) {
  background: #181c20;
}

.firmware-row::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  content: "";
  opacity: 0;
  transform: scaleY(0.4);
  transition:
    opacity 160ms ease,
    transform 220ms var(--ease-out);
}

.firmware-row:hover {
  background: #20262c;
}

.firmware-row:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.firmware-cell {
  min-width: 0;
}

.cell-label {
  display: none;
  margin-bottom: 5px;
  color: #747c86;
  font-size: 10px;
  font-weight: 680;
}

.version-value {
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 730;
  line-height: 1.35;
}

.release-date,
.file-size {
  color: #c4c9cf;
  font-variant-numeric: tabular-nums;
}

.checksum-wrap {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
}

.checksum {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #aeb5be;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.62;
}

.copy-button {
  flex: 0 0 auto;
  min-width: 39px;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: #1d2125;
  color: #aeb5be;
  cursor: pointer;
  font-size: 10px;
  font-weight: 660;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    transform 120ms var(--ease-out);
}

.copy-button:hover {
  background: #252a30;
  color: #ffffff;
}

.copy-button:active {
  transform: scale(0.94);
}

.copy-button.is-copied {
  background: #173d2a;
  color: #8fe0b1;
}

.changelog-list {
  margin: 0;
  padding: 0;
  color: #c4c9cf;
  list-style: none;
}

.changelog-list li {
  position: relative;
  padding-left: 12px;
}

.changelog-list li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.empty-changelog {
  color: #818994;
}

.download-cell {
  display: flex;
  justify-content: flex-end;
}

.download-button {
  display: inline-flex;
  min-width: 82px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 690;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 130ms var(--ease-out);
}

.download-button::before {
  content: "↓";
  font-size: 15px;
  line-height: 1;
  transition: transform 180ms var(--ease-out);
}

.download-button:hover {
  background: var(--blue-hover);
}

.download-button:hover::before {
  transform: translateY(2px);
}

.download-button:active {
  transform: scale(0.97);
}

.download-button.is-disabled {
  background: #22262b;
  color: #777f89;
  cursor: not-allowed;
  pointer-events: none;
}

.download-button.is-disabled::before {
  display: none;
}

.loading-state,
.load-error,
.empty-state {
  border-radius: 8px;
  background: #171b1f;
}

.loading-state {
  display: grid;
  gap: 13px;
  padding: 24px;
}

.loading-line {
  width: 64%;
  height: 13px;
  border-radius: 5px;
  background: #252a30;
  animation: loading-pulse 900ms ease-in-out infinite alternate;
}

.loading-line-wide {
  width: 88%;
}

.load-error,
.empty-state {
  padding: 32px;
}

.load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.load-error strong,
.empty-state strong {
  font-size: 16px;
}

.load-error p,
.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
}

.load-error button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 0;
  border-radius: 7px;
  background: #1d2125;
  color: var(--ink);
  cursor: pointer;
  font-weight: 660;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 120ms var(--ease-out);
}

.load-error button:hover {
  background: #252a30;
}

.load-error button:active {
  transform: scale(0.97);
}

.empty-state {
  text-align: center;
}

.site-footer {
  background: #0a0c0e;
  color: #737b85;
  font-size: 12px;
}

.site-footer > div {
  display: flex;
  min-height: 72px;
  align-items: center;
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading-pulse {
  from {
    opacity: 0.45;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .firmware-table-header {
    display: none;
  }

  .firmware-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 28px;
    min-height: 0;
    padding: 23px 20px;
  }

  .cell-label {
    display: block;
  }

  .checksum-cell,
  .changelog-cell {
    grid-column: 1 / -1;
  }

  .download-cell {
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    padding-top: 4px;
  }

  .download-cell .cell-label {
    display: none;
  }

  .download-button {
    width: auto;
    min-width: 108px;
    padding: 0 18px;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .page-shell,
  .site-footer > div {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    min-height: 66px;
  }

  .page-shell {
    padding: 28px 0 52px;
  }

  .catalog-overview {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }

  .catalog-overview h1 {
    font-size: 29px;
  }

  .overview-tools {
    width: 100%;
  }

  .firmware-list {
    gap: 16px;
  }

  .model-heading {
    min-height: 58px;
    padding: 13px 15px;
  }

  .model-heading h2 {
    font-size: 17px;
  }

  .firmware-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 8px;
    padding: 16px 15px;
  }

  .cell-label {
    margin-bottom: 3px;
  }

  .version-value {
    font-size: 16px;
  }

  .release-date,
  .file-size {
    font-size: 13px;
    white-space: nowrap;
  }

  .checksum-cell {
    grid-column: 1 / -1;
  }

  .checksum {
    font-size: 10px;
    line-height: 1.5;
  }

  .changelog-cell {
    grid-column: 1 / -1;
  }

  .changelog-list,
  .empty-changelog {
    font-size: 13px;
  }

  .download-cell {
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    padding-top: 4px;
  }

  .download-cell .cell-label {
    display: none;
  }

  .download-button {
    min-width: 0;
    height: 38px;
    min-width: 108px;
    padding: 0 18px;
  }

  .load-error {
    align-items: stretch;
    flex-direction: column;
  }

  .load-error button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .brand-copy > span {
    max-width: 176px;
  }

  .model-heading span {
    display: none;
  }

  .firmware-row {
    padding-right: 13px;
    padding-left: 13px;
  }
}

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

  .model-section.will-reveal {
    opacity: 1;
    transform: none;
  }
}
