/* 词汇卡片组件 */
.word-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.word-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pronunciation-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pronunciation-btn:hover {
    background: #059669;
    transform: scale(1.1);
}

.word-phonetic {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.word-meaning {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.word-example {
    font-style: italic;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent-color);
}

.word-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-small.learned {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-small.review {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

/* 练习题组件 */
.question {
    text-align: center;
    margin-bottom: 2rem;
}

.question-type {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-word {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-btn {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

.option-btn.correct {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    animation: correctAnswer 0.5s ease;
}

.option-btn.incorrect {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
    animation: incorrectAnswer 0.5s ease;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

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

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

.practice-result {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    min-height: 1.5rem;
    font-size: 1.1rem;
}

.practice-result.correct {
    color: var(--success-color);
}

.practice-result.incorrect {
    color: var(--error-color);
}

/* 进度条组件 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* 标签组件 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.25rem;
}

.tag.level-basic {
    background: #dbeafe;
    color: #1e40af;
}

.tag.level-intermediate {
    background: #fef3c7;
    color: #92400e;
}

.tag.level-advanced {
    background: #fce7f3;
    color: #be185d;
}

.tag.category {
    background: #ecfdf5;
    color: #065f46;
}

/* 模态框组件 */
.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: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* 通知组件 */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 350px;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards;
    position: relative;
    border-left: 4px solid var(--primary-color);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-light);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: var(--text-color);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    width: 100%;
    animation: shrink 3s linear forwards;
}

.notification.success .notification-progress {
    background: var(--success-color);
}

.notification.warning .notification-progress {
    background: var(--warning-color);
}

.notification.error .notification-progress {
    background: var(--error-color);
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes slideOut {
    to { transform: translateX(120%); }
}

@keyframes shrink {
    to { width: 0; }
}

/* 卡片翻转组件 */
.flip-card {
    perspective: 1000px;
    width: 100%;
    height: 200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flip-card-front {
    background: white;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.flip-card-back {
    background: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

/* 搜索框组件 */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
}

/* 选项卡组件 */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 成就徽章组件 */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.badge {
    width: 100px;
    text-align: center;
    position: relative;
}

.badge-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 2rem;
    position: relative;
    border: 3px solid var(--border-color);
}

.badge.unlocked .badge-icon {
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 15px rgba(6, 214, 160, 0.3);
}

.badge.locked .badge-icon {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.badge-description {
    font-size: 0.8rem;
    color: var(--text-light);
}

.badge-progress {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* 学习进度组件 */
.progress-container {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-title {
    font-weight: 600;
    color: var(--text-color);
}

.progress-value {
    font-weight: 600;
    color: var(--primary-color);
}

.streak-container {
    display: flex;
    gap: 0.25rem;
    margin: 1rem 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.streak-day {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.streak-day.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.streak-day.today {
    border: 2px solid var(--accent-color);
}

/* 词汇分类组件 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-light);
}