/* =========================================================
   英语学习平台 - 掌握度状态与即时激励动效样式 (mastery.css)
   ========================================================= */

.mastery-badge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0 10px;
}

.mastery-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(241, 245, 249, 0.9);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.mastery-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.tag-new {
    background: #e0f2fe;
    color: #0369a1;
}

.tag-progress {
    background: #fef3c7;
    color: #b45309;
}

.tag-sprint {
    background: #ffedd5;
    color: #c2410c;
    animation: pulseSprint 1.5s infinite;
}

.tag-mastered {
    background: #dcfce7;
    color: #15803d;
}

.tag-retry {
    background: #fee2e2;
    color: #b91c1c;
}

.tag-relapse {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.mastery-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.star-item {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-empty {
    color: #cbd5e1;
}

.star-filled {
    color: #f59e0b;
}

.star-pop {
    animation: starPopGlow 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes starPopGlow {
    0% { transform: scale(0.6); color: #cbd5e1; }
    50% { transform: scale(1.55); color: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9)); }
    100% { transform: scale(1); color: #f59e0b; filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.5)); }
}

.stars-burst {
    animation: starsBurst 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes starsBurst {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); filter: drop-shadow(0 0 8px #f59e0b); }
    100% { transform: scale(1); }
}

.badge-shake-loss {
    animation: badgeShake 0.38s ease-in-out;
}

@keyframes badgeShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.star-loss {
    animation: starLoss 0.28s ease forwards;
}

@keyframes starLoss {
    0% { transform: scale(1); color: #f59e0b; }
    40% { transform: scale(1.15); color: #ef4444; }
    100% { transform: scale(0.9); color: #cbd5e1; }
}

@keyframes pulseSprint {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 即时祝贺 Toast 弹窗 */
.mastery-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 99999;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 18px;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5), 0 8px 10px -6px rgba(79, 70, 229, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    max-width: 90vw;
}

.mastery-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mastery-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mastery-toast-icon {
    font-size: 1.8rem;
    animation: bounce 0.6s infinite alternate;
}

.mastery-toast-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.mastery-toast-sub {
    font-size: 0.8rem;
    opacity: 0.92;
    margin-top: 2px;
}

/* 任务达成悬浮 Toast 弹窗 (位于屏幕中下部，与顶部掌握 Toast 工位分离) */
.task-completed-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 99998;
    background: linear-gradient(135deg, #78350f 0%, #b45309 60%, #d97706 100%);
    border: 2px solid #fde68a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.5), 0 0 16px rgba(253, 230, 138, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    max-width: 90vw;
    white-space: nowrap;
}
.task-completed-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.task-completed-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-completed-icon {
    font-size: 1.6rem;
    animation: bounce 0.6s infinite alternate;
}
.task-completed-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: #fef08a;
}
.task-completed-sub {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1px;
}
.task-completed-points {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    margin-left: 6px;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

/* 连击 (Combo) 阶梯动效体系 */
.combo-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.82rem; font-weight: 800; padding: 3px 10px; border-radius: 20px;
    user-select: none; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.combo-hidden { display: none !important; }
.combo-cool { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #93c5fd; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2); }
.combo-great { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; border: 1.5px solid #f59e0b; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.combo-perfect { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; border: 1.5px solid #8b5cf6; box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4); animation: combo-pulse 1.2s infinite; }
.combo-fever { background: linear-gradient(135deg, #f43f5e, #fb7185, #f59e0b); color: #ffffff; border: 1.5px solid #ffffff; box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5); animation: combo-fever 1s infinite alternate; }
.combo-pop { animation: combo-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes combo-pop { 0% { transform: scale(0.7); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes combo-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes combo-fever { 0% { transform: scale(1) rotate(-1.5deg); filter: hue-rotate(0deg); } 100% { transform: scale(1.12) rotate(1.5deg); filter: hue-rotate(60deg); } }

/* 结算战报攻克错题勋章区 */
.conquered-section { margin: 14px 0 18px; text-align: left; background: var(--page-bg); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.conquered-title { font-size: 0.82rem; font-weight: 700; color: var(--success); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.conquered-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 84px; overflow-y: auto; }
.conquered-chip { display: inline-flex; align-items: center; gap: 4px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 12px; padding: 2px 8px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: transform 0.1s; }
.conquered-chip:active { transform: scale(0.95); background: #d1fae5; }
.chip-audio { font-size: 0.75rem; opacity: 0.8; }
