/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

header nav span {
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn:hover {
    background-color: #45a049;
}

/* 消息样式 */
.message {
    background-color: #f0f8ff;
    border: 1px solid #b0e0e6;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #0066cc;
}

/* 帖子表单样式 */
.post-form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.post-form h2 {
    margin-bottom: 15px;
    color: #333;
}

/* 帖子样式 */
.posts h2 {
    margin-bottom: 20px;
    color: #333;
}

.post {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.post-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.post-info p {
    font-size: 14px;
    color: #666;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-image {
    margin-bottom: 15px;
}

.post-image img {
    max-width: 100%;
    border-radius: 4px;
}

.post-actions {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.post-actions a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.post-actions a:hover {
    text-decoration: underline;
}

/* 评论样式 */
.comments h2 {
    margin-bottom: 20px;
    color: #333;
}

.comment-form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.comment {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-header .avatar {
    width: 40px;
    height: 40px;
}

.comment-info h4 {
    font-size: 16px;
    margin-bottom: 3px;
}

.comment-info p {
    font-size: 12px;
    color: #666;
}

.comment-content {
    line-height: 1.6;
}

/* 登录和注册页面样式 */
.container h1 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.container form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.container p {
    margin-top: 20px;
    text-align: center;
}

.container p a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.container p a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    header nav {
        justify-content: center;
    }
    
    .post-header,
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .avatar {
        margin-right: 0;
    }
}