/* AI客服系统 - 聊天页面样式 - 与主页保持一致 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--background) !important;
    min-height: 100vh;
    min-height: 100dvh; /* 动态视口高度，支持移动端 */
    color: var(--text-color);
    overflow: hidden;
}

.container {
    min-height: 100vh;
    min-height: 100dvh; /* 动态视口高度，支持移动端 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 聊天卡片 - 自适应尺寸 */
.chat-card {
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px); /* 动态视口高度，支持移动端 */
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: cardFadeIn 0.8s ease-out;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 顶部标题栏 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: var(--button-secondary-bg, rgba(0, 0, 0, 0.05));
    border: none;
    border-radius: var(--border-radius-md, 12px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--button-secondary-color, var(--text-color-secondary, #666));
}

.back-btn:hover {
    background: var(--button-secondary-hover, rgba(0, 0, 0, 0.1));
    color: var(--text-color, #333);
    transform: scale(1.05);
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
    margin: 0;
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-indicator {
    font-size: 12px;
    color: #00C851;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00C851;
    border-radius: 50%;
    display: inline-block;
}

.connection-status {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px 1px 5px; /* top right bottom left */
    border-radius: 3px;
    transition: all 0.3s ease;
    display: inline-block;
    width: fit-content;
}

.connection-status.connected {
    color: #00C851;
    background: rgba(0, 200, 81, 0.1);
}

.connection-status.disconnected {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.connection-status.reconnecting {
    color: #ffa726;
    background: rgba(255, 167, 38, 0.1);
    animation: pulse 1.5s infinite;
}

.connection-status.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* 系统消息样式 */
.system-message {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.system-message.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
    max-width: 80%;
    margin: 10px auto;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f44336;
    font-size: 14px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 用户头像容器 */
.user-avatar-container {
    position: relative;
}

/* 用户头像 */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--avatar-gradient, linear-gradient(135deg, #FF8A65, #FF7043));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--avatar-shadow, 0 2px 8px rgba(255, 138, 101, 0.3));
    position: relative;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--avatar-shadow, 0 4px 12px rgba(255, 138, 101, 0.4));
}

.user-avatar:hover::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    z-index: -1;
    animation: pulse 2s infinite;
}

.avatar-text {
    color: var(--button-primary-color, white);
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
}

/* 用户信息卡片 */
.user-info-card {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    min-height: 100px;
    background: var(--card-background, #ffffff);
    border-radius: var(--border-radius-md, 12px);
    padding: 16px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color-input, rgba(0, 0, 0, 0.1));
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 99999;
    /* 确保不受父元素毛玻璃效果影响 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* 初始状态隐藏，避免闪烁 */
    visibility: hidden;
    /* 初始位置设置为头像位置，避免从右上角飞入 */
    top: auto;
    right: auto;
}

.user-info-card.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-email {
    font-size: 12px;
    color: var(--text-color, #333);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.logout-btn {
    background: #ff3b30;
    color: var(--button-primary-color, white);
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

.logout-btn:hover {
    background: #d70015;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 59, 48, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* 聊天内容区域 - 占上边六分之五 */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(3px);
    /* 确保不影响子元素的定位 */
    position: relative;
    z-index: 1;
}

/* 消息组 */
.message-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* AI消息 - 靠左显示，无气泡 */
.ai-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 90%;
    margin-right: auto;
}

.ai-message .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ai-avatar-gradient, linear-gradient(135deg, #007AFF, #0056CC));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--button-primary-color, white);
    flex-shrink: 0;
    box-shadow: var(--ai-avatar-shadow, 0 2px 8px rgba(0, 122, 255, 0.3));
}

.ai-message .message-content {
    background: none;
    border: none;
    padding: 12px 0;
    box-shadow: none;
    width: 100%;
}

/* 用户消息 - 靠右显示，保持蓝色气泡 */
.user-message {
    display: flex;
    align-items: flex-start;
    max-width: 80%;
    margin-left: auto;
    justify-content: flex-end;
    position: relative;
}

.user-message .message-content {
    background: var(--button-primary-bg, #007AFF);
    color: var(--button-primary-color, white);
    border-radius: 18px 18px 4px 18px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    max-width: 100%;
}

/* 确保用户消息中没有任何头像样式 */
.user-message .message-avatar {
    display: none !important;
}

/* 用户消息后的分割线 */
.user-message::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 122, 255, 0.3) 20%, 
        rgba(0, 122, 255, 0.6) 50%, 
        rgba(0, 122, 255, 0.3) 80%, 
        transparent 100%);
    border-radius: 1px;
}

.message-text {
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Markdown样式支持 */
.ai-message .message-text h1,
.ai-message .message-text h2,
.ai-message .message-text h3,
.ai-message .message-text h4,
.ai-message .message-text h5,
.ai-message .message-text h6 {
    margin: 4px 0 2px 0;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
}

.ai-message .message-text h1 { font-size: 20px; }
.ai-message .message-text h2 { font-size: 18px; }
.ai-message .message-text h3 { font-size: 16px; }

.ai-message .message-text p {
    margin: 2px 0;
}

.ai-message .message-text ul,
.ai-message .message-text ol {
    margin: 2px 0;
    padding-left: 20px;
}

.ai-message .message-text li {
    margin: 1px 0;
}

/* 处理AI消息中Markdown解析后的HTML元素的换行问题 */
/* 只针对特定的Markdown元素，不影响纯文本内容 */
.ai-message .message-text h1,
.ai-message .message-text h2,
.ai-message .message-text h3,
.ai-message .message-text h4,
.ai-message .message-text h5,
.ai-message .message-text h6 {
    white-space: normal !important;
}

.ai-message .message-text ul,
.ai-message .message-text ol {
    white-space: normal !important;
}

.ai-message .message-text li {
    white-space: normal !important;
}

.ai-message .message-text code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
}

.ai-message .message-text pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: var(--border-radius-sm, 8px);
    overflow-x: auto;
    margin: 3px 0;
}

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

.ai-message .message-text blockquote {
    border-left: 4px solid #007AFF;
    padding-left: 16px;
    margin: 3px 0;
    color: var(--text-color-secondary, #666);
    font-style: italic;
}

.ai-message .message-text strong {
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
}

.ai-message .message-text em {
    font-style: italic;
}

.ai-message .message-text a {
    color: #007AFF;
    text-decoration: none;
}

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

.ai-message .message-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 3px 0;
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    border-radius: var(--border-radius-sm, 8px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message .message-text th,
.ai-message .message-text td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-message .message-text th {
    background: rgba(0, 122, 255, 0.1);
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
}

.ai-message .message-text tr:last-child td {
    border-bottom: none;
}

.ai-message .message-text tr:hover {
    background: rgba(0, 122, 255, 0.05);
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 8px;
    font-weight: 500;
}

/* 输入区域 - 占下边六分之一 */
.chat-input-area {
    padding: 20px 30px;
    background: var(--card-background-input-area, var(--card-background, rgba(255, 255, 255, 0.95)));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.input-container {
    max-width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    border-radius: 24px;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-wrapper:focus-within {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color, #1a1a1a);
    resize: none;
    max-height: 120px;
    min-height: 40px;
    font-family: inherit;
    padding: 8px 0;
}

.message-input::placeholder {
    color: #999;
}

.send-btn {
    background: var(--button-primary-bg, #007AFF);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--button-primary-color, white);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.send-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

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

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 卡片进入动画 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 消息进入动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-group {
    animation: messageSlideIn 0.3s ease-out;
}

/* 滚动条样式 */
.chat-content::-webkit-scrollbar {
    width: 6px;
}

.chat-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */

/* 超大屏幕 - 保持良好比例，左右留白 */
@media (min-width: 1400px) {
    .chat-card {
        max-width: 1000px;
        width: 80%;
    }
}

/* 大屏幕 - 适中比例 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .chat-card {
        max-width: 900px;
        width: 85%;
    }
}

/* 中等屏幕 - 开始填充更多空间 */
@media (min-width: 992px) and (max-width: 1199px) {
    .chat-card {
        max-width: 800px;
        width: 90%;
    }
}

/* 平板屏幕 - 优先显示聊天界面 */
@media (min-width: 769px) and (max-width: 991px) {
    .container {
        padding: 15px;
    }
    
    .chat-card {
        max-width: 100%;
        width: 100%;
        height: calc(100vh - 30px);
        height: calc(100dvh - 30px); /* 动态视口高度，支持移动端 */
        border-radius: 20px;
    }
    
    .chat-header {
        padding: 18px 25px;
    }
    
    .chat-title {
        font-size: 19px;
    }
    
    .chat-content {
        padding: 18px 25px;
    }
    
    .chat-input-area {
        padding: 18px 25px;
    }
    
    .ai-message,
    .user-message {
        max-width: 85%;
    }
}

/* 小屏幕 - 完全填充，优先聊天界面 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .chat-card {
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px); /* 动态视口高度，支持移动端 */
        border-radius: 16px;
        max-width: 100%;
        width: 100%;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-title {
        font-size: 18px;
    }
    
    .chat-content {
        padding: 16px 20px;
    }
    
    .chat-input-area {
        padding: 16px 20px;
        /* 确保输入区域在移动端可见 */
        min-height: 70px;
    }
    
    .input-wrapper {
        /* 确保输入框在移动端可见 */
        min-height: 50px;
    }
    
    .message-input {
        /* 移动端输入框优化 */
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 50px;
    }
    
    .send-btn {
        /* 移动端按钮优化 */
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .ai-message,
    .user-message {
        max-width: 90%;
    }
    
    .message-text {
        font-size: 14px;
    }
}

/* 手机屏幕 - 完全填充 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .chat-card {
        height: calc(100vh - 10px);
        height: calc(100dvh - 10px); /* 动态视口高度，支持移动端 */
        border-radius: var(--border-radius-md, 12px);
        max-width: 100%;
        width: 100%;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-content {
        padding: 12px 16px;
    }
    
    .chat-input-area {
        padding: 12px 16px;
        /* 确保输入区域在移动端可见 */
        min-height: 60px;
        /* 防止键盘弹出时被遮挡 */
        position: relative;
        z-index: 1000;
    }
    
    .input-wrapper {
        padding: 10px 12px;
        /* 确保输入框在移动端可见 */
        min-height: 44px;
    }
    
    .message-input {
        /* 移动端输入框优化 */
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 44px;
        padding: 10px 0;
        /* 防止Android键盘遮挡 */
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    .send-btn {
        /* 移动端按钮优化 */
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .ai-message .message-content,
    .user-message .message-content {
        padding: 12px 16px;
    }
    
    .ai-message,
    .user-message {
        max-width: 95%;
    }
}

/* 移动端特殊优化 - 针对Android和iOS */
@media (max-width: 768px) {
    /* 确保视口高度正确计算 */
    html, body {
        height: 100%;
        height: 100dvh;
        overflow: hidden;
    }
    
    /* 防止移动端滚动问题 */
    .chat-content {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* 输入框在移动端的特殊处理 */
    .message-input {
        /* 防止iOS自动缩放 */
        font-size: 16px;
        /* 防止Android键盘遮挡 */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 0;
        /* 确保在移动端正确显示 */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* 确保输入区域始终可见 */
    .chat-input-area {
        /* 防止键盘弹出时被遮挡 */
        position: relative;
        z-index: 1000;
        /* 确保有足够的最小高度 */
        min-height: 60px;
        /* 防止在移动端被压缩 */
        flex-shrink: 0;
    }
}

/* 背景动画效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
    }
}

/* 加载消息样式 */
.loading-message {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    padding: 0 20px;
}

.loading-content {
    background: var(--card-background, rgba(255, 255, 255, 0.95));
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 发送按钮禁用状态 */
#sendBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

#sendBtn:disabled:hover {
    background-color: #6366f1 !important;
    transform: none !important;
}

/* 输入框禁用状态 */
#messageInput:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f3f4f6;
}

/* AI思考中提示样式 */
.thinking-message {
    opacity: 0.9;
    margin-left: 12px;
}

.thinking-text {
    color: #007AFF; /* 使用AI头像的蓝色 */
    font-style: italic;
    font-weight: 500;
    font-size: 15px;
}

.thinking-text .char {
    display: inline-block;
    animation: charBounce 0.6s infinite ease-in-out;
}

.thinking-text .char:nth-child(1) { animation-delay: 0s; }
.thinking-text .char:nth-child(2) { animation-delay: 0.1s; }
.thinking-text .char:nth-child(3) { animation-delay: 0.2s; }
.thinking-text .char:nth-child(4) { animation-delay: 0.3s; }
.thinking-text .char:nth-child(5) { animation-delay: 0.4s; }
.thinking-text .char:nth-child(6) { animation-delay: 0.5s; }
.thinking-text .char:nth-child(7) { animation-delay: 0.6s; }
.thinking-text .char:nth-child(8) { animation-delay: 0.7s; }
.thinking-text .char:nth-child(9) { animation-delay: 0.8s; }
.thinking-text .char:nth-child(10) { animation-delay: 0.9s; }
.thinking-text .char:nth-child(11) { animation-delay: 1.0s; }
.thinking-text .char:nth-child(12) { animation-delay: 1.1s; }
.thinking-text .char:nth-child(13) { animation-delay: 1.2s; }
.thinking-text .char:nth-child(14) { animation-delay: 1.3s; }
.thinking-text .char:nth-child(15) { animation-delay: 1.4s; }
.thinking-text .char:nth-child(16) { animation-delay: 1.5s; }
.thinking-text .char:nth-child(17) { animation-delay: 1.6s; }
.thinking-text .char:nth-child(18) { animation-delay: 1.7s; }
.thinking-text .char:nth-child(19) { animation-delay: 1.8s; }
.thinking-text .char:nth-child(20) { animation-delay: 1.9s; }
.thinking-text .char:nth-child(21) { animation-delay: 2.0s; }
.thinking-text .char:nth-child(22) { animation-delay: 2.1s; }
.thinking-text .char:nth-child(23) { animation-delay: 2.2s; }
.thinking-text .char:nth-child(24) { animation-delay: 2.3s; }
.thinking-text .char:nth-child(25) { animation-delay: 2.4s; }
.thinking-text .char:nth-child(26) { animation-delay: 2.5s; }
.thinking-text .char:nth-child(27) { animation-delay: 2.6s; }
.thinking-text .char:nth-child(28) { animation-delay: 2.7s; }
.thinking-text .char:nth-child(29) { animation-delay: 2.8s; }
.thinking-text .char:nth-child(30) { animation-delay: 2.9s; }

@keyframes charBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

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

/* 错误消息样式 */
.error-message {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    padding: 0 20px;
}

.error-content {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 59, 48, 0.3);
}
