:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172322;
  background: #f5f8f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.site-header { background: #172322; color: white; }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 730; font-size: 19px; }
.header-note { color: #aac0bc; font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid #46615b; border-radius: 5px; }
.language-option { min-width: 37px; min-height: 28px; border: 0; border-radius: 3px; color: #c2d7d0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.language-option.active { color: #172322; background: #d5efe4; }
.language-option:focus-visible { outline: 2px solid #bce7d2; outline-offset: 2px; }

.intro { padding-block: 48px 42px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 9px; color: #237563; font-size: 12px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 11px; font-size: 38px; line-height: 1.2; }
.intro-copy { margin-bottom: 0; color: #53625e; line-height: 1.7; font-size: 15px; }
.directory-count { flex: none; display: flex; align-items: baseline; gap: 7px; color: #59716a; font-size: 13px; white-space: nowrap; }
.directory-count strong { font-size: 28px; color: #172322; }

.catalog-band { background: #fff; padding-block: 30px 66px; border-top: 1px solid #e0e9e6; }
.catalog-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.catalog-top h2 { margin-bottom: 4px; font-size: 22px; }
.result-count { margin-bottom: 0; color: #778783; font-size: 13px; }
.search { height: 43px; width: min(100%, 300px); display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #cbd8d4; border-radius: 5px; background: #fff; }
.search:focus-within { border-color: #21826c; box-shadow: 0 0 0 3px #d9f1e8; }
.search svg { width: 17px; height: 17px; fill: none; stroke: #6b8079; stroke-width: 1.8; flex: none; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #172322; background: transparent; font-size: 14px; }
.search input::placeholder { color: #87958f; }
.filters { margin-block: 22px 24px; display: flex; flex-wrap: wrap; gap: 7px; }
.filter { min-height: 34px; padding: 0 13px; border: 1px solid #d6e0dc; background: white; color: #52655e; border-radius: 4px; cursor: pointer; font-size: 13px; }
.filter:hover { border-color: #79bba7; color: #176b57; }
.filter.active { background: #e4f5ee; border-color: #9fd6bd; color: #176b57; font-weight: 700; }
.filter:focus-visible, .official-link:focus-visible, .source-inner a:focus-visible { outline: 3px solid #83cfaf; outline-offset: 3px; }

.software-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.software-card { display: flex; flex-direction: column; min-height: 244px; padding: 20px; border: 1px solid #e2e9e6; border-radius: 6px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.software-card:hover { border-color: #b9d6ca; box-shadow: 0 6px 18px rgb(20 52 43 / 7%); }
.software-heading { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.software-logo { width: 42px; height: 42px; object-fit: contain; flex: none; }
.software-name { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.software-category { margin-top: 2px; color: #7c8a85; font-size: 12px; }
.software-description { margin: 16px 0 12px; min-height: 55px; color: #586760; font-size: 13px; line-height: 1.65; }
.platforms { display: flex; flex-wrap: wrap; gap: 5px; margin: auto 0 17px; }
.platforms span { padding: 3px 6px; color: #587069; background: #edf3f0; border-radius: 3px; font-size: 11px; }
.official-link { min-height: 37px; display: inline-flex; justify-content: center; align-items: center; gap: 5px; text-decoration: none; border: 1px solid #27836d; background: #247d68; color: white; border-radius: 4px; font-size: 13px; font-weight: 700; }
.official-link:hover { background: #176b57; }
.official-link span { font-size: 16px; line-height: 1; }
.empty-state { padding: 70px 20px; text-align: center; color: #64736d; border-block: 1px solid #e6ece9; }

.source-band { background: #eaf2ef; padding-block: 32px; }
.source-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.source-inner h2 { font-size: 17px; margin-bottom: 6px; }
.source-inner p { color: #61736b; font-size: 13px; line-height: 1.65; margin-bottom: 0; max-width: 750px; }
.source-inner a { flex: none; font-size: 13px; font-weight: 700; color: #176b57; text-underline-offset: 3px; }
.site-footer { padding-block: 22px; background: #172322; color: #a9beb7; font-size: 12px; }

@media (max-width: 1000px) { .software-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 560px); }
  .intro { padding-block: 34px 31px; align-items: start; }
  h1 { font-size: 32px; }
  .directory-count { display: none; }
  .catalog-top { display: block; }
  .search { margin-top: 18px; width: 100%; }
  .software-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .software-card { padding: 15px; min-height: 255px; }
  .source-inner { align-items: start; }
  .header-note { display: none; }
}
@media (max-width: 520px) {
  .brand { font-size: 16px; gap: 8px; }
  .language-option { min-width: 32px; }
  .software-grid { grid-template-columns: minmax(0, 1fr); }
  .software-card { min-height: 220px; }
  .software-description { min-height: auto; }
  .source-inner { display: block; }
  .source-inner a { display: inline-block; margin-top: 16px; }
}
