/* notification.css — 消息通知组件样式 */

.ntf-bell-wrap { position: relative; display: inline-block; }

.ntf-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    color: inherit;
    transition: background 0.2s;
    position: relative;
}
.ntf-bell-btn:hover { background: rgba(255,255,255,0.1); }
.ntf-bell-btn:active { transform: scale(0.95); }

.ntf-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(40%, -40%);
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ntf-badge.ntf-bounce { animation: ntf-pulse 0.6s ease; }
@keyframes ntf-pulse {
    0% { transform: translate(40%, -40%) scale(1); }
    50% { transform: translate(40%, -40%) scale(1.3); }
    100% { transform: translate(40%, -40%) scale(1); }
}

.ntf-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.06);
    z-index: 9999;
    overflow: hidden;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}

.ntf-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
}
.ntf-panel-title { font-weight: 600; font-size: 0.95rem; color: #333; }
.ntf-mark-all-btn {
    background: none;
    border: none;
    color: #0d6efd;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.ntf-mark-all-btn:hover { background: rgba(13,110,253,0.08); }

.ntf-panel-body { overflow-y: auto; flex: 1; }

.ntf-panel-footer {
    padding: 8px 16px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}
.ntf-view-all-btn {
    width: 100%;
    background: none;
    border: none;
    color: #0d6efd;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}
.ntf-view-all-btn:hover { background: rgba(13,110,253,0.08); }

.ntf-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.ntf-item:hover { background: #f8f9fa; }
.ntf-item:last-child { border-bottom: none; }
.ntf-item-unread { background: #eef5ff; }
.ntf-item-unread:hover { background: #e3eefc; }
.ntf-item-unread::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc3545;
}

.ntf-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: #fff;
}
.ntf-icon-blue   { background: #0d6efd; }
.ntf-icon-cyan   { background: #17a2b8; }
.ntf-icon-orange { background: #fd7e14; }
.ntf-icon-red    { background: #dc3545; }
.ntf-icon-green  { background: #28a745; }
.ntf-icon-yellow { background: #ffc107; color: #856404; }
.ntf-icon-gray   { background: #6c757d; }

.ntf-item-body { flex: 1; min-width: 0; }
.ntf-item-title { font-weight: 600; font-size: 0.85rem; color: #333; margin-bottom: 2px; }
.ntf-item-content { font-size: 0.8rem; color: #666; line-height: 1.4; word-break: break-word; }
.ntf-item-time { font-size: 0.72rem; color: #aaa; margin-top: 4px; }

.ntf-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}
.ntf-item:hover .ntf-item-delete { opacity: 1; }
.ntf-item-delete:hover { color: #dc3545; background: rgba(220,53,69,0.08); }

.ntf-loading {
    text-align: center;
    padding: 32px 16px;
    color: #aaa;
    font-size: 0.85rem;
}
.ntf-empty {
    text-align: center;
    padding: 40px 16px;
    color: #bbb;
}
.ntf-empty i { font-size: 2rem; display: block; margin-bottom: 8px; }

/* 暗色导航栏适配 */
.navbar-dark .ntf-bell-btn { color: rgba(255,255,255,0.85); }
.navbar-dark .ntf-bell-btn:hover { background: rgba(255,255,255,0.1); }

/* 小屏幕适配 */
@media (max-width: 576px) {
    .ntf-panel { width: calc(100vw - 24px); right: -8px; }
}
