   .link-highlight {
            position: relative;
        }

        .link-highlight::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            z-index: 1;
        }

        .edit-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .edit-overlay:hover {
            opacity: 1;
        }

        .edit-btn {
            padding: 5px 10px;
            background: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .edit-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .flex-json {
            display: none;
            position: absolute;
            left: -9999px;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

        .copy-btn {
            background: #FF6B6B;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            z-index: 1000;
        }

        .link-highlight {
            position: relative;
        }

        .link-highlight::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            z-index: 1;
        }

        .ExternalResource {
            position: relative !important;
            display: block !important;
        }

        .edit-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
            cursor: pointer;
            z-index: 10;
            background: rgba(0, 0, 0, 0.3);
            color: white;
            font-size: 15px;
            font-weight: 500;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            letter-spacing: 1px;
        }

        .edit-overlay:hover {
            opacity: 1;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }

        .edit-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 24px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 1001;
            min-width: 400px;
        }

        .modal-content h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        #image-select-btn {
            padding: 8px 16px;
            background: #f0f0f0;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            margin-bottom: 10px;
        }

        #image-preview {
            text-align: center;
            margin-top: 10px;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        .cancel-btn {
            padding: 8px 16px;
            background: #f0f0f0;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .save-btn {
            padding: 8px 16px;
            background: #FF6B6B;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .flex-json {
            display: none;
            position: absolute;
            left: -9999px;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

        .copy-btn {
            background: #FF6B6B;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            z-index: 1000;
        }

        .template-content {
            display: none;
        }

        .template-content.active {
            display: block;
        }

        #imageUploadDropzone {
            border: 2px solid #99c5ff !important;
            border-radius: 4px !important;
            padding: 20px !important;
            text-align: center !important;
            background-color: #f8f9fa !important;
            cursor: pointer !important;
            min-height: 150px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            margin: 0 !important;
        }

        #imageUploadDropzone:hover {
            border-color: #999 !important;
            background-color: #f3f4f6 !important;
        }

        #imageUploadDropzone .dz-message {
            margin: 0 !important;
        }

        #imageUploadDropzone .note {
            font-size: 0.85em;
            color: #666;
            display: block;
            margin-top: 5px;
        }

        .dropzone {
            min-height: auto !important;
            padding: 0 !important;
            border: none !important;
            background: none !important;
            width: 100% !important;
            margin: 0 !important;
        }

        .dropzone .dz-preview {
            margin: 0 !important;
            min-height: 0 !important;
        }

        .dropzone .dz-preview .dz-image-preview {
            background: none !important;
        }

        .dropzone .dz-preview .dz-image {
            width: 100% !important;
            height: auto !important;
        }

        .dropzone .dz-preview .dz-details {
            padding: 0 !important;
        }

        .dropzone .dz-preview .dz-progress,
        .dropzone .dz-preview .dz-success-mark,
        .dropzone .dz-preview .dz-error-mark {
            display: none !important;
        }

        /* 取消 Dropzone 預設 hover 模糊/放大效果——縮圖變糊會被誤會成上傳失敗 */
        .dropzone .dz-preview:hover .dz-image img,
        .dropzone .dz-preview .dz-image img {
            filter: none !important;
            transform: none !important;
        }

        /* 縮圖置中，刪除鈕（垃圾桶）固定在縮圖右上角 */
        #imageUploadDropzone {
            text-align: center;
        }

        .dropzone .dz-preview {
            overflow: visible !important;
        }

        .dropzone .dz-preview .dz-remove {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 32px;
            height: 32px;
            margin: 0;
            padding: 0;
            border-radius: 50%;
            background: #fff;
            /* dropzone.min.css 在本檔之後載入且設 border:none，需 !important */
            border: 1px solid #ddd !important;
            box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
            display: flex !important;
            align-items: center;
            justify-content: center;
            color: #d9534f;
            text-decoration: none !important;
            opacity: 1 !important;
            z-index: 20;
        }

        .dropzone .dz-preview .dz-remove:hover {
            background: #d9534f;
            border-color: #d9534f;
            color: #fff;
            text-decoration: none !important;
        }

        .dropzone .dz-preview .dz-remove svg {
            display: block;
            pointer-events: none;
        }

        /* 上傳中先藏垃圾桶，避免上傳到一半把檔案刪掉 */
        .dropzone .dz-preview.dz-uploading .dz-remove {
            display: none !important;
        }

        /* 上傳進度遮罩（蓋在縮圖上） */
        .dz-upload-status {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background: rgba(255, 255, 255, .7);
            font-size: 13px;
            color: #333;
            z-index: 10;
        }

        .dz-upload-spinner {
            width: 28px;
            height: 28px;
            border: 3px solid rgba(0, 0, 0, .15);
            border-top-color: #17c950;
            border-radius: 50%;
            animation: dz-upload-spin .8s linear infinite;
        }

        @keyframes dz-upload-spin {
            to { transform: rotate(360deg); }
        }

        /* 按鈕內嵌轉圈動畫（處理中／上傳中），彩色按鈕白字用白色 spinner */
        .btn-inline-spinner {
            display: inline-block;
            width: 14px;
            height: 14px;
            margin-right: 8px;
            vertical-align: -2px;
            border: 2px solid rgba(255, 255, 255, .45);
            border-top-color: #fff;
            border-radius: 50%;
            animation: dz-upload-spin .7s linear infinite;
        }

        .dz-upload-done {
            color: #17c950;
            font-weight: bold;
        }

        /* Modal styles */
        #image-uploader-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }

        #image-uploader-modal .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            width: 500px;
            max-width: 90vw;
            max-height: 90vh;
            overflow: auto;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview {
            margin: 20px 0;
            text-align: center;
            background: #f8f8f8;
            padding: 20px;
            border-radius: 4px;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview img {
            max-width: 100%;
            max-height: 200px;
            border-radius: 4px;
            object-fit: contain;
        }

        #image-uploader-modal h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
            font-weight: bold;
        }

        #image-uploader-modal .actions {
            display: flex;
            justify-content: center;
            gap: 16px;
            margin-top: 24px;
        }

        /* Button styles */
        .modal-btn {
            padding: 8px 24px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .confirm-btn {
            background: #FF6B6B;
            color: white;
            padding-top: 0px;
            padding-bottom: 0;
        }

        .confirm-btn:hover {
            background: #FF6B6B;
        }

        .confirm-btn:disabled {
            background: #eda7a7;
            cursor: not-allowed;
        }
        .confirm-btn:disabled:hover{
            background: #e79e9e;
        }

        .cancel-btn {
            background: #f0f0f0;
            color: #333;
            padding-top: 0px;
            padding-bottom: 0;
        }

        .cancel-btn:hover {
            background: #e0e0e0;
        }
       

        /* Fix for Dropzone preview container */
        .dropzone .dz-preview .dz-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .MdImg {
            position: relative !important;
            display: block !important;
        }

        #image-uploader-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            display: none;
        }

        #image-uploader-modal .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            width: 500px;
            max-width: 90vw;
            max-height: 90vh;
            overflow: auto;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview {
            margin: 20px 0;
            text-align: center;
            background: #f8f8f8;
            padding: 20px;
            border-radius: 4px;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview img {
            max-width: 100%;
            max-height: 200px;
            border-radius: 4px;
            object-fit: contain;
        }

        #image-uploader-modal h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
            font-weight: bold;
        }

        #image-uploader-modal .actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        /* Fix for Dropzone preview container */
        .dropzone .dz-preview .dz-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .MdImg {
            position: relative !important;
            display: block !important;
        }

        #image-uploader-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            display: none;
        }

        #image-uploader-modal .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            width: 500px;
            max-width: 90vw;
            max-height: 90vh;
            overflow: auto;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview {
            margin: 20px 0;
            text-align: center;
            background: #f8f8f8;
            padding: 20px;
            border-radius: 4px;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview img {
            max-width: 100%;
            max-height: 200px;
            border-radius: 4px;
            object-fit: contain;
        }

        #image-uploader-modal h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
            font-weight: bold;
        }

        #image-uploader-modal .actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        /* Fix for Dropzone preview container */
        .dropzone .dz-preview .dz-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .MdImg {
            position: relative !important;
            display: block !important;
        }

        #image-uploader-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            display: none;
        }

        #image-uploader-modal .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            width: 500px;
            max-width: 90vw;
            max-height: 90vh;
            overflow: auto;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview {
            margin: 20px 0;
            text-align: center;
            background: #f8f8f8;
            padding: 20px;
            border-radius: 4px;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            box-sizing: border-box;
        }

        #image-uploader-modal .preview img {
            max-width: 100%;
            max-height: 200px;
            border-radius: 4px;
            object-fit: contain;
        }

        #image-uploader-modal h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
            font-weight: bold;
        }

        #image-uploader-modal .actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        /* Fix for Dropzone preview container */
        .dropzone .dz-preview .dz-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .custom-confirm-button {
            padding-top: 0px;
            /* Padding */
            font-size: 13px;
        }

        .custom-cancel-button {
            padding-top: 0px;
            /* Padding */
            font-size: 13px;
        }

        .MdBtn {
            position: relative !important;
        }

        .button-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 10;
            border-radius: 8px;
            cursor: pointer;
        }

        .button-overlay.active {
            display: flex;
        }

        .MdBtn:hover .button-overlay {
            display: flex;
        }

        .editable-text {
            outline: none;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        .editable-text:hover {

            padding: 1px;
            
            background-color: rgba(255, 107, 107, 0.05);
        }

        .editable-text.active {
            outline: 1px solid rgba(255, 107, 107, 0.3);
            background-color: rgba(255, 107, 107, 0.1);
            cursor: text;
             margin: 2px;
        }

        .editable-text[contenteditable="true"] {
            cursor: text;
            min-width: 1px; /* Prevents collapse */
        }
        .editable-text[contenteditable="true"]:focus {
             outline: 2px solid rgba(255, 107, 107, 0.3);
             margin: 2px;
             padding: 1px;
        }