:root {
  --paper: #f3f1eb;
  --surface: #faf9f5;
  --surface-hover: #ffffff;
  --ink: #1d1e1c;
  --muted: #72736e;
  --line: #d8d6ce;
  --accent: #345a4a;
  --accent-soft: #dfe8e1;
  --shadow: 0 20px 50px rgba(33, 36, 31, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(52, 90, 74, 0.08), transparent 26rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
}

.hero {
  padding: 30px 0 42px;
  border-bottom: 1px solid var(--line);
}

.topbar,
.toolbar,
.directory-card-bottom,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-decoration: none;
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(52, 90, 74, 0.12);
}

.page-label,
.directory-card-detail {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-content {
  padding: 100px 0 72px;
}

h1 {
  max-width: none;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.55rem, 2.25vw, 2rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.toolbar {
  gap: 24px;
}

.search {
  display: flex;
  width: min(100%, 390px);
  height: 48px;
  gap: 12px;
  align-items: center;
  padding: 0 14px;
  background: rgba(250, 249, 245, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.search:focus-within {
  background: var(--surface-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 90, 74, 0.1);
}

.search svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search > span {
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
  transform: rotate(-15deg);
}

.search input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search input::placeholder {
  color: #979792;
}

.search kbd {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: inherit;
  font-size: 11px;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.result-count span {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.directory-card {
  display: flex;
  min-width: 0;
  animation: directory-card-in 500ms both;
}

.directory-card[hidden] {
  display: none;
}

.directory-card-link {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 22px;
  background: rgba(250, 249, 245, 0.82);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  transition: transform 220ms ease, background-color 220ms ease,
    border-color 220ms ease, box-shadow 220ms ease;
}

.directory-card-link::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--card-accent, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms ease;
}

.directory-card-link:hover,
.directory-card-link:focus-visible {
  z-index: 1;
  background: var(--surface-hover);
  border-color: #c5c7bf;
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-5px);
}

.directory-card-link:hover::before,
.directory-card-link:focus-visible::before {
  transform: scaleX(1);
}

.directory-card-title {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.28rem, 2vw, 1.62rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-wrap: balance;
}

.directory-card-bottom {
  gap: 12px;
}

.directory-card-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-card-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--card-accent, var(--accent));
  background: var(--card-soft, var(--accent-soft));
  border-radius: 50%;
  font-size: 16px;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.directory-card-link:hover .directory-card-arrow,
.directory-card-link:focus-visible .directory-card-arrow {
  color: white;
  background: var(--card-accent, var(--accent));
  transform: rotate(-8deg);
}

.empty-state {
  min-height: 320px;
  color: var(--muted);
  text-align: center;
}

.empty-state:not([hidden]) {
  display: grid;
  place-content: center;
  gap: 12px;
}

.empty-state > span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 42px;
}

.empty-state button {
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

footer {
  padding: 30px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

footer a {
  color: var(--ink);
  text-decoration: none;
}

@keyframes directory-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 900px) {
  .hero-content {
    padding: 78px 0 58px;
  }

  h1 {
    font-size: clamp(1rem, 2.15vw, 1.55rem);
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 32px, 1280px);
  }

  .hero {
    padding-top: 22px;
  }

  .page-label {
    display: none;
  }

  .hero-content {
    padding: 62px 0 46px;
  }

  h1 {
    font-size: 1.45rem;
  }

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

  .search {
    width: 100%;
  }

  footer {
    gap: 18px;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
