* {
    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: flex-start;
    gap: 10px;
}

#settings-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;
}

#settings-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

#settings-btn:active {
    background: #e8e8e8;
}

#header-content {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    color: #ccc;
    margin: 0 6px;
}

.progress {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.book-select {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    font-family: inherit;
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 120px;
}

.lesson-select {
    font-size: 15px;
    color: #0066cc;
    font-weight: 500;
    font-family: inherit;
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 200px;
}

.book-select:hover, .lesson-select:hover {
    border-color: #999;
}

.book-select:focus, .lesson-select:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.book-select option, .lesson-select option {
    padding: 8px;
    color: #333;
}

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

#chinese-text {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    max-width: 1200px;
    line-height: 1.6;
    color: #333;
}

#english-text {
    font-size: 2rem;
    text-align: center;
    max-width: 1200px;
    line-height: 1.6;
    margin-top: 30px;
    color: #0066cc;
    display: none;
}

#help-btn {
    padding: 0;
    background: none;
    color: #666;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

#help-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

#help-btn:hover {
    color: #333;
}

#help-btn:active {
    color: #000;
}

.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;
    white-space: nowrap;
    overflow: hidden;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.lesson-item:hover {
    background-color: #f0f7ff;
}

.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;
}

.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;
}
