/**
 * 前台通用样式
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* 布局容器 */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    text-decoration: none;
    color: #333;
}

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

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
}

.nav a:hover,
.nav a.active {
    color: #3498db;
}

/* 主内容区 */
.main {
    flex: 1;
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* 内容区 */
.content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 文章卡片 */
.post {
    padding-bottom: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.post-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-excerpt {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.read-more:hover {
    color: #2980b9;
}

/* 文章详情页 */
.article-detail {
    padding-bottom: 30px;
}

.article-title {
    font-size: 32px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 20px;
    color: #999;
    font-size: 14px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.article-tags strong {
    font-weight: 600;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e9ecef;
    border-radius: 15px;
    font-size: 14px;
    color: #666;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #3498db;
}

/* 边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* 搜索表单 */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-form button {
    padding: 10px 15px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #2980b9;
}

/* 分类列表 */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.category-list a:hover {
    color: #3498db;
}

.category-list span {
    color: #999;
    font-size: 14px;
}

/* 热门文章 */
.hot-articles {
    list-style: none;
}

.hot-articles li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eee;
}

.hot-articles li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.hot-articles a {
    color: #666;
    text-decoration: none;
    display: block;
    transition: color 0.3s;
}

.hot-articles a:hover {
    color: #3498db;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination span.current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin-bottom: 20px;
}

/* 底部 */
.footer {
    background: #333;
    color: #fff;
    padding: 30px 0;
    margin-top: auto;
}

.footer .container {
    text-align: center;
}

.footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .article-title {
        font-size: 24px;
    }
}
