/* 商品通知按钮样式 - 小清新风格 */
.ntf-widget-container {
    position: fixed;
    bottom: 160px;
    right: 5px;
    z-index: 900;
}

.ntf-widget-button {
    text-decoration: none;
    position: relative;
    line-height: 20px;
    font-size: 15px;
    background-color: #6BC4A6;
    color: white;
    padding: 8px 25px;
    border-radius: 5px; /* 改为直角 */
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(107, 196, 166, 0.3);
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: normal;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
}

.ntf-widget-button:hover {
    background-color: #5AB395;
    box-shadow: 0 6px 15px rgba(107, 196, 166, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

.ntf-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF6B8B;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ntfPulse 1.5s infinite;
    box-shadow: 0 2px 5px rgba(255, 107, 139, 0.4);
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

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

/* 面板样式 - 小清新风格 */
.ntf-widget-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
    animation: ntfFadeIn 0.3s ease;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    border: 1px solid #F0F4F8;
}

@keyframes ntfFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ntf-panel-header {
    background: linear-gradient(135deg, #6BC4A6 0%, #8DD7B9 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ntf-panel-title {
    font-weight: bold;
    font-size: 16px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ntf-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f9f9f9;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #A8D5BA #F0F9F5;
    transition: opacity 0.3s ease;
}
.ntf-messages-container.updating {
    opacity: 0.7;
}

.ntf-messages-container::-webkit-scrollbar {
    width: 8px;
}

.ntf-messages-container::-webkit-scrollbar-track {
    background: #F0F9F5;
    border-radius: 4px;
}

.ntf-messages-container::-webkit-scrollbar-thumb {
    background: #A8D5BA;
    border-radius: 4px;
}

.ntf-messages-container::-webkit-scrollbar-thumb:hover {
    background: #6BC4A6;
}

/* 普通消息区域的滚动条也统一 */
.ntf-normal-section {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #A8D5BA #F0F9F5;
}

.ntf-normal-section::-webkit-scrollbar {
    width: 8px;
}

.ntf-normal-section::-webkit-scrollbar-track {
    background: #F0F9F5;
    border-radius: 4px;
}

.ntf-normal-section::-webkit-scrollbar-thumb {
    background: #A8D5BA;
    border-radius: 4px;
}

.ntf-normal-section::-webkit-scrollbar-thumb:hover {
    background: #6BC4A6;
}
/* 置顶消息横向布局样式 */
.ntf-pinned-section {
    background: linear-gradient(135deg, #F0F9F5 0%, #E6F4EC 100%);
    border-bottom: 2px solid #C1E1D2;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(107, 196, 166, 0.1);
}

.ntf-pinned-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #A8D5BA;
}

.ntf-pinned-header i {
    color: #6BC4A6;
    margin-right: 8px;
    font-size: 16px;
}

.ntf-pinned-header span {
    font-weight: bold;
    color: #6BC4A6;
    font-size: 14px;
}

.ntf-pinned-messages-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: #A8D5BA #F0F9F5;
}

.ntf-pinned-messages-container::-webkit-scrollbar {
    height: 6px;
}

.ntf-pinned-messages-container::-webkit-scrollbar-track {
    background: #F0F9F5;
    border-radius: 3px;
}

.ntf-pinned-messages-container::-webkit-scrollbar-thumb {
    background: #A8D5BA;
    border-radius: 3px;
}

.ntf-pinned-messages-container::-webkit-scrollbar-thumb:hover {
    background: #6BC4A6;
}

.ntf-pinned-card {
    flex: 0 0 auto;
    width: 220px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(107, 196, 166, 0.15);
    border-left: 3px solid #6BC4A6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ntf-pinned-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 196, 166, 0.2);
}

.ntf-pinned-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ntf-pinned-card-title {
    font-weight: bold;
    color: #333;
    font-size: 13px;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}

.ntf-pin-badge {
    background: #6BC4A6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
}

.ntf-pinned-card-content {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ntf-pinned-card-time {
    color: #999;
    font-size: 10px;
    text-align: right;
}

.ntf-pinned-card-images {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.ntf-pinned-card-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.ntf-pinned-card-image:hover {
    transform: scale(1.05);
}

/* 普通消息区域 */
.ntf-normal-section {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.ntf-normal-header {
    font-weight: bold;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E6F4EC;
    font-size: 14px;
}

.ntf-message-item {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: ntfMessageAppear 0.3s ease;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    border-left: 3px solid #C1E1D2;
}

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

.ntf-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ntf-message-title {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-message-time {
    color: #888;
    font-size: 12px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-message-content {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    font-size: 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-message-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.ntf-message-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.ntf-message-image:hover {
    transform: scale(1.05);
}

.ntf-no-messages {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-last-update {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 10px;
    border-top: 1px solid #E6F4EC;
    background: white;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000;
}

.ntf-overlay-bg.active {
    display: block;
}

/* 图片预览弹窗 */
.ntf-image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ntf-image-preview-modal.active {
    display: flex;
    opacity: 1;
}

.ntf-image-preview-container {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.ntf-image-preview-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.ntf-image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-image-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-image-preview-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ntf-image-preview-prev {
    left: 20px;
}

.ntf-image-preview-next {
    right: 20px;
}

.ntf-image-preview-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* 置顶消息详情弹窗 - 小清新风格 */
.ntf-message-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    animation: ntfDetailFadeIn 0.3s ease;
}

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

.ntf-message-detail-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.ntf-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E6F4EC;
}

.ntf-detail-title {
    color: #333;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
    margin-right: 15px;
}

.ntf-detail-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.ntf-detail-close:hover {
    background: #F0F4F8;
}

.ntf-detail-content {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
}

.ntf-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.ntf-detail-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.ntf-detail-image:hover {
    transform: scale(1.05);
}

.ntf-detail-time {
    color: #999;
    font-size: 12px;
    text-align: right;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #E6F4EC;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ntf-widget-container {
        bottom: 160px;
        right: 5px;
    }
    
    .ntf-widget-button {
        font-size: 14px;
        padding: 8px 20px;
        line-height: 20px;
    }
    
    .ntf-widget-panel {
        width: 95%;
        max-height: 85vh;
    }
    
    .ntf-pinned-card {
        width: 200px;
    }
    
    .ntf-message-images {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .ntf-detail-images {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .ntf-image-preview-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .ntf-widget-container {
        bottom: 160px;
        right: 5px;
    }
    
    .ntf-widget-button {
        font-size: 13px;
        padding: 8px 15px;
        line-height: 20px;
    }
    
    .ntf-widget-panel {
        width: 98%;
        max-height: 90vh;
    }
    
    .ntf-pinned-card {
        width: 180px;
    }
    
    .ntf-message-images {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .ntf-detail-images {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    /* 在CSS文件末尾添加 */
.ntf-pinned-card-image[style*="display: none"],
.ntf-message-image[style*="display: none"],
.ntf-detail-image[style*="display: none"] {
    display: none !important;
}

}

/* 下拉刷新样式 - 修复版本 */
.ntf-pull-refresh {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0px !important; /* 使用 !important 确保初始高度为0 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(107, 196, 166, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0 !important; /* 使用 !important 确保初始透明度为0 */
    z-index: 5;
    border-bottom: 1px solid rgba(107, 196, 166, 0.2);
    font-size: 0; /* 初始字体大小为0 */
}

.ntf-pull-refresh-icon {
    font-size: 16px;
    margin-bottom: 4px;
    color: #6BC4A6;
    transition: all 0.3s ease;
}

.ntf-pull-refresh-text {
    font-size: 12px;
    color: #6BC4A6;
    font-weight: 500;
}

@keyframes ntfSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息内容区域 */
.ntf-messages-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    min-height: 100%;
}

/* 修改消息容器，使其支持下拉刷新 */
.ntf-messages-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: #f9f9f9;
}

/* 确保普通消息区域正确显示 */
.ntf-normal-section {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}