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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

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

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-selector select {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

main {
    display: grid;
    gap: 40px;
    margin-bottom: 60px;
}

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

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

.control-group label {
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input[type="range"]:focus {
    outline: none;
    border-color: #6366f1;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

.color-text {
    flex: 1;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

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

.preview-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1f2937;
}

.preview-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.code-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.code-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
}

.copy-button {
    padding: 10px 24px;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background-color: #4f46e5;
    transform: translateY(-1px);
}

.copy-button.copied {
    background-color: #10b981;
}

.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 24px;
    background-color: #f3f4f6;
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #1f2937;
    color: white;
}

.code-content {
    background-color: #1f2937;
    border-radius: 8px;
    overflow: hidden;
}

.code-block {
    display: none;
    padding: 20px;
    overflow-x: auto;
    color: #e5e7eb;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-block.active {
    display: block;
}

.examples-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.examples-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1f2937;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.example-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.example-item:hover {
    transform: translateY(-5px);
}

.example-preview {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.example-item:hover .example-preview {
    border-color: #6366f1;
}

.example-name {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
    
    .controls-section {
        grid-template-columns: 1fr;
    }
    
    .code-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .copy-button {
        width: 100%;
    }
}