/* SignalFeed - 样式文件 */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #0066cc;
    --hover-bg: #f1f3f5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #e9ecef;
        --text-secondary: #adb5bd;
        --border-color: #495057;
        --accent-color: #4dabf7;
        --hover-bg: #343a40;
    }
}

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

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

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

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

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

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats */
.stats {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Articles */
.articles {
    padding: 2rem 0;
}

.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.article-number {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.article-header h2 {
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-title-group {
    flex: 1;
}

.open-original-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.2rem 0 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
}

.open-original-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.article-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.source {
    font-weight: 500;
}

.description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.original-content {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.original-content summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--accent-color);
    padding: 0.8rem 1rem;
}

.original-content summary::-webkit-details-marker {
    display: none;
}

.original-content[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.original-content-body {
    padding: 0.9rem 1rem 1rem;
}

.original-content-body p {
    margin: 0 0 0.85rem;
    line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.original-content-body p:last-child {
    margin-bottom: 0;
}

.original-content-note {
    color: var(--text-secondary) !important;
    font-size: 0.88rem;
    font-style: italic;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 3rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-card {
        padding: 1rem;
    }

    .article-header h2 {
        font-size: 1.1rem;
    }
}

/* AI Enhanced Content Styles */

/* Keywords */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* AI Summary */
.ai-summary {
    background: rgba(0, 102, 204, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.ai-summary strong {
    color: var(--accent-color);
}

/* Key Points */
.key-points {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.key-points strong {
    color: #4caf50;
    display: block;
    margin-bottom: 0.5rem;
}

.key-points ul {
    margin: 0;
    padding-left: 1.5rem;
}

.key-points li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.deep-analysis {
    background: rgba(255, 176, 32, 0.12);
    border-left: 3px solid #ffb020;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.deep-analysis strong {
    color: #ad6d00;
    display: block;
    margin-bottom: 0.5rem;
}

.deep-analysis ul {
    margin: 0;
    padding-left: 1.5rem;
}

.deep-analysis li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .ai-summary {
        background: rgba(77, 171, 247, 0.15);
    }

    .key-points {
        background: rgba(76, 175, 80, 0.15);
    }

    .deep-analysis {
        background: rgba(255, 176, 32, 0.2);
    }

    .deep-analysis strong {
        color: #ffd28a;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-summary, .key-points, .deep-analysis {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .tags {
        gap: 0.4rem;
    }

    .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Filters */
.filters {
    padding: 1.25rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.filters-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.filters-toggle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 6px;
}

.filters-toggle-icon {
    color: var(--text-secondary);
    font-size: 0.95rem;
    width: 1rem;
    text-align: center;
}

.filters-title {
    font-size: 1rem;
}

.filters-toggle-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.filters-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e03131;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.filters-toggle.has-active-filters .filters-title {
    color: var(--accent-color);
}

.clear-filters-btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.clear-filters-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filters-content {
    margin-top: 0.85rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.8rem 1rem;
}

.filter-grid label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.filter-grid input,
.filter-grid select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.filter-grid select {
    cursor: pointer;
}

.filter-grid input:hover,
.filter-grid select:hover {
    border-color: var(--accent-color);
}

.filter-grid input:focus,
.filter-grid select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tag-mode {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.tag-mode-label {
    font-weight: 500;
    color: var(--text-primary);
}

.tag-mode label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.tag-filter-panel {
    margin-top: 1rem;
}

.tag-filter-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-chip-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.1s;
}

.tag-chip-filter:hover:not(:disabled) {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.tag-chip-filter.is-selected {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 102, 204, 0.12);
}

.tag-chip-filter:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tag-chip-count {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.active-filter-summary {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.empty-state {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.page-btn:hover:not(:disabled) {
    background: #0052a3;
    transform: translateY(-1px);
}

.page-btn:active:not(:disabled) {
    transform: translateY(0);
}

.page-btn:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

#page-info {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

/* Responsive - Filters and Pagination */
@media (max-width: 768px) {
    .filters {
        padding: 1rem;
    }

    .filters-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .filter-grid input,
    .filter-grid select {
        width: 100%;
    }

    .tag-mode {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tag-chip-list {
        gap: 0.45rem;
    }

    .pagination {
        gap: 1rem;
    }

    .page-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (prefers-color-scheme: dark) {
    .tag-chip-count {
        background: rgba(255, 255, 255, 0.16);
    }

    .tag-chip-filter.is-selected {
        background: rgba(77, 171, 247, 0.2);
    }

    .filters-active-badge {
        background: #ff6b6b;
        color: #1f1f1f;
    }
}
