:root {
  --paper: #fafaf8;
  --ink: #0a0a0a;
  --grey-1: #f0f0ee;
  --grey-2: #d4d4d2;
  --grey-3: #737373;
  --accent: #002fa7;
  --accent-on: #ffffff;
  --line: 1px solid var(--grey-2);
  --sans: "Inter", "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", monospace;
  --page-pad: clamp(20px, 4vw, 64px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.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 {
  min-height: 72px;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: stretch;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 72px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 22px;
  font-weight: 600;
}

.brand-name {
  padding: 0 24px;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.header-meta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-meta a:hover {
  color: var(--accent);
}

.intro {
  min-height: min(680px, calc(100vh - 72px));
  padding: 64px var(--page-pad) 48px;
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(72px, 0.75fr) minmax(360px, 5fr) minmax(240px, 2.2fr);
  grid-template-rows: 1fr auto;
  column-gap: clamp(24px, 4vw, 72px);
  position: relative;
}

.intro::after {
  content: "";
  position: absolute;
  left: calc(var(--page-pad) + clamp(72px, 7vw, 120px));
  right: var(--page-pad);
  top: 64px;
  border-top: 1px solid var(--grey-2);
}

.intro-index {
  padding-top: 28px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.intro-main {
  align-self: center;
}

.eyebrow {
  margin: 0 0 24px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(64px, 9vw, 148px);
  font-weight: 200;
  line-height: 0.92;
  letter-spacing: 0;
}

.intro h1 em {
  color: var(--accent);
  font-style: normal;
  font-weight: 300;
}

.intro-note {
  align-self: center;
  max-width: 360px;
  padding-top: 40px;
  font-size: 17px;
  line-height: 1.75;
}

.intro-note p {
  margin: 0 0 12px;
}

.intro-stat {
  grid-column: 2 / 4;
  border-top: 1px solid var(--ink);
  padding-top: 22px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.intro-stat strong {
  font-size: clamp(64px, 8vw, 120px);
  font-weight: 200;
  line-height: 0.8;
}

.intro-stat span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
}

.catalog {
  padding: 88px var(--page-pad) 112px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 40px;
}

.section-heading h2,
.guide-title h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 300;
  line-height: 1.08;
}

.result-count {
  margin: 0;
  font-family: var(--mono);
  color: var(--grey-3);
  font-size: 12px;
  font-weight: 600;
}

.toolbar {
  border-top: 1px solid var(--ink);
  border-bottom: var(--line);
  min-height: 72px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.filters {
  display: flex;
}

.filter-button {
  min-width: 112px;
  padding: 0 20px;
  border: 0;
  border-right: var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.filter-button:hover,
.filter-button:focus-visible {
  color: var(--accent);
}

.filter-button.is-active {
  background: var(--accent);
  color: var(--accent-on);
}

.search-box {
  width: min(320px, 34vw);
  padding: 0 0 0 20px;
  border-left: var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-box kbd {
  margin-right: 16px;
  border: var(--line);
  padding: 3px 7px;
  color: var(--grey-3);
  font-family: var(--mono);
  font-size: 11px;
}

.list-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 200px 132px;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink);
  color: var(--grey-3);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.product-row {
  border-bottom: 1px solid var(--ink);
}

.product-summary {
  min-height: 174px;
  display: grid;
  grid-template-columns: 48px 96px minmax(0, 1fr) 176px 132px;
  gap: 24px;
  align-items: center;
}

.product-number {
  align-self: start;
  padding-top: 30px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.product-visual {
  width: 96px;
  aspect-ratio: 1;
  background: var(--grey-1);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-visual img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.product-visual.is-symbol {
  background: var(--accent);
  color: var(--accent-on);
}

.product-visual.is-symbol svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.3;
}

.product-labels {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.product-category {
  color: var(--accent);
}

.product-version::before {
  content: "/";
  margin-right: 10px;
  color: var(--grey-2);
}

.product-name {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 34px);
  font-weight: 400;
  line-height: 1.25;
}

.product-description {
  max-width: 720px;
  margin: 12px 0 0;
  color: #525252;
  font-size: 15px;
  line-height: 1.65;
}

.product-release {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
}

.product-date {
  grid-column: 1 / -1;
  color: var(--grey-3);
  font-size: 11px;
  font-weight: 600;
}

.product-size {
  font-size: 13px;
  font-weight: 600;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: var(--line);
  background: transparent;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-on);
}

.download-button {
  min-height: 52px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.download-button:hover,
.download-button:focus-visible {
  background: var(--accent);
}

.download-button[aria-disabled="true"] {
  background: var(--grey-2);
  color: var(--grey-3);
  pointer-events: none;
}

.product-details {
  padding: 20px 0 24px 168px;
  background: var(--grey-1);
  border-top: var(--line);
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr) auto;
  gap: 32px;
  align-items: center;
}

.product-details[hidden] {
  display: none;
}

.product-details > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.product-details span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.product-details code {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #525252;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.release-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.release-link:hover {
  color: var(--accent);
}

.empty-state {
  min-height: 280px;
  border-bottom: 1px solid var(--ink);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}

.empty-state[hidden] {
  display: none;
}

.empty-state > span {
  color: var(--grey-2);
  font-size: 72px;
  font-weight: 200;
}

.empty-state p {
  margin: 0;
}

.empty-state button {
  padding: 10px 18px;
  border: 0;
  background: var(--accent);
  color: var(--accent-on);
  cursor: pointer;
}

.install-guide {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 2.1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.guide-title {
  padding: 72px var(--page-pad);
  background: var(--accent);
  color: var(--accent-on);
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  min-height: 190px;
  padding: 36px var(--page-pad);
  border-bottom: var(--line);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 24px;
  align-items: start;
}

.guide-steps li:last-child {
  border-bottom: 0;
}

.guide-steps .step-number {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.guide-steps h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 400;
}

.guide-steps p {
  max-width: 700px;
  margin: 0;
  color: #525252;
  font-size: 15px;
  line-height: 1.75;
}

.guide-steps > li > svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
  stroke-width: 1.3;
}

.site-footer {
  min-height: 100px;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.load-error {
  margin: 32px 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 28px 0;
  color: #b00020;
  font-size: 16px;
}

@media (max-width: 980px) {
  .intro {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
  }

  .intro-note {
    grid-column: 2;
    padding-top: 0;
  }

  .intro-stat {
    grid-column: 2;
    margin-top: 32px;
  }

  .list-head {
    display: none;
  }

  .product-summary {
    grid-template-columns: 36px 80px minmax(0, 1fr) 120px;
  }

  .product-visual {
    width: 80px;
  }

  .product-visual img {
    width: 58px;
    height: 58px;
  }

  .product-release {
    grid-column: 4;
  }

  .download-button {
    grid-column: 4;
  }

  .product-details {
    padding-left: 140px;
    grid-template-columns: 1fr;
  }

  .install-guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 60px;
    padding-right: 16px;
  }

  .brand-mark {
    width: 60px;
  }

  .brand-name,
  .header-meta > span {
    display: none;
  }

  .header-meta {
    font-size: 10px;
  }

  .intro {
    min-height: 620px;
    padding-top: 40px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    gap: 24px;
  }

  .intro::after {
    left: var(--page-pad);
    top: 40px;
  }

  .intro-index {
    padding-top: 18px;
  }

  .intro-main {
    align-self: end;
  }

  .intro h1 {
    font-size: clamp(56px, 19vw, 88px);
  }

  .intro-note,
  .intro-stat {
    grid-column: 1;
  }

  .intro-note {
    font-size: 15px;
  }

  .catalog {
    padding-top: 64px;
    padding-bottom: 80px;
  }

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

  .toolbar {
    min-height: 0;
    flex-direction: column;
    border-top: 1px solid var(--ink);
  }

  .filters {
    width: 100%;
    min-height: 52px;
  }

  .filter-button {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
    font-size: 13px;
  }

  .search-box {
    width: 100%;
    min-height: 52px;
    border-top: var(--line);
    border-left: 0;
  }

  .product-summary {
    padding: 24px 0;
    grid-template-columns: 32px 64px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .product-number {
    padding-top: 4px;
  }

  .product-visual {
    width: 64px;
  }

  .product-visual img {
    width: 48px;
    height: 48px;
  }

  .product-visual.is-symbol svg {
    width: 32px;
    height: 32px;
  }

  .product-name {
    font-size: 21px;
  }

  .product-description {
    font-size: 14px;
  }

  .product-release {
    grid-column: 2 / 4;
    grid-template-columns: auto 1fr 36px;
    margin-top: 4px;
  }

  .product-date {
    grid-column: auto;
  }

  .product-size {
    justify-self: start;
  }

  .download-button {
    grid-column: 2 / 4;
    margin-top: 8px;
  }

  .product-details {
    padding: 20px;
    gap: 20px;
  }

  .product-details > div {
    grid-template-columns: 1fr auto;
  }

  .product-details > div > span {
    grid-column: 1 / -1;
  }

  .product-details code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .guide-title {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .guide-steps li {
    padding-top: 28px;
    padding-bottom: 28px;
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .guide-steps > li > svg {
    display: none;
  }

  .site-footer {
    min-height: 88px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
  }
}

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

  .toast {
    transition: none;
  }
}
