:root {
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --accent-color: #f9a826;
    --text-color: #333;
    --light-text: #777;
    --light-bg: #f5f7fa;
    --border-color: #ddd;
    --success-color: #28a745;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.config-panel {
    flex: 1;
    min-width: 320px;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.preview-panel {
    flex: 1;
    min-width: 320px;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    gap: 1rem;
}

.form-group {
    flex: 1;
    min-width: 120px;
}

.full-width {
    flex: 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 84, 200, 0.2);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a40a0;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

#previewContainer {
    width: 100%;
    height: 350px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

.preview-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    background-color: rgba(245, 247, 250, 0.8);
}

.preview-info.hidden {
    display: none;
}

.result-panel {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

.result-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #e8f5e9;
    border-radius: 4px;
}

.result-message i {
    font-size: 2rem;
    color: var(--success-color);
}

.download-area {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.help-text {
    margin-top: 0.5rem;
    color: var(--light-text);
    font-size: 0.9rem;
}

.print-tips {
    background-color: #fff8e1;
    padding: 1.5rem;
    border-radius: 4px;
}

.print-tips h3 {
    color: #f57c00;
    margin-bottom: 0.75rem;
}

.print-tips ul {
    padding-left: 1.5rem;
}

.print-tips li {
    margin-bottom: 0.5rem;
}

footer {
    background-color: #333;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media screen and (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .config-panel, .preview-panel {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
}