:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --border: #e4e7ec;
  --accent: #0b63b6;
  --pending-bg: #fff4d6;
  --pending-fg: #7a4d00;
  --backfill-bg: #eef0f3;
  --backfill-fg: #475467;
  --topic-bg: #eaf6ee;
  --topic-fg: #24653a;
  --filtered-bg: #f6f7f9;
  --error: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2126;
    --text: #e8eaed;
    --muted: #9aa4b2;
    --border: #30363d;
    --accent: #7ab7ff;
    --pending-bg: #3d2f10;
    --pending-fg: #f5c451;
    --backfill-bg: #262c33;
    --backfill-fg: #b8c0cc;
    --topic-bg: #1c3324;
    --topic-fg: #8fd3a5;
    --filtered-bg: #191d21;
    --error: #ff8b80;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(100% - 2rem, 860px);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.site-title {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.nav a {
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}

.nav a:hover,
.nav a.active {
  border-bottom-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

main {
  padding-block: 2rem 3rem;
}

h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
  line-height: 1.25;
}

.section-title {
  margin: 2rem 0 0.75rem;
  font-size: 1.05rem;
}

.lede,
.note,
.muted {
  color: var(--muted);
}

.lede {
  margin-top: 0;
}

.note {
  margin-top: 0.9rem;
  font-size: 0.84rem;
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 2rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tz {
  font-size: 0.72rem;
  font-weight: 500;
}

.entries {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.8rem 0.95rem;
}

.entry-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.entry-title {
  font-size: 1.02rem;
  font-weight: 600;
}

.entry-title-plain {
  color: var(--text);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.sep {
  color: var(--muted);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-pending {
  background: var(--pending-bg);
  color: var(--pending-fg);
}

.badge-backfill {
  background: var(--backfill-bg);
  color: var(--backfill-fg);
}

.badge-filtered,
.badge-drop {
  background: var(--filtered-bg);
  color: var(--muted);
}

.topics {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.topic {
  border-radius: 999px;
  background: var(--topic-bg);
  color: var(--topic-fg);
  padding: 0.03rem 0.45rem;
  font-size: 0.73rem;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.error-cell {
  min-width: 12rem;
  white-space: normal;
}

td.freshness {
  min-width: 18rem;
  white-space: normal;
}

.freshness-status {
  font-weight: 600;
}

.error-text {
  color: var(--error);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.source-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.source-meta dd {
  margin: 0.1rem 0 0;
}

.breadcrumb {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

details.filtered {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

details.filtered summary {
  cursor: pointer;
  padding: 0.8rem 0.95rem;
  font-weight: 600;
}

.filtered-body {
  padding: 0 0.95rem 0.95rem;
}

.entry-filtered {
  background: var(--filtered-bg);
}

.entry-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.reason {
  overflow-wrap: anywhere;
}

.entry-title,
.entry-meta,
.entry-reasons {
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 1.25rem, 860px);
  }

  main {
    padding-block: 1.25rem 2rem;
  }

  .entry {
    padding: 0.7rem 0.8rem;
  }

  th,
  td {
    padding: 0.55rem 0.6rem;
  }
}
