/* overlay-image.css */
.overlay-content-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 30px;
    max-width: 900px; /* 稍微宽一点以便预览 */
}

.overlay-form-group {
    margin-bottom: 20px;
}

.overlay-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.overlay-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.overlay-flex-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.overlay-file-box {
    flex: 1;
    border: 1px dashed #ccc;
    padding: 15px;
    border-radius: 4px;
    background: #fdfdfd;
}

/* 预览工作区 */
.overlay-workspace-container {
    margin-top: 20px;
    padding: 10px;
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none; /* 初始隐藏 */
    overflow: hidden;
    user-select: none;
}

.overlay-workspace {
    position: relative;
    margin: 0 auto;
    /* 宽高由 JS 动态设置 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden; /* 确保前景图不出界 */
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>');
}

/* 背景图层 */
#overlay-bg-layer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none; /* 背景图不响应鼠标 */
}

/* 前景图容器（用于定位） */
#overlay-fg-container {
    position: absolute;
    top: 0;
    left: 0;
    cursor: move;
    border: 1px dashed rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    /* 初始大小由 JS 设定 */
}

#overlay-fg-layer {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none; /* 让事件穿透到 container */
}

/* 缩放手柄 */
.overlay-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #4a90e2;
    border: 2px solid #fff;
    border-radius: 50%;
    bottom: -7px;
    right: -7px;
    cursor: se-resize;
    z-index: 10;
}

#overlay-btn-start {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#overlay-btn-start:hover {
    background-color: #357abd;
}

#overlay-btn-start:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.overlay-error-msg {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.overlay-tips {
    background: #e8f4fc;
    color: #2c3e50;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    border-left: 4px solid #4a90e2;
}