/* ===================== ПРЕДУПРЕЖДЕНИЕ МИГАНИЯ ===================== */
html, body {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Предотвращение FOUC */
body {
    animation: fadeIn 0.2s ease-in;
}

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

/* ===================== БАЗОВЫЕ СТИЛИ ===================== */
/* ===================== БАЗОВЫЕ СТИЛИ ===================== */
:root {
    /* Светлая тема (по умолчанию) - стиль Tilda */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F8F9FA;
    --color-bg-accent: #E8F4F8;
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    --color-accent-primary: #2563EB;
    --color-accent-secondary: #7C3AED;
    --color-accent-gradient: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    --color-card-bg: #FFFFFF;
    --color-card-border: #E5E7EB;
    --color-card-hover: #F0F9FF;
    --color-button-bg: #2563EB;
    --color-button-hover: #1D4ED8;
    --color-button-text: #FFFFFF;
    --color-link: #2563EB;
    --color-link-hover: #1D4ED8;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-hero-gradient-start: rgba(37, 99, 235, 0.05);
    --color-hero-gradient-end: rgba(124, 58, 237, 0.05);

    /* Категории */
    --category-easy-bg: #D1FAE5;
    --category-easy-text: #065F46;
    --category-medium-bg: #FEF3C7;
    --category-medium-text: #92400E;
    --category-hard-bg: #FEE2E2;
    --category-hard-text: #991B1B;

    /* Шрифты */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    
    /* Тени */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    
    /* Скругления */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Отступы */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
}

/* Тёмная тема */
.dark-theme {
    --color-bg-primary: #0F0F0F;
    --color-bg-secondary: #1A1A1A;
    --color-bg-accent: #1E293B;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #A0A0A0;
    --color-text-muted: #6B7280;
    --color-accent-primary: #3B82F6;
    --color-accent-secondary: #8B5CF6;
    --color-accent-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --color-card-bg: #1A1A1A;
    --color-card-border: #2D2D2D;
    --color-card-hover: #252525;
    --color-button-bg: #3B82F6;
    --color-button-hover: #2563EB;
    --color-button-text: #FFFFFF;
    --color-link: #3B82F6;
    --color-link-hover: #60A5FA;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-hero-gradient-start: rgba(59, 130, 246, 0.1);
    --color-hero-gradient-end: rgba(139, 92, 246, 0.1);

    --category-easy-bg: rgba(16, 185, 129, 0.2);
    --category-easy-text: #6EE7B7;
    --category-medium-bg: rgba(245, 158, 11, 0.2);
    --category-medium-text: #FCD34D;
    --category-hard-bg: rgba(239, 68, 68, 0.2);
    --category-hard-text: #FCA5A5;
}

/* Светлая тема */
.light-theme {
    --color-bg-primary: #F8FAFC;
    --color-bg-secondary: #EDF2F7;
    --color-text-primary: #1A202C;
    --color-text-secondary: #4A5568;
    --color-accent-primary: #0066CC;
    --color-accent-secondary: #D63384;
    --color-card-bg: rgba(255, 255, 255, 0.9);
    --color-card-border: rgba(0, 102, 204, 0.15);
    --color-node-energy: #0066CC;
    --color-node-hardware: #2B6CB0;
    --color-node-software: #6B46C1;
    --color-node-network: #2C7A7B;
    --color-node-ai: #D63384;
    --color-tree-line: rgba(0, 102, 204, 0.2);
    --color-scrollbar: rgba(0, 102, 204, 0.1);
    --color-header-border: rgba(0, 102, 204, 0.1);
    --color-footer-border: rgba(0, 102, 204, 0.1);
    --color-button-bg: rgba(0, 102, 204, 0.1);
    --color-button-hover: rgba(0, 102, 204, 0.2);
    --color-hint-bg: rgba(255, 255, 255, 0.95);
    --color-hint-border: #0066CC;
    --color-binary-text: rgba(26, 32, 44, 0.2);
    --color-hero-gradient-start: rgba(0, 102, 204, 0.05);
    --color-hero-gradient-end: rgba(214, 51, 132, 0.05);
    --color-progress-bg: rgba(0, 102, 204, 0.1);
    --color-progress-fill: #0066CC;
    --color-timeline: rgba(0, 102, 204, 0.1);
    --color-tag-bg: rgba(0, 102, 204, 0.1);
    --color-tag-text: #0066CC;
    --color-social-bg: rgba(0, 102, 204, 0.05);
    --color-social-hover: rgba(0, 102, 204, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.7;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--color-hero-gradient-start) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, var(--color-hero-gradient-end) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ===================== ТИПОГРАФИЯ ===================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

.gradient-text {
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* ===================== ШАПКА ===================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) 0;
    border-bottom: 2px solid var(--color-card-border);
    margin-bottom: var(--space-3xl);
    position: sticky;
    top: 0;
    background: var(--color-bg-primary);
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px var(--color-shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-left: var(--space-md);
}

.logo-icon {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Большое кольцо - как в pulse-circle */
.logo-circle-large {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #2563EB;
    opacity: 0.7;
}

/* Малое кольцо - как в pulse-circle */
.logo-circle-small {
    position: absolute;
    top: calc(50% + 17.68px);
    left: calc(50% + 17.68px);
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #7C3AED;
    opacity: 0.7;
}

.logo-text h1 {
    margin-bottom: var(--space-xs);
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-link h1 {
    margin: 0;
}

.logo-link .tagline {
    margin: 0;
}

.tagline {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--space-sm) var(--space-md);
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-accent-primary);
    background: var(--color-bg-accent);
    border-color: var(--color-accent-primary);
}

.nav-link.active {
    font-weight: 600;
    border-width: 2px;
}

/* ===================== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===================== */
.theme-toggle-container {
    margin-left: var(--space-md);
    padding-right: var(--space-md);
}

.theme-toggle {
    position: relative;
    width: 56px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-card-border);
    border: 3px solid var(--color-card-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: all 0.3s;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    border-color: var(--color-accent-primary);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.theme-toggle:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

.theme-toggle i {
    position: absolute;
    font-size: 12px;
    transition: all 0.3s;
    z-index: 2;
}

.theme-toggle .fa-moon {
    left: 8px;
    color: var(--color-accent-secondary);
}

.theme-toggle .fa-sun {
    right: 8px;
    color: var(--color-warning);
    opacity: 0.5;
}

.light-theme .theme-toggle .fa-moon {
    opacity: 0.5;
}

.light-theme .theme-toggle .fa-sun {
    opacity: 1;
}

.theme-slider {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent-gradient);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(0);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.light-theme .theme-slider {
    transform: translateX(28px);
}

/* ===================== ГЕРОЙ ===================== */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    margin-bottom: var(--space-4xl);
    padding: var(--space-2xl) 0;
    position: relative;
    border-bottom: 2px solid var(--color-card-border);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: var(--color-accent-gradient);
    opacity: 0.03;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    line-height: 1.2;
    font-weight: 700;
}

.hero p {
    font-size: 1.15rem;
    margin-bottom: var(--space-xl);
    max-width: 90%;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-accent-gradient);
    border: none;
    color: var(--color-button-text);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: transparent;
    border: 2px solid var(--color-card-border);
    color: var(--color-text-primary);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.secondary-button:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
    transform: translateY(-2px);
    background: var(--color-bg-accent);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 2px solid var(--color-card-border);
    position: relative;
}

.stats::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-right: 1px solid var(--color-card-border);
    padding-right: var(--space-md);
}

.stat:last-child {
    border-right: none;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-sm);
    font-weight: 500;
}

.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pulse-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 2px solid var(--color-accent-primary);
    position: relative;
    animation: pulse 3s infinite;
    opacity: 0.2;
    z-index: 3;
}

.pulse-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--color-accent-secondary);
    animation: pulse 3s infinite reverse;
    opacity: 0.3;
}

.circuit-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    background: 
        linear-gradient(90deg, transparent 49%, var(--color-accent-primary) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, var(--color-accent-secondary) 50%, transparent 51%);
    background-size: 30px 30px;
    border-radius: 50%;
    opacity: 0.1;
    z-index: 2;
}

.binary-flow {
    position: absolute;
    bottom: var(--space-lg);
    left: 0;
    right: 0;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0.6;
    z-index: 1;
}

/* ===================== СТАТЬИ ===================== */
.articles-section {
    margin-bottom: var(--space-4xl);
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--color-card-border);
    position: relative;
}

.articles-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

/* Заголовок статьи */
.article-header {
    padding: var(--space-xl) 0;
    border-bottom: 2px solid var(--color-card-border);
    margin-bottom: var(--space-xl);
    position: relative;
}

.article-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.section-header {
    margin-bottom: var(--space-xl);
    text-align: center;
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-card-border);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.4;
}

.section-header h3 {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.no-articles {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.article-card {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-accent-gradient);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--color-accent-primary);
}

.article-card:hover::before {
    opacity: 1;
}

.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s;
    border-bottom: 1px solid var(--color-card-border);
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: var(--space-xl);
}

.article-meta {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-md);
}

.article-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
    line-height: 1.4;
    transition: color 0.3s;
}

.article-card:hover .article-title {
    color: var(--color-accent-primary);
}

/* Более яркие названия статей в тёмной теме */
.dark-theme .article-title {
    color: #F8FAFC;
}

.dark-theme .article-card:hover .article-title {
    color: #60A5FA;
}

.article-excerpt {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
    font-size: 1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all 0.3s;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--color-card-border);
    padding-top: var(--space-md);
    width: 100%;
}

.read-more i {
    transition: transform 0.3s;
}

.read-more:hover {
    gap: var(--space-md);
}

.read-more:hover i {
    transform: translateX(4px);
}

/* Категории */
.category-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
    transition: all 0.3s;
}

.category-badge.easy {
    background: var(--category-easy-bg);
    color: var(--category-easy-text);
    border-color: var(--category-easy-text);
}

.category-badge.medium {
    background: var(--category-medium-bg);
    color: var(--category-medium-text);
    border-color: var(--category-medium-text);
}

.category-badge.hard {
    background: var(--category-hard-bg);
    color: var(--category-hard-text);
    border-color: var(--category-hard-text);
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================== КОНЦЕПЦИЯ ===================== */
.concept-section {
    margin-bottom: var(--space-4xl);
    padding: var(--space-2xl) 0;
    background: var(--color-bg-secondary);
    position: relative;
    border-top: 2px solid var(--color-card-border);
    border-bottom: 2px solid var(--color-card-border);
}

.concept-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 100%;
    background: var(--color-accent-gradient);
    opacity: 0.03;
    filter: blur(80px);
    z-index: 0;
}

.concept-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.concept-section h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    position: relative;
    z-index: 1;
}

.concept-card {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.concept-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--color-accent-primary);
}

.concept-card:hover::before {
    opacity: 0.05;
}

.concept-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-xl);
    position: relative;
    z-index: 1;
    transition: all 0.3s;
    border: 2px solid var(--color-card-border);
}

.concept-card:hover .concept-icon {
    transform: scale(1.1);
}

.concept-icon.spark {
    background: var(--category-easy-bg);
    color: var(--category-easy-text);
    border-color: var(--category-easy-text);
}

.concept-icon.network {
    background: var(--category-medium-bg);
    color: var(--category-medium-text);
    border-color: var(--category-medium-text);
}

.concept-icon.mind {
    background: var(--category-hard-bg);
    color: var(--category-hard-text);
    border-color: var(--category-hard-text);
}

.concept-card h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-md);
}

.concept-card p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}

.concept-chapters {
    margin-top: var(--space-xl);
    position: relative;
    z-index: 1;
}

.chapter-tag {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-bg-accent);
    color: var(--color-accent-primary);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid var(--color-accent-primary);
}

.chapter-tag:hover {
    background: var(--color-accent-primary);
    color: var(--color-button-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===================== ФОРМЫ ===================== */
.form-group {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-card-border);
    position: relative;
}

.form-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    transition: all 0.3s;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: none;
    overflow: hidden;
}

/* Auto-resize textarea */
textarea.auto-resize {
    min-height: 150px;
    resize: none;
    overflow: hidden;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-buttons {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.action-buttons form {
    display: inline;
}

.btn {
    background: var(--color-button-bg);
    border: none;
    color: var(--color-button-text);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn:hover {
    background: var(--color-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-accent-primary);
    color: var(--color-accent-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--color-accent-primary);
    color: var(--color-button-text);
}

.btn-danger {
    background: var(--color-error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #DC2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: var(--color-success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* ===================== АДМИН-ПАНЕЛЬ ===================== */
.admin-nav {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(5px);
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}

.admin-nav::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.admin-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    border: 1px solid transparent;
}

.admin-nav a:hover {
    background: var(--color-button-hover);
    color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
}

.admin-nav a.active {
    background: var(--color-button-bg);
    color: var(--color-accent-primary);
    border: 2px solid var(--color-accent-primary);
}

/* ===================== ТАБЛИЦЫ ===================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-lg);
    background: var(--color-card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid var(--color-card-border);
    box-shadow: var(--shadow-md);
}

table th,
table td {
    padding: var(--space-lg);
    text-align: left;
    border-bottom: 2px solid var(--color-card-border);
}

table th {
    background: var(--color-bg-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-card-border);
}

table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

table td {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--color-bg-accent);
}

/* ===================== СООБЩЕНИЯ ===================== */
.alert {
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.alert i {
    font-size: 1.5rem;
}

.alert-success {
    background: var(--category-easy-bg);
    color: var(--category-easy-text);
    border-color: var(--category-easy-text);
}

.alert-error {
    background: var(--category-hard-bg);
    color: var(--category-hard-text);
    border-color: var(--category-hard-text);
}

.alert-info {
    background: var(--color-bg-accent);
    color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
}

/* ===================== ПОДВАЛ ===================== */
.footer {
    border-top: 3px solid var(--color-card-border);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-4xl);
    background: var(--color-bg-secondary);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent-gradient);
    opacity: 0.4;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--space-2xl);
}

.footer-logo {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.logo-icon.small {
    width: 40px;
    height: 40px;
}

.logo-icon.small .logo-circle-large {
    width: 40px;
    height: 40px;
}

.logo-icon.small .logo-circle-small {
    width: 24px;
    height: 24px;
}

.footer-logo-text h4 {
    margin-bottom: var(--space-sm);
    font-size: 1.3rem;
    border-bottom: 2px solid var(--color-card-border);
    padding-bottom: var(--space-md);
    position: relative;
}

.footer-logo-text p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-card-border);
}

.footer-link:hover {
    color: var(--color-accent-primary);
    transform: translateX(4px);
    border-color: var(--color-accent-primary);
}

.footer-link:last-child {
    border-bottom: none;
}

.footer-social p {
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-sm);
}

.social-icons {
    display: flex;
    gap: var(--space-md);
}

.social-icon {
    width: 44px;
    height: 44px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.social-icon:hover {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: var(--color-button-text);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.binary-footer {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--color-binary-text);
    letter-spacing: 1px;
    padding: var(--space-md) 0;
    border-top: 2px solid var(--color-card-border);
    border-bottom: 2px solid var(--color-card-border);
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    position: relative;
}

.binary-footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

.binary-footer::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

.footer-bottom {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.footer-note {
    margin-top: var(--space-md);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===================== АНИМАЦИИ ===================== */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Анимации при скролле */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.article-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===================== FAQ ===================== */
.faq-section {
    margin-bottom: var(--space-4xl);
    padding: var(--space-2xl) 0;
    border-top: 2px solid var(--color-card-border);
    position: relative;
}

.faq-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

.faq-section h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.faq-section .section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.faq-grid {
    display: grid;
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-lg);
}

.faq-question {
    padding: var(--space-xl);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    font-weight: 600;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    transition: all 0.3s;
    border-bottom: 1px solid transparent;
}

.faq-item.active .faq-question {
    border-bottom-color: var(--color-card-border);
}

.faq-question:hover {
    color: var(--color-accent-primary);
}

.faq-question i {
    transition: transform 0.3s;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-top: 1px solid var(--color-card-border);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 var(--space-xl) var(--space-xl);
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ===================== АДАПТИВНОСТЬ ===================== */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero p {
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .stats {
        justify-content: center;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-md);
    }
    
    .theme-toggle-container {
        margin-left: 0;
        margin-top: var(--space-md);
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .concept-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-nav a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }
}

/* ===================== АДМИН-ПАНЕЛЬ ===================== */
.admin-nav {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
    border-bottom: 2px solid var(--color-card-border);
    padding-bottom: var(--space-lg);
    position: relative;
}

.admin-nav::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
}

.admin-nav a {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.admin-nav a:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
}

.admin-nav a.active {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: var(--color-button-text);
}

/* Разделители между секциями в админке */
main > div:not(.admin-nav) {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 2px solid var(--color-card-border);
    position: relative;
}

main > div:not(.admin-nav)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

main > div:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

main > div:last-child::after {
    display: none;
}

.widget {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    position: relative;
}

.widget::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-accent-gradient);
    opacity: 0.3;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.widget h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: var(--space-md);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-card-border);
    color: var(--color-text-secondary);
}

.widget li:last-child {
    border-bottom: none;
}

.mt-3 {
    margin-top: var(--space-2xl);
}
/* ===================== МОДАЛЬНЫЕ ОКНА ===================== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-content {
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-accent-gradient);
    opacity: 0.5;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    border-bottom: 2px solid var(--color-card-border);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: 2px solid var(--color-card-border);
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-color: var(--color-accent-primary);
}

.modal-body {
    padding: var(--space-xl);
}

/* ===================== СООБЩЕНИЯ (ALERT) ===================== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: alertSlideIn 0.3s ease-out;
    border: 2px solid;
    position: relative;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: var(--category-easy-bg);
    color: var(--category-easy-text);
    border-color: var(--category-easy-text);
}

.alert-success::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--category-easy-text);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.alert-error {
    background: var(--category-hard-bg);
    color: var(--category-hard-text);
    border-color: var(--category-hard-text);
}

.alert-error::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--category-hard-text);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.alert-warning {
    background: var(--category-medium-bg);
    color: var(--category-medium-text);
    border-color: var(--category-medium-text);
}

.alert-warning::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--category-medium-text);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.alert-info {
    background: var(--color-bg-accent);
    color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
}

.alert-info::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-accent-primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* ===================== ДОПОЛНИТЕЛЬНЫЕ КНОПКИ ===================== */
.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-card-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
    background: transparent;
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-button-text);
    border: 2px solid var(--color-error);
}

.btn-danger:hover {
    background: #DC2626;
    color: var(--color-button-text);
    border-color: #DC2626;
}

.btn-success {
    background: var(--category-easy-text);
    color: var(--color-button-text);
    border: 2px solid var(--category-easy-text);
}

.btn-success:hover {
    background: #059669;
    color: var(--color-button-text);
    border-color: #059669;
}

/* ===================== ГРАФ СВЯЗЕЙ СТАТЕЙ ===================== */
.graph-section {
    margin-bottom: var(--space-4xl);
    padding: var(--space-2xl) 0;
    border-top: 2px solid var(--color-card-border);
    position: relative;
}

.graph-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent-gradient);
    opacity: 0.2;
}

.graph-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.graph-controls {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 10;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.zoom-control label {
    color: var(--color-text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.zoom-control input[type="range"] {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-bg-secondary);
    border-radius: 3px;
    outline: none;
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.zoom-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-accent-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.article-graph {
    width: 100%;
    height: 500px;
    background: transparent;
    border-radius: 0;
    border: none;
}

.article-graph svg {
    width: 100%;
    height: 100%;
}

/* Связанные статьи в админ-панели */
.linked-articles {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
}

.linked-articles h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.linked-articles-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.linked-article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.linked-article-item:hover {
    border-color: var(--color-accent-primary);
    background: var(--color-bg-accent);
}

.linked-article-item span {
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

.btn-small {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

/* ===================== EasyMDE Editor ===================== */
.EasyMDEContainer {
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
    transition: border-color 0.3s;
}

.EasyMDEContainer:focus-within {
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.EasyMDEContainer .editor-toolbar {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-card-border);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: var(--space-sm);
}

.EasyMDEContainer .editor-toolbar button {
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    transition: all 0.2s;
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
    background: var(--color-accent-primary);
    color: #fff;
    transform: scale(1.1);
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left: 1px solid var(--color-card-border);
    margin: 0 var(--space-sm);
}

.EasyMDEContainer .editor-toolbar .fa-font[style*="#e74c3c"] {
    color: #e74c3c;
}

.EasyMDEContainer .editor-toolbar .fa-font[style*="#f1c40f"] {
    color: #f1c40f;
}

.EasyMDEContainer .editor-toolbar .fa-font[style*="#27ae60"] {
    color: #27ae60;
}

.EasyMDEContainer .CodeMirror {
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    min-height: 400px;
}

.EasyMDEContainer .CodeMirror-gutters {
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-card-border);
}

.EasyMDEContainer .CodeMirror-linenumber {
    color: var(--color-text-muted);
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left: 2px solid var(--color-accent-primary);
}

.EasyMDEContainer .CodeMirror-selected {
    background: rgba(37, 99, 235, 0.2);
}

.EasyMDEContainer .CodeMirror-placeholder {
    color: var(--color-text-muted);
}

/* Синтаксис Markdown */
.EasyMDEContainer .cm-header {
    color: inherit;
    font-weight: 700;
}

.EasyMDEContainer .cm-strong {
    color: inherit;
    font-weight: 700;
}

.EasyMDEContainer .cm-em {
    color: inherit;
    font-style: italic;
}

.EasyMDEContainer .cm-strikethrough {
    text-decoration: line-through;
    color: inherit;
}

.EasyMDEContainer .cm-link {
    color: var(--color-link);
    text-decoration: underline;
}

.EasyMDEContainer .cm-url {
    color: var(--color-text-muted);
}

.EasyMDEContainer .cm-quote {
    color: var(--color-text-secondary);
    font-style: italic;
    border-left: 3px solid var(--color-accent-primary);
    padding-left: var(--space-sm);
}

/* Предпросмотр */
.EasyMDEContainer .editor-preview {
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    border-left: 1px solid var(--color-card-border);
}

.EasyMDEContainer .editor-preview h1,
.EasyMDEContainer .editor-preview h2,
.EasyMDEContainer .editor-preview h3,
.EasyMDEContainer .editor-preview h4,
.EasyMDEContainer .editor-preview h5,
.EasyMDEContainer .editor-preview h6 {
    color: var(--color-text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.EasyMDEContainer .editor-preview a {
    color: var(--color-link);
}

.EasyMDEContainer .editor-preview code {
    background: var(--color-bg-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.EasyMDEContainer .editor-preview pre {
    background: var(--color-bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.EasyMDEContainer .editor-preview blockquote {
    border-left: 4px solid var(--color-accent-primary);
    padding-left: var(--space-md);
    color: var(--color-text-secondary);
    margin: var(--space-md) 0;
}

/* Режим разделения экрана */
.EasyMDEContainer .editor-preview-side {
    border-left: 1px solid var(--color-card-border);
}

/* Статус бар */
.EasyMDEContainer .editor-statusbar {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-card-border);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* Цветные кнопки для выделения текста */
.EasyMDEContainer .editor-toolbar button.color-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    border: 2px solid var(--color-card-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.EasyMDEContainer .editor-toolbar button.color-btn.red {
    background: #e74c3c;
}

.EasyMDEContainer .editor-toolbar button.color-btn.yellow {
    background: #f1c40f;
}

.EasyMDEContainer .editor-toolbar button.color-btn.green {
    background: #27ae60;
}

.EasyMDEContainer .editor-toolbar button.color-btn.blue {
    background: #3498db;
}

.EasyMDEContainer .editor-toolbar button.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.EasyMDEContainer .editor-toolbar button.color-btn.red:hover {
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
}

.EasyMDEContainer .editor-toolbar button.color-btn.yellow:hover {
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.5);
}

.EasyMDEContainer .editor-toolbar button.color-btn.green:hover {
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.5);
}

/* ===================== Модальное окно выбора статьи ===================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-card-border);
}

.modal-header h3 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.article-list {
    max-height: 400px;
    overflow-y: auto;
}

.article-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--color-card-border);
    margin-bottom: var(--space-sm);
}

.article-item:hover {
    background: var(--color-accent-primary);
    color: #fff;
    transform: translateX(4px);
    border-color: var(--color-accent-primary);
}

.article-item-title {
    font-weight: 500;
}

/* Скроллбар для списка статей */
.article-list::-webkit-scrollbar {
    width: 8px;
}

.article-list::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
}

.article-list::-webkit-scrollbar-thumb {
    background: var(--color-accent-primary);
    border-radius: var(--radius-sm);
}

.article-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-secondary);
}

/* ===================== Сетка заголовков ===================== */
.heading-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.heading-item {
    padding: var(--space-md);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.heading-item:hover {
    border-color: var(--color-accent-primary);
    background: var(--color-bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.heading-preview {
    font-weight: 600;
    color: var(--color-text-primary);
}

.heading-preview.h1 {
    font-size: 2rem;
}

.heading-preview.h2 {
    font-size: 1.75rem;
}

.heading-preview.h3 {
    font-size: 1.5rem;
}

.heading-preview.h4 {
    font-size: 1.25rem;
}

.heading-preview.h5 {
    font-size: 1.1rem;
}

.heading-preview.h6 {
    font-size: 1rem;
}

/* ===================== Сетка цветов ===================== */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.color-item:hover {
    border-color: var(--color-accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-card-border);
    margin-bottom: var(--space-sm);
}

.color-name {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
}

