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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 15px;
    font-size: 13px;
    color: #666;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

#lesson-select-btn, #word-count-btn, #wrong-words-btn, #recent-results-btn {
    padding: 6px 12px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#lesson-select-btn:hover, #word-count-btn:hover, #wrong-words-btn:hover, #recent-results-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

#lesson-select-btn:active, #word-count-btn:active, #wrong-words-btn:active, #recent-results-btn:active {
    background: #e8e8e8;
}

#quiz-status {
    font-size: 14px;
    color: #666;
}

#score {
    font-size: 14px;
    color: #0066cc;
    font-weight: 600;
}

.separator {
    color: #ccc;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
}

.quiz-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.quiz-chinese {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 40px;
    color: #333;
    line-height: 1.4;
}

.quiz-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    text-align: center;
}

.quiz-input.hidden {
    display: none;
}

.quiz-english {
    font-size: 2rem;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 20px;
    letter-spacing: 2px;
    filter: blur(8px);
}

.quiz-english.hidden {
    display: none;
}

.quiz-english.reveal {
    filter: blur(0);
    transition: filter 0.3s ease;
}

.quiz-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.quiz-input:disabled {
    background-color: #f9f9f9;
    color: #999;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.book-section {
    margin-bottom: 20px;
}

.book-section:last-child {
    margin-bottom: 0;
}

.book-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.lesson-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
}

.lesson-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 10px;
}

.lesson-item label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    flex: 1;
}

.word-count-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.word-count-btn {
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-count-btn:hover {
    border-color: #999;
    background: #f9f9f9;
}

.word-count-btn.selected {
    border-color: #0066cc;
    background: #f0f7ff;
    color: #0066cc;
}

.result-summary {
    margin-bottom: 20px;
}

.result-score {
    font-size: 24px;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 10px;
}

.result-stats {
    font-size: 15px;
    color: #666;
}

.result-wrong-list {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.wrong-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.wrong-item:last-child {
    border-bottom: none;
}

.wrong-word {
    font-size: 16px;
    font-weight: 600;
    color: #d32f2f;
    margin-bottom: 4px;
}

.wrong-meaning {
    font-size: 14px;
    color: #666;
}

.check-content {
    text-align: center;
}

.check-correct {
    font-size: 18px;
    color: #4caf50;
    margin-bottom: 10px;
}

.check-wrong {
    font-size: 18px;
    color: #d32f2f;
    margin-bottom: 10px;
}

.check-correct-answer {
    font-size: 16px;
    color: #666;
}

.correct-answer {
    font-weight: 600;
    color: #0066cc;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.modal-btn-cancel:hover {
    background: #f5f5f5;
}

.modal-btn-save {
    background: #0066cc;
    color: #fff;
    border: none;
}

.modal-btn-save:hover {
    background: #0055aa;
}

.wrong-words-list {
    max-height: 400px;
    overflow-y: auto;
}

.recent-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.recent-test-result {
    border-bottom: 1px solid #f0f0f0;
}

.recent-test-result:last-child {
    border-bottom: none;
}

.test-summary {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.test-summary:hover {
    background-color: #f9f9f9;
}

.test-time {
    font-size: 14px;
    color: #666;
    flex: 1;
}

.test-score {
    font-size: 15px;
    font-weight: 600;
    color: #0066cc;
}

.test-stats {
    font-size: 13px;
    color: #999;
}

.test-details {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.test-word-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.test-word-item:last-child {
    border-bottom: none;
}

.test-word {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.test-spelling {
    font-size: 13px;
    color: #666;
    margin-right: 10px;
}

.test-status {
    font-size: 14px;
}

.test-word-item.correct .test-status {
    color: #4caf50;
}

.test-word-item.wrong .test-status {
    color: #d32f2f;
}