/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
}

h2 {
    margin-bottom: 15px;
    color: #34495e;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* 部分样式 */
.section {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* 文件选择区域 */
.file-input-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.file-input-label {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-input-label:hover {
    background-color: #2980b9;
}

#pdf-file {
    display: none;
}

#file-name {
    flex-grow: 1;
    margin-left: 10px;
    color: #7f8c8d;
}

.file-size-info {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 14px;
}

/* 裁剪设置区域 */
.crop-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.crop-setting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider {
    flex-grow: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

/* 压缩设置区域 */
.compression-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#compression-options {
    margin-left: 25px;
    margin-top: 10px;
}

.compression-quality {
    margin-bottom: 15px;
}

.compression-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.compression-format {
    margin-bottom: 15px;
}

.compression-info {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    font-size: 14px;
    color: #555;
    border-left: 3px solid #3498db;
}

.compression-info p {
    margin: 5px 0;
}

/* 保存设置区域 */
.save-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
}

.page-range, .split-settings {
    display: flex;
    gap: 20px;
    margin-left: 25px;
    margin-top: 10px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 文件命名设置 */
.filename-settings {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.radio-group {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
}

#custom-filename {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#custom-filename:focus {
    border-color: #3498db;
    outline: none;
}

/* 预览区域 */
.preview-section {
    margin-top: 30px;
}

.preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

/* 页码滑块样式 */
.page-slider-container {
    width: 100%;
    padding: 0 20px;
    margin-bottom: 20px;
}

.page-slider {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    transition: opacity 0.2s;
}

.page-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e74c3c;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.page-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e74c3c;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.page-slider:disabled {
    opacity: 0.5;
}

/* 处理状态样式 */
.status-section {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #2ecc71;
    transition: width 0.3s ease-in-out;
}

.status-text {
    font-size: 14px;
    color: #7f8c8d;
}

.action-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.action-button:hover:not(:disabled) {
    background-color: #2980b9;
}

#page-info {
    font-size: 14px;
    color: #7f8c8d;
}

.preview-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.preview-wrapper {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-wrapper h3 {
    margin-bottom: 10px;
    color: #34495e;
}

.canvas-container {
    position: relative;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

#crop-rect {
    position: absolute;
    border: 2px dashed #e74c3c;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.primary-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.primary-button:hover:not(:disabled) {
    background-color: #27ae60;
}

.primary-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .crop-settings {
        grid-template-columns: 1fr;
    }
    
    .preview-content {
        flex-direction: column;
    }
    
    .preview-wrapper {
        width: 100%;
    }
}

/* 页面分割设置样式（美化，与其他区域一致） */
.settings-section {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
}
.settings-section h3 {
    margin-bottom: 15px;
    color: #34495e;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.settings-section .setting-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}
.settings-section label {
    font-size: 15px;
    color: #555;
}
.settings-section select,
.settings-section input[type="range"] {
    margin-left: 10px;
}
.settings-section input[type="range"] {
    width: 200px;
}
.settings-section span {
    min-width: 50px;
    text-align: right;
    display: inline-block;
}

/* 预览区域分割线样式 */
.split-line {
    position: absolute;
    background-color: rgba(255, 0, 0, 0.5);
    width: 2px;
    pointer-events: none;
} 