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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a28;
  --border: #2a2a3e;
  --text: #e4e4ed;
  --text2: #8888a0;
  --accent: #6c5ce7;
  --accent2: #00cec9;
  --green: #00b894;
  --orange: #fdcb6e;
  --red: #e17055;
  --blue: #74b9ff;
  --pink: #fd79a8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

header .subtitle {
  color: var(--text2);
  font-size: 0.95rem;
}

header .meta {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--text2);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header .meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Main */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Category sections */
.category {
  margin-bottom: 2.5rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.category-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.category-header .count {
  font-size: 0.8rem;
  color: var(--text2);
  background: var(--surface2);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-ai-lab { background: var(--accent); }
.dot-paper { background: var(--green); }
.dot-community { background: var(--blue); }
.dot-blog { background: var(--orange); }
.dot-discussion { background: var(--pink); }

/* Article cards */
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
  transition: border-color 0.2s, background 0.2s;
}

.article:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.article-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.article-title a {
  color: var(--text);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--accent2);
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text2);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.article-meta .source {
  color: var(--accent);
}

.article-summary {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-summary.expanded {
  -webkit-line-clamp: unset;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text2);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

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

/* Refresh notice */
.refresh-notice {
  text-align: center;
  padding: 0.5rem 1rem;
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}

/* Loading state */
.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text2);
}

.loading .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.error-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text2);
}

.error-state .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
  header { padding: 1.5rem 1rem 1rem; }
  header h1 { font-size: 1.5rem; }
  main { padding: 1rem; }
  .article { padding: 0.8rem 1rem; }
}
