/* ============ 控件部件（common.css 未提供的统一配套样式，沿用 二维码生成 视觉） ============ */
.content-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

.content-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

.text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

/* 范围滑块（统一控件） */
.range-with-value {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

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

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

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

.range-value {
    font-size: 13px;
    font-weight: 600;
    color: #6d28d9;
    min-width: 52px;
    text-align: right;
}

.range-slider.small {
    width: 50px;
    flex: 0 0 auto;
}

.range-slider.small::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
}

.range-slider.small::-moz-range-thumb {
    width: 12px;
    height: 12px;
}

/* 分段选择 */
.mode-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    padding: 8px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

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

.mode-btn.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #6d28d9;
}

.mode-selector.compact {
    flex-wrap: nowrap;
}

.mode-selector.compact .mode-btn {
    padding: 4px 8px;
    min-width: auto;
    font-size: 11px;
}

/* 复选框行 */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.checkbox-row input {
    margin: 0;
}

.checkbox-row span {
    font-size: 13px;
    color: #374151;
}

/* 上传占位 */
.upload-placeholder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-placeholder:hover,
.upload-placeholder.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

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

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

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

/* 颜色选择 */
.color-picker {
    width: 44px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

/* ============ 类型 / 样式网格 ============ */
.type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.type-btn.active {
    border-color: #8b5cf6;
    background: #ede9fe;
}

.type-icon {
    font-size: 24px;
}

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

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.style-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.style-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.style-control {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

/* ============ 二维码专属样式 ============ */
.style-settings {
    padding: 12px;
}

/* 风格分组 */
.style-section {
    padding: 12px 0;
}

.style-section:first-of-type {
    padding-top: 4px;
}

.style-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

/* 码点形状网格 */
.dot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.style-btn:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.style-btn.active {
    border-color: #8b5cf6;
    background: #ede9fe;
}

.style-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
}

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

/* 定位角形状网格 */
.eye-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* 参数行 */
.param-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.param-row .setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.param-row .setting-group.grow {
    flex: 1;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.color-row .color-picker {
    width: 38px;
    height: 32px;
    flex: 0 0 auto;
}

.color-row .text-input {
    width: 92px;
    flex: 0 0 auto;
    padding: 7px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

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

.transparent-chk {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    margin-left: 2px;
}

/* 推荐风格 */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.preset-btn.active {
    border-color: #8b5cf6;
    background: #ede9fe;
}

.preset-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: block;
}

.preset-thumb svg {
    display: block;
    width: 100%;
    height: 100%;
}

.preset-name {
    font-size: 11px;
    font-weight: 500;
    color: #4b5563;
}

/* Logo 上传 */
.logo-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 12px;
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.logo-upload:hover,
.logo-upload.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.logo-upload-icon {
    font-size: 32px;
}

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

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

.logo-preview {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-preview-controls {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.logo-preview > img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.logo-remove {
    padding: 5px 10px;
    border: 1px solid #ef4444;
    background: #fff;
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.logo-remove:hover {
    background: #fef2f2;
}

.drag-hint {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 6px;
}

/* 紧凑 Logo（基本设置中复用 erweimasheng 样式设置的外观） */
.logo-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-upload-area.compact {
    padding: 6px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.logo-placeholder-small,
.logo-preview-small {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.logo-preview-small {
    position: relative;
}

.logo-preview-small img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: contain;
}

.logo-preview-small .logo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

.logo-placeholder-small span {
    font-size: 11px;
}

.logo-size-slider {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    flex: 1;
}

/* 预览区 */
.preview-area {
    padding: 30px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-preview-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    border-radius: 10px;
    overflow: hidden;
    padding: 15px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qr-code-display canvas,
.qr-code-display img {
    max-width: 100%;
    height: auto;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.qr-tip {
    margin: 12px 0 0;
    font-size: 12px;
    color: #d97706;
    text-align: center;
}

/* 桌面端：右栏内仅「二维码预览 + 推荐风格」吸顶（.right-sticky），
   基本设置正常随页滚动；右栏拉伸到整行高度以给吸顶留出滚动空间。 */
@media (min-width: 769px) {
    body .section-row-1-2 {
        grid-template-columns: 1fr 2fr;
    }
    .section-row-1-2 > div:last-child > .right-sticky {
        position: sticky;
        top: 15px;
    }
}

@media (max-width: 768px) {
    .section-row-1-2 {
        grid-template-columns: 1fr;
    }
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .type-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .eye-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .preset-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 下载按钮组 */
.download-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}



/* Logo 额外控件（边框/形状） */
.logo-extra {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    width: 100%;
}

.logo-extra-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.logo-color-row .color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: none;
    cursor: pointer;
}

.logo-color-row .eye-grid {
    flex: 1;
}

/* 当前风格标签 */
.current-style-tag {
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    padding: 3px 10px;
    border-radius: 999px;
}

.current-style-tag.custom {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}
