/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* 通用部分样式 */
section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.3em;
    color: #2c3e50;
}

/* 拖放区域样式 */
.drop-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background-color: #fafafa;
}

.drop-area:hover,
.drop-area.drag-over {
    border-color: #667eea;
    background-color: #f5f5ff;
}

.drop-area-content .icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #667eea;
}

.drop-area-content h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.drop-area-content p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.browse-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.support-text {
    font-size: 0.9em;
    margin-top: 15px;
    color: #95a5a6;
}

#fileInput {
    display: none;
}

/* 按钮通用样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.primary-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.secondary-btn:hover {
    background-color: #dfe6e9;
    transform: translateY(-2px);
}

/* 文件列表样式 */
.file-list {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #7f8c8d;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.3s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-icon {
    font-size: 32px;
    margin-right: 15px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
}

.file-size {
    font-size: 0.9em;
    color: #7f8c8d;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #f1f1f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.action-btn:hover {
    background-color: #e0e0e0;
    transform: scale(1.1);
}

.move-up:hover {
    background-color: #3498db;
    color: white;
}

.move-down:hover {
    background-color: #2ecc71;
    color: white;
}

.remove:hover {
    background-color: #e74c3c;
    color: white;
}

/* 选项区域样式 */
.options-section h3 {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.option-group {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.option-group input[type="text"],
.option-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.option-group input[type="text"]:focus,
.option-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

/* 进度条样式 */
.progress-section {
    display: none;
}

.progress-container {
    background-color: #f1f1f1;
    border-radius: 10px;
    padding: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
}

/* 预览区域样式 */
.preview-section {
    display: none;
}

.preview-container {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.preview-pdf {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    background-color: white;
}

.preview-page {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #27ae60;
}

.notification.error {
    background-color: #e74c3c;
}

.notification.info {
    background-color: #3498db;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .drop-area {
        padding: 40px 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .drop-area-content .icon {
        font-size: 48px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-actions {
        flex-direction: row;
        align-self: flex-end;
    }
}

/* 滚动条样式 */
.file-list::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover,
.preview-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}