* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --text: #333333;
    --text-muted: #666666;
    --accent: #2563eb;
    --border: #e0e0e0;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --bg-card: #252525;
    --text: #e0e0e0;
    --text-muted: #999999;
    --accent: #60a5fa;
    --border: #333333;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    width: 92%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.title-area h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-controls button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.top-controls button:hover {
    background: var(--border);
}

/* Language toggle switch */
.lang-switch {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.lang-switch input {
    display: none;
}

.lang-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
}

.lang-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lang-switch input:checked + .lang-slider {
    background: var(--accent);
}

.lang-switch input:checked + .lang-slider::before {
    transform: translateX(20px);
}

.lang-labels {
    display: flex;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    gap: 4px;
}

.lang-labels span:first-child,
.lang-labels span:last-child {
    font-weight: 600;
}

.lang-labels span:first-child {
    color: var(--text-muted);
}

.lang-labels span:last-child {
    color: var(--text-muted);
}

.lang-switch input:not(:checked) ~ .lang-labels span:first-child {
    color: #2563eb;
    font-weight: 700;
}

.lang-switch input:not(:checked) ~ .lang-labels span:last-child {
    color: var(--text-muted);
    font-weight: 600;
}

.lang-switch input:checked ~ .lang-labels span:first-child {
    color: var(--text-muted);
    font-weight: 600;
}

.lang-switch input:checked ~ .lang-labels span:last-child {
    color: #2563eb;
    font-weight: 700;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.filters label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filters select,
.filters input,
.filters button {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    min-width: 140px;
    font-size: 0.9rem;
}

.filters button {
    background: var(--accent);
    color: white;
    border: none;
}

.filters button:hover {
    opacity: 0.9;
}

.feed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.feed-item {
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.feed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.feed-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.feed-item h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.feed-item p,
.feed-item .meta {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feed-item a {
    color: var(--accent);
    text-decoration: none;
}

.feed-item a:hover {
    text-decoration: underline;
}

@media (max-width: 760px) {
    .filters {
        justify-content: center;
    }

    .filters select,
    .filters input,
    .filters button {
        min-width: 100%;
    }
}

/* AI Summary styles */
.summary-result {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.summary-result .close-summary {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
}

.summary-result .summary-content {
    position: relative;
}

.summary-result .loading {
    color: var(--text-muted);
    font-style: italic;
}

.summary-result .error {
    color: #dc2626;
}

.summary-result .summary-content h4 {
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 1rem;
}

.summary-result .summary-content p {
    color: var(--text);
    line-height: 1.6;
}

.summary-result .top-10 {
    margin-top: 16px;
}

.summary-result .top-10 h5 {
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.summary-result .top-10 ul {
    list-style: none;
    padding: 0;
}

.summary-result .top-10 li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.4;
}

.summary-result .top-10 li:last-child {
    border-bottom: none;
}

.summary-result .top-10 a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
}

.summary-result .top-10 a:hover {
    text-decoration: underline;
}

