:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #60706a;
  --line: #d7e0db;
  --paper: #f5f7f3;
  --surface: #ffffff;
  --accent: #126b57;
  --accent-soft: #e3f1eb;
  --shadow: 0 14px 36px rgba(23, 34, 31, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
.site-header { background: #1c302b; color: #f7fbf8; border-bottom: 4px solid #be8c45; }
.header-inner { max-width: 1440px; margin: 0 auto; padding: 34px 32px 30px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.eyebrow { margin: 0 0 12px; color: #b9d5c9; font-size: 0.72rem; letter-spacing: 0.12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1; letter-spacing: 0; }
.lede { margin: 0; color: #c9ddd4; font-size: 1rem; }
.header-link { color: #fff; text-decoration: none; border-bottom: 1px solid #b9d5c9; padding-bottom: 4px; white-space: nowrap; }
.atlas-shell { max-width: 1440px; margin: 0 auto; padding: 28px 32px 60px; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 24px; }
.stat { background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 5px; }
.stat strong { font-size: 1.8rem; line-height: 1; }
.stat span { color: var(--muted); font-size: 0.78rem; }
.stat-note strong { font-size: 1.05rem; color: var(--accent); padding-top: 5px; }
.controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(100px, 130px) minmax(140px, 200px); gap: 10px; align-items: center; margin-bottom: 32px; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
input, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); padding: 0 13px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(190, 140, 69, 0.5); outline-offset: 2px; }
.controls > label:not(.search-label) { color: var(--muted); font-size: 0.82rem; text-align: right; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.results-head h2 { margin-bottom: 12px; font-size: 1.1rem; }
.results-head p { margin-bottom: 12px; color: var(--muted); font-size: 0.86rem; }
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.family-card { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; overflow: hidden; text-align: left; padding: 0; cursor: pointer; color: inherit; box-shadow: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.family-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #94b9aa; }
.family-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ecefe8; }
.card-copy { padding: 13px 14px 15px; }
.card-order { color: var(--accent); font-size: 0.72rem; margin-bottom: 7px; }
.card-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; margin-bottom: 4px; }
.card-cn { color: var(--muted); font-size: 0.82rem; min-height: 1.2em; }
.card-species { color: var(--muted); font-size: 0.76rem; margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load-more { display: block; margin: 30px auto 0; min-height: 42px; padding: 0 22px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; cursor: pointer; }
.load-more:hover { background: #0d5949; }
.empty { padding: 50px 0; text-align: center; color: var(--muted); }
.detail-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28); color: var(--ink); }
.detail-dialog::backdrop { background: rgba(16, 30, 25, 0.68); }
.detail-dialog img { display: block; width: 100%; max-height: 52vh; object-fit: cover; background: #ecefe8; }
.detail-copy { padding: 24px 26px 28px; }
.detail-copy h2 { margin-bottom: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.9rem; }
.detail-copy .latin { color: var(--muted); margin-bottom: 16px; }
.detail-copy p { line-height: 1.7; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; font-size: 0.82rem; }
.detail-meta div { border-top: 1px solid var(--line); padding-top: 8px; }
.detail-meta span { display: block; color: var(--muted); font-size: 0.7rem; margin-bottom: 3px; }
.icon-button { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 1; }
@media (max-width: 720px) {
  .header-inner, .atlas-shell { padding-left: 18px; padding-right: 18px; }
  .header-inner { display: block; }
  .header-link { display: inline-block; margin-top: 20px; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr 1fr; }
  .controls input { grid-column: 1 / -1; }
  .controls > label:not(.search-label) { text-align: left; }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-copy { padding: 10px; }
  .card-name { font-size: 0.98rem; }
  .detail-copy { padding: 20px 18px 22px; }
}
