:root {
  --page: #f7f9f7;
  --surface: #fff;
  --ink: #202d29;
  --muted: #606d66;
  --primary: #176b52;
  --primary-hover: #10543f;
  --tint: #edf4ee;
  --line: #dfe6e0;
  --control-line: #8b9a90;
  --violet-bg: #f0e9fa;
  --violet-ink: #70459c;
  --orange-bg: #fff0e5;
  --orange-ink: #a94c15;
  --slate-bg: #ecedef;
  --slate-ink: #37434d;
  --blue-bg: #e7f2fc;
  --blue-ink: #2068a0;
  --amber-bg: #fff3de;
  --amber-ink: #975b0f;
  --green-bg: #e7f2e8;
  --green-ink: #367341;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.6 "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a, button { transition: background-color 160ms, color 160ms, border-color 160ms; }
a:hover { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }

.container { width: calc(100% - 48px); max-width: 1160px; margin-inline: auto; padding-inline: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex-shrink: 0; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; background: var(--surface); z-index: 10; }
.skip-link:focus { top: 10px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 48px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 10px; }
.brand-mark .icon { width: 25px; height: 25px; }
.main-nav { display: flex; align-self: stretch; gap: 28px; }
.main-nav a { display: flex; align-items: center; min-height: 44px; border-bottom: 2px solid transparent; font-size: 14px; }
.main-nav .active { color: var(--primary); border-color: var(--primary); font-weight: 650; }
.header-caption { margin-left: auto; font-size: 13px; color: var(--muted); }

.search-area { display: flex; align-items: center; gap: 40px; padding-block: 24px; }
.search-intro { flex: 1; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 650; }
.search-intro p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.search-form { width: 56%; max-width: 650px; }
.search-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; background: var(--surface); border: 1px solid var(--control-line); border-radius: 8px; }
.search-box > .icon { color: var(--muted); }
.search-box input { width: 100%; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.search-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border: 0; border-radius: 5px; background: var(--primary); color: white; font-size: 14px; white-space: nowrap; }
.search-button:hover, .search-button:active { background: var(--primary-hover); color: white; }

.catalog { padding-top: 8px; padding-bottom: 32px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
h2 { font-size: 20px; font-weight: 650; }
.section-caption { color: var(--muted); font-size: 12px; }
.category-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.category-chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 13px; }
.category-chip .icon { width: 16px; height: 16px; }
.category-chip.selected { background: var(--primary); border-color: var(--primary); color: white; }
.category-chip:hover { border-color: var(--primary); }
.filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; overflow-wrap: anywhere; }
.filter-summary a { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); text-decoration: underline; }

.software-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.software-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; padding: 18px 18px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: background-color 160ms, border-color 160ms, box-shadow 160ms; }
.software-card:hover { border-color: var(--control-line); box-shadow: 0 5px 16px rgb(32 45 41 / 8%); color: var(--ink); }
.software-card:active { background: var(--tint); }
.software-card:focus-visible { outline-offset: 2px; }
.card-top { display: contents; }
.app-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-size: 20px; font-weight: 700; letter-spacing: -1px; }
.app-icon-image { object-fit: contain; background: var(--page); }
.category-label { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--muted); }
.software-card h3 { grid-column: 2; grid-row: 1; font-size: 16px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.app-description { grid-column: 1 / -1; min-height: 42px; margin: 12px 0 10px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.card-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); min-height: 44px; }
.platform-label { font-size: 11px; color: var(--muted); }
.card-direction { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--primary); transition: background-color 160ms, color 160ms; }
.card-direction .icon { width: 16px; height: 16px; }
.software-card:hover .card-direction { background: var(--primary); color: white; }

.tone-violet { background: var(--violet-bg); color: var(--violet-ink); }
.tone-orange { background: var(--orange-bg); color: var(--orange-ink); }
.tone-slate { background: var(--slate-bg); color: var(--slate-ink); }
.tone-blue { background: var(--blue-bg); color: var(--blue-ink); }
.tone-amber { background: var(--amber-bg); color: var(--amber-ink); }
.tone-green { background: var(--green-bg); color: var(--green-ink); }

.empty-state { grid-column: 1 / -1; padding: 36px 20px; text-align: center; border: 1px dashed var(--control-line); border-radius: 8px; }
.empty-state h3 { margin-top: 12px; font-size: 20px; }
.empty-state p { margin: 12px 0 20px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; font-size: 11px; color: var(--muted); }
.footer-inner a { display: flex; align-items: center; min-height: 44px; }

.dialog { width: min(440px, calc(100% - 40px)); padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.dialog::backdrop { background: #202d2980; }
.dialog h2 { margin-bottom: 14px; }
.dialog p { margin-bottom: 20px; color: var(--muted); }
.dialog .section-kicker { font-size: 12px; }
.dialog footer { display: flex; justify-content: flex-end; }

@media (max-width: 1023px) {
  .header-inner { gap: 28px; }
  .header-caption { display: none; }
  .software-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
  .header-inner { gap: 12px; justify-content: space-between; min-height: 62px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 12px; }
  .search-area { display: block; padding-block: 16px; }
  .search-intro { display: none; }
  .search-form { width: 100%; max-width: none; }
  .search-button { padding-inline: 14px; }
  .search-button .icon { display: none; }
  .catalog { padding-top: 0; }
  .section-heading { margin-bottom: 12px; }
  h2 { font-size: 19px; }
  .category-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
  .category-chip { padding: 8px 6px; font-size: 12px; gap: 5px; }
  .software-grid { grid-template-columns: 1fr; gap: 10px; }
  .software-card { padding: 14px 14px 0; column-gap: 10px; }
  .app-description { min-height: 0; margin: 8px 0; font-size: 13px; }
  .software-card h3 { font-size: 16px; }
  .footer-inner { flex-wrap: wrap; gap: 4px; }
  .footer-inner > span:nth-child(2) { order: 3; width: 100%; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
