* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 确保 header 样式与 portal 一致 */
.header {
    padding: 1rem 0 !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 16px;
    color: #7f8c8d;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    background-color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #3498db;
    background-color: #e8f4f8;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #95a5a6;
    margin: 0 auto 20px;
}

.upload-text {
    font-size: 18px;
    color: #34495e;
    margin-bottom: 10px;
}

.upload-or {
    font-size: 14px;
    color: #95a5a6;
    margin-bottom: 20px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: #2980b9;
}

.button-icon {
    width: 20px;
    height: 20px;
}

.privacy-notice {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 20px;
}

/* Processing Section */
.processing-section {
    margin-bottom: 30px;
}

.processing-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

/* Control Panel */
.control-panel {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.control-group {
    margin-bottom: 24px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.control-item {
    margin-bottom: 20px;
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 10px;
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    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;
    transition: background 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #2980b9;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    transition: background 0.3s ease;
}

.slider::-moz-range-thumb:hover {
    background: #2980b9;
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Tool Selector */
.tool-selector {
    display: flex;
    gap: 8px;
}

.tool-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-button:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.tool-button.active {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

.tool-button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.tool-button.active svg {
    stroke: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #34495e;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.action-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* Download Button */
.download-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 12px;
}

.download-button:hover {
    background-color: #229954;
}

.download-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

/* Reselect Button */
.reselect-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #fff;
    color: #34495e;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reselect-button:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.reselect-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* Preview Panel */
.preview-panel {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

#imageCanvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: crosshair;
}

/* Responsive */
@media (max-width: 1024px) {
    .processing-container {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    
    .tool-selector {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
