:root {
    --bg-color: #f5f7fb;
    --primary-color: #2f6bff;
    --primary-color-dark: #1f4ac9;
    --surface-color: #ffffff;
    --border-color: #d7deed;
    --text-color: #1f2430;
    --muted-text: #5b6577;
    --hint-text: #7a8699;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-soft: 0 14px 40px rgba(47, 107, 255, 0.08);
    --shadow-card: 0 12px 30px rgba(22, 33, 53, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #eef3ff 0%, #f8faff 55%, #ffffff 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.page-header {
    padding: 48px 0 32px;
    text-align: center;
}

.title {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 2.8rem);
    font-weight: 700;
}

.subtitle {
    margin: 12px 0 0;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--muted-text);
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    padding-bottom: 48px;
    width: min(1100px, 92vw);
}

.section-title {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 18px;
    font-weight: 600;
}

.form-section,
.result-section {
    background: var(--surface-color);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group,
fieldset {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
}

legend {
    padding: 0 8px;
    font-weight: 600;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

.required-mark {
    color: #ef4444;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f9fbff;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
    outline: none;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.field-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--hint-text);
}

.input-with-extra {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.dialogue-options {
    background: #f3f6ff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialogue-language {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.dialogue-language label {
    font-weight: 500;
}

.dialogue-label {
    font-weight: 600;
}

.generate-btn {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 12px 24px rgba(47, 107, 255, 0.2);
}

.generate-btn:disabled {
    background: rgba(47, 107, 255, 0.35);
    box-shadow: none;
    cursor: not-allowed;
}

.generate-btn:not(:disabled):hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

.result-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-card textarea {
    background: #f5f8ff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    min-height: 320px;
    padding: 18px;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.copy-btn {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(47, 107, 255, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.copy-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

.copy-feedback {
    font-size: 0.85rem;
    color: var(--muted-text);
    min-height: 18px;
}

.copy-feedback.success {
    color: #1a8f4c;
}

.copy-feedback.error {
    color: #c92f2f;
}

.page-footer {
    margin-top: auto;
    padding: 28px 0 40px;
    text-align: center;
    color: var(--hint-text);
    font-size: 0.9rem;
}

.footer-note {
    margin: 0;
}

@media (max-width: 768px) {
    .form-section,
    .result-section {
        padding: 22px;
    }

    .result-card textarea {
        min-height: 260px;
    }

    .dialogue-language {
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .main-content {
        width: min(640px, 94vw);
    }

    .field-grid {
        grid-template-columns: 1fr;
    }
}
