#tengfeiZnaiButton.tengfei-znai-button {
    position: fixed !important;
    width: 60px !important;
    height: 60px !important;
    background: #007AFF !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 24px !important;
    z-index: 10000 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    outline: none !important;
}

/* 按钮位置样式 - 核心修改 */
#tengfeiZnaiButton.tengfei-znai-button.bottom-right {
    bottom: 30px !important;
    right: 30px !important;
}
#tengfeiZnaiButton.tengfei-znai-button.bottom-left {
    bottom: 30px !important;
    left: 30px !important;
}
#tengfeiZnaiButton.tengfei-znai-button.top-right {
    top: 30px !important;
    right: 30px !important;
}
#tengfeiZnaiButton.tengfei-znai-button.top-left {
    top: 30px !important;
    left: 30px !important;
}

#tengfeiZnaiButton.tengfei-znai-button:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 18px rgba(0, 122, 255, 0.3) !important;
}

#tengfeiZnaiButton.tengfei-znai-button .fa-comments-o {
    font-size: 24px !important;
}

#tengfeiZnaiButton.tengfei-znai-button.pulse {
    animation: tengfei-znai-pulse 2s infinite !important;
}

@keyframes tengfei-znai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

#tengfeiZnaiWindow.tengfei-znai-window {
    position: fixed !important;
    width: 375px !important;
    height: 550px !important;
    background: #FFFFFF !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    z-index: 10001 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    border: 1px solid #E5E7EB !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* 窗口位置样式 - 核心修改 */
#tengfeiZnaiWindow.tengfei-znai-window.bottom-right {
    bottom: 100px !important;
    right: 30px !important;
}
#tengfeiZnaiWindow.tengfei-znai-window.bottom-left {
    bottom: 100px !important;
    left: 30px !important;
}
#tengfeiZnaiWindow.tengfei-znai-window.top-right {
    top: 100px !important;
    right: 30px !important;
}
#tengfeiZnaiWindow.tengfei-znai-window.top-left {
    top: 100px !important;
    left: 30px !important;
}

#tengfeiZnaiWindow.tengfei-znai-window.active {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.tengfei-znai-header {
    background: #F9FAFB !important;
    color: #1D1D1F !important;
    padding: 18px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid #E5E7EB !important;
}

.tengfei-znai-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.tengfei-znai-avatar {
    width: 45px !important; 
    height: 45px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important; 
}

.tengfei-znai-avatar img {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover !important; 
    border-radius: 50% !important; 
}

.tengfei-znai-header-info {
    gap: 15px !important;
}

.tengfei-znai-message-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
    background: transparent !important;
    border: none !important;
}

.tengfei-znai-message-avatar img {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.tengfei-znai-header-text h3 {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1D1D1F !important;
}

.tengfei-znai-header-text p {
    margin: 3px 0 0 0 !important;
    font-size: 12px !important;
    color: #86868B !important;
}

.tengfei-znai-close {
    background: none !important;
    border: none !important;
    color: #1D1D1F !important;
    font-size: 22px !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 50% !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tengfei-znai-close:hover {
    background: #F0F0F0 !important;
}

.tengfei-znai-messages {
    flex: 1 !important;
    padding: 16px !important;
    overflow-y: auto !important;
    background: #F7F7F7 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.tengfei-znai-message {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    max-width: 100% !important;
    animation: tengfei-znai-messageIn 0.3s ease-out !important;
}

.tengfei-znai-message.user {
    justify-content: flex-end !important;
}

.tengfei-znai-message.user .tengfei-znai-message-content {
    flex-direction: row-reverse !important;
}

.tengfei-znai-message-content {
    display: flex !important;
    align-items: flex-end !important;
    gap: 8px !important;
    max-width: 75% !important;
}

.tengfei-znai-message-bubble {
    padding: 12px 16px !important;
    border-radius: 18px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    max-width: 100% !important;
    position: relative !important;
}

.tengfei-znai-message.assistant .tengfei-znai-message-bubble {
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-bottom-left-radius: 6px !important;
    color: #1D1D1F !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.tengfei-znai-message.user .tengfei-znai-message-bubble {
    background: #007AFF !important;
    color: white !important;
    border-bottom-right-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.1) !important;
}

.tengfei-znai-message-time {
    font-size: 11px !important;
    color: #86868B !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-bottom: 2px !important;
}

.tengfei-znai-quick-questions {
    padding: 12px 12px !important;
    border-top: 1px solid #E5E7EB !important;
    background: white !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.tengfei-znai-quick-question {
    padding: 8px 14px !important;
    background: #F9FAFB !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #1D1D1F !important;
    text-decoration: none !important;
}

.tengfei-znai-quick-question:hover {
    background: #F0F0F0 !important;
    border-color: #D1D5DB !important;
    transform: none !important;
    box-shadow: none !important;
}

.tengfei-znai-input-area {
    padding: 16px !important;
    border-top: 1px solid #E5E7EB !important;
    background: white !important;
}

.tengfei-znai-input-group {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}

.tengfei-znai-input-wrapper {
    flex: 1 !important;
    position: relative !important;
}

.tengfei-znai-input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 24px !important;
    outline: none !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    resize: none !important;
    min-height: 45px !important;
    max-height: 120px !important;
    font-family: inherit !important;
    color: #1D1D1F !important;
    background: #F9FAFB !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.tengfei-znai-input:focus {
    border-color: #007AFF !important;
    background: white !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1) !important;
}

.tengfei-znai-send {
    padding: 12px 20px !important;
    background: #007AFF !important;
    color: white !important;
    border: none !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.tengfei-znai-send:hover {
    background: #0066CC !important;
    transform: none !important;
    box-shadow: none !important;
}

.tengfei-znai-send:disabled {
    background: #E5E7EB !important;
    color: #86868B !important;
    cursor: not-allowed !important;
}

.tengfei-znai-typing-indicator {
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 18px !important;
    border-bottom-left-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.tengfei-znai-typing-dot {
    width: 8px !important;
    height: 8px !important;
    background: #86868B !important;
    border-radius: 50% !important;
    margin: 0 3px !important;
    animation: tengfei-znai-typing 1.4s infinite ease-in-out !important;
}

.tengfei-znai-typing-dot:nth-child(1) { animation-delay: -0.32s !important; }
.tengfei-znai-typing-dot:nth-child(2) { animation-delay: -0.16s !important; }

@keyframes tengfei-znai-typing {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.tengfei-znai-notification {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: #FF3B30 !important;
    color: white !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: tengfei-znai-bounce 2s infinite !important;
    font-weight: 600 !important;
}

@keyframes tengfei-znai-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-2px); }
}

@media (max-width: 480px) {
    #tengfeiZnaiWindow.tengfei-znai-window {
        width: calc(100vw - 40px) !important;
        height: calc(100vh - 140px) !important;
        bottom: 80px !important;
        right: 20px !important;
        left: 20px !important;
    }
    
    #tengfeiZnaiButton.tengfei-znai-button {
        bottom: 20px !important;
        right: 20px !important;
    }
}

@media (max-width: 768px) {
    #tengfeiZnaiButton.tengfei-znai-button,
    #tengfeiZnaiWindow.tengfei-znai-window {
        display: none !important;
    }
}

.tengfei-znai-messages::-webkit-scrollbar {
    width: 6px !important;
}

.tengfei-znai-messages::-webkit-scrollbar-track {
    background: transparent !important;
}

.tengfei-znai-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB !important;
    border-radius: 3px !important;
}

.tengfei-znai-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF !important;
}

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

.tengfei-znai-message-avatar img {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.tengfei-znai-avatar img {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}


.tengfei-znai-message-avatar {
    position: relative !important;
}

.tengfei-znai-message-avatar .online-status-dot {
    position: absolute !important;
    bottom: 2px !important;
    right: 2px !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    z-index: 2 !important;
}

.online-status-dot.online {
    background-color: #4CD964 !important; 
}
.online-status-dot.away {
    background-color: #FFC107 !important; 
}
.online-status-dot.busy {
    background-color: #FF9500 !important;
}
.online-status-dot.offline {
    background-color: #C9C9C9 !important;
}
/* 苹果原生风格超链接 - 极简版 */
.tengfei-znai-message-bubble > a {
    color: #007AFF !important; /* 苹果标准蓝 */
    text-decoration: none !important; /* 彻底去除下划线 */
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    transition: color 0.15s ease-in-out !important; /* 快速过渡 */
    font-weight: inherit !important; /* 不加粗，保持与正文一致 */
}

/* 悬停时仅轻微加深颜色，无其他效果 */
.tengfei-znai-message-bubble > a:hover {
    color: #0066CC !important;
    background: transparent !important;
    text-decoration: none !important; /* 确保无下划线 */
    transform: none !important;
}

/* 点击时颜色再深一点，模拟原生反馈 */
.tengfei-znai-message-bubble > a:active {
    color: #0052AA !important;
    background: transparent !important;
    transform: none !important;
}

/* 已访问链接保持原色（苹果生态中很多场景不区分已访问状态） */
.tengfei-znai-message-bubble > a:visited {
    color: var(--focus-color);
}

/* 用户气泡（蓝色背景）中的链接适配 */
.tengfei-znai-message.user .tengfei-znai-message-bubble > a {
    color: #D1E7FF !important; /* 浅蓝，与蓝色背景形成柔和对比 */
}

.tengfei-znai-message.user .tengfei-znai-message-bubble > a:hover {
    color: #FFFFFF !important; /* hover时变白，更清晰 */
}

.tengfei-znai-message.user .tengfei-znai-message-bubble > a:active {
    color: #B3D7FF !important;
}

.tengfei-znai-message.user .tengfei-znai-message-bubble > a:visited {
    color: var(--focus-color);
}

/* 文章搜索结果标题间距样式 - 增大间距版 */
.tengfei-znai-message-bubble .search-article-item {
    display: block !important; /* 强制独占一行 */
    margin: 12px 0 !important; /* 上下间距各12px，比之前增加4px */
    line-height: 1.8 !important; /* 行高同步优化，视觉更舒展 */
    padding: 2px 0 !important; /* 额外增加内边距，避免文字贴边 */
}
.tengfei-znai-message-bubble .search-article-item:before {
    margin-right: 6px !important;
}


/* 查看更多链接样式 */
.tengfei-znai-message-bubble .search-more-link {
    display: inline-block !important;
    margin-top: 8px !important;
    color: var(--focus-color);
    font-weight: 500 !important;
    padding: 2px 0 !important;
}
.tengfei-znai-message-bubble .search-more-link:hover {
    color: #0066CC !important;
    text-decoration: none !important;
}