.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

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

#question {
    font-size: 24px;
    margin: 20px 0;
    text-align: center;
}

input[type="text"] {
    padding: 10px;
    font-size: 18px;
    margin: 10px 0;
}

button {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 10px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

#progress {
    text-align: center;
    margin-bottom: 20px;
}

#review-list {
    margin-top: 20px;
}

.review-item {
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.correct {
    color: #4CAF50;
}

.incorrect {
    color: #f44336;
}

.quiz-settings {
    max-width: 500px;
    margin: 0 auto 20px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.setting-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.setting-group label:first-child {
    width: 100px;
    margin-right: 10px;
}

.setting-group select {
    width: 150px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 15px;
}

.setting-group input[type="number"] {
    width: 100px;
}

.setting-group span {
    margin: 0 10px;
}

.quiz-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

#quiz-mode {
    color: #4CAF50;
    font-weight: bold;
}

.question-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.question-number {
    font-weight: bold;
    margin-bottom: 10px;
    color: #666;
}

.question-text {
    font-size: 20px;
    margin-bottom: 10px;
}

.answer-input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.result-message {
    margin-top: 5px;
    font-weight: bold;
}

.result-message .correct {
    color: #4CAF50;
}

.result-message .incorrect {
    color: #f44336;
}

.score-info {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

#accuracy {
    color: #4CAF50;
    font-weight: bold;
}

.speech-checkbox {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 30px;
}

/* 隱藏原始的 checkbox */
.speech-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* 自定義 checkbox 的外觀 */
.speech-checkbox::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    background-color: white;
    transition: all 0.2s ease;
}

/* 勾選狀態的樣式 */
.speech-checkbox input[type="checkbox"]:checked + span::before {
    content: '✓';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #4CAF50;
    font-size: 16px;
    font-weight: bold;
}

/* hover 效果 */
.speech-checkbox:hover::before {
    background-color: #f0f0f0;
}

.speech-icon {
    cursor: pointer;
    font-size: 24px;
    color: #4CAF50;
    margin-left: 10px;
}

.speech-icon:hover {
    opacity: 0.8;
}

/* 隱藏文字但顯示喇叭的樣式 */
.question-text.speech-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    gap: 10px;
}

.question-text.speech-mode span {
    display: none;
}

.speech-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speech-rate {
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.speech-rate:focus {
    outline: none;
    border-color: #4CAF50;
}

.nav-links {
    text-align: right;
    margin-bottom: 20px;
}

.nav-links a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.nav-links a:hover {
    text-decoration: underline;
}

.virtual-keyboard {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 5px;
}

.keyboard-btn {
    display: inline-block;
    margin: 2px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    user-select: none;
}

.keyboard-btn:hover {
    background: #f0f0f0;
}

.keyboard-toggle {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    margin-left: 10px;
    vertical-align: middle;
}

.keyboard-toggle:hover {
    opacity: 0.8;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.answer-input {
    flex: 1;
}

/* 句子測驗相關樣式 */
.question-container {
    background-color: #f9f9f9;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sentence-line {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 2px;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.5;
    white-space: nowrap;
}

.sentence-input {
    width: 80px;
    padding: 4px 8px;
    margin: 0 2px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    flex-shrink: 0;
    height: 28px;
}

.sentence-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.verb-hint {
    color: #666;
    font-style: italic;
    margin-top: 4px;
    font-size: 0.9em;
    padding-left: 20px;
}

.review-item {
    background-color: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.review-item.correct {
    border-left-color: #4CAF50;
    background-color: #f0f7f0;
}

.review-item.incorrect {
    border-left-color: #f44336;
    background-color: #fdf1f0;
}

.answer {
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
}

.answer.correct {
    color: #4CAF50;
    background-color: #e8f5e9;
}

.answer.incorrect {
    color: #f44336;
    background-color: #ffebee;
}

.correct-answer {
    color: #4CAF50;
    margin-top: 5px;
    font-weight: bold;
} 