:root {
  --ink: #15201d;
  --muted: #60706b;
  --line: #d9e3df;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --green: #1d6f5d;
  --green-dark: #114b40;
  --amber: #b87414;
  --blue: #285f9f;
  --rose: #9f3f55;
  --shadow: 0 18px 50px rgba(22, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 251, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--green);
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(36px, 7vw, 86px) clamp(18px, 5vw, 72px) 42px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(29, 111, 93, 0.08), rgba(40, 95, 159, 0.06) 52%, rgba(184, 116, 20, 0.09)),
    var(--paper);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.subhead {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.search-panel {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-panel > label {
  display: block;
  margin-bottom: 10px;
  font-weight: 750;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
}

.search-row input,
.filters select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
}

.search-row input {
  padding: 0 14px;
}

.search-row button,
.ghost-button,
.topic-grid button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.search-row button {
  color: white;
  background: var(--green);
}

.search-row button:hover,
.search-row button:focus {
  background: var(--green-dark);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.filters select {
  padding: 0 10px;
}

.results-shell,
.topic-band,
.resource-section,
.keyword-section,
.guide {
  padding: 36px clamp(18px, 5vw, 72px);
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.results-head h2,
.topic-band h2,
.section-head h2,
.promo-band h2,
.guide h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.results-head p {
  color: var(--muted);
}

.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--green-dark);
  background: white;
}

.ghost-button:disabled {
  color: #98a7a3;
  cursor: not-allowed;
  background: #f4f7f6;
}

.state {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px dashed #bdd1ca;
  border-radius: 8px;
  color: var(--muted);
  background: #f6faf8;
}

.state strong {
  color: var(--ink);
}

.results-list {
  display: grid;
  gap: 14px;
}

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

.paper-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.5;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--green-dark);
  background: #eaf4f0;
  font-size: 12px;
  font-weight: 750;
}

.tag.blue {
  color: var(--blue);
  background: #edf4fb;
}

.tag.amber {
  color: var(--amber);
  background: #fff5e5;
}

.tag.rose {
  color: var(--rose);
  background: #fff0f3;
}

.authors,
.abstract {
  color: var(--muted);
  line-height: 1.7;
}

.abstract {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.paper-actions a,
.paper-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: white;
  cursor: pointer;
}

.topic-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f4f8f6;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.topic-grid button {
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.section-head {
  display: grid;
  gap: 6px;
  max-width: 780px;
  margin-bottom: 18px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compact-tools {
  background: var(--paper);
}

.tool-button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tool-button-grid button {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  cursor: default;
  font-weight: 750;
}

.sitemap-links a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-weight: 750;
}

.promo-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.guide article {
  padding: 0;
}

.guide p {
  color: var(--muted);
  line-height: 1.8;
}

.lead-modal,
.citation-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 30, 27, 0.48);
}

.lead-modal[hidden],
.citation-modal[hidden] {
  display: none;
}

.modal-panel,
.citation-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 26px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.citation-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #eef3f1;
  cursor: pointer;
  font-size: 22px;
}

.modal-copy h2 {
  margin-bottom: 8px;
}

.modal-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-copy p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.qr {
  width: 210px;
  height: 210px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.full {
  width: 100%;
}

.citation-list {
  display: grid;
  gap: 12px;
}

.citation-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.citation-item h3 {
  margin: 0;
  font-size: 15px;
}

.citation-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  word-break: break-word;
}

.citation-copy {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: white;
  cursor: pointer;
  font-weight: 750;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 22px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .hero,
  .guide {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .search-row,
  .filters,
  .results-head,
  .topic-grid,
  .tool-button-grid {
    grid-template-columns: 1fr;
  }

  .results-head {
    display: grid;
  }

  .ghost-button {
    width: 100%;
  }
}
