* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

header h1 {
    font-size: 3.2em;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 8px;
}

.main-content {
    padding: 50px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
    flex: 1;
}

.left-panel {
    flex: 0 0 550px;
    min-width: 550px;
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.right-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
    .main-content {
        padding: 30px;
        gap: 30px;
    }
    
    .left-panel {
        flex: 0 0 320px;
        min-width: 320px;
        padding: 25px;
    }
    
    .right-panel {
        padding: 25px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        padding: 25px;
        gap: 25px;
    }
    
    .left-panel {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 25px;
    }
    
    .right-panel {
        flex: none;
        width: 100%;
        min-width: auto;
    }
    
    header h1 {
        font-size: 2.4em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        min-height: calc(100vh - 20px);
        border-radius: 12px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .main-content {
        padding: 20px;
        gap: 20px;
    }
    
    .left-panel {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .left-panel {
        padding: 15px;
    }
    
    /* 任务ID查询适配 */
    .task-id-search {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .task-id-search input {
        width: 100%;
        padding: 10px 14px;
    }
    
    .task-id-search .btn {
        width: 100%;
        padding: 10px 16px;
    }
    
    /* 历史记录头部适配 */
    .history-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-header .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* 表单元素适配 */
    .form-group {
        margin-bottom: 18px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="file"],
    textarea,
    select {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* 按钮适配 */
    .btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .action-section {
        gap: 10px;
        margin-top: 20px;
    }
    
    /* 视频播放器适配 */
    #imageContainer video {
        max-width: 80%;
        max-height: 200px;
    }
    
    /* 图片适配 */
    #imageContainer img {
        max-width: 40%;
    }
    
    /* 统计信息适配 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.4em;
    }
    
    /* 状态信息适配 */
    .status-info {
        gap: 10px;
    }
    
    .status-item {
        padding: 12px 16px;
    }
}

.config-section,
.workflow-section {
    margin-bottom: 40px;
}

.result-section {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    margin-bottom: 12px;
    color: #444;
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: white;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

input[type="file"] {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    padding: 14px 18px;
}

textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

.action-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 35px;
}

.left-panel .action-section {
    flex-direction: column;
}

.left-panel .btn {
    width: 100%;
    font-size: 17px;
    padding: 18px 36px;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-warning {
    background: #ffc107;
    color: #333;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.4);
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-info {
    background: #17a2b8;
    color: white;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(23, 162, 184, 0.4);
}

.btn-info:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.task-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-info p {
    margin: 10px 0;
    color: #555;
    font-size: 0.95em;
}

.task-info span {
    font-weight: 600;
    color: #333;
}

.output-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.output-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#outputResult {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 100px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.image-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

#imageContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#imageContainer img {
    max-width: 10%;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin: 0 auto;
}

#imageContainer img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#imageContainer video {
    max-width: 60%;
    max-height: 350px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

#imageContainer .text-result {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    word-break: break-word;
    flex: 1;
    min-width: 300px;
    border-left: 4px solid #667eea;
}

#imageContainer .download-link {
    display: block;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid #667eea;
}

#imageContainer .download-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

footer {
    background: #f8f9fa;
    padding: 25px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.history-section {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.history-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
    gap: 15px;
}

.history-header .btn {
    padding: 14px 28px;
    font-size: 14px;
    border-radius: 10px;
}

.stats-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.stat-item {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    border-color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 1.6em;
    font-weight: 800;
    color: #333;
    transition: all 0.3s ease;
}

.stat-value.success {
    color: #28a745;
}

.stat-value.failed {
    color: #dc3545;
}

.stat-value.running {
    color: #17a2b8;
}

.status-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.status-container h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.3em;
    font-weight: 700;
}

.status-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.status-item {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    padding: 18px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.status-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.status-key {
    font-weight: 700;
    color: #666;
    margin-right: 10px;
    font-size: 0.88em;
}

.status-value {
    font-weight: 700;
    color: #333;
    font-size: 0.88em;
}

.history-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-height: 550px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.history-container::-webkit-scrollbar {
    width: 10px;
}

.history-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.history-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.history-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 80px 20px;
    font-style: italic;
    font-size: 1.1em;
}

.history-item {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    border-color: #667eea;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.history-item-id {
    font-weight: 700;
    color: #333;
    font-size: 0.92em;
    word-break: break-all;
    letter-spacing: 0.3px;
}

.history-item-status {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 700;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.history-item-status.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    box-shadow: 0 3px 10px rgba(21, 87, 36, 0.25);
}

.history-item-status.failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    box-shadow: 0 3px 10px rgba(114, 28, 36, 0.25);
}

.history-item-status.running {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    box-shadow: 0 3px 10px rgba(12, 84, 96, 0.25);
}

.history-item-status.queued {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    box-shadow: 0 3px 10px rgba(133, 100, 4, 0.25);
}

.history-item-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    font-size: 0.88em;
    color: #666;
    margin-bottom: 18px;
}

.history-item-info p {
    margin: 5px 0;
}

.history-item-info span {
    font-weight: 700;
    color: #333;
}

.view-result-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.view-result-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 取消任务按钮样式 */
.cancel-task-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cancel-task-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.cancel-task-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cancel-task-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 历史任务操作按钮容器 */
.history-item-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.history-item-actions button {
    flex: 1;
    text-align: center;
}

/* 清空历史记录按钮样式 */
.btn-danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* 历史记录按钮容器样式 */
.history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.task-id-search {
    display: flex;
    gap: 10px;
    margin-right: auto;
}

.task-id-search input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
    transition: all 0.3s ease;
}

.task-id-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.task-id-search .btn {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
}

/* 加载动画优化 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* 消息动画效果优化 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 状态文本样式 */
.status-success {
    color: #28a745;
    font-weight: 600;
}

.status-running {
    color: #ffc107;
    font-weight: 600;
}

.status-queued {
    color: #17a2b8;
    font-weight: 600;
}

.status-failed {
    color: #dc3545;
    font-weight: 600;
}

.status-cancelled {
    color: #6c757d;
    font-weight: 600;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .history-item-info {
        grid-template-columns: 1fr;
    }
    
    .history-item-actions {
        flex-direction: column;
    }
    
    .history-item-actions button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .status-info {
        grid-template-columns: 1fr;
    }
}
