* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 20%, #90caf9 40%, #64b5f6 60%, #42a5f5 80%, #2196f3 100%);
    background-size: 400% 400%;
    animation: gradientShift 25s ease infinite;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 0;
    color: #1a237e;
    overflow-x: hidden;
    position: relative;
    /* 优化字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 动态渐变背景动画 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 添加装饰性背景元素 - 浅蓝色光效 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(100, 181, 246, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(66, 165, 245, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 50% 10%, rgba(187, 222, 251, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(144, 202, 249, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 欢迎 GIF 展示 */
.welcome-gif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(227, 242, 253, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    visibility: visible;
}

.welcome-gif-overlay.hiding {
    opacity: 0;
    visibility: hidden;
}

.welcome-gif-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    animation: welcomeFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-gif {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: welcomeFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

@keyframes welcomeFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

/* 数字人区域 - 更自然的展示 */
.avatar-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 20px 24px;
    position: relative;
    background: transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.avatar-section.scrolled {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0;
    z-index: 100;
    justify-content: flex-end;
    align-items: flex-start;
    pointer-events: auto;
}

.avatar-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-section.scrolled .avatar-wrapper {
    justify-content: flex-end;
    align-items: flex-start;
}

.avatar-image {
    width: 160px;
    height: 160px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* 圆形图标 */
    border-radius: 50%;
    /* 更柔和的阴影效果 */
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: transparent;
    background-color: transparent;
    mix-blend-mode: normal;
    image-rendering: -webkit-optimize-contrast;
    animation: avatarFloat 6s ease-in-out infinite;
    /* 确保圆形显示 */
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}

.avatar-section.scrolled .avatar-image {
    width: 80px;
    height: 80px;
    animation: none;
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        box-shadow: 
            0 16px 48px rgba(0, 0, 0, 0.12),
            0 4px 16px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 
            0 20px 56px rgba(0, 0, 0, 0.16),
            0 6px 20px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.avatar-image:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.25),
        0 12px 35px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.avatar-section.scrolled .avatar-image:hover {
    transform: translateY(-3px) scale(1.05);
}

/* 对话区域 - 现代化玻璃态设计 */
.chat-section {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 32px 32px 0 0;
    border-top: 1px solid rgba(66, 165, 245, 0.2);
    border-left: 1px solid rgba(66, 165, 245, 0.15);
    border-right: 1px solid rgba(66, 165, 245, 0.15);
    padding: 32px 24px 140px;
    box-shadow: 
        0 -8px 40px rgba(33, 150, 243, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(66, 165, 245, 0.1);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 240px);
    margin-top: auto;
    position: relative;
    z-index: 5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 2px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
}

/* 消息样式 - 苹果风格 */
.message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message.user {
    align-items: flex-end;
}

.message.ai {
    align-items: flex-start;
}

.message-bubble {
    max-width: 72%;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
    letter-spacing: 0.01em;
    font-weight: 400;
    /* 优化字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 50%, #1976d2 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 
        0 6px 20px rgba(33, 150, 243, 0.25),
        0 2px 8px rgba(66, 165, 245, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-weight: 450;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #1a237e;
    border-bottom-left-radius: 4px;
    font-weight: 400;
    letter-spacing: 0.01em;
    border: 1px solid rgba(66, 165, 245, 0.2);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 欢迎消息特殊样式 - 与建议框宽度一致 */
.message.ai:first-child .message-bubble {
    max-width: 100%;
}

/* Markdown样式 */
.message-bubble .markdown-h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 10px 0;
    color: #1a237e;
    line-height: 1.4;
}

.message-bubble .markdown-h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 8px 0;
    color: #1a237e;
    line-height: 1.4;
}

.message-bubble .markdown-h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 8px 0 6px 0;
    color: #1a237e;
    line-height: 1.4;
}

.message-bubble .markdown-list {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

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

.message-bubble .markdown-list-item {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.message-bubble ul.markdown-list .markdown-list-item:before {
    content: "•";
    position: absolute;
    left: 8px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 18px;
}

.message-bubble ol.markdown-list {
    counter-reset: list-counter;
    padding-left: 24px;
}

.message-bubble ol.markdown-list .markdown-list-item {
    counter-increment: list-counter;
    list-style: none;
    padding-left: 28px;
}

.message-bubble ol.markdown-list .markdown-list-item:before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 8px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.message-bubble .markdown-code-block {
    background: rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.message-bubble .markdown-code-block code {
    background: transparent;
    padding: 0;
    color: #1a237e;
    white-space: pre;
}

.message-bubble .markdown-inline-code {
    background: rgba(66, 165, 245, 0.12);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #2196f3;
    font-weight: 500;
    border: 1px solid rgba(66, 165, 245, 0.2);
}

.message-bubble strong {
    font-weight: 600;
    color: #1a237e;
}

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

.message-bubble a {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    border-bottom: 2px solid rgba(33, 150, 243, 0.4);
    transition: all 0.3s ease;
    font-weight: 500;
}

.message-bubble a:hover {
    border-bottom-color: #2196f3;
    filter: brightness(1.1);
}

/* 思考动效 */
.thinking {
    display: flex;
    align-items: center;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thinking-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(66, 165, 245, 0.2);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 72%;
}

.thinking-text {
    font-size: 15px;
    color: #2196f3;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    animation: thinkingPulseText 1.5s ease-in-out infinite;
}

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

.thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    animation: thinkingPulse 1.4s infinite;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.25);
    flex-shrink: 0;
}

.thinking-dots .thinking-dot:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots .thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots .thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

@keyframes thinkingPulseText {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* AI回答内容 */
.ai-response {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 20px;
    max-width: 72%;
    border: 1px solid rgba(66, 165, 245, 0.2);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.response-section {
    margin-bottom: 16px;
}

.response-section:last-child {
    margin-bottom: 0;
}

.response-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 50%, #1976d2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
    /* 优化标题字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.response-content {
    font-size: 15px;
    line-height: 1.75;
    color: #1a237e;
    letter-spacing: 0.01em;
    font-weight: 400;
    /* 优化内容字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 答案格式化样式 */
.answer-item {
    margin: 10px 0;
    padding: 12px 16px;
    background: rgba(66, 165, 245, 0.12);
    border-left: 3px solid rgba(33, 150, 243, 0.5);
    border-radius: 8px;
    line-height: 1.8;
    color: #1a237e;
    box-shadow: 
        0 2px 8px rgba(33, 150, 243, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.answer-item:hover {
    background: rgba(66, 165, 245, 0.18);
    border-left-color: rgba(33, 150, 243, 0.7);
}

.answer-step {
    margin: 14px 0;
    padding: 14px 18px;
    background: rgba(100, 181, 246, 0.15);
    border-left: 3px solid rgba(33, 150, 243, 0.6);
    border-radius: 8px;
    font-weight: 500;
    line-height: 1.8;
    color: #1a237e;
    box-shadow: 
        0 3px 10px rgba(33, 150, 243, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
}

.answer-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    border-radius: 8px 0 0 8px;
}

.answer-text {
    margin: 10px 0;
    line-height: 1.85;
    color: #1a237e;
    padding: 6px 0;
    letter-spacing: 0.01em;
}

/* 相关问题按钮 */
.related-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.related-question-btn {
    padding: 12px 18px;
    background: rgba(66, 165, 245, 0.15);
    border: 1px solid rgba(66, 165, 245, 0.3);
    border-radius: 12px;
    color: #2196f3;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    line-height: 1.6;
    -webkit-tap-highlight-color: rgba(66, 165, 245, 0.2);
    touch-action: manipulation;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.08);
}

.related-question-btn:hover {
    background: rgba(66, 165, 245, 0.25);
    border-color: rgba(66, 165, 245, 0.5);
    color: #1976d2;
    transform: translateX(4px);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.2),
        0 2px 6px rgba(100, 181, 246, 0.15);
}

.related-question-btn:active {
    transform: translateX(2px);
}

.response-list {
    list-style: none;
    padding-left: 0;
}

.response-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.response-list li:before {
    content: "✓";
    position: absolute;
    left: 2px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    font-size: 18px;
    top: 10px;
    line-height: 1;
}

.policy-btn {
    margin-top: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.25);
    border: none;
    /* 优化按钮字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.policy-btn:hover {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35);
}

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

/* 转接人工提示 */
.transfer-notice {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 50%, #1565c0 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 72%;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    font-weight: 500;
    box-shadow: 
        0 6px 20px rgba(33, 150, 243, 0.35),
        0 2px 8px rgba(21, 101, 192, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    animation: transferPulse 2s ease-in-out infinite;
    /* 优化字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transfer-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: transferShine 3s ease-in-out infinite;
}

@keyframes transferPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 6px 20px rgba(33, 150, 243, 0.35),
            0 2px 8px rgba(21, 101, 192, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 
            0 8px 24px rgba(33, 150, 243, 0.4),
            0 3px 10px rgba(21, 101, 192, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
}

@keyframes transferShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.transfer-icon {
    font-size: 24px;
    flex-shrink: 0;
    animation: transferIconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes transferIconBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.05);
    }
}

/* 预设场景按钮 - 在交互框内 */
.quick-scenarios {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.scenario-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    font-size: 15px;
    border: 1px solid rgba(66, 165, 245, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #1a237e;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.01em;
    width: 100%;
    justify-content: flex-start;
    /* 优化按钮字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: rgba(66, 165, 245, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.scenario-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 24px rgba(33, 150, 243, 0.15),
        0 2px 8px rgba(66, 165, 245, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(66, 165, 245, 0.35);
}

.scenario-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.scenario-icon {
    font-size: 20px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-btn:hover .scenario-icon {
    transform: scale(1.1) rotate(5deg);
}

.scenario-text {
    flex: 1;
    text-align: left;
}

/* 输入区域样式已在上面定义，这里删除重复定义 */

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 24px;
    padding: 8px 8px 8px 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 1200px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 6px 20px rgba(33, 150, 243, 0.2),
        0 2px 8px rgba(66, 165, 245, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(66, 165, 245, 0.5);
    transform: translateY(-1px);
}

.voice-btn {
    background: rgba(66, 165, 245, 0.15);
    border: 1px solid rgba(66, 165, 245, 0.25);
    padding: 8px;
    cursor: pointer;
    color: #2196f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.15);
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: rgba(66, 165, 245, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.voice-btn:hover {
    background: rgba(66, 165, 245, 0.25);
    border-color: rgba(66, 165, 245, 0.4);
    color: #1976d2;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.2);
}

.voice-btn.recording {
    color: #fff;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.chat-input {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    color: #1a237e;
    letter-spacing: 0.01em;
    font-weight: 400;
    /* 优化输入框字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 移动端优化 */
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

.chat-input::placeholder {
    color: rgba(26, 35, 126, 0.4);
    font-weight: 400;
}

.send-btn {
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 50%, #1976d2 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: rgba(66, 165, 245, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.send-btn:hover {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 50%, #1976d2 100%);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 6px 20px rgba(33, 150, 243, 0.4),
        0 2px 8px rgba(66, 165, 245, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

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

.send-btn:disabled {
    background: rgba(199, 199, 204, 0.5);
    cursor: not-allowed;
    transform: scale(1);
    box-shadow: none;
}

.voice-status {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(26, 35, 126, 0.6);
    text-align: center;
    min-height: 18px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.voice-status.recording {
    color: #f5576c;
    font-weight: 500;
}

/* AI免责声明 */
.ai-disclaimer {
    text-align: center;
    font-size: 11px;
    color: rgba(26, 35, 126, 0.6);
    margin-top: 8px;
    padding: 0 4px;
    letter-spacing: 0.01em;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 政策弹窗 - 现代化设计 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.01em;
    /* 优化标题字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.modal-close {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 22px;
    color: #1d1d1f;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #f5576c;
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.75;
    color: #1d1d1f;
    background: rgba(255, 255, 255, 0.1);
}

.policy-meta {
    color: rgba(29, 29, 31, 0.65);
    font-size: 13px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.01em;
    font-weight: 400;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
}

.policy-text {
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
    letter-spacing: 0.01em;
    font-weight: 400;
    color: #1d1d1f;
    /* 优化政策文本字体 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 移动端适配 */
@media (max-width: 768px) {
    html {
        height: -webkit-fill-available;
    }

    body {
        padding: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .welcome-gif {
        max-width: 85%;
        max-height: 70vh;
    }

    .welcome-gif-container {
        padding: 15px;
    }

    .container {
        padding: 0 12px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .avatar-section {
        padding: 32px 12px 16px;
    }

    .avatar-section.scrolled {
        top: 12px;
        right: 12px;
    }

    .avatar-image {
        width: 140px;
        height: 140px;
    }

    .avatar-section.scrolled .avatar-image {
        width: 64px;
        height: 64px;
    }

    .chat-section {
        border-radius: 24px 24px 0 0;
        padding: 24px 16px 140px;
        min-height: calc(100vh - 200px);
        min-height: calc(100vh - 200px);
        min-height: calc(100dvh - 200px);
    }

    .chat-input-area {
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .ai-disclaimer {
        font-size: 10px;
        margin-top: 6px;
        margin-bottom: 0;
    }

    .input-wrapper {
        padding: 6px 6px 6px 14px;
        border-radius: 20px;
    }

    .chat-messages {
        min-height: 240px;
        gap: 10px;
        margin-bottom: 6px;
    }

    .message-bubble {
        max-width: 82%;
        font-size: 14px;
        padding: 12px 16px;
        line-height: 1.6;
        border-radius: 16px;
    }

    .message.user .message-bubble {
        border-bottom-right-radius: 3px;
    }

    .message.ai .message-bubble {
        border-bottom-left-radius: 3px;
    }

    .ai-response {
        max-width: 82%;
        padding: 16px;
        border-radius: 16px;
        border-bottom-left-radius: 3px;
    }

    .thinking-bubble {
        max-width: 82%;
        padding: 12px 16px;
        border-radius: 16px;
        font-size: 14px;
    }

    .thinking-text {
        font-size: 14px;
    }

    .thinking-dot {
        width: 7px;
        height: 7px;
    }

    .transfer-notice {
        padding: 14px 16px;
        font-size: 14px;
        gap: 10px;
        max-width: 82%;
        border-radius: 16px;
    }

    .transfer-icon {
        font-size: 20px;
    }

    .scenario-btn {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 14px;
    }

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

    .input-wrapper {
        padding: 6px 6px 6px 14px;
        border-radius: 20px;
        position: relative;
    }

    .chat-input {
        font-size: 14px;
        /* 防止iOS自动缩放 */
        font-size: 16px;
    }

    /* 防止iOS输入框聚焦时页面缩放 */
    @supports (-webkit-touch-callout: none) {
        .chat-input {
            font-size: 16px !important;
        }
    }

    .voice-btn,
    .send-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        touch-action: manipulation;
    }

    .modal-content {
        max-height: 90vh;
        margin: 12px;
        border-radius: 24px;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .welcome-gif {
        max-width: 80%;
        max-height: 60vh;
    }

    .welcome-gif-container {
        padding: 10px;
    }

    .container {
        padding: 0 8px;
    }

    .avatar-section {
        padding: 24px 8px 12px;
    }

    .avatar-image {
        width: 120px;
        height: 120px;
    }

    .avatar-section.scrolled .avatar-image {
        width: 56px;
        height: 56px;
    }

    .chat-section {
        padding: 20px 12px 130px;
        border-radius: 20px 20px 0 0;
        min-height: calc(100vh - 180px);
        min-height: calc(100dvh - 180px);
    }

    .chat-input-area {
        padding: 8px 12px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .ai-disclaimer {
        font-size: 9px;
        margin-top: 5px;
        margin-bottom: 0;
    }

    .input-wrapper {
        padding: 5px 5px 5px 12px;
    }

    .chat-messages {
        min-height: 200px;
        gap: 8px;
        margin-bottom: 4px;
    }

    .message-bubble {
        max-width: 88%;
        font-size: 13px;
        padding: 10px 14px;
        line-height: 1.6;
        border-radius: 14px;
    }

    .ai-response {
        max-width: 88%;
        padding: 14px;
        border-radius: 14px;
    }

    .thinking-bubble {
        max-width: 88%;
        padding: 10px 14px;
        border-radius: 14px;
        font-size: 13px;
    }

    .thinking-text {
        font-size: 13px;
    }

    .thinking-dot {
        width: 6px;
        height: 6px;
    }

    .thinking-dots {
        gap: 5px;
    }

    .transfer-notice {
        padding: 12px 14px;
        font-size: 13px;
        gap: 8px;
        max-width: 88%;
        border-radius: 14px;
    }

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

    .scenario-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

    .input-wrapper {
        padding: 5px 5px 5px 12px;
    }

    .chat-input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 滚动条样式 - 现代化设计 */
.chat-messages::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.quick-scenarios::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.quick-scenarios::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2.5px;
}

.chat-messages::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.quick-scenarios::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    border-radius: 2.5px;
    border: none;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.quick-scenarios::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
}
