/* ============ 印章生成器 - 工具特有样式 ============ */
/* 通用样式（容器布局、卡片、按钮、分隔线、info-box、section-row-1-2、切换开关等）由 common.css 统一提供 */
/* 注：.ratio-options / .btn-ratio 为各工具自带，common.css 未提供 */

/* ---- 卡片标题中间尺寸（预览区） ---- */
.card-header-center {
    flex: 1;
    text-align: center;
}

/* ---- 选项按钮（中心内容 / 快捷尺寸等） ---- */
.ratio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-ratio {
    padding: 6px 12px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ratio:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-ratio.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
    color: white;
}

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

.color-input {
    width: 36px;
    height: 36px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
}

.color-text {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Consolas', monospace;
    outline: none;
}

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

/* ---- 开关行容器 ---- */
.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- 提示文字 ---- */
.hint-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* ---- 文字偏移双轴微调（占满宽度、可换行不溢出） ---- */
.offset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    max-width: 100%;
}

.offset-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 200px;
    min-width: 0;
}

.offset-tag {
    font-size: 12px;
    color: #6b7280;
    flex-shrink: 0;
}

.offset-cell .range-with-value {
    flex: 1;
    min-width: 0;
}

.offset-cell .range-slider {
    flex: 1 1 auto;
    min-width: 60px;
}

/* ---- 滑块（带数值） ---- */
.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-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.preset-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.preset-item:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.preset-item.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.preset-preview {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

.preset-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

/* ---- 印章预览吸顶：调节样式时预览始终可见 ---- */
.preview-sticky {
    position: sticky;
    top: 16px;
    z-index: 5;
}

/* ---- 印章预览 ---- */
.stamp-preview {
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* 窄屏单列布局下取消吸顶，避免遮挡下方内容 */
@media (max-width: 768px) {
    .preview-sticky {
        position: static;
    }
}
