/* ============ 图片加水印 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、empty-state 等）已由 common.css 统一提供 */

/* ---- 容器 + 左右 1:2 布局 ---- */
#sy-container {
    margin-bottom: 15px;
}

#sy-container > .section-row {
    display: flex;
    gap: 15px;
}

#sy-container > .section-row > .settings-card {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
}

#sy-container > .section-row > .preview-card {
    flex: 2;
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 上传区（与九宫格切图保持一致） ---- */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ---- 水印文字输入 ---- */
.form-input {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #8b5cf6;
}

/* ---- 位置选择（九宫格） ---- */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 132px;
}

.pos-btn {
    position: relative;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-btn::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.pos-btn:hover::after {
    opacity: 1;
}

.pos-btn:hover {
    border-color: #c4b5fd;
}

.pos-btn.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

/* ---- 滑块（带数值） ---- */
.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 48px;
    text-align: right;
}

/* ---- 推荐值快捷按钮 ---- */
.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.preset-chip {
    padding: 4px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-chip:hover {
    border-color: #c4b5fd;
}

.preset-chip.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #6d28d9;
    font-weight: 600;
}

/* ---- 颜色选择 ---- */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 40px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-value {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    font-family: monospace;
}

/* ---- 水印图片上传 ---- */
.watermark-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 100px;
}

.watermark-image-upload:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.watermark-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.upload-icon-small {
    font-size: 28px;
}

.upload-text-small {
    font-size: 12px;
    color: #6b7280;
}

.watermark-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.watermark-image-preview img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 4px;
}

/* ---- 预览区 ---- */
.preview-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border-radius: 12px;
    padding: 15px;
    min-height: 300px;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.preview-canvas {
    display: block;
    max-width: 100%;
    max-height: 600px;
    cursor: copy;
    touch-action: none;
}

.preview-tip {
    margin-top: 12px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    background: #f5f7fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.preview-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #sy-container > .section-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ---- 图片水印时禁用的设置项（颜色/字体粗细） ---- */
.setting-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* ---- 位置微调滑块 ---- */
.pos-fine {
    margin-top: 8px;
}

.range-label {
    font-size: 12px;
    color: #6b7280;
    min-width: 28px;
    flex-shrink: 0;
}
