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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 0;
}

.controls {
    padding: 30px 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.summary-section {
    padding: 30px 40px;
    border-bottom: 1px solid #e9ecef;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-section h2 {
    font-size: 1.8em;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.summary-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.summary-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.summary-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 12px;
    line-height: 1.6;
    color: #495057;
    font-size: 15px;
}

.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 0.6em;
    margin-bottom: 0.4em;
    font-weight: 600;
}

.markdown-content h1 {
    font-size: 1.4em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.2em;
}

.markdown-content h2 {
    font-size: 1.25em;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.2em;
}

.markdown-content h3 {
    font-size: 1.15em;
}

.markdown-content p {
    margin-bottom: 0.6em;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.6em 0;
    padding-left: 1.8em;
}

.markdown-content li {
    margin-bottom: 0.3em;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content strong {
    font-weight: 600;
    color: #212529;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content code {
    background: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.markdown-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1em;
    margin: 1em 0;
    color: #6c757d;
    font-style: italic;
}

.markdown-content a {
    color: #667eea;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
    color: #764ba2;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #e9ecef;
    padding: 0.5em 1em;
    text-align: left;
}

.markdown-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 2em 0;
}

.history-section {
    padding: 30px 40px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.history-section h2 {
    font-size: 1.8em;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.history-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #495057;
}

.date-filter select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.date-filter select:focus {
    outline: none;
    border-color: #667eea;
}

.category-tabs {
    display: flex;
    gap: 15px;
}

.tab-btn {
    padding: 10px 25px;
    border: 2px solid #e9ecef;
    background: white;
    color: #495057;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.article-list {
    display: grid;
    gap: 8px;
}

.article-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 10px;
    transition: all 0.3s;
    display: flex;
    gap: 12px;
}

.article-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.article-thumbnail {
    width: 200px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f8f9fa;
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.article-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.article-title .article-link {
    color: #212529;
    text-decoration: none;
    transition: all 0.3s;
}

.article-title .article-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.article-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.category-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.category-badge.category1 {
    background: #e3f2fd;
    color: #1976d2;
}

.category-badge.category2 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.author-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fff3e0;
    color: #e65100;
}

.article-summary-container {
    margin-bottom: 15px;
}

.article-summary {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 15px;
}

.article-summary h1,
.article-summary h2,
.article-summary h3,
.article-summary h4,
.article-summary h5,
.article-summary h6 {
    margin-top: 0.5em;
    margin-bottom: 0.3em;
    font-weight: 600;
}

.article-summary h1 {
    font-size: 1.2em;
}

.article-summary h2 {
    font-size: 1.1em;
}

.article-summary h3 {
    font-size: 1em;
}

.article-summary p {
    margin-bottom: 0.5em;
}

.article-summary ul,
.article-summary ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.article-summary li {
    margin-bottom: 0.3em;
}

.article-summary.collapsed {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.article-summary.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, white);
}

.expand-btn {
    display: inline-block;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    background: none;
    border: none;
    transition: all 0.3s;
}

.expand-btn:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.article-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 18px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .summary-header,
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-controls {
        align-items: flex-start;
        width: 100%;
    }

    .history-controls .search-box {
        min-width: 100%;
    }

    .category-tabs {
        flex-wrap: wrap;
    }

    .summary-content {
        grid-template-columns: 1fr;
    }

    .summary-section,
    .history-section {
        padding: 20px;
    }

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

    .article-card {
        flex-direction: column;
    }

    .article-thumbnail {
        width: 100%;
        height: 200px;
    }
}
