:root {
  --brand: #0a5c36;
  --brand-dark: #084a2b;
  --brand-light: #e7f5ec;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --bg: #fafafa;
  --card-bg: #fff;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Homepage ---------- */
.home { max-width: 640px; margin: 12vh auto; text-align: center; padding: 0 16px; }
.home h1 { font-size: 1.9rem; margin-bottom: 6px; letter-spacing: -0.02em; }
.tagline { color: var(--text-muted); margin-bottom: 32px; font-size: 0.95rem; }

.search-form { display: flex; gap: 10px; }
.search-input-wrap { position: relative; flex: 1; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #999; pointer-events: none; }
.search-form input,
.search-form-small input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  font-size: 1rem;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form-small input { padding-left: 16px; }
.search-form input:focus,
.search-form-small input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.search-form button,
.search-form-small button {
  padding: 13px 22px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.search-form button:hover,
.search-form-small button:hover { background: var(--brand-dark); }

/* ---------- Results page ---------- */
.results { max-width: 800px; margin: 0 auto; padding: 24px 16px 64px; }
.results-header {
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 700; font-size: 1.1rem; white-space: nowrap; color: var(--text); }
.logo:hover { text-decoration: none; color: var(--brand); }
.search-form-small { display: flex; gap: 8px; flex: 1; }

.result-count { color: var(--text-muted); margin-bottom: 18px; font-size: 0.88rem; }

.empty-state {
  text-align: center; color: var(--text-muted);
  padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.result-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border-color: #d5d5d5;
}

.result-main { flex: 1 1 420px; min-width: 0; }
.result-title { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.35; }
.result-title a { color: var(--text); font-weight: 600; }
.result-title a:hover { color: var(--brand); text-decoration: none; }

.meta {
  font-size: 0.83rem; color: var(--text-muted);
  margin: 0 0 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.meta .journal { font-weight: 500; color: #444; }
.meta .date { display: inline-flex; align-items: center; gap: 4px; }

.badge {
  padding: 2px 9px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.badge-hec { background: var(--brand-light); color: var(--brand); }

.abstract { color: #333; font-size: 0.9rem; margin: 0; line-height: 1.5; }

.result-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 7px;
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid #d5d5d5; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.pagination {
  display: flex; justify-content: center; align-items: center; gap: 20px;
  margin-top: 32px;
}
.page-btn {
  padding: 8px 16px; border: 1px solid #d5d5d5; border-radius: 7px;
  font-size: 0.88rem; font-weight: 500; color: var(--text);
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.page-btn.disabled { opacity: 0.35; pointer-events: none; }
.page-info { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .home { margin: 8vh auto; }
  .results-header { flex-wrap: wrap; }
  .result-card { flex-direction: column; align-items: stretch; }
  .result-actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
}
