/* 全局变量 */
:root {
    --primary-color: #4CAF50;
    --hover-color: #45a049;
    --error-color: #ff4444;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 2px;
    box-sizing: border-box;
}

#canvasContainer {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: hidden;
    border: 2px dashed #666;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #f8f8f8;
    transition: all 0.3s ease;
    cursor: pointer;
}

.canvasContainer::before {
    content: "拖拽上传图片";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.canvasContainer.has-image::before {
    opacity: 0;
}

.canvasContainer.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.input-group {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px;
}

.textInput {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    min-height: 80px;
    resize: vertical;
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

button {
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 5px;
    min-width: 100px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--hover-color);
}

#errorMessage {
    color: var(--error-color);
    margin: 10px 0;
    min-height: 20px;
}

canvas {
    position: absolute;
    cursor: move;
    border-radius: 4px;
}

#buttonContainer {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 修改画布容器样式 */
.canvasContainer {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: hidden;
    border: 2px dashed #666;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #f8f8f8;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 修改编辑区域容器样式 */
.edit-areas-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    gap: 30px;
    margin: 20px auto;
}

.edit-area {
    flex: 0 0 45%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 修改背景画布样式 */
.backgroundCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

/* 修改二维码容器样式 */
.qrContainer {
    position: absolute;
    pointer-events: auto;
    z-index: 2;
}

.qrCanvas {
    cursor: move;
    position: absolute;
    display: block;
    top: 0;
    left: 0;
}

/* 修改角落虚线样式 */
.corner {
    position: absolute;
    pointer-events: none;
    width: 12px;
    height: 12px;
    border: 2px dashed #666;
    border-radius: 0;
    box-sizing: border-box;
}

.corner.top-left {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.corner.top-right {
    top: -1px;
    right: -1px;
    border-left: none;
    border-bottom: none;
}

.corner.bottom-left {
    bottom: -1px;
    left: -1px;
    border-right: none;
    border-top: none;
}

.corner.bottom-right {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

/* 修改调整大小的手柄样式 */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    bottom: 0;
    right: 0;
    transform: translate(50%, 50%);
    cursor: se-resize;
    z-index: 10;
}

/* 添加输入框包装器样式 */
.input-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
}

.input-wrapper textarea {
    flex: 1;
}

/* 修改文件上传输入框样式 */
.backgroundInput {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 添加响应式布局 */
@media (max-width: 768px) {
    .edit-areas-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .edit-area {
        flex: 0 0 100%;
        width: 100%;
        max-width: 400px;
    }

    .canvasContainer {
        height: 300px;
    }
}

.copy-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
}

/* 添加按钮组样式 */
.button-group {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.file-control {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.switchBgBtn {
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.switchBgBtn:hover {
    background-color: var(--hover-color);
}

.downloadBtn {
    margin-top: 15px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.downloadBtn:hover {
    background-color: var(--hover-color);
} 