
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 414px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px 30px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid #764ba2;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.content {
    padding: 40px 20px 20px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    font-weight: bold;
    color: #999;
    position: relative;
}

.step.active {
    background: #667eea;
    color: white;
}

.step.completed {
    background: #4CAF50;
    color: white;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 2px;
    background: #e0e0e0;
}

.step.completed:not(:last-child)::after {
    background: #4CAF50;
}

.form-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timer {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    margin-top: 10px;
}

.report-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: none;
}

.report-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

/* 调整报告操作按钮样式，使其在报告下方更美观 */
.report-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e1e5e9;
}

.report-actions .btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.report-actions .regenerate-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    color: white;
}

.report-actions .regenerate-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.report-actions .restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.report-actions .restart-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 重新生成报告按钮样式 - 优化版 */
.regenerate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 35px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    min-width: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.regenerate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.regenerate-btn:hover::before {
    left: 100%;
}

.regenerate-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 另出一份报告按钮样式 - 优化版 */
.restart-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 35px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.25);
    min-width: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.restart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.restart-btn:hover::before {
    left: 100%;
}

.restart-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.regenerate-btn:active,
.restart-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
}

/* 添加按钮图标样式 */
.regenerate-btn::after {
    content: '🔄';
    margin-left: 4px;
    font-size: 14px;
}

.restart-btn::after {
    content: '📋';
    margin-left: 4px;
    font-size: 14px;
}

.report-header h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.report-content {
    line-height: 1.8;
    color: #555;
    position: relative;
}

/* 新增：美化Markdown渲染样式 */
.report-content h1,
.report-content h2,
.report-content h3,
.report-content h4,
.report-content h5,
.report-content h6 {
    color: #2c3e50;
    margin: 20px 0 15px 0;
    font-weight: 600;
    line-height: 1.4;
}

.report-content h1 {
    font-size: 28px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.report-content h2 {
    font-size: 24px;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 8px;
}

.report-content h3 {
    font-size: 20px;
    color: #667eea;
}

.report-content h4 {
    font-size: 18px;
    color: #764ba2;
}

.report-content p {
    margin: 15px 0;
    text-align: justify;
}

.report-content ul,
.report-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.report-content li {
    margin: 8px 0;
}

.report-content blockquote {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.report-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #e74c3c;
}

.report-content pre {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    overflow-x: auto;
}

.report-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-content th,
.report-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.report-content th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.report-content tr:hover {
    background: #f8f9fa;
}

.report-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.report-content em {
    color: #667eea;
    font-style: italic;
}

.report-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.report-content a:hover {
    border-bottom-color: #667eea;
}

/* 特殊内容块样式 */
.report-content .highlight-box {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    border: 1px solid #667eea30;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.report-content .highlight-box::before {
    content: '✨';
    position: absolute;
    top: -10px;
    left: 20px;
    background: white;
    padding: 0 10px;
    font-size: 20px;
}

.report-content .warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #f39c12;
}

.report-content .info-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #17a2b8;
}

.report-content.blurred {
    /* 移除全局模糊，改为通过JavaScript控制 */
    user-select: none;
    pointer-events: none;
}

/* 流式报告显示样式 */
.streaming-report {
    position: relative;
    min-height: 100px;
}

/* 优化流式报告内容的渲染效果 */
.streaming-report-content {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.8;
    color: #555;
    min-height: 20px; /* 确保即使没有内容也有最小高度 */
}

/* 流式内容中的标题样式 - 添加渐入动画 */
.streaming-report-content h1,
.streaming-report-content h2,
.streaming-report-content h3,
.streaming-report-content h4 {
    color: #2c3e50;
    margin: 20px 0 15px 0;
    font-weight: 600;
    line-height: 1.4;
    animation: fadeInUp 0.3s ease-out;
}

.streaming-report-content h1 {
    font-size: 28px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.streaming-report-content h2 {
    font-size: 24px;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 8px;
}

.streaming-report-content h3 {
    font-size: 20px;
    color: #667eea;
}

.streaming-report-content h4 {
    font-size: 18px;
    color: #764ba2;
}

/* 流式内容中的段落样式 */
.streaming-report-content p {
    margin: 15px 0;
    text-align: justify;
    animation: fadeInUp 0.2s ease-out;
}

/* 流式内容中的列表样式 */
.streaming-report-content ul,
.streaming-report-content ol {
    margin: 15px 0;
    padding-left: 30px;
    animation: fadeInUp 0.2s ease-out;
}

.streaming-report-content li {
    margin: 8px 0;
    line-height: 1.6;
}

/* 流式内容中的强调文本 */
.streaming-report-content strong {
    color: #2c3e50;
    font-weight: 600;
    background: linear-gradient(120deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.streaming-report-content em {
    color: #667eea;
    font-style: italic;
}

/* 流式内容中的代码样式 */
.streaming-report-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #e74c3c;
    border: 1px solid #e1e5e9;
}

.streaming-report-content pre {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    overflow-x: auto;
    animation: fadeInUp 0.3s ease-out;
}

.streaming-report-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: #2c3e50;
}

/* 优化流式显示时的光标位置和动画 */
.streaming-report .typing-cursor {
    display: inline-block;
    background-color: #667eea;
    width: 2px;
    height: 1.2em;
    margin-left: 2px;
    animation: reportBlink 1.2s infinite ease-in-out;
    vertical-align: text-bottom;
    will-change: opacity;
    position: relative;
    top: -2px;
}

/* 内容渐入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 光标闪烁动画 */
@keyframes reportBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 流式报告的半模糊效果优化 */
.streaming-report.half-blurred::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    backdrop-filter: blur(2px);
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.6));
    pointer-events: none;
    z-index: 1;
}

.report-content.half-blurred {
    user-select: none;
    pointer-events: none;
    position: relative;
}

/* 半模糊效果：下半部分简单模糊 */
.report-content.half-blurred::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%; /* 下半部分 */
    backdrop-filter: blur(3px);
    background: rgba(255, 255, 255, 0.4); /* 简单的半透明白色覆盖 */
    pointer-events: none;
    z-index: 1;
}

.blur-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(transparent, rgba(255,255,255,0.9));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.payment-amount {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.payment-option {
    padding: 15px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-option:hover {
    border-color: #667eea;
}

.payment-option.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.payment-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.payment-name {
    font-size: 12px;
    color: #666;
}

.payment-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.payment-buttons .btn {
    flex: 1;
}

.payment-status {
    text-align: center;
    margin: 20px 0;
}

#paymentTimer {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 10px;
}

.guidance-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    display: none;
}

.guidance-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.guidance-options {
    display: grid;
    gap: 15px;
}

.guidance-option {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.guidance-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.guidance-option h3 {
    color: #333;
    margin-bottom: 10px;
}

.guidance-option .price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

.guidance-option .description {
    color: #666;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.debug-info {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 12px;
    border: 1px solid #ffeaa7;
}

/* 商户信息水印样式 */
.merchant-watermark {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1;
    pointer-events: none;
}

.merchant-watermark p {
    margin: 0;
    font-size: 11px;
    color: #999;
    opacity: 0.4;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    transform: rotate(-15deg);
    user-select: none;
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .header {
        padding: 30px 15px 25px;
    }
    
    .content {
        padding: 30px 15px 15px;
    }
    
    .report-actions {
        gap: 15px;
        padding: 0 15px;
        margin-top: 20px;
    }
    
    .report-actions::before {
        width: 90%;
    }
    
    .regenerate-btn,
    .restart-btn {
        min-width: 150px;
        padding: 12px 24px;
        font-size: 14px;
        border-radius: 30px;
    }
}

/* 超小屏幕时垂直排列优化 */
@media (max-width: 360px) {
    .report-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .report-actions::before {
        width: 95%;
        height: calc(100% + 15px);
    }
    
    .regenerate-btn,
    .restart-btn {
        width: 220px;
        padding: 14px 24px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .report-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .report-actions .btn {
        max-width: none;
    }
    
    .report-generating-tip {
        padding: 20px 15px;
    }
    
    .generating-icon {
        font-size: 36px;
    }
    
    .report-generating-tip p {
        font-size: 16px;
    }
}

/* 情感咨询对话界面样式 - 改进版 */
.emotion-chat-modal {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.chat-modal {
    max-width: 900px;
    width: 95vw;
    height: 85vh;
    max-height: 700px;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: #ffffff;
}

.chat-header {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: white;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 20px rgba(255, 107, 157, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-text h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-text p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9em;
    font-weight: 300;
}

.close-chat {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 12px;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.user-avatar {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.message-content {
    flex: 1;
    max-width: 75%;
    min-width: 0; /* 重要：允许flex项目收缩到内容以下 */
}

.user-content {
    text-align: right;
}

/* 确保AI消息内容容器也是左对齐 */
.ai-message .message-content {
    text-align: left;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sender-name {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.message-time {
    font-size: 0.8em;
    color: #999;
    opacity: 0.7;
}

/* 确保流式消息容器的稳定性 */
.streaming-message {
    position: relative;
    min-height: 20px;
    text-align: left; /* 确保左对齐 */
}

.streaming-content {
    display: inline;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left; /* 确保左对齐 */
}

.message-text {
    background: white;
    padding: 18px 22px;
    border-radius: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
    color: #333;
    border: 1px solid #f0f0f0;
    position: relative;
    font-size: 17px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: left;
    width: 100%; /* 确保占满父容器 */
    box-sizing: border-box; /* 包含padding在宽度计算中 */
    overflow-wrap: anywhere; /* 更强的换行规则 */
    hyphens: auto; /* 启用连字符换行 */
}

/* AI回复内容格式化样式 - 简化版 */
.message-text p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text p:first-child {
    margin-top: 0;
}

/* 简化标题样式 */
.message-text h1, .message-text h2, .message-text h3, .message-text h4 {
    color: #2c3e50;
    font-weight: 600;
    margin: 16px 0 8px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-text h1 { font-size: 1.3em; }
.message-text h2 { font-size: 1.2em; }
.message-text h3 { font-size: 1.1em; }
.message-text h4 { font-size: 1.05em; }

/* 简化强调文本 - 移除背景色 */
.message-text strong {
    font-weight: 600;
    color: #2c3e50;
}

.message-text em {
    font-style: italic;
    color: #555;
}

/* 简化列表样式 */
.message-text ul, .message-text ol {
    margin: 12px 0;
    padding-left: 20px;
    list-style: disc;
}

.message-text ol {
    list-style: decimal;
}

.message-text li {
    margin: 4px 0;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 移除自定义列表样式 */
.message-text ul li::before,
.message-text ol li::before {
    display: none;
}

/* 简化代码样式 - 移除背景色和边框 */
.message-text code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 简化引用样式 */
.message-text blockquote {
    margin: 12px 0;
    padding: 8px 12px;
    border-left: 3px solid #dee2e6;
    color: #6c757d;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 简化分隔线 */
.message-text hr {
    border: none;
    height: 1px;
    background: #dee2e6;
    margin: 16px 0;
}

/* 移除特殊样式类 */
.list-number,
.list-bullet {
    display: none;
}

/* 确保所有文本元素都严格遵守容器宽度 */
.message-text * {
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
}

/* 特别处理可能导致溢出的元素 */
.message-text pre,
.message-text code {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.message-text table {
    width: 100%;
    table-layout: fixed; /* 固定表格布局防止溢出 */
    word-wrap: break-word;
}

.message-text td,
.message-text th {
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 0; /* 配合table-layout: fixed使用 */
}

/* 用户消息保持简洁 */
.user-message .message-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    font-size: 15px;
    line-height: 1.5;
}

.user-message .message-text p {
    color: white;
    margin: 0 0 8px 0;
}

.user-message .message-text strong,
.user-message .message-text em {
    color: white;
}

/* 改进欢迎消息样式 */
.welcome-message .message-text {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    line-height: 1.7;
}

/* 改进建议芯片样式 */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.chip {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.streaming-text {
    position: relative;
}

/* 打字光标动画 - 优化性能 */
.typing-cursor {
    display: inline-block;
    background-color: #667eea;
    width: 2px;
    height: 1.2em;
    margin-left: 2px;
    animation: blink 1.2s infinite ease-in-out;
    vertical-align: text-bottom;
    will-change: opacity; /* 优化动画性能 */
}

@keyframes blink {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin-bottom: 10px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    color: #667eea;
    font-size: 0.9em;
    font-style: italic;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.05);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

.chat-input-wrapper textarea::placeholder {
    color: #999;
}

.chat-input-wrapper button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chat-input-wrapper button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-input-wrapper button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .chat-modal {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        margin: 0;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .header-icon {
        font-size: 2em;
    }
    
    .header-text h3 {
        font-size: 1.3em;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 85%;
        min-width: 0;
        overflow: hidden;
    }
    
    .message-text {
        padding: 14px 18px;
        font-size: 15px;
        line-height: 1.6;
        width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
        word-break: break-all; /* 在必要时强制断词 */
    }
    
    .message-text p {
        margin: 0 0 8px 0;
    }
    
    .message-text h1, .message-text h2, .message-text h3, .message-text h4 {
        margin: 10px 0 6px 0;
    }
    
    .message-text li {
        margin: 4px 0;
        padding-left: 18px;
    }
    
    .suggestion-chips {
        gap: 8px;
        margin-top: 14px;
    }
    
    .chip {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .chat-input-container {
        padding: 15px 10px; /* 减少左右padding，增加输入框可用宽度 */
    }
    
    .input-container {
        padding: 8px 12px; /* 增加padding，让输入框更舒适 */
        margin: 0; /* 确保没有额外边距 */
        width: 100%; /* 确保占满容器宽度 */
        box-sizing: border-box;
    }
    
    .chat-input-wrapper {
        width: 100%; /* 确保输入包装器占满宽度 */
        display: flex;
        align-items: flex-end;
        gap: 8px;
    }
    
    .chat-input-wrapper textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px 16px; /* 增加内边距 */
        flex: 1; /* 确保textarea占据剩余空间 */
        min-width: 0; /* 允许收缩 */
    }
    
    .chat-input-wrapper button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .avatar-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .message {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .message-text {
        padding: 12px 16px;
        font-size: 14px;
        line-height: 1.5;
        word-break: break-all;
    }
    
    .message-text p {
        margin: 0 0 6px 0;
    }
    
    .header-text h3 {
        font-size: 1.2em;
    }
    
    .header-text p {
        font-size: 0.85em;
    }
    
    .chat-input-container {
        padding: 12px 8px; /* 进一步减少小屏幕的padding */
    }
    
    .input-container {
        padding: 6px 10px;
    }
    
    .chat-input-wrapper textarea {
        padding: 10px 14px;
    }
}

/* 事业指导对话界面样式 */
.career-chat-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.career-chat-modal .chat-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.career-chat-modal .header-icon {
    background: linear-gradient(135deg, #4CAF50, #45a049); /* 改为与整体背景一致的绿色渐变 */
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.career-chat-modal .chip {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.career-chat-modal .chip:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
}

/* 人生规划对话界面样式 */
.life-planning-chat-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.life-planning-chat-modal .chat-header {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
}

.life-planning-chat-modal .header-icon {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.life-planning-chat-modal .chip {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.life-planning-chat-modal .chip:hover {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
    transform: translateY(-2px);
}

/* PC端大屏幕优化 */
@media (min-width: 769px) {
    .chat-modal {
        max-width: 1000px;
        width: 90vw;
    }
    
    .chat-input-container {
        padding: 20px 30px;
    }
    
    .input-container {
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        margin: 0;
        box-sizing: border-box;
    }
    
    .chat-input-wrapper {
        width: 100%;
        display: flex;
        align-items: flex-end;
        gap: 12px;
    }
    
    .chat-input-wrapper textarea {
        flex: 1;
        min-width: 0;
        padding: 14px 18px;
        font-size: 16px;
        line-height: 1.5;
    }
    
    .chat-input-wrapper button {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }
}

/* 超大屏幕进一步优化 */
@media (min-width: 1200px) {
    .chat-modal {
        max-width: 1200px;
    }
    
    .chat-input-container {
        padding: 25px 40px;
    }
    
    .input-container {
        padding: 14px 20px;
    }
    
    .chat-input-wrapper textarea {
        padding: 16px 20px;
        font-size: 17px;
    }
    
    .chat-input-wrapper button {
        width: 52px;
        height: 52px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .chat-modal {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .chat-container {
        background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    }
    
    .message-text {
        background: #2d2d2d;
        color: #ffffff;
        border-color: #404040;
    }
    
    .input-container {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .chat-input-wrapper textarea {
        color: #ffffff;
    }
    
    .chat-input-wrapper textarea::placeholder {
        color: #999;
    }
}

/* 报告生成提示样式 */
.report-generating-tip {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    animation: fadeInScale 0.5s ease-out;
}

.generating-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.report-generating-tip p {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.generating-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.generating-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.generating-dots span:nth-child(1) { animation-delay: -0.32s; }
.generating-dots span:nth-child(2) { animation-delay: -0.16s; }
.generating-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 保存报告按钮样式 */
.save-report-actions {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #6c757d;
    border-radius: 12px;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-save {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.save-as-image {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.save-as-image:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.save-as-pdf {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.save-as-pdf:hover {
    background: linear-gradient(135deg, #c82333 0%, #e8650e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* 保存进度模态框样式 */
.save-progress {
    text-align: center;
    padding: 20px;
}

.save-progress .loading-spinner {
    margin: 0 auto 15px;
}

.save-progress p {
    color: #666;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .save-report-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-save {
        width: 100%;
        max-width: 200px;
    }
}

/* 打印时隐藏保存按钮和其他UI元素 */
@media print {
    .save-report-actions,
    .report-actions,
    .blur-overlay {
        display: none !important;
    }
}