/* AI 学习社区 - 综合增强功能 */

/* ===== 回到顶部按钮 ===== */
#backToTop {
    position: fixed;
    right: 30px;
    bottom: 80px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    z-index: 9999;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.6);
}

#backToTop svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* ===== AI 智能助手悬浮按钮 ===== */
#aiAssistant {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #00d4ff 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(0, 212, 255, 0.5);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse-ai 2s infinite;
}

@keyframes pulse-ai {
    0%, 100% { box-shadow: 0 4px 25px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 4px 35px rgba(168, 85, 247, 0.6); }
}

#aiAssistant:hover {
    transform: scale(1.1);
}

#aiAssistant svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

#aiAssistant .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #ff4444;
    border-radius: 50%;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI助手弹窗 */
#aiAssistantPanel {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 320px;
    max-height: 400px;
    background: rgba(10, 15, 35, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

#aiAssistantPanel.open {
    display: flex;
}

#aiAssistantPanel .panel-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 14px;
    font-weight: 600;
    color: #00d4ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#aiAssistantPanel .panel-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 13px;
    color: #c0d0e0;
    line-height: 1.6;
}

#aiAssistantPanel .panel-body .msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 8px;
}

#aiAssistantPanel .panel-footer {
    padding: 10px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    gap: 8px;
}

#aiAssistantPanel .panel-footer input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

#aiAssistantPanel .panel-footer button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #00d4ff, #a855f7);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

/* ===== 页面加载动画 ===== */
#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 20, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

#pageLoader.hidden {
    opacity: 0;
    pointer-events: none;
}

#pageLoader .loader-chip {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 图片懒加载占位 ===== */
img.lazy {
    background: linear-gradient(90deg, rgba(20, 30, 50, 0.5) 25%, rgba(30, 40, 60, 0.5) 50%, rgba(20, 30, 50, 0.5) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ===== 消息通知铃铛 ===== */
.notification-bell {
    position: relative;
    display: inline-block;
    margin: 0 8px;
    cursor: pointer;
}

.notification-bell .bell-icon {
    font-size: 18px;
    color: #8fa3bf;
    transition: color 0.3s;
}

.notification-bell:hover .bell-icon {
    color: #00d4ff;
}

.notification-bell .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== 用户等级徽章 ===== */
.user-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.user-badge.admin {
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: #fff;
}

.user-badge.supermod {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.user-badge.mod {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
}

.user-badge.member {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
}


/* ===== 热门标签云 ===== */
.tag-cloud {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.tag-cloud h3 {
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.tag-cloud .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud .tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    color: #8fa3bf;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.tag-cloud .tag:hover {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.tag-cloud .tag.hot {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.15), rgba(255, 107, 107, 0.15));
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
}

.tag-cloud .tag.hot:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: rgba(255, 68, 68, 0.5);
}

/* ===== 帖子分享按钮 ===== */
.post-share {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    padding: 12px;
    background: rgba(15, 20, 40, 0.6);
    border-radius: 10px;
}

.post-share .share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.post-share .share-btn:hover {
    transform: scale(1.15);
}

.post-share .share-btn.wechat {
    background: rgba(7, 193, 96, 0.2);
    color: #07c160;
}

.post-share .share-btn.qq {
    background: rgba(20, 152, 255, 0.2);
    color: #1498ff;
}

.post-share .share-btn.weibo {
    background: rgba(230, 33, 33, 0.2);
    color: #e62121;
}

.post-share .share-btn.link {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

/* ===== 消息通知中心 ===== */
.notification-center {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: rgba(10, 15, 35, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    margin-top: 10px;
}

.notification-center.open {
    display: block;
}

.notification-center .nc-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    font-size: 14px;
    font-weight: 600;
    color: #00d4ff;
}

.notification-center .nc-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    font-size: 13px;
    color: #c0d0e0;
    transition: background 0.2s;
}

.notification-center .nc-item:hover {
    background: rgba(0, 212, 255, 0.05);
}

.notification-center .nc-item .nc-title {
    color: #e0ecff;
    font-weight: 500;
    margin-bottom: 4px;
}

.notification-center .nc-item .nc-time {
    color: #5a6f8a;
    font-size: 12px;
    margin-top: 4px;
}

/* ===== 侧边栏热门推荐 ===== */
.hot-posts {
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.hot-posts h3 {
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.hot-posts .hot-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.05);
    font-size: 13px;
}

.hot-posts .hot-item:last-child {
    border-bottom: none;
}

.hot-posts .hot-item a {
    color: #c0d0e0;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.5;
}

.hot-posts .hot-item a:hover {
    color: #00d4ff;
}

.hot-posts .hot-item .rank {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.hot-posts .hot-item .rank.top1 {
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: #fff;
}

.hot-posts .hot-item .rank.top2 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.hot-posts .hot-item .rank.top3 {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: #fff;
}
