        /* 全局样式 */
        * {
            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.3rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        
        /* 模板选择 */
        .template-section {
            margin-bottom: 20px;
        }
        
        .template-select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
            margin-bottom: 10px;
        }
        
        /* 图片选择 */
        .image-section {
            margin-bottom: 20px;
        }
        
        .image-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 10px;
            margin-top: 10px;
            max-height: 300px;
            overflow-y: auto;
            padding: 10px;
            background: #fafafa;
            border: 1px solid #eee;
            border-radius: 5px;
        }
        
        .image-item {
            position: relative;
            cursor: pointer;
            border-radius: 5px;
            overflow: hidden;
            border: 2px solid transparent;
            transition: all 0.2s ease;
        }
        
        .image-item:hover {
            border-color: #667eea;
        }
        
        .image-item.selected {
            border-color: #667eea;
            background: rgba(102, 126, 234, 0.1);
        }
        
        .image-item img {
            width: 100%;
            height: 100px;
            object-fit: cover;
        }
        
        .image-checkbox {
            position: absolute;
            top: 5px;
            left: 5px;
            z-index: 10;
        }
        
        /* 配置选项 */
        .config-section {
            margin-bottom: 20px;
        }
        
        .config-item {
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
        }
        
        .config-label {
            font-weight: 500;
            margin-bottom: 5px;
            font-size: 0.9rem;
        }
        
        .config-input {
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 0.9rem;
        }
        
        /* 预览区域 */
        .preview-section {
            text-align: center;
        }
        
        .preview-container {
            margin: 20px 0;
            padding: 20px;
            background: #fafafa;
            border: 1px solid #eee;
            border-radius: 5px;
        }
        
        .preview-image {
            max-width: 100%;
            max-height: 400px;
            object-fit: contain;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        /* 处理状态 */
        .status-section {
            margin-top: 20px;
        }
        
        .status-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding: 10px;
            background: #fafafa;
            border-radius: 5px;
        }
        
        .status-label {
            font-weight: 500;
        }
        
        .status-value {
            color: #667eea;
        }
        
        /* 进度条 */
        .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;
        }
        
        /* 处理结果 */
        .results-section {
            margin-top: 30px;
        }
        
        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }
        
        .result-item {
            background: white;
            border: 1px solid #eee;
            border-radius: 10px;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }
        
        .result-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
        }
        
        .result-image-container {
            position: relative;
            width: 100%;
            aspect-ratio: 9 / 16;
            overflow: hidden;
            background: #f8f9fa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .result-image {
            width: 100%;
            height: 100%;
            object-fit: contain;
            transition: transform 0.3s ease;
        }
        
        .result-item:hover .result-image {
            transform: scale(1.05);
        }
        
        .result-info {
            padding: 15px;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }
        
        .result-name {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 8px;
            color: #333;
            word-break: break-all;
        }
        
        .result-meta {
            font-size: 0.85rem;
            color: #666;
            margin-bottom: 12px;
        }
        
        .result-actions {
            display: flex;
            gap: 8px;
            margin-top: auto;
        }
        
        .btn-result {
            flex: 1;
            padding: 6px 10px;
            border: none;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .btn-result-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-result-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
        }
        
        .btn-result-secondary {
            background: #f0f2f5;
            color: #333;
        }
        
        .btn-result-secondary:hover {
            background: #e4e6eb;
        }
        
        /* 图片预览模态框 */
        .preview-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }
        
        .preview-modal.show {
            display: flex;
        }
        
        .preview-content {
            max-width: 90%;
            max-height: 90%;
            position: relative;
        }
        
        .preview-content img {
            max-width: 100%;
            max-height: 90vh;
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }
        
        .close-preview {
            position: absolute;
            top: -30px;
            right: -30px;
            background: white;
            border: none;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            transition: all 0.2s ease;
        }
        
        .close-preview:hover {
            background: #f0f0f0;
            transform: scale(1.1);
        }
        
        /* 加载动画 */
        .loading-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .results-grid {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
                gap: 15px;
            }
            
            .result-actions {
                flex-direction: column;
            }
        }
        
        /* 加载状态 */
        .loading {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 40px;
            color: #667eea;
            font-size: 1.1rem;
        }
        
        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 40px;
            color: #999;
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 15px;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .content {
                grid-template-columns: 1fr;
            }
            
            header {
                flex-direction: column;
                gap: 15px;
                text-align: center;
            }
            
            .image-grid {
                grid-template-columns: repeat(auto-fill, minmax(80px, 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; }

.batch-workbench .background-options { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 7px; }
.batch-workbench .background-options summary { padding: 12px 14px; color: #535969; font-size: 13px; cursor: pointer; }
.batch-workbench .background-options summary span { margin-left: 10px; font-size: 12px; color: var(--muted); }
.batch-workbench .background-options[open] summary { border-bottom: 1px solid var(--line); }
.batch-workbench .background-options .background-section { padding: 15px; margin: 0; }
.batch-workbench #num-output { width: 120px; }

/* Shared production layout supplies columns and the bottom action bar. */
.batch-workbench .wb-settings .config-section,
.batch-workbench .wb-settings .template-section { margin-bottom: 20px; }
.batch-workbench .wb-settings .config-section:last-child { margin-bottom: 0; }
.batch-workbench .wb-settings .config-label { display: block; }
.batch-workbench .wb-settings #num-output { width: 100%; }
.batch-workbench .background-assets-panel { padding: 0; overflow: hidden; }
.batch-workbench .background-assets-panel .background-options { margin: 0; border: 0; }
.batch-workbench .wb-assets .image-section { margin: 0; }

.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; }
