* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

h1 {
    color: #2d3436;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #636e72;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

.panel {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: #6c5ce7;
}

.upload-area {
    border: 2px dashed #b2bec3;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover {
    border-color: #6c5ce7;
    background-color: rgba(108, 92, 231, 0.05);
}

.upload-icon {
    font-size: 48px;
    color: #6c5ce7;
    margin-bottom: 15px;
}

.upload-text {
    color: #636e72;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #b2bec3;
}

#image-input {
    display: none;
}

.controls {
    margin-top: 25px;
}

.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3436;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #6c5ce7;
}

input[type="range"] {
    flex-grow: 1;
    height: 6px;
    border-radius: 3px;
    background: #dfe6e9;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f2f6;
    border-radius: 8px;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background-color: #6c5ce7;
    color: white;
    flex: 1;
}

.primary-btn:hover {
    background-color: #5b4bd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.secondary-btn {
    background-color: #dfe6e9;
    color: #2d3436;
    flex: 1;
}

.secondary-btn:hover {
    background-color: #cfd9e0;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
    color: #636e72;
    font-size: 0.9rem;
}

.loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #dfe6e9;
    border-top: 5px solid #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-text {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    color: #0d47a1;
}

.preview-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.resolution-display {
    font-size: 0.9rem;
    color: #636e72;
    background-color: #f1f2f6;
    padding: 5px 10px;
    border-radius: 4px;
}