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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

.lang-switcher {
    margin-top: 20px;
}

.lang-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.lang-btn:hover {
    background: #2980b9;
}

.lang-btn.active {
    background: #2c3e50;
}

main {
    display: grid;
    gap: 30px;
}

.controls {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

select, input[type="range"], input[type="color"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

select {
    cursor: pointer;
    background: white;
}

input[type="range"] {
    cursor: pointer;
}

input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.preview-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.preview-header h2 {
    color: #2c3e50;
}

.copy-btn, .add-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.copy-btn:hover, .add-btn:hover {
    background: #229954;
}

.preview-area {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

#previewText {
    width: 100%;
    min-height: 200px;
    border: none;
    background: transparent;
    resize: vertical;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
}

.css-output {
    margin-top: 20px;
}

.css-output h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 14px;
}

code {
    font-family: 'Courier New', Courier, monospace;
}

.comparison-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.comparison-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.comparison-area {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    position: relative;
}

.comparison-item h4 {
    color: #34495e;
    margin-bottom: 10px;
}

.comparison-sample {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-btn:hover {
    background: #c0392b;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .controls {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comparison-item {
    animation: fadeIn 0.3s ease-out;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}