:root {
  --bg: #f4f3ef;
  --panel: rgba(255, 255, 255, 0.76);
  --ink: #12100f;
  --muted: #5f5953;
  --line: rgba(24, 19, 16, 0.14);
  --accent: #d94825;
  --accent-2: #0f6f7f;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(217, 72, 37, 0.15), transparent 35%),
    radial-gradient(circle at 85% 16%, rgba(15, 111, 127, 0.15), transparent 40%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(circle at 1px 1px, #000 1px, transparent 0);
  background-size: 5px 5px;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(46px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: #df6f52;
  top: -68px;
  left: -60px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: #6ca0a9;
  right: -80px;
  top: 120px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 18px 48px;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 246, 237, 0.72));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow:
    0 24px 55px rgba(21, 16, 12, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: fade-up 600ms ease;
}

.hero-headline {
  display: flex;
  gap: 14px;
  align-items: center;
}

.hero-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(24, 19, 16, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.hero-tag {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero h1 {
  margin: 10px 0 8px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.02;
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat .k {
  font-size: 12px;
  color: var(--muted);
}

.stat .v {
  margin-top: 4px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.6fr) auto auto;
  gap: 10px;
  align-items: center;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

.updated {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}

.mode-btn.active {
  background: linear-gradient(90deg, rgba(217, 72, 37, 0.14), rgba(15, 111, 127, 0.16));
  color: var(--ink);
  font-weight: 700;
}

.all-dedupe {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
}

.all-dedupe.show {
  display: inline-flex;
}

.all-dedupe input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.all-dedupe-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(18, 16, 15, 0.25);
  background: rgba(18, 16, 15, 0.18);
  transition: background 160ms ease;
}

.all-dedupe input:checked + .all-dedupe-dot {
  border-color: rgba(15, 111, 127, 0.55);
  background: rgba(15, 111, 127, 0.82);
}

.mode-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.site-pills {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.pill.active {
  background: linear-gradient(90deg, rgba(217, 72, 37, 0.14), rgba(15, 111, 127, 0.16));
  border-color: rgba(33, 22, 17, 0.35);
}

.list-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.list-head {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.list-head h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 21px;
}

#resultCount {
  color: var(--muted);
  font-size: 13px;
}

.news-list {
  display: grid;
}

.site-group {
  border-top: 1px solid rgba(22, 16, 13, 0.08);
}

.site-group:first-child {
  border-top: 0;
}

.site-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(217, 72, 37, 0.08);
  border-bottom: 1px solid rgba(22, 16, 13, 0.08);
}

.site-group-head h3 {
  margin: 0;
  font-size: 16px;
  font-family: "Bricolage Grotesque", sans-serif;
}

.site-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.site-group-list {
  display: grid;
}

.source-group {
  border-top: 1px solid rgba(22, 16, 13, 0.06);
}

.source-group:first-child {
  border-top: 0;
}

.source-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(15, 111, 127, 0.05);
  border-bottom: 1px solid rgba(22, 16, 13, 0.08);
}

.source-group-head h3 {
  margin: 0;
  font-size: 14px;
}

.source-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.source-group-list {
  display: grid;
}

.news-card {
  padding: 14px 18px;
  border-top: 1px solid rgba(22, 16, 13, 0.08);
  animation: fade-up 300ms ease;
}

.news-card:first-child {
  border-top: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.site {
  font-weight: 700;
  color: #453f39;
}

.source {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}

.time {
  margin-left: auto;
}

.title {
  margin-top: 8px;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}

.title-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
}

.title:hover {
  color: var(--accent);
}

.empty {
  padding: 24px 18px;
  color: var(--muted);
  text-align: center;
}

.waytoagi-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.waytoagi-head {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.waytoagi-head h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 20px;
}

#waytoagiUpdatedAt {
  color: var(--muted);
  font-size: 13px;
}

.waytoagi-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.waytoagi-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
}

.waytoagi-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.waytoagi-btn.active {
  background: linear-gradient(90deg, rgba(217, 72, 37, 0.14), rgba(15, 111, 127, 0.16));
  color: var(--ink);
  font-weight: 700;
}

.waytoagi-meta {
  padding: 12px 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.waytoagi-meta a {
  color: var(--accent-2);
  text-decoration: none;
}

.waytoagi-list {
  padding: 12px 16px 16px;
  display: grid;
  gap: 8px;
}

.waytoagi-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  text-decoration: none;
  border: 1px solid rgba(22, 16, 13, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
}

.waytoagi-item .d {
  color: var(--muted);
  font-size: 12px;
}

.waytoagi-item .t {
  font-size: 13px;
  line-height: 1.35;
}

.waytoagi-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
}

.waytoagi-error {
  border: 1px solid rgba(183, 28, 28, 0.28);
  background: rgba(183, 28, 28, 0.08);
  border-radius: 10px;
  padding: 9px 10px;
  color: #7b1717;
  font-size: 13px;
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 12px 36px;
  }

  .hero {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .updated {
    justify-self: start;
  }

  .time {
    margin-left: 0;
  }

  .waytoagi-head {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }
}

@keyframes fade-up {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
