/* ========================================
   Be-Tech AI Chat - 简洁专业版
   去除所有过度设计，保持简洁
   ======================================== */

/* ========================================
   核心原则：
   1. 纯色背景，不用渐变
   2. 单一边框，不叠加
   3. 简单阴影，不复杂
   4. 最少伪元素
   5. 实用动画，不花哨
   ======================================== */

/* 移动端导航 - 简洁版 */
.betech-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: white;
    border-top: 2px solid #DD7007;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    display: none;
}

.betech-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    padding: 10px;
    text-decoration: none;
    transition: color 0.2s;
    min-height: 44px;
}

.betech-nav-item:hover {
    color: #00458E;
    background: rgba(0, 69, 142, 0.05);
}

.betech-nav-item.active {
    color: #DD7007;
}

.betech-nav-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: inline-block;
}

.betech-nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* 底部导航容器（用于横向排列四个按钮） */
.betech-mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

/* 聊天按钮 - 简洁版 */
#betech-chat-button {
    background: #00458E;  /* 纯色，不用渐变 */
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 69, 142, 0.3);
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10000;
}

#betech-chat-button:hover {
    background: #DD7007;  /* 简单的颜色切换 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(221, 112, 7, 0.3);
}

/* 聊天窗口 - 简洁版 */
#betech-chat-window {
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    animation: slideUp 0.3s ease;
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

#betech-chat-window.active {
    display: flex;
}

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

/* 聊天头部 - 专业版 */
#betech-chat-header {
    background: linear-gradient(135deg, #00458E 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar svg {
    width: 22px;
    height: 22px;
}

.chat-title h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.3px;
    color: white;
}

.chat-status {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
    line-height: 1.2;
    color: white;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.header-action-btn:active {
    transform: scale(0.95);
}

.header-action-btn svg {
    width: 16px;
    height: 16px;
}

/* 消息区域 - 简洁版 */
#betech-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fafbfc;
    min-height: 0;
}

/* 滚动条 - 简洁版 */
#betech-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#betech-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* 消息气泡 - 专业版 */
.chat-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

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

.message-bubble {
    display: inline-block;
    max-width: 85%;
    padding: 13px 17px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* 用户消息 - 渐变蓝色 */
.message-bubble.user {
    background: linear-gradient(135deg, #00458E 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 69, 142, 0.25);
    border-bottom-right-radius: 4px;
}

.chat-message.user {
    text-align: right;
}

/* Bot消息 - 柔和白色 */
.message-bubble.bot {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 4px;
}

.chat-message.bot {
    text-align: left;
}

/* 降级消息 - 单一左边框，无重复 */
.message-bubble.fallback {
    background: #fff8f0;
    color: #92400e;
    border-left: 3px solid #DD7007;  /* 只有左边框 */
    box-shadow: 0 2px 4px rgba(221, 112, 7, 0.1);
}

/* 文件列表 - 专业版 */
.file-list {
    margin-top: 8px;
}

.file-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: #00458E;
    box-shadow: 0 3px 12px rgba(0, 69, 142, 0.12);
    transform: translateY(-1px);
}

.file-header {
    color: #00458E;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    font-size: 18px;
}

.file-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}

.file-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* 按钮 - 专业版 */
.download-btn {
    background: linear-gradient(135deg, #00458E 0%, #0056b3 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 69, 142, 0.2);
}

.download-btn:hover {
    background: linear-gradient(135deg, #DD7007 0%, #e67e0e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(221, 112, 7, 0.3);
}

.download-btn svg {
    width: 14px;
    height: 14px;
}

.qr-code-btn {
    background: #f3f4f6;
    color: #4b5563;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.qr-code-btn:hover {
    background: white;
    border-color: #00458E;
    color: #00458E;
}

.contact-section {
    text-align: center;
    padding: 8px 0;
}

.contact-btn {
    background: linear-gradient(135deg, #DD7007 0%, #e67e0e 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(221, 112, 7, 0.3);
}

.contact-btn:hover {
    background: linear-gradient(135deg, #00458E 0%, #0056b3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 69, 142, 0.3);
}

/* 输入区域 - 专业版 */
#betech-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
    display: flex;
    gap: 12px;
    align-items: center;
}

#betech-chat-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: white;
}

#betech-chat-input:focus {
    border-color: #00458E;
    box-shadow: 0 0 0 3px rgba(0, 69, 142, 0.1);
}

#betech-chat-send {
    background: linear-gradient(135deg, #DD7007 0%, #e67e0e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(221, 112, 7, 0.3);
}

#betech-chat-send:hover {
    background: linear-gradient(135deg, #00458E 0%, #0056b3 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 69, 142, 0.3);
}

#betech-chat-send:active {
    transform: scale(0.95);
}

#betech-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Typing指示器 - 简洁版 */
.typing-dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* ========================================
   响应式 - 保持简洁
   ======================================== */

/* 移动端 */
@media (max-width: 768px) {
    .betech-mobile-nav {
        display: block;
    }
    
    #betech-chat-button {
        display: none;
    }
    
    #betech-chat-window {
        width: 100%;
        height: calc(100vh - 80px - env(safe-area-inset-bottom));
        margin: 0;
        bottom: calc(80px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        position: fixed;
        border-radius: 0;
    }
    
    #betech-chat-messages {
        height: calc(100% - 90px - 80px);
    }
    
    #betech-chat-input-area {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    #betech-chat-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 平板 */
@media (min-width: 769px) and (max-width: 1024px) {
    #betech-chat-window {
        width: 400px;
        height: 640px;
    }
}

/* 大屏幕 */
@media (min-width: 1440px) {
    #betech-chat-window {
        width: 420px;
        height: 680px;
    }
}

/* ========================================
   可访问性 - 必要的增强
   ======================================== */

/* 键盘导航 */
*:focus-visible {
    outline: 2px solid #00458E;
    outline-offset: 2px;
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 触摸目标 */
.betech-nav-item,
#betech-chat-send,
.header-action-btn {
    min-width: 44px;
    min-height: 44px;
}

/* 安全区域 */
.betech-mobile-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* ========================================
   暗黑模式 - 简洁实现
   ======================================== */
@media (prefers-color-scheme: dark) {
    #betech-chat-window {
        background: #1f2937;
    }
    
    #betech-chat-messages {
        background: #111827;
    }
    
    .message-bubble.bot {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }
    
    .file-item {
        background: #374151;
        border-color: #4b5563;
    }
    
    #betech-chat-input-area {
        background: #1f2937;
        border-color: #374151;
    }
    
    #betech-chat-input {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    #betech-chat-widget,
    .betech-mobile-nav {
        display: none !important;
    }
}
