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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 1.5rem;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

header nav {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:hover {
    background: #f5f5f5;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: #333;
    color: #fff;
    border-color: #333;
}

.btn-primary:hover {
    background: #555;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.hidden {
    display: none !important;
}

/* Posts List */
.posts-list {
    list-style: none;
}

.posts-list li {
    margin-bottom: 2rem;
}

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

.posts-list h2 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.posts-list h2:hover {
    color: #666;
}

.posts-list .date {
    color: #888;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 3rem;
}

/* Single Post */
article {
    position: relative;
}

article h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

article .meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

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

article .content p {
    margin-bottom: 1.5rem;
}

article .content h2 {
    margin: 2rem 0 1rem;
}

article .content h3 {
    margin: 1.5rem 0 0.75rem;
}

article .content ul,
article .content ol {
    margin: 1rem 0 1rem 2rem;
}

article .content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

article .content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

article .content pre code {
    background: none;
    padding: 0;
}

article .content blockquote {
    border-left: 3px solid #333;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

article .content a {
    color: #0066cc;
}

/* Edit Mode */
.editing [contenteditable] {
    outline: 2px dashed #ccc;
    padding: 0.5rem;
    min-height: 1em;
}

.editing [contenteditable]:focus {
    outline-color: #333;
}

.edit-toolbar {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Status Messages */
.status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #333;
    color: #fff;
    border-radius: 4px;
    animation: fadeIn 0.3s;
}

.status.error {
    background: #dc3545;
}

.status.success {
    background: #28a745;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    article h1 {
        font-size: 1.5rem;
    }
}
