:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --gold: #f5b400;
  --green: #2ea043;
  --red: #f85149;
  --accent: #ff8c5a;
  --blue: #58a6ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.55; min-height: 100vh;
}

.hero {
  background: linear-gradient(135deg, #1a1f2a 0%, #2a1208 60%, #3a1a0c 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 24px;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff8c5a 0%, #d4392f 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(255, 140, 90, 0.3);
}
.brand h1 { margin: 0; font-size: 22px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; gap: 8px; }
.hero-link {
  color: var(--text); text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.hero-link:hover { background: rgba(255,255,255,0.05); border-color: var(--accent); }

.container {
  max-width: 1200px; margin: 0 auto;
  padding: 24px; display: grid; gap: 20px;
}

/* Topic switcher (top-level) */
.topic-switcher {
  display: flex; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 12px;
  flex-wrap: wrap;
}
.topic-switcher button {
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}
.topic-switcher button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topic-switcher button.active {
  background: linear-gradient(135deg, var(--accent), #d4392f);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(255,140,90,0.25);
}
.topic-switcher .topic-count {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
}
.topic-switcher button.active .topic-count {
  background: rgba(0,0,0,0.2);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap; gap: 12px;
}
.card-head h2 { margin: 0; font-size: 16px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }

.search-input, .days-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.search-input { width: 200px; }
.search-input:focus, .days-select:focus { outline: none; border-color: var(--accent); }

.ghost-btn-small {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.ghost-btn-small:hover { color: var(--accent); border-color: var(--accent); }

/* Report panel */
.report-panel { background: linear-gradient(135deg, #1a1f2a 0%, #1f2630 100%); }
.report-tabs { display: flex; gap: 8px; align-items: center; }
.report-tabs button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}
.report-tabs button:hover { color: var(--text); border-color: var(--accent); }
.report-tabs button.active {
  background: var(--accent); color: #1a0a02;
  border-color: var(--accent); font-weight: 600;
}
.report-meta { font-size: 11px; margin-bottom: 12px; }

.markdown-body { font-size: 14px; line-height: 1.7; }
.markdown-body h1 { font-size: 22px; margin: 20px 0 12px; color: var(--gold); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.markdown-body h2 { font-size: 18px; margin: 18px 0 10px; color: var(--accent); }
.markdown-body h3 { font-size: 15px; margin: 16px 0 8px; color: var(--blue); }
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li { margin: 6px 0; }
.markdown-body a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.markdown-body a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.markdown-body p { margin: 8px 0; }
.markdown-body code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.markdown-body strong { color: var(--gold); }
.markdown-body em { color: var(--blue); }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  padding: 8px 12px;
  margin: 12px 0;
  border-radius: 4px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
}
.empty-state p { margin: 6px 0; }
.empty-state b { color: var(--gold); }

/* Report history dropdown */
.report-history {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow-y: auto;
}
.report-history-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.report-history-item:last-child { border-bottom: none; }
.report-history-item:hover { background: rgba(255,255,255,0.04); }
.report-history-item.active {
  background: rgba(255,140,90,0.1);
  border-left: 3px solid var(--accent);
}
.report-history-date {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.report-history-preview {
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Source tabs */
.source-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.source-tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.source-tab .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.source-tab .count {
  font-size: 10px;
  background: var(--surface);
  padding: 1px 8px;
  border-radius: 999px;
}
.source-tab:hover { color: var(--text); }
.source-tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255,140,90,0.1);
}

/* Items list */
.items-list { list-style: none; padding: 0; margin: 0; }
.items-list li {
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: baseline;
}
.items-list li:last-child { border-bottom: none; }
.item-source-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.item-main { min-width: 0; }
.item-title-link {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.4;
}
.item-title-link:hover { color: var(--accent); text-decoration: underline; }
.item-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-meta {
  display: flex; gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.item-meta .score {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.topic-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.topic-badge.auto {
  color: #6db4ff;
  border-color: rgba(109,180,255,0.3);
  background: rgba(88,166,255,0.08);
}
.topic-badge.startup {
  color: #ffb86b;
  border-color: rgba(255,184,107,0.3);
  background: rgba(255,184,107,0.08);
}
.topic-badge.android {
  color: #6ddc8a;
  border-color: rgba(109,220,138,0.3);
  background: rgba(46,160,67,0.08);
}
.item-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.footer {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 11px;
  padding: 8px 4px 24px;
  flex-wrap: wrap; gap: 8px;
}

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

@media (max-width: 700px) {
  .items-list li { grid-template-columns: 1fr; gap: 4px; }
  .item-time { display: none; }
  .search-input { width: 100%; }
}
