* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #2c3e50;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #1a365d;
    margin-bottom: 40px;
    font-size: 2.2em;
    font-weight: 600;
}

/* 颜色图例样式 */
.color-legend {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.color-legend h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* 拼读规律组样式 */
.patterns-container {
    display: grid;
    gap: 30px;
}

.pattern-group {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.pattern-group h2 {
    color: #2b6cb0;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #4299e1;
    padding-bottom: 10px;
}

.pattern-description {
    color: #4a5568;
    margin-bottom: 20px;
    padding: 10px;
    background: #ebf8ff;
    border-radius: 8px;
    font-size: 0.95em;
}

/* 单词列表样式 */
.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.word-item {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.word-content {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.word {
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    min-width: 80px;
    display: inline-block;
}

.word:hover {
    background-color: #ebf8ff;
}

.pattern {
    color: #4299e1;
    font-size: 0.9em;
    padding: 3px 8px;
    background: #ebf8ff;
    border-radius: 4px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.meaning {
    color: #718096;
    margin-left: auto;
    font-size: 0.95em;
}

.unit {
    font-size: 0.85em;
    padding: 4px 8px;
    background: #edf2f7;
    color: #718096;
    position: absolute;
    top: 5px;
    right: 5px;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .word-list {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .pattern-group {
        padding: 20px;
    }

    .word-content {
        padding: 12px;
        flex-wrap: wrap;
    }

    .legend-items {
        gap: 10px;
    }

    .legend-item {
        font-size: 0.9em;
    }
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pattern-group {
    animation: fadeIn 0.5s ease-out;
}

/* 添加工具提示 */
.word {
    position: relative;
}

.word::after {
    content: "点击发音";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.word:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 单词学习页面新增样式 */
.word-count {
    color: #666;
    font-size: 16px;
    font-weight: normal;
    margin-left: 10px;
}

/* 单词卡片样式 */
.word-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4a90e2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.word-english {
    font-size: 32px;
    font-weight: 700;
    color: #4a90e2;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.word-phonetic {
    font-size: 18px;
    color: #6c757d;
    font-family: 'Times New Roman', serif;
    text-align: center;
    padding: 8px 0;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 8px 0;
}

.word-chinese {
    font-size: 22px;
    color: #ff6b6b;
    padding: 12px 0;
    border-bottom: 1px dashed #e9ecef;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.word-example {
    font-size: 16px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.word-status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.status-learning {
    background: #fff3cd;
    color: #856404;
}

.status-learned {
    background: #d4edda;
    color: #155724;
}

.speak-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4a90e2;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speak-btn:hover {
    background: #357abd;
    transform: scale(1.1);
}

.speak-btn-small {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

/* 测验样式 */
.quiz-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.quiz-progress {
    margin-bottom: 20px;
}

.quiz-progress .progress-bar {
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.quiz-translation {
    font-size: 24px;
    color: #ff6b6b;
    margin-bottom: 20px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quiz-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.quiz-word {
    font-size: 28px;
    font-weight: 700;
    color: #4a90e2;
}

.quiz-hint {
    font-size: 18px;
    color: #28a745;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.quiz-input-section {
    margin-bottom: 20px;
}

.quiz-input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

#quiz-answer {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

#quiz-answer:focus {
    outline: none;
    border-color: #4a90e2;
}

.quiz-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quiz-result {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.quiz-result.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quiz-result.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.quiz-controls {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 练习模式样式 */
.practice-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.practice-word {
    text-align: center;
    margin-bottom: 30px;
}

.word-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.practice-word-text {
    font-size: 48px;
    font-weight: 700;
    color: #4a90e2;
    letter-spacing: -1px;
}

.word-phonetic-display {
    text-align: center;
    margin-bottom: 15px;
}

.practice-phonetic-text {
    font-size: 24px;
    color: #6c757d;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
}

.word-translation {
    font-size: 24px;
    color: #ff6b6b;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.practice-progress {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.practice-exit {
    text-align: center;
}

/* 按钮变体 */
button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #333;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-header h2 {
    font-size: 32px;
    color: #4a90e2;
    margin: 0;
}

.detail-phonetic {
    text-align: center;
    margin-bottom: 20px;
}

.phonetic-text {
    font-size: 20px;
    color: #6c757d;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
}

.detail-translation {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-translation p {
    font-size: 20px;
    color: #ff6b6b;
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    flex: 1;
}

.detail-example {
    margin-bottom: 20px;
}

.example-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.example-content p {
    margin: 0;
    flex: 1;
    font-style: italic;
    color: #666;
}

.word-status {
    margin-bottom: 20px;
}

.word-status label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.word-status select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-message i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

.empty-message p {
    font-size: 18px;
    margin: 0;
}

.hidden {
    display: none;
}

/* 选择器样式 */
.textbook-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.textbook-selector select {
    min-width: 200px;
    flex: 1;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.controls {    display: flex;    flex-wrap: wrap;    gap: 15px;    justify-content: center;    align-items: center;}.controls select {    min-width: 150px;} 