* {
    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;
}

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

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.8rem;
    color: #3498db;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

.btn {
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #2980b9;
    color: white;
}

.user-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 主要内容区 */
main {
    min-height: calc(100vh - 140px);
    padding: 30px 0;
}

/* 内容网格布局 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-title {
    grid-column: 1 / -1;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 帖子卡片 */
.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.post-category {
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    font-size: 0.8rem;
    display: inline-block;
    border-radius: 4px;
    margin: 15px;
}

.post-image {
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 15px;
}

.post-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.post-content h3 a {
    color: #2c3e50;
    text-decoration: none;
}

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

.post-excerpt {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #95a5a6;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.post-meta i {
    margin-right: 5px;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 认证表单 */
.auth-form {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* 帖子详情页 */
.post-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.post-header {
    margin-bottom: 25px;
}

.post-header h1 {
    font-size: 2rem;
    margin: 15px 0;
    color: #2c3e50;
}

.post-image-full {
    max-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 25px;
}

.post-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content-full {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* 评论区域 */
.comments-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
    margin-bottom: 25px;
    color: #2c3e50;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-login-prompt {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 25px;
}

.comment-login-prompt a {
    color: #3498db;
    text-decoration: none;
}

.comment-login-prompt a:hover {
    text-decoration: underline;
}

.comments-list {
    margin-top: 20px;
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.comment-author {
    font-weight: 500;
    color: #2c3e50;
}

.comment-time {
    color: #95a5a6;
}

.comment-content {
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-style: italic;
}

/* 表单按钮 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    color: white;
}

/* 提示消息 */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    text-align: center;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* 页脚 */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 25px 0;
    text-align: center;
}

footer p {
    margin: 10px 0;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .post-header h1 {
        font-size: 1.6rem;
    }
    
    .auth-form,
    .post-detail,
    .comments-section {
        padding: 20px;
    }
}