#comfyPage .cyber-widget {
    margin-bottom: 5px;
    padding: 10px;
    background: rgba(5, 217, 232, 0.05);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
#comfyPage .cyber-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    animation: cyber-scan 3s linear infinite;
}
#comfyPage .cyber-widget:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .widget-label {
    display: block;
    margin-bottom: 1px;
    color: #bebebf;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#comfyPage .cyber-input {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    height: 38px;
    line-height: 38px;
    padding: 0 12px;
    font-size: 16px;
}
#comfyPage .cyber-input:focus {
    outline: none;
    border-color: #c5ef52;
    box-shadow: 0 0 5px #c5ef52;
}
#comfyPage .number-input-container {
    position: relative;
    width: 120px;
}
#comfyPage .input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: space-between;
    width: 100%;
    min-height: 32px; 
    position: relative;
    z-index: 0;
    box-sizing: border-box;
}
#comfyPage .number-widget .input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-start;
}
#comfyPage .number-input {
    width: 100px;
    height: 24px;
    padding: 0 8px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 2px;
    color: #fff;
    font-size: 14px;
    font-family: monospace;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: text;
    display: block;
    margin: 0;
    position: relative;
    z-index: 1;
    opacity: 1;
    visibility: visible;
}
#comfyPage .number-input:focus {
    border-color: #c5ef52;
    box-shadow: 0 0 5px rgba(197, 239, 82, 0.5);
}
#comfyPage .number-input::-webkit-inner-spin-button,
#comfyPage .number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#comfyPage .number-btn,
#comfyPage .seed-btn {
    width: 28px;
    height: 28px;
    padding: 2px;
    background-color: var(--spectrum-global-color-gray-800);
    border: 1px solid var(--spectrum-global-color-gray-700);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;  
}
#comfyPage .btn-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--spectrum-global-color-gray-50);
    user-select: none;
}
#comfyPage .number-btn:hover,
#comfyPage .seed-btn:hover {
    background-color: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
}
.seed-btn.active {
    background-color: var(--spectrum-global-color-blue-600);
    border-color: var(--spectrum-global-color-blue-700);
}
.seed-btn.active #comfyPage .btn-content {
    color: #fff;
}
#comfyPage .number-btn:hover .btn-content,
#comfyPage .seed-btn:hover .btn-content {
    color: #3d4246;
}
#comfyPage .range-hint {
    font-size: 12px;
    color: var(--neon-blue);
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}
#comfyPage .toggle-widget {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 4px 12px !important;
    min-height: 30px !important;
    height: 30px !important;
    box-sizing: border-box !important;
    background: #27292b !important;
    border-radius: 4px !important;
}
#comfyPage .toggle-container {
    position: relative !important;
    width : 46px !important;
    height : 22px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}
#comfyPage .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position : absolute;
}
#comfyPage .toggle-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border : 1px solid var(--spectrum-global-color-gray-600) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}
#comfyPage .toggle-slider:before {
    position: absolute !important;
    content: "" !important;
    height: 16px !important;
    width: 16px !important;
    left: 2px !important;
    bottom: 2px !important;
    background-color: #fff !important;
    border-radius: 8px !important; 
    transition: all 0.2s ease !important;
}
#comfyPage .toggle-input:checked + .toggle-slider {
    background: #c5ef52 !important; 
    border-color: #c5ef52 !important; 
}
#comfyPage .toggle-input:checked + .toggle-slider:before {
    transform: translateX(24px) !important; 
}
.toggle-widget.active #comfyPage .widget-label,
#comfyPage .toggle-input:checked ~ .widget-label {
    color: #c5ef52 !important; 
    font-weight: 600 !important;
    text-shadow: 0 0 3px rgba(197, 239, 82, 0.3) !important;
}
.toggle-widget.active,
.widget-container.toggle-widget:has(#comfyPage .toggle-input:checked) {
    border-color: #c5ef52 !important;
    background: rgba(76, 175, 80, 0.05) !important; 
}
#comfyPage .toggle-container:hover .toggle-slider {
    border-color: var(--spectrum-global-color-gray-500) !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2) !important;
}
#comfyPage .toggle-input:checked + .toggle-slider:hover,
#comfyPage .toggle-container:hover .toggle-input:checked + .toggle-slider {
    background: #c5ef52 !important; 
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3) !important; 
}
.widget-container.toggle-widget:hover {
    border-color: var(--spectrum-global-color-gray-500) !important;
}
.toggle-widget.active {
    border-color: #c5ef52 !important; 
}
#comfyPage .toggle-widget .widget-label {
    margin: 0 !important;
    flex: 1 !important;
    color: var(--spectrum-global-color-gray-50) !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}
#comfyPage .toggle-widget label.widget-label {
    display: flex;
    align-items: center;
    height: 100%;
}
#comfyPage .widget-container {
    margin-bottom: 5px;
    padding: 6px 8px;
    background: #27292b !important;
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: visible;
    min-height: 48px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.widget-container.toggle-widget {
    min-height: 30px !important;
    height: 30px !important;
    padding: 4px 8px !important;
}
#comfyPage .widget-container:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .text-widget input[type="text"] {
    width: 100%;
    padding: 8px;
    background: rgb(45 48 50 / 80%);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    color: #fff;
}
#comfyPage .number-widget input[type="number"] {
    width: 100px;
    padding: 8px;
    background: rgb(45 48 50 / 80%);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    color: #fff;
}
#comfyPage .slider-widget {
    height: auto;
    min-height: 48px;
    margin-bottom: 5px;
    background: #27292b;
    border: 1px solid #414344;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px var(--theme-glow);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    box-sizing: border-box;
    user-select: none;
}
#comfyPage .slider-widget:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .slider-widget .widget-label {
    text-align: center;
    width: 100%;
    margin: 0;
    margin-bottom: 1px;
    padding: 1px 0;
    color: #bebebf;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
#comfyPage .slider-widget .widget-label:hover {
    color: var(--theme-secondary);
}
#comfyPage .slider-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    width: 100%;
}
#comfyPage .slider-value {
    width: 38px;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    font-family: monospace;
    pointer-events: none;
    margin-right : 8px;
    transition: background-color 0.2s;
    order: -1;
    flex-shrink: 0;
    vertical-align: middle;
}
#comfyPage .slider-track-container {
    flex: 1;
    position: relative;
    vertical-align: middle;
}
#comfyPage .slider-track {
    position: relative;
    width: 95%;
    height: 6px;
    background-color: var(--spectrum-global-color-gray-700);
    border-radius: 2px;
    cursor: pointer;
    margin-top: 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}
#comfyPage .slider-progress {
    position: absolute;
    height: 100%;
    background-color: #4CAF50 !important;
    border-radius: 3px;
    pointer-events: none;
    top: 0;
    left: 0;
    transition: width 0.1s ease-out;
    box-shadow: inset 0 0 3px rgba(76, 175, 80, 0.3) !important;
}
#comfyPage .slider-thumb {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 10px;
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: all;
    z-index: 1;
    border: 1px solid #ffffff !important;
    box-shadow : 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}
#comfyPage .slider-thumb:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4) !important; 
    border-color: #4CAF50 !important;
}
#comfyPage .slider-thumb:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.5) !important;
}
.slider-widget.dragging #comfyPage .slider-value {
    background-color: rgba(76, 175, 80, 0.2) !important;
    border-color: #4CAF50 !important;
    color: #4CAF50 !important;
}
#comfyPage .slider-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#comfyPage .slider-input:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.combo-widget {
    height: auto;
    min-height: 48px;
    margin-bottom: 5px;
    background: #27292b;
    border: 1px solid #414344;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px var(--theme-glow);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
#comfyPage .combo-widget:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .combo-widget .widget-label {
    color: var(--theme-text, #ffffff);
    margin-bottom: 1px;
    font-weight: 500;
}
#comfyPage .combo-options-container {
    height: 100%;
    overflow-y: auto;
    padding: 4px 0;
    margin-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-secondary, #3c3c3c) var(--theme-background, #1e1e1e);
}
#comfyPage .combo-options-container::-webkit-scrollbar {
    width: 6px;
}
#comfyPage .combo-options-container::-webkit-scrollbar-track {
    background: var(--theme-background-dark, #1e1e1e) !important;
    border-radius: 3px;
}
#comfyPage .combo-options-container::-webkit-scrollbar-thumb {
    background: var(--theme-secondary, #3c3c3c) !important;
    border-radius: 3px;
}
#comfyPage .combo-options-container::-webkit-scrollbar-thumb:hover {
    background: var(--theme-accent, #4c4c4c) !important;
}
#comfyPage .combo-option {
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    color: var(--theme-text, #cccccc);
}
#comfyPage .combo-option:hover {
    background: #c5ef52 !important;
    color: #3d4246 !important;
}
.combo-option.selected {
    background: #44494c !important;
    color: #999999 !important;
    font-weight: 500;
}
#comfyPage .combo-current-value {
    padding: 6px 8px;
    background: var(--theme-input-bg, rgba(38, 38, 51, 0.9));
    border: 1px solid var(--theme-secondary, #3c3c3c);
    border-radius: 3px;
    color: var(--theme-text, #ffffff);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
#comfyPage .combo-current-value:hover {
    border-color: var(--theme-primary);
    background: var(--theme-input-hover-bg, rgba(43, 43, 58, 0.95));
}
#comfyPage .combo-arrow {
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-color: var(--theme-text) transparent transparent transparent;
    margin-left: 4px;
    transition: transform 0.2s;
}
.combo-widget.open #comfyPage .combo-arrow {
    transform: rotate(180deg);
}
#comfyPage .combo-widget .widget-label {
    text-align: center;
    width: 100%;
    margin: 0;
    margin-bottom: 1px;
    padding: 1px 0;
    color: #bebebf;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
#comfyPage .combo-widget .widget-label:hover {
    color: var(--theme-secondary);
}
.combo-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: block;
}
#comfyPage .combo-selected {
    width: 100%;
    padding : 2px 8px;
    height: 28px;
    min-height: unset;
    line-height: 24px;
    background: #2d3032;
    border: 1px solid #555555;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-family: monospace;
    box-shadow : 0 0 4px var(--theme-glow);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}
#comfyPage .combo-selected:hover {
    background: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3);
}
.combo-dropdown {
    position: fixed;
    top: auto;
    left: auto;
    width: 210px;
    height: 280px;
    background: #212324;
    border: 1px solid #999999;
    border-radius: 4px;
    margin-top: 2px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow : 0 0 8px var(--theme-glow), 0 5px 15px rgba(0, 0, 0, 0.7);
    pointer-events: auto !important;
}
.combo-list-container {
    flex: 1;
    height: calc(100% - 32px);
    background :rgba(33,35,36,0.8) !important;
    position: relative;
    overflow: hidden !important;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}
.combo-options-container {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
.combo-options-container::-webkit-scrollbar {
    width: 6px;
}
.combo-options-container::-webkit-scrollbar-track {
    background: #1e1e1e !important;
}
.combo-options-container::-webkit-scrollbar-thumb {
    background: #3c3c3c !important;
    border-radius: 4px;
}
.combo-options-container::-webkit-scrollbar-thumb:hover {
    background: #4c4c4c !important;
}
.combo-option {
    padding : 8px 10px;
    color: #ffffff !important;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    line-height : 1.4;
    font-size: 12px;
    font-family: monospace;
    background : transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    position: relative;
    z-index: 1000000;
    pointer-events: auto !important;
}
.combo-search,
.combo-search-input {
    width: 100%;
    height: 30px;
    padding: 4px 8px;
    margin: 0 !important;
    background: #1a1a2e !important;
    border: none;
    border-bottom: 1px solid #333 !important;
    color: #ffffff !important;
    font-size: 14px;
    outline: none;
    box-sizing: border-box !important;
}

.combo-search-container {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}
/* 全局 .hidden 规则（combo-dropdown 移到 document.body 后仍需要匹配） */
.hidden {
    display: none;
}

.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    z-index: -1 !important;
}
#comfyPage .checkbox-widget .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
#comfyPage .checkbox-widget input[type="checkbox"] {
    width: 18px;
    height: 18px;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid var(--neon-blue);
    border-radius: 3px;
    cursor: pointer;
    -webkit-appearance: none;
}
#comfyPage .checkbox-widget input[type="checkbox"]:checked {
    background: var(--neon-blue);
}
#comfyPage .widget-group {
    width: var(--container-width);
    margin: var(--widget-margin) auto;  
    padding: var(--container-padding);
    background: rgba(157, 78, 221, 0.1);
    border: 1px solid var(--neon-purple);
    border-radius: 8px;
}
#comfyPage .widget-group-title {
    margin: calc(-1 * var(--container-padding));  
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(157, 78, 221, 0.2);
    color: var(--neon-purple);
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid var(--neon-purple);
}
#comfyPage .generate-button {
    width: var(--container-width);
    margin: var(--widget-margin) auto;
    padding: 10px;
    text-align: center;
}
#comfyPage .number-input-container:has(.seed-btn) .number-input {
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
}
:root {
    --container-width: 290px;
    --container-padding: 8px;
    --widget-margin: 4px;
    --widget-bg: rgba(26, 26, 46, 0.8);
    --spectrum-global-color-gray-50: #fff;
    --spectrum-global-color-gray-75: #fafafa;
    --spectrum-global-color-gray-100: #f5f5f5;
    --spectrum-global-color-gray-200: #eaeaea;
    --spectrum-global-color-gray-300: #e1e1e1;
    --spectrum-global-color-gray-400: #cacaca;
    --spectrum-global-color-gray-500: #b3b3b3;
    --spectrum-global-color-gray-600: #8e8e8e;
    --spectrum-global-color-gray-700: #6e6e6e;
    --spectrum-global-color-gray-800: #4b4b4b;
    --spectrum-global-color-gray-900: #2c2c2c;
    --spectrum-global-color-blue-400: #2680eb;
    --spectrum-global-color-blue-500: #1473e6;
    --spectrum-global-color-blue-600: #0d66d0;
    --spectrum-global-color-blue-700: #095aba;
    --spectrum-global-color-green-400: #2d9d78;
    --spectrum-global-color-green-500: #268e6c;
    --spectrum-global-color-green-600: #12805c;
}
#comfyPage .number-input:not([type="hidden"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#comfyPage .number-display {
    width: auto;
    min-width: 60px;
    flex: 1;
    margin-right: auto;  
    max-width: 100%;
    height: 28px;
    padding: 0 8px;
    background-color: var(--spectrum-global-color-gray-800);
    border: 1px solid var(--spectrum-global-color-gray-700);
    border-radius: 4px;
    color: var(--spectrum-global-color-gray-50);
    font-size: 13px;
    font-family: monospace;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}
#comfyPage .number-display:hover {
    background-color: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
    box-shadow: 0 0 0 1px #c5ef52;
}
#comfyPage .number-display::after {
    content: "\u270e";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}
#comfyPage .number-display:hover::after {
    opacity: 0.7;
}
#comfyPage .number-edit-input {
    width: 70px;
    height: 28px;
    padding: 0 6px;  
    background-color: var(--spectrum-global-color-gray-800);
    border: 1px solid var(--spectrum-global-color-blue-500);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-family: monospace;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    display: block;
    margin: 0;
    position: relative;
    z-index: 10;
    box-shadow: none;
}
#comfyPage .number-edit-input:focus {
    border: 1px solid var(--spectrum-global-color-blue-600);
    box-shadow: 0 0 0 1px var(--spectrum-global-color-blue-500);
    outline: none;
}
#comfyPage .number-btn,
#comfyPage .seed-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: var(--spectrum-global-color-gray-800);
    border: 1px solid var(--spectrum-global-color-gray-700);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
#comfyPage .btn-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--spectrum-global-color-gray-50);
    user-select: none;
}
#comfyPage .number-btn:hover,
#comfyPage .seed-btn:hover {
    background-color: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
}
.seed-btn.active {
    background-color: var(--spectrum-global-color-blue-600);
    border-color: var(--spectrum-global-color-blue-700);
}
.seed-btn.active #comfyPage .btn-content {
    color: #fff;
}
#comfyPage .number-btn:hover .btn-content,
#comfyPage .seed-btn:hover .btn-content {
    color: #3d4246;
}
#comfyPage .workflow-vertical-layout {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
#comfyPage .pure-text-input {
    width: 100%;
    height: 40px; 
    border: none;
    outline: none;
    background: rgba(38, 38, 51, 0.9);
    color: white;
    font-size: 16px; 
    font-family: monospace;
    text-align: center;
    padding: 8px 12px; 
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    border-radius: 4px;
    position: relative;
    z-index: 100;
    display: block;
    line-height: 24px; 
}
#comfyPage .pure-text-input:focus {
    border: 1px solid #c5ef52;
    box-shadow: 0 0 3px rgba(197, 239, 82, 0.4);
    background: var(--theme-input-focus-bg, rgba(43, 43, 58, 1));
}
sp-textfield.spectrum-number-edit {
    width: 100% !important;
    height: 32px !important;
    --spectrum-textfield-textcolor: #ffffff !important;
    --spectrum-textfield-background-color: rgba(45, 48, 50, 0.95) !important;
    --spectrum-textfield-border-color: #555555 !important;
    --spectrum-textfield-border-color-hover: #c5ef52 !important;
    --spectrum-textfield-border-color-focus: #c5ef52 !important;
    --spectrum-textfield-background-color-focus: rgba(50, 53, 55, 0.98) !important;
    border-radius: 4px !important;
    font-family: monospace !important;
    font-size: 14px !important;
    text-align: center !important;
    --spectrum-textfield-border-width: 1px !important;
    --spectrum-textfield-padding-x: 8px !important;
}
sp-textfield.spectrum-number-edit[quiet] {
    --spectrum-textfield-background-color: transparent !important;
    --spectrum-textfield-background-color-focus: rgba(45, 48, 50, 0.8) !important;
    --spectrum-textfield-border-color: rgba(85, 85, 85, 0.8) !important;
}
sp-textfield.spectrum-number-edit::part(textfield) {
    text-align: center !important;
    font-family: monospace !important;
    color: #ffffff !important;
}
sp-textfield.spectrum-number-edit:focus-within {
    box-shadow: 0 0 5px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .number-widget .input-group:has(.pure-text-input) {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0;
}
#comfyPage .text-input-widget {
    height: auto;
    min-height: 48px;
    margin-bottom: 5px;
    background: #27292b;
    border: 1px solid #414344;
    border-radius: 4px;
    padding: 4px 10px 0px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px var(--theme-glow);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    box-sizing: border-box;
    z-index: 1;
    align-items: center;
}
#comfyPage .text-input-widget .widget-label {
    text-align: center;
    width: 100%;
    margin: 0;
    margin-bottom: 3px;
    padding: 1px 0;
    color: #bebebf;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
#comfyPage .text-input-widget:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .text-input-widget .widget-label:hover {
    color: var(--theme-secondary);
}
#comfyPage .text-input-widget .input-container {
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
#comfyPage .text-input-widget .text-display,
#comfyPage .text-input-widget .text-input {
    width: 100% !important;
    padding: 4px 8px;
    margin: 0;
    box-sizing: border-box;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: hidden;
    line-height: 1.4;
    position: static;
    font-size: 14px;
    font-family: inherit;
}
#comfyPage .text-input-widget .text-display {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    overflow-y: hidden;
    text-overflow: ellipsis;
    background: var(--theme-input-bg, rgba(38, 38, 51, 0.9));
    border: 1px solid var(--theme-secondary, #3c3c3c);
    color: var(--theme-text, #ffffff);
    cursor: pointer;
}
#comfyPage .text-input-widget .text-input {
    min-height: 150px;
    height: 150px;
    overflow-y: auto;
    background: var(--theme-input-bg, rgba(38, 38, 51, 0.9));
    border: 1px solid var(--theme-secondary, #3c3c3c);
    color: var(--theme-text, #ffffff);
    resize: vertical;
}
#comfyPage .text-input-widget .text-input:focus {
    outline: none;
    border-color: #c5ef52;
    background: var(--theme-input-focus-bg, rgba(43, 43, 58, 0.95));
    box-shadow: 0 0 5px rgba(197, 239, 82, 0.3);
}
#comfyPage .text-input-widget .hidden {
    display: none !important;
    position: absolute;
    visibility: hidden;
}
#comfyPage .text-input-widget .text-input::-webkit-scrollbar,
#comfyPage .text-input-widget .text-display::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}
#comfyPage .text-input-widget .text-input::-webkit-scrollbar-thumb,
#comfyPage .text-input-widget .text-display::-webkit-scrollbar-thumb {
    background: var(--theme-primary, rgba(5, 217, 232, 0.7));
    border-radius: 4px;
}
#comfyPage .text-input-widget .text-input::-webkit-scrollbar-thumb:hover,
#comfyPage .text-input-widget .text-display::-webkit-scrollbar-thumb:hover {
    background: var(--theme-secondary, rgba(255, 42, 109, 0.7));
}
#comfyPage .number-widget {
    height: auto;
    min-height: 48px;
    margin-bottom: 5px;
    background: #27292b;
    border : 1px solid #414344;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px var(--theme-glow);
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    box-sizing: border-box;
}
#comfyPage .number-widget:hover {
    border-color: #c5ef52 !important;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.3) !important;
}
#comfyPage .number-widget .widget-label {
    text-align: center;
    width: 100%;
    margin: 0;
    margin-bottom: 1px;
    padding: 1px 0;
    color: #bebebf;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
#comfyPage .number-widget .widget-label:hover {
    color: var(--theme-secondary);
}
#comfyPage .number-display {
    color: var(--theme-text, #ffffff);
    background: var(--theme-input-bg, rgba(38, 38, 51, 0.9));
    border: 1px solid var(--theme-secondary, #3c3c3c);
    border-radius: 3px;
    transition: background-color 0.2s, border-color 0.2s;
}
#comfyPage .number-display:hover {
    background-color: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
    box-shadow: 0 0 0 1px #c5ef52;
}
#comfyPage .number-btn, #comfyPage .seed-btn {
    background-color: var(--theme-button-bg, var(--spectrum-global-color-gray-800));
    border: 1px solid var(--theme-button-border, var(--spectrum-global-color-gray-700));
    color: var(--theme-button-text, var(--spectrum-global-color-gray-50));
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
#comfyPage .number-btn:hover, #comfyPage .seed-btn:hover {
    background-color: #c5ef52;
    border-color: #c5ef52;
    color: #3d4246;
}
.seed-btn.active {
    background-color: var(--theme-active-button-bg, var(--spectrum-global-color-blue-600));
    border-color: var(--theme-active-button-border, var(--spectrum-global-color-blue-700));
}
.seed-btn.active #comfyPage .btn-content {
    color: var(--theme-active-button-text, #fff);
}
#comfyPage .number-btn:hover .btn-content,
#comfyPage .seed-btn:hover .btn-content {
    color: #3d4246;
}
#comfyPage .number-widget .input-group .number-display {
    width: 100%;
    min-width: 60px;
    height: 26px;
    line-height: 26px;
    padding: 0 8px;
    margin-right: 5px;
    color: var(--theme-text, #ffffff);
    background: #2d3032;
    border: 1px solid #555555;
    border-radius: 3px;
    text-align: center;
    font-family: monospace;
    transition: all 0.2s ease;
}
#comfyPage .number-widget .input-group .number-display:hover {
    border-color: #c5ef52;
    background: #c5ef52;
    color: #3d4246;
}
#comfyPage .number-widget .input-group .pure-text-input {
    width: 100%;
    height: 32px;
    line-height: 32px;
    padding: 0 8px;
    margin-right: 5px;
    background: var(--theme-input-bg, rgba(38, 38, 51, 0.95));
    color: var(--theme-text, white);
    border: 1px solid var(--theme-primary, var(--neon-blue));
    border-radius: 3px;
    text-align: center;
    font-family: monospace;
    font-size: 14px;
    box-shadow: 0 0 5px var(--theme-glow, rgba(5, 217, 232, 0.2));
}
#comfyPage .number-widget .input-group .pure-text-input:focus {
    outline: none;
    border-color: #c5ef52;
    box-shadow: 0 0 8px rgba(197, 239, 82, 0.4);
    background: #2d3032;
}
#comfyPage .number-widget .input-group {
    display: flex;
    justify-content: space-between;
    padding: 0;
    gap: 5px;
}
#comfyPage .number-widget .number-btn,
#comfyPage .number-widget .seed-btn {
    flex: 0 0 28px;
    height: 26px;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#comfyPage .cyber-input-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}
.widget-container.cyber-widget,
.combo-widget {
    box-sizing: border-box;
}
#comfyPage .widget-container .widget-label,
#comfyPage .combo-widget .widget-label {
    margin-bottom: 1px;
}
#comfyPage .number-widget .input-group,
#comfyPage .combo-widget .combo-selected {
    box-sizing: border-box;
}
#comfyPage .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--theme-text, #ffffff);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    user-select: none;
    z-index: 5;
}
#comfyPage .progress-container {
    display: block !important;
    width: 100% !important;
    height: 40px !important;
    margin: 0 !important; 
    position: relative !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    border-radius: 10px;
    background-color: rgba(8, 12, 20, 0.92);
    border: 1px solid rgba(71, 85, 105, 0.5);
    overflow: visible;
}
#comfyPage .progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 50%;
    background-color: #4CAF50; 
    border-radius: 2px 2px 0 0;
    transition: width 0.3s ease-in-out, background-color 0.3s;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); 
    z-index: 1;
}
#comfyPage .step-progress-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 50%;
    background-color: #388E3C; 
    border-radius: 0 0 2px 2px;
    transition: width 0.3s ease-in-out;
    box-shadow: 0 0 3px rgba(56, 142, 60, 0.5); 
    z-index: 2;
}
#comfyPage .node-progress-text {
    position: absolute !important;
    top: -21px !important;
    left: 0 !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    color: #4CAF50 !important;
    opacity: 1;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: initial !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8) !important;
    z-index: 999 !important;
    visibility: visible;
    pointer-events: none !important;
    background: none !important;
}
.progress-container.error #comfyPage .progress-bar,
.progress-container.error #comfyPage .step-progress-bar {
    background-color: var(--theme-error, #ff0000);
    box-shadow: 0 0 5px var(--theme-error-glow, rgba(255, 0, 0, 0.5));
}
.node-progress-text.error {
    color: var(--theme-error, #ff0000) !important;
    font-weight: bold;
}
/* workflow-title 样式已移�?styles.css */
#comfyPage .task-count-input {
    width: 50px;
    height: 28px;
    padding: 0 5px;
    margin-left: 5px;
    background: rgba(45, 48, 50, 0.8);
    border: 1px solid #05d9e8;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    outline: none;
}
#comfyPage .task-count-input:focus {
    border-color: #c5ef52;
    box-shadow: 0 0 5px rgba(197, 239, 82, 0.5);
}
#comfyPage .task-count-input::-webkit-inner-spin-button,
#comfyPage .task-count-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#comfyPage .task-count-input {
    -moz-appearance: textfield;
}
/* ComfyUI 底部控制条的最终布局由 wk-comfyui-layout-reset.css 接管 */

sp-textarea {
    width: 100% !important;
    height: 70px !important; 
    min-height: 70px !important;
    max-height: 70px !important;
    border-radius: 4px;
    font-family: monospace;
    overflow-y: hidden !important; 
    overflow-x: hidden !important; 
    resize: none !important; 
    --spectrum-textfield-textcolor: var(--theme-text, #ffffff);
    --spectrum-textfield-background-color: var(--theme-input-bg, rgba(38, 38, 51, 0.9));
    --spectrum-textfield-border-color: var(--theme-secondary, #3c3c3c);
    --spectrum-textfield-border-color-hover: #c5ef52;
    --spectrum-textfield-border-color-focus: #c5ef52;
    --spectrum-textfield-background-color-focus: var(--theme-input-focus-bg, rgba(43, 43, 58, 0.95));
    display: block !important; 
    box-sizing: border-box !important;
}
#comfyPage .text-input-widget {
    min-height: 107px !important; 
    max-height: 107px !important;
    height: 107px !important;
    padding: 4px 10px 0px 10px !important;
    box-sizing: border-box !important;
}
sp-textarea::-webkit-scrollbar {
    width: 0px !important;
    background: transparent !important;
    display: none !important;
}
sp-textarea::-webkit-scrollbar-thumb {
    background: transparent !important;
    display: none !important;
}
sp-textarea::-webkit-scrollbar-thumb:hover {
    background: transparent !important;
    display: none !important;
}
sp-textarea::part(textfield) {
    overflow: auto !important;
    height: 70px !important;
}
#comfyPage .node-group {
    margin-bottom: 10px; 
}
#comfyPage .node-group .widget-container,
#comfyPage .node-group .cyber-widget,
#comfyPage .node-group .combo-widget,
#comfyPage .node-group .image-upload-widget {
    margin-bottom: 5px; 
}
body:has(.combo-dropdown) .text-input-widget {
    z-index: 1; 
}
