* {
    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;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav a:hover {
    color: #fff;
}

.auth-state {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    color: #ccc;
}

.btn-login, .btn-logout {
    background: none;
    border: 1px solid #555;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: 0.2s;
}

.btn-login:hover, .btn-logout:hover {
    border-color: #fff;
    color: #fff;
}

.post-author {
    color: #888;
    font-size: 0.8rem;
}

.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.hero p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.btn {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn:hover {
    background: #16213e;
}

.btn-secondary {
    background: #555;
}

.btn-secondary:hover {
    background: #444;
}

.flash {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 0.95rem;
}

.flash-error {
    background: #fbe9e7;
    color: #c62828;
}

.posts {
    padding-bottom: 40px;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.post-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

.post-meta {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.post-content {
    font-size: 0.95rem;
    word-break: break-word;
    white-space: pre-wrap;
}

.post-content a {
    color: #1a73e8;
    text-decoration: underline;
    word-break: break-all;
}

.post-content a:hover {
    color: #1557b0;
}

.attachments-preview {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preview-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    cursor: pointer;
}

.post-detail {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.post-detail h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.attachments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.attachments h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #555;
}

.attachment-item {
    margin-bottom: 20px;
}

.attachment-image img {
    max-width: 100%;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #eee;
}

.attachment-video video {
    max-width: 100%;
    border-radius: 6px;
}

.attachment-audio {
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.attachment-name {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.post-form {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a1a2e;
}

.form-group input[type="file"] {
    font-size: 0.9rem;
}

.help {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

.post-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
}

.empty {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 1rem;
}

.footer {
    margin-top: auto;
    background: #1a1a2e;
    color: #888;
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.upload-progress {
    margin: 8px 0;
    font-size: 0.85rem;
    color: #666;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    width: 360px;
    max-width: 90vw;
    position: relative;
}

.modal h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.modal input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 10px;
}

.modal input:focus {
    outline: none;
    border-color: #1a1a2e;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-error {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

.btn-delete {
    background: none;
    border: 1px solid #e57373;
    color: #c62828;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    transition: 0.2s;
}

.btn-delete:hover {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    .post-card,
    .post-detail,
    .post-form {
        padding: 20px;
    }
}
