:root {
  color-scheme: light;
  --page: #6873cf;
  --surface: #ffffff;
  --surface-subtle: #f5f7f9;
  --ink: #152d3f;
  --ink-soft: #536a7a;
  --ink-faint: #8494a0;
  --line: #dce4e9;
  --header: #293d4c;
  --green: #1faf68;
  --green-soft: #e9f8f0;
  --blue: #258bc8;
  --violet: #7657b3;
  --shadow: 0 20px 55px rgb(28 40 75 / 22%);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(37 139 200 / 32%);
  outline-offset: 2px;
}

[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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  display: flex;
  width: min(1220px, calc(100% - 48px));
  min-height: calc(100vh - 48px);
  flex-direction: column;
  margin: 24px auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  padding: 42px 48px 40px;
  background: var(--header);
  color: #ffffff;
  text-align: center;
}

.back-link {
  position: absolute;
  top: 18px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d9e4ea;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.35;
}

.hero__tag {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 4px;
  background: rgb(255 255 255 / 10%);
  color: #dfe9ef;
  font-size: 12px;
  font-weight: 700;
}

.hero p {
  margin: 9px 0 0;
  color: #b8c8d2;
  font-size: 15px;
}

.directory {
  flex: 1 0 auto;
  padding: 34px 36px 42px;
}

.directory__toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.directory__heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 700;
}

.directory h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
}

.directory h2 span {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
  vertical-align: 2px;
}

.search-field {
  position: relative;
  display: block;
  width: min(360px, 100%);
}

.search-field > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #718492;
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 44px 9px 42px;
  border: 1px solid #cfd9df;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.search-field input::placeholder {
  color: #8b9aa5;
}

.search-field input:hover {
  border-color: #9aacb7;
}

.search-field button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #657987;
  cursor: pointer;
  transform: translateY(-50%);
}

.search-field button:hover {
  background: #edf2f5;
  color: var(--ink);
}

.search-field button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.tool-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.tool-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 20px 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tool-item:hover {
  border-color: #a8c5d6;
  box-shadow: 0 8px 22px rgb(31 55 70 / 10%);
  transform: translateY(-1px);
}

.tool-item__icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}

.tool-item__icon--green {
  background: var(--green-soft);
  color: #15834e;
}

.tool-item__icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-item__body {
  display: block;
  min-width: 0;
}

.tool-item__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tool-item__title-row strong {
  color: #132b3c;
  font-size: 18px;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid #bee2ce;
  border-radius: 4px;
  background: #effaf4;
  color: #26714b;
  font-size: 11px;
  font-weight: 700;
}

.availability > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.tool-item__description {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 14px;
}

.tool-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tool-item__meta span {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: #627582;
  font-size: 11px;
  font-weight: 700;
}

.tool-item__open {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #edf5f9;
  color: var(--blue);
  transition: background-color 160ms ease, color 160ms ease;
}

.tool-item:hover .tool-item__open {
  background: var(--blue);
  color: #ffffff;
}

.tool-item__open svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state {
  display: grid;
  min-height: 270px;
  place-content: center;
  justify-items: center;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.empty-state h3 {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.empty-state p {
  margin: 2px 0 0;
  font-size: 13px;
}

footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 22px 30px;
  background: var(--header);
  color: #c5d3dc;
  font-size: 13px;
  text-align: center;
}

noscript {
  display: block;
  padding: 14px;
  background: #fff2c7;
  color: #5d4900;
  text-align: center;
}

@media (max-width: 760px) {
  body {
    background: #ffffff;
    font-size: 15px;
  }

  .page-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .hero {
    padding: 50px 20px 28px;
    text-align: left;
  }

  .back-link {
    top: 16px;
    left: 18px;
  }

  .hero__title-row {
    justify-content: flex-start;
    gap: 8px;
  }

  .hero__icon {
    width: 28px;
    height: 28px;
  }

  .hero h1 {
    max-width: calc(100% - 36px);
    font-size: 23px;
  }

  .hero__tag {
    margin-left: 36px;
  }

  .hero p {
    font-size: 13px;
  }

  .directory {
    padding: 24px 18px 32px;
  }

  .directory__toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .search-field {
    width: 100%;
  }

  .tool-item {
    grid-template-columns: 46px minmax(0, 1fr) 34px;
    gap: 12px;
    min-height: 120px;
    padding: 17px 12px;
  }

  .tool-item__icon {
    width: 46px;
    height: 46px;
  }

  .tool-item__icon svg {
    width: 24px;
    height: 24px;
  }

  .tool-item__title-row strong {
    font-size: 16px;
  }

  .tool-item__description {
    font-size: 13px;
  }

  .tool-item__open {
    width: 32px;
    height: 32px;
  }

  .tool-item__open svg {
    width: 17px;
    height: 17px;
  }

  footer {
    padding: 20px 18px;
  }
}

@media (max-width: 430px) {
  .tool-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .tool-item__icon {
    width: 42px;
    height: 42px;
  }

  .tool-item__open {
    display: none;
  }
}

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