* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    text-align: center;
}

header h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 300;
}

.sort-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.sort-controls button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sort-controls button.active {
    background: #333;
    color: white;
    border-color: #333;
}

.sort-controls button:hover {
    background: #e0e0e0;
}

.post-form, .posts-section {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.post-form h2, .posts-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 400;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #333;
}

.submit-btn, button[type="submit"] {
    background: #333;
    color: white;
    padding: 12px 24px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-right: 5px;
    margin-bottom: 5px;
}

.submit-btn:hover, button[type="submit"]:hover {
    background: #555;
}

.post {
    background: #ffffff;
    padding: 15px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.post:hover {
    background: #fafafa;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-author {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.post-time {
    color: #999;
    font-size: 12px;
}

.post-content {
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
}

.post-image {
    max-width: 100%;
    max-height: 400px;
    margin: 10px 0;
    border: 1px solid #ddd;
}

.loading {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 14px;
}

.error {
    color: #d32f2f;
    background: #ffebee;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #f8bbd9;
    font-size: 14px;
}

.success {
    color: #388e3c;
    background: #e8f5e8;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #c8e6c9;
    font-size: 14px;
}

.toolbar-btn {
    padding: 4px 10px;
    border: 1px solid #ccc;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.toolbar-btn:hover {
    background: #e8e8e8;
    border-color: #999;
}

.toolbar-btn:active {
    background: #ddd;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .post-form, .posts-section {
        padding: 15px;
    }
    
    .post {
        padding: 12px;
    }
    
    .sort-controls button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #tocContainer {
        display: none !important;
    }
    
    .text-editor-toolbar {
        padding: 6px !important;
        gap: 3px !important;
    }
    
    .toolbar-btn {
        padding: 3px 8px;
        font-size: 12px;
    }
}