* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f5f5f5; color: #333; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: #333; }
.btn { display: inline-block; padding: 10px 20px; background: #007bff; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn:hover { background: #0056b3; }
.btn.secondary { background: #6c757d; }
.btn.secondary:hover { background: #545b62; }
.btn.small { padding: 5px 15px; font-size: 12px; }
.alert { padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.alert.error { background: #f8d7da; color: #721c24; }
.alert.success { background: #d4edda; color: #155724; }

header { background: #fff; border-bottom: 1px solid #ddd; padding: 15px 0; }
header .container { display: flex; justify-content: space-between; align-items: center; }
header .logo h1 { font-size: 24px; }
header .logo a { color: #007bff; }
header nav ul { list-style: none; display: flex; }
header nav li { margin-left: 20px; }
header nav a { color: #333; }
header nav a:hover, header nav a.active { color: #007bff; }
header .user-menu { display: flex; align-items: center; }
header .user-menu a { margin-left: 20px; }
header .user-menu .avatar img { width: 32px; height: 32px; border-radius: 50%; }

.main { display: flex; gap: 30px; margin-top: 30px; }
.main .left { flex: 1; }
.main .right { width: 300px; }
.main.single { justify-content: center; }
.main.single > * { flex: none; }

.filter-bar { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.filter-bar span { color: #666; }
.filter-bar a { padding: 5px 15px; background: #fff; border: 1px solid #ddd; border-radius: 4px; }
.filter-bar a.active { background: #007bff; color: #fff; border-color: #007bff; }

.posts { background: #fff; border-radius: 8px; padding: 20px; }
.post-item { padding: 20px; border-bottom: 1px solid #eee; }
.post-item:last-child { border-bottom: none; }
.post-item .post-header { margin-bottom: 10px; }
.post-item .category { color: #007bff; font-size: 12px; }
.post-item .badge { font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-left: 5px; }
.post-item .badge.top { background: #dc3545; color: #fff; }
.post-item .badge.essence { background: #ffc107; color: #000; }
.post-item h2 { font-size: 18px; margin-bottom: 10px; }
.post-item h2 a { color: #333; }
.post-item h2 a:hover { color: #007bff; }
.post-item .post-content { color: #666; font-size: 14px; line-height: 1.6; }
.post-item .post-footer { display: flex; align-items: center; gap: 20px; margin-top: 15px; color: #999; font-size: 14px; }
.post-item .author img { width: 24px; height: 24px; border-radius: 50%; margin-right: 8px; }
.post-item .likes { color: #dc3545; }

.pagination { display: flex; justify-content: center; margin-top: 20px; gap: 10px; }
.pagination a { padding: 8px 15px; background: #fff; border: 1px solid #ddd; border-radius: 4px; }
.pagination a.active { background: #007bff; color: #fff; border-color: #007bff; }

.widget { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.widget h3 { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.widget ul { list-style: none; }
.widget li { margin-bottom: 10px; }
.widget li a { color: #333; }
.widget li a:hover { color: #007bff; }
.widget .stats { display: flex; justify-content: space-between; }
.widget .stats div { text-align: center; }
.widget .stats .number { font-size: 24px; font-weight: bold; color: #007bff; }
.widget .stats .label { display: block; color: #999; font-size: 14px; }

.auth-container { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 400px; }
.auth-box h2 { text-align: center; margin-bottom: 30px; }
.auth-box .form-group { margin-bottom: 20px; }
.auth-box .form-group label { display: block; margin-bottom: 8px; }
.auth-box .form-group input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.auth-box .btn { width: 100%; padding: 12px; font-size: 16px; }
.auth-box .link { text-align: center; margin-top: 20px; }
.auth-box .link a { color: #007bff; }

.post-detail { background: #fff; border-radius: 8px; padding: 30px; margin-bottom: 30px; }
.post-detail .post-header { margin-bottom: 15px; }
.post-detail h1 { font-size: 28px; margin-bottom: 20px; line-height: 1.4; }
.post-detail .post-meta { display: flex; align-items: center; gap: 20px; color: #999; margin-bottom: 25px; }
.post-detail .post-meta .author img { width: 36px; height: 36px; border-radius: 50%; margin-right: 10px; }
.post-detail .post-body { line-height: 1.8; font-size: 16px; color: #444; }
.post-detail .post-actions { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; }
.post-detail .like-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 1px solid #dc3545; color: #dc3545; border-radius: 4px; }
.post-detail .like-btn:hover, .post-detail .like-btn.liked { background: #dc3545; color: #fff; }
.post-detail .edit-btn { margin-left: 15px; color: #666; }

.comments-section { background: #fff; border-radius: 8px; padding: 30px; }
.comments-section h3 { margin-bottom: 20px; }
.comment-form textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 4px; resize: vertical; margin-bottom: 15px; }
.comment-item { padding: 20px; border-bottom: 1px solid #eee; }
.comment-item:last-child { border-bottom: none; }
.comment-item .comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.comment-item .comment-header .author img { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; }
.comment-item .comment-header .time { color: #999; font-size: 14px; }
.comment-item .comment-content { color: #444; line-height: 1.6; }

.publish-form { background: #fff; border-radius: 8px; padding: 30px; max-width: 900px; width: 100%; }
.publish-form h2 { margin-bottom: 30px; }
.publish-form .form-group { margin-bottom: 20px; }
.publish-form .form-group label { display: block; margin-bottom: 8px; }
.publish-form .form-group input, .publish-form .form-group textarea, .publish-form .form-group select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.publish-form .form-group textarea { resize: vertical; min-height: 200px; }

.profile { background: #fff; border-radius: 8px; padding: 30px; }
.profile-header { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #eee; }
.profile-header .avatar { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; }
.profile-header .info h2 { font-size: 24px; margin-bottom: 10px; }
.profile-header .level, .profile-header .points { color: #666; margin-bottom: 5px; }
.profile-header .signature { color: #888; margin-top: 10px; }
.profile-header .stats { display: flex; gap: 40px; margin: 20px 0; }
.profile-header .stats div { text-align: center; }
.profile-header .stats div span:first-child { display: block; font-size: 24px; font-weight: bold; color: #007bff; }
.profile-header .stats div span:last-child { color: #666; }

.edit-form { background: #fff; border-radius: 8px; padding: 30px; max-width: 600px; margin: 0 auto; }
.edit-form .form-group { margin-bottom: 20px; }
.edit-form .form-group label { display: block; margin-bottom: 8px; }
.edit-form .form-group input, .edit-form .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; }
.edit-form .preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }

.messages-page { background: #fff; border-radius: 8px; padding: 30px; max-width: 800px; margin: 0 auto; }
.messages-page h2 { margin-bottom: 20px; }
.conversation-item { display: flex; align-items: center; gap: 15px; padding: 15px; border-bottom: 1px solid #eee; }
.conversation-item:hover { background: #f9f9f9; }
.conversation-item img { width: 50px; height: 50px; border-radius: 50%; }
.conversation-item .info h4 { margin-bottom: 5px; }
.conversation-item .info p { color: #666; font-size: 14px; }
.conversation-item .meta { margin-left: auto; text-align: right; }
.conversation-item .time { color: #999; font-size: 12px; }
.conversation-item .badge.unread { background: #dc3545; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }

.chat-page { background: #fff; border-radius: 8px; padding: 20px; max-width: 800px; margin: 0 auto; }
.chat-header { display: flex; align-items: center; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.chat-header .back { color: #007bff; }
.chat-header img { width: 48px; height: 48px; border-radius: 50%; }
.chat-messages { height: 400px; overflow-y: auto; padding: 20px 0; }
.message { display: flex; gap: 12px; margin-bottom: 20px; }
.message.sent { flex-direction: row-reverse; }
.message.sent .content { background: #007bff; color: #fff; border-radius: 12px 0 12px 12px; }
.message.received .content { background: #f5f5f5; border-radius: 0 12px 12px 12px; }
.message img { width: 40px; height: 40px; border-radius: 50%; }
.message .content { max-width: 70%; padding: 12px 16px; }
.message .content p { margin-bottom: 5px; }
.message .time { font-size: 12px; opacity: 0.7; }
.chat-form textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 4px; resize: vertical; margin-bottom: 15px; }

footer { background: #fff; border-top: 1px solid #ddd; padding: 30px 0; margin-top: 50px; text-align: center; color: #999; }

@media (max-width: 768px) {
    header .container { flex-direction: column; gap: 15px; }
    header nav ul { flex-wrap: wrap; justify-content: center; }
    header nav li { margin: 5px 10px; }
    header .user-menu { margin-top: 10px; }
    .main { flex-direction: column; }
    .main .right { width: 100%; }
    .post-detail h1 { font-size: 22px; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-header .stats { justify-content: center; }
    .auth-box { width: 90%; padding: 20px; }
}