body {
    font-family: Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1, h2 {
    color: #333;
    text-align: center;
}

.section-title {
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* Scene Input Section */
.scene-input-container {
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

.scene-textarea {
    width: 90%;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 16px;
    resize: vertical;
}

.generate-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-btn:hover {
    background-color: #45a049;
}

.generate-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.loading-indicator {
    display: none;
    margin-left: 10px;
    color: #666;
}

/* Vocabulary cards */
.vocabulary-container {
    display: flex;
    flex-wrap: wrap; /* 允許換行 */
    width: 100%;
    gap: 10px; /* 元素間距 */
    box-sizing: border-box;
}

.vocab-card {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
    transition: transform 0.2s;
    flex: 0 0 calc(50% - 5px); /* 每行2個，減去間距 (10px / 2) */
    max-width: calc(50% - 5px); /* 限制最大寬度，防止拉伸 */
    text-align: center;
    padding: 20px;
    box-sizing: border-box; /* 確保內邊距不影響寬度 */
}

.vocab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.vocab-term {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.vocab-transliteration {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.vocab-translation {
    font-size: 16px;
    color: #444;
}

/* Speaker Icon Button Styles */
.speaker-btn {
    background: none;
    border: none;
    color: #4CAF50;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    margin-top: 10px;
    padding: 5px 10px;
    display: inline-block;
}

.speaker-btn:hover {
    background: none;
    color: #45a049;
    transform: scale(1.1);
}

.speaker-btn.playing {
    background: none;
    color: #ff4500;
    animation: pulse 1s infinite;
}

.speaker-btn.loading {
    background: none;
    animation: spin 1s infinite linear;
}

.speaker-btn:disabled {
    background: none;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Phrases */
.phrase-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.phrase-text {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.phrase-transliteration {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.phrase-translation {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
    font-style: italic;
}

.word {
    display: inline-block;
    transition: background-color 0.1s ease;
}

.word.active {
    background-color: #ffff99;
}

button {
    padding: 8px 15px;
    margin-right: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.record-btn.recording {
    background-color: #ff4500;
}

.play-recording-btn {
    background-color: #2196F3;
}

.play-recording-btn:hover {
    background-color: #0b7dda;
}

.recording-status {
    color: #ff4500;
    font-weight: bold;
    margin-left: 10px;
}

#content-container {
    transition: opacity 0.3s ease-in-out;
}

.status-message {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}