/* リセットとベース */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

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

/* 言語切り替え */
.lang-switcher {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: white;
    color: #667eea;
}

/* セクション共通 */
section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 入力セクション */
.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

#text-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#text-input:focus {
    outline: none;
    border-color: #667eea;
}

/* ボタン */
.primary-btn, .secondary-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

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

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #f0f0f0;
    color: #333;
}

.secondary-btn:hover {
    background: #e0e0e0;
}

.secondary-btn.active {
    background: #667eea;
    color: white;
}

/* プレビューセクション */
.preview-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 20px;
}

ruby {
    position: relative;
    display: inline-block;
    transition: background-color 0.3s ease;
}

ruby.editable {
    cursor: pointer;
}

ruby.editable:hover {
    background-color: #e8eaf6;
    border-radius: 4px;
}

rt {
    font-size: 0.6em;
    color: #666;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.edit-hint {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* 出力セクション */
.output-container {
    position: relative;
}

#html-output {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #5a67d8;
}

.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    animation: slideIn 0.3s ease;
}

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

/* フッター */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .lang-switcher {
        flex-wrap: wrap;
    }
    
    .copy-btn {
        position: static;
        width: 100%;
        margin-top: 10px;
    }
}