:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d9e0ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft: #eef4ff;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 260px);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 28px;
}

.eyebrow {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(32px, 6vw, 62px);
  margin: 0 0 14px;
  line-height: 1.05;
}

.subtitle {
  max-width: 800px;
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 22px;
}

.side-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.section-head p, .card > p {
  margin: 0;
  font-size: 14px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

input, textarea, button {
  font: inherit;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: #fff;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

button:hover { background: var(--primary-dark); }
button.secondary {
  color: var(--primary);
  background: var(--soft);
}
button.secondary:hover { background: #dbe8ff; }

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

.paper-list {
  display: grid;
  gap: 12px;

  /* Keep the Latest Papers module scrollable inside the card. */
  max-height: min(72vh, 760px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

.paper-list::-webkit-scrollbar {
  width: 10px;
}

.paper-list::-webkit-scrollbar-track {
  background: #eef4ff;
  border-radius: 999px;
}

.paper-list::-webkit-scrollbar-thumb {
  background: #b8c7e6;
  border-radius: 999px;
  border: 2px solid #eef4ff;
}

.paper-list::-webkit-scrollbar-thumb:hover {
  background: #8fa7d8;
}

.paper-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcff;
}

.paper-title {
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.45;
}

.paper-title a {
  color: var(--text);
  text-decoration: none;
}

.paper-title a:hover { color: var(--primary); }

.paper-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.paper-abstract {
  margin-top: 10px;
  color: #344054;
  font-size: 14px;
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  background: var(--soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.wordcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  min-height: 220px;
}

.word {
  display: inline-block;
  color: var(--primary-dark);
  background: #f4f7ff;
  border: 1px solid #dbe8ff;
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.2;
}

.idea-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.ideas-section {
  max-width: 1180px;
  margin: 22px auto;
}

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

.idea-item {
  border-left: 4px solid var(--primary);
  background: #fbfcff;
  border-radius: 12px;
  padding: 14px 16px;
}

.idea-header {
  font-weight: 800;
  margin-bottom: 6px;
}

.idea-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.footer {
  max-width: 1180px;
  margin: 10px auto 38px;
  padding: 0 24px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.footer a { color: var(--primary); text-decoration: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .section-head { flex-direction: column; }
  .paper-list { max-height: 68vh; }
}
