/* ==================== 顶部导航栏 ==================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-left h1 {
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    filter: brightness(1.1);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.nav-separator {
    width: 1px;
    height: 28px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.4), transparent);
    margin: 0 8px;
}

/* 禁用按钮样式 */
.nav-btn:disabled,
.nav-btn.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none;
}

.nav-btn:disabled:hover,
.nav-btn.disabled:hover {
    transform: none !important;
    box-shadow: none;
    filter: none;
}

/* 特殊按钮样式 */
.nav-btn#preview-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.nav-btn#preview-btn:hover {
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.nav-btn#upload-btn {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.nav-btn#upload-btn:hover {
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.nav-btn#help-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.nav-btn#help-btn:hover {
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

/* ==================== 主要内容区域 ==================== */
.main-container {
    display: flex;
    height: calc(100vh - 100px);
}

/* ==================== 左侧章节管理区 ==================== */
.left-sidebar {
    width: 250px;
    height: 100%;
    background-color: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.add-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    filter: brightness(1.1);
}

.add-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.chapter-list {
    flex: 1;
    overflow-y: scroll !important;
    overflow-x: hidden;
    padding: 10px;
    min-height: 0;
    max-height: calc(100vh - 220px);
}

.chapter-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.chapter-header {
    padding: 10px;
    background-color: #ecf0f1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.chapter-header:hover {
    background-color: #d5dbdb;
}

.chapter-title {
    font-weight: bold;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chapter-title:hover {
    color: #3498db;
}

/* 章节折叠/展开图标 */
.chapter-toggle-icon {
    font-size: 12px;
    color: #666;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    padding: 2px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chapter-toggle-icon:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 页面列表的过渡动画 */
.page-list {
    padding: 5px 10px;
    background-color: white;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* 添加页面按钮的过渡动画 */
.chapter-item .add-btn {
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    overflow: hidden;
}

.chapter-item.collapsed .page-list {
    max-height: 0;
    padding: 0;
    opacity: 0;
}

/* 折叠时隐藏页面列表 */
.chapter-item.collapsed .page-list {
    display: none;
}

/* 折叠时隐藏添加页面按钮 */
.chapter-item.collapsed .add-btn {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    display: none;
}

.chapter-actions {
    display: flex;
    gap: 5px;
}

.chapter-action-btn {
    padding: 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    color: #666;
    transition: all 0.2s ease;
}

/* 悬停效果 */
.chapter-action-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 调整按钮间距 */
.chapter-actions {
    gap: 5px;
}

.page-item {
    padding: 8px;
    margin: 5px 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-item:hover {
    background-color: #e9ecef;
}

.page-item.active {
    background-color: #3498db;
    color: white;
}

.page-thumbnail {
    width: 30px;
    height: 20px;
    background-color: #ddd;
    border-radius: 2px;
    margin-right: 8px;
}

/* ==================== 中间编辑区 ==================== */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f0f0f0;
    position: relative;
}

.editor-toolbar {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.element-tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

.alignment-tools {
    display: flex;
    gap: 5px;
    padding: 5px;
    background-color: #e9ecef;
    border-radius: 6px;
}

.alignment-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ced4da;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alignment-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.alignment-btn:active {
    background-color: #e9ecef;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alignment-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

/* 层级移动按钮特殊样式 */
.alignment-btn#move-up-btn,
.alignment-btn#move-down-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.alignment-btn#move-up-btn:hover,
.alignment-btn#move-down-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.text-tools select,
.text-tools input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.format-btn {
    padding: 6px 10px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.format-btn:hover {
    background-color: #f0f0f0;
}

.format-btn.active {
    background-color: #3498db;
    color: white;
}

.element-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.element-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.element-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.element-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.element-btn.btn-delete {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.element-btn.btn-delete:hover {
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    filter: brightness(1.1);
}

/* 特殊按钮 - 题目向导按钮 */
.element-btn.problem-wizard-btn,
.element-btn#add-problem-wizard-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
}

.element-btn.problem-wizard-btn:hover,
.element-btn#add-problem-wizard-btn:hover {
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* 特殊按钮 - 添加动画按钮 */
.element-btn[data-id="add-animation-btn"],
.element-btn#add-animation-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.element-btn[data-id="add-animation-btn"]:hover,
.element-btn#add-animation-btn:hover {
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

/* ==================== 编辑元素样式 ==================== */
.editable-element {
    position: absolute;
    padding: 0;
    border: none;
    cursor: grab;
    transition: all 0.3s ease;
    box-sizing: border-box;
    user-select: none;
    margin: 0; /* 确保没有默认margin */
}

.editable-element:hover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.editable-element.selected {
    border: none;
    /* background-color: rgba(231, 76, 60, 0.05); */
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.editable-element.dragging {
    z-index: 1000;
    cursor: grabbing;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
    transform: scale(1.02);
    transition: none; /* 拖拽时禁用过渡效果 */
}

/* 拖拽手柄样式 */
.drag-handle {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.drag-handle:hover {
    opacity: 0.9;
    transform: translateX(-50%) scale(1.1);
}

/* 拖拽时的视觉反馈 */
.editable-element.dragging {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* 拖拽时的网格对齐指示 */
.snap-indicator {
    position: absolute;
    background: rgba(0, 123, 255, 0.3);
    pointer-events: none;
    z-index: 999;
}

.snap-indicator.horizontal {
    width: 100%;
    height: 2px;
    left: 0;
}

.snap-indicator.vertical {
    width: 2px;
    height: 100%;
    top: 0;
}

.text-element {
    min-height: 24px;
    outline: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    line-height: 1.4;
    font-size: 16px;
    padding: 4px;
}

.image-element {
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
}

/* ==================== 对齐辅助线容器 ==================== */
.snap-lines-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
}

.snap-line {
    position: absolute;
    background-color: #3498db;
    opacity: 0.7;
    z-index: 999;
}

.snap-line.horizontal {
    height: 1px;
    left: 0;
    right: 0;
}

.snap-line.vertical {
    width: 1px;
    top: 0;
    bottom: 0;
}

/* ==================== 手机编辑器容器 ==================== */
.mobile-editor-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 20px;
    overflow: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin-top: 20px;
}

/* ==================== 手机设备外框 ==================== */
.mobile-device-frame {
    position: relative;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 30px;
    padding: 15px;
    box-shadow:
        0 20px 40px rgba(0,0,0,0.3),
        0 10px 20px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

/* ==================== 设备扬声器 ==================== */
.device-speaker {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #555, #777);
    border-radius: 2px;
    margin: 0 auto 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

/* ==================== 手机屏幕容器 ==================== */
.mobile-screen-container {
    position: relative;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px;
}

.mobile-screen-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 1;
}

/* ==================== 手机Home按钮 ==================== */
.device-home-button {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #34495e, #2c3e50);
    border-radius: 50%;
    margin: 10px auto 5px;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-home-button:hover {
    background: linear-gradient(145deg, #3d566e, #2c3e50);
    transform: scale(1.05);
}

/* ==================== 手机画布 ==================== */
.editor-canvas.mobile-canvas {
    width: 393px;
    height: 852px;
    padding: 0;
    overflow: hidden;
    background-color: #ffffff;
    position: relative;
    border-radius: 17px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    transform-origin: center center;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* ==================== 不同设备尺寸 ==================== */
.device-iphone-se .editor-canvas.mobile-canvas { width: 375px; height: 667px; }
.device-iphone-12 .editor-canvas.mobile-canvas { width: 390px; height: 844px; }
.device-iphone-14 .editor-canvas.mobile-canvas { width: 430px; height: 932px; }
.device-iphone-15 .editor-canvas.mobile-canvas { width: 393px; height: 852px; }
.device-iphone-16 .editor-canvas.mobile-canvas { width: 430px; height: 932px; }
.device-iphone-17 .editor-canvas.mobile-canvas { width: 450px; height: 990px; }
.device-xiaomi-14 .editor-canvas.mobile-canvas { width: 390px; height: 865px; }
.device-xiaomi-15 .editor-canvas.mobile-canvas { width: 390px; height: 865px; }
.device-xiaomi-17 .editor-canvas.mobile-canvas { width: 412px; height: 915px; }
.device-samsung-s21 .editor-canvas.mobile-canvas { width: 384px; height: 854px; }
.device-samsung-s24 .editor-canvas.mobile-canvas { width: 384px; height: 854px; }
.device-huawei-p40 .editor-canvas.mobile-canvas { width: 360px; height: 780px; }

/* ==================== 横屏模式支持 ==================== */
@media (max-width: 768px) {
    .mobile-editor-container {
        padding: 10px;
    }

    .mobile-device-frame {
        transform: scale(0.8);
    }
}

@media (max-width: 480px) {
    .mobile-device-frame {
        transform: scale(0.6);
    }
}

/* ==================== 右侧属性设置区 ==================== */
.right-sidebar {
    width: 340px;
    background-color: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.properties-panel {
    flex: 1;
    overflow: hidden; /* 移除外层滚动条，使用内层滚动 */
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
}

/* ==================== 折叠面板样式 ==================== */
.accordion-item {
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.accordion-header {
    padding: 12px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    height: 45px;
    box-sizing: border-box;
}

.accordion-header:hover {
    background-color: #e9ecef;
}

.accordion-header h4 {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
}

.accordion-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.accordion-header.collapsed .accordion-icon {
    transform: rotate(-90deg);
}

.accordion-content {
    padding: 15px;
    background-color: white;
    overflow-y: auto; /* 只在需要时显示滚动条 */
    overflow-x: hidden;
    transition: all 0.3s ease-out;
    flex: 1;
}

.accordion-content.collapsed {
    display: none;
}

.property-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.property-section h4 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.property-group {
    margin-bottom: 15px;
}

.property-group:last-child {
    margin-bottom: 0;
}

.property-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 清除链接样式 */
.clear-link {
    color: #999;
    cursor: pointer;
    font-size: 11px;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    user-select: none;
}

.clear-link:hover {
    color: #666;
    background-color: #e9ecef;
}

.property-group input,
.property-group select,
.property-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    background-color: white;
    transition: all 0.2s ease;
}

.property-group select {
    height: 32px;
}

.property-group input[type="color"] {
    height: 32px;
    padding: 2px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    background-color: white;
}

.property-group input[type="color"]:hover {
    border-color: #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.property-group input[type="color"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* 重置颜色选择器的webkit样式 */
.property-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 3px;
}

.property-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.property-group input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

/* 双列属性布局 */
.property-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.property-row .property-group {
    flex: 1;
    margin-bottom: 0;
}

.property-row .property-group input {
    width: 100%;
}

.property-group input:focus,
.property-group select:focus,
.property-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 颜色选择器特殊样式 */
.property-group input[type="color"] {
    height: 45px;
    padding: 3px;
    cursor: pointer;
    border: 3px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: white;
    position: relative;
    overflow: hidden;
}

.property-group input[type="color"]:hover {
    border-color: #3498db;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.property-group input[type="color"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
    outline: none;
}

/* 颜色选择器自定义样式 */
.property-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 4px;
}

.property-group input[type="color"]::-webkit-color-swatch {
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.property-group input[type="color"]::-moz-color-swatch {
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.property-group textarea {
    resize: vertical;
    min-height: 60px;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #c0392b;
}

.animation-panel {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.animation-panel h3 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.apply-btn {
    width: 100%;
    padding: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.apply-btn:hover {
    background-color: #2980b9;
}

.cancel-btn {
    width: 100%;
    padding: 8px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

.no-selection {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* ==================== 底部操作区 ==================== */
.bottom-toolbar {
    height: 45px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 73, 94, 0.3);
}

.page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 73, 94, 0.4);
    filter: brightness(1.1);
}

.page-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 73, 94, 0.3);
}

.page-btn:disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none;
}

.page-btn:disabled:hover {
    transform: none !important;
    box-shadow: none;
    filter: none;
}

.page-indicator {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    padding: 0 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.edit-controls {
    display: flex;
    gap: 10px;
}

.edit-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
    filter: brightness(1.1);
}

.edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.edit-btn:disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none;
}

.edit-btn:disabled:hover {
    transform: none !important;
    box-shadow: none;
    filter: none;
}

.layout-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.layout-controls label {
    font-size: 12px;
    color: #555;
}

.layout-controls select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.mobile-content {
    background-color: white;
    border-radius: 10px;
    min-height: 500px;
    padding: 20px;
}

.delete-btn {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    width: 100%;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.apply-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.apply-btn:hover {
    background-color: #2980b9;
}

/* ==================== 布局约束可视化样式 ==================== */
.constraint-panel {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
}

.constraint-panel--content {
    padding: 0;
}

.constraint-panel--grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.constraint-display {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ed-constraints-map {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
}

.ed-constraints-map--layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
}

/* 约束线条和方块样式 */
.h-line, .v-line, .h-block, .v-block {
    background: #e0e0e0;
    transition: all 0.3s;
    justify-content: center;
    align-items: center;
    display: flex;
    position: relative;
}

/* 水平线条 */
.h-line {
    height: 3px;
    width: 100%;
    border-radius: 2px;
}

/* 垂直线条 */
.v-line {
    width: 3px;
    height: 100%;
    border-radius: 2px;
}

/* 水平方块 */
.h-block {
    height: 13px;
    width: 23px;
    opacity: 0;
    background-color: var(--color-bg-hover, #e0e0e0);
    position: absolute;
}

/* 垂直方块 */
.v-block {
    width: 13px;
    height: 23px;
    opacity: 0;
    background-color: var(--color-bg-hover, #e0e0e0);
    position: absolute;
}

/* Hover效果 */
.ed-constraints-map .ed-constraints-map--layout .ed-constraints-map--layout-top:hover .v-block,
.ed-constraints-map .ed-constraints-map--layout .ed-constraints-map--layout-bottom:hover .v-block,
.ed-constraints-map .ed-constraints-map--layout .ed-constraints-map--layout-left:hover .h-block,
.ed-constraints-map .ed-constraints-map--layout .ed-constraints-map--layout-right:hover .h-block {
    opacity: 1;
}

.ed-constraints-map .ed-constraints-map--layout .h-block:hover,
.ed-constraints-map .ed-constraints-map--layout .v-block:hover {
    opacity: 1;
}

/* 激活状态 */
.h-line-active {
    background: #1890ff !important;
}

.v-line-active {
    background: #1890ff !important;
}

.h-block-active {
    opacity: 0 !important;
}

.v-block-active {
    opacity: 0 !important;
}

/* 布局区域 */
.ed-constraints-map--layout-top {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
}

.ed-constraints-map--layout-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 3;
}

.ed-constraints-map--layout-left {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 2;
}

.ed-constraints-map--layout-right {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 3;
    grid-row: 2;
}

.ed-constraints-map--layout-center {
    position: relative;
    grid-column: 2;
    grid-row: 2;
}

/* 中心区域的线叠放形成十字 */
.ed-constraints-map--layout-center .h-line,
.ed-constraints-map--layout-center .v-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ed-constraints-map--layout-center .h-line {
    width: 100%;
}

.ed-constraints-map--layout-center .v-line {
    height: 100%;
}

/* 激活状态 */
.h-line-active, .v-line-active,
.h-block-active, .v-block-active {
    background: #1890ff !important;
    box-shadow: 0 0 8px rgba(24, 144, 255, 0.5);
}

/* 选择框容器 */
.constraint-panel--select-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.constraint-panel--select-width,
.constraint-panel--select-height {
    width: 100%;
}

.constraint-select {
    position: relative;
}

.constraint-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.constraint-select-trigger:hover {
    border-color: #1890ff;
}

.constraint-select-trigger--title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.constraint-select-trigger--title-text {
    font-size: 13px;
    color: #333;
}

.constraint-select-trigger svg {
    color: #666;
}

.constraint-select-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.constraint-select-hidden:hover + .constraint-select-trigger {
    border-color: #1890ff;
}

.mb__8 {
    margin-bottom: 8px;
}

/* 约束参数区域 */
.constraint-param {
    padding: 8px 0;
    border-top: 1px dashed #e0e0e0;
    margin-top: 8px;
}

/* ==================== 紧凑型布局约束样式 ==================== */
.constraint-compact {
    margin: 15px 0;
}

.constraint-compact-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 10px;
}

.constraint-compact-grid {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

/* 左侧9宫格 - 宽度占一半，高度等于两个下拉框的高度 */
.constraint-compact-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ed-constraints-map-compact {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
}

/* 右侧下拉框 */
.constraint-compact-selects {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.constraint-select-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.constraint-select-compact label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.constraint-select-compact select {
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background-color: white;
}

/* 动态参数显示区域 */
.constraint-params-compact {
    margin-top: 10px;
}

.param-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
}

.param-label {
    color: #666;
    white-space: nowrap;
    min-width: fit-content;
    font-size: 12px;
}

.param-input {
    flex: 1;
    height: 26px;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    background-color: white;
    min-width: 40px;
    max-width: 70px;
}

.param-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* ==================== 选择题布局模式 ==================== */

/* 选项列表基础样式 */
.choice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: white;
}

/* 1行布局：所有选项在一行显示，平均分配宽度 */
.choice-options.layout-single {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

.choice-options.layout-single .choice-option {
    flex: 1 1 0% !important;
    min-width: 0;
    width: auto !important;
}

/* 2行布局：每行显示2个选项，每个占50%宽度 */
.choice-options.layout-double {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px;
}

.choice-options.layout-double .choice-option {
    flex: 0 0 calc(50% - 4px) !important;
    min-width: 0;
    width: auto !important;
}

/* 4行布局：垂直排列，每个选项占一整行 */
.choice-options.layout-quadruple {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

.choice-options.layout-quadruple .choice-option {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0;
}

/* 多选题布局模式 */

/* 1行布局：所有选项在一行显示，平均分配宽度 */
.multi-choice-options.layout-single {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

.multi-choice-options.layout-single .multi-choice-option {
    flex: 1 1 0% !important;
    min-width: 0;
    width: auto !important;
}

/* 2行布局：每行显示2个选项，每个占50%宽度 */
.multi-choice-options.layout-double {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px;
}

.multi-choice-options.layout-double .multi-choice-option {
    flex: 0 0 calc(50% - 4px) !important;
    min-width: 0;
    width: auto !important;
}

/* 4行布局：垂直排列，每个选项占一整行 */
.multi-choice-options.layout-quadruple {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

.multi-choice-options.layout-quadruple .multi-choice-option {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0;
}

/* ==================== 选择题基础样式 ==================== */

/* 容器样式 */
.choice-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.choice-question {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: left;
    cursor: text;
}

/* 单选/多选选项基础样式 */
.choice-option,
.multi-choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.choice-option-text {
    flex: 1;
    text-align: left;
    cursor: text;
}

/* 单选框样式 */
.choice-radio {
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 复选框样式 */
.choice-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* 占位提交按钮样式（编辑器中使用） */
.multi-choice-submit-placeholder {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: rgb(102, 126, 234);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    opacity: 0.7;
}
    gap: 8px;
}

.multi-choice-options.layout-quadruple .multi-choice-option {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0;
}



