* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部工具栏 */
.toolbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
    will-change: transform;
}

/* Logo区域 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: -0.5px;
}

/* 教程弹窗版本信息 */
.tutorial-version {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* 右侧操作区域 */
.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 画板比例下拉选择器 */
.canvas-selector-dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: #3b82f6;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    min-width: 65px;
    justify-content: space-between;
    height: 48px;
    box-sizing: border-box;
}

.dropdown-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.dropdown-btn.open {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.selected-ratio {
    font-weight: 600;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 8px;
    border: 2px solid rgba(226, 232, 240, 0.5);
    background: white;
    color: #4a5568;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-height: 40px;
    grid-column: span 2; /* 默认占 1/3 宽度 (2/6) */
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.dropdown-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 首图常规/首图竖版：各占 1/2 宽度 (3/6) */
.dropdown-item.wide-btn {
    grid-column: span 3;
}

/* 自定义尺寸按钮：占满整行 (6/6) */
.dropdown-item.custom-ratio-btn {
    grid-column: span 6;
}

.canvas-btn {
    padding: 12px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.canvas-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #2d3748;
}

.canvas-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}



.action-btn {
    padding: 12px 24px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#exportBtn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

#exportBtn:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.action-btn:disabled {
    background: rgba(160, 174, 192, 0.6);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.action-btn:disabled:hover {
    background: rgba(160, 174, 192, 0.6);
    transform: none;
    box-shadow: none;
}

/* 主工作区 */
.workspace {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
    position: relative;
}

.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
    position: relative;
    overflow: hidden;
    padding: 40px;
    /* 性能优化 */
    will-change: contents;
    contain: layout style;
    transform: translateZ(0); /* 创建新的合成层 */
}

.canvas-container.hidden {
    display: none;
}

.canvas {
    position: relative;
    background: white;
    border: 3px solid rgba(59, 130, 246, 0.6);
    border-radius: 0;
    box-shadow:
        0 0 0 2000px rgba(0, 0, 0, 0.8),
        0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1;
    /* 默认尺寸 16:9，避免初始化时的闪烁 */
    width: 960px;
    height: 540px;
    /* 性能优化 */
    will-change: contents;
    contain: layout style paint;
    transform-origin: center center;
    flex: 0 0 auto; /* 避免随容器宽度压缩，交给 JS 统一缩放 */
    /* 移除 max-width/max-height，改用 JS 动态缩放保持比例 */
}

/* 不同比例的画布尺寸 */
.canvas.ratio-16-9 {
    width: 960px !important;
    height: 540px !important;
}

.canvas.ratio-1-1 {
    width: 540px !important;
    height: 540px !important;
}

.canvas.ratio-2-3 {
    width: 360px !important;
    height: 540px !important;
}

.canvas.ratio-3-2 {
    width: 540px !important;
    height: 360px !important;
}

.canvas.ratio-3-4 {
    width: 405px !important;
    height: 540px !important;
}

.canvas.ratio-4-3 {
    width: 540px !important;
    height: 405px !important;
}

.canvas.ratio-9-16 {
    width: 304px !important;
    height: 540px !important;
}

.canvas.ratio-SBV {
    width: 1031px !important;
    height: 540px !important;
}

.canvas.ratio-CLT {
    width: 432px !important;
    height: 540px !important;
}

.drop-zone {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: 0;
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    font-size: 16px;
    font-weight: 500;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    z-index: 3;
    will-change: transform;
}

.drop-zone.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    transform: scale(1.01);
}

.drop-zone.hidden {
    display: none;
}

/* 图片元素 - 性能优化版 */
.image-layer {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 2;
    display: block;
    border-radius: 0;
    object-fit: fill; /* 强制图片填充整个元素，不保持原始比例 */
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0); /* 开启GPU加速 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    contain: layout style paint;
}

/* 拖拽中的状态 - 取消过渡动画 */
.image-layer.dragging {
    transition: none !important;
    will-change: transform;
    z-index: 9999 !important;
    cursor: grabbing !important;
}

/* 优化后的图片 */
.image-layer.optimized {
    image-rendering: auto; /* 对压缩图片使用更平滑的渲染 */
}

/* 复制拖拽状态的视觉效果 */
.image-layer.copy-dragging {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: 
        0 0 0 2px rgba(72, 187, 120, 0.6),
        0 8px 32px rgba(72, 187, 120, 0.4);
    cursor: copy;
    z-index: 1000;
}

/* Alt键提示样式 - 移除跳动效果，仅在复制模式下显示 */

/* 复制模式样式 */
body.copy-mode .image-layer {
    cursor: copy !important;
}

body.copy-mode .image-layer:hover {
    box-shadow: 
        0 0 0 2px rgba(72, 187, 120, 0.4),
        0 4px 16px rgba(72, 187, 120, 0.2);
}

/* 复制模式下的简化提示 - 移除动画避免跳动 */
body.copy-mode .image-layer:hover::after {
    content: '拖拽复制';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(72, 187, 120, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1001;
}

/* 全局控制点容器 - 放在画布容器外层 */
.global-handles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* 控制点边框 */
.selection-border {
    position: absolute;
    border: 2px solid #3b82f6;
    border-radius: 0;
    box-shadow: 
        0 0 0 1px rgba(59, 130, 246, 0.2),
        0 4px 20px rgba(59, 130, 246, 0.3);
    pointer-events: none;
    z-index: 101;
    will-change: transform, opacity;
    transform: translateZ(0);
    transform-origin: center;
    transition: opacity 0.2s ease;
}

/* 调整大小控制点 */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 102;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.4),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    pointer-events: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    will-change: transform;
    transform: translateZ(0);
}

.resize-handle:hover {
    transform: scale(1.2);
    box-shadow: 
        0 6px 20px rgba(59, 130, 246, 0.5),
        0 0 0 2px rgba(59, 130, 246, 0.3);
}

.resize-handle.nw { 
    top: -6px; 
    left: -6px; 
    cursor: nw-resize; 
}
.resize-handle.ne { 
    top: -6px; 
    right: -6px; 
    cursor: ne-resize; 
}
.resize-handle.sw { 
    bottom: -6px; 
    left: -6px; 
    cursor: sw-resize; 
}
.resize-handle.se { 
    bottom: -6px; 
    right: -6px; 
    cursor: se-resize; 
}

/* 图层面板 */
.layers-panel {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 0 0 0;
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    will-change: transform;
    display: flex;
    flex-direction: column;
}

.layers-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2d3748;
    letter-spacing: -0.5px;
    padding: 0 20px;
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 0 20px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 6px;
    cursor: grab;
    background: rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 4px;
    -webkit-user-drag: element;
    min-height: 56px;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.layer-item.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.layer-item.dragging {
    opacity: 0.8;
    cursor: grabbing;
    transform: rotate(1deg) scale(0.98) translateZ(0);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.95);
    border-color: #667eea;
    border-width: 2px;
    z-index: 1000;
    position: relative;
    transition: none;
}

/* 拖拽指示器 - 整个卡片高亮，移除跳动效果 */
.layer-item.drag-over-full {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transition: none;
}

/* 拖拽指示器 - 在目标上方 */
.layer-item.drag-over-top {
    border-top: 3px solid #667eea;
    position: relative;
}

.layer-item.drag-over-top::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #667eea;
    z-index: 10;
}

/* 拖拽指示器 - 在目标下方 */
.layer-item.drag-over-bottom {
    border-bottom: 3px solid #667eea;
    position: relative;
}

.layer-item.drag-over-bottom::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #667eea;
    z-index: 10;
}

/* 拖拽区域提示文字 */
.layer-item.drag-over-full .layer-name {
    color: #667eea;
    font-weight: 600;
}

.layer-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 0;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.layer-name {
    min-width: 60px;
    max-width: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.layer-name:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.layer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

.layer-action {
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(248, 250, 252, 0.9);
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #64748b;
    transition: all 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.5);
    flex-shrink: 0;
}

.layer-action svg {
    width: 10px;
    height: 10px;
}

.layer-action:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.layer-action.toggle-visibility {
    padding: 2px;
}

.layer-action.toggle-visibility svg {
    width: 18px;
    height: 18px;
    color: #3b82f6;
    transition: color 0.2s ease;
}

.layer-action.toggle-visibility.hidden svg {
    color: #94a3b8;
}

.layer-action.toggle-visibility:hover svg {
    color: #2563eb;
}

.layer-action.toggle-visibility.hidden:hover svg {
    color: #64748b;
}

.layer-action.delete {
    font-size: 18px;
    color: #64748b;
}

.layer-action.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.layer-action.fill-mode {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.8);
    font-size: 10px;
    font-weight: bold;
    border-radius: 6px;
}

.layer-action.fill-mode.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
}

/* 全局性能优化 - 移除通用transform避免图片跳动 */
* {
    /* 优化渲染性能 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 关键元素硬件加速 - 移除可能跳动的元素 */
.canvas, .resize-handle, .selection-border, 
.canvas-btn, .action-btn {
    transform: translateZ(0);
    will-change: transform;
}

/* 优化动画性能 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

.canvas-btn, .action-btn, .layer-item {
    animation: fadeIn 0.3s ease-out;
}

/* 优化的背景效果 */
.app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.2), transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1), transparent 40%);
    pointer-events: none;
    z-index: -1;
    will-change: transform;
    transform: translateZ(0);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* 图片样式工具栏 */
.image-toolbar {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 6px;
    z-index: 1002;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.08s ease, visibility 0.08s ease, transform 0.08s ease;
    will-change: transform, opacity;
}

.image-toolbar.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 覆盖模式下的增强对比度 */
.image-toolbar.overlay-mode {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 0 2px rgba(255, 255, 255, 0.8);
}

.image-toolbar::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    outline: none;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 600;
    margin: 0 2px;
}

.toolbar-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #5a67d8;
    transform: scale(1.05);
}

.toolbar-btn:hover img {
    opacity: 1;
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn:focus {
    outline: none;
    border: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 吸附对称线样式 */
.snap-line {
    position: absolute;
    background: #3b82f6;
    pointer-events: none;
    z-index: 999;
    opacity: 0.8;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

.snap-line.vertical {
    width: 1px;
    border-left: 1px dashed #3b82f6;
    background: none;
}

.snap-line.horizontal {
    height: 1px;
    border-top: 1px dashed #3b82f6;
    background: none;
}

.snap-line::before {
    content: attr(data-label);
    position: absolute;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 1000;
}

.snap-line.vertical::before {
    left: 4px;
    top: 8px;
}

.snap-line.horizontal::before {
    left: 8px;
    top: -16px;
}

/* 画布顶部工具栏 */
.canvas-top-toolbar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

.canvas-tool-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.canvas-tool-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.canvas-tool-btn:disabled {
    background: rgba(160, 174, 192, 0.6);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(160, 174, 192, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.canvas-tool-btn:disabled:hover {
    background: rgba(160, 174, 192, 0.6);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(160, 174, 192, 0.4);
    transform: none;
    box-shadow: none;
}

/* 图标按钮样式 */
.canvas-tool-btn.icon-btn {
    padding: 8px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.canvas-tool-btn:hover .btn-icon {
    opacity: 1;
}

.canvas-tool-btn:disabled .btn-icon {
    opacity: 0.4;
    filter: grayscale(1);
}

/* 重做图标水平翻转实现对称效果 */
.redo-icon {
    transform: scaleX(-1);
}

/* 版权信息样式 */
.copyright {
    text-align: center;
    padding: 16px 20px;
    margin-top: auto;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

/* 导出模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    animation: slideIn 0.3s ease-out forwards;
    overflow-y: auto;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: -0.5px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(226, 232, 240, 0.8);
    color: #4a5568;
    transform: scale(1.1);
}

.modal-body {
    padding: 16px 20px 20px;
}

.amazon-batch-modal .modal-content {
    max-width: 1080px;
    width: calc(100% - 48px);
}

.batch-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-header-actions .batch-export-btn {
    padding: 10px 24px;
    font-size: 14px;
}

.batch-tip {
    margin: 0 0 16px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
}

.batch-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

.batch-slot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(100, 116, 139, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.batch-slot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 600;
    color: #1f2937;
}

.batch-slot-top .slot-title {
    flex: 0 0 auto;
    min-width: 60px;
}

.batch-slot-top .slot-orientation:not(.empty) {
    margin: 0 auto;
}

.slot-orientation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 22px;
    font-size: 12px;
    color: #475569;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.slot-orientation::before {
    content: '';
}

.slot-orientation.square::before {
    content: '◻';
}

.slot-orientation.landscape::before {
    content: '▭';
}

.slot-orientation.portrait::before {
    content: '▭';
    transform: rotate(90deg);
    display: inline-block;
}

.slot-orientation.empty {
    display: none;
}

.slot-export-btn {
    border: 1px solid #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.slot-export-btn:hover {
    background: rgba(59, 130, 246, 0.16);
}

.slot-export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.6);
    color: #64748b;
}

.batch-slot-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0;
    border: 1px dashed #cbd5f5;
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.15) 0%, rgba(221, 214, 254, 0.15) 100%);
    overflow: hidden;
    cursor: grab;
}

/* CLT 画板下的槽位使用 4:5 比例 */
.batch-slot-canvas.ratio-clt {
    aspect-ratio: 4 / 5;
}

.batch-slot-canvas.dragging {
    cursor: grabbing;
}

.batch-slot.dragover .batch-slot-canvas {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.slot-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-size: 13px;
    gap: 6px;
    text-align: center;
    pointer-events: none;
}

.slot-sub {
    font-size: 12px;
    color: #64748b;
}

.slot-image {
    position: absolute;
    top: 0;
    left: 0;
    user-select: none;
    pointer-events: none;
}

.batch-slot-controls {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.slot-actions {
    display: flex;
    gap: 8px;
}

.slot-actions button {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.slot-actions button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.batch-clear-all-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.batch-clear-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.batch-clear-all-btn:active {
    transform: translateY(0);
}

.batch-export-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.batch-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
}

.batch-export-btn:active {
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .batch-slots-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .batch-slots-grid {
        grid-template-columns: repeat(1, minmax(220px, 1fr));
    }

    .batch-slot {
        padding: 12px;
    }

}

.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    text-align: center;
}

.export-option:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.export-option:active {
    transform: translateY(-1px);
}

.export-option.selected {
    border-color: rgba(59, 130, 246, 0.8);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.export-option.selected .format-icon {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.format-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 8px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.format-info {
    width: 100%;
}

.format-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.format-desc {
    font-size: 11px;
    color: #718096;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
}

/* 不同格式的特定图标颜色 */
.export-option[data-format="png"] .format-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.export-option[data-format="jpg"] .format-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.export-option[data-format="svg"] .format-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.export-option[data-format="pdf"] .format-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.export-option[data-format="ai"] .format-icon {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.export-option[data-format="eps"] .format-icon {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* HOT标签样式 */
.hot-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    animation: pulse-hot 2s infinite;
    z-index: 1;
}

@keyframes pulse-hot {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
}

/* 文件名设置区域样式 */
.filename-section {
    margin-bottom: 16px;
    text-align: center;
}

.filename-label {
    display: block;
    margin-bottom: 8px;
}

.label-text {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.label-desc {
    display: inline-block;
    font-size: 10px;
    color: #6b7280;
    background: rgba(247, 250, 252, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    font-weight: 500;
    margin-left: 8px;
    line-height: 1.2;
    opacity: 0.9;
    transition: all 0.2s ease;
}

.label-desc:hover {
    opacity: 1;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    color: #374151;
}

.filename-input-wrapper {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filename-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    text-align: center;
}

.filename-input:focus {
    border-color: rgba(59, 130, 246, 0.8);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.filename-input::placeholder {
    color: #a0aec0;
}

/* 日期复选框样式 */
.date-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(247, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
    white-space: nowrap;
    user-select: none;
}

.date-checkbox-label:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

.date-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.date-checkbox:checked {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
}

.date-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.checkbox-text {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.filename-preview {
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 6px;
    font-size: 11px;
    color: #4a5568;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.preview-text {
    color: #718096;
    margin-right: 4px;
}

.preview-name {
    color: #2d3748;
    font-weight: 500;
}

.preview-ext {
    color: #3182ce;
    font-weight: 600;
}

/* 分隔线样式 */
.modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(226, 232, 240, 0.8) 20%, rgba(226, 232, 240, 0.8) 80%, transparent 100%);
    margin: 16px 0;
}

/* 格式选择区域 */
.format-section {
    margin-top: 0;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 12px 16px 16px;
    }
    
    .export-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .export-option {
        min-height: 85px;
        padding: 12px 8px;
    }
    
    .format-icon {
        width: 32px;
        height: 32px;
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .format-name {
        font-size: 12px;
    }
    
    .format-desc {
        font-size: 10px;
    }
    
    .filename-input-wrapper {
        max-width: 320px;
    }
    
    .input-row {
        gap: 8px;
    }
    
    .date-checkbox-label {
        padding: 6px 8px;
    }
    
    .checkbox-text {
        font-size: 11px;
    }
    
    .label-desc {
        font-size: 9px;
        padding: 1px 4px;
        margin-left: 6px;
    }
    
    .hot-badge {
        font-size: 8px;
        padding: 2px 4px;
        top: 6px;
        right: 6px;
    }
}

@media (max-width: 400px) {
    .export-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .export-option {
        min-height: 70px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 12px;
    }
    
    .format-icon {
        margin-right: 12px;
        margin-bottom: 0;
    }
    
    .format-info {
        flex: 1;
    }
}

/* 调色工具栏样式 */
.color-toolbar {
    position: fixed;
    top: 50%;
    right: -400px;
    transform: translateY(-50%);
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transition: right 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.color-toolbar.show {
    right: 20px;
}

.color-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.color-toolbar-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: -0.5px;
}

.color-toolbar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.color-toolbar-close:hover {
    background: rgba(226, 232, 240, 0.8);
    color: #4a5568;
    transform: scale(1.1);
}

.color-toolbar-content {
    padding: 24px 24px 16px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.color-control {
    margin-bottom: 28px;
    position: relative;
    padding: 0 4px;
}

.color-control:last-child {
    margin-bottom: 8px;
}

.color-control label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.color-slider-container {
    position: relative;
    margin-bottom: 12px;
    padding: 8px 0;
}

.color-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e2e8f0, #667eea);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    padding: 8px 0;
    margin: -8px 0;
}

.color-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

.color-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.color-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

.color-value {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 28px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 5px;
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transition: left 0.15s ease, background 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.color-slider:hover + .color-value {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateX(-50%) scale(1.05);
}

.color-toolbar-actions {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 32px -24px 0 -24px;
    padding: 18px 28px 22px 28px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.color-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    max-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    min-width: 80px;
    flex: none;
}

.color-btn.primary {
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.4);
}

.color-btn.primary:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.color-btn.secondary {
    color: #718096;
    border: 1px solid rgba(160, 174, 192, 0.4);
}

.color-btn.secondary:hover {
    background: rgba(160, 174, 192, 0.12);
    border-color: rgba(160, 174, 192, 0.6);
    color: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(160, 174, 192, 0.15);
}

/* 去朦胧滑块特殊样式 */
#dehazeSlider {
    background: linear-gradient(to right, #b0c4de, #4682b4, #1e90ff);
}

#dehazeSlider::-webkit-slider-thumb {
    background: linear-gradient(135deg, #1e90ff 0%, #4682b4 100%);
}

#dehazeSlider::-moz-range-thumb {
    background: linear-gradient(135deg, #1e90ff 0%, #4682b4 100%);
}

/* 色温滑块特殊样式 */
#temperatureSlider {
    background: linear-gradient(to right, #87ceeb, #e2e8f0, #ffa500);
}

#temperatureSlider::-webkit-slider-thumb {
    background: linear-gradient(135deg, #ff7f50 0%, #ffa500 100%);
}

#temperatureSlider::-moz-range-thumb {
    background: linear-gradient(135deg, #ff7f50 0%, #ffa500 100%);
}

/* 色调滑块特殊样式 */
#tintSlider {
    background: linear-gradient(to right, #90ee90, #e2e8f0, #dda0dd);
}

#tintSlider::-webkit-slider-thumb {
    background: linear-gradient(135deg, #9370db 0%, #dda0dd 100%);
}

#tintSlider::-moz-range-thumb {
    background: linear-gradient(135deg, #9370db 0%, #dda0dd 100%);
}

/* 剪裁模式相关样式 */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #667eea;
    background: transparent;
    cursor: move;
    z-index: 201;
    box-shadow: 
        0 0 0 1px rgba(102, 126, 234, 0.3),
        0 4px 20px rgba(102, 126, 234, 0.4);
    pointer-events: auto;
}

.crop-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(102, 126, 234, 0.6);
    margin: 2px;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 202;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(102, 126, 234, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crop-handle:hover {
    transform: scale(1.2);
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.5),
        0 0 0 2px rgba(102, 126, 234, 0.3);
}

.crop-handle.nw { 
    top: -6px; 
    left: -6px; 
    cursor: nw-resize; 
}
.crop-handle.ne { 
    top: -6px; 
    right: -6px; 
    cursor: ne-resize; 
}
.crop-handle.sw { 
    bottom: -6px; 
    left: -6px; 
    cursor: sw-resize; 
}
.crop-handle.se { 
    bottom: -6px; 
    right: -6px; 
    cursor: se-resize; 
}

.crop-actions {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 203;
    white-space: nowrap;
}

.crop-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crop-btn.confirm {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.crop-btn.confirm:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.crop-btn.cancel {
    background: rgba(255, 255, 255, 0.9);
    color: #718096;
    border: 1px solid rgba(160, 174, 192, 0.4);
}

.crop-btn.cancel:hover {
    background: rgba(248, 250, 252, 0.95);
    color: #4a5568;
    border-color: rgba(160, 174, 192, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.2);
}

/* 剪裁模式下隐藏其他工具栏 */
.crop-mode .image-toolbar {
    display: none;
}

.crop-mode .global-handles-container {
    display: none;
}

/* 框选多选功能样式 */
.selection-box {
    position: absolute;
    border: 2px dashed #667eea;
    background: rgba(102, 126, 234, 0.1);
    pointer-events: none;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.2);
}

/* 多选状态下的图片样式 */
.image-layer.multi-selected {
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.6),
        0 4px 20px rgba(102, 126, 234, 0.3);
}

/* 多选控制点容器 */
.multi-selection-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
}

/* 多选边框 */
.multi-selection-border {
    position: absolute;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.05);
    pointer-events: none;
    z-index: 151;
    box-shadow: 
        0 0 0 1px rgba(102, 126, 234, 0.2),
        0 4px 20px rgba(102, 126, 234, 0.3);
}

/* 多选缩放控制点 */
.multi-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nw-resize;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 152;
    transition: all 0.2s ease;
}

.multi-resize-handle:hover {
    transform: scale(1.3);
    background: #4c51bf;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.multi-resize-handle.nw {
    cursor: nw-resize;
}

.multi-resize-handle.ne {
    cursor: ne-resize;
}

.multi-resize-handle.sw {
    cursor: sw-resize;
}

.multi-resize-handle.se {
    cursor: se-resize;
}

/* 多选拖拽区域 */
.multi-drag-area {
    background: transparent;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.multi-drag-area:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 多选工具栏 */
.multi-selection-toolbar {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 6px;
    z-index: 1003;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    will-change: transform, opacity;
}

.multi-selection-toolbar.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 覆盖模式下的增强对比度 */
.multi-selection-toolbar.overlay-mode {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 0 2px rgba(255, 255, 255, 0.8);
}

.multi-selection-toolbar::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

.multi-toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    outline: none;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
}

.multi-toolbar-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #5a67d8;
    transform: scale(1.05);
}

.multi-toolbar-btn:active {
    transform: scale(0.95);
}

.multi-toolbar-btn:focus {
    outline: none;
    border: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.multi-toolbar-btn .toolbar-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.multi-toolbar-btn:hover .toolbar-icon {
    opacity: 1;
}


/* 图层面板中的多选状态 */
.layer-item.multi-selected {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    border-width: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .workspace {
        flex-direction: column;
    }
    
    .canvas-container {
        overflow: hidden; /* 确保移动端也不出现滚动条 */
        padding: 20px; /* 移动端减少padding */
    }
    
    .layers-panel {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .canvas.ratio-16-9 { width: 480px; height: 270px; }
    .canvas.ratio-1-1 { width: 320px; height: 320px; }
    .canvas.ratio-2-3 { width: 213px; height: 320px; }
    .canvas.ratio-3-2 { width: 320px; height: 213px; }
    .canvas.ratio-9-16 { width: 180px; height: 320px; }
    .canvas.ratio-CLT { width: 256px; height: 320px; }

    .toolbar {
        padding: 12px 16px;
    }
    
    .canvas-selector {
        gap: 8px;
        padding: 6px;
    }
    
    .canvas-btn, .action-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header, .modal-body {
        padding: 20px;
    }
    
    .export-option {
        padding: 16px;
    }
    
    .format-icon {
        width: 48px;
        height: 48px;
        margin-right: 16px;
        font-size: 12px;
    }
    
    /* 调色工具栏移动端适配 */
    .color-toolbar {
        right: -380px;
        width: 320px;
    }
    
    .color-toolbar.show {
        right: 10px;
    }
    
    .color-toolbar-content {
        padding: 18px 18px 14px 18px;
        max-height: 60vh;
    }
    
    .color-control {
        margin-bottom: 22px;
        padding: 0 2px;
    }
    
    .color-slider-container {
        margin-bottom: 10px;
        padding: 6px 0;
    }
    
    .color-value {
        bottom: -18px;
        font-size: 9px;
        padding: 1px 4px;
        min-width: 22px;
    }
    
    .color-toolbar-actions {
        padding: 16px 22px 20px 22px;
        gap: 10px;
        margin: 28px -18px 0 -18px;
        justify-content: center;
    }
    
    .color-btn {
        padding: 7px 14px;
        font-size: 12px;
        max-height: 30px;
        min-width: 70px;
    }
    
    /* 剪裁功能移动端适配 */
    .crop-actions {
        top: -40px;
        gap: 6px;
    }
    
    .crop-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .crop-handle {
        width: 14px;
        height: 14px;
    }
    
    .crop-handle.nw { top: -7px; left: -7px; }
    .crop-handle.ne { top: -7px; right: -7px; }
    .crop-handle.sw { bottom: -7px; left: -7px; }
    .crop-handle.se { bottom: -7px; right: -7px; }
    
    /* 移动设备上的旋转按钮调整 */
    .rotation-handle {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .rotation-handle::before {
        font-size: 16px;
    }
    
    .rotation-line {
        height: 35px;
    }
    
    .rotation-feedback {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* 帮助按钮样式 */
.help-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 39px;
    height: 39px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.4),
        0 0 0 0 rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: helpPulse 2s infinite;
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 24px rgba(102, 126, 234, 0.5),
        0 0 0 0 rgba(102, 126, 234, 0.7);
    animation: none;
}

.help-btn:active {
    transform: scale(0.95);
}

.help-btn svg {
    transition: transform 0.2s ease;
}

.help-btn:hover svg {
    transform: rotate(15deg);
}

@keyframes helpPulse {
    0% {
        box-shadow: 
            0 4px 16px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 
            0 4px 16px rgba(102, 126, 234, 0.4),
            0 0 0 8px rgba(102, 126, 234, 0.1);
    }
    100% {
        box-shadow: 
            0 4px 16px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.5);
    }
}

/* 移动端帮助按钮适配 */
@media (max-width: 768px) {
    .help-btn {
        bottom: 20px;
        left: 20px;
        width: 48px;
        height: 48px;
    }
    
    .help-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* 教程弹窗样式 */
.tutorial-modal {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tutorial-modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15);
    transform: translateY(-20px);
    animation: slideIn 0.3s ease-out forwards;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.tutorial-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
    flex-shrink: 0;
}

.tutorial-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #3b82f6;
    letter-spacing: -0.5px;
}

.tutorial-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* 教程导航标签 */
.tutorial-nav-compact {
    flex-shrink: 0;
    background: rgba(247, 250, 252, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    padding: 0 16px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 教程内容容器 */
.tutorial-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

.tutorial-section {
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

.tutorial-section.active {
    display: block;
}

.tutorial-section h3 {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 介绍卡片 */
.intro-card {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.intro-card h4 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 16px;
}

/* 步骤网格 */
.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.step-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h5 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.step-content p {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.5;
}

/* 操作列表 */
.operation-list {
    display: grid;
    gap: 12px;
}

.operation-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.operation-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.operation-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.operation-text h5 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.operation-text p {
    color: #4a5568;
    font-size: 13px;
    margin: 0;
}

/* 功能网格 */
.feature-grid, .layer-features, .multi-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.feature-item {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.feature-item h5 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.feature-item ul {
    margin: 0;
    padding-left: 16px;
}

.feature-item li {
    color: #4a5568;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.feature-item p {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* 导出格式 */
.export-formats {
    display: grid;
    gap: 12px;
}

.format-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.format-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.format-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    min-width: 50px;
    text-align: center;
}

.format-badge.png { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.format-badge.jpg { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.format-badge.svg { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.format-badge.pdf { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.format-badge.eps { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.format-info {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.5;
}

.format-info strong {
    color: #2d3748;
}

/* 快捷键 */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.shortcut-group {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.shortcut-group h5 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.shortcut-item kbd {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: monospace;
    color: #3b82f6;
    font-weight: 600;
}

.shortcut-item span {
    color: #4a5568;
    font-size: 13px;
}

/* 技巧列表 */
.tips-list {
    display: grid;
    gap: 12px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.tip-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.tip-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tip-content h5 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.tip-content p {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tutorial-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .tutorial-modal-header {
        padding: 16px 20px;
    }
    
    .tutorial-content-container {
        padding: 20px;
    }
    
    .step-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid,
    .layer-features,
    .multi-features,
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        padding: 8px 0;
    }
    
    .nav-tab {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .tutorial-section h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .tutorial-content-container {
        padding: 16px;
    }
    
    .operation-item,
    .format-item,
    .tip-item {
        padding: 12px;
    }
    
    .step-item {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .operation-item,
    .tip-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .format-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* 360度旋转按钮 */
.rotation-handle {
    position: absolute;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    z-index: 1010; /* 确保旋转按钮在图像工具栏之上 */
}

.rotation-handle:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.rotation-handle:active,
.rotation-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.6);
}

.rotation-handle::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('image/旋转.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    display: block;
}

/* 旋转指示线 */
.rotation-line {
    position: absolute;
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, #3b82f6, transparent);
    transform-origin: bottom center;
    pointer-events: none;
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1005; /* 确保旋转指示线在工具栏之上 */
}

.rotation-line.show {
    opacity: 1;
}

/* 旋转时的视觉反馈 */
.rotation-feedback {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1015; /* 确保旋转反馈在所有工具栏之上 */
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: translate(-50%, -50%);
}

.rotation-feedback.show {
    opacity: 1;
}

.toolbar .nav-toast {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.85);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 28px;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(59,130,246,0.10);
    z-index: 1200;
    pointer-events: none;
    opacity: 0;
    animation: navToastFadeIn 0.25s forwards, navToastFadeOut 0.4s 1.6s forwards;
}

.shift-resize-hint {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 110%);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 22px;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    pointer-events: none;
    z-index: 1200;
}

.shift-resize-hint.visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

@keyframes navToastFadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes navToastFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 画板颜色按钮及面板 */
.canvas-color-panel-wrapper {
    position: absolute;
    top: 24px;
    right: 36px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.canvas-color-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #e0e7ef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    margin-bottom: 8px;
}
.canvas-color-btn:hover {
    background: linear-gradient(135deg, #e0e7ef 0%, #cbd5e1 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59,130,246,0.18);
}

.canvas-color-btn svg {
    color: #3b82f6;
}

.amazon-export-btn {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}

.amazon-export-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-color: #f59e0b;
}

.amazon-export-btn svg {
    width: 22px;
    height: 22px;
}

.canvas-color-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1.5px solid #e0e7ef;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(59,130,246,0.13);
    padding: 18px 20px 14px 20px;
    min-width: 90px;
    margin-top: 2px;
    position: absolute;
    right: 0;
    top: 48px;
    z-index: 30;
    animation: fadeIn 0.2s;
}
.canvas-color-panel.show {
    display: flex;
}
.color-presets {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.color-preset {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #e0e7ef;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(59,130,246,0.08);
}
.color-preset:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.15);
}
.color-preset.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.color-picker-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 0 0;
}
.canvas-color-picker {
    width: 38px;
    height: 38px;
    border: none;
    background: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.08);
    cursor: pointer;
    padding: 0;
}
.eyedropper-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 0 0;
}
.eyedropper-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #e0e7ef;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.eyedropper-btn:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #e0e7ef 0%, #cbd5e1 100%);
    box-shadow: 0 4px 12px rgba(59,130,246,0.13);
}
.eyedropper-btn svg {
    color: #6366f1;
}
@media (max-width: 768px) {
    .canvas-color-panel-wrapper {
        top: 12px;
        right: 10px;
    }
    .canvas-color-panel {
        min-width: 120px;
        padding: 12px 10px 10px 10px;
        top: 40px;
    }
    .canvas-color-btn {
        width: 36px;
        height: 36px;
    }
    .color-preset, .canvas-color-picker, .eyedropper-btn {
        width: 28px;
        height: 28px;
    }
}

/* ==================== 自定义比例模态框 ==================== */

/* 下拉菜单分隔线 */
.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 8px;
}

/* 自定义比例按钮 */
.custom-ratio-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    color: #3b82f6 !important;
    font-weight: 500;
}

.custom-ratio-btn .custom-icon {
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.custom-ratio-btn:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* 自定义比例模态框 */
.custom-ratio-modal .modal-content {
    max-width: 420px;
}

/* 尺寸输入区域 */
.custom-ratio-inputs {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.size-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.size-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 12px;
    transition: all 0.2s ease;
}

.input-with-unit:focus-within {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.size-input {
    width: 100px;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    text-align: center;
    outline: none;
}

.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.size-input[type=number] {
    -moz-appearance: textfield;
}

.unit {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

.size-separator {
    font-size: 20px;
    color: #94a3b8;
    font-weight: 300;
    padding-bottom: 8px;
}

/* 预览区域 */
.custom-ratio-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 20px;
}

.preview-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-ratio {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.preview-size {
    font-size: 14px;
    color: #64748b;
}

/* 快捷预设 */
.quick-presets {
    margin-bottom: 16px;
}

/* 预设标签 - 亚马逊橙色 */
.presets-label {
    font-size: 12px;
    color: #ea580c;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 10px;
}

/* 历史标签 - 灰色 */
.history-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 10px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.history-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* 预设按钮 - 亚马逊橙色主题 */
.preset-btn {
    padding: 10px 6px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-radius: 8px;
    font-size: 11px;
    color: #c2410c;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.preset-btn:hover {
    border-color: #f97316;
    color: #ea580c;
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

/* 历史记录按钮 - 灰色主题 */
.history-btn {
    padding: 10px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.history-btn:hover {
    border-color: #94a3b8;
    color: #475569;
    background: #f1f5f9;
}

/* 历史记录 */
.custom-ratio-history {
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.history-btn {
    position: relative;
}

.history-btn .delete-history {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-btn:hover .delete-history {
    opacity: 1;
}

/* 错误提示 */
.custom-ratio-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 16px;
}

/* 确认按钮区域 */
.custom-ratio-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.cancel-btn {
    padding: 12px 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.confirm-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.confirm-btn:active {
    transform: translateY(0);
}

/* 响应式适配 */
@media (max-width: 480px) {
    .custom-ratio-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .size-separator {
        display: none;
    }

    .size-input {
        width: 100%;
    }

    .input-with-unit {
        width: 100%;
    }

    .preset-buttons,
    .history-buttons {
        justify-content: center;
    }
}
