/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 5px;
    padding-bottom: 0px;
    border-bottom: 1px solid #ddd;
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Search box */
.search-box {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#search-input {
    padding: 10px 15px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        align-items: center;
    }

    #search-input {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    #search-button {
        display: none;
    }

    .articles {
        grid-template-columns: 1fr;
    }
}

/* Articles grid */
.articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-image {
    height: 180px;
    background-color: #eee;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.article-image-link {
    display: block;
}

.article-image-link:hover .article-image {
    opacity: 0.9;
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.article-excerpt {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
}

.article-tags {
    display: flex;
    gap: 5px;
}

.tag {
    background-color: #e0f7fa;
    color: #00838f;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.read-more {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

.read-more:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #777;
}

/* Responsive design */
@media (max-width: 768px) {
    .articles {
        grid-template-columns: 1fr;
    }
}

/* Article detail page */
.article-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.article-detail h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.article-detail .article-meta {
    margin-bottom: 20px;
}

.article-detail .article-content {
    line-height: 1.8;
}

.article-detail .article-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-width: 100%;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.article-detail .article-content code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 14px;
}

.article-detail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

.back-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    margin-bottom: 20px;
}

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