
:root {
    /* Цветовая палитра */
    --primary-color: #0f2b4c;
    --primary-light: #428cdc;
    --secondary-color: #ff6b00;
    --secondary-hover: #ff8533;
    --accent-green: #28a745;
    --text-main: #333333;
    --text-light: #7a8a9e;
    --text-white: #ffffff;
    --bg-body: #f4f6f8;
    --bg-surface: #ffffff;
    --border-color: #e1e5eb;
    
    /* Отступы и размеры */
    --container-width: 75rem; /* ~1200px */
    --header-height: 4rem;
    --border-radius-sm: 0.5rem;
    --border-radius-md: 1rem;
    --border-radius-lg: 1.25rem;
    
    /* Тени */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.25rem 0.5rem rgba(15, 43, 76, 0.1);
    --shadow-lg: 0 0.625rem 1rem rgba(15, 43, 76, 0.15);
    --shadow-inner: inset 0 0.125rem 0.25rem rgba(0, 0, 0, 0.06);

    /* Типографика */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Сброс и базовые стили */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul, ol {
    list-style: none;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Утилитарные классы из HTML (адаптация) */
.flx { display: flex; }
.aic { align-items: center; }
.jcsb { justify-content: space-between; }
.fxg { flex-grow: 1; }
.w500 { font-weight: 500; }
.f12 { font-size: 0.75rem; }
.b10 { margin-bottom: 0.625rem; }
.b20 { margin-bottom: 1.25rem; }
.r10 { margin-right: 0.625rem; }
.r20 { margin-right: 1.25rem; }

/* Wrapper */
.wrap {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Header */
header {
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
}

.head-top {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.download {
    color: var(--text-light);
    gap: 0.5rem;
}

.btn-icon svg {
    fill: var(--text-light);
    transition: var(--transition-base);
}

.btn-icon:hover svg {
    fill: var(--primary-light);
    transform: scale(1.1);
}

.drop {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
}

.drop:hover {
    background-color: rgba(66, 140, 220, 0.1);
}

.drop.time {
    color: var(--text-main);
    font-weight: 400;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 2.5rem; /* h40 эквивалент */
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.fon-blu, .fon-blu2 {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--text-white);
}

.fon-orang {
    background: linear-gradient(135deg, var(--secondary-color), #ff4500);
    color: var(--text-white);
}

.fon-orang:hover {
    background: linear-gradient(135deg, #ff8533, #ff5722);
}

/* Логотип */
.logo svg {
    height: 2.5rem;
    width: auto;
}

.logo path {
    fill: var(--primary-color); /* Переопределение белого цвета из SVG для светлой темы */
}
.logo circle {
    fill: var(--secondary-color);
}

/* Главное меню */
.main-menu ul {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    align-items: center;
}

.main-menu a {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    position: relative;
    padding: 0.5rem 0;
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.main-menu a:hover::after {
    width: 100%;
}

/* Layout Grid */
.content-row {
    display: grid;
    grid-template-columns: 16rem 1fr; /* Сайдбар 256px, контент остальное */
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: start;
}

/* Sidebar */
.menu-category {
    background: var(--bg-surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 0.5rem 0;
}

.menu-category ul li {
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.menu-category ul li:last-child {
    border-bottom: none;
}

.menu-category a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition-base);
}

.menu-category a:hover {
    background-color: #f8f9fa;
    color: var(--primary-light);
    padding-left: 1.25rem; /* Микроанимация сдвига */
}

.menu-category a svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

/* Вложенные списки в сайдбаре */
.menu-category ul ul {
    background-color: #fafbfc;
    display: none; /* Скрыты по умолчанию, можно добавить JS для раскрытия */
}

/* Основной контент */
.content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.box {
    background: var(--bg-surface);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Типографика статьи */
.entry-content {
    color: #4a5568;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1rem;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25em;
    bottom: 0.25em;
    width: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

p {
    margin-bottom: 1rem;
}

/* Списки внутри контента */
.entry-content ul, .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.entry-content ol li {
    list-style-type: decimal;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

/* Оглавление */
nav ol {
    background: #f8faff;
    border: 1px solid #e1e8f0;
    border-radius: var(--border-radius-md);
    padding: 1.5rem 1.5rem 1.5rem 2.5rem;
}

nav ol li {
    font-weight: 500;
}

nav ol li a {
    color: var(--primary-light);
    border-bottom: 1px dashed transparent;
}

nav ol li a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

td, th {
    padding: 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

td[colspan="2"] {
    background-color: var(--primary-color);
    color: var(--text-white);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:nth-child(even) {
    background-color: #f8faff;
}

tr:hover {
    background-color: #edf2f7;
}

/* Кнопка перехода (refka) */
.refka {
    text-align: center;
    margin: 2rem 0;
}

.refka a {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--secondary-color);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
    animation: pulse 2s infinite;
}

.refka a:hover {
    background: var(--secondary-hover);
    transform: scale(1.05);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

/* Элементы форм (для общего стиля) */
input[type="text"], 
input[type="email"], 
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition-base);
}

input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(66, 140, 220, 0.2);
}

/* Адаптивность */
@media (max-width: 992px) {
    .hide_992 {
        display: none !important;
    }

    .content-row {
        grid-template-columns: 1fr;
    }

    .col-left {
        display: none; /* Или order: 2, если нужно показать под контентом */
    }

    h1 {
        text-align: center;
    }
    
    .head-top {
        justify-content: center;
    }
    
    .head-bottom {
        justify-content: center;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .box {
        padding: 1.25rem;
    }
    
    .head-top .flx {
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 0.5rem;
    }
    
    .head-top .flx > div {
        margin-right: 0;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Улучшение визуального восприятия изображений */
img.loaded {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}
