#canvasContainer {
    position: relative;
    overflow: hidden;
    height: calc(100vh - 64px); /* 减去顶部导航栏的高度 */
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #ffffff;
}

#mainCanvas {
    display: block;
    cursor: crosshair;
    background: transparent;
    width: 100%;
    height: 100%;
}

.drop-zone-hint {
    background-color: white;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.drop-zone-hint button {
    pointer-events: auto;
}

#canvasContainer.dragging .drop-zone-hint {
    background-color: rgb(238 242 255);
}

.preview-section {
    position: relative;
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-container {
    position: relative;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.5rem;
    background: #f9fafb;
}

.preview-container canvas {
    display: block;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.preview-size {
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
}

.actions button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: rgb(55 65 81);
    background-color: white;
    border: 1px solid rgb(209 213 219);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.actions button:hover:not(:disabled) {
    color: rgb(79 70 229);
    border-color: rgb(79 70 229);
    background-color: rgb(238 242 255);
}

.actions button.active {
    color: rgb(79 70 229);
    border-color: rgb(79 70 229);
    background-color: rgb(238 242 255);
}

.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions button.download-btn {
    color: white;
    background-color: rgb(79 70 229);
    border-color: transparent;
}

.actions button.download-btn:hover:not(:disabled) {
    background-color: rgb(67 56 202);
    border-color: transparent;
}

/* 调整主布局 */
.flex.h-screen.pt-14 {
    padding-top: 3.5rem;
    gap: 1rem;
    padding: 3.5rem 1rem 1rem 1rem;
    background: #f9fafb;
}

/* 左侧编辑区域 */
.w-1/2.bg-white {
    background: transparent;
    padding: 0;
}

/* 右侧预览区域 */
#previewArea {
    padding: 1rem;
    margin: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    height: calc(100vh - 96px); /* 64px(顶部导航) + 16px(上边距) + 16px(下边距) */
    overflow-y: auto;
}

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

#previewArea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#previewArea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

#previewArea::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

#editArea {
    position: relative;
    display: flex;
}

#verticalRuler {
    width: 30px;
    background-color: #f3f4f6;
    position: relative;
    cursor: crosshair;
    border-right: 1px solid #e5e7eb;
}

.ruler-tick {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #d1d5db;
}

.ruler-tick::after {
    content: attr(data-value);
    position: absolute;
    left: 2px;
    top: -7px;
    font-size: 10px;
    color: #6b7280;
}

.ruler-tick.major {
    height: 2px;
    background-color: #9ca3af;
}

#imageContainer {
    position: relative;
    flex: 1;
}

#sourceCanvas {
    display: block;
    width: 100%;
}

#rulerLines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#rulerLines .ruler-line {
    pointer-events: auto;
} 