/* =============================================
   公共样式 - Common Styles
   ============================================= */

/* --- 基础重置 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 去掉所有可点击元素的默认效果 */
button, a, .service-item, .qa-item, .try-btn, .quick-tag, .action-btn, .retry-btn, .send-btn, .back-btn, .refresh-btn, .mic-icon, .keyboard-btn, .mic-btn, .voice-talk-btn, .department-book-btn, .smart-guide-btn, .dept-book-btn, .dept-book-btn-primary {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* --- 主容器 --- */
.app-container {
    width: 100%;
    height: 100vh;
    background: linear-gradient(180deg, #e6eeff 0%, #f7f9fc 30%, #f7f9fc 100%);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- 聊天容器 --- */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- 聊天消息列表 --- */
.chat-messages {
    flex: 1;
    padding: 15px;
    /* 为底部输入栏留出空间，避免消息被遮挡 */
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    overflow-y: auto;
    scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

/* --- 消息项基础样式 --- */
.message-item {
    display: flex;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease-out;
}

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

/* --- 用户消息 - 右侧 --- */
.message-item.user {
    justify-content: flex-end;
}

.message-item.user .message-bubble {
    background: linear-gradient(135deg, #4a9fff, #2d7be5);
    color: white;
    border-radius: 20px 20px 4px 20px;
    padding: 12px 18px;
    max-width: 95%;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(74, 159, 255, 0.3);
}

/* --- AI 消息 - 左侧 --- */
.message-item.ai {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
}

.message-item.ai .message-bubble {
    background: #fff;
    color: #333;
    border-radius: 20px 20px 20px 4px;
    padding: 16px 18px;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* --- 播放中的波浪蓝光效果 --- */
.message-item.ai .message-bubble.speaking {
    background: linear-gradient(135deg, #e6f2ff 0%, #ffffff 50%, #e6f2ff 100%);
    box-shadow: 0 4px 20px rgba(74, 159, 255, 0.3), 0 0 0 2px rgba(74, 159, 255, 0.1);
}

.message-item.ai .message-bubble.speaking::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(74, 159, 255, 0.2) 50%,
        transparent 100%);
    animation: waveMove 2s ease-in-out infinite;
}

@keyframes waveMove {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.message-item.ai .message-content {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* --- 系统消息 - 左侧，无免责声明 --- */
.message-item.system {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
}

.message-item.system .message-bubble {
    background: #fff;
    color: #333;
    border-radius: 20px 20px 20px 4px;
    padding: 16px 18px;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

/* --- AI 提示文字 --- */
.message-item.ai .ai-disclaimer {
    font-size: 12px;
    color: #aaa;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* --- Markdown 样式 --- */
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
    margin: 8px 0 4px 0;
    font-weight: 600;
}

.message-bubble h2 {
    font-size: 16px;
}

.message-bubble h3 {
    font-size: 15px;
}

.message-bubble h4 {
    font-size: 14px;
}

.message-bubble strong {
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble a {
    color: #4a90ff;
    text-decoration: none;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
}

.message-bubble code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.message-bubble pre {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-bubble pre code {
    background: none;
    padding: 0;
}

.message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

.message-bubble th,
.message-bubble td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.message-bubble th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* --- 点赞/点踩按钮 --- */
.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    gap: 4px;
}

.action-btn {
    background: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.action-btn.active {
    color: #4a90ff;
}

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

/* --- 播放按钮特殊样式 --- */
.action-btn.speak-btn.playing {
    color: #4a90ff;
    background: #e8f2ff;
}

.action-btn.speak-btn.playing svg {
    animation: pulse 1s ease-in-out infinite;
}

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

/* --- 加载动画 --- */
.loading-bubble {
    padding: 16px 24px;
}

.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #4a90ff;
    border-radius: 50%;
    animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* --- Toast 提示 --- */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: toastFadeIn 0.3s ease-out;
}

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

/* --- 底部输入栏 --- */
.footer {
    padding: 12px 15px;
    /* iOS 安全区域适配 */
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    /* 固定在底部 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.input-box {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 15px;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    transition: border-color 0.2s;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.input-box::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.input-box:focus {
    border-color: #4a90ff;
}

.send-btn {
    background: linear-gradient(135deg, #4a9fff, #2d7be5);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(74, 159, 255, 0.3);
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 159, 255, 0.4);
}

.send-btn:active {
    transform: translateY(0);
}

/* 重新提问按钮 */
.retry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e8e8e8;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    margin: 15px auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #f9f9f9;
    border-color: #ddd;
}

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

/* --- 科室推荐卡片 --- */
.department-card {
    margin-top: 12px;
}

.department-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.department-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.department-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f8fc;
    border-radius: 12px;
    padding: 14px 16px;
    transition: background 0.2s;
}

.department-item:hover {
    background: #eef3fa;
}

.department-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.department-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e8f4ff 0%, #d4e8ff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.department-icon svg {
    width: 22px;
    height: 22px;
    fill: #4a90ff;
}

.department-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.department-book-btn {
    background: linear-gradient(90deg, #6ecfff, #4a90ff);
    color: white;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(74, 144, 255, 0.3);
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.department-book-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 255, 0.4);
}

.department-book-btn:active {
    transform: translateY(0);
}

/* --- 智能导诊入口 --- */
.smart-guide-entry {
    margin-top: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.smart-guide-entry::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 100px;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        right: -30%;
    }
    100% {
        right: 120%;
    }
}

.smart-guide-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.smart-guide-entry:active {
    transform: translateY(0);
}

.smart-guide-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.smart-guide-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.smart-guide-content {
    flex: 1;
}

.smart-guide-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.smart-guide-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.smart-guide-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.smart-guide-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
}

.smart-guide-btn:active {
    transform: scale(0.95);
}

.smart-guide-btn svg {
    width: 18px;
    height: 18px;
}

/* --- 医疗信息卡片 --- */
.medical-info-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e8ebf5;
}

.medical-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.medical-card-icon, .card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.medical-card-icon svg, .card-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.medical-card-title, .card-title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.medical-card-body {
    padding: 20px;
}

.medical-info-item {
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #f0f2f8;
    transition: all 0.2s;
}

.medical-info-item:hover {
    border-color: #e0e4f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.medical-info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-value {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.7;
}

.medical-info-item:first-child .info-value {
    font-size: 15px;
    font-weight: 500;
    color: #2d3748;
    background: linear-gradient(135deg, #fff5f5 0%, #fffaf0 100%);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #fc8181;
    margin-top: 4px;
}

.recommended-dept-card {
    margin: 0 20px 20px 20px;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border-radius: 14px;
    padding: 18px;
    border: 2px solid #bfdbfe;
    position: relative;
    overflow: hidden;
}

.recommended-dept-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 120px;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(-15deg);
    animation: shimmerSlow 4s infinite;
}

@keyframes shimmerSlow {
    0% {
        right: -30%;
    }
    100% {
        right: 120%;
    }
}

.dept-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
}

.dept-card-header svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.dept-card-body {
    position: relative;
    z-index: 1;
}

.dept-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.dept-reason {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 14px;
}

.dept-book-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.dept-book-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.dept-book-btn-primary:active {
    transform: translateY(0);
}

.dept-book-btn-primary svg {
    width: 18px;
    height: 18px;
}

/* ========== 麦克风按钮和语音模式 ========== */
/* 麦克风按钮 */
.mic-btn {
    width: 40px;
    height: 40px;
    background: #f5f7fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mic-btn:hover {
    background: #e8ecf0;
}

.mic-btn svg {
    width: 20px;
    height: 20px;
    fill: #00b4ff;
}

.voice-mode .mic-btn {
    display: none;
}

/* 语音输入按钮 */
.voice-talk-btn {
    display: none;
    flex: 1;
    background: linear-gradient(90deg, #66b5ff, #4089ff);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(64, 137, 255, 0.3);
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}

.voice-mode .voice-talk-btn {
    display: block;
}

.voice-talk-btn:active {
    background: linear-gradient(90deg, #4089ff, #2d6fd9);
    transform: scale(0.98);
}

.voice-talk-btn.recording {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* 返回键盘按钮 */
.keyboard-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: #f5f7fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.voice-mode .keyboard-btn {
    display: flex;
}

.keyboard-btn:hover {
    background: #e8ecf0;
}

.keyboard-btn svg {
    width: 20px;
    height: 20px;
    fill: #666;
}

/* 语音模式下隐藏输入框和发送按钮 */
.voice-mode .input-box,
.voice-mode .send-btn {
    display: none;
}

/* ========== 语音识别蒙层 ========== */
.voice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.voice-overlay.active {
    opacity: 1;
    visibility: visible;
}

.voice-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

.voice-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4a9fff, #2d7be5);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(74, 159, 255, 0.6);
}

.voice-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid rgba(74, 159, 255, 0.3);
    border-radius: 50%;
    animation: voiceRipple 1.5s ease-out infinite;
}

@keyframes voiceRipple {
    0% {
        width: 100px;
        height: 100px;
        opacity: 1;
    }
    100% {
        width: 180px;
        height: 180px;
        opacity: 0;
    }
}

.voice-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
    align-items: center;
}

.voice-waves span {
    width: 4px;
    background: white;
    border-radius: 2px;
    animation: voiceWave 0.8s ease-in-out infinite;
}

.voice-waves span:nth-child(1) {
    height: 20px;
    animation-delay: 0s;
}

.voice-waves span:nth-child(2) {
    height: 30px;
    animation-delay: 0.1s;
}

.voice-waves span:nth-child(3) {
    height: 40px;
    animation-delay: 0.2s;
}

.voice-waves span:nth-child(4) {
    height: 30px;
    animation-delay: 0.3s;
}

.voice-waves span:nth-child(5) {
    height: 20px;
    animation-delay: 0.4s;
}

@keyframes voiceWave {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

.voice-tip {
    text-align: center;
    color: white;
    transition: opacity 0.3s;
}

.voice-tip-main {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.voice-tip-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.voice-cancel-tip {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.voice-overlay.canceling .voice-animation {
    animation: shake 0.5s;
}

.voice-overlay.canceling .voice-animation::before,
.voice-overlay.canceling .voice-animation::after {
    border-color: rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.voice-overlay.canceling .voice-cancel-tip {
    opacity: 1;
}

.voice-overlay.canceling .voice-tip {
    opacity: 0;
}

/* --- 响应式适配 --- */
@media screen and (max-width: 768px) {
    .message-item.user .message-bubble,
    .message-item.ai .message-bubble,
    .message-item.system .message-bubble {
        max-width: 95%;
    }

    .dept-name {
        font-size: 16px;
    }
}


/* 快捷入口标签 */
.quick-tags {
    display: flex;
    flex-direction: column;
    padding: 10px 15px 10px 70px;
    gap: 10px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-tags.show {
    transform: translateY(0);
    opacity: 1;
}

.quick-tags-header {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.quick-tags-content {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 8px 8px;
    margin-right: -15px;
}

.quick-tags-content::-webkit-scrollbar {
    display: none;
}

.quick-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    flex-shrink: 0;
}

.quick-tag:hover {
    background: #f5f9ff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-tag svg {
    width: 20px;
    height: 20px;
}

.quick-tag.ai-service svg {
    fill: #4a90ff;
}

.quick-tag.guide svg {
    fill: #2ecc71;
}

.quick-tag-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.quick-tag-text {
    flex: 1;
}

/* 底部小头像 */
.footer-avatar {
    position: absolute;
    left: -5px;
    bottom: 70px;
    width: 90px;
    height: 90px;
    z-index: 15;
    pointer-events: none;
}

.footer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50% 50% 0 0;
    filter: drop-shadow(2px 2px 8px rgba(0,0,0,0.1));
}

