/* 模版设计器样式 */
:root {
    /* TDesign 颜色变量 */
    --mtd-brand-color: #0052d9;
    --mtd-brand-color-light: #4a89ff;
    --mtd-brand-color-lighter: #a2c5ff;
    --mtd-brand-color-lightest: #deedff;
    --mtd-success-color: #2ba471;
    --mtd-warning-color: #ed7b2f;
    --mtd-error-color: #d54941;
    
    /* 基础颜色 */
    --mtd-white-color: #fff;
    --mtd-black-color: #000;
    --mtd-gray-color-1: #f3f3f3;
    --mtd-gray-color-2: #e7e7e7;
    --mtd-gray-color-3: #dcdcdc;
    --mtd-gray-color-4: #c5c5c5;
    --mtd-gray-color-5: #a6a6a6;
    --mtd-gray-color-6: #8b8b8b;
    --mtd-gray-color-7: #777;
    --mtd-gray-color-8: #5c5c5c;
    --mtd-gray-color-9: #4d4d4d;
    --mtd-gray-color-10: #2c2c2c;
    
    /* 文本颜色 */
    --mtd-text-color-primary: #000000e0;
    --mtd-text-color-secondary: #000000a6;
    --mtd-text-color-placeholder: #00000061;
    --mtd-text-color-disabled: #00000040;
    
    /* 边框颜色 */
    --mtd-border-color: #dcdcdc;
    --mtd-border-color-hover: #a6a6a6;
    --mtd-border-color-active: #2c2c2c;
    --mtd-border-color-disabled: #e5e5e5;
    
    /* 背景颜色 */
    --mtd-bg-color-component-disabled: #f5f5f5;
    
    /* 文本颜色 */
    --mtd-text-color-regular: #000000a6;
    --mtd-text-color-primary: #000000e0;
    --mtd-text-color-disabled: #00000040;
    
    /* 简化别名 */
    --mtd-gray-color: #666666;
    --mtd-dark-color: #333333;
    --mtd-light-color: #f0f0f0;
}

.mtd-designer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 9999;
}

.mtd-designer-modal.active {
    display: flex;
    flex-direction: column;
}

.mtd-designer-container {
    background-color: #fff;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.mtd-designer-header {
    background-color: #0052D9;
    padding: 4px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtd-designer-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtd-designer-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: var(--mtd-radius-round);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    position: relative;
    outline: none;
    box-shadow: none;
}

.mtd-designer-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(1.1);
}

.mtd-designer-close:active {
    transform: scale(0.95);
    background-color: rgba(255, 255, 255, 0.25);
}

.mtd-designer-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.mtd-designer-close i {
    font-size: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

/* 添加关闭按钮的徽章效果 */
.mtd-designer-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.mtd-designer-close:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* 键盘导航时的焦点样式 */
.mtd-designer-close:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 禁用状态 */
.mtd-designer-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.mtd-designer-close:disabled:hover {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.5);
    transform: none;
}

/* 确认对话框样式 - TDesign风格优化 */
.mtd-confirm-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.mtd-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mtd-confirm-container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 90%;
    animation: mtd-confirm-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@keyframes mtd-confirm-slide-in {
    from {
        opacity: 0;
        transform: translateY(-24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mtd-confirm-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.mtd-confirm-header i {
    color: #0052d9;
    font-size: 20px;
    background: #e7f0ff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtd-confirm-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    letter-spacing: -0.01em;
}

.mtd-confirm-body {
    padding: 24px;
}

.mtd-confirm-body p {
    margin: 0 0 24px 0;
    color: #4e5969;
    line-height: 1.6;
    font-size: 14px;
    font-weight: 400;
}

.mtd-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0 24px 24px;
}

.mtd-confirm-btn {
    padding: 10px 20px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 88px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.mtd-confirm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mtd-confirm-btn:hover::before {
    left: 100%;
}

.mtd-confirm-btn--secondary {
    background: #f7f8fa;
    border-color: #e5e6eb;
    color: #4e5969;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mtd-confirm-btn--secondary:hover {
    background: #f0f2f5;
    border-color: #d8d8d8;
    color: #1d2129;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mtd-confirm-btn--secondary:active {
    background: #e8e8e8;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.mtd-confirm-btn--primary {
    background: #0052d9;
    border-color: #0052d9;
    color: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mtd-confirm-btn--primary:hover {
    background: #1a6ce6;
    border-color: #1a6ce6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
}

.mtd-confirm-btn--primary:active {
    background: #0045b3;
    border-color: #0045b3;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 82, 217, 0.4);
}

.mtd-confirm-btn--danger {
    background: #e34d59;
    border-color: #e34d59;
    color: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mtd-confirm-btn--danger:hover {
    background: #ed6b75;
    border-color: #ed6b75;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 77, 89, 0.3);
}

.mtd-confirm-btn--danger:active {
    background: #d83946;
    border-color: #d83946;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(227, 77, 89, 0.4);
}

/* 按钮焦点状态 */
.mtd-confirm-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1);
}

.mtd-confirm-btn--secondary:focus {
    box-shadow: 0 0 0 3px rgba(78, 89, 105, 0.1);
}

.mtd-confirm-btn--danger:focus {
    box-shadow: 0 0 0 3px rgba(227, 77, 89, 0.1);
}



/* 提示消息样式 */
.mtd-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
}

.mtd-toast--show {
    transform: translateX(0);
    opacity: 1;
}

.mtd-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mtd-toast-content i {
    font-size: 18px;
}

.mtd-toast--success .mtd-toast-content i {
    color: #52c41a;
}

.mtd-toast--error .mtd-toast-content i {
    color: #ff4d4f;
}

.mtd-toast--info .mtd-toast-content i {
    color: #1890ff;
}

.mtd-toast-content span {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.mtd-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mtd-confirm-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    animation: mtd-confirm-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mtd-confirm-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mtd-confirm-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mtd-confirm-header i {
    color: #ff6b35;
    font-size: 20px;
}

.mtd-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mtd-confirm-body {
    padding: 24px;
}

.mtd-confirm-body p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.mtd-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.mtd-confirm-btn {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.mtd-confirm-btn--secondary {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #333;
}

.mtd-confirm-btn--secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.mtd-confirm-btn--primary {
    background: #1890ff;
    border-color: #1890ff;
    color: white;
}

.mtd-confirm-btn--primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}



/* 提示消息样式 */
.mtd-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
}

.mtd-toast--show {
    transform: translateX(0);
    opacity: 1;
}

.mtd-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mtd-toast-content i {
    font-size: 18px;
}

.mtd-toast--success .mtd-toast-content i {
    color: #52c41a;
}

.mtd-toast--error .mtd-toast-content i {
    color: #ff4d4f;
}

.mtd-toast--info .mtd-toast-content i {
    color: #1890ff;
}

.mtd-toast-content span {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.mtd-designer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TDesign 字体导入 */
@font-face {
    font-family: "TCloud";
    src: local("PingFang SC"), local("Hiragino Sans GB"), local("Microsoft YaHei"), local("Helvetica Neue"),
         local("Source Han Sans SC"), local("Noto Sans CJK SC"), local("Source Han Sans CN"),
         local("Noto Sans SC");
    font-display: fallback;
}

/* 确保字体图标正确加载 */
.fa, .fas, .far, .fab, .fal {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
}

/* 防止图标闪烁 */
.mtd-designer-element-icon i, 
.mtd-designer-layer-icon i,
.mtd-designer-toolbar i,
.mtd-designer-zoom-control i,
.mtd-designer-status-item i,
.mtd-designer-panel-header i,
.mtd-designer-close i {
    font-family: "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
}

/* 图标容器样式 */
.mtd-designer-element-icon,
.mtd-designer-layer-icon,
.mtd-designer-toolbar button i,
.mtd-designer-zoom-control button i,
.mtd-designer-status-item i,
.mtd-designer-panel-header button i,
.mtd-designer-close i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

/* 确保图标始终可见 */
.mtd-designer-element-icon i:before,
.mtd-designer-layer-icon i:before,
.mtd-designer-toolbar button i:before,
.mtd-designer-zoom-control button i:before,
.mtd-designer-status-item i:before,
.mtd-designer-panel-header button i:before,
.mtd-designer-close i:before {
    display: inline-block;
    font-family: "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 确保按钮图标正确显示 */
.mtd-designer-btn i {
    font-family: "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
}

/* 全局图标修复 */
i.fas, i.far, i.fab {
    
    font-family: "Font Awesome 6 Free", sans-serif !important;
    font-style: normal;
    font-variant: normal;
    font-weight: 900;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 确保所有图标元素使用正确的字体 */
[class*="mtd-designer"] i {
    font-family: "Font Awesome 6 Free", sans-serif !important;
}

/* 防止图标被其他样式覆盖 */
[class*="mtd-designer"] .fa,
[class*="mtd-designer"] .fas,
[class*="mtd-designer"] .far,
[class*="mtd-designer"] .fab {
    font-family: "Font Awesome 6 Free", sans-serif !important;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* TDesign 设计规范变量 */
:root {
    /* 品牌色 */
    --mtd-brand-color: #0052d9;
    --mtd-brand-color-1: #e0ebff;
    --mtd-brand-color-2: #c0d8ff;
    --mtd-brand-color-3: #a1c4ff;
    --mtd-brand-color-4: #82b0ff;
    --mtd-brand-color-5: #629bff;
    --mtd-brand-color-6: #4285f2;
    --mtd-brand-color-7: #2370e8;
    --mtd-brand-color-8: #0052d9;
    --mtd-brand-color-9: #0034b3;
    --mtd-brand-color-10: #001fa0;
    
    /* 功能色 */
    --mtd-success-color: #00a870;
    --mtd-warning-color: #ed7b2f;
    --mtd-error-color: #d54941;
    --mtd-info-color: #059deb;
    
    /* 中性色 */
    --mtd-text-color-primary: #000000;
    --mtd-text-color-regular: #000000e0;
    --mtd-text-color-secondary: #000000a6;
    --mtd-text-color-placeholder: #00000066;
    --mtd-text-color-disabled: #00000040;
    
    --mtd-bg-color-container: #ffffff;
    --mtd-bg-color-container-select: #f2f3ff;
    --mtd-bg-color-container-hover: #f2f3ff;
    --mtd-bg-color-component: #f3f3f3;
    --mtd-bg-color-page: #f5f5f5;
    
    --mtd-border-color: #dcdcdc;
    --mtd-border-color-component: #dcdcdc;
    --mtd-border-color-hover: #dcdcdc;
    --mtd-border-color-focus: var(--mtd-brand-color);
    --mtd-border-color-disabled: #f0f0f0;
    
    --mtd-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.07);
    --mtd-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06);
    --mtd-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --mtd-radius-small: 3px;
    --mtd-radius-default: 6px;
    --mtd-radius-medium: 6px;
    --mtd-radius-large: 9px;
    --mtd-radius-extra-large: 12px;
    --mtd-radius-round: 999px;
    
    /* 尺寸 */
    --mtd-sidebar-width: 260px;
    --mtd-header-height: 60px;
    --mtd-footer-height: 40px;
    --mtd-panel-width: 300px;
    
    /* 间距 */
    --mtd-spacer-1: 4px;
    --mtd-spacer-2: 8px;
    --mtd-spacer-3: 12px;
    --mtd-spacer-4: 16px;
    --mtd-spacer-5: 20px;
    --mtd-spacer-6: 24px;
}

.mtd-designer-body {
    background-color: var(--mtd-light-color);
    color: var(--mtd-dark-color);
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 顶部导航栏 */
.mtd-designer-topbar {
    background-color: var(--mtd-bg-color-container);
    box-shadow: var(--mtd-shadow-1);
    padding: 0 var(--mtd-spacer-5);
    height: var(--mtd-header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid var(--mtd-border-color-component);
}

.mtd-designer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: var(--mtd-brand-color);
}

.mtd-designer-logo i {
    font-size: 24px;
}

.mtd-designer-logo i {
    font-size: 24px;
}

.mtd-designer-toolbar {
    display: flex;
    gap: 8px;
}

/* TDesign 按钮样式 - 优化版 */
.mtd-designer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    white-space: nowrap;
    text-decoration: none;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
    border-radius: var(--mtd-radius-medium);
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    letter-spacing: 0.2px;
}

.mtd-designer-btn--default {
    background-color: var(--mtd-bg-color-container);
    border: 1px solid var(--mtd-border-color);
    color: var(--mtd-text-color-regular);
}

.mtd-designer-btn--default:hover {
    background-color: var(--mtd-bg-color-container-hover);
    border-color: var(--mtd-border-color-hover);
    color: var(--mtd-text-color-primary);
}

.mtd-designer-btn--primary {
    background-color: var(--mtd-brand-color);
    border: 1px solid var(--mtd-brand-color);
    color: #fff;
}

.mtd-designer-btn--primary:hover {
    background-color: var(--mtd-brand-color-7);
    border-color: var(--mtd-brand-color-7);
}

.mtd-designer-btn--danger {
    background-color: var(--mtd-error-color);
    border: 1px solid var(--mtd-error-color);
    color: #fff;
}

.mtd-designer-btn--danger:hover {
    background-color: #dd5248;
    border-color: #dd5248;
}

.mtd-designer-btn--ghost {
    background-color: transparent;
    border: 1px solid var(--mtd-border-color);
    color: var(--mtd-text-color-regular);
}

.mtd-designer-btn--ghost:hover {
    background-color: var(--mtd-bg-color-container-hover);
    border-color: var(--mtd-border-color-hover);
    color: var(--mtd-text-color-primary);
}

.mtd-designer-btn--text {
    background-color: transparent;
    border: none;
    color: var(--mtd-brand-color);
    padding: 0;
}

.mtd-designer-btn--text:hover {
    background-color: var(--mtd-brand-color-1);
}

.mtd-designer-btn--small {
    padding: 0 var(--mtd-spacer-4);
    height: 28px;
    font-size: 12px;
    min-width: 60px;
}

.mtd-designer-btn--medium {
    padding: 0 var(--mtd-spacer-5);
    height: 36px;
    min-width: 80px;
}

.mtd-designer-btn--large {
    padding: 0 var(--mtd-spacer-6);
    height: 40px;
    font-size: 16px;
    min-width: 100px;
}

.mtd-designer-btn--icon {
    padding: var(--mtd-spacer-3);
    width: 36px;
    height: 36px;
    min-width: 36px;
}

.mtd-designer-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
}

.mtd-designer-btn span {
    margin-left: var(--mtd-spacer-1);
}

.mtd-designer-btn:active {
    transform: scale(0.95);
}

.mtd-designer-btn--icon:active {
    transform: scale(0.9);
}

/* 禁用状态按钮样式 */
.mtd-designer-btn--disabled,
.mtd-designer-btn:disabled {
    background-color: var(--mtd-bg-color-component-disabled) !important;
    border-color: var(--mtd-border-color-disabled) !important;
    color: var(--mtd-text-color-disabled) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.mtd-designer-btn--disabled:hover,
.mtd-designer-btn:disabled:hover {
    background-color: var(--mtd-bg-color-component-disabled) !important;
    border-color: var(--mtd-border-color-disabled) !important;
    color: var(--mtd-text-color-disabled) !important;
    transform: none !important;
}


/* 工具栏按钮样式 */
.mtd-designer-toolbar button {
    margin-right: var(--mtd-spacer-2);
}

.mtd-designer-toolbar .mtd-designer-btn {
    padding: var(--mtd-spacer-1) var(--mtd-spacer-3);
    height: 32px;
}

.mtd-designer-toolbar .mtd-designer-btn i {
    margin-right: var(--mtd-spacer-1);
}

.mtd-designer-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mtd-designer-zoom-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtd-designer-zoom-control button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mtd-border-color);
    background: var(--mtd-light-color);
    border-radius: 4px;
    cursor: pointer;
}

.mtd-designer-zoom-value {
    min-width: 50px;
    text-align: center;
}

/* 紧凑版缩放控件样式 - 用于画布控制区域 */
.mtd-designer-zoom-control--compact {
    gap: 6px;
    border-radius: 6px;
    padding: 4px;
}

.mtd-designer-zoom-control--compact button {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--mtd-border-color);
    border-radius: 4px;
}

.mtd-designer-zoom-control--compact button:hover {
    background-color: var(--mtd-bg-color-container-hover);
    border-color: var(--mtd-border-color-hover);
    color: var(--mtd-text-color-primary);
}

.mtd-designer-zoom-control--compact .mtd-designer-zoom-value {
    min-width: 40px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mtd-text-color-secondary);
}

/* 左侧面板 */
.mtd-designer-left-panel {
    width: var(--mtd-sidebar-width);
    background-color: var(--mtd-bg-color-container);
    border-right: 1px solid var(--mtd-border-color-component);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.38, 0, 0.24, 1);
    box-shadow: var(--mtd-shadow-1);
}

.mtd-designer-panel-header {
    padding: var(--mtd-spacer-4);
    border-bottom: 1px solid var(--mtd-border-color-component);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--mtd-bg-color-page);
}

.mtd-designer-panel-title {
    font-size: 16px;
    font-weight: 600;
    height: 32px;
}

.mtd-designer-panel-content {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

/* 元素分类样式 */
.mtd-designer-category {
    margin-bottom: 20px;
}

.mtd-designer-category-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--mtd-gray-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--mtd-border-color);
}

.mtd-designer-elements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mtd-designer-element-item {
    background-color: var(--mtd-bg-color-container);
    border: 1px solid var(--mtd-border-color-component);
    border-radius: var(--mtd-radius-medium);
    padding: var(--mtd-spacer-4) var(--mtd-spacer-2);
    text-align: center;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--mtd-spacer-2);
    user-select: none;
}

.mtd-designer-element-item:hover {
    background-color: var(--mtd-bg-color-container-hover);
    border-color: var(--mtd-brand-color);
    transform: translateY(-2px);
    box-shadow: var(--mtd-shadow-1);
}

.mtd-designer-element-icon {
    font-size: 24px;
    color: var(--mtd-brand-color);
    line-height: 1;
}

.mtd-designer-element-icon i {
    font-size: 24px;
    line-height: 1;
}

.mtd-designer-element-name {
    font-size: 12px;
    color: var(--mtd-dark-color);
}

/* 图层面板 */
.mtd-designer-layers-panel {
    background-color: var(--mtd-light-color);
    border-right: 1px solid var(--mtd-border-color);
    width: 200px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mtd-designer-layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.mtd-designer-layer-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mtd-border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.mtd-designer-layer-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.mtd-designer-layer-item.active {
    background-color: rgba(67, 97, 238, 0.1);
    border-left: 3px solid var(--mtd-brand-color);
}

.mtd-designer-layer-icon {
    margin-right: 8px;
    color: var(--mtd-text-color-secondary);
}

.mtd-designer-layer-icon i {
    font-size: 16px;
    line-height: 1;
}

.mtd-designer-layer-name {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtd-designer-layer-actions {
    display: flex;
    gap: 5px;
}

.mtd-designer-layer-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mtd-gray-color);
    font-size: 12px;
}

.mtd-designer-layer-action:hover {
    color: var(--mtd-danger-color);
}

/* 中央画布区 */
.mtd-designer-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--mtd-bg-color-page);
    position: relative;
}

/* TDesign 基础信息区域 - 优化版 */
.mtd-designer-basic-info-panel {
    
    background-color: var(--mtd-bg-color-page);
    border-bottom: 1px solid var(--mtd-border-color-component);
    padding: 14px var(--mtd-spacer-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--mtd-spacer-5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    min-height: 64px;
    position: relative;
    overflow: visible; /* 允许内容溢出 */
    z-index: 1;
}

.mtd-designer-basic-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--mtd-brand-color) 50%, transparent 100%);
    opacity: 0.3;
}

.mtd-designer-basic-info-content {
    display: flex;
    align-items: center;
    gap: var(--mtd-spacer-6);
    flex: 1;
    min-width: 0;
}

.mtd-designer-basic-info-item {
    display: flex;
    align-items: center;
    gap: var(--mtd-spacer-3);
    min-width: 0;
    flex-shrink: 0;
    position: relative;
    min-height: 36px; /* 最小高度与输入框一致 */
}

.mtd-designer-basic-info-item::after {
    content: '';
    position: absolute;
    right: calc(var(--mtd-spacer-3) * -1);
    top: 10px; /* 调整到与输入框顶部对齐 */
    width: 1px;
    height: 18px;
    background-color: var(--mtd-border-color);
}

.mtd-designer-basic-info-item:last-child::after {
    display: none;
}

.mtd-designer-basic-info-label {
    font-size: 14px;
    color: var(--mtd-text-color-secondary);
    white-space: nowrap;
    font-weight: 500;
    min-width: 72px;
    text-align: right;
    letter-spacing: 0.2px;
}

.mtd-designer-basic-info-actions {
    display: flex;
    align-items: center;
    gap: var(--mtd-spacer-3);
    flex-shrink: 0;
}

/* 基本信息区域按钮样式优化 */
.mtd-designer-basic-info-actions .mtd-designer-btn {
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mtd-designer-basic-info-actions .mtd-designer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mtd-designer-basic-info-actions .mtd-designer-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 图标和文字间距优化 */
.mtd-designer-basic-info-actions .mtd-designer-btn i {
    margin-right: 6px;
    font-size: 14px;
}

/* 按钮间距优化 */
.mtd-designer-basic-info-actions .mtd-designer-btn--medium {
    padding: 8px 16px;
    min-width: 100px;
    justify-content: center;
}

/* TDesign 输入框样式 - 优化版 */
.mtd-designer-input {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    position: relative;
    text-align: left;
    font-size: 14px;
    width: 100%;
    height: 36px;
    line-height: 22px;
    padding: 0 var(--mtd-spacer-4);
    color: var(--mtd-text-color-regular);
    background-color: var(--mtd-bg-color-container);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    outline: none;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mtd-designer-input:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
    background-color: var(--mtd-bg-color-container-hover);
}

.mtd-designer-input:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
}

.mtd-designer-basic-info-input {
    padding: 0 var(--mtd-spacer-4);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    background-color: var(--mtd-bg-color-container);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    outline: none;
    color: var(--mtd-text-color-regular);
    width: 240px;
    height: 36px;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mtd-designer-basic-info-input:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
    background-color: var(--mtd-bg-color-container-hover);
}

.mtd-designer-basic-info-input:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
}

/* TDesign 文本区域样式 - 优化版 */
.mtd-designer-textarea {
    display: inline-block;
    position: relative;
    width: 100%;
    padding: var(--mtd-spacer-3) var(--mtd-spacer-4);
    color: var(--mtd-text-color-regular);
    background-color: var(--mtd-bg-color-container);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    outline: none;
    font-size: 14px;
    line-height: 22px;
    resize: vertical;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mtd-designer-textarea:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
    background-color: var(--mtd-bg-color-container-hover);
}

.mtd-designer-textarea:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
}

.mtd-designer-basic-info-textarea {
    width: 320px;
    padding: 6px var(--mtd-spacer-4);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    background-color: var(--mtd-bg-color-container);
    font-size: 14px;
    resize: vertical;
    min-height: 36px;
    height: 36px;
    max-height: 120px;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    outline: none;
    color: var(--mtd-text-color-regular);
    line-height: 22px;
    overflow: hidden;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    z-index: 10;
}

.mtd-designer-basic-info-textarea:focus {
    height: 80px;
    max-height: 120px;
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
    z-index: 100;
    position: relative;
}

.mtd-designer-basic-info-textarea:focus::placeholder {
    color: var(--mtd-text-color-placeholder);
}

.mtd-designer-basic-info-textarea:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
    background-color: var(--mtd-bg-color-container-hover);
}

.mtd-designer-basic-info-textarea:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
}

.mtd-designer-canvas-controls {
    padding: 10px 20px;
    background-color: var(--mtd-light-color);
    border-bottom: 1px solid var(--mtd-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtd-designer-canvas-controls-left, .mtd-designer-canvas-controls-right {
    display: flex;
    gap: 10px;
}

/* 画布控制区域按钮样式优化 */
.mtd-designer-canvas-controls .mtd-designer-btn--icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mtd-radius-default);
}

.mtd-designer-canvas-controls .mtd-designer-btn--icon i {
    margin-right: 0 !important;
    font-size: 14px;
    line-height: 1;
}


.mtd-designer-canvas-controls .mtd-designer-btn--small {
    padding: 6px 12px;
    height: 32px;
    font-size: 12px;
}

.mtd-designer-canvas-controls .mtd-designer-btn--small i {
    margin-right: 6px;
}

/* 表格单元格选择样式 */
.mtd-designer-table-cell-selected {
    background-color: rgba(0, 82, 217, 0.1) !important;
    border: 2px solid #0052d9 !important;
    position: relative;
}

.mtd-designer-table-cell-selected::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #0052d9;
    pointer-events: none;
}

/* 表格预览样式（用于增强表格外观） */
.mtd-designer-table-preview {
    border-collapse: collapse;
    width: 100%;
    height: 100%;
    font-size: 12px;
    line-height: 1.4;
}

.mtd-designer-table-preview th,
.mtd-designer-table-preview td {
    border: 1px solid #dcdcdc;
    padding: 4px 8px;
    text-align: left;
    vertical-align: middle;
    min-height: 35px;
    box-sizing: border-box;
}

.mtd-designer-table-preview th {
    background-color: #f5f5f5;
    font-weight: bold;
    height: 35px;
}

.mtd-designer-table-preview td {
    background-color: white;
    height: 35px;
}

/* 表格元素的容器样式 */
.mtd-designer-element[data-type="table"] {
    overflow: visible;
}

/* 表格右键菜单样式 */
.mtd-designer-context-menu {
    position: fixed !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    z-index: 10000 !important;
    min-width: 150px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mtd-designer-context-menu div {
    padding: 8px 12px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: background-color 0.15s ease !important;
}

.mtd-designer-context-menu div:last-child {
    border-bottom: none !important;
}

.mtd-designer-context-menu div:hover {
    background-color: #f5f5f5 !important;
}

/* 表格单元格选择样式 */
.mtd-designer-table-cell-selected {
    background-color: rgba(0, 82, 217, 0.1) !important;
    border: 2px solid #0052d9 !important;
    position: relative;
}

.mtd-designer-table-cell-selected::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #0052d9;
    pointer-events: none;
}

/* 表格预览样式（用于增强表格外观） */
.mtd-designer-table-preview {
    border-collapse: collapse;
    width: 100%;
    height: 100%;
    font-size: 12px;
    line-height: 1.4;
}

.mtd-designer-table-preview th,
.mtd-designer-table-preview td {
    border: 1px solid #dcdcdc;
    padding: 4px 8px;
    text-align: left;
    vertical-align: middle;
    min-height: 35px;
    box-sizing: border-box;
}

.mtd-designer-table-preview th {
    background-color: #f5f5f5;
    font-weight: bold;
    height: 35px;
}

.mtd-designer-table-preview td {
    background-color: white;
    height: 35px;
}

/* 表格元素的容器样式 */
.mtd-designer-element[data-type="table"] {
    overflow: visible;
}

/* 表格右键菜单样式 */
.mtd-designer-context-menu {
    position: fixed !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    z-index: 10000 !important;
    min-width: 150px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mtd-designer-context-menu div {
    padding: 8px 12px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: background-color 0.15s ease !important;
}

.mtd-designer-context-menu div:last-child {
    border-bottom: none !important;
}

.mtd-designer-context-menu div:hover {
    background-color: #f5f5f5 !important;
}


.mtd-designer-canvas-controls .mtd-designer-btn--small span {
    margin-left: 0;
}

/* 清空画布按钮专用样式优化 */
.mtd-designer-canvas-controls #mtdClearCanvas {
width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mtd-radius-default);
}





.mtd-designer-canvas-controls #mtdClearCanvas i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.mtd-designer-canvas-controls #mtdClearCanvas:hover i {
    transform: rotate(-10deg);
}

.mtd-designer-canvas-controls #mtdClearCanvas span {
    font-size: 13px;
    font-weight: 500;
}

.mtd-designer-canvas-container {
    flex: 1;
    display: block; /* 改为block布局，避免flex居中导致的溢出问题 */
    padding: 20px;
    overflow: auto;
    position: relative;
    /* 确保容器正确约束子元素 */
    min-height: 0;
    min-width: 0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    /* 添加滚动区域样式 */
    overflow-x: auto;
    overflow-y: auto;
}

.mtd-designer-canvas-wrapper {
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    padding: 40px;
    /* 确保wrapper能正确容纳canvas */
    box-sizing: border-box;
    /* 改为block布局，避免居中导致的溢出问题 */
    display: block;
    /* wrapper的尺寸由JavaScript动态设置，移除固定最小尺寸 */
    min-width: 0; /* 允许动态调整 */
    min-height: 0; /* 允许动态调整 */
    /* 移除最大尺寸限制，允许wrapper超出容器以便正确滚动 */
    max-width: none;
    max-height: none;
    /* 使用margin居中显示，但允许容器滚动 */
    margin: 0 auto;
    /* 确保wrapper能正确显示在容器内 */
    position: relative;
    left: auto;
    top: auto;
}

.mtd-designer-canvas-ruler {
    position: absolute;
    background-color: #f0f2f5;
    z-index: 5;
}

.mtd-designer-ruler-horizontal {
    top: 0;
    left: 40px;
    right: 40px;
    height: 40px;
    border-bottom: 1px solid var(--mtd-border-color);
    display: flex;
    align-items: flex-end;
}

.mtd-designer-ruler-vertical {
    top: 40px;
    bottom: 40px;
    left: 0;
    width: 40px;
    border-right: 1px solid var(--mtd-border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* 确保尺标不超出容器 */
    height: calc(100% - 80px);
    overflow: hidden;
}

.mtd-designer-ruler-mark {
    position: absolute;
    background-color: var(--mtd-gray-color);
    font-size: 10px;
    color: var(--mtd-dark-color);
}

.mtd-designer-ruler-horizontal .mtd-designer-ruler-mark {
    height: 6px;
    width: 1px;
    bottom: 0;
}

.mtd-designer-ruler-horizontal .mtd-designer-ruler-mark.major {
    height: 12px;
}

.mtd-designer-ruler-vertical .mtd-designer-ruler-mark {
    width: 6px;
    height: 1px;
    left: 0;
}

.mtd-designer-ruler-vertical .mtd-designer-ruler-mark.major {
    width: 12px;
}

.mtd-designer-ruler-label {
    position: absolute;
    font-size: 10px;
    color: var(--mtd-gray-color);
}

.mtd-designer-ruler-horizontal .mtd-designer-ruler-label {
    bottom: 2px;
    transform: translateX(-50%);
}

.mtd-designer-ruler-vertical .mtd-designer-ruler-label {
    left: 2px;
    transform: translateY(-50%);
}

.mtd-designer-canvas {
    background-color: white;
    position: relative;
    overflow: hidden;
    transform-origin: center center;
    /* canvas尺寸由JavaScript动态控制，移除固定最小尺寸 */
    width: 800px;
    height: 600px;
    min-width: 0; /* 允许动态调整 */
    min-height: 0; /* 允许动态调整 */
    box-sizing: border-box;
    /* 确保canvas能正确显示 */
    display: block;
}

/* 辅助线样式 */
.mtd-designer-guide-line {
    position: absolute;
    background-color: var(--mtd-brand-color);
    z-index: 1000;
    pointer-events: none;
}

.mtd-designer-guide-line-horizontal {
    height: 1px;
    width: 100%;
    left: 0;
}

.mtd-designer-guide-line-vertical {
    width: 1px;
    height: 100%;
    top: 0;
}

.mtd-designer-guide-line-center {
    background-color: var(--mtd-success-color);
}

.mtd-designer-guide-line-edge {
    background-color: var(--mtd-brand-color);
}

.mtd-designer-guide-line-canvas {
    background-color: var(--mtd-warning-color);
    opacity: 0.7;
}

.mtd-designer-canvas-element {
    position: absolute;
    border: 1px dashed transparent;
    padding: 0;
    cursor: move;
    user-select: none;
    box-sizing: border-box;
    min-width: 50px;
    min-height: 30px;
}

.mtd-designer-canvas-element.selected {
    border-color: var(--mtd-brand-color);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
}

.mtd-designer-canvas-element:hover {
    border-color: var(--mtd-gray-color);
}

.mtd-designer-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--mtd-brand-color);
    border: 1px solid var(--mtd-bg-color-container);
    border-radius: 50%;
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.38, 0, 0.24, 1);
}

.mtd-designer-resize-handle:hover {
    transform: scale(1.2);
}

.mtd-designer-resize-handle.top-left {
    top: -4px;
    left: -4px;
    cursor: nw-resize;
}

.mtd-designer-resize-handle.top-right {
    top: -4px;
    right: -4px;
    cursor: ne-resize;
}

.mtd-designer-resize-handle.bottom-left {
    bottom: -4px;
    left: -4px;
    cursor: sw-resize;
}

.mtd-designer-resize-handle.bottom-right {
    bottom: -4px;
    right: -4px;
    cursor: se-resize;
}

.mtd-designer-rotate-handle {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background-color: var(--mtd-brand-color);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: var(--mtd-shadow-1);
    transition: transform 0.2s cubic-bezier(0.38, 0, 0.24, 1);
}

.mtd-designer-rotate-handle:hover {
    transform: translateX(-50%) scale(1.2);
}

/* 横线元素：只允许调整宽度，高度通过属性面板调整 */
.mtd-designer-canvas-element[data-type="hline"] {
    min-height: 1px !important;
    height: auto !important;
}

/* 横线元素：显示左右控制点用于调整宽度 */
.mtd-designer-canvas-element[data-type="hline"] .mtd-designer-resize-handle {
    display: none !important;
}

.mtd-designer-canvas-element[data-type="hline"] .mtd-designer-resize-handle.bottom-left {
    display: block !important;
    cursor: w-resize !important;
}

.mtd-designer-canvas-element[data-type="hline"] .mtd-designer-resize-handle.bottom-right {
    display: block !important;
    cursor: e-resize !important;
}

/* 竖线元素：只能调整高度，宽度由线条粗度控制 */
.mtd-designer-canvas-element[data-type="vline"] {
    min-width: 1px !important;
    width: auto !important;
}

/* 竖线元素：显示上下控制点用于调整高度 */
.mtd-designer-canvas-element[data-type="vline"] .mtd-designer-resize-handle {
    display: none !important;
}

.mtd-designer-canvas-element[data-type="vline"] .mtd-designer-resize-handle.top-left {
    display: block !important;
    cursor: n-resize !important;
}

.mtd-designer-canvas-element[data-type="vline"] .mtd-designer-resize-handle.top-right {
    display: block !important;
    cursor: n-resize !important;
}

.mtd-designer-canvas-element[data-type="vline"] .mtd-designer-resize-handle.bottom-left {
    display: block !important;
    cursor: s-resize !important;
}

.mtd-designer-canvas-element[data-type="vline"] .mtd-designer-resize-handle.bottom-right {
    display: block !important;
    cursor: s-resize !important;
}

/* 分页符元素：不允许调整大小和旋转，宽度跟随画布 */
.mtd-designer-canvas-element[data-type="page-break"] {
    width: 100% !important;
    min-height: 0 !important;
    left: 0 !important;
}

/* 分页符元素：隐藏所有控制点和旋转手柄 */
.mtd-designer-canvas-element[data-type="page-break"] .mtd-designer-resize-handle,
.mtd-designer-canvas-element[data-type="page-break"] .mtd-designer-rotate-handle {
    display: none !important;
}



/* 右侧属性面板 */
.mtd-designer-right-panel {
    width: var(--mtd-panel-width);
    background-color: var(--mtd-bg-color-container);
    border-left: 1px solid var(--mtd-border-color-component);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.38, 0, 0.24, 1);
    box-shadow: var(--mtd-shadow-1);
}

.mtd-designer-property-group {
    margin-bottom: 20px;
    padding: 0 16px;
}

.mtd-designer-property-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--mtd-gray-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtd-designer-property-item {
    margin-bottom: 12px;
}

.mtd-designer-property-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--mtd-dark-color);
}

/* 表单控件 */
.mtd-designer-property-input, 
.mtd-designer-property-input[type="text"],
.mtd-designer-property-input[type="number"],
.mtd-designer-property-input[type="color"],
.mtd-designer-property-input[type="textarea"],
.mtd-designer-property-input[type="select"],
.mtd-designer-property-input.select,
.mtd-designer-property-input.input {
    width: 100%;
    padding: var(--mtd-spacer-2) var(--mtd-spacer-3);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-default);
    background-color: var(--mtd-bg-color-container);
    color: var(--mtd-text-color-regular);
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    font-size: 14px;
    line-height: 22px;
    outline: none;
    height: 32px;
}

select.mtd-designer-property-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--mtd-spacer-2) center;
    background-size: 16px;
    padding-right: calc(var(--mtd-spacer-2) * 5);
    /* 确保文字不会截断 */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    /* 确保宽度足够 */
    width: 100%;
    min-width: 140px;
    /* 增加高度以适应更多内容 */
    height: 36px;
    line-height: 20px;
    padding-top: 6px;
    padding-bottom: 6px;
}

textarea.mtd-designer-property-input {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.mtd-designer-property-input:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
}

.mtd-designer-property-input:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
}

.mtd-designer-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtd-designer-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--mtd-border-color);
    cursor: pointer;
}

.mtd-designer-color-input {
    flex: 1;
}

/* 文件上传控件样式优化 */
input[type="file"].mtd-designer-property-input {
    padding: 6px;
    height: auto;
    min-height: 32px;
    line-height: 20px;
}

/* 文件上传按钮样式 */
.mtd-designer-file-upload-btn {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
}

.mtd-designer-file-upload-btn input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.mtd-designer-file-upload-label {
    display: block;
    padding: var(--mtd-spacer-2) var(--mtd-spacer-3);
    border: 1px dashed var(--mtd-border-color);
    border-radius: var(--mtd-radius-default);
    background-color: var(--mtd-bg-color-container);
    color: var(--mtd-text-color-secondary);
    text-align: center;
    transition: all 0.2s;
    font-size: 14px;
}

.mtd-designer-file-upload-label:hover {
    border-color: var(--mtd-brand-color);
    color: var(--mtd-brand-color);
}


.mtd-designer-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtd-designer-slider {
    flex: 1;
    height: 6px;
    background-color: var(--mtd-gray-color-2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    margin: 0 4px;
}

.mtd-designer-slider-thumb {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--mtd-brand-color);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 0 2px var(--mtd-white-color);
    transition: all 0.2s ease;
}

.mtd-designer-slider-thumb:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 0 3px var(--mtd-white-color);
}

.mtd-designer-property-row {
    display: flex;
    gap: 12px;
}

.mtd-designer-property-row .mtd-designer-property-item {
    flex: 1;
    min-width: 0; /* 防止子元素溢出 */
}

/* 确保select元素有足够的宽度显示完整文本 */
.mtd-designer-property-row select.mtd-designer-property-input {
    min-width: 140px;
    max-width: 100%;
    width: 100%;
}

/* 确保边框样式下拉框有足够宽度 */
#mtdImageBorderStyle {
    width: 100% !important;
    min-width: 140px !important;
}

/* 基础信息面板中的下拉选择框 - 优化版 */
select.mtd-designer-basic-info-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300000066' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    width: 240px;
    height: 36px;
    font-family: TCloud, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

select.mtd-designer-basic-info-input:hover:not(:disabled) {
    border-color: var(--mtd-border-color-hover);
    background-color: var(--mtd-bg-color-container-hover);
}

select.mtd-designer-basic-info-input:focus:not(:disabled) {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background-color: var(--mtd-white-color);
}

.mtd-designer-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.mtd-designer-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mtd-designer-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.mtd-designer-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .mtd-designer-toggle-slider {
    background-color: var(--mtd-brand-color);
}

input:checked + .mtd-designer-toggle-slider:before {
    transform: translateX(20px);
}

/* 底部状态栏 */
.mtd-designer-footer {
    background-color: var(--mtd-light-color);
    border-top: 1px solid var(--mtd-border-color);
    padding: 0 20px;
    height: var(--mtd-footer-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--mtd-gray-color);
}

.mtd-designer-status-info {
    display: flex;
    gap: 20px;
}

.mtd-designer-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mtd-designer-status-item i {
    font-size: 16px;
    color: var(--mtd-text-color-secondary);
}

/* 辅助类 */
.mtd-designer-hidden {
    display: none !important;
}

.mtd-designer-panel-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--mtd-dark-color);
}

/* 网格背景 */
.mtd-designer-grid-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.5;
}

/* 修复拖动时的样式 */
.mtd-designer-dragging {
    opacity: 0.8;
    z-index: 1000;
}

.mtd-designer-resizing {
    user-select: none;
}

.mtd-designer-rotating {
    cursor: grabbing;
}

/* 条形码和二维码样式 */
.mtd-designer-barcode-preview, .mtd-designer-qrcode-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    overflow: hidden;
    box-sizing: border-box;
}

/* 条形码SVG样式 */
.barcode {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: auto;
}

/* 确保条形码SVG子元素不会阻止鼠标事件 */
.barcode * {
    pointer-events: none;
}

/* 表格样式 */
.mtd-designer-table-preview {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.mtd-designer-table-preview th, .mtd-designer-table-preview td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
}

.mtd-designer-table-preview th {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* 长文样式 */
.mtd-designer-long-text {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 14px;
    line-height: 1.5;
}

/* 分页符样式 */
.mtd-designer-page-break {
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        #ccc,
        #ccc 10px,
        transparent 10px,
        transparent 20px
    );
    position: relative;
    min-height: 0 !important;
}

.mtd-designer-page-break::after {
    content: "分页符";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 10px;
    font-size: 12px;
    color: #666;
}

/* 形状样式 */
.mtd-designer-shape-rectangle {
    border-radius: 0;
}

.mtd-designer-shape-circle {
    border-radius: 50%;
}

/* 
  打印预览样式
  注意：以下样式已被独立的打印预览模块(print-preview.css)替代
  保留这些样式是为了向后兼容，但不再使用
*/
/* 
.mtd-designer-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.mtd-designer-preview-header {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--mtd-border-color);
}

.mtd-designer-preview-title {
    font-size: 18px;
    font-weight: 600;
}

.mtd-designer-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--mtd-dark-color);
}

.mtd-designer-preview-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto;
}

.mtd-designer-preview-canvas {
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.mtd-designer-preview-controls {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid var(--mtd-border-color);
}
*/

/* 颜色选择器模态框 */
.mtd-designer-color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.mtd-designer-color-picker-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mtd-designer-color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mtd-designer-color-picker-title {
    font-size: 16px;
    font-weight: 600;
}

.mtd-designer-color-picker-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--mtd-dark-color);
}

.mtd-designer-color-picker-palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.mtd-designer-color-picker-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.mtd-designer-color-picker-swatch:hover {
    transform: scale(1.1);
}

.mtd-designer-color-picker-custom {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mtd-designer-color-picker-input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--mtd-border-color);
    border-radius: 6px;
}

/* 画布尺寸设置模态框样式 - TDesign 优化版 */
.mtd-designer-modal-content--canvas-size {
    max-width: 520px;
    width: 90%;
    margin: 20px;
    background: var(--mtd-bg-color-container);
    border-radius: var(--mtd-radius-medium);
    box-shadow: var(--mtd-shadow-3);
    overflow: hidden;
}

.mtd-designer-modal-content--canvas-size .mtd-designer-modal-header {
    background: var(--mtd-bg-color-page);
    border-bottom: 1px solid var(--mtd-border-color);
    padding: 20px 24px;
    position: relative;
}

.mtd-designer-modal-content--canvas-size .mtd-designer-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--mtd-text-color-primary);
    margin: 0;
    line-height: 1.4;
}

.mtd-designer-modal-content--canvas-size .mtd-designer-modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.mtd-designer-modal-content--canvas-size .mtd-designer-modal-footer {
    background: var(--mtd-bg-color-page);
    border-top: 1px solid var(--mtd-border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.mtd-designer-canvas-size-section {
    margin-bottom: 32px;
    position: relative;
}

.mtd-designer-canvas-size-section:last-child {
    margin-bottom: 0;
}

.mtd-designer-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--mtd-text-color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mtd-designer-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--mtd-brand-color);
    border-radius: 2px;
    display: block;
}

.mtd-designer-preset-sizes {
    margin-bottom: 20px;
}

.mtd-designer-preset-sizes .mtd-designer-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    padding: 0 16px;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    background: var(--mtd-bg-color-container);
    color: var(--mtd-text-color-regular);
}

.mtd-designer-preset-sizes .mtd-designer-input:hover {
    border-color: var(--mtd-border-color-hover);
    background: var(--mtd-bg-color-container-hover);
}

.mtd-designer-preset-sizes .mtd-designer-input:focus {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background: var(--mtd-white-color);
    outline: none;
}

.mtd-designer-custom-size {
    background: var(--mtd-bg-color-page);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.mtd-designer-custom-size::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mtd-brand-color), var(--mtd-brand-color-3));
    opacity: 0.8;
}

.mtd-designer-size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.mtd-designer-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mtd-designer-input-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mtd-text-color-regular);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mtd-designer-input-label::before {
    content: '•';
    color: var(--mtd-brand-color);
    font-size: 16px;
    line-height: 1;
}

.mtd-designer-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--mtd-bg-color-container);
    border: 1px solid var(--mtd-border-color);
    border-radius: var(--mtd-radius-medium);
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
    overflow: hidden;
}

.mtd-designer-input-wrapper:hover {
    border-color: var(--mtd-border-color-hover);
    background: var(--mtd-bg-color-container-hover);
}

.mtd-designer-input-wrapper:focus-within {
    border-color: var(--mtd-border-color-focus);
    box-shadow: 0 0 0 2px var(--mtd-brand-color-2);
    background: var(--mtd-white-color);
}

.mtd-designer-input-wrapper .mtd-designer-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--mtd-text-color-regular);
    outline: none;
    height: 44px;
    line-height: 20px;
}

.mtd-designer-input-wrapper .mtd-designer-input:focus {
    box-shadow: none;
}

.mtd-designer-input-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 500;
    color: var(--mtd-text-color-secondary);
    background: var(--mtd-bg-color-page);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    min-width: 40px;
    text-align: center;
}

.mtd-designer-current-size {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--mtd-border-color);
    margin-top: 16px;
}

.mtd-designer-current-size-label {
    font-size: 14px;
    color: var(--mtd-text-color-secondary);
    font-weight: 500;
}

.mtd-designer-current-size-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--mtd-text-color-primary);
    background: var(--mtd-brand-color-1);
    padding: 6px 12px;
    border-radius: var(--mtd-radius-small);
    border: 1px solid var(--mtd-brand-color-2);
}

.mtd-designer-size-validation {
    min-height: 28px;
    font-size: 13px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--mtd-radius-small);
    margin-top: 12px;
    transition: all 0.2s ease;
}

.mtd-designer-size-validation--error {
    background: rgba(213, 73, 65, 0.08);
    border: 1px solid rgba(213, 73, 65, 0.2);
    color: var(--mtd-error-color);
}

.mtd-designer-size-validation--success {
    background: rgba(0, 168, 112, 0.08);
    border: 1px solid rgba(0, 168, 112, 0.2);
    color: var(--mtd-success-color);
}

.mtd-designer-validation-error,
.mtd-designer-validation-success {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.mtd-designer-validation-error i {
    color: var(--mtd-error-color);
    font-size: 14px;
}

.mtd-designer-validation-success i {
    color: var(--mtd-success-color);
    font-size: 14px;
}

/* 关闭按钮样式优化 */
.mtd-designer-close-modal {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--mtd-text-color-secondary);
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.38, 0, 0.24, 1);
}

.mtd-designer-close-modal:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--mtd-text-color-primary);
    transform: scale(1.1);
}

.mtd-designer-close-modal:active {
    transform: scale(0.95);
}

/* 图片元素样式 */
.mtd-designer-element-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mtd-designer-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: 1px dashed #ddd;
    cursor: default;
    transition: all 0.2s ease;
}

.mtd-designer-image-placeholder:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
}

.mtd-designer-image-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    font-size: 14px;
}

.mtd-designer-image-placeholder-content i {
    font-size: 24px;
    color: var(--mtd-text-color-placeholder);
}

.mtd-designer-image-file-input {
    display: none;
}

/* 
  预览遮罩层
  注意：此样式已被独立的打印预览模块替代
*/
/*
.mtd-designer-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: default;
}
*/

/* 线条样式 */
.mtd-designer-line-element {
    background-color: transparent;
    min-width: 20px;
    min-height: 1px;
}

.mtd-designer-line-horizontal {
    width: 200px;
    /* 移除固定的高度设置，让JavaScript动态控制 */
    min-width: 20px;
    min-height: 1px;
    cursor: ew-resize;
}

.mtd-designer-line-vertical {
    width: 1px;
    height: 100px;
    min-width: 1px;
    min-height: 20px;
    cursor: ns-resize;
}

/* 二维码画布样式 */
.mtd-designer-qrcode-canvas {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
}

/* 二维码表格样式 */
.mtd-designer-qrcode-canvas table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    padding: 0;
}

.mtd-designer-qrcode-canvas td {
    margin: 0;
    padding: 0;
    border: none;
}

/* 二维码内容文本样式 */
.mtd-designer-qrcode-content {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    padding: 4px 8px;
    background-color: #f5f5f5;
    border-radius: 3px;
    max-width: 100%;
    word-break: break-all;
    white-space: normal;
}

/* 二维码元素基础样式 */
.mtd-designer-canvas-element[data-type="qrcode"] {
    min-width: 100px;
    min-height: 100px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-sizing: border-box;
}

.mtd-designer-canvas-element[data-type="qrcode"]:hover {
    border-color: #999;
}

.mtd-designer-canvas-element[data-type="qrcode"].selected {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 模态框通用样式 */
.mtd-designer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.mtd-designer-modal-content {
    background-color: var(--mtd-bg-color-container);
    border-radius: var(--mtd-radius-medium);
    width: 400px;
    max-width: 90%;
    box-shadow: var(--mtd-shadow-3);
}

.mtd-designer-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--mtd-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtd-designer-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.mtd-designer-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--mtd-dark-color);
}

.mtd-designer-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.mtd-designer-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--mtd-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 图标旋转辅助类 */
.rotate-90 {
    transform: rotate(90deg);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .mtd-designer-left-panel, .mtd-designer-right-panel {
        width: 240px;
    }
}

@media (max-width: 992px) {
    .mtd-designer-left-panel, .mtd-designer-right-panel {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .mtd-designer-container {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .mtd-designer-left-panel, .mtd-designer-right-panel {
        width: 160px;
    }
    
    .mtd-designer-element-grid {
        grid-template-columns: 1fr;
    }
}
