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

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --muted: #666;
    --border: #e0e0e0;
    --accent: #2d6a4f;
    --accent-light: #eaf5ef;
    --card-bg: #fff;
    --max-w: 960px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Nav */
header { border-bottom: 1px solid var(--border); background: var(--card-bg); }
nav {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); }

/* Main */
main { max-width: var(--max-w); margin: 0 auto; padding: 2rem 1rem; }

/* Footer */
footer {
    max-width: var(--max-w);
    margin: 3rem auto 1rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}
footer a { color: var(--accent); }

/* Hero */
.hero { text-align: center; padding: 2rem 0 1.5rem; }
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.3rem; }
.subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 1.1rem; }
.search-hero {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}
.search-hero input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}
.search-hero button, #search-btn {
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
.search-hero button:hover, #search-btn:hover { opacity: 0.9; }

/* Stats */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}
.stat { text-align: center; }
.stat-number { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.9rem; color: var(--muted); }

/* About sections */
.about { margin-bottom: 2rem; }
.about h2 { font-size: 1.3rem; margin-bottom: 0.6rem; border-bottom: 2px solid var(--accent-light); padding-bottom: 0.3rem; }
.about p { margin-bottom: 0.6rem; }
.about ul { margin-left: 1.2rem; margin-bottom: 0.6rem; }
.about li { margin-bottom: 0.3rem; }
.about pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.sources-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.sources-table th, .sources-table td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.sources-table th { font-weight: 600; }

/* Catalog */
.catalog h1 { margin-bottom: 1rem; }
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-form input {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}
.search-form select {
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}
.results-info { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Taxon cards */
.results-list { display: flex; flex-direction: column; gap: 0.5rem; }
.taxon-card {
    display: block;
    padding: 0.8rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.taxon-card:hover { border-color: var(--accent); }
.taxon-id { font-size: 0.8rem; color: var(--muted); font-family: monospace; }
.taxon-main { margin: 0.2rem 0; }
.taxon-latin { font-style: italic; font-weight: 600; margin-right: 0.5rem; }
.taxon-ru { color: var(--text); margin-right: 0.5rem; }
.taxon-en { color: var(--muted); font-size: 0.9rem; }
.taxon-meta { font-size: 0.85rem; color: var(--muted); }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; margin-top: 1rem; }
.pagination button {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.pagination button:hover { border-color: var(--accent); }

/* Taxon detail */
.taxon-detail h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.taxon-detail .latin { font-style: italic; }
.taxon-detail .author { font-weight: 400; color: var(--muted); font-size: 0.9rem; margin-left: 0.3rem; }
.display-id { font-family: monospace; color: var(--accent); margin-bottom: 0.3rem; }
.name-en { color: var(--muted); margin-bottom: 0.3rem; }
.rank { display: inline-block; background: var(--accent-light); color: var(--accent); padding: 0.15rem 0.6rem; border-radius: 4px; font-size: 0.85rem; margin-bottom: 1rem; }
.back-link { display: inline-block; margin-bottom: 1rem; color: var(--accent); text-decoration: none; }
.section { margin-bottom: 1.5rem; }
.section h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs .sep { margin: 0 0.3rem; color: var(--muted); }
.breadcrumbs .current { font-weight: 600; }
.source { color: var(--muted); font-size: 0.85rem; }
.preferred { background: var(--accent-light); color: var(--accent); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.8rem; margin-left: 0.3rem; }
.external-links { list-style: none; display: flex; gap: 1rem; }
.external-links a { color: var(--accent); text-decoration: none; padding: 0.3rem 0.7rem; border: 1px solid var(--accent); border-radius: 4px; font-size: 0.9rem; }
.external-links a:hover { background: var(--accent-light); }

/* Mobile */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.5rem; }
    .search-hero { flex-direction: column; }
    .stats-bar { gap: 1.5rem; }
    .stat-number { font-size: 1.4rem; }
    .search-form { flex-direction: column; }
    .external-links { flex-wrap: wrap; }
}
