:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cbc;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 主要内容样式 */
main {
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* 博客卡片样式 */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.blog-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: #6c757d;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.like-btn:hover {
    color: var(--primary-color);
}

.like-btn.liked {
    color: #e74c3c;
}

/* 博客详情页样式 */
.blog-detail {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.blog-header {
    margin-bottom: 1.5rem;
}

.blog-detail-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.blog-author {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.blog-content {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.blog-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* 评论区域样式 */
.comments-section {
    margin-top: 2rem;
}

.comments-header {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
    font-family: inherit;
}

.comment-list {
    list-style: none;
}

.comment-item {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: bold;
}

.comment-date {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 留言板样式 */
.message-board {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.message-content {
    text-align: center;
    padding: 3rem 0;
}

.message-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.message-content p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 表单样式 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 页脚样式 */
footer {
    background-color: white;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

.footer-content {
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-detail {
        padding: 1.5rem;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

/* 用户欢迎文字在移动端隐藏 */
.user-welcome {
    display: inline;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links.mobile-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow);
        padding: 1rem 0;
    }

    .nav-links.mobile-menu.active {
        display: flex;
    }

    .nav-links.mobile-menu li {
        margin: 0;
        width: 100%;
    }

    .nav-links.mobile-menu a {
        display: block;
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.mobile-menu a:hover {
        background-color: var(--light-gray);
    }

    .user-welcome {
        display: none;
    }

    .user-info .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}