:root {
    --bg-dark: #121214;
    --text-white: #ffffff;

    /* ВОТ ОНА, ПРОПУЩЕННАЯ ПЕРЕМЕННАЯ: */
    --text-grey: #a0a0a0;

    --accent-blue: #3E7B99;
    --border-color: rgba(255, 255, 255, 0.15);
}

/* Принудительный шрифт */
body, button, input, textarea, h1, h2, h3, a {
    font-family: 'Montserrat', sans-serif !important;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    margin: 0;
    position: relative;
    overflow-x: hidden;
    /* Эти 3 строки прижимают футер к низу */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- ФОНЫ --- */

/* 1. Пятна (Слой самый нижний) */
.glow {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    z-index: -3;
    pointer-events: none;
    filter: blur(150px);
    opacity: 0.4;
}
.glow-1 { top: -300px; left: -200px; background: #2F00DA; }
.glow-2 { top: 30%; right: -400px; background: #58BFFF; }

/* 2. СЕТКА (Исправленная) */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;


    z-index: -2;


    background-image: url('../img/grid.png');

    background-repeat: repeat;

    background-size: cover;

    opacity: 0.2;

    pointer-events: none;
}
.wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
    /* Это заставляет wrapper растягиваться и толкать футер вниз */
    flex: 1;
}

/* --- Хедер (Без изменений) --- */
.header {
    display: flex;
    position: relative;
    z-index: 9999;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
}

.logo {
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
}

.nav-menu { display: flex; gap: 40px; }
.nav-link {
    color: #b0b0b0; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.3s;
}
.nav-link:hover { color: white; }

.btn-small {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;

    text-decoration: none !important;
    display: inline-block;

    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-small:hover {
    border-color: #58BFFF;
    color: #58BFFF;
    box-shadow: 0 0 15px rgba(88, 191, 255, 0.4); /* Свечение */
    transform: translateY(-2px); /* Легкий подъем */
}

/* --- HERO SLIDER (Главный экран) --- */
.hero-slider-container {
    height: 700px; /* Чуть увеличим общую высоту секции, чтобы влез отступ */
    margin-bottom: 80px;
    position: relative;
}

.heroSwiper {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.hero-slide {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;

    /* ИСПРАВЛЕНО: Было 130px, стало 220px.
       Это опустит заголовок "Профессиональный форум..." вниз */
    padding-top: 220px;

    background: transparent;
}

.hero-content h1 {
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 50px;
}

.btn-primary {
    font-family: 'Montserrat', sans-serif !important;
    padding: 14px 35px;
    border-radius: 40px;
    background: linear-gradient(90deg, #3E7B99 0%, #2a5a75 100%);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(62, 123, 153, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); }

.center-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 60px;
    position: relative;
    z-index: 2;
}
/* --- ТОЧКИ ПАГИНАЦИИ (Вертикальные справа) --- */

.heroSwiper .swiper-pagination {
    position: absolute;
    right: 30px !important;
    left: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    gap: 15px;
    width: auto !important;
    z-index: 10;
}

.heroSwiper .swiper-pagination-bullet {
    width: 14px;
    height: 14px;
    background: white;
    opacity: 0.4;
    margin: 0 !important;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.heroSwiper .swiper-pagination-bullet-active {
    background: #58BFFF;
    opacity: 1;
    transform: scale(1.3);
}
/* --- Точки пагинации --- */
.swiper-pagination-vertical.swiper-pagination-bullets,
.swiper-vertical>.swiper-pagination-bullets {
    right: 20px;
    top: 50%;
    transform: translate3d(0px,-50%,0);
}
.swiper-pagination-bullet {
    width: 10px; height: 10px; background: white; opacity: 0.3; margin: 15px 0 !important;
}
.swiper-pagination-bullet-active { opacity: 1; background: #58BFFF; }

/* --- Заглушки и Футер--- */
.empty-state {
    text-align: center;
    padding: 60px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--text-grey);
}
.section-title { text-align: center; margin-bottom: 40px; font-size: 1.6rem; }
.footer {
    border-top: 1px solid rgba(255,255,255,0.1); padding: 40px; margin-top: 50px; background: rgba(0,0,0,0.2);
}
.footer-content { display: flex; justify-content: center; gap: 50px; }
.footer a { color: #a0a0a0; text-decoration: none; font-size: 0.9rem; }
.footer a:hover { color: white; }

/* --- СТРАНИЦА НОВОСТЕЙ --- */

.page-section {
    padding: 120px 0 80px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    color: white;
}

/* Сетка новостей */
.news-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* --- НОВОСТИ (На главной) --- */
.news-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.news-card-home {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.news-card-home:hover {
    transform: translateY(-5px);
    border-color: #58BFFF;
    background: rgba(255, 255, 255, 0.05);
}

.news-card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-card-body {
    padding: 25px;
}

.news-date {
    font-size: 0.8rem;
    color: #58BFFF;
    margin-bottom: 10px;
    display: block;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.news-desc {
    font-size: 0.9rem;
    color: #a0a0a0;
    line-height: 1.5;
}


/* --- НОВОСТИ (Отдельная страница) --- */
.page-container {
    padding-top: 50px;
    padding-bottom: 80px;
}

.page-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 60px;
}

.news-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

/* Дизайн карточки */
.news-tile {
    background: linear-gradient(180deg, rgba(30, 30, 35, 0.8) 0%, rgba(20, 20, 25, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-tile:hover {
    box-shadow: 0 10px 40px rgba(62, 123, 153, 0.15);
    border-color: #3E7B99;
    transform: translateY(-5px);
}

.tile-image-wrap {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.tile-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.news-tile:hover .tile-image {
    transform: scale(1.05);
}

.news-section,
.topics-section,
.materials-section {
    margin-bottom: 130px;
}

.tile-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tile-date {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 12px;
}

.tile-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    color: white;
    flex: 1;
}

.read-link {
    font-size: 0.9rem;
    color: #58BFFF;
    font-weight: 600;
}

a.news-card-home,
a.news-tile,
a.forum-card,
a.thread-card,
a.sidebar-card,
a.file-card {
    text-decoration: none !important;
    color: white !important;
}

/* Кнопка на главной (Все новости) */
.btn-secondary {
    padding: 12px 35px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-secondary:hover {
    border-color: #58BFFF;
    background: rgba(88, 191, 255, 0.1);
}
/* Большая заглушка для целой страницы */
.empty-state-large {
    text-align: center;
    padding: 100px 20px;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 20px;
    background: rgba(255,255,255,0.02);
}
.empty-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.empty-state-large h3 { margin-bottom: 15px; font-size: 1.5rem; }
.empty-state-large p { color: var(--text-grey); max-width: 500px; margin: 0 auto 30px; }

/* --- ПАГИНАЦИЯ (Для страницы новостей) --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 60px;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    border-color: #58BFFF;
    background: rgba(88, 191, 255, 0.1);
}

.page-link.active {
    background: #58BFFF;
    color: white;
    border-color: #58BFFF;
    box-shadow: 0 0 15px rgba(88, 191, 255, 0.4);
}
/* --- ДЕТАЛЬНАЯ СТРАНИЦА НОВОСТИ --- */

.news-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* --- БЛОК СТАТЬИ --- */
.news-article-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px;
}

/* Хлебные крошки */
.breadcrumbs {
    color: var(--text-grey);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.breadcrumbs a {
    color: var(--text-grey);
    text-decoration: none;
    transition: color 0.3s;
}
.breadcrumbs a:hover { color: #58BFFF; }

/* Заголовок */
.article-main-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: white;
}

/* Мета (Дата, Автор) */
.article-meta-top {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.meta-date { color: #58BFFF; }

/* Картинка */
.article-main-image {
    width: 100%;
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}
.article-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ТЕКСТ СТАТЬИ (Типографика) */
.article-body-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #e0e0e0;
}

.article-body-text p { margin-bottom: 20px; }
.article-body-text h3 {
    font-size: 1.5rem;
    color: white;
    margin: 40px 0 20px;
}
.article-body-text ul {
    margin-bottom: 25px;
    padding-left: 20px;
}
.article-body-text li {
    margin-bottom: 10px;
    color: #d0d0d0;
}

/* Подвал статьи */
.article-bottom-bar {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back {
    color: #58BFFF;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(88, 191, 255, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s;
}
.btn-back:hover { background: rgba(88, 191, 255, 0.1); }

.share-links a {
    color: var(--text-grey);
    margin-left: 15px;
    text-decoration: none;
    font-weight: 600;
}
.share-links a:hover { color: white; }


/* --- САЙДБАР (ПРАВАЯ КОЛОНКА) --- */
.news-sidebar {
    position: sticky;
    top: 40px;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-left: 3px solid #58BFFF;
    padding-left: 15px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    text-decoration: none;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s;
}

.sidebar-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-date {
    font-size: 0.75rem;
    color: #58BFFF;
    display: block;
    margin-bottom: 8px;
}

.sidebar-news-title {
    font-size: 0.95rem;
    color: white;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* АДАПТИВНОСТЬ: На планшетах и телефонах убираем сайдбар вниз */
@media (max-width: 900px) {
    .news-detail-layout {
        grid-template-columns: 1fr;
    }
    .news-sidebar {
        margin-top: 50px;
    }
}

.section-subtitle {
    font-size: 1.5rem;
    color: white;
    margin: 50px 0 25px;
    font-weight: 600;
}

/* Галерея */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Файлы */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    text-decoration: none;
    transition: all 0.3s;
}

.file-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #58BFFF;
    transform: translateX(5px);
}

.file-icon {
    font-size: 1.8rem;
    margin-right: 20px;
    opacity: 0.8;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.file-size {
    color: var(--text-grey);
    font-size: 0.8rem;
}

.file-download-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(88, 191, 255, 0.1);
    color: #58BFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- LIGHTBOX (Просмотр фото) --- */

.gallery-item {
    position: relative;
}

.zoom-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.gallery-item:hover .zoom-icon {
    opacity: 1;
}

.gallery-item:hover img {
    filter: brightness(0.7);
    transform: scale(1.05);
}

/* Само модальное окно (скрыто по умолчанию) */
/* --- LIGHTBOX --- */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    cursor: default;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    border-radius: 5px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
    user-select: none;
}

/* Кнопка закрытия */
.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}
.close-btn:hover { color: #58BFFF; }

/* НОВОЕ: Стрелки навигации */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 10000;
}

/* Позиция стрелок */
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.5);
    color: #58BFFF;
}

/* --- СТРАНИЦА ФОРУМА --- */

/* Заголовок по центру */
.forum-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Список */
.forum-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 60px;
}

/* Карточка форума */
.forum-card {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: linear-gradient(90deg, rgba(40, 60, 80, 0.9) 0%, rgba(30, 45, 60, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;

    padding: 20px 40px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.forum-card:hover {
    background: linear-gradient(90deg, rgba(62, 123, 153, 0.8) 0%, rgba(40, 60, 80, 0.7) 100%);
    border-color: #58BFFF;
    transform: translateX(10px);
}

.forum-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.forum-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.forum-count {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Кнопка со стрелкой */
.forum-arrow-btn {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

/* При наведении меняем только цвет */
.forum-card:hover .forum-arrow-btn {
    background: #58BFFF;
}

.forum-card:hover .forum-arrow-btn svg path {
    stroke: white;
}

/* --- ВНУТРЯНКА РАЗДЕЛА (Список тем) --- */

.threads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 60px;
}

.thread-card {
    display: flex;
    align-items: center;
    gap: 25px;

    background: linear-gradient(90deg, rgba(40, 60, 80, 0.9) 0%, rgba(30, 45, 60, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;

    padding: 20px 30px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.thread-card:hover {
    background: linear-gradient(90deg, rgba(62, 123, 153, 0.8) 0%, rgba(40, 60, 80, 0.7) 100%);
    border-color: #58BFFF;
    transform: translateX(10px);
}

.thread-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #d9d9d9;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
}

/* Блок с текстом */
.thread-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Верхняя строка (Автор, Дата, Ответы) */
.thread-meta-row {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #a0a0a0;
}

/* Название обсуждения */
.thread-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

/* Стрелка наследуется от .forum-arrow-btn, но добавим специфику при наведении */
.thread-card:hover .forum-arrow-btn {
    background: #58BFFF;
}
.thread-card:hover .forum-arrow-btn svg path {
    stroke: white;
}

/* --- СТРАНИЦА ТЕМЫ (Внутрянка) --- */

.thread-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.login-hint a { color: #58BFFF; text-decoration: none; border-bottom: 1px dashed #58BFFF; }

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 60px;
}

/* Карточка сообщения */
.forum-post {
    display: flex;
    background: linear-gradient(180deg, rgba(30, 45, 60, 0.8) 0%, rgba(20, 30, 40, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    min-height: 300px;
}

/* Левая колонка (Автор) */
.post-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.author-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    background-color: #d9d9d9;
    margin-bottom: 15px;
    border: 3px solid rgba(255,255,255,0.1);
}

.author-name {
    color: white; font-weight: 700; font-size: 1rem; margin-bottom: 5px;
}
.author-status {
    color: #58BFFF; font-size: 0.85rem; margin-bottom: 20px;
}

.author-stats {
    font-size: 0.75rem; color: #808080; line-height: 1.6; width: 100%; text-align: left; padding-left: 10px;
}

/* Правая колонка (Контент) */
.post-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px; margin-bottom: 20px;
    color: #808080; font-size: 0.85rem;
}

.post-body-text {
    color: #e0e0e0; font-size: 1rem; line-height: 1.6;
}
.post-body-text ul { padding-left: 20px; margin-top: 10px; }


/* --- МОДАЛЬНОЕ ОКНО ОТВЕТА --- */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center; justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-window {
    background: linear-gradient(135deg, #1e2a36 0%, #151b22 100%);
    width: 800px;
    max-width: 95%;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 1.2rem; color: white; }
.modal-close {
    background: none; border: none; color: #a0a0a0; font-size: 2rem; cursor: pointer;
}
.modal-close:hover { color: white; }

.modal-body { padding: 30px; }

/* Тулбар редактора */
.editor-toolbar {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;


    box-sizing: border-box;
    width: 100%;
}
.editor-toolbar button {
    background: none; border: none; color: #ccc; cursor: pointer; font-size: 1rem; padding: 5px;
}
.editor-toolbar button:hover { color: #58BFFF; background: rgba(255,255,255,0.05); border-radius: 4px; }
.separator { color: #444; }

/* --- ВИЗУАЛЬНЫЙ РЕДАКТОР --- */

.reply-textarea {
    width: 100%;
    height: 200px;
    background: rgba(30, 40, 50, 0.5);
    border: 1px solid rgba(255,255,255,0.1);

    border-top: 1px solid rgba(255,255,255,0.05);

    border-radius: 0 0 8px 8px;
    color: white;
    padding: 15px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;

    overflow-y: auto;
    outline: none;
    display: block;

    box-sizing: border-box;
}

.reply-textarea:focus {
    border-color: #58BFFF;
    background: rgba(30, 40, 50, 0.8);
    border-top-color: #58BFFF;
}

/* Показываем placeholder, когда div пустой */
.reply-textarea:empty:before {
    content: attr(data-placeholder);
    color: #808080;
    pointer-events: none;
    display: block;
}

/* Стили внутри редактора */
.reply-textarea ul { padding-left: 20px; list-style-type: disc; margin: 10px 0; }
.reply-textarea a { color: #58BFFF; text-decoration: underline; }
.reply-textarea b { font-weight: 700; color: white; }
.reply-textarea i { font-style: italic; }

/* Блок файлов */
.file-attach-area { margin-top: 20px; }
.file-attach-area h4 { font-size: 0.9rem; margin-bottom: 10px; color: #ccc; }
.file-checkbox-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }

.custom-checkbox {
    display: flex; align-items: center; gap: 10px; cursor: pointer; color: #a0a0a0; font-size: 0.9rem;
}
.btn-attach {
    background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); width: auto; display: inline-block;
}

.modal-footer {
    padding: 20px 30px; border-top: 1px solid rgba(255,255,255,0.1); text-align: right;
}

/* Адаптив для постов */
@media (max-width: 768px) {
    .forum-post { flex-direction: column; }
    .post-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); flex-direction: row; padding: 15px; justify-content: flex-start; gap: 20px;}
    .author-avatar { width: 60px; height: 60px; margin: 0; }
    .author-stats { display: none; }
}

/* --- ВЛОЖЕНИЯ В ПОСТАХ (Просмотр) --- */
.post-attachments {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.attachments-title {
    font-size: 0.9rem; color: #808080; margin-bottom: 15px;
}

.attachments-grid {
    display: flex; flex-wrap: wrap; gap: 15px;
}

/* Карточка вложения */
.attachment-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.attachment-item:hover {
    border-color: #58BFFF;
    background: rgba(255,255,255,0.05);
}

/* Если это картинка */
.image-type {
    width: 150px; display: flex; flex-direction: column;
}
.image-type img {
    width: 100%; height: 100px; object-fit: cover;
}
.image-type .attach-name {
    padding: 8px; font-size: 0.75rem; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- ВЛОЖЕНИЯ --- */

/* Контейнер файла */
.file-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    min-width: 300px;
    max-width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    transition: all 0.2s;
}

.file-type:hover {
    background: rgba(255,255,255,0.05);
    border-color: #58BFFF;
}

/* Группа иконка + текст */
.file-info-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    margin-right: 20px;
    overflow: hidden;
}

/* Кнопка скачивания */
.btn-download {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #58BFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none !important;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;

    position: relative;
}

/* Разделительная черта */
.btn-download::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.btn-download:hover {
    background: #58BFFF;
    color: white;
    border-color: #58BFFF;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 191, 255, 0.3);
}

/* Иконки и текст */
.file-icon-small { font-size: 1.8rem; }
.file-details { display: flex; flex-direction: column; overflow: hidden; }
.file-details .attach-name {
    font-size: 0.95rem;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-details .attach-size { font-size: 0.75rem; color: #808080; margin-top: 2px; }
/* --- ЗАГРУЗКА ФАЙЛОВ (В Модалке) --- */
.file-upload-area {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.upload-controls {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
}
.upload-hint { font-size: 0.8rem; color: #666; }

/* Список выбранных файлов */
.selected-files-list {
    display: flex; flex-direction: column; gap: 8px;
}

.selected-file-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.delete-file-btn {
    background: none; border: none; color: #ff5c5c; cursor: pointer; font-weight: bold; font-size: 1.1rem;
}
.delete-file-btn:hover { color: #ff0000; }


/* --- ЗАГОЛОВОК ТЕМЫ--- */

.thread-header-wrapper {
    text-align: center;
    margin-bottom: 50px;
}

/* Ссылка на категорию (над заголовком) */
.category-badge {
    display: inline-block;
    color: #58BFFF;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-decoration: none;
    background: rgba(88, 191, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(88, 191, 255, 0.2);
    transition: all 0.3s;
}

.category-badge:hover {
    background: #58BFFF;
    color: white;
    transform: translateY(-2px);
}

.thread-header-wrapper .page-title {
    margin-bottom: 0;
    font-size: 2rem;
    line-height: 1.3;
}

/* --- СТРАНИЦА МАТЕРИАЛОВ --- */

.materials-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    position: relative;
}
.materials-header .pagination-simple {
    position: absolute;
    right: 0;
    top: 10px;
}

/* СЕТКА КНИГ */
.materials-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 40px 30px;
    margin-bottom: 80px;
}

/* Карточка */
.material-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    width: 100%;
}

.material-card:hover {
    transform: translateY(-10px);
}

/* Обложка */
.material-cover-wrapper {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.material-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

/* Эффект при наведении на обложку */
.material-card:hover .material-img {
    transform: scale(1.05);
    filter: brightness(0.7);
}

.material-hover-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #58BFFF;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: bold;
}
.material-card:hover .material-hover-overlay {
    opacity: 1;
}


/* Текстовая часть */
.material-info {
    padding: 0 5px;
}

.material-author {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.material-book-title {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Адаптив для мобилок: центрируем пагинацию */
@media (max-width: 768px) {
    .materials-header .pagination-simple {
        position: static;
        margin-top: 20px;
    }
}

/* --- ДЕТАЛЬНАЯ СТРАНИЦА КНИГИ --- */

/* Большая карточка */
.book-detail-card {
    background: linear-gradient(145deg, #1a1f26 0%, #0d1117 100%);
    border: 1px solid rgba(88, 191, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(62, 123, 153, 0.1);

    border-radius: 30px;
    padding: 60px;
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
}

.book-info-side {
    flex: 1;
}

.book-cover-side {
    width: 300px;
    flex-shrink: 0;
}
.book-cover-side img {
    width: 100%;
    border-radius: 10px;
    box-shadow: -10px 10px 30px rgba(0,0,0,0.5);
    transform: rotate(2deg);
}

/* Тексты */
.book-authors-large {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.book-title-large {
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 30px;
    line-height: 1.2;
}

.book-description {
    color: #b0b0b0;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 600px;
}

.btn-download-large {
    display: inline-block;
    padding: 15px 50px;
    font-size: 1.1rem;
}

/* --- СЛАЙДЕР "ДРУГИЕ МАТЕРИАЛЫ" (Обновленный) --- */
.other-materials-section {
    margin-top: 80px;
    padding-bottom: 100px;
}

.slider-external-container {
    position: relative;
    padding: 0 80px;
}

.materialsSwiper {
    width: 100%;
    overflow: hidden;
}

/* Кнопки навигации */
.material-next, .material-prev {
    background: white !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10;
}

/* Позиционирование стрелок СНАРУЖИ */
.material-next, .material-prev {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10;
    margin: 0 !important;
}

/* Левая стрелка за пределы карусели */
.material-prev { left: 0 !important; }
.material-next { right: 0 !important; }

/* Стили самих кнопок (белые круги как в макете) */
.material-next:after, .material-prev:after {
    color: #121214 !important;
    font-size: 1.2rem !important;
    font-weight: bold;
}

/* --- СТРАНИЦА КОНТАКТЫ --- */

.contacts-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 80px;
}

.contact-card {
    flex: 1;
    min-width: 400px;
    background: linear-gradient(145deg, #1e2832 0%, #151b22 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.city-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    margin-top: 0;
    color: white;
    text-align: center;
}

.contact-section {
    margin-bottom: 30px;
}

.contact-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.contact-text {
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.5;
}

/* Реквизиты - мелкий шрифт */
.requisites-text {
    font-size: 0.85rem;
    color: #e0e0e0;
    line-height: 1.6;
    white-space: pre-line;
}

/* Нижний блок с телефонами */
.contact-bottom-row {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 30px;
}

.contact-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.col-label {
    font-size: 0.9rem;
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
}

.contact-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s;
}
.contact-link:hover { color: #58BFFF; }

.email-link {
    color: white;
    text-decoration: underline;
    font-size: 1rem;
}
.email-link:hover { color: #58BFFF; }

/* Мессенджеры */
.messengers-block {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.messenger-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s;
}
.messenger-row:hover { opacity: 0.8; }

/* Адаптив контактов */
@media (max-width: 900px) {
    .contacts-wrapper {
        flex-direction: column;
    }
    .contact-card {
        min-width: 100%;
        padding: 30px;
    }
    .contact-bottom-row {
        flex-direction: column;
        gap: 20px;
    }
}


/* --- СТРАНИЦА КОНФЕРЕНЦИЙ --- */

/* Главный блок (Hero) */
.conf-hero-section {
    background: linear-gradient(135deg, #1A2530 0%, #10151a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 60px 80px;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* Декоративное пятно на фоне */
.conf-hero-section::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(88,191,255,0.15) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.conf-status {
    display: inline-block;
    background: rgba(88, 191, 255, 0.1);
    color: #58BFFF;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(88, 191, 255, 0.2);
}

.conf-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.conf-subtitle {
    font-size: 1.5rem;
    color: #a0a0a0;
    font-weight: 300;
    margin-bottom: 40px;
}

/* Сетка деталей (Даты, Место) */
.conf-details-grid {
    display: flex;
    gap: 50px;
    margin-bottom: 40px;
}

.conf-detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-icon {
    font-size: 2rem;
}

.detail-text {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
}

/* Кнопки */
.conf-actions {
    display: flex;
    gap: 20px;
}

.btn-outline {
    padding: 14px 30px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-outline:hover {
    border-color: #58BFFF;
    color: #58BFFF;
}

/* --- ИНФО БЛОК --- */
.conf-info-section {
    display: flex;
    gap: 60px;
    margin-bottom: 100px;
    align-items: flex-start;
}

.conf-text-block {
    flex: 2;
}
.conf-text-block h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 30px;
}
.conf-text-block p {
    color: #e0e0e0;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.conf-stats-block {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-item {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.stat-item:last-child { border-bottom: none; }

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #58BFFF;
}
.stat-desc {
    color: #a0a0a0;
    font-size: 0.9rem;
}

/* --- АРХИВ --- */
.conf-archive-section {
    margin-bottom: 80px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.archive-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s;
}
.archive-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.3);
}

.archive-image {
    height: 180px;
    background-color: #2c3e50;
    background-size: cover;
    background-position: center;
    position: relative;
}

.archive-year {
    position: absolute;
    top: 15px; left: 15px;
    background: #58BFFF;
    color: white;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.archive-content {
    padding: 25px;
}

.archive-meta {
    color: #808080;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.archive-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    line-height: 1.4;
    min-height: 3.6em;
}

/* Адаптив */
@media (max-width: 900px) {
    .conf-hero-section {
        flex-direction: column;
        padding: 40px;
        text-align: center;
    }
    .conf-details-grid {
        justify-content: center;
        flex-wrap: wrap;
    }
    .conf-actions {
        justify-content: center;
    }
    .conf-info-section {
        flex-direction: column;
    }
    .conf-stats-block {
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- АВТОРИЗАЦИЯ И РЕГИСТРАЦИЯ --- */

.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding-top: 40px;
}

/* Заголовок теперь снаружи, стилизуем как page-title, но с отступом */
.auth-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 0 20px rgba(88, 191, 255, 0.4);
}

.auth-card {
    background: rgba(30, 48, 65, 0.9);
    border: 1px solid rgba(88, 191, 255, 0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 30px;
    padding: 50px;
    width: 450px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.wide-card { width: 600px; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    align-items: start;
}

.auth-form .form-row > .form-group,
.auth-form .form-row > div {
    min-width: 0;
}

.auth-form .form-row > :only-child {
    grid-column: 1 / -1;
}

/* Группа поля (Лейбл + Инпут) */
.form-group {
    text-align: left;
}

.auth-label {
    display: block;
    color: #e0e0e0;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 500;
    margin-left: 5px;
}

/* СТИЛЬ ИНПУТОВ */
.auth-input {
    width: 100%;
    height: 50px;
    background: #324a5e;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 20px;
    color: white;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
}

.auth-input:focus {
    border-color: #58BFFF;
    background: #3b566d;
    box-shadow: 0 0 15px rgba(88, 191, 255, 0.2);
}

/* Ссылка "Забыли пароль?" */
.forgot-pass-link {
    display: inline-block;
    margin-top: 10px;
    color: #584a75;
    color: #8daabf !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    width: 100%;
    text-align: right;
}
.forgot-pass-link:hover { color: white !important; }

/* Загрузка файла (вернем рамку) */
.file-upload-group {
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px dashed rgba(88, 191, 255, 0.3);
    transition: border-color 0.3s;
}
.file-upload-group:hover {
    border-color: #58BFFF;
    background: rgba(88, 191, 255, 0.05);
}
.file-label {
    cursor: pointer;
    color: #e0e0e0;
    display: block;
    font-size: 0.9rem;
}
.file-icon { font-size: 1.5rem; display: block; margin-bottom: 5px; }

.auth-btn {
    width: 100%; margin-top: 10px; padding: 15px; border-radius: 12px; font-size: 1.1rem;
}

.auth-footer {
    margin-top: 30px;
    color: #808080;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
}
.auth-footer a { color: white; font-weight: 600; text-decoration: none; }

/* --- ПРОФИЛЬ --- */

.profile-card {
    background: #1A222B;
    border-radius: 30px;
    display: flex;
    overflow: hidden;
    min-height: 700px;
    margin-bottom: 80px;
    border: 1px solid rgba(88, 191, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.profile-sidebar {
    width: 350px; flex-shrink: 0; background: rgba(0,0,0,0.2); padding: 60px 30px;
    display: flex; flex-direction: column; align-items: center; border-right: 1px solid rgba(255,255,255,0.05);
}
.avatar-circle {
    width: 160px; height: 160px; border-radius: 50%; background-color: #d9d9d9; margin-bottom: 30px;
}
.profile-name-display { color: white; font-size: 1.3rem; font-weight: 700; text-align: center; margin-bottom: 30px; }
.profile-stats { margin-top: auto; text-align: center; color: #8daabf; line-height: 2; }

.profile-main { flex: 1; padding: 60px 80px; }
.profile-section-title { color: white; font-size: 1.8rem; margin-bottom: 40px; text-align: center; font-weight: 700; }
.profile-form { display: flex; flex-direction: column; gap: 25px; }
.profile-form label { display: block; color: white; margin-bottom: 10px; font-weight: 600; margin-left: 5px; }

/* --- ТУМБЛЕРЫ (TOGGLE SWITCH) --- */
.visibility-section {
    background: rgba(30, 48, 65, 0.4);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; gap: 20px;
}
.visibility-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.visibility-hint { color: #8daabf; font-size: 0.8rem; }

/* Контейнер поля с тумблером */
.toggle-field-wrapper {
    position: relative;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 5px 60px 5px 5px;
    display: flex; align-items: center;
}
.toggle-field-wrapper .auth-input {
    background: transparent; border: none; height: 40px; padding: 0 10px;
}
.toggle-field-wrapper .auth-input:focus { box-shadow: none; }

/* Сам переключатель */
.switch {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4a5d6e;
    transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
/* Состояние ВКЛ */
input:checked + .slider { background-color: #58BFFF; }
input:checked + .slider:before { transform: translateX(18px); }

/* Ряды */
.form-row { display: flex; gap: 30px; width: 100%; }
.form-row > div { flex: 1; }

@media (max-width: 900px) {
    .profile-card { flex-direction: column; }
    .profile-sidebar { width: 100%; border-right: none; }
    .profile-main { padding: 30px; }
    .form-row { flex-direction: column; gap: 20px; }
}

/* --- АДМИН ПАНЕЛЬ --- */

.admin-card {
    background: rgba(22, 33, 44, 0.95);
    border: 1px solid rgba(88, 191, 255, 0.1);
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    min-height: 700px;
    display: flex;
    overflow: hidden;
    margin-bottom: 80px;
}

/* ЛЕВЫЙ САЙДБАР */
.admin-sidebar {
    width: 300px;
    background: rgba(0,0,0,0.2);
    border-right: 2px solid rgba(255,255,255,0.05);
    padding: 50px 30px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: block;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 40px;
    padding-left: 10px;
    text-decoration: none;
    transition: opacity 0.2s;
    cursor: pointer;
}
.sidebar-header:hover {
    opacity: 0.8;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-nav-link {
    display: block;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 10px;
    transition: color 0.2s;
}

.admin-nav-link:hover {
    color: white;
}

/* Активный пункт меню (Синий) */
.admin-nav-link.active {
    color: #58BFFF;
}

/* Подпункты */
.nav-subitems {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    margin-left: 20px;
    gap: 8px;
    margin-bottom: 10px;
}

.sub-link {
    color: #b0b0b0;
    font-size: 1rem;

    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    display: block;
    padding: 3px 0;
}

.sub-link:hover {
    color: white;
    transform: translateX(5px);
}

.exit-link {
    margin-top: 40px;
    color: #e0e0e0;
}

/* ПРАВАЯ ЧАСТЬ */
.admin-content-area {
    flex: 1;
    padding: 60px 80px;
}

.admin-section-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
}

/* ПЛИТКИ НАВИГАЦИИ (БОЛЬШИЕ КНОПКИ) */
.admin-grid-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.three-cols { grid-template-columns: repeat(3, 1fr); }

.admin-tile {
    background: linear-gradient(145deg, #2c3e50 0%, #202b36 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.admin-tile:hover {
    transform: translateY(-5px);
    border-color: #58BFFF;
    box-shadow: 0 15px 40px rgba(88, 191, 255, 0.1);
}

.admin-tile span {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* КАРТОЧКИ СТАТИСТИКИ (ДАШБОРД) */
.admin-stats-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.stat-card {
    background: linear-gradient(145deg, #2c3e50 0%, #202b36 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 250px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.stat-card:hover {
    transform: translateY(-5px);
    border-color: #58BFFF;
}

.stat-title {
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Адаптив */
@media (max-width: 900px) {
    .admin-card { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 2px solid rgba(255,255,255,0.05); }
    .admin-grid-menu { grid-template-columns: 1fr; }
    .admin-stats-grid { flex-direction: column; align-items: center; }
}

/* --- СПИСКИ ПОЛЬЗОВАТЕЛЕЙ (ADMIN) --- */

/* Заголовок-хлебные крошки */
.page-breadcrumb {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

/* Поле поиска */
.admin-search-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.admin-search-input {
    width: 100%;
    background: rgba(30, 48, 65, 0.6);
    border: 1px solid rgba(88, 191, 255, 0.2);
    border-radius: 12px;
    padding: 15px 50px 15px 20px;
    color: white;
    font-size: 1rem;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
    transition: all 0.2s;
    height: 54px;
}

.search-icon-svg {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
/* Строка пользователя */
.user-row {
    display: flex;
    align-items: center;
    background: rgba(30, 48, 65, 0.6);
    border-radius: 50px;
    padding: 15px 30px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s;
}
.user-row:hover {
    transform: translateX(5px);
    border-color: rgba(88, 191, 255, 0.3);
}

.admin-search-input:focus + .search-icon-svg path {
    stroke: #58BFFF;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 5px rgba(88, 191, 255, 0.8));
    transition: all 0.3s;
}

/* Сама иконка по умолчанию */
.search-icon-svg path {
    stroke: #5a6b7c;
    transition: all 0.3s;
}

/* Цветная полоска статуса слева */
.status-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 8px;
}
.status-wait .status-bar { background: #58BFFF; box-shadow: 0 0 10px #58BFFF; }
.status-accepted .status-bar { background: #4CAF50; box-shadow: 0 0 10px #4CAF50; }
.status-declined .status-bar { background: #F44336; box-shadow: 0 0 10px #F44336; }
.status-blocked .status-bar { background: #808080; }

/* Аватар */
.user-row-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: #d9d9d9;
    margin-right: 20px;
    margin-left: 10px;
}

/* Инфо */
.user-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.info-date { color: white; font-size: 0.75rem; font-weight: 600; }
.info-name { color: white; font-size: 0.95rem; font-weight: 700; }
.info-email { color: #a0a0a0; font-size: 0.85rem; }
.info-status-text { font-size: 0.8rem; margin-top: 2px; }

/* Текст статуса */
.st-wait { color: #58BFFF; }
.st-accept { color: #4CAF50; }
.st-decline { color: #F44336; }

/* Кнопки действий */
.user-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: all 0.2s;
    padding: 5px;
}
.action-btn:hover { opacity: 1; transform: scale(1.1); }
.btn-approve:hover { color: #4CAF50; }
.btn-reject:hover { color: #F44336; }
.btn-block:hover { color: #F44336; }

/* Активный подпункт меню */
.active-sub {
    color: #58BFFF !important;
    font-weight: 700;
}

/* --- ПАГИНАЦИЯ (ADMIN) --- */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.page-btn:hover {
    background: rgba(88, 191, 255, 0.2);
    border-color: #58BFFF;
}

.page-btn.active {
    background: #58BFFF;
    color: #0f1621;
    font-weight: 700;
    border-color: #58BFFF;
}

/* --- МОДЕРАЦИЯ ТЕМ --- */

.topic-card {
    background: rgba(30, 48, 65, 0.6);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.topic-content {
    flex: 1;
    color: white;
}

.topic-header {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e0e0e0;
}
.topic-header span { color: white; }

.topic-author {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 600;
    margin-bottom: 15px;
}
.topic-author span { color: white; }

.topic-text {
    font-size: 0.85rem;
    color: #b0b0b0;
    line-height: 1.5;
    max-width: 90%;
}

/* Вертикальный стек кнопок справа */
.topic-actions-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

/* --- СТРУКТУРА РАЗДЕЛОВ --- */

.structure-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.structure-header-row .page-breadcrumb {
    flex: 1;
    width: auto;
    margin-bottom: 0;
    text-align: left;
}

/* Кнопка Плюс (+) */
.btn-add-section {
    background: none; border: none; cursor: pointer; color: white; transition: 0.2s;
}
.btn-add-section:hover { transform: scale(1.2); color: #58BFFF; }

.structure-row {
    background: rgba(30, 48, 65, 0.6);
    border-radius: 50px;
    padding: 15px 30px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
}
.structure-row:hover {
    border-color: rgba(88, 191, 255, 0.3);
    transform: translateX(5px);
}

.structure-title {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.structure-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Кнопка сохранить внизу */
.structure-save-btn {
    display: block;
    margin: 40px auto 0;
    padding: 12px 40px;
    background: rgba(88, 191, 255, 0.2);
    border: 1px solid #58BFFF;
    color: white;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}
.structure-save-btn:hover {
    background: #58BFFF;
    color: #0f1621;
}

.sortable-ghost {
    opacity: 0.4;
    background: #58BFFF;
    border: 1px dashed white;
}

/* Типографика для контента поста */
.content-typography {
    color: #e0e0e0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-typography p {
    margin-bottom: 20px;
}

.content-typography ul {
    margin-bottom: 20px;
    padding-left: 25px;
}

.content-typography li {
    margin-bottom: 10px;
}

.content-typography b {
    color: white;
}

/* Эффект при наведении на вложения */
.attachment-item:hover img,
.attachment-item.file-card:hover {
    border-color: #58BFFF !important;
    opacity: 0.9;
}

/* --- UI МОДЕРАЦИИ (НОВЫЙ ДИЗАЙН) --- */

/* Контейнер страницы */
.moderation-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding-bottom: 100px;
}

/* Карточка автора (Слева) */
.author-sticky-card {
    width: 280px;
    flex-shrink: 0;
    background: rgba(22, 33, 44, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    position: sticky;
    top: 30px;
    backdrop-filter: blur(20px);
}

.author-meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #8daabf;
}

/* Карточка контента (Справа) */
.content-reading-card {
    flex: 1;
    background: #161b22;
    border: 1px solid rgba(88, 191, 255, 0.1);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
    min-height: 60vh;
}

/* Заголовок темы */
.topic-hero-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
    line-height: 1.3;
    font-weight: 700;
}

.topic-meta-info {
    color: #5a6b7c;
    font-size: 0.9rem;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- ПЛАВАЮЩАЯ ПАНЕЛЬ ДЕЙСТВИЙ (DOCK) --- */
.moderation-dock-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: auto;
}

.moderation-dock {
    background: rgba(30, 48, 65, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 100px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопки в доке */
.dock-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.dock-btn:hover { transform: translateY(-3px); }

/* Цвета кнопок */
.btn-dock-approve {
    background: #4CAF50;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}
.btn-dock-approve:hover { background: #55c559; }

.btn-dock-reject {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff6b6b;
}
.btn-dock-reject:hover { background: rgba(244, 67, 54, 0.1); color: #ff8787; }

.btn-dock-delete {
    width: 45px; height: 45px; padding: 0; justify-content: center;
    background: transparent;
    color: #8daabf;
}
.btn-dock-delete:hover { color: #e0e0e0; background: rgba(255,255,255,0.1); }

/* Разделитель в доке */
.dock-divider {
    width: 1px; height: 25px; background: rgba(255,255,255,0.1); margin: 0 5px;
}

/* --- РЕЖИМ ЧТЕНИЯ (LAYOUT) --- */
.reading-mode-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 120px;
}

/* --- РЕЖИМ ЧТЕНИЯ (FIX) --- */

.author-header-card {
    background: rgba(30, 48, 65, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 20px;

    /* ЖЕСТКОЕ ВЫРАВНИВАНИЕ ПО ЦЕНТРУ */
    display: flex;
    justify-content: space-between;
    align-items: center;

    backdrop-filter: blur(10px);
}

.author-info-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.small-avatar {
    width: 55px; height: 55px;
    border-radius: 50%;
    background: #d9d9d9;
    flex-shrink: 0;
    margin: 0;
}

/* Текстовый блок автора */
.author-text-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.author-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.a-name { color: white; font-weight: 700; font-size: 1.15rem; line-height: 1; }
.a-badge {
    background: rgba(88, 191, 255, 0.1); color: #58BFFF;
    font-size: 0.75rem; padding: 3px 10px; border-radius: 6px;
}
.a-meta { color: #8daabf; font-size: 0.95rem; line-height: 1; }


/* --- ЛИНИЯ-РАЗДЕЛИТЕЛЬ (МЯГКАЯ) --- */
.reading-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 30px 0 40px 0;
}

/* --- ВЛОЖЕНИЯ (FIX РАЗМЕРОВ) --- */

.attachments-grid-uniform {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Единая база для карточки */
.attach-card {
    position: relative;
    height: 160px;
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.attach-card:hover {
    border-color: #58BFFF;
    transform: translateY(-3px);
    background: rgba(255,255,255,0.06);
}

/* Картинка внутри карточки */
.attach-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Файл внутри карточки */
.attach-card.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.file-icon-box { margin-bottom: 12px; opacity: 0.9; }
.file-info-box { width: 100%; }

.file-name {
    color: white; font-size: 0.9rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { color: #5a6b7c; font-size: 0.8rem; margin-top: 5px; }

/* --- СПИСКИ КОНТЕНТА (НОВОСТИ / МАТЕРИАЛЫ) --- */

.content-list-row {
    background: rgba(30, 48, 65, 0.6);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.content-list-row:hover {
    transform: translateX(5px);
    border-color: rgba(88, 191, 255, 0.3);
}

.content-info-meta { color: #8daabf; font-size: 0.85rem; margin-bottom: 5px; }
.content-info-title { color: white; font-weight: 600; font-size: 1rem; line-height: 1.4; }

/* --- ИНТЕРФЕЙС РЕДАКТОРА --- */

/* --- ИНТЕРФЕЙС РЕДАКТОРА (ОБНОВЛЕННЫЙ) --- */

.editor-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Левая колонка теперь растягивается по высоте */
.editor-main-col {
    flex: 1;
    background: rgba(30, 48, 65, 0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 50px;
    min-height: 600px; /* Чтобы всегда было много места для текста */
    display: flex;
    flex-direction: column;
}

.editor-side-col {
    width: 320px;
    flex-shrink: 0;
    background: rgba(30, 48, 65, 0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 30px;
    position: sticky;
    top: 30px;
}

.editor-section-title {
    color: white; font-size: 1.1rem; font-weight: 700; margin-bottom: 20px;
}

/* Поле заголовка */
.title-input-ghost {
    width: 100%; background: transparent; border: none;
    color: white; font-size: 2rem; font-weight: 700; font-family: 'Montserrat', sans-serif;
    outline: none; margin-bottom: 30px; line-height: 1.3;
}
.title-input-ghost::placeholder { color: #5a6b7c; font-weight: 600; }

/* Обложка */
.cover-upload-box {
    width: 100%; height: 200px;
    background: rgba(0,0,0,0.2); border: 1px dashed rgba(88,191,255,0.3);
    border-radius: 16px; display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; transition: 0.2s; color: white; margin-bottom: 20px;
}
.cover-upload-box:hover { background: rgba(88,191,255,0.1); border-color: #58BFFF; }

/* Выступающая вкладка "Файл" для материалов */
.material-file-tab {
    position: absolute;
    top: -45px;
    left: 20px;
    background: #31526b; /* Цвет активной вкладки из макета */
    color: white;
    padding: 12px 25px;
    border-radius: 12px 12px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}
.material-file-tab:hover { background: #3b6382; }

/* --- СТИЛИЗАЦИЯ QUILL.JS ПОД ТЕМНУЮ ТЕМУ --- */

#editor-container {
    flex: 1;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: #e0e0e0;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
}

/* Скрываем стандартные уродливые рамки Quill */
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.1rem !important;
}

/* Панель инструментов (Тулбар) */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important; /* Только тонкая линия снизу */
    padding: 0 0 15px 0 !important;
    margin-bottom: 20px;
}

/* Цвета иконок на панели */
.ql-snow .ql-stroke { stroke: #8daabf !important; transition: 0.2s; }
.ql-snow .ql-fill { fill: #8daabf !important; transition: 0.2s; }
.ql-snow .ql-picker { color: #8daabf !important; transition: 0.2s; }

/* Ховер эффекты (голубые при наведении) */
.ql-snow button:hover .ql-stroke, .ql-snow button.ql-active .ql-stroke { stroke: #58BFFF !important; }
.ql-snow button:hover .ql-fill, .ql-snow button.ql-active .ql-fill { fill: #58BFFF !important; }
.ql-snow .ql-picker:hover { color: #58BFFF !important; }

/* ПОЛЕ ВВОДА ТЕКСТА (ЖЕСТКИЙ ФИКС) */
.ql-editor {
    padding: 0 !important;
    min-height: 400px !important; /* Увеличили минимальную высоту */
    color: #e0e0e0 !important; /* Текст будет белым/светло-серым */
    font-size: 1.1rem !important;
}

/* Фикс черного плейсхолдера */
.ql-editor.ql-blank::before {
    color: #8daabf !important; /* Светло-голубой вместо черного */
    font-style: normal !important;
    left: 0 !important;
    font-weight: 500 !important;
}

/* Картинки внутри текста (если вставлять по одной) */
.ql-editor img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- БЛОКИ ГАЛЕРЕИ И ФАЙЛОВ ПОД ТЕКСТОМ --- */
.news-extra-blocks {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.extra-block-title {
    color: white; font-weight: 600; font-size: 1.1rem; margin-bottom: 15px;
}

/* Зона загрузки файлов/фото */
.upload-dropzone {
    display: block; /* ВАЖНО: Фикс наезжания на текст */
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.2);
    border: 1px dashed rgba(88,191,255,0.3);
    border-radius: 12px;
    padding: 30px 20px; /* Вернул нормальные отступы сюда */
    text-align: center;
    color: #8daabf;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}

.upload-dropzone:hover {
    background: rgba(88,191,255,0.1);
    border-color: #58BFFF;
    color: white;
}

/* Сетка загруженных элементов */
.uploaded-items-grid {
    display: flex; gap: 15px; flex-wrap: wrap; margin-top: 15px;
}

.uploaded-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 0.85rem;
}
.uploaded-item .delete-icon {
    color: #F44336; cursor: pointer; margin-left: auto;
}

/* --- ПАНЕЛЬ ФИЛЬТРАЦИИ --- */
.filter-bar {
    display: flex;
    gap: 15px;
    background: rgba(30, 48, 65, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 40px;
    align-items: center;
    flex-wrap: wrap; /* Для адаптивности на мобильных */
}

.filter-group {
    position: relative;
    flex: 1;
    min-width: 150px;
}

.search-group {
    flex: 2; /* Поиск занимает больше места */
    min-width: 250px;
}

.filter-input, .filter-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.search-group .filter-input {
    padding-left: 45px; /* Место под иконку */
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    stroke: #8daabf;
    pointer-events: none;
}

.filter-input:focus, .filter-select:focus {
    border-color: #58BFFF;
    background: rgba(0, 0, 0, 0.4);
}

/* Стилизация select (убираем дефолтную стрелку браузера и добавляем свою, если нужно, но пока ограничимся базой) */
.filter-select {
    appearance: none;
    cursor: pointer;
}
.filter-select option {
    background: #16212c;
    color: white;
}

.filter-submit {
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 0.95rem;
    height: 100%;
    white-space: nowrap;
}

.filter-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border-radius: 10px;
    text-decoration: none;
    transition: 0.2s;
}
.filter-reset:hover {
    background: #F44336;
    color: white;
}

.no-results {
    color: #8daabf;
    text-align: center;
    padding: 50px;
    font-size: 1.1rem;
    background: rgba(30, 48, 65, 0.3);
    border-radius: 16px;
}

/* Год в карточке материала (3-я строка в сетке) */
.material-year-tag {
    color: #58BFFF;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Год на детальной странице книги (Над авторами) */
.book-year-large {
    color: #58BFFF;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px; /* Отступ до авторов */
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    border-bottom: 1px solid rgba(88, 191, 255, 0.3);
    padding-bottom: 4px;
}

/* --- СТРУКТУРА РЕДАКТОРА --- */
.editor-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.dropzone-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

/* Зоны загрузки */
.file-dropzone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1c242c;
    border: 1px dashed #3a4b5c;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    color: white;
    transition: background 0.3s, border-color 0.3s;
}
.file-dropzone.has-file {
    background: #4CAF50;
    border-color: #4CAF50;
}
.cover-dropzone {
    flex: 1;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1c242c;
    border: 1px dashed #3a4b5c;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: 0.3s;
}
.cover-dropzone img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Кнопки удаления файлов и материалов */
.btn-clear-cross {
    display: none;
    align-items: center;
    justify-content: center;
    background: #F44336;
    color: white;
    border: none;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.3s;
}
.btn-clear-cross.visible {
    display: flex;
}
.btn-clear-cross:hover {
    background: #d32f2f;
}
.btn-delete-full {
    width: 100%;
    border-radius: 12px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    background: transparent;
    border: 2px solid #F44336;
    color: #F44336;
    cursor: pointer;
    transition: 0.3s;
}
.btn-delete-full:hover {
    background: #F44336;
    color: white;
}

/* Иконки действий в списках */
.list-actions-group {
    display: flex;
    gap: 15px;
    align-items: center;
}
.btn-icon-white {
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    padding: 0;
    text-decoration: none;
    transition: opacity 0.2s;
}
.btn-icon-white:hover {
    opacity: 0.7;
}
.modal-btn-uniform {
    height: 45px !important;
    margin: 0 !important;
    padding: 0 20px !important;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-cancel-custom {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.btn-cancel-custom:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-save-custom {
    background-color: #58BFFF;
    color: #000;
}
.btn-save-custom:hover {
    background-color: #4AA5E0;
    transform: translateY(-2px);
}

.profile-avatar-wrapper:hover .avatar-overlay { opacity: 1 !important; }

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8daabf !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    width: 24px;
    height: 24px;
}

.password-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
}

.auth-btn-container {
    width: 100%;
    margin-top: 20px;
}

.btn-primary.auth-btn {
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

input::-ms-reveal,
input::-ms-clear {
    display: none;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

.thread-controls .btn-primary,
.forum-title + .btn-primary,
a.btn-primary[href*="/create"] {
    width: auto !important;
    flex: 0 0 auto !important;
    display: inline-block !important;
    padding: 12px 35px !important;
    white-space: nowrap;
}

/* --- БЕЙДЖИ СТАТУСА ТЕМЫ --- */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-badge.open {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.status-badge.closed {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.thread-closed {
    opacity: 0.6;
    filter: grayscale(30%);
    background: linear-gradient(90deg, rgba(30, 45, 60, 0.8) 0%, rgba(20, 30, 40, 0.5) 100%) !important;
}

.thread-closed:hover {
    opacity: 0.9;
    filter: grayscale(0%);
}

.materials-slider-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 60px;
    box-sizing: border-box;

    --swiper-navigation-size: 25px;
}

.materials-slider-container .material-next,
.materials-slider-container .material-prev {
    color: #58BFFF !important;
    background: transparent !important;
    width: auto !important;
    height: auto !important;
    transition: 0.2s;
    margin-top: -12px !important;
}

.materials-slider-container .material-prev {
    left: 10px !important;
}

.materials-slider-container .material-next {
    right: 10px !important;
}

.materials-slider-container .material-next:hover,
.materials-slider-container .material-prev:hover {
    color: white !important;
}

.materials-slider-container .swiper-button-disabled,
.materials-slider-container .swiper-button-lock {
    display: none !important;
}

/* --- RESPONSIVE REFRESH --- */

html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

main {
    width: 100%;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

body.menu-open {
    overflow: hidden;
}

.wrapper,
.page-container,
.auth-wrapper {
    width: 100%;
}

.header {
    gap: 24px;
    position: relative;
    flex-wrap: nowrap;
}

.header-meta {
    margin-left: 0;
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    margin-left: 64px;
}

.header-actions,
.header-controls,
.header-user-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions {
    justify-content: flex-end;
    min-width: 0;
    margin-left: auto;
}

.nav-menu {
    gap: 40px;
}

.header-controls {
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.header-user-summary {
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.header-user-link {
    color: white;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.25;
    text-decoration: none;
    transition: color 0.2s ease;
    max-width: 240px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-link:hover,
.header-admin-link:hover {
    color: #58BFFF;
}

.header-admin-link {
    color: #58BFFF;
    font-weight: 600;
}

.btn-logout {
    border-color: rgba(244, 67, 54, 0.4);
    color: #F44336;
    justify-content: center;
    font-weight: 600;
}

.notification-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    box-shadow: 0 12px 24px rgba(0,0,0,0.18);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.notification-wrapper:hover {
    border-color: rgba(88, 191, 255, 0.35);
    background: linear-gradient(180deg, rgba(88,191,255,0.14) 0%, rgba(88,191,255,0.05) 100%);
    transform: translateY(-1px);
}

.notification-wrapper svg {
    stroke: #dfe9f2 !important;
}

.menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.menu-toggle:hover {
    border-color: rgba(88, 191, 255, 0.4);
    background: linear-gradient(180deg, rgba(88, 191, 255, 0.18) 0%, rgba(88, 191, 255, 0.06) 100%);
    box-shadow: 0 16px 30px rgba(10, 18, 26, 0.34);
    transform: translateY(-1px);
}

.menu-toggle[aria-expanded="true"] {
    border-color: rgba(88, 191, 255, 0.36);
    background: linear-gradient(180deg, rgba(88, 191, 255, 0.2) 0%, rgba(50, 110, 145, 0.08) 100%);
    box-shadow: 0 18px 34px rgba(8, 17, 24, 0.4);
}

.menu-toggle span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2.5px;
    margin-left: -10px;
    border-radius: 999px;
    background: white;
    transform-origin: center;
    transition: top 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle span:nth-child(1) {
    top: 16px;
}

.menu-toggle span:nth-child(2) {
    top: 22px;
}

.menu-toggle span:nth-child(3) {
    top: 28px;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    top: 22px;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    top: 22px;
    transform: rotate(-45deg);
}

#notif-dropdown {
    max-width: min(92vw, 320px);
}

.hero-slider-container {
    height: min(78vh, 700px);
    min-height: 560px;
}

.hero-slide {
    padding-inline: 48px;
}

.hero-content {
    max-width: 820px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(1.55rem, 2.4vw, 2.2rem);
    line-height: 1.16;
    margin-inline: auto;
}

.page-title,
.section-title,
.profile-section-title,
.auth-page-title {
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.news-grid-home,
.news-page-grid,
.archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid,
.attachments-grid-uniform,
.uploaded-items-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.forum-search-form,
.filter-bar,
.thread-controls,
.topic-page-header,
.structure-header-row,
.content-list-row,
.profile-topic-row,
.thread-controls-secondary,
.upload-controls,
.dropzone-container {
    width: 100%;
}

.forum-search-form input,
.filter-group,
.thread-info,
.user-row-info,
.content-info-title {
    min-width: 0;
}

.thread-controls-secondary,
.list-actions-group,
.structure-actions,
.user-actions {
    flex-wrap: wrap;
}

.thread-control-btn {
    white-space: nowrap;
}

.profile-topic-row,
.content-list-row,
.topic-card,
.structure-row,
.user-row {
    gap: 18px;
}

.profile-topic-meta,
.profile-topic-status {
    min-width: 0;
}

.profile-topic-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start !important;
}

.profile-topic-meta {
    flex: 1 1 auto;
}

.profile-topic-status {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-self: flex-start;
    margin-left: 0;
}

.forum-post,
.book-detail-card,
.conf-hero-section,
.contact-bottom-row {
    gap: 32px;
}

.book-description,
.article-body-text,
.post-body-text,
.requisites-text,
.contact-text {
    overflow-wrap: anywhere;
}

.pagination,
.admin-pagination {
    flex-wrap: wrap;
}

.modal-window,
.auth-card,
.wide-card {
    width: min(100%, 100%);
}

.auth-card {
    max-width: 450px;
}

.wide-card {
    width: min(100%, 760px);
    max-width: 760px;
}

.auth-input,
.filter-input,
.filter-select,
.admin-search-input {
    min-width: 0;
}

@media (max-width: 1360px) {
    .header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 16px;
        row-gap: 10px;
        padding: 20px 0;
    }

    .logo {
        justify-self: start;
    }

    .header-meta {
        display: flex;
        justify-self: end;
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: 0;
    }

    .header-shell {
        display: flex;
        grid-column: 1 / -1;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 20px;
        margin-top: 0;
        margin-left: 0;
        border-radius: 24px;
        background: rgba(18, 28, 38, 0.96);
        border: 1px solid transparent;
        box-shadow: none;
        pointer-events: none;
        transform: translateY(-10px) scale(0.985);
        transform-origin: top center;
        transition: max-height 0.36s ease, opacity 0.24s ease, transform 0.24s ease, padding 0.24s ease, margin-top 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
    }

    .header-shell.is-open {
        max-height: 920px;
        opacity: 1;
        padding: 22px;
        margin-top: 8px;
        border-color: rgba(88, 191, 255, 0.16);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-menu {
        padding: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        border-radius: 0;
        background: transparent;
        border: none;
    }

    .nav-link {
        display: block;
        padding: 2px 0;
        border-radius: 0;
        border: none;
        background: transparent;
        color: #eef4f9;
        font-size: 1.06rem;
        font-weight: 600;
        letter-spacing: 0;
        transition: color 0.2s ease, opacity 0.2s ease;
    }

    .nav-link:hover {
        color: #58BFFF;
        background: transparent;
        transform: none;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 18px 0 6px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: transparent;
        border-radius: 0;
    }

    .header-controls {
        width: auto;
        display: flex;
        justify-content: center;
    }

    .header-user-summary {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        text-align: center;
    }

    .header-user-link {
        max-width: min(70vw, 340px);
        font-size: 1.05rem;
        font-weight: 700;
        text-align: center;
    }

    .header-controls .btn-small,
    .header-user-summary .btn-small {
        width: min(100%, 320px);
        text-align: center;
        margin: 0 auto;
    }

    #notif-badge {
        top: -4px !important;
        right: -6px !important;
        left: auto !important;
    }

    #notif-dropdown {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        width: min(92vw, 340px) !important;
        max-width: min(92vw, 340px) !important;
        margin-top: 0;
        border-radius: 20px !important;
        overflow: hidden;
    }
}

@media (max-width: 1279px) {
    .wrapper {
        padding: 0 32px;
    }

    .hero-slide {
        padding-top: 180px;
    }

    .materials-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .profile-main,
    .admin-content-area {
        padding: 48px 40px;
    }
}

@media (max-width: 1024px) {
    .wrapper {
        padding: 0 24px;
    }

    .hero-slider-container {
        min-height: 0;
        height: auto;
        margin-bottom: 64px;
    }

    .heroSwiper {
        min-height: 560px;
    }

    .hero-slide {
        min-height: 560px;
        padding: 150px 32px 110px;
        align-items: center;
    }

    .heroSwiper .swiper-pagination,
    .swiper-pagination-vertical.swiper-pagination-bullets,
    .swiper-vertical > .swiper-pagination-bullets {
        inset: auto 0 28px 0 !important;
        transform: none !important;
        flex-direction: row;
        justify-content: center;
    }

    .news-grid-home,
    .news-page-grid,
    .archive-grid,
    .admin-grid-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .materials-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .book-detail-card,
    .conf-hero-section,
    .thread-controls,
    .topic-page-header,
    .structure-header-row,
    .contact-bottom-row,
    .content-list-row,
    .topic-card,
    .user-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .book-detail-card {
        padding: 40px;
    }

    .book-cover-side {
        width: min(100%, 320px);
        margin: 0 auto;
    }

    .structure-header-row {
        flex-direction: row;
        align-items: center !important;
        justify-content: space-between;
        gap: 16px;
    }

    .structure-header-row .page-breadcrumb {
        flex: 1;
        margin-bottom: 0;
    }

    .post-sidebar {
        width: 220px;
    }

    .thread-controls-primary,
    .thread-controls-secondary,
    .list-actions-group,
    .structure-actions,
    .user-actions {
        width: 100%;
    }

    .thread-controls-secondary,
    .list-actions-group,
    .structure-actions,
    .user-actions {
        justify-content: flex-start;
    }

    .auth-card {
        padding: 40px 32px;
    }

    .admin-card {
        border-radius: 24px;
    }

    .admin-sidebar,
    .profile-sidebar {
        padding: 36px 28px;
    }

    .admin-content-area,
    .profile-main {
        padding: 36px 28px;
    }

    .admin-stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        width: calc(50% - 15px);
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .wrapper {
        padding: 0 18px;
    }

    .footer {
        padding: 28px 18px;
    }

    .footer-content {
        flex-wrap: wrap;
        gap: 16px 24px;
    }

    .page-section,
    .page-container {
        padding-top: 32px;
        padding-bottom: 56px;
    }

    .news-section,
    .topics-section,
    .materials-section {
        margin-bottom: 88px;
    }

    .page-title,
    .auth-page-title {
        font-size: 1.8rem;
        margin-bottom: 36px;
    }

    .section-title,
    .profile-section-title {
        font-size: 1.5rem;
        margin-bottom: 28px;
    }

    .heroSwiper {
        min-height: 480px;
    }

    .hero-slide {
        min-height: 480px;
        padding: 126px 18px 88px;
    }

    .hero-content h1 {
        font-size: clamp(1.3rem, 4vw, 1.75rem);
        margin-bottom: 28px;
    }

    .auth-form .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .auth-footer {
        white-space: normal;
    }

    .btn-primary,
    .btn-secondary,
    .btn-small {
        width: 100%;
        text-align: center;
    }

    .forum-search-form,
    .filter-bar,
    .upload-controls,
    .dropzone-container,
    .thread-controls-secondary,
    .post-header,
    .visibility-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .forum-search-form svg {
        display: none;
    }

    .search-group,
    .filter-group {
        min-width: 100%;
    }

    .filter-submit,
    .filter-reset,
    .forum-search-form .btn-small {
        width: 100%;
    }

    .news-grid-home,
    .news-page-grid,
    .archive-grid,
    .gallery-grid,
    .attachments-grid-uniform,
    .uploaded-items-grid,
    .admin-grid-menu,
    .materials-grid {
        grid-template-columns: 1fr !important;
    }

    .materials-slider-container,
    .slider-external-container {
        padding: 0 18px;
    }

    .materials-slider-container .material-next,
    .materials-slider-container .material-prev,
    .material-next,
    .material-prev {
        display: none !important;
    }

    .book-detail-card,
    .profile-card,
    .admin-card,
    .forum-post {
        border-radius: 22px;
    }

    .profile-topic-row {
        grid-template-columns: 1fr;
        align-items: stretch !important;
    }

    .profile-topic-status {
        width: auto;
        margin-left: 0;
        justify-content: flex-start;
    }

    .book-detail-card,
    .auth-card,
    .editor-main-col,
    .profile-main,
    .admin-content-area,
    .modal-body,
    .modal-footer {
        padding: 24px;
    }

    .profile-sidebar,
    .admin-sidebar {
        padding: 28px 20px;
    }

    .post-sidebar,
    .forum-post {
        width: 100%;
        min-height: 0;
    }

    .post-sidebar {
        padding: 18px;
        gap: 14px;
    }

    .author-stats,
    .author-academic-info {
        width: 100%;
        text-align: left !important;
    }

    .file-type,
    .file-card,
    .attachment-item.file-type {
        min-width: 0;
        width: 100%;
    }

    .file-card,
    .file-type {
        padding: 14px 16px;
    }

    .file-info-group {
        margin-right: 12px;
    }

    .btn-download::before {
        display: none;
    }

    .contact-card,
    .news-article-block,
    .news-sidebar,
    .topic-card,
    .structure-row,
    .user-row,
    .content-list-row {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .topic-actions-col {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-left: 0;
        padding-top: 16px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .user-actions,
    .list-actions-group {
        justify-content: flex-start;
    }

    .content-list-row:hover,
    .user-row:hover,
    .forum-card:hover,
    .thread-card:hover,
    .structure-row:hover,
    .file-card:hover,
    .sidebar-card:hover,
    .topic-card:hover,
    .archive-card:hover,
    .news-card-home:hover,
    .news-tile:hover,
    .material-card:hover {
        transform: none;
    }

    .modal-window {
        max-height: 92vh;
        border-radius: 20px;
    }

    .modal-header {
        padding: 18px 24px;
    }

    .stat-card {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .wrapper {
        padding: 0 14px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .header {
        gap: 14px;
    }

    .header-shell {
        padding: 0 16px;
        border-radius: 20px;
    }

    .header-shell.is-open {
        padding: 18px 16px;
    }

    .header-actions,
    .header-controls,
    .header-user-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-actions {
        padding: 16px 0 4px;
    }

    .header-user-summary {
        align-items: center;
        text-align: center;
    }

    .notification-wrapper {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .heroSwiper {
        min-height: 420px;
    }

    .hero-slide {
        min-height: 420px;
        padding: 110px 6px 78px;
    }

    .hero-content h1 {
        font-size: 1.12rem;
        line-height: 1.22;
    }

    .page-title,
    .auth-page-title {
        font-size: 1.55rem;
    }

    .pagination,
    .admin-pagination {
        gap: 8px;
    }

    .page-link,
    .page-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .auth-card,
    .book-detail-card,
    .editor-main-col,
    .profile-main,
    .modal-body,
    .modal-footer,
    .admin-content-area {
        padding: 20px;
    }

    .profile-sidebar,
    .admin-sidebar {
        padding: 24px 18px;
    }

    .topic-page-header .btn-primary,
    .thread-controls .btn-primary,
    .thread-control-btn {
        width: 100% !important;
        justify-content: center;
    }

    .status-badge {
        margin-left: 0;
    }

    .thread-card-right-group {
        width: 100%;
        justify-content: space-between;
        margin-left: 0 !important;
    }

    .thread-meta-row,
    .post-header-actions {
        gap: 10px !important;
    }

    .book-title-large {
        font-size: 1.7rem;
    }

    .book-authors-large {
        font-size: 1.2rem;
    }
}

@media (min-width: 1025px) {
    .thread-controls-secondary {
        width: auto !important;
    }
}

@media (max-width: 1024px) {
    .thread-controls {
        gap: 15px;
    }
    .thread-controls-secondary {
        flex-wrap: wrap;
        gap: 10px !important;
    }
}

@media (max-width: 560px) {
    .thread-controls-secondary {
        flex-direction: column;
        align-items: stretch !important;
    }
    .thread-control-btn {
        width: 100% !important;
        justify-content: center;
    }
}

.file-info-group,
.file-details {
    min-width: 0 !important;
}

.file-details .attach-name {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .forum-post {
        flex-direction: column !important;
    }

    .post-sidebar {
        width: 100% !important;
        padding: 15px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        box-sizing: border-box !important;

        display: grid !important;
        grid-template-columns: auto 1fr !important;
        grid-template-rows: auto auto !important;
        row-gap: 4px !important;
        column-gap: 15px !important;
    }

    .post-sidebar img,
    .post-sidebar .avatar-circle {
        width: 50px !important;
        height: 50px !important;
        margin: 0 !important;
        grid-row: 1 / 3 !important;
        grid-column: 1 !important;
    }

    .author-name {
        font-size: 1rem !important;
        margin: 0 !important;
        text-align: left !important;
        grid-row: 1 !important;
        grid-column: 2 !important;
        align-self: end !important;
    }

    .author-status {
        font-size: 0.85rem !important;
        margin: 0 !important;
        text-align: left !important;
        grid-row: 2 !important;
        grid-column: 2 !important;
        align-self: start !important;
    }

    .author-academic-info,
    .author-stats {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        grid-column: 1 / 3 !important;
        width: 100% !important;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 0 !important;
    }

    .author-academic-info {
        margin-top: 12px !important;
        padding-top: 10px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        gap: 10px 15px !important;
        font-size: 0.8rem !important;
    }

    .author-academic-info div {
        margin: 0 !important;
    }

    .author-stats {
        margin-top: 6px !important;
        gap: 10px 15px !important;
        font-size: 0.75rem !important;
        color: #8daabf !important;
    }

    .post-content {
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .post-body-text {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }

    .attachments-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .file-type,
    .attachment-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 1361px) {
    .nav-menu {
        margin: 0 auto !important;
    }
}


.topic-actions-col {
    justify-content: center !important;
    gap: 12px !important;
}

.topic-actions-col a,
.topic-actions-col button {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #8daabf !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.topic-actions-col a:hover,
.topic-actions-col button:hover {
    background: rgba(88, 191, 255, 0.15) !important;
    border-color: #58BFFF !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(88, 191, 255, 0.2) !important;
}

.topic-actions-col svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    stroke-width: 2px !important;
    fill: none !important;
}

body, html {
    max-width: 100vw;
    overflow-x: hidden;
}

.article-body-text {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}

.article-body-text img,
.article-body-text video,
.article-body-text iframe,
.article-body-text table {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.breadcrumbs,
.article-meta-top {
    display: flex;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

@media (max-width: 768px) {
    .article-main-title {
        font-size: 1.5rem !important; /* Уменьшаем огромный заголовок */
        line-height: 1.3 !important;
    }
    .article-meta-top {
        padding-bottom: 15px !important;
        margin-bottom: 20px !important;
    }

    .conf-hero-section {
        padding: 30px 20px !important; /* Убираем гигантские поля */
    }
    .conf-title {
        font-size: 1.4rem !important; /* Успокаиваем гигантский шрифт */
        line-height: 1.3 !important;
    }
    .conf-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 25px !important;
    }

    .conf-details-grid {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: center !important;
    }
    .conf-detail-item {
        justify-content: flex-start !important;
        width: 100%;
        max-width: 300px;
    }

    .conf-actions {
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }
    .btn-outline, .conf-actions .btn-primary {
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .conf-info-section {
        flex-direction: column !important;
        gap: 30px !important;
    }
    .conf-text-block h2 {
        font-size: 1.6rem !important;
    }
    .conf-stats-block {
        padding: 25px 20px !important;
    }
}

.hidden-gallery-item {
    display: none !important;
}

html, body {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

.article-body-text * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.article-body-text img,
.article-main-image img {
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

@media (max-width: 900px) {
    .news-detail-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .news-article-block {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;

        overflow: hidden !important;
    }
}
/* --- МОБИЛЬНАЯ АДАПТАЦИЯ ДЛЯ КУКИ И СОГЛАШЕНИЯ --- */
@media (max-width: 600px) {
    #cookie-banner {
        left: 16px !important;
        right: 16px !important;
        bottom: 24px !important;
        transform: none !important;
        max-width: calc(100% - 32px) !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* Уменьшаем тиски отступов в соглашении, чтобы текст задышал */
    .agreement-card {
        padding: 24px 16px !important; /* Текст больше не сжато */
    }

    /* Адаптируем заголовок политики, чтобы он не съезжал */
    .agreement-card h1 {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
    }

    /* Чуть уменьшаем внешние поля контейнера страницы */
    .page-container {
        padding: 30px 10px !important;
    }
}