/* SD 页面样式 - 紧凑版 */

/* SD 页面整体紧凑覆盖 */
#sdPage .comfyui-connection-bar {
    padding: 3px 6px !important;
    gap: 4px !important;
}

#sdPage .comfyui-url-input {
    padding: 4px 6px;
    font-size: 11px;
}

#sdPage .comfyui-connect-btn {
    padding: 3px 8px;
    font-size: 10px;
}

#sdPage .comfyui-settings-bar {
    padding: 3px 8px !important;
    gap: 8px !important;
}

#sdPage .toggle-label {
    font-size: 10px;
}

#sdPage .toggle-text {
    font-size: 10px;
}

#sdPage .comfyui-execution-section {
    padding: 6px 8px !important;
}

#sdPage .comfyui-action-buttons {
    gap: 8px !important;
}

#sdPage .comfyui-run-btn,
#sdPage .comfyui-stop-btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
}

#sdPage .comfyui-progress-section {
    padding: 4px 8px !important;
}

#sdPage .comfyui-system-stats-section {
    padding: 2px 8px !important;
}

#sdPage .comfyui-error-section {
    padding: 4px 8px !important;
    margin: 0 !important;
}

#sdPage .comfyui-preview-section {
    padding: 4px 8px !important;
}

#sdPage .comfyui-section-header {
    font-size: 10px;
    margin-bottom: 4px;
}

/* ========== 紧凑参数区 ========== */
.sd-compact-params {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.sd-row-2col {
    display: flex;
    gap: 8px;
}

.sd-row-2col .sd-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sd-col-denoising {
    gap: 4px !important;
}

.sd-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* 文本输入框 - UXP 兼容 */
.sd-text-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: #fff;
    box-sizing: border-box;
}

.sd-text-input:focus {
    outline: none;
    border-color: #1473e6;
    background: rgba(0, 0, 0, 0.4);
}

.sd-text-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sd-input-sm {
    width: 100%;
}

.sd-input-xs {
    width: 50px;
    text-align: center;
    flex: none;
}

/* 滑条样式 */
.sd-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sd-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.sd-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #1473e6;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.sd-slider::-webkit-slider-thumb:hover {
    background: #0d5ccc;
}

.sd-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #1473e6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 小滑条样式 */
.sd-slider-mini {
    -webkit-appearance: none;
    appearance: none;
    width: 80%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin-top: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.sd-slider-mini::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #1473e6;
    border-radius: 50%;
    cursor: pointer;
}

.sd-slider-mini::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #1473e6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 下拉框 */
.sd-select {
    width: 100%;
    padding: 4px 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
}

.sd-select:focus {
    outline: none;
    border-color: #1473e6;
}

.sd-select-sm {
    width: auto;
    min-width: 80px;
}

/* 尺寸行 */
.sd-size-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sd-x {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
}

.sd-btn-sm {
    padding: 3px 8px;
    font-size: 10px;
    background: #4CAF50;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
}

.sd-btn-sm:hover {
    background: #45a049;
}

/* 复选框 */
.sd-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    white-space: nowrap;
}

.sd-check input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #4CAF50;
}

/* 填充按钮组 */
.sd-fill-btns {
    display: flex;
    gap: 4px;
    flex: 1;
}

.sd-fill-btn {
    flex: 1;
    padding: 3px 2px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.sd-fill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sd-fill-btn.selected {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

/* SD 页面特定的连接栏样式 */
#sdBaseUrl {
    font-size: 11px;
    padding: 4px 6px;
}

#sdTestBtn {
    padding: 4px 8px;
    font-size: 10px;
}

/* SD 预览区 */
#sdPreview {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 3px;
}

#sdPreviewArea {
    min-height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    padding: 4px;
}

/* 错误提示 */
.sd-error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 3px;
    padding: 4px 6px;
    margin: 4px;
    color: #f44336;
    font-size: 10px;
}
