/**
 * MiniRefresh-WeChat CSS
 * 专为微信群聊风格设计的下拉刷新样式
 */

/* 基础容器样式 */
.minirefresh-wrap {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.minirefresh-scroll {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

/* 下拉刷新容器 */
.minirefresh-down-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: linear-gradient(to bottom, #fff, #f0f0f0);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

.minirefresh-down-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.minirefresh-down-icon {
    display: none; /* 隐藏图标 */
}

.minirefresh-down-text {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    text-align: center;
    width: 100%;
}

/* 下拉状态样式 */

.minirefresh-down-loading .minirefresh-down-text {
    color: #07c160;
}

/* 上拉加载容器 */
.minirefresh-up-wrap {
    position: absolute;
    bottom: 100px; /* 为底部导航留出空间 */
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, #f8f8f8, #f0f0f0);
    z-index: 999; /* 降低z-index，避免遮挡底部导航 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.minirefresh-up-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.minirefresh-up-icon {
    display: none; /* 隐藏图标 */
}

.minirefresh-up-text {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    text-align: center;
    width: 100%;
}

/* 上拉状态样式 */

.minirefresh-up-loading .minirefresh-up-text {
    color: #07c160;
}

/* 旋转动画 */
@keyframes minirefresh-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 微信群聊特定样式 */
.wechat-group-container {
    position: relative;
    height: 100vh;
    background: #f5f5f5;
    overflow: hidden;
}

.wechat-group-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.wechat-chat-messages {
    padding: 10px;
    background: #f5f5f5;
}

/* 消息气泡样式增强 */
.message-bubble {
    position: relative;
    margin-bottom: 15px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 新消息通知样式 */
.new-message-notification {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(7, 193, 96, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
    animation: slideDown 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-btn:hover {
    background: rgba(255,255,255,0.3);
}

.notification-btn:active {
    background: rgba(255,255,255,0.4);
    transform: scale(0.95);
}

/* 通知动画 */
@keyframes slideDown {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

@keyframes slideUp {
    0% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
}

/* 状态指示器样式 */
.auto-refresh-status {
    font-size: 12px;
    opacity: 0.6;
    margin-left: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.auto-refresh-status.active {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 响应式设计 */
@media screen and (max-width: 480px) {
    .minirefresh-down-wrap,
    .minirefresh-up-wrap {
        height: 60px;
    }
    
    .minirefresh-down-content,
    .minirefresh-up-content {
        font-size: 12px;
    }
    
    .minirefresh-down-icon,
    .minirefresh-up-icon {
        font-size: 16px;
    }
    
    .new-message-notification {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 触摸反馈优化 */
.minirefresh-wrap * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 硬件加速 */
.minirefresh-down-wrap,
.minirefresh-up-wrap,
.minirefresh-scroll {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* 滚动条样式 */
.minirefresh-scroll::-webkit-scrollbar {
    display: none;
}

.minirefresh-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 100px; /* 为底部导航留出空间 */
}

/* 加载状态的特殊效果 */
.minirefresh-down-loading {
    background: linear-gradient(45deg, #f8f8f8, #e8f5e8);
}

.minirefresh-up-loading {
    background: linear-gradient(-45deg, #f8f8f8, #e8f5e8);
}

/* 成功状态的绿色主题 */
.minirefresh-down-wrap .minirefresh-down-icon,
.minirefresh-up-wrap .minirefresh-up-icon {
    color: #07c160;
}

/* 错误状态的红色主题 */
.minirefresh-down-error .minirefresh-down-icon,
.minirefresh-up-error .minirefresh-up-icon {
    color: #fa5151;
}

.minirefresh-down-error .minirefresh-down-text,
.minirefresh-up-error .minirefresh-up-text {
    color: #fa5151;
}

/* 禁用状态 */
.minirefresh-disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .minirefresh-down-wrap,
    .minirefresh-up-wrap {
        background: linear-gradient(to bottom, #ffffff, #fefefe);
        border-color: #444;
        color: #ccc;
    }
    
    .minirefresh-down-text,
    .minirefresh-up-text {
        color: #999;
    }
    
    .new-message-notification {
        background: rgba(7, 193, 96, 0.9);
    }
} 