        * { box-sizing: border-box; margin: 0; padding: 0; }
        
        body { 
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .main-container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }

        h1 {
            text-align: center;
            color: #667eea;
            margin-bottom: 20px;
            font-size: 28px;
        }

        .variant-info {
            text-align: center;
            color: #6b7280;
            font-size: 14px;
            margin-bottom: 20px;
        }

        .layout {
            display: flex;
            gap: 20px;
        }

        .content-area {
            flex: 1;
        }

        .sidebar {
            width: 200px;
            background: #f8f9ff;
            padding: 20px;
            border-radius: 15px;
            border: 2px solid #e5e7eb;
        }

        .sidebar-title {
            font-weight: bold;
            color: #667eea;
            margin-bottom: 15px;
            text-align: center;
            font-size: 16px;
        }

        .variant-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .variant-btn {
            padding: 12px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .variant-btn:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .variant-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .variant-btn.completed {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .home-btn {
            position: fixed;
            top: 20px;
            left: 20px;
            padding: 12px 24px;
            background: white;
            color: #667eea;
            border: 2px solid #667eea;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            text-decoration: none;
            display: inline-block;
            z-index: 1000;
        }

        .home-btn:hover {
            background: #667eea;
            color: white;
        }

        .stats-section {
            background: #f8f9ff;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
            border: 2px solid #e5e7eb;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
        }

        .stat-item {
            text-align: center;
            padding: 15px;
            background: white;
            border-radius: 10px;
        }

        .stat-value {
            font-size: 28px;
            font-weight: bold;
            color: #667eea;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 14px;
            color: #6b7280;
        }

        .check-mark {
            font-size: 14px;
        }

        .sentence-container {
            background: #f8f9ff;
            border: 2px dashed #667eea;
            border-radius: 15px;
            padding: 40px 30px 30px 30px;
            margin-bottom: 30px;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .sentence {
            font-size: 24px;
            line-height: 1.8;
            text-align: center;
            color: #2c3e50;
        }

        .word {
            cursor: pointer;
            transition: all 0.3s ease;
            padding: 2px 6px;
            border-radius: 4px;
            display: inline-block;
            margin: 0 3px;
            position: relative;
        }

        .word:hover {
            background-color: #e8ecff;
            transform: translateY(-2px);
        }

        .word.selected {
            color: #667eea;
        }

        .word.correct {
            background-color: #d1fae5;
        }

        .word.incorrect {
            background-color: #fee2e2;
        }

        .word.not-processed {
            background-color: #fef3c7;
        }

        .word[data-part]::before {
            content: attr(data-part-abbr);
            position: absolute;
            top: -18px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 11px;
            font-weight: 700;
            color: #667eea;
            white-space: nowrap;
        }

        /* Подчёркивания по типам */
        .word.подлежащее {
            border-bottom: 3px solid #667eea;
        }

        .word.сказуемое {
            border-bottom: 6px double #764ba2;
        }

        .word.дополнение {
            border-bottom: 3px dashed #9333ea;
        }

        .word.определение {
            text-decoration: underline wavy #f59e0b;
            text-decoration-thickness: 2px;
            text-underline-offset: 12px;
        }

        .word.обстоятельство {
            position: relative;
            padding-bottom: 2px;
        }

        .word.обстоятельство::after {
            content: '';
            position: absolute;
            bottom: -3px;
            left: 0;
            right: 0;
            height: 3px;
            background-image: repeating-linear-gradient(
                to right,
                #10b981 0px,
                #10b981 8px,
                transparent 8px,
                transparent 10px,
                #10b981 10px,
                #10b981 12px,
                transparent 12px,
                transparent 14px
            );
        }

        .options {
            display: flex;
            gap: 20px;
            margin-bottom: 30px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .option {
            flex: 1;
            min-width: 200px;
            max-width: 220px;
            padding: 20px;
            background: white;
            border: 3px solid #e5e7eb;
            border-radius: 15px;
            cursor: pointer;
            text-align: center;
            font-size: 18px;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .option:hover {
            border-color: #667eea;
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
        }

        .option.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .option-icon {
            font-size: 32px;
        }

        .result-message {
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 10px;
            text-align: center;
            font-size: 18px;
            font-weight: 600;
            display: none;
        }

        .result-message.success {
            background: #d1fae5;
            color: #065f46;
            border: 2px solid #10b981;
        }

        .result-message.error {
            background: #fee2e2;
            color: #991b1b;
            border: 2px solid #ef4444;
        }

        .buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 20px;
        }

        button {
            padding: 15px 35px;
            font-size: 18px;
            font-weight: 600;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .check-btn {
            background: #10b981;
            color: white;
        }

        .check-btn:hover:not(:disabled) {
            background: #059669;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
        }

        .reset-btn {
            background: #ef4444;
            color: white;
        }

        .reset-btn:hover {
            background: #dc2626;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
        }

        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Основные вкладки */
        .main-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            border-bottom: 3px solid #e5e7eb;
        }

        .main-tab {
            padding: 15px 30px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 18px;
            font-weight: 600;
            color: #6b7280;
            transition: all 0.3s;
            margin-bottom: -3px;
        }

        .main-tab:hover {
            color: #667eea;
        }

        .main-tab.active {
            color: #667eea;
            border-bottom-color: #667eea;
        }

        .main-tab-content {
            display: none;
        }

        .main-tab-content.active {
            display: block;
        }

        /* Вкладка "Части речи" */
        .instruction {
            background: #fff3cd;
            border-left: 4px solid #ffc107;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            font-size: 15px;
            color: #856404;
        }

        .parts-analysis {
            background: #f8f9ff;
            padding: 25px;
            border-radius: 12px;
            border-left: 4px solid #667eea;
            margin-bottom: 20px;
        }

        .parts-analysis h3 {
            margin-bottom: 20px;
            color: #667eea;
            font-size: 18px;
            text-align: center;
        }

        .parts-group {
            margin-bottom: 25px;
        }

        .group-title {
            font-weight: bold;
            font-size: 16px;
            color: #667eea;
            margin-bottom: 8px;
        }

        .group-description {
            font-size: 13px;
            color: #6b7280;
            margin-bottom: 15px;
            font-style: italic;
        }

        .part-btn {
            display: block;
            width: 100%;
            padding: 12px 16px;
            margin-bottom: 8px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            text-align: left;
            transition: all 0.3s;
        }

        .part-btn:hover {
            border-color: #667eea;
            background: #f8f9ff;
            transform: translateX(5px);
        }

        .part-btn.active {
            background: #667eea;
            border-color: #667eea;
        }

        .part-btn.active .part-name {
            color: white;
        }

        .part-btn.active .part-comment {
            color: rgba(255, 255, 255, 0.8);
        }

        .part-btn.part-correct {
            background: #10b981;
            border-color: #10b981;
        }

        .part-btn.part-correct .part-name {
            color: white;
        }

        .part-btn.part-correct .part-comment {
            color: rgba(255, 255, 255, 0.8);
        }

        .part-btn.part-incorrect {
            background: #ef4444;
            border-color: #ef4444;
        }

        .part-btn.part-incorrect .part-name {
            color: white;
        }

        .part-btn.part-incorrect .part-comment {
            color: rgba(255, 255, 255, 0.8);
        }

        .part-name {
            display: block;
            font-weight: 600;
            font-size: 15px;
            color: #2c3e50;
            margin-bottom: 4px;
        }

        .part-comment {
            display: block;
            font-size: 12px;
            color: #6b7280;
            user-select: none;
        }

        /* Морфологический разбор (табы по словам) */
        .tabs-container {
            margin-bottom: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            border-bottom: 2px solid #e5e7eb;
            padding-bottom: 10px;
        }

        .tab {
            padding: 12px 20px;
            background: #f3f4f6;
            border: none;
            border-radius: 8px 8px 0 0;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
            color: #6b7280;
            font-weight: 500;
        }

        .tab:hover {
            background: #e5e7eb;
        }

        .tab.active {
            background: #667eea;
            color: white;
            font-weight: bold;
        }

        .analysis-container {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .analysis-container.active {
            display: block;
        }

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

        .section {
            margin-bottom: 20px;
            padding: 15px;
            background: white;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            transition: all 0.3s;
        }

        .section-error {
            background: #fee2e2;
            border-color: #ef4444;
        }

        .section-correct {
            background: #d1fae5;
            border-color: #10b981;
        }

        .section-title {
            font-weight: bold;
            color: #667eea;
            margin-bottom: 12px;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .analysis-container .option {
            padding: 10px 16px;
            border: 2px solid #e5e7eb;
            background: white;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
            font-weight: 500;
        }

        .analysis-container .option:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .analysis-container .option.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .analysis-container .option.option-correct {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .analysis-container .option.option-incorrect {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .analysis-container .option[data-field="case"] {
            flex: 0 0 48px;
            min-width: 48px;
            max-width: 48px;
            width: 48px;
            padding: 6px 0;
            text-align: center;
        }

        /* Морфологический разбор */
        .morph-word-selector {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .morph-word-selector h3 {
            color: #667eea;
            margin-bottom: 15px;
        }

        .morph-words {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .morph-word-btn {
            padding: 10px 20px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
        }

        .morph-word-btn:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .morph-word-btn.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .morph-analysis {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 20px;
            display: none;
        }

        .morph-analysis.active {
            display: block;
        }

        .morph-analysis h3 {
            color: #667eea;
            margin-bottom: 20px;
            font-size: 20px;
        }

        .morph-field {
            margin-bottom: 20px;
        }

        .morph-field label {
            display: block;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
            font-size: 16px;
        }

        .morph-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .morph-option {
            padding: 10px 18px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            font-size: 15px;
            transition: all 0.3s;
        }

        .morph-option:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .morph-option.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .morph-option.correct {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .morph-option.incorrect {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .legend {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .legend h3 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 18px;
        }

        .legend-items {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
        }

        .legend-line {
            width: 60px;
            height: 3px;
            border-radius: 2px;
        }

        .legend-line.подлежащее {
            border-bottom: 3px solid #667eea;
        }

        .legend-line.сказуемое {
            border-bottom: 6px double #764ba2;
        }

        .legend-line.дополнение {
            border-bottom: 3px dashed #9333ea;
        }

        .legend-line.legend-wave {
            display: inline-block;
            width: 30px;
            height: auto;
            border-radius: 0;
            color: transparent;
            font-size: 20px;
            line-height: 1;
            text-decoration: underline wavy #f59e0b;
            text-decoration-thickness: 2px;
            text-underline-offset: 0;
            position: relative;
            top: -10px;
            left: -4px;
        }

        .legend-line.обстоятельство {
            position: relative;
        }

        .legend-line.обстоятельство::after {
            content: '';
            position: absolute;
            bottom: -3px;
            left: 0;
            right: 0;
            height: 3px;
            background-image: repeating-linear-gradient(
                to right,
                #10b981 0px,
                #10b981 8px,
                transparent 8px,
                transparent 10px,
                #10b981 10px,
                #10b981 12px,
                transparent 12px,
                transparent 14px
            );
        }

        /* Модальное окно для ввода имени */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            max-width: 500px;
            width: 90%;
        }

        .modal-content h2 {
            color: #667eea;
            margin-bottom: 20px;
            text-align: center;
        }

        .modal-content p {
            text-align: center;
            font-size: 16px;
            color: #6b7280;
            margin-bottom: 25px;
        }

        .modal-content input {
            width: 100%;
            padding: 15px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-size: 16px;
            margin-bottom: 20px;
        }

        .modal-buttons {
            display: flex;
            gap: 15px;
        }

        .modal-buttons button {
            flex: 1;
        }

        .cancel-btn {
            background: #6b7280;
            color: white;
        }

        .cancel-btn:hover {
            background: #4b5563;
        }

        .save-btn {
            background: #667eea;
            color: white;
        }

        .save-btn:hover {
            background: #5568d3;
        }

        /* Синтаксический разбор - новая вкладка */
        .syntax-role-selector {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .syntax-role-selector h3 {
            color: #667eea;
            margin-bottom: 15px;
        }

        .syntax-words {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .syntax-word-btn {
            padding: 10px 20px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
        }

        .syntax-word-btn:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .syntax-word-btn.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .syntax-role-panel {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 20px;
            display: none;
        }

        .syntax-role-panel.active {
            display: block;
        }

        .syntax-role-panel h3 {
            color: #667eea;
            margin-bottom: 20px;
            font-size: 20px;
        }

        .syntax-role-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .syntax-role-option {
            padding: 12px 20px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
        }

        .syntax-role-option:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .syntax-role-option.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .syntax-role-option.correct {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .syntax-role-option.incorrect {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        /* Вкладка "Шаблоны" */
        .template-section {
            background: #f8f9ff;
            border: 2px solid #e5e7eb;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 20px;
        }

        .template-section h3 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 18px;
        }

        .template-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 12px;
        }

        .template-option {
            padding: 15px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .template-option:hover {
            border-color: #667eea;
            background: #f8f9ff;
        }

        .template-option.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .template-option.correct {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .template-option.incorrect {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .template-code {
            font-weight: bold;
            font-size: 16px;
            margin-bottom: 5px;
            font-family: 'Courier New', monospace;
        }

        .template-name {
            font-size: 14px;
            opacity: 0.9;
        }

        .template-example {
            font-size: 13px;
            margin-top: 8px;
            font-style: italic;
            opacity: 0.8;
        }

        .verb-types-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
        }

        .verb-type-option {
            padding: 15px;
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
        }

        .verb-type-option:hover {
            border-color: #764ba2;
            background: #f8f9ff;
        }

        .verb-type-option.selected {
            background: #764ba2;
            color: white;
            border-color: #764ba2;
        }

        .verb-type-option.correct {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .verb-type-option.incorrect {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .verb-type-code {
            font-weight: bold;
            font-size: 18px;
            margin-bottom: 5px;
            font-family: 'Courier New', monospace;
        }

        .verb-type-name {
            font-size: 14px;
        }

        .help-section {
            background: #fffbeb;
            border: 2px solid #fbbf24;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .help-section h4 {
            color: #d97706;
            margin-bottom: 12px;
            font-size: 16px;
        }

        .help-items {
            display: grid;
            gap: 10px;
        }

        .help-item {
            background: white;
            padding: 12px;
            border-radius: 8px;
            font-size: 14px;
        }

        .help-item strong {
            color: #d97706;
            font-family: 'Courier New', monospace;
        }

    </style>
