/**
 * 狐狸云公共样式库 v3.0
 * 包含：公共组件、暗黑模式、骨架屏、按钮反馈、页面过渡、表单样式、代码高亮、灯箱、粒子等
 * 新增：商城优化、帖子优化、用户中心优化、通知优化、登录优化、首页优化相关样式
 */

/* ============================================
   1. 基础变量与重置
   ============================================ */
:root {
    --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #ec4899 50%, #d946ef 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 暗黑模式变量 */
.dark {
    --glass-bg: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(71, 85, 105, 0.5);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* 基础过渡 */
* {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* ============================================
   2. 公共组件样式
   ============================================ */

/* 玻璃态卡片 */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
}

/* 悬浮抬起效果 */
.hover-lift {
    transition: all var(--transition-bounce);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.15);
}

/* 渐变文字 */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 章节标题 */
.section-title {
    position: relative;
    padding-left: 16px;
    font-size: 1.25rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* ============================================
   3. 卡片组件增强
   ============================================ */

/* 帖子卡片 */
.post-card {
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(14, 165, 233, 0.2);
}

/* 商品卡片 */
.product-card {
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(14, 165, 233, 0.2);
}

.product-card:hover .price-tag {
    transform: scale(1.1);
}

/* 统计卡片 */
.stat-card {
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transition: transform 0.5s;
}

.stat-card:hover::after {
    transform: translate(-20%, 20%);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* ============================================
   4. 分类标签
   ============================================ */
.category-tag {
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.category-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.category-tag:hover::before {
    left: 100%;
}

.category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ============================================
   5. 骨架屏动画
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.dark .skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-title { height: 20px; margin-bottom: 8px; }
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text-short { height: 16px; width: 60%; margin-bottom: 8px; }
.skeleton-image { height: 200px; border-radius: 12px; }
.skeleton-button { height: 36px; border-radius: 8px; }
.skeleton-card { padding: 20px; background: rgba(255,255,255,0.5); border-radius: 16px; }

/* ============================================
   6. Toast 提示样式
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-info { border-left: 4px solid #0ea5e9; }

/* ============================================
   7. 页面加载进度条
   ============================================ */
#page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4, #14b8a6);
    z-index: 99999;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

#page-progress-bar.complete {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ============================================
   8. 回到顶部按钮
   ============================================ */
#back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
    z-index: 1000;
    border: none;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.5);
}

/* ============================================
   9. 图片放大镜
   ============================================ */
.image-zoom-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.image-zoom-container img {
    transition: transform 0.3s ease;
}

.image-zoom-container:hover img {
    transform: scale(1.5);
}

.image-zoom-lens {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 2px solid #0ea5e9;
    border-radius: 50%;
    background-repeat: no-repeat;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

/* ============================================
   10. 快速购买弹窗
   ============================================ */
.quick-buy-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-buy-modal.show {
    opacity: 1;
    visibility: visible;
}

.quick-buy-modal .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.quick-buy-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.quick-buy-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* ============================================
   11. 商品收藏按钮
   ============================================ */
.favorite-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #ef4444;
    animation: heartbeat 0.6s ease;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
}

/* ============================================
   12. 订单状态时间线
   ============================================ */
.order-timeline {
    position: relative;
    padding-left: 30px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #cbd5e1;
}

.timeline-item.active::before {
    background: #0ea5e9;
    box-shadow: 0 0 0 2px #0ea5e9, 0 0 10px rgba(14, 165, 233, 0.5);
}

.timeline-item.completed::before {
    background: #10b981;
    box-shadow: 0 0 0 2px #10b981;
}

/* ============================================
   13. 商品评分
   ============================================ */
.star-rating {
    display: inline-flex;
    gap: 2px;
}

.star-rating .star {
    color: #fbbf24;
    transition: transform 0.2s ease;
}

.star-rating .star.empty {
    color: #d1d5db;
}

.star-rating .star:hover {
    transform: scale(1.2);
}

/* ============================================
   14. 评论楼中楼
   ============================================ */
.comment-nested {
    margin-left: 48px;
    padding-left: 16px;
    border-left: 2px solid #e2e8f0;
}

.comment-reply-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.comment-item:hover .comment-reply-btn {
    opacity: 1;
}

/* ============================================
   15. 帖子目录导航
   ============================================ */
.post-toc {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.post-toc::-webkit-scrollbar {
    width: 4px;
}

.post-toc::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.toc-item {
    padding: 8px 12px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.toc-item:hover {
    background: #f1f5f9;
    border-left-color: #0ea5e9;
}

.toc-item.active {
    background: #e0f2fe;
    border-left-color: #0ea5e9;
    color: #0ea5e9;
}

/* ============================================
   16. 帖子预览卡片
   ============================================ */
.post-preview-card {
    position: absolute;
    z-index: 100;
    width: 320px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.post-preview-card.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   17. 签到日历
   ============================================ */
.sign-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: #f1f5f9;
}

.calendar-day.signed {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    border: 2px solid #0ea5e9;
    font-weight: 600;
}

.calendar-day.other-month {
    color: #cbd5e1;
}

/* ============================================
   18. 签到成功动画
   ============================================ */
.sign-success-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sign-success-modal.show {
    opacity: 1;
    visibility: visible;
}

.sign-success-content {
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.coin-earned {
    animation: coinDrop 0.6s ease-out;
}

@keyframes coinDrop {
    0% { transform: translateY(-50px); opacity: 0; }
    60% { transform: translateY(10px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* ============================================
   19. 成就展示墙
   ============================================ */
.achievement-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
}

.achievement-badge {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement-badge:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.achievement-badge.earned {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

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

.achievement-badge .badge-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.achievement-badge .badge-name {
    font-size: 10px;
    text-align: center;
    color: #64748b;
}

/* ============================================
   20. 账号安全评分
   ============================================ */
.security-score {
    position: relative;
    width: 120px;
    height: 120px;
}

.security-score .score-ring {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
}

.security-score .score-bg {
    stroke: #e2e8f0;
}

.security-score .score-fill {
    stroke: #10b981;
    transition: stroke-dashoffset 1s ease;
}

.security-score .score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.security-score .score-value {
    font-size: 32px;
    font-weight: 700;
    color: #10b981;
}

.security-score .score-label {
    font-size: 12px;
    color: #64748b;
}

/* ============================================
   21. 快捷操作面板
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    border-radius: 16px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

.quick-action-btn .action-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.quick-action-btn .action-label {
    font-size: 12px;
    color: #64748b;
}

/* ============================================
   22. 访客记录
   ============================================ */
.visitor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.visitor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.visitor-avatar:hover {
    transform: scale(1.1);
    z-index: 1;
}

/* ============================================
   23. 消息气泡预览
   ============================================ */
.message-preview {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 280px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.message-preview.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.message-preview::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

/* ============================================
   24. 未读消息红点
   ============================================ */
.unread-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ============================================
   25. 登录背景动画
   ============================================ */
.login-bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.login-bg-animation .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   26. 密码显示/隐藏
   ============================================ */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #0ea5e9;
}

/* ============================================
   27. 热帖榜
   ============================================ */
.hot-posts-list {
    counter-reset: hot-counter;
}

.hot-post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    counter-increment: hot-counter;
}

.hot-post-item::before {
    content: counter(hot-counter);
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #64748b;
}

.hot-post-item:nth-child(1)::before {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.hot-post-item:nth-child(2)::before {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.hot-post-item:nth-child(3)::before {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

.hot-post-item:hover {
    background: #f1f5f9;
}

/* ============================================
   28. 新用户引导
   ============================================ */
.guide-tooltip {
    position: absolute;
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 280px;
    z-index: 10000;
    animation: guidePop 0.3s ease;
}

.guide-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.guide-tooltip.arrow-bottom::before {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
}

.guide-tooltip.arrow-top::before {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}

@keyframes guidePop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
}

.guide-highlight {
    position: relative;
    z-index: 10000;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    border-radius: 8px;
}

/* ============================================
   29. 在线人数
   ============================================ */
.online-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 20px;
    font-size: 14px;
}

.online-counter .online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ============================================
   30. 图片懒加载
   ============================================ */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

.lazy-image-placeholder {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   31. 全局搜索
   ============================================ */
.global-search-container {
    position: relative;
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.global-search-results.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background: #f1f5f9;
}

.search-result-item .result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0ea5e9;
}

/* ============================================
   32. 无限滚动加载
   ============================================ */
.infinite-scroll-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 8px;
}

.infinite-scroll-loader .dot {
    width: 8px;
    height: 8px;
    background: #0ea5e9;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.infinite-scroll-loader .dot:nth-child(1) { animation-delay: -0.32s; }
.infinite-scroll-loader .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================
   33. 表情选择器
   ============================================ */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.emoji-picker.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-item:hover {
    background: #f1f5f9;
    transform: scale(1.2);
}

/* ============================================
   34. 移动端底部导航
   ============================================ */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 1000;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 4px 12px;
        color: #64748b;
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .mobile-nav-item.active {
        color: #0ea5e9;
    }
    
    .mobile-nav-item .nav-icon {
        font-size: 24px;
    }
    
    .mobile-nav-item .nav-label {
        font-size: 10px;
    }
    
    /* 为页面底部留出空间 */
    body {
        padding-bottom: 80px;
    }
    
    /* 隐藏桌面端导航 */
    .desktop-nav {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* ============================================
   35. 互动音效开关
   ============================================ */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.sound-toggle.muted {
    color: #94a3b8;
}

/* ============================================
   36. @提及高亮和跳转
   ============================================ */
.mention-link {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mention-link:hover {
    text-decoration: underline;
}

.mention-highlight {
    background: #fef3c7;
    padding: 2px 4px;
    border-radius: 4px;
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0% { background: #fbbf24; }
    100% { background: #fef3c7; }
}

/* ============================================
   37. 表单增强样式
   ============================================ */
.form-input-enhanced {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.form-input-enhanced:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.form-input-enhanced.is-invalid {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

.form-input-enhanced.is-valid {
    border-color: #10b981;
}

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

/* ============================================
   38. 按钮增强样式
   ============================================ */
.btn-primary-enhanced {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.4);
}

.btn-primary-enhanced:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================
   39. 评分筛选器
   ============================================ */
.rating-filter {
    display: flex;
    gap: 8px;
}

.rating-filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-filter-btn:hover {
    background: #e2e8f0;
}

.rating-filter-btn.active {
    background: #0ea5e9;
    color: white;
}

/* ============================================
   40. 评论排序切换
   ============================================ */
.sort-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 4px;
}

.sort-toggle-btn {
    padding: 6px 16px;
    border-radius: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-toggle-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   41. 动画工具类
   ============================================ */
.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.5s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* 延迟动画 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   42. 响应式工具
   ============================================ */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievement-wall {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .global-search-results {
        position: fixed;
        top: 70px;
        left: 16px;
        right: 16px;
        max-height: 60vh;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .hide-tablet { display: none !important; }
}

@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}
