:root {
    --primary-color: #1877f2;
    --primary-text-color: #1c1e21;
    --secondary-text-color: #65676b;
    --background-color: #f0f2f5;
    --container-background: #fff;
    --border-color: #dddfe2;
    --border-radius-main: 8px;
    --box-shadow-main: 0 1px 3px rgba(0,0,0,0.1);
    --font-family-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Post Styles */
.wbp-post {
    background-color: var(--container-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-main);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow-main);
}

.wbp-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.wbp-post-header img.wbp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
}

.wbp-post-header .wbp-user-info {
    display: flex;
    flex-direction: column;
}

.wbp-post-header .wbp-user-info .wbp-username {
    font-weight: bold;
    color: var(--primary-text-color);
}

.wbp-post-header .wbp-user-info .wbp-timestamp {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}

.wbp-post-text {
    margin-bottom: 10px;
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--primary-text-color);
}

.wbp-post-footer {
    display: flex;
    justify-content: space-around;
    color: var(--secondary-text-color);
    border-top: 1px solid #e9ebee;
    padding-top: 10px;
    margin-top: 15px;
    font-size: 0.9em;
    align-items: center;
}

/* Media Styles */
.wbp-post-media {
    margin-top: 10px;
}

.wbp-post-media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wbp-post-media-grid a {
    display: block;
    flex-grow: 1;
    border-radius: var(--border-radius-main);
    overflow: hidden;
    width: calc(33.333% - 3px);
    aspect-ratio: 1 / 1;
}

.wbp-post-media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wbp-image-count-1 a { width: 100%; aspect-ratio: 16 / 10; }
.wbp-image-count-2 a, .wbp-image-count-4 a { width: calc(50% - 2px); }

.wbp-video-container video {
    width: 100%;
    border-radius: var(--border-radius-main);
    background-color: #000;
}

/* Translation Button */
.wbp-translation-controls { margin-top: 10px; }
.wbp-translate-btn {
    background-color: #e7f3ff;
    color: var(--primary-color);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: inherit;
}
.wbp-translate-btn:disabled { background-color: #f0f2f5; color: #bcc0c4; cursor: default; }

/* Comments Section & Modal (Corrected) */
.wbp-comments-section {
    margin-top: 15px;
    border-top: 1px solid #f0f2f5;
    padding-top: 10px;
}

.wbp-load-comments-btn {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    cursor: pointer;
    font-size: 0.9em;
}

.wbp-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.wbp-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 680px;
    border-radius: var(--border-radius-main);
    position: relative;
}

.wbp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.wbp-modal-header h2 { margin: 0; }

.wbp-modal-body {
    padding-top: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.wbp-close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.wbp-close-btn:hover, .wbp-close-btn:focus { color: black; }

.wbp-comment {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}
.wbp-comment:last-child { border-bottom: none; }
.wbp-comment-avatar { width: 32px; height: 32px; border-radius: 50%; margin-left: 10px; }
.wbp-comment-content { flex: 1; }
.wbp-comment-header { margin-bottom: 4px; display: flex; align-items: baseline; }
.wbp-comment-author { font-weight: bold; color: var(--primary-text-color); font-size: 0.9em; }
.wbp-comment-timestamp { font-size: 0.8em; color: var(--secondary-text-color); margin-right: 8px; }
.wbp-comment-text { font-size: 0.95em; line-height: 1.4; white-space: pre-wrap; }