/* PDF文档处理工具 - 表单和交互样式 */

/* 处理器容器 */
.processor-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #718096;
}

.upload-placeholder svg {
    margin-bottom: 16px;
    color: #667eea;
}

.upload-placeholder p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2d3748;
}

.upload-placeholder span {
    font-size: 14px;
    color: #a0aec0;
}

/* 文件列表 */
.file-list {
    margin-top: 20px;
}

.file-list-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.file-list-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.clear-all-btn {
    padding: 4px 14px;
    font-size: 13px;
    color: #6b7280;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
}

.remove-btn {
    padding: 6px 12px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #f56565;
}

/* 功能选择器 */
.function-selector {
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.function-selector label {
    font-size: 16px;
    font-weight: 500;
    color: #2d3748;
}

.function-selector select {
    flex: 1;
    max-width: 300px;
    padding: 10px 16px;
    font-size: 15px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.function-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* 功能选择卡片 */
.function-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    max-width: 873px;
}

.function-card {
    flex: 1;
    min-width: 105px;
    max-width: 165px;
    padding: 12px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.function-card:hover {
    border-color: #667eea;
    background: #f5f3ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.function-card:hover .card-label {
    color: #4c1d95;
}

.function-card.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.function-card.active::before {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.function-card.active .card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.function-card.active .card-icon svg {
    stroke: white;
}

.function-card.active .card-label {
    color: #5b21b6;
    font-weight: 700;
}

.card-icon {
    width: 33px;
    height: 33px;
    background: #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.card-icon svg {
    width: 18px;
    height: 18px;
    stroke: #64748b;
    transition: stroke 0.25s ease;
}

.function-card:hover .card-icon {
    background: #c7d2fe;
}

.function-card:hover .card-icon svg {
    stroke: #667eea;
}

.card-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: all 0.25s ease;
}

.card-desc {
    font-size: 10px;
    color: #9ca3af;
    transition: all 0.25s ease;
    margin-top: -4px;
}

.function-card.active .card-desc {
    color: #7c3aed;
}

/* 参数区域 */
.params-area {
    margin: 30px 0;
}

.param-group {
    margin-bottom: 20px;
}

.param-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 8px;
}

.param-input,
.param-select {
    width: 100%;
    padding: 10px 16px;
    font-size: 15px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: white;
    transition: border-color 0.3s;
}

.param-input:focus,
.param-select:focus {
    outline: none;
    border-color: #667eea;
}

.param-row {
    display: flex;
    gap: 20px;
}

.param-row .param-group {
    flex: 1;
}

.param-row-3 {
    display: flex;
    gap: 16px;
}

.param-row-3 .param-group {
    flex: 1;
}

/* 处理按钮 */
.process-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 进度区域 - 默认隐藏 */
#progressArea,
#resultArea,
#splitPagesGroup,
.download-btn {
    display: none;
}

.progress-area {
    margin-top: 30px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #718096;
}

/* 结果区域 */
.result-area {
    margin-top: 30px;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.result-area.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.result-area.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.result-area h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2d3748;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.result-message {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 20px;
}

.download-btn {
    padding: 12px 32px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #38a169;
}

/* Footer 样式修复 */
.footer p:last-child {
    margin-top: 8px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .processor-container {
        padding: 20px;
    }

    .function-cards {
        gap: 8px;
    }

    .function-card {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 4px);
        padding: 16px 12px;
    }

    .card-icon {
        width: 30px;
        height: 30px;
    }

    .card-icon svg {
        width: 16px;
        height: 16px;
    }

    .card-label {
        font-size: 12px;
    }

    .param-row {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .steps-wrapper {
        padding: 0 10px;
    }

    .steps-row {
        flex-direction: column;
        gap: 16px;
    }

    .step-line {
        width: 2px;
        height: 30px;
        margin: 0;
    }

    .steps-labels {
        flex-direction: column;
        gap: 46px;
    }
}
