#main_bg {
    background-image: url(../assets/images/background/pbr_bg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: fixed;
    min-height: 100vh;
    width: 100%;
    background-attachment: fixed;
    z-index: -1;
}

#panel {
    font-family: "Yu Gothic UI", sans-serif;
    padding: 14px !important;
    display: flex;
    gap: 16px;
    height: calc(100vh - 8vh - 20px);
    overflow: hidden;
}

/* 左侧图片队列区 */
.queue-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.queue-title {
    font-size: 13px;
    font-weight: 700;
    color: white;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(55, 177, 140, 0.9) 0%, rgba(45, 140, 110, 0.95) 100%);
    border-radius: 10px;
    border: 1px solid rgba(55, 177, 140, 0.3);
    box-shadow: 0 2px 8px rgba(55, 177, 140, 0.2);
    text-align: center;
    letter-spacing: 0.5px;
}

#panel h1 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-family: "Yu Gothic UI", sans-serif;
    letter-spacing: -0.5px;
}

.upload-section {
    margin-bottom: 10px;
}

.upload-area {
    border: 2px dashed rgba(55, 177, 140, 0.4);
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 250, 248, 0.9) 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(55, 177, 140, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover {
    border-color: rgba(55, 177, 140, 0.6);
    box-shadow: 0 4px 12px rgba(55, 177, 140, 0.15);
    transform: translateY(-1px);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: rgba(55, 177, 140, 0.8);
    background: rgba(55, 177, 140, 0.12);
    box-shadow: 0 8px 24px rgba(55, 177, 140, 0.2);
}

.upload-content svg {
    color: rgba(55, 177, 140, 0.8);
    margin-bottom: 6px;
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(55, 177, 140, 0.2));
}

.upload-content p {
    font-size: 13px;
    font-weight: 600;
    color: #2a2a2a;
    margin: 0 0 3px 0;
    font-family: "Yu Gothic UI", sans-serif;
}

.upload-content .sub-text {
    font-size: 11px;
    color: #6b7280;
    font-family: "Yu Gothic UI", sans-serif;
    margin: 0;
}

.settings-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 252, 251, 0.95) 100%);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(55, 177, 140, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(55, 177, 140, 0.1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    transition: all 0.3s ease;
}

.settings-panel:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(55, 177, 140, 0.15);
}

.settings-panel:hover {
    border-color: rgba(55, 177, 140, 0.35);
}

.setting-group {
    margin-bottom: 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(55, 177, 140, 0.12);
    border-radius: 8px;
    transition: all 0.25s ease;
}

.setting-group:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(55, 177, 140, 0.25);
    box-shadow: 0 2px 8px rgba(55, 177, 140, 0.08);
    transform: translateY(-1px);
}

.setting-group label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: rgba(55, 177, 140, 0.9);
    margin-bottom: 6px;
    font-family: "Yu Gothic UI", sans-serif;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.model-hint {
    margin-top: 4px;
    padding: 3px 6px;
    font-size: 9px;
    color: #6b7280;
    font-family: "Yu Gothic UI", sans-serif;
    background: rgba(55, 177, 140, 0.08);
    border-radius: 4px;
    border-left: 2px solid rgba(55, 177, 140, 0.5);
    line-height: 1.3;
}

.model-status {
    margin-top: 4px;
    padding: 2px 6px;
    font-size: 9px;
    color: #6b7280;
    font-family: "Yu Gothic UI", sans-serif;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    background: rgba(107, 114, 128, 0.12);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.model-status.ok {
    color: #2f855a;
    background: rgba(47, 133, 90, 0.12);
    border: 1px solid rgba(47, 133, 90, 0.2);
}

.model-status.warn {
    color: #b45309;
    background: rgba(180, 83, 9, 0.12);
    border: 1px solid rgba(180, 83, 9, 0.2);
}

.model-status.error {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.12);
    border: 1px solid rgba(185, 28, 28, 0.2);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 0;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.radio-group label:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(55, 177, 140, 0.25);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: rgb(55, 177, 140);
    width: 16px;
    height: 16px;
}

.radio-group label:has(input:checked) {
    background: rgba(55, 177, 140, 0.15);
    border-color: rgba(55, 177, 140, 0.6);
    color: #1a1a1a;
    font-weight: 600;
}

.setting-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid rgba(55, 177, 140, 0.25);
    border-radius: 6px;
    font-size: 11px;
    background: white;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: "Yu Gothic UI", sans-serif;
    cursor: pointer;
    font-weight: 500;
}

.setting-group select:hover {
    border-color: rgba(55, 177, 140, 0.45);
    box-shadow: 0 2px 6px rgba(55, 177, 140, 0.1);
}

.setting-group select:focus {
    outline: none;
    border-color: rgb(55, 177, 140);
    box-shadow: 0 0 0 3px rgba(55, 177, 140, 0.15);
}

#loadModelBtn {
    margin-top: 6px;
    width: 100%;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.25s ease;
}

#loadModelBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(55, 177, 140, 0.3);
}

.suffix-input {
    margin-left: 6px;
    padding: 3px 6px;
    border: 1px solid rgba(55, 177, 140, 0.3);
    background: rgba(255, 255, 255, 0.95);
    color: #2a2a2a;
    border-radius: 4px;
    width: 80px;
    font-size: 11px;
    transition: all 0.2s ease;
}

.suffix-input:focus {
    outline: none;
    border-color: rgba(55, 177, 140, 0.6);
    box-shadow: 0 0 0 2px rgba(55, 177, 140, 0.1);
}

.file-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    border-radius: 12px;
    border: 1px solid rgba(55, 177, 140, 0.15);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03), 0 2px 12px rgba(0, 0, 0, 0.06);
}

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: rgba(55, 177, 140, 0.5);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(55, 177, 140, 0.7);
}

.file-list:empty {
    display: flex;
    min-height: 200px;
}

.file-list:empty::before {
    content: '暂无图片';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
}

.file-item {
    background: white;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 90px;
    border: 1px solid rgba(55, 177, 140, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.file-item:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 rgba(55, 177, 140, 0.6), 0 4px 12px rgba(55, 177, 140, 0.15);
    border-color: rgba(55, 177, 140, 0.4);
}

.file-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.file-preview {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(55, 177, 140, 0.1) 0%, rgba(55, 177, 140, 0.05) 100%);
    border: 2px solid rgba(55, 177, 140, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-preview:hover {
    transform: scale(1.08);
    border-color: rgba(55, 177, 140, 0.4);
    box-shadow: 0 4px 16px rgba(55, 177, 140, 0.25);
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.file-name {
    font-size: 12px;
    color: #2a2a2a;
    margin-bottom: 4px;
    font-weight: 500;
    word-break: break-all;
    font-family: "Yu Gothic UI", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    max-height: 2.6em;
}

.file-size {
    font-size: 10px;
    color: #777;
    font-family: "Yu Gothic UI", sans-serif;
}

.file-result {
    font-size: 10px;
    color: rgba(55, 177, 140, 0.9);
    font-family: "Yu Gothic UI", sans-serif;
    text-align: left;
}

.file-status {
    display: none;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: stretch;
    flex-shrink: 0;
    width: auto;
}

.file-download,
.file-preview-btn,
.file-remove {
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: "Yu Gothic UI", sans-serif;
    flex: 1;
    min-width: 40px;
}

.file-download {
    background: rgba(55, 177, 140, 0.7);
    color: white;
}

.file-preview-btn {
    background: rgba(84, 126, 199, 0.75);
    color: white;
}

.file-preview-btn:hover {
    background: rgba(84, 126, 199, 0.9);
}

.file-preview-btn:disabled {
    background: rgba(150, 150, 150, 0.4);
    cursor: not-allowed;
}

.file-download:hover {
    background: rgba(55, 177, 140, 0.85);
}

.file-download:disabled {
    background: rgba(150, 150, 150, 0.4);
    cursor: not-allowed;
}

.file-remove {
    background: rgba(200, 80, 80, 0.7);
    color: white;
}

.file-remove:hover {
    background: rgba(200, 80, 80, 0.85);
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(55, 177, 140, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-primary,
.btn-secondary {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: "Yu Gothic UI", sans-serif;
}

.btn-primary {
    background: rgba(55, 177, 140, 0.8);
    color: white;
    box-shadow: 0 2px 6px rgba(55, 177, 140, 0.25);
}

.btn-primary:hover {
    background: rgba(55, 177, 140, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 177, 140, 0.3);
}

.btn-primary:disabled {
    background: rgba(150, 150, 150, 0.6);
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(150, 150, 150, 0.65);
    color: white;
}

.btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}


.btn-secondary:hover {
    background: rgba(150, 150, 150, 0.8);
    transform: translateY(-1px);
}

#downloadAllBtn {
    background: rgba(55, 177, 140, 0.7);
}

#downloadAllBtn:hover {
    background: rgba(55, 177, 140, 0.9);
}

.progress-container {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(55, 177, 140, 0.2);
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(220, 220, 220, 0.5);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid rgba(55, 177, 140, 0.15);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(55, 177, 140, 0.85), rgba(55, 177, 140, 0.95));
    transition: width 0.3s;
    width: 0;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #2a2a2a;
    font-family: "Yu Gothic UI", sans-serif;
}

/* 对比查看模态框 */
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.comparison-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.comparison-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(55, 177, 140, 0.3);
    gap: 15px;
}

.modal-title-group {
    flex: 1;
    text-align: center;
}

.comparison-modal-header h2 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #2a2a2a;
    font-family: "Yu Gothic UI", sans-serif;
}

.current-file-name {
    font-size: 13px;
    color: #666;
    font-family: "Yu Gothic UI", sans-serif;
    word-break: break-all;
}

.nav-btn {
    background: rgba(55, 177, 140, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(55, 177, 140, 0.9);
    transform: scale(1.05);
}

.nav-btn:disabled {
    background: rgba(150, 150, 150, 0.4);
    cursor: not-allowed;
    opacity: 0.5;
}

.close-modal {
    background: none;
    border: none;
    font-size: 32px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.comparison-slider-container {
    max-width: 1200px;
    margin: 0 auto;
}

.comparison-slider {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background: #f8f9fa;
    user-select: none;
    min-height: 300px;
}

.comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-before {
    position: relative;
    z-index: 1;
}

.comparison-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.comparison-image canvas {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
}

.image-label {
    position: absolute;
    top: 15px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: 600;
    font-size: 13px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10;
    font-family: "Yu Gothic UI", sans-serif;
}

.label-left {
    left: 15px;
}

.label-right {
    right: 15px;
}

.comparison-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-2px);
}

.handle-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.handle-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.handle-arrow-left {
    left: 12px;
    border-width: 6px 8px 6px 0;
    border-color: transparent rgba(55, 177, 140, 0.8) transparent transparent;
}

.handle-arrow-right {
    right: 12px;
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent rgba(55, 177, 140, 0.8);
}

.file-preview.is-ready {
    box-shadow: 0 0 0 2px rgba(84, 126, 199, 0.28);
}

@media (max-width: 1200px) {
    .settings-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    #panel {
        flex-direction: column;
        height: auto;
    }

    .queue-sidebar {
        width: 100%;
        max-height: 300px;
    }
}

@media (max-width: 900px) {
    .settings-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .queue-sidebar {
        max-height: 250px;
    }
}

.comparison-modal {
    padding: 10px;
}

.comparison-modal-content {
    padding: 12px;
}

.comparison-modal-header h2 {
    font-size: 16px;
}

/* 文件状态标签样式 */
.file-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
    font-family: "Yu Gothic UI", sans-serif;
    letter-spacing: 0.3px;
}

.file-status-badge.pending {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), rgba(71, 85, 105, 0.15));
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.file-status-badge.processing {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite;
}

.file-status-badge.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.15));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.file-status-badge.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* 优化文件列表背景 */
.file-list {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03), 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* 优化空状态显示 */
.file-list:empty::before {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
}

/* 增强文件项悬停效果 */
.file-item {
    position: relative;
    width: 95%;
}

.file-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    border-radius: 10px 0 0 10px;
    transition: all 0.3s ease;
}

.file-item:hover::before {
    background: linear-gradient(180deg, rgba(55, 177, 140, 0.8), rgba(55, 177, 140, 0.5));
}

.file-item:hover {
    background: linear-gradient(90deg, rgba(55, 177, 140, 0.03) 0%, white 100%);
}