:root {
  color-scheme: light;
  font-family: "Instrument Sans", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182c24;
  background: #f7f7f0;
  --ink: #182c24;
  --muted: #505e54;
  --line: #dce1d5;
  --green: #214538;
  --lime: #dbf277;
  --panel: #fffffa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid #638f54;
  outline-offset: 4px;
}

.shell {
  width: min(100% - 96px, 1152px);
  margin-inline: auto;
}

.topbar { border-bottom: 1px solid var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.055em;
}

.brand-icon {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-auto-rows: 5px;
  place-content: center;
  gap: 3px;
  width: 33px;
  height: 33px;
  border-radius: 9px;
  background: var(--green);
}

.brand-icon span {
  border-radius: 1px;
  background: var(--lime);
}

.brand-icon span:nth-child(2) { transform: translate(1px, -1px) rotate(15deg); }

.directory-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0 7px 7px;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
}

.directory-link:hover { color: var(--ink); }
.directory-link span { color: var(--green); }

main { padding-bottom: 60px; }

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 60px 0 41px;
}

h1 {
  margin: 0;
  font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.065em;
}

.search {
  width: min(100%, 315px);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 13px;
  margin-bottom: 3px;
  background: var(--panel);
  border: 1px solid #cbd3c6;
  border-radius: 9px;
}

.search:focus-within {
  outline: 2px solid #638f54;
  outline-offset: 2px;
}

.search-icon {
  position: relative;
  width: 13px;
  height: 13px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  margin-right: 3px;
}

.search-icon::after {
  position: absolute;
  content: "";
  width: 6px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--muted);
  right: -4px;
  bottom: -2px;
  transform: rotate(45deg);
}

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

.search input::placeholder { color: #56645a; }
#directory { scroll-margin-top: 18px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding-block: 13px;
  border-block: 1px solid var(--line);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.categories button {
  min-height: 37px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}

.categories button:hover { background: #edf0e3; }

.categories button[aria-pressed="true"] {
  border-color: #cbdc9b;
  background: #e7efce;
  color: #213b28;
  font-weight: 650;
}

.result-count {
  flex: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.group { margin-top: 33px; }

.group h2 {
  font-size: 19px;
  line-height: 1.4;
  margin: 0 0 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover {
  border-color: #a6b79e;
  box-shadow: 0 9px 24px #253b2710;
}

.tool-card.featured { grid-column: 1 / -1; }

.tool-link {
  display: grid;
  height: 100%;
  border-radius: inherit;
}

.featured .tool-link { grid-template-columns: 1.05fr 1fr; }

.tool-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.tool-copy h3 {
  margin: 0;
  font-size: clamp(23px, 2.9vw, 37px);
  font-weight: 720;
  line-height: 1.24;
  letter-spacing: -.045em;
}

.tool-description {
  max-width: 340px;
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.tool-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  padding: 9px 13px;
  min-height: 42px;
  border-radius: 7px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease;
}

.tool-action span {
  color: var(--lime);
  font-size: 19px;
  line-height: 1;
}

.tool-link:hover .tool-action { background: #285847; }

.waveform-art {
  min-width: 0;
  min-height: 240px;
  margin: 7px;
  padding: 21px 23px;
  border-radius: 11px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(#a2cda327 1px, transparent 1px) center / 25px 25px,
    linear-gradient(90deg, #a2cda327 1px, transparent 1px) center / 25px 25px,
    radial-gradient(ellipse at 74% 40%, #315d45, #172f27 76%);
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  height: 142px;
  gap: 3px;
}

.waveform::before {
  position: absolute;
  content: "";
  inset: 50% 0 auto;
  border-top: 1px solid #d9f47745;
}

.waveform span {
  flex: 1 1 0;
  background: linear-gradient(#f1fc9a, #c5e85f);
  border-radius: 6px;
  min-height: 2px;
  max-width: 4px;
  position: relative;
  transform-origin: center;
  transition: transform 230ms ease;
}

.tool-link:hover .waveform span:nth-child(2n) { transform: scaleY(1.13); }

.empty {
  text-align: center;
  border: 1px dashed #cbd3c6;
  border-radius: 14px;
  margin-top: 26px;
  padding: 32px 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty p { margin: 0 0 8px; }
.empty p:last-child { margin-bottom: 0; }

.reset {
  padding: 6px 8px;
  background: none;
  border: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 650;
}

.reset:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .shell { width: calc(100% - 40px); }
  .topbar-inner { min-height: 62px; }
  .intro { padding: 39px 0 24px; align-items: start; flex-direction: column; }
  .search { width: 100%; margin-bottom: 0; }
  .tool-grid, .featured .tool-link { grid-template-columns: 1fr; }
  .tool-copy { padding: 23px; }
  .waveform-art { min-height: 150px; }
  .waveform { height: 105px; }
}

@media (max-width: 420px) {
  .toolbar { gap: 4px; flex-wrap: wrap; }
  .categories { gap: 3px; }
  .categories button { padding-inline: 9px; font-size: 13px; }
  .result-count { padding-inline: 9px; }
  .waveform span:nth-child(2n) { display: none; }
}

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