/* ============================================
   COMPOXER BLOG — Professional Social Design
   Same colors as main app, simplified UX
   ============================================ */

/* --- Blog Page Base --- */
/* Override global body height/overflow so the page scrolls normally */
body.blog-page {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.blog-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* --- Blog Main --- */
.blog-main {
    flex: 1;
    padding-top: 72px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* --- User Profile Section --- */
.user-profile-section {
    flex-shrink: 0;
    padding: 48px 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile-card {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.user-profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-avatar svg {
    color: rgba(255, 255, 255, 0.4);
}

.user-profile-info {
    flex: 1;
    min-width: 0;
}

.user-profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-profile-name {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}

.profile-edit-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.profile-edit-inline-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
}

.user-profile-username {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 12px;
}

.user-profile-bio {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0 0 12px;
}

.user-profile-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.profile-meta-item svg {
    opacity: 0.7;
}

/* Profile Owner Actions */
.user-profile-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.profile-action-btn.profile-action-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.profile-action-btn.profile-action-primary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
}

/* --- Blog Feed Section --- */
.blog-feed-section {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 32px 24px 80px;
}

.blog-feed-container {
    max-width: 680px;
    margin: 0 auto;
}

/* --- Loading State --- */
.blog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    color: rgba(255, 255, 255, 0.4);
}

.blog-loading p {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    margin: 0;
}

.blog-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Empty State --- */
.blog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
}

.blog-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.blog-empty-icon svg {
    color: rgba(255, 255, 255, 0.2);
}

.blog-empty h3 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.blog-empty p {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.blog-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-empty-cta:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
}

/* --- Posts Feed --- */
.blog-posts-feed {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

/* --- Post Card (Social Media Style) --- */
.post-card {
    background: var(--bg-secondary);
    padding: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.post-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.post-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.post-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-avatar svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
}

.post-card-author {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.post-card-author-name {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.post-card-meta {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.post-card-actions {
    position: relative;
}

.post-card-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-card-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.post-card-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.post-card-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.post-card-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background: transparent;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s ease;
}

.post-card-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.post-card-dropdown-item.danger {
    color: #ff6b6b;
}

.post-card-dropdown-item.danger:hover {
    background: rgba(255, 107, 107, 0.1);
}

.post-card-share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-card-share-row.hidden {
    display: none;
}

.post-card-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.post-card-share-icon svg {
    width: 13px;
    height: 13px;
}

.post-card-share-icon:hover {
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.18);
}

.post-card-share-icon:active {
    transform: scale(0.9);
}

.post-card-share-icon.copied {
    color: #34c759;
}

.post-card-body {
    margin-bottom: 16px;
}

.post-card-title {
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.35;
    margin: 0 0 6px;
}

.post-card-subtitle {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0 0 10px;
}

.post-card-content {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 10px;
}

.post-card-location svg {
    width: 12px;
    height: 12px;
}

/* Post Melody Preview */
.post-card-melody {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-top: 16px;
}

.post-card-melody-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-card-melody-play:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    transform: scale(1.05);
}

.post-card-melody-play svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
    margin-left: 2px;
}

.post-card-melody-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.post-card-melody-title {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card-melody-meta {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.post-card-draft-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.15);
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: auto;
}

.post-card-draft-badge--moderated {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    cursor: default;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.72rem;
}

.post-card-moderation-msg {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.78rem;
    color: rgba(248, 113, 113, 0.9);
    line-height: 1.5;
    font-family: var(--font-primary);
    width: 100%;
}

/* --- Post Composer Modal --- */
.composer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 24px 40px;
    overflow-y: auto;
}

.composer-modal {
    width: 100%;
    max-width: 560px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-header h2 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.composer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.composer-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.composer-form {
    padding: 24px;
}

.composer-field {
    margin-bottom: 16px;
    position: relative;
}

.composer-field input,
.composer-field textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: #ffffff;
    transition: all 0.2s ease;
    resize: none;
}

.composer-field input::placeholder,
.composer-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.composer-field input:focus,
.composer-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.composer-char-count {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s ease;
}

.composer-char-count.char-warning {
    color: rgba(255, 193, 7, 0.8);
}

.composer-char-count.char-limit {
    color: #ff6b6b;
    font-weight: 600;
}

/* Melody Section */
.composer-melody-section {
    margin-bottom: 20px;
}

.composer-melody-label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.composer-melody-empty {
    display: flex;
}

.composer-melody-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.composer-melody-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
}

.composer-melody-attached {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.attached-melody-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.attached-melody-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attached-melody-icon svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
    margin-left: 2px;
}

.attached-melody-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.attached-melody-title {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attached-melody-meta {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.attached-melody-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.attached-melody-remove:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.composer-error {
    padding: 12px 16px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: #ff6b6b;
    margin-bottom: 16px;
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
}

.composer-btn-secondary,
.composer-btn-primary {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.composer-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.composer-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

.composer-btn-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.composer-btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
}

/* --- Melody Picker --- */
.melody-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.melody-picker-modal {
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.melody-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.melody-picker-header h3 {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.melody-picker-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.melody-picker-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.melody-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.melody-picker-empty {
    text-align: center;
    padding: 40px 20px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

.melody-picker-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 24px;
    text-align: center;
}

.melody-picker-empty-state svg {
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 4px;
}

.melody-picker-empty-state p {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.melody-picker-empty-state span {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
}

.melody-picker-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.melody-picker-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.melody-picker-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.melody-picker-item-icon svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.melody-picker-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.melody-picker-item-title {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.melody-picker-item-meta {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Post Detail Modal --- */
.post-detail-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 190;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}

.post-detail-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.post-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.post-detail-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.post-detail-content {
    padding: 32px;
}

.post-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.post-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail-avatar svg {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.4);
}

.post-detail-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-detail-author-name {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.post-detail-meta {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.post-detail-title {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.post-detail-subtitle {
    font-family: var(--font-primary);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin: 0 0 24px;
}

.post-detail-body {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.75;
}

.post-detail-body p {
    margin: 0 0 1.25em;
}

.post-detail-body p:last-child {
    margin-bottom: 0;
}

/* Post Detail Melody Player */
.post-detail-melody {
    margin-top: 28px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

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

.post-detail-melody-title {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.post-detail-melody-meta {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.post-detail-melody-waveform {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    margin-bottom: 16px;
}

.waveform-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: background 0.15s ease;
}

.waveform-bar.active {
    background: rgba(255, 255, 255, 0.6);
}

.post-detail-melody-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.melody-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.melody-play-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    transform: scale(1.05);
}

.melody-play-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.melody-play-btn .pause-icon {
    display: none;
    margin-left: 0;
}

.melody-play-btn.playing .play-icon {
    display: none;
}

.melody-play-btn.playing .pause-icon {
    display: block;
}

.melody-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.melody-download-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.melody-download-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* --- Post Share Bar --- */
.post-share-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 0 2px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.post-share-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

.post-share-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.post-share-btn svg {
    width: 14px;
    height: 14px;
}

.post-share-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.15);
}

.post-share-btn:active {
    transform: scale(0.92);
}

.post-share-btn.copied {
    color: #34c759;
}

/* --- Settings Modal --- */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.settings-modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-header h2 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.settings-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.settings-form {
    padding: 24px;
}

.settings-field {
    margin-bottom: 20px;
}

/* Avatar upload */
.settings-avatar-field > label {
    margin-bottom: 10px;
}

.settings-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.settings-avatar-upload.drag-over {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.settings-avatar-upload input[type="file"] {
    display: none;
}

.settings-avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.3);
}

.settings-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-upload-hint {
    flex: 1;
}

.settings-avatar-upload-hint p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

.settings-avatar-pick-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-family: var(--font-primary);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.settings-avatar-pick-btn:hover {
    color: #ffffff;
}

.settings-avatar-hint-sub {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
    margin-top: 2px !important;
}

.settings-avatar-error {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-avatar-error.hidden {
    display: none;
}

.settings-field label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: #ffffff;
    transition: all 0.2s ease;
    resize: none;
}

.settings-field input::placeholder,
.settings-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.settings-field input:focus,
.settings-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
}

.settings-username-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.settings-username-prefix {
    padding: 12px 0 12px 14px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.settings-username-wrapper input {
    border: none;
    background: transparent;
    padding-left: 0;
}

.settings-username-wrapper input:focus {
    border: none;
}

.settings-field-checkbox {
    margin-top: 24px;
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.settings-checkbox input {
    display: none;
}

.settings-checkbox-mark {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.settings-checkbox input:checked + .settings-checkbox-mark {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.settings-checkbox input:checked + .settings-checkbox-mark::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 2px;
}

.settings-checkbox span:last-child {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.settings-error {
    padding: 12px 16px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: #ff6b6b;
    margin-bottom: 16px;
}

.settings-actions {
    padding-top: 8px;
}

.settings-save-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-save-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .blog-main {
        padding-top: 50px;
    }

    .user-profile-section {
        padding: 28px 16px 24px;
    }

    .user-profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .user-profile-avatar {
        width: 72px;
        height: 72px;
    }

    .user-profile-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .user-profile-meta {
        justify-content: center;
    }

    .user-profile-actions {
        margin-top: 16px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .profile-action-btn {
        min-height: 44px;
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .blog-feed-section {
        padding: 24px 16px 60px;
        padding-bottom: max(60px, env(safe-area-inset-bottom));
    }

    .post-card {
        padding: 18px 14px;
    }

    .post-card-avatar {
        width: 38px;
        height: 38px;
    }

    .post-card-menu-btn {
        width: 40px;
        height: 40px;
    }

    .post-card-melody {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .post-card-melody-play {
        width: 44px;
        height: 44px;
    }

    /* Composer — full page below header on mobile, no modal overlay */
    .composer-overlay {
        top: 50px;
        padding: 0;
        align-items: flex-start;
        background: var(--bg-primary, #0d0d0d);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .composer-modal {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
        max-height: none;
        border-radius: 0;
        border: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .composer-header {
        position: sticky;
        top: 0;
        background: var(--bg-secondary);
        z-index: 1;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 16px 18px;
    }

    .composer-form {
        padding: 18px;
    }

    .composer-field input,
    .composer-field textarea {
        font-size: 16px;
        padding: 14px 14px;
    }

    .composer-actions {
        flex-direction: column;
    }

    .composer-btn-secondary,
    .composer-btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        text-align: center;
    }

    /* Post detail — centered card on mobile */
    .post-detail-overlay {
        padding: 16px;
        top: 50px;
        align-items: center;
    }

    .post-detail-modal {
        max-width: 100%;
        min-height: auto;
        max-height: calc(100dvh - 82px);
        border-radius: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .post-detail-content {
        padding: 20px 18px;
    }

    .post-detail-close {
        width: 28px;
        height: 28px;
        top: 10px;
        right: 10px;
    }

    .post-detail-close svg {
        width: 14px;
        height: 14px;
    }

    .post-detail-title {
        font-size: 1.35rem;
    }

    .post-detail-subtitle {
        font-size: 0.95rem;
    }

    .post-detail-melody-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .melody-download-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .melody-play-btn {
        width: 48px;
        height: 48px;
    }

    /* Settings — full page below header on mobile, no modal overlay */
    .settings-overlay {
        top: 50px;
        padding: 0;
        align-items: flex-start;
        background: var(--bg-primary, #0d0d0d);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .settings-modal {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
        max-height: none;
        border-radius: 0;
        border: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .settings-header {
        position: sticky;
        top: 0;
        background: var(--bg-secondary);
        z-index: 1;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .settings-form {
        padding: 18px;
    }

    .settings-field input,
    .settings-field textarea {
        font-size: 16px;
    }

    .settings-save-btn {
        min-height: 48px;
    }

    /* Melody picker — bottom sheet */
    .melody-picker-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .melody-picker-modal {
        max-width: 100%;
        max-height: 80vh;
        max-height: 80dvh;
        border-radius: 16px 16px 0 0;
    }

    .melody-picker-item {
        padding: 14px 16px;
        min-height: 56px;
    }

    .post-share-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .user-profile-avatar {
        width: 64px;
        height: 64px;
    }

    .user-profile-name {
        font-size: 1.25rem;
    }

    .post-card-title {
        font-size: 1.05rem;
    }

    .post-card-content {
        font-size: 0.9rem;
    }

    .post-detail-content {
        padding: 16px 18px;
    }

    .post-detail-title {
        font-size: 1.2rem;
    }

    .post-detail-body {
        font-size: 0.95rem;
    }

    .post-card-melody {
        padding: 12px;
    }

    .profile-action-btn {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .post-card-share-row {
        gap: 2px;
    }

    .post-card-share-icon {
        width: 36px;
        height: 36px;
    }

    .post-share-btn {
        width: 36px;
        height: 36px;
    }

}

/* --- Blog Page Header Overrides --- */
.blog-page .brand-header {
    left: 0 !important;
    z-index: 300;
}

body.blog-page .brand-center {
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
}

body.blog-page .brand-center:hover {
    opacity: 0.8;
}

.blog-page .back-to-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.2s ease;
}

.blog-page .back-to-app-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.95);
}

/* --- Infinite Scroll Loader --- */
.infinite-scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 24px;
    color: rgba(255, 255, 255, 0.4);
}

.infinite-scroll-loader p {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    margin: 0;
}

.infinite-scroll-loader.hidden {
    display: none;
}

/* --- Word wrap: prevent long strings without spaces from overflowing --- */
.post-card-title,
.post-card-subtitle,
.post-card-content,
.post-card-location,
.post-detail-title,
.post-detail-subtitle,
.post-detail-body,
.post-detail-body p,
.post-detail-body li,
.post-detail-body td,
.post-detail-body th,
.post-detail-body blockquote,
.post-detail-body h1,
.post-detail-body h2,
.post-detail-body h3,
.user-profile-name,
.user-profile-bio {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

/* --- Hidden Utility --- */
.hidden {
    display: none !important;
}
