:root {
  --bg: #f7f7f4;
  --paper: #ffffff;
  --ink: #222521;
  --muted: #6e756f;
  --line: #dfe3dc;
  --accent: #1f6b57;
  --accent-soft: #e8f0ec;
  --danger: #9a3947;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", "PingFang SC", serif;
  line-height: 1.72;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar,
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 22px;
}

.topbar {
  padding-top: 34px;
  padding-bottom: 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0;
}

h1 {
  font-size: 38px;
  font-weight: 800;
}

h2 {
  font-size: 23px;
}

.summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) minmax(120px, 180px) auto;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 0;
  background: rgba(247, 247, 244, 0.95);
  backdrop-filter: blur(8px);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 87, 0.12);
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
  padding: 8px 13px;
  font-weight: 700;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 16px 0 12px;
  border-top: 1px solid var(--line);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.cards {
  display: grid;
  gap: 10px;
  padding-bottom: 34px;
}

.wisdom-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 18px 20px;
}

.card-id {
  color: var(--danger);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 800;
}

.wisdom-card h3 {
  margin-top: 5px;
  font-size: 21px;
}

.wisdom-card p {
  margin: 10px 0 0;
  font-size: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.meta span {
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 3px 9px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .topbar,
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 31px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    position: static;
  }

  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pager {
    justify-content: space-between;
  }
}
