*{margin:0;padding:0;box-sizing:border-box}body{font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;background-color:#f7f7f7;height:100vh;/*overflow:hidden;*/padding:20px}h1{text-align:center;color:#333;margin-bottom:20px;font-size:20px;font-weight:500}.container{display:flex;gap:15px;height:calc(100vh - 100px);overflow-x:auto}.column{flex:1;min-width:300px;background-color:#fff;border-radius:6px;padding:15px;box-shadow:0 2px 6px rgba(0,0,0,.1);display:flex;flex-direction:column}.column h2{margin-top:0;color:#555;border-bottom:1px solid #eee;padding-bottom:8px;font-size:16px;font-weight:600}textarea{width:100%;height:100%;padding:10px;font-family:Courier New,monospace;font-size:14px;border:1px solid #ccc;border-radius:4px;resize:none;outline:none;overflow-y:auto;margin-bottom:15px}#result{overflow-y:auto}#jsCode,#result{flex:1;padding:10px;font-family:Courier New,monospace;font-size:14px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word;border:1px solid #ddd;border-radius:4px;background-color:#fafafa}#jsCode{overflow-y:hidden;height:100%}.toggle{cursor:pointer;color:#2980b9;font-weight:700;user-select:none;margin-right:5px}.toggle:before{content:"▶ ";transition:transform .2s ease}.toggle.expanded:before{content:"▼ "}.array-content{margin-left:20px;margin-top:5px;padding-left:10px;border-left:1px dashed #ccc;display:none}.img-link{position:relative;color:#2980b9;text-decoration:underline;cursor:pointer;display:inline-flex;align-items:center;gap:4px}.img-link .open-new{opacity:0;transition:opacity .2s ease;font-size:12px;color:#666;background:#fff;border:1px solid #ddd;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.img-link:hover{color:#4caf50}.img-link:hover .open-new{opacity:1}.image-preview{position:absolute;top:-130px;left:50%;transform:translateX(-50%);background:#fff;border:1px solid #ccc;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.2);padding:8px;z-index:1000;max-width:300px;pointer-events:none;animation:fadeIn .3s ease-out;display:block;width:300px;text-align:center}.image-preview img{max-width:100%;max-height:180px;object-fit:contain;border-radius:4px}.image-preview:after{content:"";position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:#fff}@keyframes fadeIn{0%{opacity:0;transform:translateX(-50%) translateY(-10px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}#jsCode.error,#result.error{color:#c0392b;background-color:#ffebee;border-left:4px solid #c0392b}#jsCode.success,#result.success{color:#27ae60;background-color:#e8f5e9;border-left:4px solid #27ae60;white-space:nowrap}.js-code-label{margin-bottom:8px;font-weight:700;color:#555}@media (max-width:768px){.container{flex-direction:column;height:auto}.column{min-width:auto;margin-bottom:15px;height:fit-content;max-height:300px}textarea{height:150px}#jsCode,#result{max-height:200px;overflow-y:auto}.image-preview{display:none!important}}
/* Современное модальное окно */
.modern-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-image-modal.visible {
    opacity: 1;
}

.modern-image-modal.fade-out {
    opacity: 0;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #94a3b8;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.image-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #94a3b8;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-image {
    max-width: calc(90vw - 48px);
    max-height: calc(80vh - 120px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    animation: imageFadeIn 0.3s ease;
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-link,
.modal-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.modal-link:hover,
.modal-download:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.modal-download {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.modal-download:hover {
    background: rgba(16, 185, 129, 0.3);
}

/* Стили для JSON с правильными отступами */
.json-success {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    background: #0f172a;
}

.json-object-content,
.json-array-content {
    margin-left: 20px;
}

.json-object-item,
.json-array-item {
    margin: 2px 0;
}

.json-object-footer,
.json-array-footer {
    margin-top: 2px;
}

.json-image-icon {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    transition: transform 0.2s;
    color: #60a5fa;
}

.json-image-icon:hover {
    transform: scale(1.1);
    color: #3b82f6;
}

.image-icon-svg {
    width: 14px;
    height: 14px;
}

.json-string {
    color: #fbbf24;
}

.json-number {
    color: #34d399;
}

.json-boolean {
    color: #60a5fa;
}

.json-null {
    color: #94a3b8;
    font-style: italic;
}

.json-key {
    color: #152fb9;
}

.json-bracket {
    color: #94a3b8;
}

.json-comma,
.json-colon {
    color: #64748b;
}

.json-array-toggle {
    cursor: pointer;
    transition: opacity 0.2s;
}

.json-array-toggle:hover {
    opacity: 0.7;
}

.image-tooltip {
    background: #1e293b;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: system-ui, -apple-system, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}