/*
Theme Name: SEO13
Description: 极简自适应SEO主题 · 自动缩略图 · 百度SEO优化
Version: 3.1（手机端宽度优化）
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f7f8fa;
    color: #333;
    line-height: 1.8;
}

/* 容器：手机端更宽松 */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 12px; /* 手机端内边距缩小，更宽 */
}

a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #0066cc;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* 头部 */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 99;
}

.logo {
    font-size: 24px;
    font-weight: 600;
}

/* 导航 */
.nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 10px;
}

.nav a {
    font-size: 15px;
    font-weight: 500;
}

/* 两栏布局：手机端自动单列、全屏 */
.main-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.content {
    flex: 1;
    min-width: 680px;
}

.sidebar {
    width: 300px;
}

/* 手机端（≤991px）：单列、全屏、无最小宽度限制 */
@media (max-width: 991px) {
    .content, .sidebar {
        min-width: 100%;
        width: 100%;
    }
    .main-wrapper {
        gap: 16px;
        margin: 16px 0;
    }
}

/* 首页文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.article-thumb {
    width: 240px;
    height: 160px;
    object-fit: cover;
}

.article-info {
    flex: 1;
    padding: 20px;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.5;
}

.article-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}

/* 手机端文章卡片：单列、更紧凑 */
@media (max-width: 768px) {
    .article-item {
        flex-direction: column;
        gap: 0;
    }
    .article-thumb {
        width: 100%;
        height: 180px;
    }
    .article-info {
        padding: 16px;
    }
}

/* 侧边栏：手机端更紧凑 */
.widget {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.widget h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
}

/* 文章详情页：手机端内边距缩小、更宽 */
.single {
    background: #fff;
    padding: 24px; /* 手机端内边距缩小，内容更宽 */
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
}

.single h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
    color: #222;
}

.single-content {
    font-size: 16px;
    line-height: 1.9;
    color: #333;
}

.single-content p {
    margin-bottom: 1.2em;
}

.single-content h2 {
    font-size: 20px;
    margin: 1.4em 0 0.7em;
    font-weight: 600;
}

.single-content h3 {
    font-size: 18px;
    margin: 1.2em 0 0.6em;
    font-weight: 600;
}

.single-content img {
    margin: 1.2em 0;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.single-content blockquote {
    margin: 1.5em 0;
    padding: 14px 18px;
    background: #f7f8fa;
    border-left: 4px solid #0066cc;
    border-radius: 0 6px 6px 0;
    color: #555;
}

.single-content code {
    background: #f2f2f2;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 14px;
}

.single-content pre {
    background: #2d2d2d;
    color: #ccc;
    padding: 14px;
    overflow-x: auto;
    margin: 1.2em 0;
    border-radius: 8px;
    font-family: Consolas, monospace;
    font-size: 14px;
}

/* 上下篇：手机端更紧凑 */
.post-nav {
    margin: 30px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 15px;
}

.post-nav a {
    color: #0066cc;
    font-weight: 500;
}

/* 相关文章：手机端列数更合理 */
.related-posts {
    margin-top: 30px;
}

.related-posts h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.related-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s;
}

.related-item:hover {
    transform: translateY(-3px);
}

.related-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.related-title {
    padding: 8px;
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
}

/* 手机端相关文章：3列 → 2列，更宽松 */
@media (max-width: 991px) {
    .related-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 576px) {
    .related-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 404 */
.page-404 {
    text-align: center;
    padding: 60px 20px;
}

.page-404 h2 {
    font-size: 30px;
    margin-bottom: 16px;
}

/* 底部 */
footer {
    background: #fff;
    padding: 22px 0;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    font-size: 14px;
    color: #666;
}
/* 容器：手机端进一步加宽 */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 8px; /* 从12px改为8px，手机端更宽 */
}

/* 文章详情页：手机端极致优化宽度 */
.single {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
}

/* 手机端（≤768px）专属优化 */
@media (max-width: 768px) {
    .single {
        padding: 6px; /* 手机端内边距缩小，内容更宽 */
    }
    .single h1 {
        font-size: 22px; /* 手机端标题稍小，避免换行 */
        margin-bottom: 6px;
    }
    .single-content {
        font-size: 15px; /* 正文稍小，一行容纳更多字 */
        line-height: 1.8;
    }
    .single-content h2 {
        font-size: 19px;
    }
    .single-content h3 {
        font-size: 17px;
    }
}
/* 列表分页样式 */
.pagination {
  text-align: center;
  margin: 30px 0;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  margin: 0 3px;
}
.pagination .current {
  background: #a67c52;
  color: #fff;
  border-color: #a67c52;
}

/* 内容页上下篇样式 */
.single-nav {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
}
.single-nav a {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}