:root {
  --bg: #080b12;
  --bg-soft: #0c111b;
  --panel: #111726;
  --panel-2: #151d2f;
  --text: #e9eef8;
  --muted: #8b98ad;
  --muted-2: #66738a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gold: #f5c451;
  --gold-soft: rgba(245, 196, 81, 0.14);
  --blue: #62a8ff;
  --blue-soft: rgba(98, 168, 255, 0.14);
  --purple: #b58cff;
  --purple-soft: rgba(181, 140, 255, 0.14);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --red: #ff7b72;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(245, 196, 81, 0.28);
  color: #fff;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.bg-glow-a {
  top: -240px;
  left: 8%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(245, 196, 81, 0.14), transparent 68%);
}

.bg-glow-b {
  top: 120px;
  right: -180px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(98, 168, 255, 0.11), transparent 70%);
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(8, 11, 18, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(245, 196, 81, 0.25);
  border-radius: 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-text small {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.updated-at {
  color: var(--muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: 0.18s ease;
}

.refresh-btn:hover {
  border-color: rgba(245, 196, 81, 0.5);
  background: var(--gold-soft);
}

.refresh-btn.is-loading svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Page shell */
.page {
  width: min(1180px, 100% - clamp(32px, 8vw, 96px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 40px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  padding-bottom: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.grad {
  background: linear-gradient(100deg, var(--gold) 0%, #ffe6a3 42%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

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

.stat {
  position: relative;
  padding: 16px 18px 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.05), transparent 55%);
  pointer-events: none;
}

.stat-value {
  display: block;
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

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

.accent-gold {
  color: var(--gold);
}

.accent-green {
  color: var(--green);
}

.accent-blue {
  color: var(--blue);
}

/* Expiring section */
.expiring-section {
  margin-bottom: 40px;
  padding: 20px;
  background: linear-gradient(140deg, rgba(245, 196, 81, 0.06), rgba(17, 23, 38, 0.85) 45%);
  border: 1px solid rgba(245, 196, 81, 0.16);
  border-radius: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.section-head p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(245, 196, 81, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(245, 196, 81, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 196, 81, 0);
  }
}

.expiring-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.expiring-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px;
  background: rgba(8, 11, 18, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: 0.18s ease;
}

.expiring-card:hover {
  border-color: rgba(245, 196, 81, 0.4);
  transform: translateY(-2px);
}

.expiring-card .expiry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.expiring-card strong {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expiring-card small {
  color: var(--muted-2);
  font-size: 11.5px;
}

.expiry-pill {
  flex: 0 0 auto;
  padding: 2px 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  background: var(--gold-soft);
  border-radius: 999px;
}

/* Toolbar */
.feed-section {
  margin-top: 8px;
}

.toolbar {
  position: sticky;
  top: 69px;
  z-index: 20;
  padding: 14px 0 12px;
  background: linear-gradient(var(--bg) 65%, rgba(8, 11, 18, 0.85) 88%, transparent);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 8px 15px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  background: transparent;
  border: 0;
  border-radius: 9px;
  transition: 0.16s ease;
}

.tab span {
  margin-left: 3px;
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: #16120a;
  background: var(--gold);
}

.tab.is-active span {
  color: rgba(22, 18, 10, 0.6);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 220px;
  padding: 0 12px;
  color: var(--muted-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.16s ease;
}

.search-box:focus-within {
  border-color: rgba(245, 196, 81, 0.45);
}

.search-box input {
  width: 100%;
  padding: 9px 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box input::-webkit-search-cancel-button {
  filter: grayscale(1) invert(0.6);
}

.filters select {
  padding: 8px 30px 8px 11px;
  color: var(--muted);
  font-size: 12.5px;
  background: var(--panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b98ad' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  border: 1px solid var(--line);
  border-radius: 10px;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.filters select:hover,
.filters select:focus {
  border-color: var(--line-strong);
  color: var(--text);
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.source-chip {
  padding: 5px 12px;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: 0.16s ease;
}

.source-chip span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.source-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.source-chip.is-active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line-strong);
}

.source-chip[data-color="gold"].is-active {
  color: var(--gold);
  border-color: rgba(245, 196, 81, 0.4);
  background: var(--gold-soft);
}

.source-chip[data-color="blue"].is-active {
  color: var(--blue);
  border-color: rgba(98, 168, 255, 0.4);
  background: var(--blue-soft);
}

.source-chip[data-color="purple"].is-active {
  color: var(--purple);
  border-color: rgba(181, 140, 255, 0.4);
  background: var(--purple-soft);
}

/* Feed head */
.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.feed-head p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

/* Feed cards */
.feed-list {
  display: flex;
  flex-direction: column;
}

.feed-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 24px;
  padding: 20px 16px 18px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s ease;
}

.feed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  width: 2px;
  height: 0;
  background: var(--gold);
  border-radius: 2px;
  transition: height 0.18s ease;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.018);
}

.feed-item:hover::before {
  height: 28px;
}

.feed-main {
  min-width: 0;
}

.item-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 5px;
}

.badge-source-freeegg {
  color: var(--gold);
  background: var(--gold-soft);
}

.badge-source-free-llm-intel {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge-source-modelwool {
  color: var(--purple);
  background: var(--purple-soft);
}

.badge-kind {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.badge-kind-perk {
  color: var(--green);
  background: var(--green-soft);
}

.badge-kind-change {
  color: #ffb86b;
  background: rgba(255, 184, 107, 0.12);
}

.badge-new {
  color: #ffdf9e;
  background: rgba(245, 196, 81, 0.16);
}

.badge-multi {
  color: var(--muted-2);
  border: 1px solid var(--line);
}

.vendor-chip {
  color: var(--muted);
  font-size: 11.5px;
}

.feed-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.feed-item h3 a {
  transition: color 0.15s ease;
}

.feed-item h3 a:hover {
  color: var(--gold);
}

.feed-item p.summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.item-meta .score {
  color: var(--gold);
  font-weight: 600;
}

.item-meta .expiry {
  color: #ffb86b;
}

.item-meta .expired {
  color: var(--red);
}

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-width: 92px;
}

.item-date {
  color: var(--muted-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.original-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: 0.16s ease;
}

.original-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

/* Empty / load more */
.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13.5px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0 10px;
}

.load-more {
  padding: 10px 26px;
  color: var(--muted);
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: 0.16s ease;
}

.load-more:hover {
  color: var(--text);
  border-color: rgba(245, 196, 81, 0.45);
  background: var(--gold-soft);
}

/* Footer */
.footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.footer-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--muted-2);
  font-size: 12px;
}

.footer-sources span {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10.5px;
}

.footer-sources a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-sources a:hover {
  color: var(--gold);
}

.disclaimer {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.8;
}

.footer-meta {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
  }

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

  .stat {
    padding: 13px 14px 11px;
  }

  .stat-value {
    font-size: 22px;
  }

  .toolbar {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 11px 16px;
  }

  .brand-text small,
  .updated-at {
    display: none;
  }

  .page {
    width: calc(100% - 28px);
    padding-top: 26px;
  }

  .hero h1 {
    font-size: 34px;
  }

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

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .filters select {
    width: 100%;
  }

  .feed-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 10px 16px 16px;
  }

  .item-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .feed-item h3 {
    font-size: 15px;
  }

  .expiring-track {
    grid-auto-columns: 82%;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}