* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Хедер */
header {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: #3498db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.search-container {
    position: relative;
    width: 350px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px 10px;
}

.search-button:hover {
    color: #3498db;
}

.search-info {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 20px 20px;
    padding: 10px 15px;
    font-size: 0.8rem;
    color: #7f8c8d;
    display: none;
    z-index: 1001;
}

.search-info.active {
    display: block;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

/* Левая навигация */
.left-nav {
    width: 280px;
    background-color: #ffffff;
    padding: 20px 20px 30px;
    border-right: 1px solid #e1e8ed;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 8px 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    margin-top: 20px;
}

.left-nav h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    font-size: 1.2rem;
    color: #2c3e50;
}

.left-nav ul {
    list-style: none;
}

.left-nav li {
    margin-bottom: 12px;
}

.left-nav a {
    color: #5a6c7d;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.left-nav a:hover {
    background-color: #f1f8ff;
    color: #3498db;
    transform: translateX(5px);
}

.left-nav a.active {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

/* .nav-link {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 24px;
    max-height: 63px;
    white-space: normal;
} */

/* Основной контент */
.main-content {
    flex: 1;
    padding: 40px;
    background-color: white;
    margin: 20px 20px 20px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

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

.article-content h2 {
    margin: 40px 0 20px;
    color: #2c3e50;
    font-size: 1.8rem;
    scroll-margin-top: 100px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Стили для списков */
.article-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

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

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

/* Подсветка найденного текста */
.highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.highlight.active {
    background-color: #ff9800;
    color: white;
}

/* Футер */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.footer-bottom {
    font-size: 0.9rem;
    color: #95a5a6;
}

.footer-bottom a {
    color: #3498db;
    text-decoration: none;
}

/* Адаптивность */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    .left-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
        border-radius: 0 0 8px 8px;
        position: static;
        height: auto;
    }

    .main-content {
        margin: 10px;
    }

    .search-container {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        width: 100%;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}



/* // Стили контента статьи */

.article-content {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: #2a2a2a;
    margin: 0 auto;
    box-sizing: border-box;
}

.article-content p {
    margin: 1em 0;
}

.article-content b,
.article-content strong {
    font-weight: 600;
    color: #1d1d1d;
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
    margin: 2em 0 1em;
    font-weight: 700;
    line-height: 1.3;
    color: #1c3f2b;
}

.article-content h2 {
    font-size: 28px;
    border-left: 4px solid #89b96f;
    padding-left: 12px;
}

.article-content h3 {
    font-size: 24px;
    border-left: 3px solid #b1d48f;
    padding-left: 10px;
}

.article-content h4 {
    font-size: 20px;
    color: #2c5c38;
}

.article-content h5 {
    font-size: 18px;
    color: #3a3a3a;
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 1em 0 1em 1.5em;
    padding-left: 1em;
}

.article-content ul li,
.article-content ol li {
    margin-bottom: 0.5em;
    padding-left: 0.3em;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

/* 📱 Адаптивность для мобильных */
@media (max-width: 768px) {
    .article-content {
        font-size: 16px;
        padding: 16px;
    }

    .article-content h2 {
        font-size: 24px;
        padding-left: 10px;
    }

    .article-content h3 {
        font-size: 20px;
        padding-left: 8px;
    }

    .article-content h4 {
        font-size: 18px;
    }

    .article-content h5 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .article-content {
        font-size: 15px;
        padding: 14px;
    }

    .article-content h2 {
        font-size: 22px;
    }

    .article-content h3 {
        font-size: 18px;
    }

    .article-content h4 {
        font-size: 17px;
    }

    .article-content h5 {
        font-size: 15px;
    }
}


/* // таблица  */

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 16px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.article-content table th,
.article-content table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.article-content table thead {
    background-color: #89b96f;
    color: white;
}

.article-content table tbody tr:nth-child(even) {
    background-color: #f8f9f7;
}

.article-content table tbody tr:hover {
    background-color: #e4f0d6;
    transition: background-color 0.3s ease;
}

.article-content table th {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.03em;
}

.article-content table td {
    font-weight: 400;
}

.article-content table caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    font-size: 18px;
    padding-bottom: 8px;
    color: #1c3f2b;
}

.table-wrapper {
    width: 100%;
    overflow: auto;
}

/* Адаптив для мобилки: оставляем таблицу как есть, но добавляем обёртку с прокруткой */
@media (max-width: 600px) {
    .main-content {
        padding: 40px 12px;
    }

    /* Таблица не меняем, просто прокручиваем */
    .article-content table {
        width: 100%;
        min-width: 600px;
        /* минимальная ширина, чтобы появилась прокрутка */
    }
}