﻿/* 内容页样式 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 面包屑导航 */
.breadcrumb-container {
    padding: 15px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 20px;
}

/* 文章标题 */
.article-title {
    font-size: 28px;
    line-height: 1.4;
    margin: 0 0 20px;
    color: #222;
    text-align: center;
    font-weight: 600;
}

/* 文章元信息 - 已修复居中问题 */
.article-meta-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* PC端和移动端都居中 */
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-size-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.font-size-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.font-size-btn:hover {
    background: #e0e0e0;
}

.font-size-display {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
}

/* 分享功能 */
.share-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.share-title {
    font-size: 14px;
    color: #666;
}

.share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
}

.weixin { background: #07C160; }
.weibo { background: #E6162D; }
.qq { background: #12B7F5; }
.qzone { background: #F7CE00; color: #333; }
.link { background: #666; }

/* 文章正文 - 图片响应式增强 */
.article-body {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 图片容器包装 */
.article-body img {
    /* 强制响应式 */
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    
    /* 显示优化 */
    display: block;
    margin: 15px auto;
    
    /* 防止图片变形 */
    object-fit: contain;
    
    /* 重置所有可能的内联样式 */
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    
    /* 视觉优化 */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 特别处理可能被内联样式影响的图片 */
.article-body img[style*="height"],
.article-body img[style*="width"] {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* 处理表格中的图片 */
.article-body table img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* 处理图片链接 */
.article-body a img {
    display: block;
}

.pageLink {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* 上一篇下一篇 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.nav-item {
    flex: 1;
    min-width: 200px;
}

.nav-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

/* 心情框架 */
#mood_frame {
    border: none;
    overflow: hidden;
    margin: 0;
}

/* 响应式调整 - 移动端优化 */
@media (max-width: 768px) {
    .article-title {
        font-size: 22px;
    }
    
    /* 移动端文章元信息保持水平排列并居中 */
    .article-meta-info {
        gap: 10px; /* 适当减小间距 */
        font-size: 13px; /* 稍微减小字体大小 */
    }
    
    .share-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .related-list {
        grid-template-columns: 1fr;
    }
    
    .article-navigation {
        flex-direction: column;
    }
    
    /* 移动端图片优化 - 更强制性的规则 */
    .article-body img {
        margin: 12px auto;
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
        display: block !important;
    }
    
    /* 针对移动端限制图片最大高度 */
    .article-body img {
        max-height: 50vh !important; /* 限制为视口高度的50% */
    }
}

@media (max-width: 480px) {
    .article-meta-info {
        gap: 8px; /* 进一步减小间距 */
        font-size: 12px; /* 进一步减小字体大小以适应小屏幕 */
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    /* 小屏幕图片优化 */
    .article-body img {
        margin: 10px auto;
        border-radius: 3px;
        max-height: 40vh !important; /* 在更小屏幕上进一步限制高度 */
    }
}

/* 心情容器响应式 */
@media (max-width: 600px) {
    .mood-container {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .mood-frame {
        height: 250px;
    }
}

/* 相关文章 */
.related-articles {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.related-title {
    font-size: 20px;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
    color: #333;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.related-item {
    display: block;
    padding: 15px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.related-item:hover {
    border-color: #4a90e2;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.related-item h4 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
    color: #222;
}

.related-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 字体控制样式 */
.font-control {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.font-control button {
    border: none;
    background: #ddd;
    padding: 4px 10px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 3px;
}

.font-control button:hover {
    background: #ccc;
}

#font-size-display {
    margin: 0 10px;
    font-weight: bold;
}