        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }
        
        /* 主容器 */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.2s ease;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
        
        .btn-secondary {
            background: #f0f2f5;
            color: #333;
        }
        
        .btn-secondary:hover {
            background: #e4e6eb;
        }
        
        .btn-small {
            padding: 4px 8px;
            font-size: 0.8rem;
        }
        
        /* 内容区域 */
        .content {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }
        
        /* 面板样式 */
        .panel {
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 20px;
        }
        
        .panel-title {
            font-size: 1.2rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        
        /* 配置标签 */
        .config-label {
            display: block;
            font-weight: 500;
            margin-bottom: 8px;
            color: #666;
        }
        
        /* 配置输入 */
        .config-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 0.9rem;
        }
        
        /* 配置区域 */
        .config-section {
            margin-bottom: 20px;
        }
        
        /* 模板选择 */
        .template-section {
            margin-bottom: 20px;
        }
        
        /* 图片选择 */
        .image-section {
            margin-bottom: 20px;
        }
        
        /* 图片网格 */
        .image-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
            gap: 10px;
            max-height: 300px;
            overflow-y: auto;
            padding: 10px;
            background: #fafafa;
            border-radius: 5px;
            border: 1px solid #eee;
        }
        
        /* 图片项 */
        .image-item {
            width: 100%;
            aspect-ratio: 1 / 1;
            border: 2px solid #eee;
            border-radius: 5px;
            overflow: hidden;
            cursor: pointer;
            position: relative;
            transition: all 0.2s ease;
        }
        
        .image-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .image-item.selected {
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
        }
        
        .image-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .image-item .checkmark {
            position: absolute;
            top: 5px;
            right: 5px;
            width: 20px;
            height: 20px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 12px;
            font-weight: bold;
            display: none;
        }
        
        .image-item.selected .checkmark {
            display: flex;
        }
        
        /* 处理方式选择 */
        .processing-method-section {
            margin-bottom: 20px;
        }
        
        .method-option {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .method-option:hover {
            background-color: #f5f5f5;
        }
        
        .method-option.selected {
            border-color: #667eea;
            background-color: rgba(102, 126, 234, 0.1);
        }
        
        .method-option input[type="radio"] {
            width: 16px;
            height: 16px;
        }
        
        .method-option label {
            flex: 1;
            cursor: pointer;
        }
        
        /* 背景设置 */
        .background-section {
            margin-bottom: 20px;
        }
        
        /* 颜色选择器 */
        .color-picker {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .color-picker input[type="color"] {
            width: 50px;
            height: 40px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        
        /* 背景图网格 */
        .background-image-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
            gap: 10px;
            max-height: 200px;
            overflow-y: auto;
            padding: 10px;
            background: #fafafa;
            border-radius: 5px;
            border: 1px solid #eee;
        }
        
        /* 背景图项 */
        .background-item {
            width: 100%;
            aspect-ratio: 1 / 1;
            border: 2px solid #eee;
            border-radius: 5px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .background-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .background-item.selected {
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
        }
        
        .background-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 进度条 */
        .progress-container {
            margin: 20px 0;
        }
        
        .progress-bar {
            width: 100%;
            height: 8px;
            background: #f0f2f5;
            border-radius: 4px;
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 4px;
            transition: width 0.3s ease;
        }
        
        /* 状态区域 */
        .status-section {
            margin: 20px 0;
            padding: 15px;
            background: #f8f9ff;
            border-radius: 5px;
            border-left: 4px solid #667eea;
        }
        
        .status-item {
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
        }
        
        .status-label {
            font-weight: 500;
            color: #666;
        }
        
        .status-value {
            color: #333;
        }
        
        /* 处理结果 */
        .results-section {
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 20px;
        }
        
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        
        #results-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }
        
        /* 结果项 */
        .result-item {
            background: #fafafa;
            border: 1px solid #eee;
            border-radius: 8px;
            overflow: hidden;
            transition: all 0.2s ease;
        }
        
        .result-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        }
        
        .result-item img {
            width: 100%;
            aspect-ratio: 9 / 16;
            object-fit: contain;
            background: white;
        }
        
        .result-info {
            padding: 10px;
        }
        
        .result-name {
            font-weight: 500;
            margin-bottom: 5px;
            font-size: 0.9rem;
        }
        
        .result-meta {
            font-size: 0.8rem;
            color: #666;
        }
        
        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 40px;
            color: #999;
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 15px;
        }
        
        /* 预览模态框 */
        .preview-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        
        .preview-content {
            background: white;
            padding: 20px;
            border-radius: 10px;
            max-width: 80%;
            max-height: 80%;
            position: relative;
        }
        
        .close-preview {
            position: absolute;
            top: 10px;
            right: 10px;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
        }
        
        .close-preview:hover {
            color: #333;
        }
        
        .preview-content img {
            max-width: 100%;
            max-height: 70vh;
            object-fit: contain;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .content {
                grid-template-columns: 1fr;
            }
            
            #results-container {
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            }
        }

/* Desktop workbench: presentation changes only; processing parameters stay unchanged. */
.processing-workbench { min-width: 1000px; padding-bottom: 92px; }
.processing-workbench .container { padding: 0; }
.processing-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 26px 0 22px; }
.processing-heading h1 { font-size: 26px; margin-bottom: 5px; }
.processing-heading p { font-size: 13px; color: var(--muted); }
.processing-workbench .content { align-items: start; gap: 20px; margin-bottom: 20px; }
.processing-workbench .panel, .processing-workbench .results-section { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 20px; min-width: 0; }
.processing-workbench .panel-title { font-size: 16px; font-weight: 650; border-color: var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.processing-workbench .config-label { font-size: 12px; color: #62697a; margin-bottom: 7px; }
.processing-workbench .config-input, .processing-workbench .template-select { height: 35px; padding: 6px 10px; font-size: 13px; }
.processing-workbench .template-select { margin: 0; }
.processing-workbench .image-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); min-height: 170px; padding: 10px; border-color: var(--line); background: #fafbfc; border-radius: 7px; }
.processing-workbench .image-item { border-radius: 6px; background: #fff; border-color: var(--line); align-self: start; }
.processing-workbench .image-item:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.processing-workbench .image-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.processing-workbench .image-item img { object-fit: contain; background: #f7f8fa; }
.processing-workbench input[type=checkbox], .processing-workbench input[type=radio] { accent-color: var(--accent); }
.processing-workbench .progress-fill { background: var(--accent); }
.processing-workbench .processing-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.processing-workbench #start-process-btn { min-width: 140px; min-height: 40px; }
.processing-workbench .results-header { align-items: center; gap: 12px; }
.processing-workbench .results-header .panel-title { border: 0; padding: 0; margin: 0; }
.processing-workbench .result-item { box-shadow: none; border: 1px solid var(--line); border-radius: 8px; }
.processing-workbench .result-item:hover { transform: none; box-shadow: none; }
.processing-workbench .processing-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 150px; text-align: center; padding: 24px !important; color: var(--muted); font-size: 12px; }
.processing-workbench .processing-empty strong, .processing-workbench .empty-state strong { font-size: 14px; font-weight: 500; color: #535969; }
.processing-workbench .processing-empty p, .processing-workbench .empty-state p { font-size: 12px; margin: 6px 0; }
.processing-workbench .empty-state { grid-column: 1 / -1; width: 100%; padding: 30px 20px; color: var(--muted); }
.processing-workbench .empty-icon { display: none; }
.processing-workbench #clear-results-btn { color: #ab474d; }

.size-workbench .method-option { margin-bottom: 7px; padding: 8px 10px; font-size: 13px; border-color: var(--line); }
.size-workbench .method-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.size-workbench .background-section { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #eef0f4; }
.size-workbench .background-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.size-workbench .color-picker { gap: 8px; font-size: 12px; }
.size-workbench .color-picker input[type=color] { width: 40px; height: 30px; padding: 2px; }
.size-workbench #preview-btn { width: 100%; }

/* Source media stays left; output parameters stay in the shared right column. */
.size-workbench .wb-assets > #background-image-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0; }
.size-workbench .wb-assets .image-section { margin: 0; }
.size-workbench .preview-assets-panel .background-section { border: 0; margin: 0; padding: 0; }
.size-workbench .preview-assets-panel #preview-btn { width: auto; min-width: 120px; }
.size-workbench .preview-action { text-align: left; }
.size-workbench .wb-settings .config-section { margin-bottom: 20px; }
.size-workbench .wb-settings .config-label { display: block; }
.size-workbench .wb-settings .processing-method-section { margin-bottom: 20px; }

.processing-workbench .wb-settings .output-dimensions { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; }
.processing-workbench .wb-settings .output-dimensions > input { width: 100%; min-width: 0; }
.processing-workbench .wb-settings .output-dimensions > div { grid-column: 1 / -1; }
