* {
    box-sizing: border-box;
}

body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
    background: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.github {
    color: #24292f;
    position: fixed;
    top: 2rem;
    right: 2rem;
    transition: all 0.2s ease;
}

.github:hover {
    color: darkorange;
    transform: translateY(-1px);
}

.github svg {
    width: 2.5rem;
    height: 2.5rem;
}

h1 {
    color: darkorange;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0;
}

.subtitle {
    color: #888;
    font-size: 1.25rem;
    margin-top: 0.5rem;
}

.upload {
    background: #fbfbfb;
    border: 2px dashed #e5e5e5;
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload:hover {
    background: #f3f3f3;
    border-color: darkorange;
}

.upload.dragover {
    background: #f3f3f3;
    border-color: darkorange;
    transform: scale(1.1);
}

.upload-icon {
    color: darkorange;
    margin: 0;
    width: 64px;
    height: 64px;
}

.upload-text {
    color: #4a3f35;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #888;
    font-size: 1rem;
    margin-top: 0;
}

.control {
    background: #fbfbfb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    color: #4a3f35;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input[type="number"] {
    color: #4a3f35;
    font-size: 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    text-align: center;
    padding: 0.5rem;
}

input[type="number"]:focus {
    outline: none;
    border-color: darkorange;
}

input[type="range"] {
    flex: 1;
}

fieldset.control-group {
    border: none;
    padding: 0;
    margin-bottom: 0rem;
}

legend {
    color: #4a3f35;
    font-weight: 500;
    padding: 0;
    margin-bottom: 0.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.radio-label:hover {
    background: #f3f3f3;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 0.75rem;
}

.preview {
    margin-bottom: 2rem;
}

.image-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.image-container {
    background: #fbfbfb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-container h3 {
    color: #4a3f35;
    margin: 0 0 1rem;
}

.image-container img {
    width: 100%;
    border-radius: 8px;
}

.processed-container {
    display: flex;
    min-height: 200px;
    align-items: center;
    justify-content: center;
}

.loading {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid darkorange;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download {
    color: white;
    background: darkorange;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 128, 0, 0.2);
}

.download:active {
    transform: translateY(0);
}

.error-message {
    background: #fff0f0;
    color: #ee4444;
    padding: 1rem;
    border-radius: 8px;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
}

footer p {
    color: #888;
    font-size: 0.875rem;
    margin: 0;
}
