/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-item {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-item:hover,
.nav-item.active {
    color: #3498db;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    transition: 0.3s;
}

/* 主要内容区样式 */
main {
    margin-top: 70px;
    padding: 2rem;
}

/* 头部横幅样式 */
.hero {
    position: relative;
    height: 400px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 3rem;
    overflow: hidden;
    border-radius: 10px;
}

.hero-content {
    z-index: 1;
    padding: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

/* 文章卡片样式 */
.latest-posts {
    margin-bottom: 3rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.post-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1rem;
}

.post-meta {
    font-size: 0.875rem;
    color: #999;
}

/* 技术标签样式 */
.tech-tags {
    margin-bottom: 3rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: #fff;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tag:hover {
    background-color: #2980b9;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background-color 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: #2980b9;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: #2c3e50;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        gap: 0;
        display: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        padding: 1rem;
        border-bottom: 1px solid #eee;
    }

    .hero {
        height: 300px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    main {
        padding: 1rem;
    }
} 