/* 袁氏家谱网 - 统一样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    color: #333;
    background: #fff;
    width: 100%;
    margin:0
}

/* 主容器 */
.wp,.wrap, .main-content {
    width: 98%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height:100vh;
}

/* 头部 */
.header {
    background:linear-gradient(135deg,#f5f5f5,#2dcfff);color:#444;padding:25px;border-radius:8px;margin-bottom:25px;
    color: #666;
    padding: 15px 20px;
    width: 100%;
}
.header h1 {
    margin: 0;
    font-size: 1.6em;
    margin:0 0 12px 0
}
.header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: normal;
    color: #666;
    margin:0 0 12px 0
}
.header a {
    color: #666;
    text-decoration: none;
}
.header a:hover {
    text-decoration: none;
    color: #bbb;
}
.header p{margin:5px 0;opacity:.9;font-size:.9em}
/* 当前位置导航 - 浅色简洁版 */
.current-nav {
    background: #fafafa;
    padding: 6px 15px;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.current-nav a {
    color: #8b3e1f;
    text-decoration: none;
}
.current-nav a:hover {
    text-decoration: underline;
}
.current-nav .sep {
    margin: 0 8px;
    color: #ccc;
}

/* 栏目导航 */
.category-nav {
    margin-bottom: 20px;
}
.category-section {
    background: #fff;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.category-section h2 {
    margin: 0 0 10px 0;
    color: #8b3e1f;
    border-left: 3px solid #8b3e1f;
    padding-left: 10px;
    font-size: 1.1rem;
}
.board-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.board-link {
    background: #f5f5f5;
    padding: 5px 12px;
    border-radius: 4px;
}
.board-link a {
    color: #555;
    text-decoration: none;
}
.board-link a:hover {
    color: #8b3e1f;
}

/* 最新主题 */
.latest-topics {
    margin-top: 30px;
}
.latest-topics h2 {
    color: #8b3e1f;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.topic-item {
    background: #fafafa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eee;
}
.topic-item.digest {
    background: #fff8f0;
    border-left: 3px solid #e6a017;
}
.topic-item h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}
.topic-item h3 a {
    color: #333;
    text-decoration: none;
}
.topic-item h3 a:hover {
    color: #8b3e1f;
}
.topic-meta {
    font-size: 12px;
    color: #aaa;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.digest-badge {
    display: inline-block;
    background: #e6a017;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* 文章内容图片样式 */
.article-content {
    line-height: 1.8;
    font-size: 16px;
    text-align: left;
      /* 至少占满整个视口高度 */
  min-height: 100vh; 
  /* 可选：给容器加个背景色或内边距 */
  background-color: #f9f9f9;
  padding: 5px;
  box-sizing: border-box;
}
.article-content h1 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #8b3e1f;
    text-align: left;
}
.article-meta {
    color: #aaa;
    font-size: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    text-align: left;
}
.article-content p {
    margin: 0.8em 0;
    text-indent: 2em;
    text-align: left;
}
/* 1. 统一的基础图片样式 */
.article-content img {
    max-width: 80%;
    height: auto;
    display: block;         /* 核心修改：改为 block，让 margin: auto 生效 */
    margin: 10px auto;      /* 核心修改：左右改为 auto，实现完美居中 */
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    object-fit: contain;
    box-sizing: border-box; /* 加上这个，防止边框把图片撑出 80% */
}

/* 2. 多张图片并排显示（覆盖上面的居中样式） */
/* 两张图并排 */
.article-content img:first-child:nth-last-child(2),
.article-content img:first-child:nth-last-child(2) ~ img {
    display: inline-block;  /* 并排时改回 inline-block */
    max-width: 45%;
    margin: 10px 1%;        /* 恢复左右 1% 的间距 */
}

/* 三张图并排 */
.article-content img:first-child:nth-last-child(3),
.article-content img:first-child:nth-last-child(3) ~ img {
    display: inline-block;
    max-width: 30%;
    margin: 10px 1%;
}

/* 3. 段落内的图片 */
.article-content p img {
    display: inline-block;
    margin: 5px 1%;
}

/* 4. 段落内单张图片居中（现在可以完美生效了） */
.article-content p img:only-child {
    display: block;         /* 块级元素 */
    max-width: 80%;
    margin: 15px auto;      /* 左右自动分配空间，实现居中 */
}

/* 文章内容中单独一行（不换段落）的图片 */
.article-content br + img {
    display: inline-block;
}

/* 分页样式 - 淡化 */
.pagination {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    text-decoration: none;
    color: #8b3e1f;
    background: #fff;
    font-size: 13px;
}
.pagination a:hover {
    background: #f5f0eb;
    border-color: #d0c0b0;
    color: #8b3e1f;
}
.pagination .current {
    background: #f0e8e0;
    color: #8b3e1f;
    border-color: #d0c0b0;
}

/* 回复列表 - 淡化 */
.replies-container {
    margin-top: 30px;
}
.replies-container h3 {
    color: #aaa;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: normal;
}
.reply-item {
    background: #fafafa;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid #eee;
}
.reply-meta {
    color: #bbb;
    font-size: 12px;
    margin-bottom: 8px;
}
.reply-item .reply-content {
    color: #555;
    line-height: 1.7;
}
.reply-item .reply-content p {
    margin: 0.5em 0;
}

/* 上一篇/下一篇 - 淡化 */
.prev-next-links {
    margin: 20px 0;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #eee;
}
.prev-next-item {
    margin: 5px 0;
}
.prev-next-item .label {
    font-weight: normal;
    color: #aaa;
}
.prev-next-item a {
    color: #8b3e1f;
    text-decoration: none;
}
.prev-next-item a:hover {
    text-decoration: underline;
}

/* 返回列表按钮 - 淡化 */
.back-to-list {
    display: inline-block;
    padding: 6px 18px;
    background: #f0f0f0;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 13px;
}
.back-to-list:hover {
    background: #e8e0d8;
    color: #8b3e1f;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 15px;    
    color: #bbb;
    border-top: 1px solid #eee;
    margin-top: 30px;
    font-size:.85em;
    clear:both
}
.footer a {
    color: #bbb;
    text-decoration: none;
}
.footer a:hover {
    color: #8b3e1f;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wp, .wrap, .main-content {
        padding: 10px;
    }
    
 .header{padding:18px}.header h1{font-size:1.3em}.postbox{padding:12px}
    
    .topic-meta {
        flex-direction: column;
        gap: 5px;
    }
    .board-links {
        flex-direction: column;
    }
    .article-content h1 {
        font-size: 1.3rem;
    }
    .article-content {
        font-size: 14px;
    }
    .pagination a, .pagination span {
        padding: 3px 8px;
        font-size: 12px;
    }
    .current-nav {
        padding: 4px 10px;
        font-size: 11px;
    }
    /* 手机端：图片独占一行 */
    .article-content img,
    .article-content img:first-child:nth-last-child(2),
    .article-content img:first-child:nth-last-child(2) ~ img,
    .article-content img:first-child:nth-last-child(3),
    .article-content img:first-child:nth-last-child(3) ~ img {
        display: block;
        max-width: 90%;
        margin: 15px auto;
    }
}

.postbox{background:#fff;padding:20px;margin-bottom:15px;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.08);border:1px solid #eee}
.posthead{color:#666;margin-bottom:12px;padding-bottom:8px;border-bottom:1px dashed #e0e0e0;font-size:.9em}
.posthead span{margin-right:15px}
.posthead .author{font-weight:bold;color:#333}
.posthead .floor{background:#667eea;color:#fff;padding:2px 8px;border-radius:10px;font-size:.85em}
.postcontent{color:#333;word-wrap:break-word;min-height:100vh;font-size: 15px;line-height: 1.8;}
.postcontent img{max-width:100%;height:auto;border-radius:4px;min-height: 100vh}
.postcontent p{text-indent:2rem;margin:0 0 1em 0}

.breadcrumb{margin-bottom:15px;padding:8px 12px;background:#f5f5f5;border-radius:4px;font-size:.9em}
.breadcrumb a{color:#667eea;text-decoration:none}
