* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.api-key-help {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    line-height: 1.5;
}

.api-key-help a {
    color: #667eea;
    text-decoration: none;
}

.api-key-help a:hover {
    text-decoration: underline;
}

.checkbox-group {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 13px;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    font-size: 12px;
    color: #856404;
}

.help-section {
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

details {
    cursor: pointer;
}

details summary {
    padding: 15px 20px;
    background: #e9ecef;
    font-weight: 600;
    color: #495057;
    user-select: none;
    transition: background 0.3s;
}

details summary:hover {
    background: #dee2e6;
}

details[open] summary {
    background: #667eea;
    color: white;
}

.help-content {
    padding: 20px;
}

.help-content h4 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-content ol li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.help-content a {
    color: #667eea;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #c33;
    display: none;
}

.error.active {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-steps {
    margin-top: 30px;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s;
}

.step.active {
    background: #e3f2fd;
}

.step.completed {
    background: #e8f5e9;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ccc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.step.active .step-number {
    background: #2196f3;
}

.step.completed .step-number {
    background: #4caf50;
}

.step-text {
    color: #666;
    font-size: 14px;
}

.step.active .step-text {
    color: #1976d2;
    font-weight: 600;
}

.step.completed .step-text {
    color: #2e7d32;
}

.results {
    display: none;
}

.results.active {
    display: block;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    min-height: 60px;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    flex: 0 0 200px;
    padding: 20px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.result-value {
    flex: 1;
    padding: 20px;
    color: #555;
    line-height: 1.8;
}

.feature-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.feature-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.competitor-detail-table {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.competitor-detail-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.competitor-detail-row:last-child {
    border-bottom: none;
}

.competitor-detail-label {
    flex: 0 0 150px;
    padding: 15px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.competitor-detail-value {
    flex: 1;
    padding: 15px;
    color: #555;
    line-height: 1.8;
}

.competitor-detail-value a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.competitor-detail-value a:hover {
    text-decoration: underline;
}

.competitor-detail-value ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.competitor-detail-value ul li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.competitor-detail-value ul li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 150px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .card {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .result-row {
        flex-direction: column;
    }
    
    .result-label {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .competitor-detail-row {
        flex-direction: column;
    }
    
    .competitor-detail-label {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .export-buttons {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }
}
