/* 通用样式 */
html {
    font-size: 14px;  /* 默认是16px，改小一点 */
}

body {
    font-family: "Microsoft YaHei", "思源黑体", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    margin: 0;
    padding: 0;
}

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

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: #222;
    margin-top: 1em;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }

/* 头部 */
header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    margin: 0;
    display: inline-block;
}

header h1 a {
    color: #333;
    font-size: 2em;
    font-weight: bold;
    text-decoration: none;
}

header nav {
    float: right;
    margin-top: 10px;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav ul li {
    display: inline-block;
    margin-left: 20px;
}

header nav ul li a {
    color: #555;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #007bff;
    text-decoration: none;
}

/* 主内容区布局 */
.main-content {
    padding: 30px 0;
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
    gap: 30px; /* 两栏之间的间距 */
}

.main-area {
    flex: 3; /* 主内容区占3份 */
    min-width: 600px; /* 最小宽度，防止被挤压太小 */
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-area {
    flex: 1; /* 侧边栏占1份 */
    min-width: 250px; /* 最小宽度 */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 新闻列表 */
.news-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.news-item h2 {
    margin-top: 0;
    font-size: 1.8em;
}

.news-item h2 a {
    color: #333;
    text-decoration: none;
}

.news-item h2 a:hover {
    color: #007bff;
}

.news-item .news-date {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
}

.news-item .news-summary {
    color: #555;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #0056b3;
    text-decoration: none;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 30px 0;
}

/* 文章页 */
.article-detail h1 {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 15px;
}

.article-detail .article-date {
    text-align: center;
    color: #888;
    font-size: 1em;
    margin-bottom: 30px;
}

.article-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 1em;
    text-indent: 2em; /* 首行缩进 */
}

.article-content h2, .article-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #444;
}

/* 侧边栏存档 */
.archive-section h3 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.archive-section ul {
    list-style: none;
    padding: 0;
}

.archive-section ul li {
    margin-bottom: 8px;
}

.archive-section ul li a {
    color: #555;
    font-weight: normal;
}

.archive-section ul li a:hover {
    color: #007bff;
}

/* 存档列表页 */
.archive-list-section ul {
    list-style: none;
    padding: 0;
}

.archive-list-section ul li {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.archive-list-section ul li:last-child {
    border-bottom: none;
}

.archive-list-section ul li a {
    font-size: 1.2em;
    color: #333;
}

.archive-list-section ul li a:hover {
    color: #007bff;
}

.archive-list-section .archive-date {
    font-size: 0.9em;
    color: #888;
    margin-left: 10px;
}


/* 页脚 */
footer {
    background-color: #333;
    color: #bbb;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column; /* 小屏幕上垂直堆叠 */
    }

    .main-area, .sidebar-area {
        min-width: unset; /* 移除最小宽度限制 */
        width: 100%; /* 占据全部宽度 */
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.5em;
    }

    header nav {
        float: none;
        text-align: center;
        margin-top: 15px;
    }

    header nav ul li {
        margin: 0 10px;
    }

    .main-area, .sidebar-area {
        padding: 20px;
    }

    h1 { font-size: 2em; }
    h2 { font-size: 1.5em; }
    h3 { font-size: 1.2em; }
}

/* static/css/style.css */

/* ... (existing styles) ... */

.search-bar {
    float: right;
    margin-top: 5px; /* Adjust as needed */
    display: flex;
    align-items: center;
}

.search-bar form {
    display: flex;
}

.search-bar input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    width: 200px;
    margin-right: 5px;
}

.search-bar button[type="submit"] {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.search-bar button[type="submit"]:hover {
    background-color: #0056b3;
}

.search-unavailable {
    color: #999;
    font-size: 0.85em;
    margin-top: 10px;
    float: right;
}

/* Search Results Page Styles */
.search-results-section h1 {
    text-align: left;
    margin-bottom: 20px;
}

.search-results-list {
    list-style: none;
    padding: 0;
}

.search-result-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.search-result-item h2 {
    margin-top: 0;
    font-size: 1.6em;
}

.search-result-item h2 a {
    color: #333;
    text-decoration: none;
}

.search-result-item h2 a:hover {
    color: #007bff;
}

.search-result-item .result-date {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
}

.search-result-item .result-summary {
    color: #555;
    margin-bottom: 10px;
}

.search-result-item .result-score {
    font-size: 0.8em;
    color: #a0a0a0;
}

.error-message {
    color: red;
    font-weight: bold;
    margin-top: 20px;
}

/* 响应式调整搜索栏 */
@media (max-width: 900px) {
    .search-bar {
        float: none;
        width: 100%;
        margin-top: 15px;
        justify-content: center; /* 居中显示 */
    }
    .search-bar input[type="text"] {
        width: calc(100% - 80px); /* 适应宽度 */
    }
}
@media (max-width: 600px) {
    .search-bar input[type="text"] {
        width: calc(100% - 70px); /* 更小屏幕调整 */
        font-size: 0.8em;
    }
    .search-bar button[type="submit"] {
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

.tag-cloud {
    margin-top: 20px;
}

.tag-cloud h3 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.tag-cloud .tags {
    padding: 10px 0;
}

.tag-cloud .tags a {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 4px 10px;
    background-color: #f0f0f0;
    border-radius: 12px;
    font-size: 0.9em;
    color: #555;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
}

.tag-cloud .tags a:hover {
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

