/* Toast 通知容器 */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    max-width: 400px;
    pointer-events: none;
}

/* Toast 项 */
.toast-item {
    animation: toastSlideIn 0.3s ease forwards;
    position: relative;
    padding-right: 2.5rem !important;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.toast-item span:first-child {
    flex-shrink: 0;
}

.toast-item span:nth-child(2) {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 关闭按钮 */
.toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    padding: 0.2rem;
    line-height: 1;
}

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

/* 滑入动画 */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 滑出动画 */
.toast-item.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 移动端适配 */
@media (max-width: 600px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

/* ====== 小红点通知 ====== */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.notification-bell:hover {
    opacity: 0.8;
}

/* 小红点 */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    transform: translate(30%, -30%);
    display: none;
    animation: badgePulse 0.3s ease;
}

.notification-badge.visible {
    display: block;
}

@keyframes badgePulse {
    0% { transform: translate(30%, -30%) scale(0); }
    50% { transform: translate(30%, -30%) scale(1.2); }
    100% { transform: translate(30%, -30%) scale(1); }
}

/* 通知面板 */
.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 400px;
    background: var(--surface, #1e1c19);
    border: 1px solid var(--border, #3a3530);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    overflow: hidden;
    margin-top: 0.5rem;
}

.notification-panel.open {
    display: block;
    animation: panelSlideIn 0.2s ease;
}

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

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border, #3a3530);
    font-size: 0.85rem;
    font-weight: 600;
}

.notification-header button {
    background: none;
    border: none;
    color: var(--accent, #c8a45c);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.notification-header button:hover {
    background: rgba(200, 164, 92, 0.1);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border, #3a3530);
    font-size: 0.8rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover {
    background: rgba(200, 164, 92, 0.05);
}

.notification-item.unread {
    background: rgba(200, 164, 92, 0.03);
    border-left: 3px solid var(--accent, #c8a45c);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item .notif-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.notification-item .notif-detail {
    color: var(--text-muted, #8a8078);
    font-size: 0.75rem;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted, #8a8078);
    font-size: 0.85rem;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .notification-panel {
        width: calc(100vw - 2rem);
        right: -0.5rem;
    }
}
