* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    padding: 0;
    font-size: 18px;
}

.header {
    background-color: #fff;
    padding: 12px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.novel-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.chapter-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a73e8;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.nav-link {
    display: inline-block;
    padding: 9px 18px; /* 增大按钮尺寸 */
    background-color: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 6px; /* 稍微增加圆角 */
    font-size: 1.1rem; /* 增大字体 */
}

.nav-link.disabled {
    background-color: #ccc;
    pointer-events: none;
}

.content {
    background-color: #fff;
    font-size: 1.4rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    letter-spacing: 1px;
}

.chapter-content {
    padding: 20px 15px;
    line-height: 1.8;
}

.translate-section {
    padding: 20px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: none;
}

.translated-content {
    line-height: 1.8;
}

.translate-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 5px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.translate-btn:hover {
    background-color: #45a049;
}

.dict-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 10px;
    border-radius: 4px;
    max-width: 300px;
    z-index: 1000;
    display: none;
    font-size: 0.9rem;
}

.dict-word-head {
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffcc00;
}

.dict-translation {
    line-height: 1.5;
}

.add-vocab-btn {
    margin-top: 8px;
    padding: 4px 10px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.add-vocab-btn:hover {
    background: #e68900;
}

.dict-word {
    cursor: pointer;
    color: #1a73e8;
    border-bottom: 1px dashed #1a73e8;
}
.dict-word:hover {
    color: #0d62c9;
    background: #e8f0fe;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.directory-link {
    padding: 9px 18px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.1rem;
}

/* 新增：语法题区域样式 */
.grammar-section {
    background-color: #fff;
    padding: 20px 15px;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.grammar-section h3 {
    margin-bottom: 15px;
    color: #1a73e8;
}

.question-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fafafa;
}

.question-item.correct {
    border-color: #4CAF50;
    background-color: #f1f8e9;
}

.question-item.incorrect {
    border-color: #f44336;
    background-color: #ffebee;
}

.options div {
    margin: 8px 0;
}

#submitAnswersBtn, #showExplanationBtn {
    padding: 10px 20px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 10px;
}

#submitAnswersBtn:hover, #showExplanationBtn:hover {
    background-color: #0d62c9;
}