:root {
  color-scheme: light;
  background: #f4f6f9;
  color: #1f2937;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f9;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  position: sticky;
  top: 0;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  z-index: 10;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-link {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  color: #0f172a;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 2rem;
  border-radius: 1.5rem;
  background: #ffffff;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 2.5vw, 3rem);
}

.hero p {
  margin: 0;
  line-height: 1.8;
  color: #374151;
  max-width: 780px;
}

.tag-bar {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-bar span {
  font-size: 0.88rem;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 9999px;
  padding: 0.55rem 0.9rem;
}

.controls {
  margin: 2rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.controls label {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: #334155;
  font-weight: 600;
}

.controls input,
.controls select {
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #0f172a;
  min-width: 220px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.articles {
  display: grid;
  gap: 1rem;
}

.article {
  display: grid;
  gap: 1rem;
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
}

.article-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.45;
  color: #0f172a;
}

.article-meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.92rem;
}

.article-summary {
  margin: 0;
  line-height: 1.8;
  color: #334155;
}

.article-footer {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}

.article-button {
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
}

.article-button:hover {
  background: #1d4ed8;
}

.article-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.article-link:hover {
  text-decoration: underline;
}

.status-message {
  color: #94a3b8;
  padding: 2rem 1rem;
}

.site-note {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.site-note p {
  margin: 0;
  color: #334155;
  line-height: 1.7;
}

.site-note a {
  color: #2563eb;
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-content {
  position: relative;
  width: min(100%, 920px);
  max-height: min(100%, 90vh);
  overflow: auto;
  padding: 2rem;
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
  color: #1f2937;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-meta {
  margin: 0.75rem 0 1.5rem;
}

.article-fullbody p {
  margin: 0 0 1rem;
  line-height: 1.8;
}

.article-source {
  margin-top: 1.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.article-source a {
  color: #2563eb;
  font-weight: 600;
}

.footer {
  margin-top: 3rem;
  padding: 2rem 1rem 1rem;
  color: #475569;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  text-align: center;
  background: #ffffff;
}

@media (max-width: 720px) {
  .controls {
    flex-direction: column;
    gap: 0.75rem;
  }
  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
