/* ========== СТИЛЬ СТРАНИЦЫ НОВОСТЕЙ PRIME (ФЭНТЕЗИ) ========== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.news-page {
    --news-bg: rgba(26, 17, 12, 0.92);
    --news-gold: #d4af37;
    --news-gold-light: #f5e6b3;
    --news-red: #a84444;
    --news-brown: #5a3e2b;
    --news-light: #f0e6d2;
    --news-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --news-border: 1.5px solid #8b5a2b;
    --news-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
    background: transparent;
}

.news-page .content {
    background: var(--news-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    box-shadow: var(--news-shadow), var(--news-inner-glow);
    border: var(--news-border);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    max-width: 100%;
    overflow-x: hidden;
    padding: 30px 25px;
}

.news-page .content:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.4), inset 0 0 30px rgba(212,175,55,0.12);
}

.news-page .content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
            repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212,175,55,0.02) 2px, rgba(212,175,55,0.02) 4px),
            radial-gradient(circle at 20% 30%, rgba(210,180,140,0.05) 0%, transparent 20%),
            radial-gradient(circle at 80% 70%, rgba(139,69,19,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.news-page .page-title {
    background: linear-gradient(145deg, rgba(44,30,21,0.9), rgba(26,17,12,0.9)) !important;
    padding: 15px 25px !important;
    margin: 0 0 25px 0 !important;
    border: 2px solid #a0522d;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,215,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.news-page .page-title h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
}

/* Вкладки категорий */
.news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid #6b4f2a;
    box-shadow: inset 0 1px 4px #000;
}

.news-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: #fff8e7;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    background: linear-gradient(145deg, #a0522d, #8b4513, #a0522d);
    border: none;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    min-height: 44px;
    flex: 0 1 auto;
}

.news-tab.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c !important;
    font-weight: 700;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    pointer-events: none;
}

/* Карточка новости */
.news-card {
    background: rgba(91, 69, 50, 0.7);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #b07d44;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 10px 25px #000, 0 0 0 1px #d4af37 inset;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 0 2px #d4af37 inset;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed rgba(212,175,55,0.3);
    border-radius: 11px;
    pointer-events: none;
    z-index: 0;
}

.news-card .news_info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.news-card .news_ava {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.5);
    overflow: hidden;
    background: #2b1e0e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card .news_ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card .news_cont_text {
    flex: 1;
    min-width: 200px;
}

.news-card .news-Title {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 10px;
}

.news-card .news-Title .news_type {
    display: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(212,175,55,0.2);
    border: 1px solid #d4af37;
    color: #ffd966;
}

.news-card .news-Title b {
    font-size: 20px;
    color: #fff8e7;
    text-shadow: 1px 1px 2px #000;
    font-weight: 700;
    text-transform: uppercase;
    word-break: break-word;
}

.news-card .news-Title .color-green {
    color: #d4af37;
    font-size: 14px;
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
}

.news-card .rank-lvl {
    color: #f5e6d3;
    font-size: 16px;
    line-height: 1.6;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #b07d44;
    word-break: break-word;
}

.news-card .rank-lvl p {
    margin-bottom: 10px;
}

.news-card .rank-lvl a {
    color: #ffd966;
    text-decoration: none;
    border-bottom: 1px dotted #d4af37;
}

.news-card .rank-lvl a:hover {
    color: #fff;
    border-bottom: 1px solid #ffd700;
    text-shadow: 0 0 8px gold;
}

/* Детальная новость */
.news-detail .news-card {
    margin-bottom: 0;
}

/* Пагинация */
.pagination {
    list-style: none;
    padding-left: 0;
    margin: 40px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.3);
    border-radius: 50px;
    border: 1px solid #6b4f2a;
    padding: 15px;
}

.pagination li {
    list-style: none;
}

.pagination .number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #8b5a2b;
    color: #fff8e7;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    text-decoration: none;
}

.pagination .number:hover:not(.active) {
    background: #b8860b;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #3f2e22, 0 8px 15px #000, 0 0 15px gold;
}

.pagination .number.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    cursor: default;
}

.pagination .pag-arrow {
    background: #3f2e22;
    border: 2px solid #8b5a2b;
    color: #fff8e7;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
}

.pagination .pag-arrow:hover {
    background: #b8860b;
    border-color: #ffd700;
}

/* Пустое состояние */
.no-data-message {
    font-size: 28px;
    color: #c0b09a;
    text-align: center;
    padding: 70px 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    border: 2px dashed #b8860b;
    box-shadow: inset 0 0 30px #000;
}

/* ========== СОВРЕМЕННЫЙ СТИЛЬ БИБЛИОТЕКИ PRIME (ФЭНТЕЗИ-РЕДИЗАЙН) ========== */
.lib-page {
    --lib-bg: rgba(26, 17, 12, 0.92);
    --lib-gold: #d4af37;
    --lib-gold-light: #f5e6b3;
    --lib-red: #a84444;
    --lib-brown: #5a3e2b;
    --lib-light: #f0e6d2;
    --lib-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --lib-border: 1.5px solid #8b5a2b;
    --lib-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
    background: transparent;
}

.lib-page .content {
    background: var(--lib-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 30px 40px;
    box-shadow: var(--lib-shadow), var(--lib-inner-glow);
    border: var(--lib-border);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.lib-page .content:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.4), inset 0 0 30px rgba(212,175,55,0.12);
}

.lib-page .content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
            repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212,175,55,0.02) 2px, rgba(212,175,55,0.02) 4px),
            radial-gradient(circle at 20% 30%, rgba(210,180,140,0.05) 0%, transparent 20%),
            radial-gradient(circle at 80% 70%, rgba(139,69,19,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.lib-page .page-title {
    background: linear-gradient(145deg, rgba(44,30,21,0.9), rgba(26,17,12,0.9)) !important;
    padding: 15px 25px !important;
    margin: 0 0 25px 0 !important;
    border: 2px solid #a0522d;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,215,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.lib-page .page-title h1 {
    font-size: 34px;
    font-weight: 100;
    margin: 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
}

/* ===== ВКЛАДКИ: адаптивная сетка ===== */
.lib-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid #6b4f2a;
    box-shadow: inset 0 1px 4px #000;
}

.lib-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    color: #fff8e7;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #a0522d, #8b4513, #a0522d);
    border: none;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    min-height: 44px;
    word-break: break-word;
    white-space: normal;
}

.lib-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.2), transparent);
    transition: left 0.4s;
    z-index: 0;
}

.lib-tab:hover {
    background: linear-gradient(145deg, #8b4513, #5d2906, #8b4513);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(139, 69, 19, 0.35), 0 0 15px rgba(255, 215, 0, 0.15);
    color: #ffd700 !important;
}

.lib-tab:hover::before {
    left: 100%;
}

.lib-tab.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c !important;
    font-weight: 700;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    pointer-events: none;
}

/* Подменю (дочерние пункты) */
.lib-submenu {
    list-style: none;
    padding: 12px 16px;
    margin: 20px 0 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(145deg, #2f241b, #1f150e);
    border-radius: 10px;
    border: 1.5px solid #a0522d;
    box-shadow: inset 0 2px 5px #000, 0 6px 12px rgba(0,0,0,0.6);
    position: relative;
    z-index: 2;
}

.lib-submenu li {
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
}

.lib-submenu a {
    display: block;
    padding: 10px 24px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border-radius: 10px;
    color: #fff8e7;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid #8b5a2b;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 0 #3f2e22, 0 4px 8px #000;
    position: relative;
    overflow: hidden;
}

.lib-submenu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.15), transparent);
    transition: left 0.3s;
}

.lib-submenu a:hover {
    background: linear-gradient(145deg, #5a3e2b, #3f2e22);
    border-color: #ffd700;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #3f2e22, 0 6px 12px #000, 0 0 12px #ffd700;
}

.lib-submenu a:hover::before {
    left: 100%;
}

.lib-submenu .lib_act_men a {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #fff9f2;
    font-weight: 700;
    box-shadow: 0 0 15px gold, inset 0 0 8px #fff3b0;
    cursor: default;
    pointer-events: none;
    text-shadow: none;
}

/* Основная контентная область */
.lib-content {
    background: rgba(26,17,12,0.75);
    backdrop-filter: blur(6px);
    border-radius: 15px;
    padding: 45px 45px;
    border: 2px solid #b07d44;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 10px 25px #000, 0 0 0 1px #d4af37 inset;
    position: relative;
    z-index: 1;
    color: #f5e6d3;
    font-size: clamp(16px, 4vw, 18px);
    line-height: 1.7;
    word-wrap: break-word;
    animation: libFadeIn 0.6s ease-out;
}

@keyframes libFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.lib-content::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed rgba(212,175,55,0.3);
    border-radius: 11px;
    pointer-events: none;
    z-index: 0;
}

.lib-content::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(212,175,55,0.03) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(160,82,45,0.05) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 18px;
}

.lib-content h1.news-title {
    font-size: 48px;
    margin: 0 0 25px 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    border-left: 10px solid #a84444;
    padding-left: 30px;
    line-height: 1.2;
    font-weight: 700;
    word-break: break-word;
}

.lib-content .rank-lvl {
    color: #f5e6d3;
    font-size: 18px;
    line-height: 1.7;
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    position: relative;
    z-index: 2;
    word-wrap: break-word;
}

.lib-content p {
    margin-bottom: 25px;
}

.lib-content a {
    color: #ffd966;
    text-decoration: none;
    border-bottom: 1px dotted #d4af37;
    transition: all 0.2s;
    font-weight: 500;
    word-break: break-word;
}

.lib-content a:hover {
    color: #fff;
    border-bottom: 1px solid #ffd700;
    text-shadow: 0 0 8px gold, 0 0 15px #ffaa00;
}

.lib-content strong, .lib-content b {
    color: #ffe8b5;
    font-weight: 700;
}

.lib-content em, .lib-content i {
    color: #e0cba0;
    font-style: italic;
}

/* Таблицы с артефактами */
.lib-content table.artifact-table {
    display: inline-block;
    margin: 10px;
    border: 2px solid #d4af37;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212,175,55,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 100%;
}

@media (hover: hover) {
    .lib-content table.artifact-table:hover {
        transform: scale(1.05) rotate(0.5deg);
        box-shadow: 0 0 30px gold;
    }
}

.lib-content table.artifact-table td {
    padding: 0 !important;
    background: rgba(20,15,10,0.05);
}

.lib-content table.artifact-table img {
    display: block;
    border: none;
    box-shadow: none;
    margin: 0;
    max-width: 100%;
}

/* Контейнер для горизонтального скролла артефактов */
.lib-content .artifact-table-container {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}
.lib-content .artifact-table-container .artifact-table {
    display: inline-block;
    margin: 0 5px;
}

/* Изображения */
.lib-content img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    border: 3px solid #d4af37;
    box-shadow: 0 0 25px rgba(0,0,0,0.8), 0 0 15px #b8860b;
    margin: 25px 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.lib-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 35px #ffd700, 0 0 0 2px #fff3b0;
}

.lib-content .lib_img {
    text-align: center;
}

/* Списки */
.lib-content ul, .lib-content ol {
    padding-left: 40px;
    margin: 20px 0;
}

.lib-content li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.lib-content li::marker {
    color: #d4af37;
}

/* Цитаты */
.lib-content blockquote {
    border-left: 6px solid #d4af37;
    background: rgba(212,175,55,0.08);
    padding: 20px 30px;
    font-style: italic;
    border-radius: 0 30px 30px 0;
    margin: 30px 0;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    color: #f0ddc0;
}

.lib-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Код или особые вставки */
.lib-content .underline a {
    border-bottom: 2px dotted #d4af37;
    text-decoration: none;
    font-weight: 600;
}

.lib-content .underline a:hover {
    border-bottom-style: solid;
}

/* ===== УЛУЧШЕНИЯ: Навигация (предыдущая / следующая) ===== */
.lib-navigation {
    display: flex;
    gap: 15px;
    margin-top: 45px;
    padding-top: 20px;
    border-top: 2px dashed #b8860b;
}

.lib-navigation a {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #b8860b;
    border-radius: 50px;
    color: #fff8e7 !important;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 5px 0 #3f2e22, 0 8px 15px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lib-navigation a:first-child::before {
    content: "← ";
    font-size: 1.2em;
}

.lib-navigation a:last-child::after {
    content: " →";
    font-size: 1.2em;
}

.lib-navigation a:hover {
    background: #b8860b;
    color: #1f140c !important;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #3f2e22, 0 12px 20px #000, 0 0 20px gold;
}

/* Пустое состояние / нет данных */
.lib-content .no-data-message {
    font-size: 28px;
    color: #c0b09a;
    text-align: center;
    padding: 70px 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    border: 2px dashed #b8860b;
    box-shadow: inset 0 0 30px #000;
}

/* ===== УЛУЧШЕНИЯ: Стили качества артефактов ===== */
a.macros_artifact_quality0,
span.macros_artifact_quality0 { color: #a5a5a5 !important; font-weight: bold; }
a.macros_artifact_quality1,
span.macros_artifact_quality1 { color: #5cff69 !important; font-weight: bold; }
a.macros_artifact_quality2,
span.macros_artifact_quality2 { color: #23b2e9 !important; font-weight: bold; }
a.macros_artifact_quality3,
span.macros_artifact_quality3 { color: #f11dff !important; font-weight: bold; }
a.macros_artifact_quality4,
span.macros_artifact_quality4 { color: #ff2e2e !important; font-weight: bold; }
a.macros_artifact_quality5,
span.macros_artifact_quality5 { color: #2effe2 !important; font-weight: bold; }
a.macros_artifact_quality6,
span.macros_artifact_quality6 { color: #e09100 !important; font-weight: bold; }

/* ===== УЛУЧШЕНИЯ: Стили для выпадающего подменю на мобильных ===== */
.lib-submenu-select {
    display: none;
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 25px 0;
    background: #2b1e0e;
    color: #fff8e7;
    border: 2px solid #b8860b;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

/* ===== ФИЛЬТРЫ НОВОСТЕЙ ===== */
.news-filters {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    min-width: 200px;
}

.filter-submit,
.date-apply {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.clear-filters {
    color: #ffd966;
    font-size: 18px;
    text-decoration: none;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-range label {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-input {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 8px;
    border-radius: 5px;
}

/* ===== РЕАКЦИИ ===== */
.reactions-block {
    margin-top: 20px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.reactions-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: none;
    border: 1px solid #b8860b;
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.reaction-btn.active {
    background: #b8860b !important;
    color: #1f140c !important;
    border-color: #ffd966 !important;
}

.reaction-btn .count {
    margin-left: 3px;
}

/* ===== КОММЕНТАРИИ ===== */
.comments-block {
    margin-top: 20px;
}

.comment-item {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.comment-author a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

.comment-author a:hover {
    color: #ffd966;
}

.admin-badge {
    color: #ffaa00;
    font-weight: bold;
    margin-left: 5px;
}

.comment-date {
    color: #aaa;
    font-size: 0.9em;
}

.comment-body {
    margin-top: 8px;
    word-break: break-word;
}

.edited-mark {
    font-size: 0.8em;
    color: #aaa;
    margin-left: 10px;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 5px;
    color: #fff;
    transition: opacity 0.2s;
}

.comment-actions .delete-comment-btn {
    background: #5a3737;
}
.comment-actions .edit-comment-btn {
    background: #52523e;
}
.comment-actions .report-comment-btn {
    background: #6a3e24;
}

.comment-actions button:hover {
    opacity: 0.8;
}

.add-comment-form textarea {
    width: 100%;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    resize: vertical;
    margin-bottom: 10px;
}

.add-comment-form button {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.add-comment-form button:hover {
    background: #d4a017;
}

/* Сообщения об ошибках */
.error-message {
    color: #ff6666;
}

/* Всплывающий блок непрочитанных комментариев */
.unread-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    font-size: 14px;
}

.unread-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #b8860b;
    padding-bottom: 8px;
    margin-bottom: 10px;
    color: #ffd966;
    font-weight: bold;
}

.unread-popup .popup-header button {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.unread-popup .popup-content {
    max-height: 300px;
    overflow-y: auto;
}

.unread-item {
    border-bottom: 1px solid #3f2e22;
    padding: 8px 0;
}

.unread-item:last-child {
    border-bottom: none;
}

.unread-item a {
    color: #ffd966;
    text-decoration: none;
    font-weight: 500;
}

.unread-item a:hover {
    text-decoration: underline;
}

.unread-item .comment-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.unread-item .comment-time {
    font-size: 11px;
    color: #888;
    text-align: right;
}

.unread-popup .popup-footer {
    text-align: center;
    margin-top: 10px;
    border-top: 1px solid #3f2e22;
    padding-top: 8px;
}

.unread-popup .popup-footer a {
    color: #b8860b;
    text-decoration: none;
}

.unread-popup .popup-footer a:hover {
    text-decoration: underline;
}

/* Индикатор непрочитанных комментариев */
.unread-comments {
    background: #ff4444;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.unread-comments:hover {
    background: #ff6666;
}

/* Эмодзи-пикер */
.emoji-picker-container {
    position: relative;
    display: inline-block;
    margin-top: 5px;
}

.emoji-toggle-btn {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #ffd966;
    font-size: 1.5em;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
}

.emoji-toggle-btn:hover {
    background: #b8860b;
    color: #1f140c;
}

.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    width: 500px;
    max-width: 90vw;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    font-size: 1.5em;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}

.emoji-item:hover {
    background: #b8860b;
}

/* Модальные окна */
.modal_div {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    z-index: 10000;
    color: #fff;
    font-family: 'Philosopher', sans-serif;
    display: none;
}

.modal_div h3 {
    margin: 0 0 20px 0;
    color: #ffd966;
    font-size: 24px;
    text-align: center;
    border-bottom: 1px solid #b8860b;
    padding-bottom: 10px;
}

.modal_close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    width: 70px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closeButton {
    width: 31px;
    height: 7px;
    position: relative;
}
.closeButton span {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #b8860b;
    top: 50%;
    left: 0;
}
.closeButton span:first-child {
    transform: rotate(45deg);
}
.closeButton span:last-child {
    transform: rotate(-45deg);
}

.modal_div textarea,
.modal_div input[type="text"],
.modal_div input[type="number"] {
    width: 100%;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.modal_div textarea:focus,
.modal_div input:focus {
    outline: none;
    border-color: #ffd966;
    box-shadow: 0 0 5px #b8860b;
}

.modal_div button {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Philosopher', sans-serif;
    font-size: 16px;
    margin-right: 10px;
}

.modal_div button:hover {
    background: #d4a017;
}

.modal_div button[type="button"] {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
}

.modal_div button[type="button"]:hover {
    background: #5a3e2c;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
}

/* Лента активности */
.activity-feed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 370px;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 10px;
    z-index: 9999;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    font-size: 13px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #b8860b;
    padding-bottom: 5px;
}
.activity-header h4 {
    margin: 0;
}

.activity-content {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
}

.activity-filters {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.filter-btn {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 3px 8px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
}
.filter-btn.active {
    background: #b8860b;
    color: #1f140c;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #3f2e22;
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-item a {
    color: #ffd966;
    text-decoration: none;
}
.activity-item a:hover {
    text-decoration: underline;
}
.activity-item .time {
    color: #aaa;
    font-size: 11px;
    margin-left: auto;
}

/* Разное */
#blink1 {
    -webkit-animation: blink1 3s linear infinite;
    animation: blink1 3s linear infinite;
}
@-webkit-keyframes blink1 {
    0% { color: rgba(20, 255, 16, 1); }
    50% { color: rgba(20, 255, 16, 0); }
    100% { color: rgba(20, 255, 16, 1); }
}
@keyframes blink1 {
    0% { color: rgba(20, 255, 16, 1); }
    50% { color: rgba(20, 255, 16, 0); }
    100% { color: rgba(20, 255, 16, 1); }
}
.welcome{
    font-size: 11px;
    color: #cacaca;
}
.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ff4444;
    border-radius: 50%;
    margin-left: 5px;
    box-shadow: 0 0 8px #ff0000;
    vertical-align: middle;
}
.lib-progress-indicator {
    margin-left: 5px;
    font-size: 0.8em;
    color: #ffd966;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-name {
    display: block;
    color: #fff;
    font-size: 17px;
    text-transform: uppercase;
    text-shadow: 0px 3px 2px rgba(38, 26, 16, .25);
    line-height: 34px;
}
.logout-btn {
    color: #fff;
    background: #b8860b;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}
.logout-btn:hover {
    background: #d4a017;
}
.profile {
    padding-top: 7px;
}
.menu li a {
    flex-direction: row;
}
.page .menuBlock-logo {
    display: flex;
}
.admin-badge {
    color: #ffaa00;
    font-weight: bold;
    margin-left: 5px;
}

/* ===== АДАПТИВНОСТЬ (ОСНОВНЫЕ МЕДИАЗАПРОСЫ) ===== */

/* Планшеты и большие телефоны */
@media (max-width: 992px) {
    .news-page .page-title h1,
    .lib-page .page-title h1 {
        font-size: 36px;
    }
    .lib-content {
        padding: 35px;
    }
}

@media (max-width: 768px) {
    .news-page .content,
    .lib-page .content {
        padding: 20px;
    }
    .news-page .page-title h1,
    .lib-page .page-title h1 {
        font-size: 32px;
    }
    .news-card .news_info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .news-card .news_ava {
        margin-bottom: 15px;
    }
    .news-card .news-Title b {
        font-size: 16px;
        font-weight: 100;
    }
    .news-card .news-Title .color-green {
        margin-left: 0;
        white-space: normal;
    }
    .lib-content {
        padding: 25px;
    }
    .lib-content h1.news-title {
        font-size: 32px;
        padding-left: 20px;
    }
    .modal_div {
        width: 95%;
        padding: 15px;
    }
    .modal_div h3 {
        font-size: 20px;
    }
    .activity-feed {
        width: 300px;
    }
}

@media (max-width: 600px) {
    .lib-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    .lib-tab {
        font-size: 14px;
        padding: 10px 5px;
    }
    .news-tabs {
        flex-direction: column;
    }
    .news-tab {
        width: 100%;
    }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-input {
        width: 100%;
    }
    .filter-submit, .date-apply {
        width: 100%;
    }
    .date-range {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .date-range label {
        width: 100%;
    }
    .date-input {
        width: 100%;
    }
    .pagination .number {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    .lib-navigation {
        flex-direction: column;
        gap: 10px;
    }
    .lib-navigation a {
        white-space: normal;
        padding: 12px 15px;
        font-size: 16px;
    }
    .lib-navigation a:first-child::before,
    .lib-navigation a:last-child::after {
        content: none;
    }
    .activity-feed {
        width: 90%;
        left: 5%;
        right: 5%;
        bottom: 10px;
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .lib-submenu {
        display: none;
    }
    .lib-submenu-select {
        display: block;
    }
    .lib-page .content {
        padding: 10px;
    }
    .lib-content {
        padding: 20px;
        font-size: 16px;
    }
    .lib-content h1.news-title {
        font-size: 26px;
        border-left-width: 6px;
        padding-left: 15px;
    }
    .lib-content .artifact-table {
        width: 50px;
        height: 50px;
    }
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .comment-actions button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .lib-tabs {
        grid-template-columns: 1fr;
    }
    .news-card .news-Title b {
        font-size: 15px;
    }
    .news-card .news_ava {
        width: 60px;
        height: 60px;
    }
    .pagination .number {
        width: 34px;
        height: 34px;
    }
}

@media (max-height: 375px) {
    .modal_div {
        top: 5%;
        transform: translate(-50%, 0);
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Поддержка тёмной темы браузера */
@media (prefers-color-scheme: dark) {
    .lib-page .content {
        background: rgba(20, 15, 10, 0.95);
    }
}

/* Отключение анимаций для пользователей с reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lib-content,
    .lib-tab:hover,
    .lib-submenu a:hover,
    .lib-content a:hover,
    .lib-content table.artifact-table:hover,
    .news-card:hover {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        text-shadow: none !important;
    }
    .lib-tab::before, .lib-submenu a::before, .lib-navigation a::before {
        transition: none;
    }
}

/* ===== Общие стили для новых страниц ===== */
.achievements-categories,
.moderation-tabs,
.search-results-list {
    margin: 20px 0;
}

.category h2,
.moderation-tabs h2 {
    color: #ffd966;
    border-bottom: 2px solid rgba(212,175,55,0.3);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.achievements-grid,
.moderation-reports-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.achievement-card,
.report-item {
    background: rgba(91,69,50,0.7);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffd966;
}

.achievement-desc,
.achievement-req,
.achievement-points {
    font-size: 14px;
    color: #ddd;
    margin-top: 5px;
}

.achievement-points {
    color: gold;
    font-weight: bold;
}

/* Модерация */
.moderation-tabs .tab-button {
    padding: 8px 16px;
    background: rgba(91,69,50,0.7);
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    margin-right: 10px;
}

.moderation-tabs .tab-button.active {
    background: #b8860b;
    color: #1f140c;
}

.report-item {
    text-align: left;
    margin-bottom: 15px;
}

.report-header {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #ffd966;
}

.resolve-form textarea {
    width: 100%;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Поиск по тегу */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-result-item {
    background: rgba(91,69,50,0.7);
    border-radius: 5px;
    padding: 10px;
}

.result-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.result-link:hover {
    color: #ffd966;
}

.result-icon {
    font-size: 24px;
}

/* Кнопки поддержки и подписки */
.author-support,
.subscribe-form {
    background: rgba(91,69,50,0.7);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.support-form label {
    display: block;
    margin: 10px 0;
    color: #ffd966;
}

.support-form input,
.support-form textarea {
    width: 100%;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
}