/* 成就徽章墙样式 - 调整配色，用主题色系 */

.achievement-page {
    max-width: 900px;
    width: 100%;
    padding: 20px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin-bottom: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 吉祥物 */
.achievement-mascot {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.mascot-body {
    width: 100%;
    height: 100%;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.mascot-face {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.mascot-eye {
    font-size: 1.5rem;
    animation: blink 3s infinite;
}

.mascot-mouth {
    font-size: 1.2rem;
}

.mascot-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 154, 158, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: glow 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 标题 */
h1.glow-text {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    color: #667eea;
}

.subtitle {
    text-align: center;
    color: #764ba2;
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: bold;
}

.subtitle small {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #5568d3;
    font-weight: normal;
}

/* 进度条 */
.progress-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

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

.progress-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
}

.progress-count {
    font-size: 1rem;
    color: #764ba2;
    font-weight: bold;
}

.progress-bar {
    height: 12px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    text-align: right;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: bold;
}

/* 筛选按钮 */
.filter-section {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: bold;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    color: #667eea;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-weight: bold;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 徽章网格 */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.achievement-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.75) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.achievement-card:hover::before {
    opacity: 1;
    animation: shine 0.6s ease-in-out;
}

@keyframes shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

.achievement-card.unlocked {
    border-color: var(--badge-color);
    border-width: 3px;
}

.achievement-card.locked {
    filter: grayscale(0.4);
    opacity: 0.8;
}

.achievement-card.locked:hover {
    filter: grayscale(0.2);
    opacity: 0.9;
}

.achievement-card.hidden {
    display: none;
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.achievement-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--badge-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.achievement-card.unlocked .achievement-icon {
    animation: glow-icon 2s ease-in-out infinite;
}

@keyframes glow-icon {
    0%, 100% { box-shadow: 0 4px 15px var(--badge-glow); }
    50% { box-shadow: 0 6px 25px var(--badge-glow); }
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 4px;
}

.achievement-rarity {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--rarity-bg);
    color: white;
    font-weight: bold;
}

.achievement-description {
    color: #444;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.achievement-card.locked .achievement-description {
    color: #666;
    font-style: italic;
}

.achievement-condition {
    font-size: 0.8rem;
    color: #555;
    background: rgba(102, 126, 234, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.achievement-date {
    font-size: 0.75rem;
    color: #667eea;
    margin-top: 8px;
    text-align: right;
}

/* 稀有度颜色 */
.achievement-card.common {
    --badge-color: #60a5fa;
    --badge-bg: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    --badge-glow: rgba(96, 165, 250, 0.5);
    --rarity-bg: rgba(96, 165, 250, 0.95);
}

.achievement-card.rare {
    --badge-color: #8b5cf6;
    --badge-bg: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    --badge-glow: rgba(139, 92, 246, 0.5);
    --rarity-bg: rgba(139, 92, 246, 0.95);
}

.achievement-card.epic {
    --badge-color: #ec4899;
    --badge-bg: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
    --badge-glow: rgba(236, 72, 153, 0.5);
    --rarity-bg: rgba(236, 72, 153, 0.95);
}

.achievement-card.legendary {
    --badge-color: #f59e0b;
    --badge-bg: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --badge-glow: rgba(245, 158, 11, 0.5);
    --rarity-bg: rgba(245, 158, 11, 0.95);
}

.achievement-card.legendary.unlocked .achievement-icon {
    animation: legendary-glow 1.5s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 30px rgba(245, 158, 11, 0.7);
        transform: scale(1.05);
    }
}

/* 图例说明 */
.legend-section {
    background: linear-gradient(135deg, rgba(255,255, 255, 0.7) 0%, rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.legend-title {
    font-size: 1rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 16px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 0.9rem;
    font-weight: bold;
}

.legend-badge {
    font-size: 1.2rem;
}

/* 小贴士 */
.tips-section {
    margin-bottom: 24px;
}

.tips-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.tips-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.tips-content {
    flex: 1;
}

.tips-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.tips-text {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 庆祝动画 */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.celebration-overlay.hidden {
    display: none;
}

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

.celebration-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.4s ease;
    border: 3px solid #667eea;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.celebration-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
}

.celebration-badge {
    font-size: 5rem;
    margin-bottom: 24px;
    animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

.celebration-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.celebration-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .achievement-card {
        padding: 16px;
    }

    .achievement-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .achievement-name {
        font-size: 1rem;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
