:root {
  color-scheme: light;
  --brand-blue: #042e90;
  --brand-blue-strong: #003cb8;
  --brand-blue-soft: #eef4ff;
  --brand-red: #da1122;
  --ink: #172033;
  --muted: #667085;
  --subtle: #8992a5;
  --line: #d7ddea;
  --line-strong: #c6cfdf;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --surface-hover: #f8faff;
  --focus: #0b62d8;
  --shadow-drawer: -16px 0 40px rgb(10 24 50 / 18%);
  --container: 1464px;
  --radius: 6px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.is-dialog-open { overflow: hidden; }
button, input, select { color: inherit; font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
img, svg { display: block; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.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: 10px 14px;
  color: #fff;
  background: var(--brand-blue);
  border-radius: var(--radius);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }
.page-container { width: min(calc(100% - 48px), var(--container)); margin-inline: auto; }

.site-header {
  min-height: 60px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.site-header__inner { display: flex; align-items: center; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 18px; color: var(--ink); text-decoration: none; }
.brand__logo { width: 150px; height: auto; }
.brand__divider { width: 1px; height: 34px; background: var(--line-strong); }
.brand__product { font-size: 18px; font-weight: 700; white-space: nowrap; }

.directory-intro { padding: 28px 0 18px; }
.directory-intro h1 { max-width: 100%; font-size: 42px; line-height: 1.25; font-weight: 720; }
.directory-intro__lead { margin-top: 3px; color: var(--muted); font-size: 18px; }
.directory-stats { display: flex; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.directory-stats__item { display: flex; align-items: center; }
.directory-stats__item + .directory-stats__item::before { width: 1px; height: 30px; margin-inline: 24px; background: var(--line); content: ""; }
.directory-stats dt { display: none; }
.directory-stats dd { display: flex; align-items: baseline; gap: 7px; color: var(--muted); }
.directory-stats strong { color: var(--brand-blue); font-size: 26px; line-height: 1.3; }

.directory-search {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 62px;
  margin-top: 16px;
  padding: 0 8px 0 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.directory-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 13%, transparent); }
.directory-search__icon { color: var(--ink); }
.directory-search input { width: 100%; min-width: 0; height: 60px; padding: 0 14px; background: transparent; border: 0; outline: 0; font-size: 18px; }
.directory-search input::placeholder { color: var(--subtle); opacity: 1; }
.directory-search input::-webkit-search-cancel-button { cursor: pointer; }
.directory-search__submit { min-width: 82px; min-height: 44px; padding: 0 18px; color: #fff; background: var(--brand-blue); border: 1px solid var(--brand-blue); border-radius: var(--radius); font-weight: 650; }
.directory-search__submit:hover { background: var(--brand-blue-strong); }

.directory-workspace { display: grid; grid-template-columns: 294px minmax(0, 1fr); align-items: start; gap: 16px; padding-bottom: 56px; }
.category-panel, .results-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.category-panel { position: sticky; top: 16px; overflow: hidden; }
.category-nav { display: flex; flex-direction: column; }
.category-nav__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 20px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.category-nav__item:last-child { border-bottom: 0; }
.category-nav__item:hover { background: var(--surface-hover); }
.category-nav__item.is-active { margin: 4px; min-height: 50px; padding-inline: 16px; color: #fff; background: var(--brand-blue); border-bottom: 0; border-radius: var(--radius); font-weight: 650; }
.category-nav__item.is-active + .category-nav__item { border-top: 1px solid var(--line); }

.results-panel { min-width: 0; overflow: hidden; }
.results-toolbar { display: flex; align-items: center; gap: 24px; min-height: 78px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.module-filter select, .filter-dialog select { width: 100%; min-height: 46px; padding: 0 42px 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.module-filter { width: min(310px, 42%); }
.results-count { color: var(--muted); white-space: nowrap; }
.results-count strong { color: var(--ink); font-weight: 650; }
.filter-trigger { display: none; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; color: var(--brand-blue); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 650; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.active-filters[hidden] { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 8px 3px 11px; color: var(--brand-blue); background: var(--brand-blue-soft); border: 1px solid #c6d7fa; border-radius: var(--radius); }
.filter-chip button { display: inline-grid; width: 28px; height: 28px; place-items: center; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 4px; }
.filter-chip button:hover { background: #dce8ff; }
.clear-filters { min-height: 34px; padding: 0 4px; color: var(--brand-blue-strong); background: transparent; border: 0; font-weight: 650; }

.service-list { min-height: 420px; }
.service-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 126px; gap: 14px; align-items: start; min-height: 154px; padding: 18px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.service-row:last-child { border-bottom: 0; }
.service-row:hover { background: var(--surface-hover); }
.service-row__index { padding-top: 1px; color: var(--muted); font-size: 20px; }
.service-row__content { min-width: 0; }
.service-row__heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 24px; }
.service-row__heading h2 { font-size: 19px; line-height: 1.45; }
.service-row__heading p { color: var(--muted); font-size: 14px; }
.service-row__description { max-width: 840px; margin-top: 4px; color: #344054; line-height: 1.65; }
.service-row mark { padding: 0 2px; color: inherit; background: #ffe26a; border-radius: 2px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; list-style: none; }
.keyword-list li { padding: 2px 10px; color: var(--brand-blue-strong); background: var(--brand-blue-soft); border: 1px solid #c6d7fa; border-radius: 5px; font-size: 13px; line-height: 1.55; }
.service-row__action { align-self: center; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 44px; padding: 0; color: var(--brand-blue-strong); background: transparent; border: 0; font-weight: 650; white-space: nowrap; }
.service-row__action:hover span { text-decoration: underline; text-underline-offset: 4px; }

.directory-state { display: grid; place-items: center; align-content: center; min-height: 420px; padding: 40px 24px; text-align: center; }
.directory-state[hidden] { display: none; }
.directory-state h2 { font-size: 21px; }
.directory-state p { margin-top: 6px; color: var(--muted); }
.directory-state .button { margin-top: 20px; }
.loading-indicator { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand-blue); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.button { min-height: 44px; padding: 0 18px; border-radius: var(--radius); font-weight: 650; }
.button--primary { color: #fff; background: var(--brand-blue); border: 1px solid var(--brand-blue); }
.button--secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }

.site-footer { padding: 20px 0; background: var(--surface-soft); border-top: 1px solid var(--line); }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 13px; }

dialog { max-width: none; max-height: none; padding: 0; color: var(--ink); background: var(--surface); border: 0; }
dialog::backdrop { background: rgb(23 32 51 / 42%); }
.detail-dialog { width: min(520px, 100vw); height: 100dvh; margin: 0 0 0 auto; box-shadow: var(--shadow-drawer); }
.detail-drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.detail-drawer__header, .dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.detail-drawer__header h2 { margin-top: 4px; font-size: 28px; line-height: 1.35; }
.detail-drawer__eyebrow { color: var(--muted); font-size: 14px; }
.icon-button { flex: 0 0 44px; display: inline-grid; width: 44px; height: 44px; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius); }
.icon-button:hover { background: var(--surface-soft); }
.detail-drawer__body { overflow-y: auto; padding: 26px 28px 48px; }
.detail-drawer__summary { color: #344054; line-height: 1.75; }
.detail-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 10px; font-size: 18px; }
.detail-section ul { display: grid; gap: 8px; padding-left: 20px; }
.detail-section--boundary { padding: 18px; background: var(--surface-soft); border-top: 0; border-radius: var(--radius); }

.filter-dialog { width: min(480px, calc(100vw - 32px)); margin: auto; border-radius: var(--radius); box-shadow: 0 24px 60px rgb(10 24 50 / 22%); }
.dialog-header { align-items: center; padding: 18px 20px; }
.dialog-header h2 { font-size: 21px; }
.filter-dialog__body { display: grid; gap: 10px; padding: 20px; }
.filter-dialog__body label { margin-top: 4px; font-weight: 650; }
.dialog-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .directory-workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .service-row { grid-template-columns: 28px minmax(0, 1fr); }
  .service-row__action { grid-column: 2; justify-self: start; }
}

@media (max-width: 1023px) {
  .page-container { width: min(calc(100% - 40px), 860px); }
  .directory-workspace { display: block; }
  .category-panel { display: none; }
  .filter-trigger { display: inline-flex; }
  .results-toolbar { flex-wrap: wrap; gap: 12px; }
  .module-filter { display: none; }
  .results-count { margin-left: auto; }
}

@media (max-width: 767px) {
  .page-container { width: min(calc(100% - 32px), 600px); }
  .site-header, .site-header__inner { min-height: 58px; }
  .brand { gap: 12px; }
  .brand__logo { width: 118px; }
  .brand__divider { height: 28px; }
  .brand__product { font-size: 15px; }
  .directory-intro { padding-top: 22px; }
  .directory-intro h1 { font-size: 32px; }
  .directory-intro__lead { font-size: 16px; }
  .directory-stats { gap: 6px 14px; margin-top: 12px; }
  .directory-stats__item + .directory-stats__item::before { display: none; }
  .directory-stats dd { gap: 4px; font-size: 13px; }
  .directory-stats strong { font-size: 20px; }
  .directory-search { grid-template-columns: 24px minmax(0, 1fr); min-height: 56px; padding-right: 14px; }
  .directory-search input { height: 54px; padding-right: 0; font-size: 16px; }
  .directory-search__submit { display: none; }
  .results-panel { border-right: 0; border-left: 0; border-radius: 0; }
  .results-toolbar { padding: 12px 0; }
  .service-row { grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 0; padding: 20px 0 24px; }
  .service-row__index { display: none; }
  .service-row__heading { display: block; }
  .service-row__heading h2 { font-size: 20px; }
  .service-row__heading p { margin-top: 3px; }
  .service-row__description { margin-top: 8px; }
  .service-row__action { grid-column: 1; justify-self: start; justify-content: flex-start; }
  .site-footer__inner { display: grid; gap: 4px; }
  .filter-dialog { width: 100%; max-height: min(82dvh, 680px); margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; }
  .detail-dialog { width: 100vw; }
  .detail-drawer__header { padding: 16px 18px; }
  .detail-drawer__header h2 { font-size: 24px; }
  .detail-drawer__body { padding: 20px 18px 40px; }
}

@media (max-width: 420px) {
  .page-container { width: calc(100% - 28px); }
  .brand__logo { width: 104px; }
  .brand__product { max-width: 118px; white-space: normal; line-height: 1.25; }
  .directory-intro h1 { font-size: 29px; }
  .directory-stats__item { flex: 1 1 auto; }
  .results-count { font-size: 14px; }
}

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