* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

p {
    text-align: center;
    margin-bottom: 20px;
    color: #7f8c8d;
}

.input-section {
    margin-bottom: 20px;
}

.function-input {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.function-input label {
    width: 120px;
    font-weight: bold;
    color: #2c3e50;
}

.function-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.settings-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.setting {
    display: flex;
    align-items: center;
}

.setting label {
    width: 80px;
    font-weight: bold;
    color: #2c3e50;
}

.setting input {
    width: 80px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#downloadButton {
    background-color: #2ecc71;
}

#downloadButton:hover {
    background-color: #27ae60;
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

canvas {
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .settings-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .function-input {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .function-input label {
        margin-bottom: 5px;
    }
}

.examples-section, .functions-reference {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.examples-section h3, .functions-reference h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

.examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.example {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.example h4 {
    margin-bottom: 10px;
    color: #3498db;
}

.example p {
    font-family: monospace;
    text-align: left;
    margin: 5px 0;
    color: #333;
    font-size: 0.9em;
}

.function-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

.function-category {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.function-category h4 {
    margin-bottom: 10px;
    color: #3498db;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.function-category ul {
    list-style-type: none;
    padding-left: 0;
}

.function-category li {
    margin-bottom: 5px;
    font-size: 0.9em;
}

.function-category code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    color: #e74c3c;
}

.note {
    text-align: center;
    font-style: italic;
    color: #7f8c8d;
    margin-top: 10px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .examples {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .function-categories {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .settings-section {
        grid-template-columns: 1fr;
    }
    
    .button-section {
        flex-direction: column;
    }
    
    .examples {
        grid-template-columns: 1fr;
    }
}
