:root {
  --bg: #e9eeea;
  --surface: #edf2ee;
  --surface-strong: #f3f6f3;
  --ink: #1f2926;
  --muted: #65716d;
  --line: rgba(52, 69, 63, 0.14);
  --green: #176b58;
  --green-soft: #d7e9e1;
  --blue: #315f7d;
  --blue-soft: #dce8ef;
  --coral: #b95543;
  --coral-soft: #f0ddd8;
  --amber: #8a6422;
  --amber-soft: #eee4ce;
  --shadow-dark: rgba(51, 69, 62, 0.16);
  --shadow-light: rgba(255, 255, 255, 0.9);
  --raised: 8px 8px 18px var(--shadow-dark), -8px -8px 18px var(--shadow-light);
  --pressed: inset 3px 3px 7px rgba(53, 70, 64, 0.16), inset -3px -3px 7px rgba(255, 255, 255, 0.88);
  --radius: 7px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
}

button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 66px;
  padding: 8px max(20px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(233, 238, 234, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(23, 107, 88, 0.22);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.category-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.nav-tab span { margin-left: 3px; color: #8b9692; font-size: 11px; }
.nav-tab:hover { color: var(--ink); background: rgba(255,255,255,.35); }
.nav-tab.is-active { color: var(--green); background: var(--surface); box-shadow: var(--pressed); }

.live-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 84px;
  color: var(--muted);
  font-size: 12px;
}

.live-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 107, 88, 0.1);
}

main {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.brief-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 36px; line-height: 1.15; letter-spacing: 0; }
.date-line { margin: 0; color: var(--muted); font-size: 14px; }

.sync-note {
  display: grid;
  min-width: 330px;
  padding: 15px 18px;
  border: 1px solid rgba(23, 107, 88, 0.13);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--raised);
}

.sync-note span, .sync-note small { color: var(--muted); font-size: 11px; }
.sync-note strong { margin: 2px 0; font-size: 15px; }
.sync-note b { color: var(--green); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 20px;
}

.metric {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid rgba(52, 69, 63, 0.1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 5px 5px 14px var(--shadow-dark), -5px -5px 14px var(--shadow-light);
}

.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 1px; font-size: 25px; line-height: 1.25; }
.metric small { color: var(--muted); font-size: 11px; }
.metric.green strong { color: var(--green); }
.metric.blue strong { color: var(--blue); }
.metric.coral strong { color: var(--coral); }
.metric.amber strong { color: var(--amber); }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(4, minmax(135px, 0.75fr)) auto;
  align-items: end;
  gap: 10px;
  margin: 22px 0 12px;
  padding: 13px;
  border: 1px solid rgba(52, 69, 63, 0.11);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--pressed);
}

.filters label { min-width: 0; }
.filters label > span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 10px; font-weight: 700; }

.filters input, .filters select {
  width: 100%;
  height: 39px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid rgba(52, 69, 63, 0.12);
  border-radius: 5px;
  outline: none;
  background: rgba(249, 251, 249, 0.7);
  color: var(--ink);
  font-size: 12px;
}

.filters input:focus, .filters select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 88, 0.1); }

.reset-button {
  height: 39px;
  padding: 0 13px;
  border: 1px solid rgba(52, 69, 63, 0.13);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  font-size: 12px;
  white-space: nowrap;
}

.reset-button:hover { color: var(--coral); }
.reset-button:active { box-shadow: var(--pressed); }

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 28px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
}

.result-line p { margin: 0; }

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 31px;
}

.signal {
  position: relative;
  min-height: 152px;
  padding: 19px 20px 17px;
  overflow: hidden;
  border: 1px solid rgba(52, 69, 63, 0.11);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--raised);
}

.signal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--green);
}

.signal.blue::before { background: var(--blue); }
.signal.coral::before { background: var(--coral); }
.signal span { color: var(--green); font-size: 10px; font-weight: 800; }
.signal.blue span { color: var(--blue); }
.signal.coral span { color: var(--coral); }
.signal h3 { margin: 7px 0 7px; font-size: 16px; line-height: 1.38; }
.signal p { margin: 0; color: var(--muted); font-size: 12px; }

.overview-columns {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  gap: 42px;
  padding: 29px 0 38px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.section-heading > span { color: var(--muted); font-size: 11px; }

.deadline-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  border-top: 1px solid var(--line);
}

.deadline-row:first-child { border-top: 0; }
.deadline-date { color: var(--coral); font-size: 12px; font-weight: 800; }
.deadline-row h3 { margin: 0 0 2px; overflow-wrap: anywhere; font-size: 13px; }
.deadline-row p { margin: 0; color: var(--muted); font-size: 11px; }
.deadline-row a { color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.deadline-row a:hover { text-decoration: underline; }

.source-panel dl { margin: 0; }
.source-panel dl > div { padding: 13px 0; border-top: 1px solid var(--line); }
.source-panel dt { margin-bottom: 3px; color: var(--blue); font-size: 11px; font-weight: 800; }
.source-panel dd { margin: 0; color: var(--muted); font-size: 12px; }

.feed { padding-top: 38px; }
.feed-heading { margin-bottom: 23px; }
.card-grid { display: grid; gap: 17px; }

.record-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 21px;
  padding: 20px;
  border: 1px solid rgba(52, 69, 63, 0.11);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 6px 6px 16px var(--shadow-dark), -6px -6px 16px var(--shadow-light);
}

.record-card:hover { border-color: rgba(23, 107, 88, 0.25); }

.record-meta {
  min-width: 0;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.kind-label { display: block; margin-bottom: 10px; color: var(--green); font-size: 10px; font-weight: 800; }
.record-card.project .kind-label { color: var(--blue); }
.record-card.competition .kind-label { color: var(--coral); }
.meta-list { display: grid; gap: 8px; margin: 0; }
.meta-list div { min-width: 0; }
.meta-list dt { color: var(--muted); font-size: 9px; font-weight: 700; }
.meta-list dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }

.record-main { min-width: 0; }
.record-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.record-title { margin: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.35; }
.record-title a { text-decoration: none; }
.record-title a:hover { color: var(--green); }

.status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(23, 107, 88, 0.18);
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.status-badge.preprint, .status-badge.conditional { border-color: rgba(138, 100, 34, 0.2); background: var(--amber-soft); color: var(--amber); }
.status-badge.reviewed { border-color: rgba(49, 95, 125, 0.2); background: var(--blue-soft); color: var(--blue); }
.status-badge.urgent { border-color: rgba(185, 85, 67, 0.2); background: var(--coral-soft); color: var(--coral); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 15px; }
.tag { padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; }

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

.detail-block { min-width: 0; padding-top: 11px; border-top: 1px solid var(--line); }
.detail-block.wide { grid-column: 1 / -1; }
.detail-block h4 { margin: 0 0 3px; color: var(--muted); font-size: 10px; }
.detail-block p { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.detail-block.caveat p { color: #70562c; }

.record-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(23, 107, 88, 0.18);
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--green);
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.source-link:hover { box-shadow: var(--pressed); }
.secondary-link { margin-left: 8px; color: var(--blue); font-size: 11px; text-decoration: none; }
.secondary-link:hover { text-decoration: underline; }
.record-footnote { color: var(--muted); font-size: 10px; text-align: right; }

.project-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0 0; }
.project-stats b { display: block; font-size: 15px; }
.project-stats span { color: var(--muted); font-size: 9px; }

.empty-state { padding: 70px 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px max(20px, calc((100vw - 1380px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1120px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); }
  .category-nav { justify-content: flex-start; }
  .live-state { display: none; }
  .filters { grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(135px, 1fr)); }
  .reset-button { width: 100%; }
}

@media (max-width: 820px) {
  .topbar { display: block; padding: 9px 16px 0; }
  .brand { margin-bottom: 8px; }
  .category-nav { justify-content: flex-start; margin: 0 -16px; padding: 0 16px 8px; }
  main { width: min(100% - 28px, 1380px); padding-top: 27px; }
  .brief-head { align-items: stretch; flex-direction: column; gap: 18px; }
  h1 { font-size: 30px; }
  .sync-note { min-width: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .signal-grid { grid-template-columns: 1fr; }
  .signal { min-height: 0; }
  .overview-columns { grid-template-columns: 1fr; gap: 34px; }
  .record-card { grid-template-columns: 1fr; }
  .record-meta { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 0 0 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .kind-label { margin: 0; }
}

@media (max-width: 560px) {
  main { width: calc(100% - 22px); }
  .brand strong { font-size: 13px; }
  .category-nav { gap: 2px; }
  .nav-tab { padding-inline: 6px; font-size: 11px; }
  .nav-tab span { margin-left: 1px; font-size: 9px; }
  .brief-head { padding-bottom: 21px; }
  .metrics { gap: 10px; }
  .metric { padding: 13px; }
  .metric strong { font-size: 21px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 11px; }
  .search-field, .reset-button { grid-column: 1 / -1; }
  .result-line { display: block; }
  .result-line p + p { margin-top: 3px; }
  .signal-grid { padding-bottom: 24px; }
  .overview-columns { padding-top: 24px; }
  .deadline-row { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
  .deadline-row a { grid-column: 2; }
  .feed { padding-top: 29px; }
  .record-card { gap: 15px; padding: 15px; }
  .record-meta { grid-template-columns: 100px minmax(0, 1fr); }
  .record-top { display: block; }
  .status-badge { display: inline-block; margin-top: 9px; }
  .record-title { font-size: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block.wide { grid-column: auto; }
  .record-actions { align-items: flex-start; flex-direction: column; }
  .record-footnote { text-align: left; }
  footer { flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
