:root {
  --ink: #15231f;
  --muted: #687570;
  --paper: #eff2ee;
  --paper-deep: #e1e8e3;
  --card: #fbfcfa;
  --line: #d3ddd6;
  --line-dark: #b7c4bd;
  --accent: #d85c3f;
  --accent-soft: #f2dfd9;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 12px 30px rgba(46, 40, 26, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent); color: white; }

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  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='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.topbar, main, .site-footer {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}
.topbar {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.brand-mark::before { width: 1px; height: 46px; }
.brand-mark::after { width: 46px; height: 1px; }
.brand-mark i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.brand-mark i:nth-child(1) { transform: translateY(-17px); }
.brand-mark i:nth-child(2) { transform: translateX(-17px); }
.brand-mark i:nth-child(3) { transform: translate(13px, 13px); width: 5px; height: 5px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-family: var(--serif); font-size: 22px; letter-spacing: 0.16em; }
.brand-copy span, .date-stamp, .eyebrow, .section-note {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.brand-copy span { color: var(--muted); }
.topbar-meta { display: flex; align-items: center; gap: 24px; }
.date-stamp { color: var(--muted); }
.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}
.admin-link:hover { color: var(--ink); }
.admin-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.hero {
  min-height: 335px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  padding: 52px 0 44px;
}
.hero-copy { max-width: 650px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--muted);
}
.eyebrow span { display: block; width: 22px; height: 1px; background: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 63px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
}
.hero-description {
  max-width: 540px;
  margin-bottom: 0;
  color: #5d635d;
  font-size: 16px;
  line-height: 1.85;
}
.compass { width: 185px; height: 185px; flex: 0 0 auto; position: relative; }
.compass-ring { position: absolute; border: 1px solid var(--line-dark); border-radius: 50%; }
.ring-outer { inset: 0; }
.ring-inner { inset: 31px; border-style: dashed; opacity: 0.82; }
.compass::before, .compass::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 7px;
  right: 7px;
  height: 1px;
  background: var(--line-dark);
  opacity: 0.55;
}
.compass::after { transform: rotate(90deg); }
.compass-n, .compass-e, .compass-s, .compass-w {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper);
  padding: 3px 5px;
  z-index: 1;
}
.compass-n { top: -10px; left: calc(50% - 5px); }
.compass-e { right: -8px; top: calc(50% - 6px); }
.compass-s { bottom: -10px; left: calc(50% - 5px); }
.compass-w { left: -8px; top: calc(50% - 6px); }
.compass-center {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  position: absolute;
  top: calc(50% - 9px);
  left: calc(50% - 9px);
  display: grid;
  place-items: center;
  background: var(--paper);
  z-index: 2;
}
.compass-center span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.find-bar {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line-dark);
  background: rgba(251, 252, 250, 0.72);
}
.search-box {
  height: 52px;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--line);
}
.search-box:focus-within { border-color: var(--ink); outline: 2px solid rgba(24, 33, 29, 0.08); }
.search-box svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: #90938d; }
.search-box kbd { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; }
.find-summary { width: 148px; color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.6; text-align: right; }

.category-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 30px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.filter-list { display: flex; gap: 8px; }
.filter-chip, .text-button {
  border: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.filter-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid transparent;
  font-size: 14px;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.filter-chip span { font-family: var(--mono); font-size: 11px; opacity: 0.65; }
.filter-chip:hover { color: var(--ink); border-color: var(--line); }
.filter-chip.is-active { color: var(--card); background: var(--ink); }
.text-button { padding: 3px 0; border-bottom: 1px solid currentColor; font-size: 13px; }
.text-button:hover { color: var(--ink); }

.pin-section { padding-bottom: 64px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.3;
  font-weight: 700;
}
.section-note { color: var(--muted); white-space: nowrap; padding-bottom: 3px; }
.pin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pin-card {
  min-height: 119px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}
.pin-card:hover { border-color: var(--line-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.pin-copy { min-width: 0; }
.pin-card strong { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pin-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.pin-arrow { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.tile-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
}

.directory { padding-bottom: 64px; }
.directory-group { margin-top: 30px; }
.directory-group-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 11px;
}
.directory-group-header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
}
.group-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.group-description { margin: 0; color: var(--muted); font-size: 13px; }
.group-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.link-list { border-top: 1px solid var(--line); }
.link-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(220px, 2fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 70px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 160ms, padding 160ms;
}
.link-row:hover { background: rgba(251, 252, 250, 0.82); padding-left: 16px; }
.link-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.link-main strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.link-description { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.link-side { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.tag { padding: 3px 6px; color: var(--muted); background: var(--paper-deep); font-size: 12px; }
.link-arrow { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.empty-state { padding: 64px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty-mark { display: block; font-family: var(--serif); color: var(--line-dark); font-size: 40px; }
.empty-state h3 { margin: 9px 0 7px; font-family: var(--serif); font-size: 19px; }
.empty-state p { margin-bottom: 17px; color: var(--muted); font-size: 14px; }

.site-footer { display: flex; align-items: center; gap: 17px; padding: 0 0 32px; color: var(--muted); font-size: 13px; }
.footer-rule { width: 30px; height: 1px; background: var(--line-dark); }
.site-footer p { margin: 0; flex: 1; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 16px;
  color: var(--card);
  background: var(--ink);
  font-size: 13px;
  transition: opacity 180ms, transform 180ms;
  z-index: 10;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.skeleton { background: linear-gradient(90deg, var(--paper-deep), var(--card), var(--paper-deep)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.is-hidden { display: none !important; }

@media (max-width: 900px) {
  .pin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-row { grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto; gap: 16px; }
  .tags { display: none; }
}
@media (max-width: 680px) {
  .topbar, main, .site-footer { width: min(100% - 34px, 560px); }
  .topbar { min-height: 76px; }
  .date-stamp { display: none; }
  .brand-copy span { font-size: 10px; }
  .admin-link span { display: none; }
  .hero { min-height: 0; padding: 41px 0 34px; }
  .hero h1 { font-size: clamp(36px, 10vw, 48px); }
  .hero-description { max-width: 440px; }
  .compass { display: none; }
  .find-bar { display: block; padding: 10px; }
  .search-box { height: 47px; }
  .find-summary { width: auto; padding: 8px 4px 0; text-align: left; }
  .category-nav { padding: 13px 0 23px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 26px; }
  .pin-section { padding-bottom: 43px; }
  .pin-grid { grid-template-columns: 1fr; gap: 8px; }
  .pin-card { min-height: 91px; padding: 14px; align-items: center; }
  .pin-card p { margin-top: 4px; }
  .directory { padding-bottom: 40px; }
  .directory-group { margin-top: 25px; }
  .directory-group-header { display: block; }
  .directory-group-header h3 { font-size: 19px; }
  .group-description { margin: 5px 0 0 15px; }
  .group-count { float: right; margin-top: -18px; }
  .link-row { grid-template-columns: 1fr auto; gap: 9px; min-height: 69px; padding: 12px 6px; align-items: center; }
  .link-description { grid-column: 1 / -1; grid-row: 2; font-size: 13px; margin-top: -14px; padding-left: 41px; }
  .link-side { grid-column: 2; grid-row: 1; }
  .link-row:hover { padding-left: 6px; }
  .site-footer { padding-bottom: 23px; }
}

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