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

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

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

header {
    text-align: center;
    color: white;
    padding: 40px 0;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #555;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.config-item input,
.config-item select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #667eea;
}

.fields-section {
    margin-top: 30px;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.field-item {
    display: flex;
    align-items: center;
}

.field-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.field-item label {
    cursor: pointer;
    user-select: none;
}

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

.btn-primary,
.btn-secondary,
.btn-action {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-action {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
}

.btn-action:hover {
    background: #218838;
}

.preview-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.format-tabs {
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 8px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-btn:not(.active):hover {
    background: #e0e0e0;
}

.preview-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    max-height: 500px;
    overflow: auto;
}

.code-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #667eea;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.export-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.info-section ol {
    margin-left: 25px;
    line-height: 1.8;
}

.info-section ol li {
    margin-bottom: 8px;
}

.features {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.features ul {
    list-style: none;
    line-height: 2;
}

.features ul li {
    padding-left: 5px;
}

footer {
    text-align: center;
    color: white;
    padding: 30px 0;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .fields-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .preview-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
    }
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}