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

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

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

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

/* ---- 左栏缩略预览 ---- */
.preview-box {
    border-radius: 10px;
    overflow: hidden;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.preview-img {
    display: block;
    max-width: 100%;
    max-height: 360px;
}

/* ---- 右栏大图预览（棋盘格背景，便于观察透明区域） ---- */
.image-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: 15px;
    margin-bottom: 20px;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ---- 分析中遮罩 ---- */
.analyzing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #6d28d9;
    font-weight: 600;
    border-radius: 8px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e9d5ff;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

/* ---- 主色调卡片 ---- */
.dominant-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 2px solid #e9d5ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.dominant-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

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

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

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

.dominant-sub {
    font-size: 12px;
    color: #6b7280;
    font-family: monospace;
    margin-top: 4px;
}

.dominant-ratio {
    font-size: 12px;
    color: #8b5cf6;
    font-weight: 600;
    margin-top: 4px;
}

.copy-btn {
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e9d5ff;
    color: #7c3aed;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

/* ---- 配色方案 ---- */
.palette-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

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

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

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

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

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

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

.palette-ratio {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

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

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

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

.detail-preview {
    width: 120px;
    height: 120px;
    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: 48px;
    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;
}

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