:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-hover: #222;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #e53935;
    --accent-dark: #b71c1c;
    --tag-area: #1b3a4b;
    --tag-category: #3a1b1b;
    --urgency-high: #e53935;
    --urgency-medium: #ff9800;
    --urgency-low: #4caf50;
}

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

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

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

header h1 { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
header h1 span { color: var(--text-muted); font-weight: 400; }

.stats { display: flex; gap: 20px; font-size: 0.85rem; color: var(--text-muted); }
.stats .count { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

.ollama-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

.ollama-status .dot.online { background: var(--urgency-low); }
.ollama-status .dot.offline { background: var(--urgency-high); }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.toolbar button.running { opacity: 0.5; cursor: wait; }

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select, .filters input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.filters input { flex: 1; min-width: 200px; }

.filters button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.filters button:hover { background: var(--accent-dark); }

.article-list { display: flex; flex-direction: column; gap: 10px; }

.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    transition: background 0.2s;
}

.article:hover { background: var(--surface-hover); }
.article.unread { border-left: 3px solid var(--accent); }

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 6px;
}

.article-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}

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

.article-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.article-source { font-weight: 600; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag.area { background: var(--tag-area); color: #6db3d6; }
.tag.category { background: var(--tag-category); color: #d66d6d; }

.article-actions { display: flex; gap: 8px; flex-shrink: 0; }

.article-actions button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.article-actions button:hover { border-color: var(--accent); color: var(--accent); }
.article-actions button.active { background: var(--accent); color: white; border-color: var(--accent); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 10px; }

.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }

.pagination a {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}

.pagination a:hover { border-color: var(--accent); }
.pagination a.active { background: var(--accent); border-color: var(--accent); }

.status-bar {
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Chat */
@media (max-width: 600px) {
    .container { padding: 12px; }
    header { flex-direction: column; gap: 10px; }
    .filters { flex-direction: column; }
    .article-header { flex-direction: column; }
}
