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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: calc(100% - 350px);
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 20px;
}

/* 上传区域 */
.upload-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#fileInput {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
}

#fileInput:hover {
    border-color: #4CAF50;
}

.upload-section p {
    color: #666;
    font-size: 14px;
}

/* 预览区域 */
.preview-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-container {
    width: 300px;
    height: 400px;
    border: 3px solid #4CAF50;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.preview-container:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: #45a049;
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.rotate-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.rotate-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.rotate-buttons button:hover {
    background-color: #45a049;
}



/* 选项容器 */
.options-container {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    
}

.option-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.option-group label {
    display: inline-block;
    min-width: 80px;
    width: 100px;
    margin-right: 10px;
    font-weight: bold;
}

.option-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 300px;
    font-size: 14px;
}

.option-group input[type="range"] {
    width: 200px;
    margin: 0 10px;
}

.option-group span {
    font-weight: bold;
    color: #4CAF50;
    margin: 0 10px;
}

.option-group input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.spacing-btn {
    width: 30px;
    height: 30px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    margin: 0 3px;
}

.spacing-btn:hover {
    background-color: #45a049;
}

.spacing-btn:active {
    background-color: #3d8b40;
}

#generateBtn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

#generateBtn:hover {
    background-color: #45a049;
}

/* 结果区域 */
.result-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#resultCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#downloadBtn,
#printBtn {
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#downloadBtn:hover,
#printBtn:hover {
    background-color: #007B9E;
}

#printBtn {
    background-color: #f44336;
}

#printBtn:hover {
    background-color: #d32f2f;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }
    
    .options-section {
        position: static;
        transform: none;
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .preview-container {
        width: 250px;
        height: 350px;
    }
    
    .option-group select {
        width: 100%;
    }
    
    .option-group label {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .preview-container {
        width: 200px;
        height: 280px;
    }
    
    #generateBtn,
    #downloadBtn,
    #printBtn {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .rotate-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .rotate-buttons button {
        width: 100%;
    }
}