/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

a:hover {
    color: #6c757d;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.nav ul {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav a.active {
    color: #6c757d;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #6c757d;
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

/* 主要内容区 */
.main {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* 文章卡片 */
.post-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-title a {
    color: #333;
}

.post-title a:hover {
    color: #6c757d;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    color: #6c757d;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.read-more:hover {
    color: #333;
    border-bottom-color: #6c757d;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile {
    background-color: #fff;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #f8f9fa;
}

.profile h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.profile p {
    color: #888;
    font-size: 0.9rem;
}

.category {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.category ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category a {
    color: #666;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.category a:hover {
    color: #333;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.back-to-top:hover {
    background-color: #6c757d;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav ul {
        gap: 1rem;
    }

    .post-img img {
        height: 200px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}