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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.control-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.control-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.preset-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.preset-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.preset-item label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #6c757d;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 30px;
}

.canvas-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#mainCanvas {
    max-width: 100%;
    height: auto;
    display: none;
    touch-action: none;
}

.placeholder {
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.info-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.info-content {
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-content ol,
.info-content ul {
    padding-left: 20px;
}

.info-content li {
    margin-bottom: 8px;
    color: #6c757d;
}

kbd {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    border: 1px solid #ced4da;
}

.preview-section {
    padding: 30px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

.preview-section h3 {
    margin-bottom: 15px;
    color: #495057;
}

.preview-container {
    background: white;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
    }
    
    .info-panel {
        order: 2;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .controls,
    .workspace,
    .preview-section {
        padding: 20px;
    }
    
    .preset-controls {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}