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

:root {
    --primary: #6c5ce7;
    --primary-dark: #5849c2;
    --primary-light: #a29bfe;
    --bg: #f8f9fd;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-secondary: #636e72;
    --border: #e9ecef;
    --danger: #e74c3c;
    --success: #00b894;
    --warning: #fdcb6e;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

.header {
    position: relative;
    min-height: 360px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
}

.header-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.nav-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
}

.nav-logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-user {
    color: #fff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user a {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
}

.nav-user a:hover {
    opacity: 1;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.content-section {
    padding: 30px 0;
}

.content-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    text-align: center;
}

.content-box p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.message-section {
    padding: 0 0 60px;
}

.post-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.post-input-wrap {
    margin-bottom: 12px;
}

.post-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.post-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-btn {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.upload-btn:hover {
    background: var(--border);
}

.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image {
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 6px 18px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.message-card:hover {
    transform: translateY(-2px);
}

.message-card.pending {
    opacity: 0.6;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.msg-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.msg-info {
    flex: 1;
}

.msg-author {
    font-weight: 600;
    font-size: 0.95rem;
}

.msg-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.msg-content {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 12px;
    word-break: break-word;
}

.msg-image {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 12px;
    max-height: 400px;
    object-fit: cover;
    cursor: pointer;
}

.msg-footer {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.msg-action {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.88rem;
    transition: color 0.2s;
    background: none;
    border: none;
    font-family: inherit;
}

.msg-action:hover {
    color: var(--primary);
}

.msg-action.liked {
    color: var(--danger);
}

.msg-action.voted {
    color: var(--warning);
    font-weight: 700;
}

.vote-badge {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.comment-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text);
    margin: 2px 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.comment-like-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: inherit;
}

.comment-like-btn:hover {
    color: var(--danger);
}

.comment-like-btn.liked {
    color: var(--danger);
}

.comment-delete {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.78rem;
    background: none;
    border: none;
    font-family: inherit;
}

.comment-delete:hover {
    color: var(--danger);
}

.comment-input-bar {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.comment-input-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
}

.comment-input-bar input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

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

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
}

.modal-footer input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    z-index: 2000;
    transition: transform 0.3s;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

@media (max-width: 600px) {
    .header-title {
        font-size: 2rem;
    }
    .header-subtitle {
        font-size: 1rem;
    }
    .nav-bar {
        padding: 12px 16px;
    }
    .post-actions {
        justify-content: space-between;
    }
    .msg-footer {
        gap: 12px;
    }
}
