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

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4bb543;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #2b2d42;
    --border-radius: 16px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background-color: #f0f4f8;
    color: #333;
    min-height: 100vh;
    padding: 2rem 0;
}

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

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 2.2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.preview-container {
    width: 48%;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.upload-area, .result-area {
    border: 2px dashed #bbb;
    border-radius: 8px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
}

.controls {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.controls label {
    margin-right: 10px;
}

.download-btn {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.download-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.preview-canvas {
    max-width: 100%;
    max-height: 300px;
    border-radius: calc(var(--border-radius) - 4px);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: var(--text-color);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 75%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.upload-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-top: 10px;
}

.upload-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

#radiusValue {
    text-align: center;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    background: rgba(67, 97, 238, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    margin-top: 0.5rem;
    margin-left: 10px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .controls {
        width: 100%;
    }
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-container, .controls {
    animation: fadeIn 0.5s ease-out;
}

.description {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 1rem;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.controls label {
    white-space: nowrap;
} 