/* 通知铃铛 */
.notification-bell {
    position: relative;
    margin-right: 15px;
    cursor: pointer;
    z-index: 1002;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important; /* 固定高度 */
    min-height: 40px !important;
    max-height: 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    box-sizing: border-box !important;
}

.notification-bell i {
    font-size: 20px;
    color: var(--navbar-text-secondary);
    transition: color 0.2s, background 0.2s;
    padding: 8px;
    border-radius: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    box-sizing: border-box !important;
}

.notification-bell:hover i {
    color: var(--navbar-primary);
    background: var(--navbar-primary-light);
}

.notification-bell:active i {
    color: var(--navbar-primary);
    background: var(--navbar-primary-light);
}

.notification-bell:hover i {
    color: var(--navbar-primary);
    background: var(--navbar-primary-light);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: navbar-pulse 2s infinite;
}

@keyframes navbar-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 通知面板 */
.notification-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}

.notification-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid var(--navbar-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--navbar-text-primary);
    margin: 0;
}

.notification-header h4 i {
    color: var(--navbar-primary);
}

.view-all-notifications {
    font-size: 14px;
    color: var(--navbar-primary);
    text-decoration: none;
}

.view-all-notifications:hover {
    text-decoration: underline;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.notification-item {
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.notification-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    transform: translateX(4px);
}

.notification-item:active {
    transform: translateX(2px);
    opacity: 0.8;
}

.notification-item.unread:hover {
    background: linear-gradient(135deg, var(--navbar-primary-light) 0%, #d6e0ff 100%);
}

/* 全部通知列表项样式 */
.all-notifications-list-item {
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    position: relative;
}

.all-notifications-list-item:hover {
    background: #f8f9ff;
}

.all-notifications-list-item:active {
    background: #e9ecef;
}

.all-notifications-list-item.unread {
    background: #e0e9ff;
    border-left: 4px solid var(--navbar-primary);
    position: relative;
}

.all-notifications-list-item.unread:hover {
    background: #d6e0ff;
}

.all-notifications-list-content {
    display: flex;
    gap: 12px;
}

.all-notifications-list-icon {
    color: var(--navbar-primary);
    font-size: 20px;
    margin-top: 2px;
    background: rgba(67, 97, 238, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.all-notifications-list-text {
    flex: 1;
}

.all-notifications-list-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--navbar-text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
}

.all-notifications-list-preview {
    font-size: 14px;
    color: var(--navbar-text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.all-notifications-list-content-full {
    font-size: 14px;
    color: var(--navbar-text-primary);
    margin-bottom: 12px;
    line-height: 1.6;
    word-wrap: break-word;
}

.all-notifications-list-content-full h1,
.all-notifications-list-content-full h2,
.all-notifications-list-content-full h3,
.all-notifications-list-content-full h4,
.all-notifications-list-content-full h5,
.all-notifications-list-content-full h6 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    color: var(--navbar-text-primary);
}

.all-notifications-list-content-full p {
    margin-bottom: 8px;
}

.all-notifications-list-content-full ul,
.all-notifications-list-content-full ol {
    margin: 8px 0;
    padding-left: 20px;
}

.all-notifications-list-content-full li {
    margin-bottom: 4px;
}

.all-notifications-list-content-full a {
    color: var(--navbar-primary);
    text-decoration: none;
}

.all-notifications-list-content-full a:hover {
    text-decoration: underline;
}

.all-notifications-list-content-full code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
}

.all-notifications-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--navbar-text-secondary);
}

.notification-item-content {
    display: flex;
    gap: 12px;
}

.notification-item.unread {
    background: linear-gradient(135deg, var(--navbar-primary-light) 0%, #e0e9ff 100%);
    border-left: 4px solid var(--navbar-primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
    position: relative;
}

.unread-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
    animation: pulse 2s infinite;
}

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

.notification-item-content {
    display: flex;
    gap: 12px;
}

.notification-item-icon {
    color: var(--navbar-primary);
    font-size: 20px;
    margin-top: 2px;
    background: rgba(67, 97, 238, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-text {
    flex: 1;
}

.notification-item-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--navbar-text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
}

.notification-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--navbar-text-secondary);
}

.notification-item-category {
    background: rgba(67, 97, 238, 0.1);
    color: var(--navbar-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.notification-footer {
    padding: 20px;
    border-top: 1px solid var(--navbar-border);
    text-align: center;
    background: #fafafa;
}

.mark-all-read {
    background: #ffffff;
    border: 1px solid #e9ecef;
    color: var(--navbar-text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    padding: 12px 28px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mark-all-read:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mark-all-read:active {
    background: #e9ecef;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.no-notifications {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--navbar-text-secondary);
    text-align: center;
}

.no-notifications i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    color: var(--navbar-primary);
}

.no-notifications p {
    font-size: 16px;
    margin: 0;
}

/* 通知弹窗样式 */
.notification-modal,
.all-notifications-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.notification-modal.show,
.all-notifications-modal.show {
    display: flex;
}

.notification-modal-content,
.all-notifications-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.all-notifications-modal-content {
    overflow: hidden;
}

.notification-modal-header,
.all-notifications-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-modal-header h3,
.all-notifications-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--navbar-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-modal-header h3 i,
.all-notifications-header h3 i {
    color: var(--navbar-primary);
}

.notification-modal-close,
.all-notifications-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--navbar-text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-modal-close:hover,
.all-notifications-close:hover {
    background: #f8f9fa;
    color: var(--navbar-text-primary);
}

.notification-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: var(--navbar-text-secondary);
}

.notification-category {
    background: rgba(67, 97, 238, 0.1);
    color: var(--navbar-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.notification-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--navbar-text-primary);
}

.notification-content {
    line-height: 1.6;
    color: var(--navbar-text-primary);
    margin-bottom: 20px;
}

.notification-modal-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
    background: #fafafa;
}

.all-notifications-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    box-sizing: border-box;
    -ms-overflow-style: auto;
    overflow-style: auto;
}

/* 滚动条样式优化 */
.all-notifications-body::-webkit-scrollbar {
    width: 8px;
}

.all-notifications-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.all-notifications-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.all-notifications-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .all-notifications-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .all-notifications-body {
        max-height: 500px;
        padding: 15px;
    }
    
    .all-notifications-list-item {
        padding: 15px;
    }
    
    .all-notifications-list-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .all-notifications-list-icon {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .all-notifications-list-title {
        font-size: 14px;
    }
    
    .all-notifications-list-content-full {
        font-size: 13px;
    }
    
    .all-notifications-list-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

.all-notifications-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    background: #fafafa;
}

.btn-clear-all-read {
    background: #ffffff;
    border: 1px solid #e9ecef;
    color: var(--navbar-text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    padding: 12px 28px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-clear-all-read:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-clear-all-read:active {
    background: #e9ecef;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

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

/* 通知项悬停效果 */
.notification-item {
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%) !important;
    transform: translateX(4px);
    cursor: pointer;
}