* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', Meiryo, sans-serif;
    background: #f5f7fb;
    color: #333;
    margin: 0;
    padding: 40px 16px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

h1 {
    margin-top: 0;
    font-size: 1.8rem;
    text-align: center;
    color: #2c3e50;
}

.prompt-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
}

input[type="text"],
textarea,
select {
    padding: 10px 12px;
    border: 1px solid #d6d9e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

textarea {
    resize: vertical;
}

.few-shot {
    border: 1px solid #dfe3eb;
    border-radius: 8px;
    padding: 16px;
    display: grid;
    gap: 16px;
}

.few-shot legend {
    padding: 0 8px;
    font-weight: 700;
}

.form-actions {
    text-align: center;
}

.submit-button,
.copy-button,
.back-link {
    display: inline-block;
    background: #4f46e5;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.submit-button:hover,
.copy-button:hover,
.back-link:hover {
    background: #4338ca;
}

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

.back-link {
    text-align: center;
}

.copy-button {
    min-width: 120px;
}

.generated-text {
    width: 100%;
    min-height: 360px;
    padding: 16px;
    border: 1px solid #d6d9e0;
    border-radius: 8px;
    font-family: 'Fira Code', 'Ricty Diminished', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .container {
        padding: 20px;
    }

    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-button,
    .back-link {
        width: 100%;
        text-align: center;
    }
}

.copy-button.copied {
    background: #16a34a;
}

.copy-button.copy-error {
    background: #dc2626;
}
