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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

.subtitle {
    opacity: 0.8;
    font-size: 1.1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filters select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.filters button {
    padding: 0.75rem 1.5rem;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.filters button:hover {
    background: #16213e;
}

.btn-reset {
    padding: 0.75rem 1.5rem;
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-reset:hover {
    background: #d0d0d0;
}

.filters-checkbox {
    display: none !important;
}

.filters-toggle {
    display: none !important;
    width: 100%;
    padding: 0.75rem;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    text-align: center;
}

.filters-toggle:hover {
    background: #16213e;
}

.results-count {
    color: #666;
    margin-bottom: 1rem;
}

.articles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card {
    background: white;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 0.35rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card:hover {
    background: #fafafa;
}

.site-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 16px;
}

.card h2 {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.card h2 a {
    color: #1a1a2e;
    text-decoration: none;
}

.card h2 a:hover {
    color: #0066cc;
}

.scores {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.score {
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
}

.score.quality {
    background: #e3f2fd;
    color: #1565c0;
}

.score.relevance {
    background: #e8f5e9;
    color: #2e7d32;
}

.summary {
    color: #555;
    margin-bottom: 1rem;
}

.card time {
    color: #888;
    font-size: 0.75rem;
    white-space: nowrap;
    width: 110px;
    text-align: right;
}

.no-date {
    color: #aaa;
    font-size: 0.75rem;
    width: 110px;
    text-align: right;
}

.summary-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.75rem;
    white-space: nowrap;
    width: 55px;
    text-align: right;
}

.summary-link:hover {
    text-decoration: underline;
}

.summary-placeholder {
    width: 55px;
}

.card-footer a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination a {
    padding: 0.75rem 1.5rem;
    background: #1a1a2e;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.pagination a:hover {
    background: #16213e;
}

.page-info {
    color: #666;
}

/* About page */
.about-page {
    max-width: 800px;
}

.about-page article {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.about-page h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

.about-page ul {
    list-style: disc;
    margin-left: 1.5rem;
    color: #444;
    line-height: 1.8;
}

.about-page li {
    margin-bottom: 0.5rem;
}

.score-explanation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.score-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.score-item .score {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
}

.score-item p {
    margin: 0.25rem 0 0 0;
    color: #666;
}

/* Article detail page */
.article-detail {
    max-width: 800px;
}

.back-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

.article-detail article {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.article-detail h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.article-detail .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.article-detail .meta time {
    color: #666;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-section p {
    color: #444;
    line-height: 1.8;
}

.actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0052a3;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #0066cc;
}

@media (max-width: 640px) {
    header h1 {
        font-size: 1.75rem;
    }

    main {
        padding: 1rem;
    }

    .filters-toggle {
        display: block !important;
    }

    .filters {
        display: none !important;
        flex-direction: column;
    }

    .filters-checkbox:checked ~ .filters {
        display: flex !important;
    }

    .filters input[type="text"],
    .filters select,
    .filters button,
    .btn-reset {
        width: 100%;
    }

    .card {
        display: block;
        padding: 0.5rem 0.75rem;
    }

    .card h2 {
        white-space: normal;
        margin-bottom: 0.4rem;
    }

    .card .site-icon {
        display: inline-block;
        vertical-align: middle;
        margin-right: 0.4rem;
    }

    .card .score,
    .card time,
    .card .no-date,
    .card .summary-link {
        display: inline-block;
        margin-right: 0.5rem;
    }

    .article-detail .meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
