::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.preview-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.preview-image {
    max-width: 100%;
    max-height: 280px;
    border-radius: 0.6rem;
    object-fit: contain;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.code-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-all;
}

.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #1e293b;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .preview-wrap {
        min-height: 150px;
    }

    .preview-image {
        max-height: 220px;
    }
}
