:root {
  color-scheme: light;
  --paper: #f3ecdf;
  --card: #fffaf3;
  --ink: #241c16;
  --muted: #6d5e52;
  --line: #e2d3c2;
  --seal: #8f2d22;
  --seal-dark: #6e2119;
  --ok: #1f6b45;
  --warn: #8a5a12;
  --shadow: 0 16px 40px rgba(60, 36, 18, 0.08);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 45, 34, 0.08), transparent 32rem),
    var(--paper);
}

a { color: var(--seal-dark); }

h1, h2, h3 {
  font-family: "Iowan Old Style", Palatino, "Songti SC", serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 6vw;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-family: "Iowan Old Style", Palatino, "Songti SC", serif;
  font-size: 1.35rem;
}

.brand span {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1.5px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  font-size: 0.95rem;
}

nav, .actions, .subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: center;
}

nav form, .actions form { margin: 0; }

.link, button.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--seal-dark);
  font: inherit;
  cursor: pointer;
}

.nav-cta, button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--seal);
  border-radius: 999px;
  background: var(--seal);
  color: #fffaf3;
  text-decoration: none;
  padding: 0.55rem 1rem;
  font: inherit;
  cursor: pointer;
}

.ghost, button.ghost {
  background: transparent;
  color: var(--seal-dark);
}

main {
  width: min(1040px, calc(100% - 8vw));
  margin: 0 auto 4rem;
}

.hero { padding: 2.5rem 0 1rem; max-width: 40rem; }

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--seal);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.lead, .hint { color: var(--muted); line-height: 1.7; }
.lead { white-space: pre-wrap; }

.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.panel { padding: 1.2rem 1.3rem 1.4rem; }
.narrow { max-width: 28rem; }

form { display: grid; gap: 0.85rem; }
label, fieldset { display: grid; gap: 0.35rem; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset.range { grid-template-columns: 1fr 1fr; }
fieldset.range legend { grid-column: 1 / -1; }
.choice { display: flex; gap: 0.4rem; align-items: center; }

.map-picker {
  width: 100%;
  height: 22rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
}

.cascader { position: relative; }
.cascader-trigger {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: inherit;
  padding: 0.65rem 0.75rem;
  white-space: normal;
  text-align: left;
  line-height: 1.45;
}
.cascader-back { display: none; }
.cascader-panel {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  display: flex;
  margin-top: 0.35rem;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  box-shadow: var(--shadow);
}
.cascader-panel[hidden] { display: none; }
.cascader-panel section {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 8.5rem;
  flex: 1;
  border-right: 1px solid var(--line);
}
.cascader-panel section > span {
  padding: 0.45rem 0.7rem 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.cascader-panel ul {
  max-height: 16rem;
  margin: 0;
  padding: 0.2rem 0 0.4rem;
  overflow: auto;
  list-style: none;
}
.cascader-panel button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0.4rem 0.7rem;
}
.cascader-panel button[aria-selected='true'] {
  background: #f6ebe3;
  color: var(--seal-dark);
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: inherit;
  font: inherit;
  padding: 0.65rem 0.75rem;
}
input[type='radio'], input[type='checkbox'] {
  width: 1.05rem;
  height: 1.05rem;
  max-width: none;
  margin: 0;
  padding: 0;
  accent-color: var(--seal);
}

.share-link {
  margin: 0.2rem 0 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-all;
}

.captcha-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.captcha-line input { grid-column: 1 / -1; }
.captcha-line button { justify-self: end; }
.captcha-line.code-line { grid-template-columns: 1fr auto; }
.captcha-line.code-line input { grid-column: auto; }
.captcha-line img {
  width: 9.25rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fffaf3;
}
.captcha-line button.ghost {
  height: 3rem;
  border-radius: 0.7rem;
  padding: 0 0.75rem;
  white-space: nowrap;
}

.flash, .error, .ok, .warn {
  border-radius: 0.8rem;
  padding: 0.75rem 0.9rem;
}

.flash, .ok { background: #e7f4ec; color: var(--ok); }
.error { background: #fdecea; color: var(--seal-dark); }
.warn { background: #fff4df; color: var(--warn); }

.cards { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.card {
  display: flex;
  gap: 0.9rem;
  padding: 0.8rem;
  color: inherit;
  text-decoration: none;
}
.card img, .thumb, .portrait {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.8rem;
  background: var(--line);
}
.portrait { width: 7.5rem; height: 7.5rem; }
.card div { display: grid; align-content: center; gap: 0.15rem; }
.card em { color: var(--seal); font-style: normal; }

.match-head { display: flex; gap: 1rem; align-items: center; }
.meeting { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.inline { grid-template-columns: 1.4fr 1fr auto; align-items: end; }
.pair { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: end; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.page-head h1, .page-head p { margin: 0; }
.page-head p { margin-top: 0.35rem; }
.back { margin: 0 0 0.8rem; }
.filters {
  display: flex;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 1rem;
}
.filters label { min-width: 12rem; }
.city-extra { margin-top: 1rem; }
td form { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
td form select { width: auto; flex: 1; min-width: 7rem; }
td form button { flex: none; }
.subnav { margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
.data { min-width: 52rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data th, .data td { white-space: nowrap; }
.data td.wrap { white-space: normal; min-width: 14rem; max-width: 22rem; }
.data th:last-child, .data td:last-child {
  position: sticky;
  right: 0;
  background: var(--card);
}
.thumb { width: 2.6rem; height: 2.6rem; }

@media (max-width: 800px) {
  .split, .inline, .pair, .page-head { grid-template-columns: 1fr; }
  .page-head, .match-head, .filters { flex-direction: column; align-items: stretch; }
  .filters label { min-width: 0; }
  .top { align-items: flex-start; flex-direction: column; }
  .map-picker { height: 16rem; }
  .cascader-panel {
    position: fixed;
    left: 4vw;
    right: 4vw;
    bottom: 1rem;
    top: auto;
    max-height: min(70vh, 28rem);
    flex-direction: column;
  }
  .cascader-back {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--seal-dark);
  }
  .cascader-back[hidden] { display: none; }
  .cascader-panel section { display: none; min-width: 0; border-right: 0; }
  .cascader-panel section.is-current { display: grid; }
  .cascader-panel ul { max-height: 46vh; }
  .data { min-width: 0; background: transparent; }
  .data thead { display: none; }
  .data, .data tbody, .data tr, .data td { display: block; }
  .data tr {
    margin-bottom: 0.8rem;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.1rem;
  }
  .data td, .data td.wrap { border: 0; padding: 0.15rem 0; white-space: normal; min-width: 0; max-width: none; }
  .data td:last-child { position: static; margin-top: 0.55rem; background: transparent; }
  .data td[data-label]::before {
    content: attr(data-label);
    margin-right: 0.4rem;
    color: var(--muted);
    font-size: 0.82rem;
  }
}
