/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.clear {
    clear: both;
}

.clear:after {
    content: "";
    display: table;
    clear: both;
}

.box {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.whitebg {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blank {
    height: 20px;
}

/* 头部样式 */
header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.logo-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo img {
    max-height: 60px;
}

.search form {
    display: flex;
    gap: 10px;
}

.input_text {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.input_submit {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input_submit:hover {
    background: #0056b3;
}

/* 导航样式 */
.topnav {
    background: #2c3e50;
    padding: 0;
}

.topnav h2 {
    display: none;
}

/* 导航与内容对齐的容器 */
.topnav nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.navbar {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-item {
    border-right: 1px solid #34495e;
}

.navbar-item:last-child {
    border-right: none;
}

.navbar-item a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s;
}

.navbar-item a:hover {
    background: #34495e;
}

/* 主内容区域 */
article {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    padding: 0 15px;
}

.left-box {
    flex: 1;
}

.right-box {
    width: 300px;
}

/* 博客列表样式 */
.blogs-box {
    padding: 20px;
    margin-bottom: 20px;
}

.news-title h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

.blogs-list ul {
    list-style: none;
}

.blogs-list li {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.blogs-list li:last-child {
    border-bottom: none;
}

.blogs-list li i {
    flex-shrink: 0;
}

.blogs-list li i img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.blogs-list li div {
    flex: 1;
}

.blogs-list li h2 {
    font-size: 16px;
    margin-bottom: 8px;
}

.blogs-list li h2 a {
    color: #333;
    text-decoration: none;
}

.blogs-list li h2 a:hover {
    color: #007bff;
}

.blogs-list li span {
    color: #666;
    font-size: 12px;
}

/* 分页样式 */
.pagelist {
    text-align: center;
    padding: 20px 0;
}

.pagelist a, .pagelist b {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
}

.pagelist b {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagelist a:hover {
    background: #f8f9fa;
}

.pagelist .page-info {
    margin-left: 15px;
    color: #666;
    font-size: 12px;
}

/* 侧边栏样式 */
.widget {
    margin-bottom: 20px;
    padding: 20px;
}

.side-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #333;
    text-decoration: none;
}

.widget a:hover {
    color: #007bff;
}

/* 推荐内容样式 */
.topnews {
    margin-bottom: 15px;
}

.topnews img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.modMenu li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.modMenu li:last-child {
    border-bottom: none;
}

.modMenu .l-i {
    flex-shrink: 0;
    width: 40px;
}

.modMenu .l-i img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.modMenu .l-i .date {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    display: block;
    text-align: center;
}

.modMenu a {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
}

.modMenu a:hover {
    color: #007bff;
}

/* 猜你喜欢样式 */
.recommend .topnews li {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    transition: all 0.3s;
}

.recommend .topnews li:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.recommend .topnews a {
    display: block;
    text-decoration: none;
}

.recommend .topnews h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.recommend .topnews a:hover h3 {
    color: #007bff;
}

.recommend .topnews .date {
    color: #999;
    font-size: 11px;
}

/* 标签云样式 */
.cloud a {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
}

.cloud a:hover {
    background: #007bff;
    color: white;
}

/* 友情链接样式 */
.aslinks ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.link-item a {
    display: block;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

.link-item a:hover {
    background: #007bff;
    color: white;
}

/* 底部样式 */
footer {
    background: #2c3e50;
    color: #fff;
    margin-top: 40px;
    padding: 30px 0;
}

.footer {
    text-align: center;
}

.footer a {
    color: #bdc3c7;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

/* 搜索页面样式 */
.search-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.is-search {
    display: none;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    
    .topnav h2 {
        display: block;
        padding: 15px 20px;
        color: #fff;
        background: #2c3e50;
    }
    
    #mnavh {
        display: block;
        cursor: pointer;
    }
    
    article {
        flex-direction: column;
    }
    
    .right-box {
        width: 100%;
    }
    
    .blogs-list li {
        flex-direction: column;
    }
    
    .blogs-list li i img {
        width: 100%;
        height: 200px;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 15px;
    }
}

/* 搜索排行样式 */
.search-paihang li a {
    display: flex;
    align-items: center;
    padding: 8px 15px 8px 0;
    position: relative;
}

.search-paihang i {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.search-paihang span {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 15px;
}

.search-paihang .date {
    color: #999;
    font-size: 11px;
    position: absolute;
    right: 0;
    flex-shrink: 0;
}

/* 文章详情页样式 */
.article-detail {
    padding: 20px;
    margin-bottom: 20px;
}

.article-header {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.article-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
}

.article-meta {
    color: #666;
    font-size: 14px;
}

.article-meta span {
    margin-right: 20px;
}

.article-content {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
}

.article-content * {
    max-width: 100% !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content div {
    max-width: 100%;
    overflow-wrap: break-word;
}

.article-content br {
    display: block;
    margin: 5px 0;
}

/* 数据表格样式 - 防止溢出 */
.data-table {
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
    table-layout: fixed;
}

.data-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    word-wrap: break-word;
    overflow: hidden;
}

.data-label {
    min-width: 120px;
    width: 120px;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
    word-wrap: break-word;
}

.data-value {
    flex: 1;
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: calc(100% - 130px);
    overflow: hidden;
}

/* 文章标签 */
.article-tags {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
}

.article-tags h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.tags-list .tag {
    display: inline-block;
    padding: 4px 8px;
    margin: 0 5px 5px 0;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
}

.tags-list .tag:hover {
    background: #e0e0e0;
}

/* 文章操作 */
.article-actions {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
}

.share-btn:hover {
    background: #e0e0e0;
}

.article-operations button {
    padding: 5px 10px;
    margin-left: 10px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 3px;
}

.article-operations button:hover {
    background: #f0f0f0;
}

/* 相关推荐 */
.related-articles {
    padding: 20px;
    margin-bottom: 20px;
}

.related-articles h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.related-list {
    list-style: none;
}

.related-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.related-list a {
    color: #333;
    text-decoration: none;
    flex: 1;
    margin-right: 10px;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-list a:hover {
    color: #007acc;
}

.related-date {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

/* 上下页导航 - 左右布局 */
.page-navigation {
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.prev-page, .next-page {
    flex: 1;
    max-width: 48%;
}

.prev-page {
    text-align: left;
}

.next-page {
    text-align: right;
}

.prev-page a, .next-page a {
    color: #007acc;
    text-decoration: none;
    word-wrap: break-word;
    display: block;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.prev-page a:hover, .next-page a:hover {
    text-decoration: none;
    background: #f0f0f0;
    border-color: #007acc;
}

.prev-page span, .next-page span {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

/* 面包屑导航 */
.breadcrumb {
    background: #f8f8f8;
    padding: 10px 0;
    font-size: 14px;
}

.breadcrumb a {
    color: #007acc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .article-detail {
        padding: 15px;
    }
    
    .article-header h1 {
        font-size: 20px;
    }
    
    .article-content {
        font-size: 14px;
    }
    
    .data-row {
        flex-direction: column;
    }
    
    .data-label {
        min-width: auto;
        width: auto;
        margin-bottom: 5px;
    }
    
    .data-value {
        max-width: 100%;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .share-buttons {
        width: 100%;
    }
    
    /* 移动端上下页导航调整 */
    .page-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .prev-page, .next-page {
        max-width: 100%;
        text-align: left;
    }
}
