/* ═══════════════════════════════════════════════
   НОВОСТИ — СТИЛИ
   ═══════════════════════════════════════════════ */

/* ─── Основной контейнер ─── */
.news-page {
    max-width: 820px;
    margin: 30px auto;
    padding: 0 20px;
}

.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 28px;
}

.news-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ─── Кнопка создания ─── */
.news-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.news-admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}
.news-admin-btn svg {
    width: 18px;
    height: 18px;
}

/* ─── Фильтры ─── */
.news-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.news-filter-btn {
    padding: 8px 18px;
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.news-filter-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}
.news-filter-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

/* ─── Лента новостей (вертикальная) ─── */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ─── Карточка-пост ─── */
.news-card {
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    margin-bottom: 16px;
}
.news-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.news-card.pinned {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1);
}
.news-card.pinned::before {
    content: '📌 Закреплено';
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    letter-spacing: 0.02em;
}

/* ─── Обложка поста ─── */
.news-card-cover-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
}
.news-card-cover-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(15, 15, 30, 0.85));
    pointer-events: none;
}
.news-card-cover {
    width: 100%;
    height: auto;
    display: block;
}
.news-card-no-cover {
    display: none;
}

/* ─── Тело поста ─── */
.news-card-body {
    padding: 24px 28px 20px;
}

.news-card-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.news-card-status.draft {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}
.news-card-status.archived {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.news-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 10px 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.news-card-excerpt {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px 0;
    line-height: 1.65;
}

/* Контент развёрнутый внутри карточки */
.news-card-content-preview {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin: 0 0 16px 0;
    max-height: 200px;
    overflow: hidden;
    position: relative;
}
.news-card-content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(15, 15, 30, 0.95));
    pointer-events: none;
}
.news-card-content-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}
.news-card-content-preview video,
.news-card-content-preview iframe {
    max-width: 100%;
    height: auto;
    display: block;
}
.news-card-content-preview * {
    max-width: 100%;
    box-sizing: border-box;
}

.news-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #818cf8;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 16px;
    transition: color 0.2s;
}
.news-card:hover .news-card-readmore {
    color: #a5b4fc;
}

/* ─── Мета: дата + просмотры ─── */
.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.news-card-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.news-card-meta-left span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}
.news-card-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
}
.news-card-views svg {
    width: 15px;
    height: 15px;
    opacity: 0.5;
}

/* ─── Кнопки администрирования на карточке ─── */
.news-card-actions {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 6px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}
.news-card:hover .news-card-actions {
    opacity: 1;
}
.news-card-action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: #fff;
}
.news-card-action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}
.news-card-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.4);
}
.news-card-action-btn.discord:hover {
    background: rgba(88, 101, 242, 0.3);
    border-color: rgba(88, 101, 242, 0.4);
}

/* Кнопка Discord в просмотре новости */
.news-single-discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.25);
    border-radius: 8px;
    color: #7289da;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}
.news-single-discord-btn:hover {
    background: rgba(88, 101, 242, 0.25);
    border-color: rgba(88, 101, 242, 0.4);
    color: #99aaf5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.2);
}

/* ─── Пустое состояние ─── */
.news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}
.news-empty svg {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
}
.news-empty p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
}

/* ─── Пагинация ─── */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 28px 0 40px;
}
.news-page-btn {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}
.news-page-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.25);
}
.news-page-btn.active {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.4);
}

/* ─── Лоадер ─── */
.news-loader {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════ ПРОСМОТР ОДНОЙ НОВОСТИ ═══════ */
.news-single {
    max-width: 1060px;
    margin: 28px auto 80px;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Кнопка «Назад» */
.news-single-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.news-single-back:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateX(-3px);
}
.news-single-back svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}
.news-single-back:hover svg {
    transform: translateX(-2px);
}

/* Карточка новости */
#newsSingleContent {
    background: rgba(15, 15, 30, 0.90);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

/* ─── Обложка ─── */
.news-single-cover {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: opacity 0.3s;
}

/* ─── Заголовок ─── */
.news-single-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    padding: 40px 48px 16px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

/* ─── Мета-информация ─── */
.news-single-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 48px 28px;
    flex-wrap: wrap;
}
.news-single-meta span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.40);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ─── Разделитель после меты ─── */
.news-single-meta + .news-single-content {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Контент ─── */
.news-single-content {
    padding: 36px 48px 56px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
    line-height: 1.9;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    letter-spacing: 0.005em;
}

/* Ограничение всех медиа */
.news-single-content img,
.news-single-content video,
.news-single-content iframe,
.news-single-content embed,
.news-single-content object,
.news-single-content canvas,
.news-single-content svg {
    max-width: 100% !important;
    height: auto !important;
}
.news-single-content div,
.news-single-content span,
.news-single-content section,
.news-single-content article {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ─── Параграфы ─── */
.news-single-content p {
    margin: 0 0 1.3em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.news-single-content p:empty,
.news-single-content p > br:only-child {
    display: none;
}

/* ─── Заголовки в контенте ─── */
.news-single-content h1,
.news-single-content h2,
.news-single-content h3,
.news-single-content h4 {
    color: #f1f5f9;
    font-weight: 700;
    line-height: 1.32;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 2em 0 0.7em;
}
.news-single-content h1 {
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}
.news-single-content h2 {
    font-size: 1.4rem;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: -0.015em;
}
.news-single-content h3 {
    font-size: 1.2rem;
    color: #e2e8f0;
}
.news-single-content h4 {
    font-size: 1.05rem;
    color: #cbd5e1;
}

/* ─── Изображения ─── */
.news-single-content img {
    display: block;
    margin: 1.8em auto;
    border-radius: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}
.news-single-content img:hover {
    transform: scale(1.015);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}
.news-single-content p > img {
    display: block;
    margin: 1.8em auto;
}
/* Широкие изображения — выход за границы контента */
.news-single-content img[style*="width: 100%"],
.news-single-content img:not([style*="width"]):not([style*="float"]) {
    width: 100%;
    border-radius: 14px;
}

/* ─── Ссылки ─── */
.news-single-content a {
    color: #818cf8;
    text-decoration: underline;
    text-decoration-color: rgba(129, 140, 248, 0.3);
    text-underline-offset: 3px;
    transition: all 0.2s;
    word-break: break-all;
}
.news-single-content a:hover {
    color: #a5b4fc;
    text-decoration-color: rgba(165, 180, 252, 0.6);
}

/* ─── Цитаты ─── */
.news-single-content blockquote {
    margin: 1.8em 0;
    padding: 20px 28px;
    border-left: 4px solid rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
    border-radius: 0 14px 14px 0;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 1.05rem;
    line-height: 1.8;
}
.news-single-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ─── Код ─── */
.news-single-content code {
    background: rgba(99, 102, 241, 0.1);
    color: #c4b5fd;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.88em;
}
.news-single-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 22px 26px;
    border-radius: 14px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.88rem;
    color: #a5f3fc;
    border: 1px solid rgba(255, 255, 255, 0.06);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 1.8em 0;
    max-width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.7;
}
.news-single-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* ─── Таблицы ─── */
.news-single-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.8em 0;
    display: block;
    overflow-x: auto;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.news-single-content table th,
.news-single-content table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    text-align: left;
}
.news-single-content table th {
    background: rgba(99, 102, 241, 0.08);
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.news-single-content table tr:last-child td {
    border-bottom: none;
}
.news-single-content table th:last-child,
.news-single-content table td:last-child {
    border-right: none;
}
.news-single-content table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ─── Разделитель ─── */
.news-single-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 2.8em 0;
}

/* ─── Списки ─── */
.news-single-content ul,
.news-single-content ol {
    padding-left: 28px;
    margin: 0.8em 0 1.4em;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.news-single-content li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}
.news-single-content ul li::marker {
    color: rgba(99, 102, 241, 0.6);
}
.news-single-content ol li::marker {
    color: rgba(99, 102, 241, 0.7);
    font-weight: 600;
}

/* ─── Видео ─── */
.news-single-content video {
    width: 100% !important;
    display: block;
    border-radius: 14px;
    margin: 1.8em 0;
    background: #000;
}
.news-single-content .news-video-wrap {
    margin: 1.8em 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.news-single-content .news-video-wrap video {
    width: 100% !important;
    margin: 0;
    border-radius: 0;
}

/* ─── Iframe / YouTube ─── */
.news-single-content .news-video-embed,
.news-single-content div[style*="padding-bottom"] {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    margin: 1.8em 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.news-single-content .news-video-embed iframe,
.news-single-content div[style*="padding-bottom"] iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}
.news-single-content iframe { border: 0; }

/* ─── Инфо-блоки из редактора ─── */
.news-single-content div[style*="border-left"] {
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 0 14px 14px 0 !important;
    margin: 1.4em 0 !important;
    padding: 18px 24px !important;
    font-size: 1rem;
    line-height: 1.75;
}

/* ─── Спойлеры ─── */
.news-single-content .news-spoiler {
    max-width: 100% !important;
    border-radius: 14px;
    margin: 1.4em 0;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow: hidden;
}
.news-single-content .news-spoiler-header {
    cursor: pointer;
    user-select: none;
    padding: 14px 20px !important;
    transition: background 0.2s;
}
.news-single-content .news-spoiler-header:hover {
    background: rgba(255, 255, 255, 0.07) !important;
}

/* ─── Grid / flex из редактора ─── */
.news-single-content div[style*="grid"] {
    overflow: hidden;
    border-radius: 14px;
    margin: 1.4em 0;
    gap: 16px;
}

/* ─── Float-картинки ─── */
.news-single-content img[style*="float"] {
    margin: 6px 20px 16px 0 !important;
    max-width: 50% !important;
    border-radius: 14px;
}
.news-single-content img[style*="float: right"],
.news-single-content img[style*="float:right"] {
    margin: 6px 0 16px 20px !important;
}

/* ─── Выделение текста ─── */
.news-single-content ::selection {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
}

/* ─── Strong / em ─── */
.news-single-content strong,
.news-single-content b {
    color: #f1f5f9;
    font-weight: 700;
}

/* ─── Lightbox для изображений ─── */
.news-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lightboxIn 0.25s ease;
    padding: 40px;
}
.news-lightbox-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.news-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100000;
}
.news-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
@keyframes lightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════ ТОСТЫ ═══════ */
.news-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.news-toast {
    padding: 12px 20px;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.88rem;
    animation: toastIn 0.3s ease;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.news-toast.success { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.news-toast.error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.news-toast.info { border-color: rgba(99, 102, 241, 0.4); color: #a5b4fc; }
.news-toast.removing { opacity: 0; transform: translateX(20px); transition: all 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ═══════ CONFIRM ═══════ */
.news-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-confirm-box {
    background: rgba(20, 20, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 400px;
    text-align: center;
}
.news-confirm-box p {
    color: #e2e8f0;
    font-size: 1rem;
    margin: 0 0 20px;
    line-height: 1.5;
}
.news-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.news-confirm-yes {
    padding: 10px 24px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}
.news-confirm-yes:hover {
    background: rgba(239, 68, 68, 0.35);
}
.news-confirm-yes--action {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}
.news-confirm-yes--action:hover {
    background: rgba(99, 102, 241, 0.35);
}
.news-confirm-no {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.news-confirm-no:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ═══════ РЕДАКТОР ═══════ */
.news-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.news-editor-overlay.active {
    display: flex;
}
.news-editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Шапка */
.news-editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(15, 15, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.news-editor-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.news-editor-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.news-editor-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.news-editor-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}
/* Индикатор несохранённых изменений */
.news-editor-unsaved {
    display: none;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    flex-shrink: 0;
    animation: unsavedPulse 2s ease-in-out infinite;
}
.news-editor-unsaved.active {
    display: block;
}
@keyframes unsavedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.news-editor-title-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}
.news-editor-title-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
}
.news-editor-title-input::placeholder { color: rgba(255,255,255,0.25); }

.news-editor-status-select {
    padding: 8px 12px;
    background-color: #0e1320;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
}
.news-editor-status-select:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}
.news-editor-status-select option {
    background: #0e1320;
    color: #e2e8f0;
    padding: 8px;
}
.news-editor-pin-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
.news-editor-save-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.news-editor-save-btn:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.news-editor-save-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Настройки */
.news-editor-settings {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(10, 10, 25, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
    flex-shrink: 0;
}
.news-editor-settings label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    white-space: nowrap;
}
.news-editor-settings input[type="text"] {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
    width: 160px;
}
.news-editor-cover-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.news-editor-cover-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.news-editor-cover-preview {
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

/* Тулбар */
.news-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(10, 10, 25, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
    overflow-x: auto;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ne-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.ne-toolbar-group:last-child { border-right: none; }

.ne-tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.ne-tool-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.08);
}
.ne-tool-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}
.ne-tool-btn svg { width: 16px; height: 16px; }

.ne-tool-select {
    padding: 4px 8px;
    background-color: #0e1320;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
    max-width: 120px;
    color-scheme: dark;
}
.ne-tool-select:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.12);
}
.ne-tool-select option {
    background: #0e1320;
    color: #e2e8f0;
    padding: 6px;
}

/* Тело редактора */
.news-editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.news-editor-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.news-editor-area {
    flex: 1;
    padding: 28px 32px 50vh;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.8;
    outline: none;
    min-height: 500px;
    box-sizing: border-box;
    caret-color: #fff;
    cursor: text;
    -webkit-user-modify: read-write;
}
.news-editor-area:focus {
    outline: none;
    caret-color: #fff;
}
.news-editor-area:empty::before {
    content: 'Начните писать...';
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    display: block;
}
/* Видимый мигающий курсор */
.news-editor-area p:empty::after,
.news-editor-area p br:only-child {
    content: '';
    display: inline;
}
/* Drag & Drop зона */
.news-editor-area.drag-over {
    background: rgba(99, 102, 241, 0.08);
    outline: 2px dashed rgba(99, 102, 241, 0.4);
    outline-offset: -4px;
    border-radius: 8px;
}
.news-editor-area.drag-over::after {
    content: '📎 Отпустите для загрузки';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 30, 0.95);
    color: #a5b4fc;
    padding: 20px 40px;
    border-radius: 16px;
    border: 2px dashed rgba(99, 102, 241, 0.5);
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
}
.news-editor-area img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
}
.news-editor-area img.selected {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

/* Изображения в редакторе — блочные с возможностью ввода вокруг */
.news-editor-area p {
    min-height: 1em;
}
.news-editor-area .news-editor-media-wrap {
    margin: 12px 0;
    position: relative;
    display: block;
    clear: both;
}
.news-editor-area .news-editor-media-wrap img,
.news-editor-area .news-editor-media-wrap video {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}
.news-editor-area video {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

/* Сайдбар */
.news-editor-sidebar {
    width: 280px;
    padding: 20px;
    background: rgba(10, 10, 25, 0.6);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    overflow-y: auto;
    flex-shrink: 0;
}
.news-editor-sidebar h4 {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
    font-weight: 600;
}
.news-editor-sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.news-editor-sidebar-section:last-child {
    border-bottom: none;
}
.news-editor-excerpt-input {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    outline: none;
    resize: vertical;
    margin-bottom: 16px;
    font-family: inherit;
    line-height: 1.5;
}
.word-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 6px;
}
.reading-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 16px;
}
.autosave-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.autosave-status.saving { color: #fbbf24; }
.autosave-status.saved { color: #6ee7b7; }
/* Кнопка предпросмотра */
.news-editor-preview-btn {
    width: 100%;
    padding: 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.news-editor-preview-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.35);
}
/* Прогресс загрузки */
.news-upload-progress {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    z-index: 10002;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.news-upload-progress-title {
    font-size: 0.85rem;
    color: #a5b4fc;
    font-weight: 600;
    margin-bottom: 8px;
}
.news-upload-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.news-upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}
.news-upload-progress-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}
/* Превью-оверлей */
.news-editor-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, 0.95);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.news-editor-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(15, 15, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.news-editor-preview-header h3 {
    color: #a5b4fc;
    font-size: 0.95rem;
    margin: 0;
}
.news-editor-preview-close {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.news-editor-preview-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.news-editor-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}
.news-editor-preview-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(15, 15, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

/* Image toolbar */
.ne-image-toolbar {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}
.ne-image-toolbar.visible {
    opacity: 1;
    pointer-events: auto;
}
.ne-image-toolbar label {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.ne-image-toolbar input[type="range"] {
    width: 60px;
}
.ne-image-toolbar select {
    padding: 3px 6px;
    background-color: #0e1320;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.78rem;
    color-scheme: dark;
    outline: none;
    cursor: pointer;
}
.ne-image-toolbar select option {
    background: #0e1320;
    color: #e2e8f0;
}
.ne-image-toolbar button {
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.78rem;
    cursor: pointer;
}

/* ═══════ АДАПТИВНОСТЬ ═══════ */
@media (max-width: 768px) {
    .news-page { margin: 16px auto; }
    .news-header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
    .news-header h2 { font-size: 1.2rem; }
    .news-card-body { padding: 18px 20px 16px; }
    .news-card-title { font-size: 1.15rem; }
    .news-single { padding: 0 12px; margin: 16px auto 40px; }
    .news-single-back { padding: 8px 14px; font-size: 0.82rem; margin-bottom: 16px; }
    .news-single-title { font-size: 1.55rem; padding: 24px 20px 10px; }
    .news-single-meta { padding: 0 20px 16px; gap: 12px; }
    .news-single-content { padding: 24px 20px 36px; font-size: 1rem; line-height: 1.8; }
    .news-single-content img { border-radius: 10px; margin: 1.2em auto; }
    .news-single-content blockquote { padding: 14px 18px; margin: 1.2em 0; }
    .news-single-content pre { padding: 16px 14px; font-size: 0.82rem; }
    .news-single-content div[style*="grid"] {
        display: flex !important;
        flex-direction: column !important;
    }
    .news-single-content img[style*="float"] {
        float: none !important;
        max-width: 100% !important;
        margin: 1em auto !important;
        display: block;
    }
    .news-single-cover { max-height: 280px; }
    #newsSingleContent { border-radius: 16px; }
    .news-editor-sidebar { display: none; }
    .news-editor-topbar { flex-direction: column; align-items: flex-start; }
    .news-editor-area { padding: 20px 16px 50vh; }
}
