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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

.form-group textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    min-height: 200px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea::placeholder {
    color: #a0aec0;
    font-size: 0.9rem;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-stats {
    text-align: right;
    font-size: 0.9rem;
    color: #718096;
    margin-top: 8px;
}

.options-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.generate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-section {
    text-align: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section p {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
}

.result-section {
    text-align: center;
}

.result-section h2 {
    color: #48bb78;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.result-section h2 i {
    margin-right: 10px;
}

.image-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: inline-block;
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn, .regenerate-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn {
    background: #48bb78;
    color: white;
}

.download-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.regenerate-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.regenerate-btn:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.error-section {
    text-align: center;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer i {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main {
        padding: 25px;
    }
    
    .options-group {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn, .regenerate-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.7rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main {
        padding: 20px;
    }
    
    .generate-btn {
        font-size: 1rem;
        padding: 15px 20px;
    }
}