/* 通知页面整体样式 - 现代化设计 */
:root {
    --primary-color: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-secondary-color: #6b7280;
    --text-tertiary-color: #9ca3af;
    --background-color: #f8fafc;
    --card-color: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 页面主容器 */
.notification-page-container {
    min-height: calc(100vh - 132px);
    background-color: var(--background-color);
    padding-bottom: 132px;
}

/* 顶部状态栏 */
.notification-header {
    position: relative;
    padding: 28px 16px 40px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    overflow: hidden;
    background: var(--primary-gradient);
}

.notification-header-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 30%, rgba(168, 85, 247, 0.2) 0%, transparent 40%);
    animation: floatBg 8s ease-in-out infinite;
}

@keyframes floatBg {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.1) rotate(3deg); opacity: 1; }
}

.notification-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 500;
}

.unread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-left: 4px;
    animation: pulse 2s ease-in-out infinite;
}

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

.mark-all-read-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.mark-all-read-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.mark-all-read-btn:active {
    transform: translateY(0) scale(0.97);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* 分类标签区域 */
.notification-category-tabs {
    background: var(--card-color);
    padding: 16px 0;
    position: sticky;
    top: 44px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    margin-top: -20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tabs-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px;
}

.tabs-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs-container {
    display: inline-flex;
    gap: 6px;
    padding: 0 4px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 14px;
    background: var(--background-color);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-secondary-color);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-normal);
    white-space: nowrap;
    border: 2px solid transparent;
    min-width: 52px;
    position: relative;
}

.category-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

.category-tab.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.category-tab.active::before {
    opacity: 0.08;
}

.category-tab:active {
    transform: scale(0.95);
}

.tab-icon {
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.tab-text {
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.tab-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var(--danger-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: badgePop 0.3s ease-out;
}

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

/* 通知列表容器 */
.notification-list-container {
    padding: 16px;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 通知项样式 */
.notification-item {
    background: var(--card-color);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.notification-item.unread::before {
    opacity: 1;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.notification-item.read {
    opacity: 0.75;
}

.notification-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.notification-item:active {
    transform: translateY(-1px) scale(0.99);
}

/* 通知内容布局 */
.notification-item-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
}

.notification-avatar-wrap {
    flex-shrink: 0;
    position: relative;
}

.notification-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.notification-item.unread .notification-avatar {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.notification-type-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ffffff;
}

.notification-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-main {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.notification-user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    white-space: nowrap;
}

.notification-action-text {
    font-size: 14px;
    color: var(--text-secondary-color);
    line-height: 1.5;
}

.notification-target {
    font-size: 13px;
    color: var(--text-tertiary-color);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 4px;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary-color);
}

.notification-type-tag {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--background-color);
    color: var(--text-secondary-color);
}

.notification-type-tag.like {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.notification-type-tag.comment {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.notification-type-tag.mention {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.notification-type-tag.follow {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.notification-type-tag.message {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary-color);
}

/* 操作按钮区域 */
.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.notification-btn {
    flex: 1;
    padding: 11px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.notification-btn.follow {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.notification-btn.follow.followed {
    background: var(--background-color);
    color: var(--text-secondary-color);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.notification-btn.reply {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.notification-btn:hover {
    transform: translateY(-2px);
}

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

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    background: var(--card-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 3px solid transparent;
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite reverse;
}

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

.loading-text {
    font-size: 15px;
    color: var(--text-secondary-color);
    margin-top: 20px;
}

/* 空状态 */
.empty-notifications {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 40px;
    text-align: center;
}

.empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(99, 102, 241, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-icon::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0.5;
    animation: pulseRing 2s ease-out infinite;
}

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

.empty-icon svg {
    width: 50px;
    height: 50px;
    color: var(--text-tertiary-color);
    position: relative;
    z-index: 1;
}

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

.empty-desc {
    font-size: 15px;
    color: var(--text-secondary-color);
    line-height: 1.6;
}

/* 私信对话样式 */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--card-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.conversation-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.conversation-item:active {
    transform: translateY(-1px) scale(0.99);
}

.conversation-avatar-wrap {
    position: relative;
    margin-right: 16px;
}

.conversation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--background-color);
    border: 3px solid var(--border-color);
    transition: all var(--transition-fast);
}

.conversation-item:hover .conversation-avatar {
    border-color: var(--primary-color);
}

.avatar-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--success-color);
    border: 3px solid var(--card-color);
    border-radius: 50%;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-preview {
    font-size: 14px;
    color: var(--text-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    text-align: right;
    margin-left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-tertiary-color);
}

.conversation-unread {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--danger-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease-out;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f9fafb;
        --text-secondary-color: #d1d5db;
        --text-tertiary-color: #9ca3af;
        --background-color: #111827;
        --card-color: #1f2937;
        --border-color: #374151;
        --primary-light: rgba(99, 102, 241, 0.15);
    }

    .notification-header {
        background: var(--primary-gradient);
    }

    .category-tab {
        background: var(--card-color);
        border-color: var(--border-color);
    }

    .category-tab.active {
        background: var(--primary-light);
    }

    .notification-item::before {
        opacity: 0.8;
    }

    .notification-btn.reply {
        background: var(--card-color);
        border-color: var(--border-color);
    }

    .conversation-avatar {
        border-color: var(--border-color);
    }

    .avatar-online {
        border-color: var(--card-color);
    }
}

/* 响应式调整 */
@media (max-width: 320px) {
    .notification-header {
        padding: 24px 12px 36px;
    }

    .notification-title {
        font-size: 28px;
    }

    .notification-subtitle {
        font-size: 13px;
    }

    .mark-all-read-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .category-tab {
        padding: 9px 14px;
        gap: 4px;
    }

    .tab-text {
        font-size: 13px;
    }

    .notification-item-inner {
        padding: 12px;
    }

    .notification-avatar {
        width: 44px;
        height: 44px;
    }

    .notification-user-name {
        font-size: 14px;
    }

    .notification-action-text {
        font-size: 13px;
    }

    .conversation-item {
        padding: 14px;
    }

    .conversation-avatar {
        width: 50px;
        height: 50px;
    }

    .conversation-name {
        font-size: 15px;
    }

    .conversation-preview {
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-item {
    animation: slideIn 0.4s ease-out;
}

.notification-item:nth-child(1) { animation-delay: 0.05s; }
.notification-item:nth-child(2) { animation-delay: 0.1s; }
.notification-item:nth-child(3) { animation-delay: 0.15s; }
.notification-item:nth-child(4) { animation-delay: 0.2s; }
.notification-item:nth-child(5) { animation-delay: 0.25s; }

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

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

.loading-state,
.empty-notifications {
    animation: fadeInUp 0.5s ease-out;
}

.conversation-item {
    animation: slideIn 0.3s ease-out;
}

/* 涟漪效果 */
.notification-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.notification-item:active::after {
    opacity: 1;
}

/* 未读通知高亮 */
.notification-item.unread {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--card-color) 50%);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary-color);
}
