/* ============ 图片取色器 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、mode-btn、badge、form-hint 等）已由 common.css 统一提供 */

/* ---- 容器 + 左右 1:2 布局 ---- */
#quseqi-container > .section-row {
    display: flex;
    gap: 15px;
}

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

#quseqi-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;
}

/* ---- 区块标题 ---- */
.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}

/* ---- 取色画布 ---- */
.canvas-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
    border-radius: 8px;
    padding: 10px;
    min-height: 200px;
    overflow: hidden;
}

.image-canvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.crosshair-h, .crosshair-v {
    position: absolute;
    background: rgba(139, 92, 246, 0.8);
    pointer-events: none;
    z-index: 5;
}

.crosshair-h {
    left: 0;
    right: 0;
    height: 1px;
}

.crosshair-v {
    top: 0;
    bottom: 0;
    width: 1px;
}

.magnifier {
    position: absolute;
    border: 3px solid #8b5cf6;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 10;
}

.magnifier-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.magnifier-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ---- 实时预览 ---- */
.hover-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hover-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.hover-info {
    flex: 1;
    min-width: 0;
}

.hover-hex {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    font-family: monospace;
}

.hover-sub {
    font-size: 11px;
    color: #6b7280;
    font-family: monospace;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hover-hint {
    font-size: 12px;
    color: #8b5cf6;
    margin-top: 10px;
    text-align: center;
}

/* ---- 已取颜色 ---- */
.picked-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.picked-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.picked-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
}

.picked-card.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.picked-swatch {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.picked-info {
    flex: 1;
    min-width: 0;
}

.picked-hex {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    font-family: monospace;
}

.picked-sub {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-copy, .card-remove {
    padding: 4px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.card-copy:hover { background: #ede9fe; }
.card-remove:hover { background: #fee2e2; color: #dc2626; }

/* ---- 颜色详情 ---- */
.detail-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
}

.detail-preview {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.detail-formats {
    flex: 1;
    min-width: 0;
}

.format-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.format-row:last-child { border-bottom: none; }

.format-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    width: 44px;
    flex-shrink: 0;
}

.format-value {
    flex: 1;
    font-size: 13px;
    color: #1f2937;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-mini {
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.copy-mini:hover { background: #ede9fe; }

/* ---- 滑块（带数值） ---- */
.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;
    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: 36px;
    text-align: right;
}

/* ---- 模式选择（mode-btn 由 common.css 提供） ---- */
.mode-selector {
    display: flex;
    gap: 6px;
}

/* ---- 结果区底部操作 ---- */
.result-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.result-actions .btn {
    flex: 1;
}

/* ---- 复选项 ---- */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    accent-color: #8b5cf6;
}

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