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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #fff;
    color: #000;
    line-height: 1.6;
}

.card {
    border: 1px solid #ddd;
    padding: 24px;
    margin-bottom: 24px;
    background: #fff;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.section-header p {
    font-size: 13px;
    color: #666;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #666;
}

textarea {
    width: 100%;
    border: 1px solid #ccc;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    min-height: 140px;
    resize: vertical;
    background: #fff;
}

textarea:focus {
    outline: none;
    border-color: #999;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.04);
}

.input-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #666;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.example-tag {
    border: 1px solid #ccc;
    min-height: 32px;
    padding: 0 12px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.example-tag:hover {
    border-color: #000;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.form-group input[type="color"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    height: 40px;
    border: 1px solid #ccc;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
}

.form-group input[type="color"] {
    padding: 0;
    cursor: pointer;
    width: 100%;
    padding-block: 1px;
    padding-inline: 3px;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23000' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
}

.preview-card #previewContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #ddd;
    padding: 32px;
    min-height: 320px;
    background: #fafafa;
}

#qrcodePreview {
    display: inline-flex;
    padding: 12px;
    background: #fff;
    border: 1px solid #eee;
    min-width: 250px;
    min-height: 250px;
    align-items: center;
    justify-content: center;
}

#qrcodePreview canvas,
#qrcodePreview img {
    width: 100%;
    height: 100%;
}

#qrcodePreview .placeholder {
    font-size: 13px;
    color: #999;
    text-align: center;
    max-width: 220px;
    line-height: 1.4;
}

.preview-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-actions .btn {
    min-width: 140px;
}

.btn-black {
    background: #000;
    color: #fff;
}

.btn-black:hover:not(:disabled) {
    background: #333;
}

@media (max-width: 640px) {
    .card {
        padding: 20px;
    }

    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-actions {
        flex-direction: column;
    }

    .preview-actions .btn {
        width: 100%;
    }
}
