/**
 * 通用消息通知组件样式
 */

/* 通知容器 */
.notification-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

.notification-container.top-right {
    top: 20px;
    right: 20px;
}

.notification-container.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.notification-container.top-left {
    top: 20px;
    left: 20px;
}

.notification-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.notification-container.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.notification-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* 通知项 */
.notification {
    position: relative;
    margin-bottom: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fff;
    border-left: 4px solid;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.hiding {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.2s ease-in-out;
}

/* 成功类型 */
.notification.success {
    border-left-color: #52c41a;
    background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%);
}

.notification.success .notification-icon {
    color: #52c41a;
}

/* 错误类型 */
.notification.error {
    border-left-color: #ff4d4f;
    background: linear-gradient(135deg, #fff2f0 0%, #ffffff 100%);
}

.notification.error .notification-icon {
    color: #ff4d4f;
}

/* 警告类型 */
.notification.warning {
    border-left-color: #faad14;
    background: linear-gradient(135deg, #fffbe6 0%, #ffffff 100%);
}

.notification.warning .notification-icon {
    color: #faad14;
}

/* 信息类型 */
.notification.info {
    border-left-color: #1890ff;
    background: linear-gradient(135deg, #e6f7ff 0%, #ffffff 100%);
}

.notification.info .notification-icon {
    color: #1890ff;
}

/* 通知内容 */
.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #262626;
    line-height: 1.4;
}

.notification-message {
    font-size: 13px;
    color: #595959;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #8c8c8c;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #595959;
}

/* 进度条 */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0 8px;
}

.notification-progress-bar {
    height: 100%;
    background: currentColor;
    border-radius: 0 0 0 8px;
    transition: width linear;
}

/* 不同类型的进度条颜色 */
.notification.success .notification-progress-bar {
    background: #52c41a;
}

.notification.error .notification-progress-bar {
    background: #ff4d4f;
}

.notification.warning .notification-progress-bar {
    background: #faad14;
}

.notification.info .notification-progress-bar {
    background: #1890ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .notification {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        margin-left: 0;
        margin-right: 0;
    }

    .notification-container {
        left: 20px !important;
        right: 20px !important;
        transform: none !important;
    }

    .notification-container.top-right,
    .notification-container.top-left,
    .notification-container.bottom-right,
    .notification-container.bottom-left {
        left: 20px;
        right: 20px;
        transform: none;
    }

    .notification-container.top-center {
        top: 20px;
        left: 20px;
        right: 20px;
        transform: none;
    }

    .notification-container.bottom-center {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
    }
}

/* 动画关键帧 */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #1f1f1f;
        border-left-color: rgba(255, 255, 255, 0.1);
    }

    .notification.success {
        background: linear-gradient(135deg, #162312 0%, #1f1f1f 100%);
    }

    .notification.error {
        background: linear-gradient(135deg, #2a1215 0%, #1f1f1f 100%);
    }

    .notification.warning {
        background: linear-gradient(135deg, #2b2111 0%, #1f1f1f 100%);
    }

    .notification.info {
        background: linear-gradient(135deg, #111d2c 0%, #1f1f1f 100%);
    }

    .notification-title {
        color: #ffffff;
    }

    .notification-message {
        color: #bfbfbf;
    }

    .notification-close {
        color: #8c8c8c;
    }

    .notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
}

/* 无障碍支持 */
.notification:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

.notification[role="alert"] {
    outline: none;
}

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

.notification-container::-webkit-scrollbar-track {
    background: transparent;
}

.notification-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.notification-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}