/* =========================================================
   site-notifications.css —— 全站右下角 toast 风格消息通知
   与 site-notifications.js 配套使用
   特点：默认不常驻，有消息才滑入，点击/自动消失
   ========================================================= */

/* 屏幕右上/右下角通知容器（固定定位，可拖动） */
#notifyBox {
    position: fixed;
    z-index: 99999;
    right: 24px;
    bottom: 24px;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

#notifyBox.show {
    display: flex;
    pointer-events: auto;
}

/* 拖拽手柄 */
#notifyBox .notify-drag-handle {
    position: absolute;
    top: -8px;
    right: 12px;
    width: 24px;
    height: 16px;
    cursor: move;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.8);
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    user-select: none;
}

#notifyBox:hover .notify-drag-handle {
    opacity: 1;
}

/* 单条通知 toast */
.notify-toast {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    min-width: 280px;
    max-width: 380px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.21, 0.61, 0.35, 1), opacity 0.25s ease;
    cursor: pointer;
    position: relative;
    animation: none;
}

.notify-toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.notify-toast.removing {
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

/* 左侧类型色条 */
.notify-toast .notify-accent {
    width: 4px;
    flex-shrink: 0;
}

.notify-toast[data-type="friend_request"] .notify-accent { background: linear-gradient(180deg, #10B981, #059669); }
.notify-toast[data-type="friend_approved"] .notify-accent { background: linear-gradient(180deg, #3B82F6, #2563EB); }
.notify-toast[data-type="private_message"] .notify-accent { background: linear-gradient(180deg, #F59E0B, #D97706); }
.notify-toast[data-type="mention"] .notify-accent { background: linear-gradient(180deg, #EC4899, #DB2777); }
.notify-toast[data-type="system"] .notify-accent { background: linear-gradient(180deg, #8B5CF6, #7C3AED); }

/* 图标区 */
.notify-toast .notify-icon-wrap {
    padding: 14px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notify-toast .notify-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.notify-toast[data-type="friend_request"] .notify-icon { background: linear-gradient(135deg, #10B981, #059669); }
.notify-toast[data-type="friend_approved"] .notify-icon { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.notify-toast[data-type="private_message"] .notify-icon { background: linear-gradient(135deg, #F59E0B, #D97706); }
.notify-toast[data-type="mention"] .notify-icon { background: linear-gradient(135deg, #EC4899, #DB2777); }
.notify-toast[data-type="system"] .notify-icon { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }

/* 内容区 */
.notify-toast .notify-body {
    flex: 1;
    padding: 12px 14px 12px 0;
    min-width: 0;
}

.notify-toast .notify-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notify-toast .notify-content {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notify-toast .notify-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
}

/* 关闭按钮 */
.notify-toast .notify-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    cursor: pointer;
    background: transparent;
    border: none;
}

.notify-toast:hover .notify-close {
    opacity: 1;
}

.notify-toast .notify-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #374151;
}

/* 操作按钮区 */
.notify-toast .notify-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px 12px 12px;
    justify-content: flex-end;
}

.notify-toast .notify-actions .btn {
    padding: 4px 14px;
    font-size: 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.notify-toast .notify-actions .btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: #fff;
}

.notify-toast .notify-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.notify-toast .notify-actions .btn-danger {
    background: #f3f4f6;
    color: #6b7280;
}

.notify-toast .notify-actions .btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 进度条（自动消失倒计时） */
.notify-toast .notify-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    border-radius: 0 0 0 12px;
    animation: notify-progress 4s linear forwards;
}

@keyframes notify-progress {
    from { width: 100%; }
    to { width: 0%; }
}

.notify-toast.paused .notify-progress {
    animation-play-state: paused;
}

/* 响应式：移动端缩小 */
@media (max-width: 520px) {
    #notifyBox {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }
    .notify-toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* 拖拽中样式 */
#notifyBox.dragging {
    transition: none !important;
    opacity: 0.92;
}

/* 新消息徽章（全站浮动入口） */
#notifyBell {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 22px;
}

#notifyBell.show {
    display: flex;
    animation: notify-bell-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#notifyBell:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

#notifyBell .bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

@keyframes notify-bell-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================================
 * 【弹窗公告大模态窗】样式（版本升级/活动福利等居中大图式）
 * 对齐用户截图里的"版本升级"卡片：白卡 + 渐变边角 + 图标 + 标题 + 描述 + 主按钮
 * ============================================================ */
.site-popup-ann-root {
    position: fixed;
    inset: 0;
    z-index: 9999;                /* 高于 nav/footer/其他弹窗 */
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;           /* 未 .show 时不捕获事件 */
    opacity: 0;
    transition: opacity .28s ease, visibility 0s linear .28s;
    padding: 16px;
}
.site-popup-ann-root.show {
    visibility: visible;
    opacity: 1;
    transition: opacity .28s ease, visibility 0s;
}

/* 蒙版 */
.site-popup-ann-mask {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

/* 卡片主体（视觉参考：用户截图中的版本升级卡片） */
.site-popup-ann-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    min-width: 280px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow:
        0 30px 80px -15px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(214, 51, 108, 0.12) inset;
    padding: 0;
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform .32s cubic-bezier(.2,.9,.3,1.2), opacity .28s ease;
}
.site-popup-ann-root.show .site-popup-ann-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 顶部渐变装饰条（左侧紫-粉红，对应截图） */
.site-popup-ann-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #8B5CF6 0%, #D6336C 50%, #FEF3C7 100%);
}
/* 左侧彩色渐变边框（和截图中的小方块渐变一致） */
.site-popup-ann-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, #8B5CF6 0%, #D6336C 50%, #F59E0B 100%);
}

/* 关闭按钮 */
.site-popup-ann-close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(107, 114, 128, 0.08);
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
    padding: 0;
}
.site-popup-ann-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

/* 正文区域：图标 + 文字内容 */
.site-popup-ann-body {
    padding: 32px 28px 22px 36px;     /* 左侧多 8px 给彩色边条留白 */
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.site-popup-ann-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(214, 51, 108, 0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-top: 2px;
}
.site-popup-ann-content {
    flex: 1;
    min-width: 0;
}
.site-popup-ann-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
    letter-spacing: 0.2px;
}
.site-popup-ann-desc {
    margin: 0 0 14px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    word-break: break-word;
}
/* 进度装饰条（截图底部有一条小彩条） */
.site-popup-ann-progress {
    height: 4px;
    width: 100%;
    max-width: 220px;
    border-radius: 4px;
    background: linear-gradient(90deg, #D6336C 0%, #8B5CF6 60%, #FEF3C7 100%);
    opacity: 0.85;
}

/* 底部按钮区 */
.site-popup-ann-actions {
    padding: 0 28px 26px 36px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.site-popup-ann-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .18s ease, filter .15s ease;
    white-space: nowrap;
}
.site-popup-ann-btn:active {
    transform: translateY(1px);
}
.site-popup-ann-btn-primary {
    background: linear-gradient(135deg, #D6336C 0%, #8B5CF6 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(214, 51, 108, 0.32);
}
.site-popup-ann-btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 22px rgba(214, 51, 108, 0.42);
}
.site-popup-ann-btn-secondary {
    background: rgba(107, 114, 128, 0.08);
    color: #4b5563;
}
.site-popup-ann-btn-secondary:hover {
    background: rgba(107, 114, 128, 0.16);
}

/* 小屏适配：卡片更紧凑 */
@media (max-width: 520px) {
    .site-popup-ann-card { border-radius: 14px; }
    .site-popup-ann-body { padding: 24px 18px 18px 26px; gap: 14px; }
    .site-popup-ann-actions { padding: 0 18px 20px 26px; }
    .site-popup-ann-icon { width: 46px; height: 46px; font-size: 22px; border-radius: 12px; }
    .site-popup-ann-title { font-size: 17px; }
    .site-popup-ann-desc { font-size: 13px; }
}

/* 暗色主题下卡片配色（跟随 [data-theme="dark"]） */
[data-theme="dark"] .site-popup-ann-card {
    background: #1f2937;
    box-shadow:
        0 30px 80px -15px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
[data-theme="dark"] .site-popup-ann-title { color: #f3f4f6; }
[data-theme="dark"] .site-popup-ann-desc  { color: #9ca3af; }
[data-theme="dark"] .site-popup-ann-close { background: rgba(255, 255, 255, 0.06); color: #9ca3af; }
