 /* Пропишите это в самом начале вашего тега <style> на строке 18 */
html {
    --bg-site-color: #ffffff; /* По умолчанию цвет белый */
}

html[data-theme="dark"] {
    --bg-site-color: #1c1c1e; /* Если атрибут dark, цвет мгновенно станет темным */
}

body {
    background-color: var(--bg-site-color) !important;
}
        /* Подключаем Inter локально */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap; /* Текст появится сразу стандартным шрифтом, затем заменится */
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Обновляем правило для body */
body {
    /* Сначала ищем системные шрифты Apple, затем наш локальный Inter */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

        /* === APPLE STYLE VARIABLES === */
        :root {
            --bg-primary: #f5f5f7;
            --bg-surface: #ffffff;
            --text-primary: #1d1d1f;
            --text-secondary: #86868b;
            --text-tertiary: #a1a1a6;
            --primary-blue: #007aff;
            --primary-hover: #0056d6;
            --border-color: #d2d2d7;
            --border-light: #e5e5e7;
            --radius-large: 20px;
            --radius-medium: 12px;
            --radius-small: 8px;
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
            --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        /* Цвета для тёмной темы (активируются через data-theme="dark") */
[data-theme="dark"] {
    --bg-primary: #0f0f10;       /* Глубокий тёмный фон сайта */
    --bg-surface: #1c1c1e;      /* Цвет карточек и сайдбара (в стиле iOS Dark) */
    --text-primary: #f5f5f7;    /* Белый контрастный текст */
    --text-secondary: #98989d;  /* Светло-серый текст для подписей */
    --text-tertiary: #636366;   /* Тёмно-серый текст */
    --primary-blue: #2f95ff;    /* Чуть более яркий синий, чтобы не слепил на тёмном */
    --primary-hover: #54a9ff;   /* Цвет синих кнопок при наведении в тёмной теме */
    --border-color: #3a3a3c;    /* Тёмные границы элементов */
    --border-light: #2c2c2e;    /* Совсем лёгкие внутренние разделители */
    
    /* Тёмные тени делаем более мягкими и прозрачными, чтобы они не выглядели грязными */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
}
        /* === RESET & BASE === */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.47059;
            letter-spacing: -0.022em;
            font-weight: 400;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            min-height: 100vh;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
        }

        /* === HEADER === */
        .apple-header {
            padding: 72px 0 48px;
            text-align: center;
        }

        .header-title {
            font-family: 'SF Pro Display', -apple-system, sans-serif;
            font-size: 64px;
            font-weight: 700;
            letter-spacing: -0.5px;
            line-height: 1.05;
            margin-bottom: 12px;
            background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header-subtitle {
            font-size: 24px;
            color: var(--text-secondary);
            font-weight: 400;
            margin-bottom: 40px;
            max-width: 640px;
            margin-left: auto;
            margin-right: auto;
        }

        /* Search Bar */
        .search-container {
            max-width: 680px;
            margin: 0 auto 48px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 18px 56px 18px 48px;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-medium);
            font-size: 17px;
            color: var(--text-primary);
            transition: var(--transition);
            font-weight: 400;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 20px;
        }

        .search-clear {
            position: absolute;
            right: 18px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-tertiary);
            cursor: pointer;
            padding: 6px;
            display: none;
            border-radius: 50%;
            transition: var(--transition);
        }

        .search-clear:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        /* === MAIN CONTENT LAYOUT === */
        .main-content {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 32px;
            margin-bottom: 64px;
        }

        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
            }
        }

        /* === SIDEBAR - Manufacturers === */
        .sidebar {
            background: var(--bg-surface);
            border-radius: var(--radius-large);
            padding: 24px;
            box-shadow: var(--shadow-md);
            height: fit-content;
            position: sticky;
            top: 24px;
        }

        .sidebar-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border-light);
            color: var(--text-primary);
        }

        /* Manufacturers List */
        .manufacturers-list {
            max-height: 600px;
            overflow-y: auto;
            padding-right: 8px;
        }

        .manufacturer-item {
            display: flex;
            align-items: center;
            padding: 14px 16px;
            margin-bottom: 6px;
            border-radius: var(--radius-small);
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            color: var(--text-primary);
            border: 1px solid transparent;
        }

        .manufacturer-item:hover {
            background: rgba(0, 122, 255, 0.05);
            border-color: var(--border-color);
        }

        .manufacturer-item.active {
            background: rgba(0, 122, 255, 0.1);
            border-color: var(--primary-blue);
            color: var(--primary-blue);
            font-weight: 500;
        }

        .manufacturer-icon {
            width: 32px;
            height: 32px;
            margin-right: 14px;
            background: linear-gradient(135deg, #f5f5f7, #e5e5ea);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            color: var(--text-primary);
            flex-shrink: 0;
        }

        .manufacturer-item.active .manufacturer-icon {
            background: var(--primary-blue);
            color: white;
        }

        .manufacturer-name {
            font-size: 15px;
            font-weight: 500;
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .manufacturer-count {
            font-size: 13px;
            color: var(--text-tertiary);
            background: var(--bg-primary);
            padding: 4px 8px;
            border-radius: 12px;
            margin-left: 8px;
            font-weight: 400;
        }

        .manufacturer-item.active .manufacturer-count {
            background: white;
    color: var(--primary-blue) !important;
        }

        /* Sidebar Empty State */
        .sidebar-empty-state {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-secondary);
        }

        .sidebar-empty-icon {
            font-size: 32px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .sidebar-empty-text {
            font-size: 15px;
            line-height: 1.4;
        }

        /* === CONTENT AREA === */
        .content-area {
            background: var(--bg-surface);
            border-radius: var(--radius-large);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            min-height: 600px;
        }

        /* Tab Header */
        .tab-header {
            padding: 32px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            gap: 24px;
        }

        .brand-logo-container {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #f5f5f7, #e5e5ea);
            border-radius: var(--radius-medium);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .brand-logo-container img {
            max-width: 60px;
            max-height: 60px;
            object-fit: contain;
        }

        .brand-info h2 {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 8px;
            letter-spacing: -0.3px;
        }

        .brand-website {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--primary-blue);
            text-decoration: none;
            font-size: 17px;
            font-weight: 500;
            padding: 8px 0;
            transition: var(--transition);
        }

        .brand-website:hover {
            opacity: 0.8;
        }

        .brand-website::after {
            content: "→";
            font-size: 18px;
            transition: transform 0.2s;
        }

        .brand-website:hover::after {
            transform: translateX(4px);
        }

        /* Emulators Grid */
        .emulators-container {
            padding: 32px;
        }

        .emulators-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }

        .emulator-card {
            background: var(--bg-primary);
            border-radius: var(--radius-medium);
            padding: 24px;
            border: 1px solid var(--border-light);
            transition: var(--transition);
            text-decoration: none;
            color: inherit;
            display: block;
        }

        .emulator-card:hover {
            border-color: var(--primary-blue);
            box-shadow: var(--shadow-lg);
            transform: translateY(-4px);
        }

        .emulator-name {
            font-size: 17px;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-primary);
        }

        .emulator-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--primary-blue);
            font-size: 15px;
            font-weight: 500;
            text-decoration: none;
            padding-top: 12px;
            border-top: 1px solid var(--border-light);
            margin-top: 12px;
            transition: var(--transition);
        }

        .emulator-link:hover {
            gap: 12px;
        }

        .emulator-link::after {
            content: "→";
            font-size: 16px;
            transition: transform 0.2s;
        }

        .emulator-link:hover::after {
            transform: translateX(4px);
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 80px 40px;
            color: var(--text-secondary);
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 24px;
            opacity: 0.5;
        }

        .empty-state h3 {
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-primary);
        }

        .empty-state p {
            font-size: 17px;
            max-width: 400px;
            margin: 0 auto;
        }

        /* === FOOTER === */
        .apple-footer {
            padding: 48px 0;
            text-align: center;
            border-top: 1px solid var(--border-color);
            margin-top: 64px;
        }

        .footer-content {
            max-width: 800px;
            margin: 0 auto;
        }

        .footer-text {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }

        .footer-link {
            color: var(--primary-blue);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
        }

        .footer-link:hover {
            text-decoration: underline;
        }

        .footer-stats {
            display: flex;
            justify-content: center;
            gap: 32px;
            margin: 32px 0;
            flex-wrap: wrap;
        }

        .stat-item {
            text-align: center;
        }

        .stat-number {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Version Info */
        .version-info {
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid var(--border-color);
            text-align: center;
            font-size: 0.9em;
            color: #666;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .version-info p {
            margin: 0;
            font-size: 13px;
        }

        .changelog-link {
            color: var(--primary-blue);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            font-size: 13px;
        }

        .changelog-link:hover {
            text-decoration: underline;
        }

        /* === CATEGORIES STYLES === */
        .category-section {
            margin-bottom: 32px;
        }

        .category-section:last-child {
            margin-bottom: 0;
        }

        .category-header {
            padding-bottom: 12px;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--border-color);
        }

        .category-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
            display: inline-block;
            padding-right: 10px;
        }

        /* Обновленные стили для заголовка категорий */
        .models-header {
            margin-bottom: 32px;
        }

        .models-header h3 {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .models-count {
            color: var(--text-secondary);
            font-size: 15px;
        }

        /* === RESPONSIVE === */
        @media (max-width: 834px) {
            .header-title {
                font-size: 48px;
            }
            
            .header-subtitle {
                font-size: 20px;
            }
            
            .main-content {
                gap: 24px;
            }
            
            .sidebar {
                position: static;
            }
        }

        @media (max-width: 640px) {
            .header-title {
                font-size: 36px;
            }
            
            .header-subtitle {
                font-size: 18px;
            }
            
            .container {
                padding: 0 16px;
            }
            
            .tab-header {
                flex-direction: column;
                text-align: center;
                gap: 16px;
            }
            
            .brand-info h2 {
                font-size: 28px;
            }
            
            .emulators-grid {
                grid-template-columns: 1fr;
            }

            .version-info {
                flex-direction: column;
                gap: 8px;
            }
        }

        /* === UTILITY CLASSES === */
        .hidden {
            display: none !important;
        }

        .fade-in {
            animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .scrollbar-custom {
            scrollbar-width: thin;
            scrollbar-color: var(--border-color) transparent;
        }

        .scrollbar-custom::-webkit-scrollbar {
            width: 6px;
        }

        .scrollbar-custom::-webkit-scrollbar-track {
            background: transparent;
        }

        .scrollbar-custom::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 3px;
        }

        .scrollbar-custom::-webkit-scrollbar-thumb:hover {
            background: var(--text-tertiary);
        }
        @media (prefers-color-scheme: dark) {
    :root {
        /* Тёмная тема Apple */
        --bg-primary: #000000;      /* Глубокий черный фон */
        --bg-surface: #1c1c1e;     /* Цвет карточек (Space Gray) */
        --text-primary: #f5f5f7;    /* Почти белый текст */
        --text-secondary: #a1a1a6;  /* Приглушенный серый */
        --border-color: #38383a;    /* Тёмные границы */
        --card-shadow: rgba(0, 0, 0, 0.4);
    }
    
    /* Улучшение видимости заголовков в темной теме */
    .header-title {
        background: linear-gradient(135deg, #ffffff 0%, #a1a1a6 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }

    /* Инпуты в темной теме */
    .search-input, .input-apple {
        background: #2c2c2e !important;
        border-color: #3a3a3c !important;
        color: #fff !important;
    }

    /* Эффект наведения для производителей */
    .manufacturer-item:hover {
        background: rgba(255, 255, 255, 0.05) !important;
    }
    
    .manufacturer-count {
        background: #2c2c2e;
        color: var(--text-secondary);
    }
}
    @media (prefers-color-scheme: dark) {
    .manufacturer-icon img {
        filter: brightness(0.9) contrast(1.2);
    }
}

       /* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .main-content {
        display: flex;
        flex-direction: column-reverse; /* Контент (эмуляторы) будет СВЕРХУ, а категории — СНИЗУ */
    }

    .sidebar {
        position: static; /* На мобилках липкость лучше отключить, чтобы не перекрывать экран */
        max-height: none;
        margin-top: 24px;
    }

    .header-title {
        font-size: 32px !important;
    }
}
    /* Итоговый контейнер строки в общем потоке сайта */
.top-help-bar {
    position: absolute;       /* Уплывает вверх при скролле */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;           
    background-color: #ffffff; /* ИЗМЕНЕНО: Чисто белый фон, один в один как карточки на сайте */
    border-bottom: 1px solid #e4e6eb; /* ИЗМЕНЕНО: Мягкая серая каёмка, как границы элементов вашего поиска */
    padding: 14px 50px 14px 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

/* Центрирование текста и иконки */
.banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.top-help-bar .help-icon {
    font-size: 16px;
}

.top-help-bar .help-text {
    color: #1d1d1f; /* Фирменный угольный цвет текста Apple/LINSERV */
    font-weight: 500;
}

/* Синяя ссылка */
.top-help-bar .help-link {
    color: #0071e3; 
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.top-help-bar .help-link:hover {
    color: #005bbd;
    text-decoration: underline;
}

/* Серый крестик закрытия */
.close-banner-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 16px;
    color: #86868b;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
    padding: 6px;
    line-height: 1;
}

.close-banner-btn:hover {
    opacity: 1;
    color: #1d1d1f;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
    .top-help-bar { font-size: 13px; padding: 12px 40px 12px 15px; }
    .banner-content { flex-direction: column; gap: 4px; }
    .top-help-bar .help-link { display: block; margin-left: 0; margin-top: 2px; }
    .close-banner-btn { right: 10px; }
}