/* ===== БАЗОВЫЙ СБРОС ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8faff;
    color: #1a1a2e;
    line-height: 1.6;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ШАПКА ===== */
.header {
    background: #0f0f1f;
    padding: 12px 0;
    border-bottom: 2px solid rgba(74, 108, 247, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo span {
    color: #FFF8DC;
}
.logo i {
    color: #4a6cf7;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
    align-items: center;
}
.nav-menu a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}
.nav-menu a:hover {
    color: #fff;
    background: rgba(74, 108, 247, 0.15);
}
.btn-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: #4a6cf7;
    padding: 6px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.btn-profile:hover {
    background: #3a5bd9;
}

/* ===== ГЕРОЙ ===== */
.materials-hero {
    padding: 40px 0 30px;
    background: linear-gradient(135deg, #0f0f1f 0%, #1a1a3e 100%);
    border-bottom: 1px solid rgba(74, 108, 247, 0.1);
}
.materials-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.materials-hero-text h1 {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}
.materials-hero-text h1 span {
    color: #4a6cf7;
}
.materials-hero-text p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}
.hero-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.7;
}
@media (max-width: 600px) {
    .materials-hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-logo { width: 60px; height: 60px; }
}

/* ===== ОСНОВНОЙ БЛОК ===== */
.methodology-wrapper {
    display: flex;
    gap: 30px;
    padding: 30px 0 60px;
    align-items: flex-start;
}

/* ===== САЙДБАР ===== */
.sidebar-toc {
    flex: 0 0 260px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid #f0f2f8;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.sidebar-toc::-webkit-scrollbar {
    width: 4px;
}
.sidebar-toc::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.toc-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a6cf7;
    padding: 0 20px 12px;
    border-bottom: 1px solid #edf2f7;
}
.toc-list {
    list-style: none;
    padding: 8px 0;
}
.toc-list li {
    padding: 0;
}
.toc-list a {
    display: block;
    padding: 8px 20px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.toc-list a:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.toc-list a.active-toc {
    background: #eef4ff;
    color: #4a6cf7;
    border-left-color: #4a6cf7;
    font-weight: 600;
}

/* ===== КОНТЕНТ ===== */
.methodology-content {
    flex: 1;
    min-width: 0;
}
.doc-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.02);
    border: 1px solid #f0f2f8;
}
.doc-card h2 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}
.doc-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 20px 0 10px;
}
.doc-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 16px 0 8px;
}
.doc-card p {
    color: #334155;
    margin-bottom: 16px;
}
.doc-card ul, .doc-card ol {
    padding-left: 24px;
    margin-bottom: 16px;
    color: #334155;
}
.doc-card li {
    margin-bottom: 6px;
}

/* ===== БЛОКИ КОДА ===== */
.code-block {
    background: #0f172a;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0 20px;
    position: relative;
    overflow-x: auto;
}
.code-block pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.code-block .copy-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: #94a3b8;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #f1f5f9;
}

/* ===== МЕДИА ===== */
.media-item {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9edf4;
}
.media-item img {
    width: 100%;
    height: auto;
    display: block;
}
.media-item video {
    width: 100%;
    display: block;
}
.media-item iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}
.media-item .caption {
    padding: 8px 16px;
    font-size: 14px;
    color: #475569;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 860px) {
    .methodology-wrapper {
        flex-direction: column;
    }
    .sidebar-toc {
        flex: auto;
        position: relative;
        top: 0;
        max-height: 300px;
        width: 100%;
    }
    .doc-card {
        padding: 20px;
    }
}
@media (max-width: 480px) {
    .doc-card h2 { font-size: 22px; }
}

/* ===== ФОРМАТИРОВАНИЕ ТЕКСТА ===== */
.highlight-red { color: #ef4444; }
.highlight-blue { color: #3b82f6; }
.highlight-green { color: #22c55e; }
.highlight-yellow { color: #eab308; }
.highlight-purple { color: #a855f7; }
.highlight-orange { color: #f97316; }

.bg-red { background: #fef2f2; padding: 2px 6px; border-radius: 4px; }
.bg-blue { background: #eff6ff; padding: 2px 6px; border-radius: 4px; }
.bg-green { background: #f0fdf4; padding: 2px 6px; border-radius: 4px; }
.bg-yellow { background: #fefce8; padding: 2px 6px; border-radius: 4px; }
.bg-purple { background: #faf5ff; padding: 2px 6px; border-radius: 4px; }
.bg-orange { background: #fff7ed; padding: 2px 6px; border-radius: 4px; }

b, strong { font-weight: 700; }
i, em { font-style: italic; }
u { text-decoration: underline; }
s, strike { text-decoration: line-through; }

.note-info { background: #eff6ff; border-left: 4px solid #3b82f6; padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
.note-warning { background: #fefce8; border-left: 4px solid #eab308; padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
.note-tip { background: #f0fdf4; border-left: 4px solid #22c55e; padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
.note-danger { background: #fef2f2; border-left: 4px solid #ef4444; padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
