/* 现代博客优化样式 - Flexbox布局 */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f0f2f5;
    min-height: 100vh;
}

/* 头部 */
#header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.site-name {
    font-size: 2.5em;
    font-weight: 700;
    color: #fff !important;
}

/* Flexbox 布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

#main {
    flex: 0 0 70%;
    max-width: 70%;
    padding: 0 10px;
    padding-bottom: 40px;
}

#secondary {
    flex: 0 0 28%;
    max-width: 28%;
    padding: 0 10px;
    margin-left: 2%;
    font-size: 15px;
}

/* 文章卡片 */
.post {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.post-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 12px;
}

.post-title a { color: #333; text-decoration: none; }
.post-title a:hover { color: #667eea; }

.post-meta {
    color: #888;
    font-size: 0.85em;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* 文章内容截断 */
.post-content {
    max-height: 280px;
    overflow: hidden;
    position: relative;
}

.post-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, #fff);
}

/* 阅读更多按钮 */
.post-read-more { text-align: center; margin: 18px 0; }

.post-read-more a {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.post-read-more a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 右边栏 */
.widget {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.widget-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.widget-list { list-style: none; padding: 0; margin: 0; }

.widget-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1em;
}

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

.widget-list a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1em;
}

.widget-list a:hover { color: #667eea; }

/* 底部 */
#footer {
    background: #1a1a2e;
    color: #888;
    padding: 30px 0;
    margin-top: 0;
    text-align: center;
    clear: both;
}

/* 分页 */
#page-navi { text-align: center; margin: 30px 0; }

#page-navi a, #page-navi span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 4px;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

#page-navi a:hover {
    background: #667eea;
    color: #fff;
}

/* 移动端 */
@media (max-width: 768px) {
    .row { flex-direction: column; }
    #main, #secondary { max-width: 100%; flex: 100%; margin-left: 0; }
    #secondary { font-size: 14px; }
    .post { padding: 20px; border-radius: 12px; }
    .post-title { font-size: 1.3em; }
    #header { padding: 25px 0; }
    .site-name { font-size: 1.6em; }
    .widget { margin-top: 20px; }
}

/* 代码高亮 */
pre[class*="language-"] {
    background: #282c34 !important;
    border-radius: 12px;
}
