/* 词汇模块样式 */

/* 页面标题 */
.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: moveBackground 25s ease-in-out infinite;
}

@keyframes moveBackground {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.page-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: pulse 8s ease-in-out infinite;
}

.page-header h2 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    color: white;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #FFFFFF, rgba(255,255,255,0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.page-header p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* 词汇模块导航 */
.vocab-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 40px 0;
    margin-bottom: 80px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .vocab-nav {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vocab-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-primary);
}

.vocab-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.vocab-tab {
    padding: 16px 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .vocab-tab {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vocab-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: 12px;
}

.vocab-tab:hover::before {
    left: 0;
}

.vocab-tab:hover {
    color: white;
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.vocab-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.vocab-tab.active::before {
    left: 0;
}

/* 词汇内容区域 */
.vocab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.vocab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主题分类 */
.theme-categories {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.theme-category h4 {
    font-size: 1.8rem;
    margin-bottom: 32px;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
}

.theme-category h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.word-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 32px;
}

.word-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.9));
}

[data-theme="dark"] .word-card {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.9));
}

.word-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

[data-theme="dark"] .word-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.word-info {
    flex: 1;
    margin-right: 20px;
}

.word-info h5 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.word-type {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 16px;
    background: rgba(59, 130, 246, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

[data-theme="dark"] .word-type {
    background: rgba(96, 165, 250, 0.2);
}

.word-definition {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 16px;
    font-style: italic;
    line-height: 1.6;
}

.word-example {
    font-size: 1rem;
    color: var(--text-light);
    background: rgba(243, 244, 246, 0.8);
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    line-height: 1.5;
}

[data-theme="dark"] .word-example {
    background: rgba(31, 41, 55, 0.8);
}

.word-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.word-actions button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .word-actions button {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.word-actions button:hover {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.word-actions button:active {
    transform: scale(0.95);
}

/* 词性分类 */
.pos-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.pos-category {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pos-category:hover {
    box-shadow: var(--shadow-hover);
}

.pos-category h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.word-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background-color: var(--bg-light);
    border-radius: 8px;
    transition: var(--transition);
}

.word-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.word-item:hover .word-meaning {
    color: white;
}

.word {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
}

.word-type {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

.word-meaning {
    font-size: 1rem;
    color: var(--text-light);
    flex: 1;
}

.word-item .play-audio {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.word-item:hover .play-audio {
    color: white;
}

/* 记忆卡片 */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.flashcard {
    width: 100%;
    max-width: 500px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 40px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.flashcard-front h4 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.flashcard-hint {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.flashcard-back h4 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.flashcard-type {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 15px;
}

.flashcard-definition {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-style: italic;
}

.flashcard-example {
    font-size: 0.9rem;
    color: var(--text-light);
    background-color: var(--bg-light);
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.flashcard-back .play-audio {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.flashcard-back .play-audio:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.flashcard-controls {
    display: flex;
    gap: 20px;
}

.prev-card,
.next-card {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.prev-card:hover,
.next-card:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.flashcard-status {
    font-size: 1rem;
    color: var(--text-light);
}

/* 拼写练习 */
.spelling-exercise {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.exercise-card {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.exercise-card:hover {
    box-shadow: var(--shadow-hover);
}

.exercise-card h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.exercise-audio {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.exercise-audio:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.spelling-input {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.spelling-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.spelling-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.check-spelling {
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.check-spelling:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.spelling-feedback {
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
}

.spelling-feedback.correct {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--secondary-color);
}

.spelling-feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--accent-color);
}

/* 词义辨析 */
.discrimination-exercise {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.discrimination-exercise .exercise-card h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.sentence {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.option {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.option.correct {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.option.incorrect {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.feedback {
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
}

.feedback.correct {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--secondary-color);
}

.feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--accent-color);
}

/* 词汇进度 */
.vocab-progress {
    margin-top: 60px;
    margin-bottom: 40px;
}

.vocab-progress h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .vocab-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .vocab-tab {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .word-cards,
    .pos-categories {
        grid-template-columns: 1fr;
    }
    
    .word-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .word-actions {
        flex-direction: row;
    }
    
    .flashcard-container {
        padding: 20px;
    }
    
    .flashcard {
        max-width: 100%;
        height: 250px;
    }
    
    .flashcard-front h4 {
        font-size: 1.8rem;
    }
    
    .flashcard-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .prev-card,
    .next-card {
        width: 100%;
        justify-content: center;
    }
    
    .spelling-input {
        flex-direction: column;
    }
    
    .options {
        flex-direction: column;
    }
    
    .option {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .word-card,
    .pos-category,
    .exercise-card {
        padding: 20px;
    }
    
    .word-info h5 {
        font-size: 1.2rem;
    }
    
    .flashcard {
        height: 200px;
    }
    
    .flashcard-front h4 {
        font-size: 1.5rem;
    }
    
    .flashcard-back h4 {
        font-size: 1.3rem;
    }
    
    .exercise-audio {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}