.news-page { padding-bottom: var(--space-2xl); }

.container-narrow { max-width: 720px; }

.news-page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--space-md); flex-wrap: wrap;
}
.news-new-btn { flex-shrink: 0; }

.news-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-xl);
}
.news-filters {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.filter-btn {
    padding: 5px 14px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: var(--font-weight-medium);
    color: var(--color-text-muted); border: 1px solid transparent;
    transition: all var(--transition-fast);
}
.filter-btn:hover { color: var(--color-text); background: var(--color-surface); }
.filter-btn.active {
    color: var(--color-accent-text); background: var(--color-accent);
}

/* ── Empty state ── */
.news-empty {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-md);
    padding: var(--space-4xl) 0; text-align: center; color: var(--color-text-muted);
}
.news-empty svg { width: 40px; height: 40px; opacity: 0.5; }
.news-empty p { font-size: 0.88rem; }

/* ── Feed (Threads/X-style post cards) ── */
.feed { display: flex; flex-direction: column; }

.feed-post {
    display: flex; gap: var(--space-md); align-items: flex-start;
    padding: var(--space-lg) 0; border-bottom: 1px solid var(--color-border);
}
.feed-post:first-child { border-top: 1px solid var(--color-border); }
.feed-post.is-draft { opacity: 0.72; }

.feed-post-avatar-link { flex-shrink: 0; }
.feed-post-avatar { width: 40px; height: 40px; }

.feed-post-body { flex: 1; min-width: 0; }
.feed-post-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 4px;
}
.feed-post-author { font-weight: var(--font-weight-semibold); color: var(--color-text); }
.feed-post-dot { opacity: 0.6; }
.feed-post-badge { margin-left: 2px; }

.feed-post-link { color: inherit; display: block; transition: opacity var(--transition-fast); }
.feed-post-link:hover { opacity: 0.8; }
.feed-post-title {
    font-size: 0.95rem; font-weight: var(--font-weight-semibold);
    line-height: 1.4; margin-bottom: 4px;
}
.feed-post-excerpt {
    font-size: 0.82rem; color: var(--color-text-secondary); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    white-space: pre-line; word-break: break-word; overflow-wrap: break-word;
}

.feed-post-image {
    margin-top: var(--space-sm); border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--color-border);
}
.feed-post-image img { width: 100%; display: block; }

.feed-post-stats { margin-top: var(--space-sm); }
.feed-post-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }
.feed-delete-form { display: contents; }
.feed-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; color: var(--color-text-muted);
    padding: 4px 8px; border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.feed-action-btn svg { width: 12px; height: 12px; }
.feed-action-btn:hover { color: var(--color-text); background: var(--color-surface); }
.feed-action-danger:hover { color: var(--color-rose); }

.badge-draft { background: var(--color-surface-elevated); color: var(--color-text-muted); }

@media (max-width: 768px) {
    .news-toolbar { flex-direction: column; align-items: stretch; }
    .feed-post { gap: var(--space-sm); }
}

/* ── Detail page ── */
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: var(--color-text-muted);
    margin-bottom: var(--space-lg); transition: color var(--transition-fast);
}
.back-link:hover { color: var(--color-text); }
.back-link svg { width: 14px; height: 14px; }

.post-detail { padding-bottom: var(--space-2xl); }
.post-detail-meta {
    display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}
.post-detail-avatar { width: 44px; height: 44px; }
.post-detail-meta-text { margin-right: auto; }
.post-detail-author { font-size: 0.85rem; font-weight: var(--font-weight-semibold); }
.post-detail-time { font-size: 0.72rem; color: var(--color-text-muted); }

.post-detail-title {
    font-size: 1.6rem; font-weight: var(--font-weight-bold);
    line-height: 1.35; margin-bottom: var(--space-lg); letter-spacing: -0.01em;
}
.post-detail-body {
    font-size: 0.92rem; line-height: 1.85; color: var(--color-text-secondary);
    word-break: break-word; overflow-wrap: break-word;
}
.post-detail-body:not(.md-body) p { margin-bottom: var(--space-md); white-space: pre-line; }

.news-detail-image {
    margin-bottom: var(--space-lg); border-radius: var(--radius-lg); overflow: hidden;
}
.news-detail-image img { width: 100%; display: block; }

.post-detail-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-xl); }
.btn-danger:hover { border-color: var(--color-rose); color: var(--color-rose); }

/* ── Create / edit form ── */
.news-form-page .auth-form { display: flex; flex-direction: column; gap: var(--space-md); }
.news-form-page .form-group { display: flex; flex-direction: column; gap: 4px; }
.news-form-page .form-group label {
    font-size: 0.75rem; font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}
.news-form-page .form-input {
    width: 100%; padding: 9px 12px;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); font-family: var(--font-primary);
    font-size: 0.85rem; color: var(--color-text);
    transition: border-color var(--transition-fast);
}
.news-form-page .form-input:focus { outline: none; border-color: var(--color-accent); }
.news-form-page textarea.form-input { resize: vertical; min-height: 220px; line-height: 1.6; }
select.form-input { cursor: pointer; }

.publish-toggle {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--color-text-secondary); cursor: pointer;
}
.publish-toggle input { width: 16px; height: 16px; accent-color: var(--color-accent); }

.news-form-buttons { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }
.news-form-buttons .auth-submit { flex: 1; }
.news-form-page .auth-submit {
    padding: 10px 20px; margin-top: 0;
    background: var(--color-accent); color: var(--color-accent-text);
    border-radius: var(--radius-md); font-family: var(--font-primary);
    font-size: 0.85rem; font-weight: var(--font-weight-semibold);
    transition: background var(--transition-fast);
}
.news-form-page .auth-submit:hover { background: var(--color-accent-hover); }

.news-form-current-image { margin-bottom: var(--space-sm); }
.news-form-current-image img {
    max-width: 220px; max-height: 160px; object-fit: cover;
    border-radius: var(--radius-md); border: 1px solid var(--color-border);
    display: block; margin-bottom: 4px;
}
.news-image-preview {
    margin-top: var(--space-sm); border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--color-border); background: var(--color-surface-elevated);
    max-height: 360px; display: flex; align-items: center; justify-content: center;
}
.news-image-preview img { width: 100%; max-height: 360px; object-fit: contain; display: block; }
.form-help { font-size: 0.7rem; color: var(--color-text-muted); }

.auth-error {
    padding: 8px 12px; border-radius: var(--radius-md);
    background: rgba(174, 68, 90, 0.1); color: var(--color-rose);
    font-size: 0.78rem; margin-bottom: var(--space-md);
}
