/* ===== 通知弹窗（从数据库 announcement 表获取数据） ===== */

/* 通知列表遮罩 */
#notify-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

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

#notify-modal {
    width: 320px;
    max-width: 90vw;
    max-height: 75vh;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.96), rgba(20, 20, 28, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: notifySlideUp 0.35s ease-out;
    display: flex;
    flex-direction: column;
}

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

/* ===== 公告详情图片样式 ===== */
.notify-detail-image-wrapper {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.notify-detail-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: block;
}
.notify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.notify-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

#notify-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#notify-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* 通知列表容器 */
.notify-list {
    overflow-y: auto;
    padding: 8px 12px 12px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.notify-list::-webkit-scrollbar {
    width: 3px;
}

.notify-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* 空状态提示 */
.notify-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
    text-align: center;
    gap: 8px;
}

.notify-empty-icon {
    font-size: 36px;
    opacity: 0.5;
}

/* 加载状态 */
.notify-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    gap: 8px;
}

.notify-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: notifySpin 0.8s linear infinite;
}

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

/* 单条通知项 */
.notify-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notify-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.notify-item-content {
    flex: 1;
    min-width: 0;
}

.notify-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
    line-height: 1.3;
}

.notify-item-preview {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.notify-item-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

/* 未读标记 */
.notify-item-badge {
    font-size: 9px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    flex-shrink: 0;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 通知类型图标 */
.notify-item-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notify-item-type-icon.type-system {
    background: rgba(42, 171, 238, 0.15);
}

.notify-item-type-icon.type-activity {
    background: rgba(251, 191, 36, 0.15);
}

.notify-item-type-icon.type-notice {
    background: rgba(52, 211, 153, 0.15);
}

/* 通知详情弹窗 */
#notify-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

#notify-detail-overlay.notify-hidden {
    opacity: 0;
    pointer-events: none;
}

#notify-detail-modal {
    width: 320px;
    max-width: 90vw;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.96), rgba(20, 20, 28, 0.96));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: notifySlideUp 0.35s ease-out;
}

.notify-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#notify-detail-back {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#notify-detail-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.notify-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

#notify-detail-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#notify-detail-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.notify-detail-body {
    padding: 24px 20px 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.notify-detail-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-align: left;
    width: 100%;
}

.notify-detail-time {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
    width: 100%;
}

.notify-detail-image-wrapper {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.notify-detail-image {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: block;
}

.notify-detail-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.notify-detail-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    text-align: left;
    letter-spacing: 0.3px;
    white-space: pre-wrap;
    word-break: break-word;
    width: 100%;
}

/* ===== 通知按钮角标（显示未读数量） ===== */
#btn-notify {
    position: relative;
}

.notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    border: 1.5px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
    z-index: 5;
    display: none;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.notify-badge.show {
    display: block;
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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