
#creative-workshop-view {
    height: 100%;
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.workshop-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}



.workshop-card {
    width: 100%;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    flex-shrink: 0;
}


.topic-input {
    width: 100%;
    min-height: 0;
    height: 80px;
    padding: 12px 16px;
    font-size: 17px;
    line-height: 1.4;
    border: none;
    border-radius: 12px 12px 0 0;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
}


.topic-input:focus {
    outline: none;
}


.topic-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}



#creative-workshop-view .bottom-progress {
    position: relative;
    margin-top: -1px;
    width: 100%;
    animation: slideUp 0.3s ease;
    transition: opacity 0.5s ease;
}


#creative-workshop-view .bottom-progress.fade-out {
    opacity: 0;
}


@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


#creative-workshop-view .progress-track {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    width: 100%;
}


#creative-workshop-view .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    border-radius: 2px;
    position: relative;
}


#creative-workshop-view .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}


@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}


#log-progress-btn .btn-icon.rotating {
    animation: rotate 2s linear infinite;
}


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



.workshop-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "reference publish"
        "reference logs";
    gap: 20px;
    width: 100%;
    align-items: stretch;
    min-height: 0;
}


.workshop-block {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}


#reference-mode-panel.workshop-block {
    grid-area: reference;
}


#publish-settings-panel.workshop-block {
    grid-area: publish;
}



.workshop-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
}


.workshop-tab {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}


.workshop-tab:hover {
    background: var(--hover-background);
    color: var(--text-primary);
}


.workshop-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}


.workshop-tab .tab-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    font-weight: 700;
}


.workshop-tab:not(.active) .tab-index {
    background: var(--border-color);
    color: var(--text-secondary);
}


.workshop-tab .tab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--error-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.workshop-tab-panel {
    display: none;
    width: 100%;
}


.workshop-tab-panel.active {
    display: block;
}


.auto-recommend-hint {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}



.agent-picker {
    position: relative;
}


#creative-workshop-view .agent-picker-trigger {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}


#creative-workshop-view .agent-picker-trigger:hover {
    border-color: var(--primary-color);
}


#creative-workshop-view .agent-picker-trigger:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


.agent-picker-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}


.agent-picker-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.agent-picker-caret {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}


.agent-picker-dropdown {
    position: fixed;
    max-height: min(360px, 50vh);
    overflow-y: auto;
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    padding: 6px;
    z-index: 1000;
    opacity: 1;
}


.agent-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}


.agent-option:hover {
    background: var(--hover-background);
}


.agent-option.selected {
    background: rgba(37, 99, 235, 0.1);
}


.agent-option-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}


.agent-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}


.agent-option-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}


.agent-option-role {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.task-view-btn {
    border: none;
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}


.task-view-btn:hover {
    background: var(--primary-hover);
}



#creative-workshop-view .toolbar-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


#creative-workshop-view .toolbar-btn.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}



.workshop-card {
    border-left: 4px solid var(--primary-color);
}


#reference-mode-panel.workshop-block {
    border-left: 4px solid #60a5fa;
}


#reference-mode-panel .block-header {
    background: rgba(96, 165, 250, 0.08);
}


#publish-settings-panel.workshop-block {
    border-left: 4px solid #a78bfa;
}


#publish-settings-panel .block-header {
    background: rgba(167, 139, 250, 0.08);
}


.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    min-height: 48px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
}


.block-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}


.block-icon {
    width: 18px;
    height: 18px;
    stroke: var(--primary-color);
    flex-shrink: 0;
}


#reference-mode-panel .block-icon {
    stroke: #3b82f6;
}


#publish-settings-panel .block-icon {
    stroke: #8b5cf6;
}


.block-content {
    padding: 18px 16px;
}



#creative-workshop-view .form-group {
    margin-bottom: 16px;
}


#creative-workshop-view .form-group:last-child {
    margin-bottom: 0;
}


#creative-workshop-view .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}


#creative-workshop-view .label-hint {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 400;
}


#creative-workshop-view .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}


#creative-workshop-view .form-row:last-child {
    margin-bottom: 0;
}


#creative-workshop-view .form-row.agent-config-row {
    grid-template-columns: 1.5fr 1fr;
    align-items: stretch;
    gap: 16px;
}


#creative-workshop-view .form-row.agent-config-row .form-group {
    margin-bottom: 0;
}


#creative-workshop-view .agent-select-group {
    display: flex;
    flex-direction: column;
}


#creative-workshop-view .agent-select-group .form-select {
    flex: 1;
    min-height: 36px;
}


#creative-workshop-view .humanize-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 14px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    gap: 6px;
}


#creative-workshop-view .humanize-card > label:first-child {
    margin-bottom: 0;
}


#creative-workshop-view .form-select,
#creative-workshop-view .form-textarea,
#creative-workshop-view .form-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-background);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}


#creative-workshop-view .form-textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 50px;
}


#creative-workshop-view .form-select:focus,
#creative-workshop-view .form-textarea:focus,
#creative-workshop-view .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


#creative-workshop-view .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}


#creative-workshop-view .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}


#creative-workshop-view .checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}



.cw-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}


.cw-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}


.cw-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 24px;
    transition: 0.25s;
}


.cw-toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


.cw-toggle-switch input:checked + .cw-toggle-slider {
    background-color: var(--primary-color);
}


.cw-toggle-switch input:checked + .cw-toggle-slider::before {
    transform: translateX(20px);
}


.cw-toggle-switch input:focus + .cw-toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}



#creative-workshop-view .workshop-action-bar {
    position: relative;
    width: 100%;
    padding: 14px 24px;
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    z-index: 10;
    flex-shrink: 0;
    box-sizing: border-box;
}


#creative-workshop-view .action-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}


#creative-workshop-view .goto-publish-btn {
    height: 40px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}


#creative-workshop-view .goto-publish-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.06);
}


#creative-workshop-view .goto-publish-btn .btn-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}


#creative-workshop-view .action-bar-right {
    display: flex;
    align-items: center;
}


#creative-workshop-view .toolbar-btn {
    height: 36px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}


#creative-workshop-view .toolbar-btn:hover {
    background: var(--hover-background);
    border-color: var(--primary-color);
}


#creative-workshop-view .toolbar-btn .btn-icon {
    width: 16px;
    height: 16px;
}


#creative-workshop-view .generate-btn {
    height: 40px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}


#creative-workshop-view .generate-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}


#creative-workshop-view .generate-btn:active {
    transform: translateY(0);
}


#creative-workshop-view .generate-btn .btn-icon {
    width: 18px;
    height: 18px;
    stroke: white;
}


#creative-workshop-view .btn-stop {
    height: 40px;
    padding: 0 24px;
    background: var(--error-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}


#creative-workshop-view .btn-stop:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}


#creative-workshop-view .btn-stop .btn-icon {
    fill: white;
    stroke: none;
    width: 18px;
    height: 18px;
}


#creative-workshop-view .btn-stop .btn-icon rect {
    fill: white;
    stroke: none;
}



#creative-workshop-view .btn-icon,
#creative-workshop-view .panel-icon,
#creative-workshop-view .btn-icon-small {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


#creative-workshop-view .btn-icon-small {
    width: 14px;
    height: 14px;
}


#creative-workshop-view .panel-header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}


#creative-workshop-view .icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}


#creative-workshop-view .icon-btn:hover {
    background: var(--hover-background);
    border-color: var(--border-color);
    color: var(--text-primary);
}


#creative-workshop-view .icon-btn .btn-icon-small {
    width: 16px;
    height: 16px;
}



#creative-workshop-view .upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface-color);
    margin-bottom: 12px;
}


#creative-workshop-view .upload-dropzone:hover,
#creative-workshop-view .upload-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}


#creative-workshop-view .upload-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}


#creative-workshop-view .upload-icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}


#creative-workshop-view .upload-dropzone p {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
}


#creative-workshop-view .uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


#creative-workshop-view .uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-background);
}


#creative-workshop-view .uploaded-file-item .file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}


#creative-workshop-view .uploaded-file-item .file-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


#creative-workshop-view .uploaded-file-item .file-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}


#creative-workshop-view .file-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}


#creative-workshop-view .file-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}


.hidden {
    display: none !important;
}



@media (max-width: 1024px) {
    #creative-workshop-view .workshop-container {
        padding: 16px 16px;
    }

    #creative-workshop-view .workshop-blocks {
        grid-template-columns: 1fr;
    }

    #creative-workshop-view .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #creative-workshop-view .form-row.agent-config-row {
        grid-template-columns: 1fr 1fr;
    }

    #creative-workshop-view .workshop-blocks {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "reference"
            "publish"
            "logs";
    }

    #reference-mode-panel.workshop-block {
        grid-row: auto;
    }
}


@media (max-width: 768px) {
    #creative-workshop-view .workshop-container {
        padding: 12px 16px;
    }

    #creative-workshop-view .topic-input {
        height: 72px;
        padding: 12px 16px;
        font-size: 16px;
    }

    #creative-workshop-view .form-row,
    #creative-workshop-view .form-row.agent-config-row {
        grid-template-columns: 1fr;
    }

    #creative-workshop-view .workshop-action-bar {
        padding: 10px 16px;
        border-radius: 0;
    }

    #creative-workshop-view .generate-btn,
    #creative-workshop-view .btn-stop {
        width: 100%;
        justify-content: center;
    }

    #creative-workshop-view .action-bar-left {
        display: none;
    }

    #creative-workshop-view .action-bar-right {
        width: 100%;
    }
}


@media (max-width: 480px) {
    #creative-workshop-view .workshop-container {
        padding: 8px 12px;
    }

    #creative-workshop-view .topic-input {
        height: 68px;
        padding: 10px 12px;
        font-size: 15px;
    }

    #creative-workshop-view .workshop-block {
        border-radius: 10px;
    }

    #creative-workshop-view .block-content {
        padding: 12px;
    }
}



[data-theme="dark"] #creative-workshop-view .generate-btn {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}


[data-theme="dark"] #creative-workshop-view .generate-btn:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}


[data-theme="dark"] .cw-toggle-slider {
    background-color: var(--text-tertiary);
}


[data-theme="dark"] .cw-toggle-slider::before {
    background-color: var(--card-background);
}



[data-theme="dark"] #reference-mode-panel .block-header {
    background: rgba(96, 165, 250, 0.12);
}


[data-theme="dark"] #publish-settings-panel .block-header {
    background: rgba(167, 139, 250, 0.12);
}
