:root {
  --brand-950: #10392f;
  --brand-900: #154d3e;
  --brand-800: #1c624e;
  --brand-700: #26745b;
  --brand-100: #e3f0eb;
  --brand-050: #f0f7f4;
  --page: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f9fbfb;
  --text: #15251f;
  --muted: #586b63;
  --muted-subtle: #6a7b74;
  --line: #dce5e2;
  --line-strong: #c4d2cd;
  --focus: #0f6951;
  --radius-card: 12px;
  --radius-control: 8px;
  --shadow-card: 0 2px 10px rgba(18, 51, 42, .045);
  --content-width: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button,
input,
select { font: inherit; font-size: 16px; }
button,
a,
input,
select { -webkit-tap-highlight-color: transparent; }
button,
a { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.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: 10px;
  left: 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid var(--brand-900);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--brand-950);
  box-shadow: var(--shadow-card);
  transform: translateY(-150%);
  transition: transform .18s ease;
}

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

.wrap {
  width: min(var(--content-width), calc(100% - 32px));
  margin-inline: auto;
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--brand-950);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-900);
  color: #fff;
}

.brand-mark svg,
.header-search svg,
.resource-actions svg,
.view-count svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--brand-050);
  color: var(--brand-900);
}

.header-search {
  width: 236px;
  min-height: 44px;
  display: flex;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.header-search:focus-within {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(38, 116, 91, .12);
}

.header-search input {
  min-width: 0;
  min-height: 42px;
  flex: 1;
  padding: 8px 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.header-search input::placeholder,
.directory-search input::placeholder,
.search-input::placeholder { color: var(--muted-subtle); }

.header-search button {
  min-width: 64px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  background: var(--brand-900);
  color: #fff;
  cursor: pointer;
  transition: background-color .18s ease;
}

.header-search button:hover { background: var(--brand-950); }

/* The homepage and search page each have one prominent search form. */
body:has(.directory-intro) .header-search,
body:has([data-search-input]) .header-search { display: none; }

body:has(.directory-intro) .nav,
body:has([data-search-input]) .nav { justify-content: flex-end; }

/* Homepage directory introduction */
.directory-intro {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
  align-items: center;
  gap: 34px;
  margin-top: 22px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(125deg, var(--surface) 0%, #f3f8f6 100%);
  box-shadow: var(--shadow-card);
}

.directory-intro > div { min-width: 0; }

.directory-intro .eyebrow {
  margin: 0 0 7px;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .12em;
}

.directory-intro h1 {
  margin: 0;
  color: var(--brand-950);
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.16;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.directory-intro .intro-copy {
  max-width: 42ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.directory-search {
  min-width: 0;
  display: flex;
  gap: 8px;
}

.directory-search input {
  min-width: 0;
  min-height: 48px;
  flex: 1;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(18, 51, 42, .025);
}

.directory-search input:focus {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(38, 116, 91, .13);
}

.directory-search button {
  min-width: 76px;
  min-height: 48px;
  padding: 9px 16px;
  border: 1px solid var(--brand-900);
  border-radius: var(--radius-control);
  background: var(--brand-900);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

.directory-search button:hover {
  border-color: var(--brand-950);
  background: var(--brand-950);
}

/* Category and listing layout */
.layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  padding: 28px 0 64px;
}

.directory-intro + .layout { padding-top: 22px; }

.sidebar {
  align-self: start;
  position: sticky;
  top: 88px;
  min-width: 0;
}

.side-card { min-width: 0; }
.side-card + .side-card { margin-top: 20px; }

.side-title {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .09em;
}

.category-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-list a {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.category-list a span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-list a:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--brand-900);
}

.category-list a[aria-current="page"] {
  border-color: #bfd8cd;
  background: var(--brand-100);
  color: var(--brand-950);
  font-weight: 700;
}

.category-list span:last-child {
  flex: none;
  color: var(--muted-subtle);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.section-head {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(23px, 2.6vw, 28px);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Small content cards: compact thumbnail, title and metadata */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-card {
  min-width: 0;
  min-height: 104px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow: hidden;
  padding: 16px 18px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.article-card::after {
  width: 9px;
  height: 9px;
  position: absolute;
  top: 19px;
  right: 19px;
  content: "";
  border-top: 1.5px solid var(--brand-700);
  border-right: 1.5px solid var(--brand-700);
  color: var(--brand-700);
  transform: rotate(45deg);
  opacity: .72;
  transition: color .2s ease, opacity .2s ease, transform .2s ease;
}

.article-card:hover {
  border-color: #a9cabc;
  box-shadow: 0 5px 16px rgba(18, 51, 42, .075);
  transform: translateY(-1px);
}

.article-card:hover::after {
  color: var(--brand-900);
  border-color: var(--brand-900);
  opacity: 1;
  transform: translate(1px, -1px) rotate(45deg);
}

.article-card:focus-within {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(38, 116, 91, .15), var(--shadow-card);
}

.article-cover-link { display: none; }

.article-thumbnail {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f4f3;
}

.article-thumbnail picture {
  width: 100%;
  height: 100%;
  display: block;
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-copy {
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-self: stretch;
  align-content: stretch;
  column-gap: 12px;
  row-gap: 5px;
}

.article-copy h2 {
  min-width: 0;
  min-height: 0;
  grid-column: 1 / -1;
  margin: 0;
  padding-right: 23px;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.42;
  letter-spacing: -.02em;
}

.article-copy h2 a {
  display: -webkit-box;
  position: static;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-copy h2 a::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.article-copy h2 a:hover { color: var(--brand-800); }

.article-copy p:not(.card-description) { display: none; }

.card-description {
  min-width: 0;
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  grid-column: 1;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

.meta time { color: var(--muted); }

.pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid #c8ded4;
  border-radius: 999px;
  background: var(--brand-050);
  color: var(--brand-900);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}

.meta .pill {
  position: relative;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill:hover {
  border-color: var(--brand-700);
  background: var(--brand-100);
  color: var(--brand-950);
}

.view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.view-count svg { width: 14px; height: 14px; }
.view-count [data-view-count-value] { display: inline-block; min-width: 3ch; }





.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.pagination a:hover {
  border-color: var(--brand-700);
  color: var(--brand-900);
}

.pagination .current {
  border-color: var(--brand-900);
  background: var(--brand-900);
  color: #fff;
}

/* Detail pages */
.section-head .category-description {
  max-width: 60ch;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.article-page { padding: 30px 0 68px; }

.article-shell {
  max-width: 880px;
  margin-inline: auto;
}

.breadcrumb {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a:hover {
  color: var(--brand-800);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb [aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  max-width: 52ch;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.article-content {
  max-width: 760px;
  margin: 30px 0 0;
}

.article-content > h2 {
  margin: 0 0 20px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.prose {
  max-width: 760px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.prose > * + * { margin-top: 19px; }
.prose p { margin: 0; }

.prose h2,
.prose h3 {
  margin: 31px 0 0;
  color: var(--brand-950);
  line-height: 1.4;
  letter-spacing: -.025em;
}

.prose h2 { font-size: 23px; }
.prose h3 { font-size: 19px; }

.prose ul,
.prose ol {
  margin: 0;
  padding-inline-start: 1.45em;
}

.prose li + li { margin-top: 6px; }

.prose a {
  color: var(--brand-800);
  text-decoration: underline;
  text-decoration-color: #9fc4b4;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--brand-950);
  text-decoration-color: var(--brand-700);
}

.prose blockquote {
  margin-inline: 0;
  padding: 12px 16px;
  border-left: 3px solid #a9cabc;
  background: var(--brand-050);
  color: var(--muted);
}

.prose code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--brand-950);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}

.prose pre {
  max-width: 100%;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eef3f1;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

.prose img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.related-section {
  margin-top: 36px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.related-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.related-section > p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.related-section .article-grid { margin-top: 17px; }

.article-header {
  min-width: 0;
  margin: 0;
  text-align: left;
}

.detail-category {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 3px 10px;
  border: 1px solid #c8ded4;
  border-radius: 999px;
  background: var(--brand-050);
  color: var(--brand-900);
  font-size: 12px;
  font-weight: 700;
}

.article-header h1 {
  max-width: 28ch;
  margin: 0;
  color: var(--brand-950);
  font-size: clamp(32px, 3.5vw, 36px);
  line-height: 1.2;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.lead {
  max-width: 56ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.article-header .lead { display: none; }

.article-meta { display: none; }

.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 24px;
  color: var(--brand-900);
  font-size: 14px;
}

.back-link:hover {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resource-box {
  min-width: 0;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.resource-heading strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.resource-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  gap: 12px;
  margin-top: 12px;
}

.resource-item {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(42px, auto) auto;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.resource-info {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
}

.resource-info strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
}

.resource-code {
  color: var(--muted);
  font-size: 12px;
}

.resource-code code {
  color: var(--brand-900);
  font-weight: 750;
}

.resource-actions {
  min-width: 0;
  display: flex;
  flex: none;
  gap: 8px;
}

.resource-actions .button {
  border-color: #c8ded4;
  background: var(--brand-050);
  color: var(--brand-900) !important;
}

.resource-actions .button:hover { background: var(--brand-100); }

.resource-actions .copy-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button,
.copy-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.button {
  border-color: var(--brand-900);
  background: var(--brand-900);
  color: #fff !important;
  text-decoration: none !important;
}

.button:hover {
  border-color: var(--brand-950);
  background: var(--brand-950);
}

.copy-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--brand-900);
}

.copy-button:hover {
  border-color: #9fc4b4;
  background: var(--brand-050);
}

.copy-button.is-copied {
  border-color: #9fc4b4;
  background: var(--brand-100);
  color: var(--brand-950);
}

.copy-button:disabled { cursor: default; }

/* Search and empty states */
.search-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form .search-input { min-width: 0; }

.search-input {
  width: 100%;
  min-height: 48px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
}

.search-input:focus {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(38, 116, 91, .13);
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-filters select {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 28px 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  color: var(--text);
}

.search-status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.search-result {
  min-width: 0;
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.search-result:hover {
  border-color: #a9cabc;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.search-result-copy {
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  overflow: hidden;
}

.search-result .pill { flex: none; }

.search-result h2 {
  min-width: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result-copy h2 {
  width: 100%;
  flex: 0 1 auto;
}

.search-result-copy h2 a {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result-copy h2 a::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.search-result-copy .card-description {
  width: 100%;
  grid-column: auto;
}



.search-result p:not(.card-description) { display: none; }
.search-result mark { border-radius: 3px; background: #d9ebe2; color: var(--text); }

.empty {
  padding: 38px 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  padding: 42px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: center;
}

.empty-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-inline: auto;
  border: 1px solid #b8d3c6;
  border-radius: 10px;
  background: var(--brand-100);
  color: var(--brand-900);
  font-weight: 750;
}

.empty-state h2 { margin: 14px 0 5px; font-size: 19px; }

.empty-state p {
  max-width: 480px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 900px) {
  .header-inner { gap: 12px; }
  .header-search { width: min(220px, 28vw); }
  .header-search button { min-width: 48px; }
  .header-search button span { display: none; }
  .layout { gap: 24px; }
  .directory-intro { grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 24px; }
}

@media (max-width: 760px) {
  .wrap { width: min(var(--content-width), calc(100% - 24px)); }

  .header-inner {
    min-height: 60px;
    gap: 7px;
  }

  .brand {
    gap: 7px;
    font-size: 17px;
  }

  .brand-mark { width: 30px; height: 30px; }

  .nav {
    justify-content: flex-end;
    gap: 0;
  }

  .nav a {
    padding-inline: 6px;
    font-size: 13px;
  }

  .directory-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 17px;
    border-radius: 14px;
  }

  .directory-intro .eyebrow { margin-bottom: 3px; }
  .directory-intro h1 { font-size: clamp(27px, 8vw, 34px); }
  .directory-intro .intro-copy {
    max-width: none;
    overflow: hidden;
    margin-top: 4px;
    font-size: 13px;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .directory-search { gap: 7px; }
  .directory-search input,
  .directory-search button { min-height: 44px; }
  .directory-search button { min-width: 70px; padding-inline: 12px; }

  .layout,
  .directory-intro + .layout {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 52px;
  }

  .sidebar { position: static; }
  .side-title { margin-bottom: 8px; }

  .category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .category-list a {
    min-height: 44px;
    align-items: center;
    padding: 7px;
    border-color: var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
    line-height: 1.25;
  }

  .category-list a:hover { border-color: #a9cabc; }
  .category-list a[aria-current="page"] { border-color: #a9cabc; }
  .category-list span:last-child { font-size: 12px; }

  .meta { column-gap: 6px; }
  .meta .pill { padding-inline: 5px; }
  .view-count [data-view-count-value] { min-width: 1ch; }

  .section-head {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .section-head h1,
  .section-head h2 { font-size: 23px; }

  .article-grid { grid-template-columns: 1fr; gap: 10px; }

  .article-card {
    min-height: 100px;
    gap: 12px;
    padding: 15px 16px 14px;
  }

  .article-thumbnail {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .article-card::after { top: 18px; right: 17px; }
  .article-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .article-copy h2,
  .card-description,
  .article-card .meta { grid-column: auto; }
  .article-copy h2 { min-height: 0; font-size: 16px; }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
  }

  .article-page { padding-top: 24px; }
  .article-header h1 { max-width: 24ch; font-size: 28px; }
  .lead { margin-top: 13px; font-size: 16px; line-height: 1.75; }
  .article-content { margin-top: 24px; }
  .article-content > h2 { margin-bottom: 16px; font-size: 21px; }
  .prose { font-size: 16px; line-height: 1.8; }
  .prose h2 { font-size: 21px; }
  .prose h3 { font-size: 18px; }
  .related-section { margin-top: 30px; padding-top: 20px; }
  .related-section .article-grid { grid-template-columns: 1fr; margin-top: 14px; }

  .search-panel { padding: 16px; }

  .resource-list { grid-template-columns: 1fr; }

  .resource-item {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .resource-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-actions .button,
  .resource-actions .copy-button {
    width: 100%;
    min-height: 40px;
  }


  .search-form { flex-direction: column; }
  .search-form .button { width: 100%; }

  .search-result {
    min-height: 60px;
    gap: 8px;
    padding: 11px;
  }

  .search-result h2 { font-size: 16px; }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .layout .article-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .header-search { display: none; }
  .nav { justify-content: flex-end; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 20px); }
  .header-inner { gap: 3px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; }
  .nav a { padding-inline: 4px; font-size: 12px; }
  .directory-intro { padding-inline: 14px; }
  .directory-intro h1 { font-size: 27px; }
  .directory-intro .intro-copy { font-size: 12px; }
  .category-list { gap: 4px; }
  .category-list a { padding-inline: 5px; font-size: 12px; }
  .category-list span:last-child { font-size: 12px; }
}

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