:root {
  --bg: #fafaf7;
  --bg-card: #fff;
  --border: #e5e2db;
  --text: #1a1a1a;
  --text-secondary: #6b6560;
  --text-muted: #9a948c;
  --accent: #a94f2c;
  --accent-light: #f3ebe6;
  --radius: 8px;
  --max-width: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.site-tagline {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Main layout --- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Feed list --- */
.feed-list {
  list-style: none;
}
.feed-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.feed-item:last-child {
  border-bottom: none;
}
.feed-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.feed-link:hover .feed-title {
  color: var(--accent);
}
.feed-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  transition: color 0.15s;
}
.feed-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}
.feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.feed-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.feed-sources {
  display: flex;
  align-items: center;
  gap: -4px;
}
.feed-labels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.feed-label {
  background: var(--accent-light);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.source-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -6px;
  background: var(--border);
  object-fit: cover;
}
.source-icon:first-child {
  margin-left: 0;
}
.source-icon-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -6px;
  background: var(--text-muted);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.source-icon-fallback:first-child {
  margin-left: 0;
}
.feed-source-count {
  color: var(--text-secondary);
  white-space: nowrap;
}
.feed-time {
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Story detail --- */
.story-back {
  display: inline-block;
  padding: 16px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.story-back:hover {
  color: var(--accent);
}
.story-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.story-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}
.story-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.story-stats {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}
.story-section {
  margin-top: 20px;
}
.story-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}

/* --- Source timeline --- */
.timeline {
  list-style: none;
  padding: 0;
}
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-icon img,
.timeline-icon .source-icon-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  margin-left: 0;
  font-size: 12px;
}
.timeline-body {
  min-width: 0;
  flex: 1;
}
.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.timeline-source {
  font-size: 12px;
  color: var(--text-muted);
}
.timeline-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
}
.timeline-title:hover {
  color: var(--accent);
}
.timeline-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Pagination --- */
.feed-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.feed-pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, border-color 0.15s;
}
.feed-pagination button:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
}
.feed-pagination button:disabled {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.5;
}
.feed-pagination .page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Loading / empty --- */
.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; }
  main { padding: 0 16px; }
  .feed-title { font-size: 16px; }
  .story-title { font-size: 20px; }
  .site-tagline { display: none; }
}
