* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    background: url(http://113.207.120.70:5000/static/images/bananjqrbjt.jpg) no-repeat top center;
    background-size: contain;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.jqrtit {
    padding: 20px 0;
    height: 130px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 82, 165, 0.15);
    display: flex;
    justify-content: space-between;
}

.jqrtitl {
    display: flex;
    align-items: center;
    margin-left: 25px;
}

.jqrtitl img {
    margin-right: 10px;
}

.jqrtitr {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.jqrtitr .jqrtitrspan {
    width: 20px;
    line-height: 20px;
    color: rgb(17, 93, 178);
}

.jqrtitr img {
    width: 90px;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 会话列表样式 */
.session-list {
    margin: 20px;
    width: 280px;
    height: min-content;
    padding-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 会话列表折叠状态 */
.session-list.collapsed {
    width: 40px;
    margin-right: 0;
    background: transparent;
    box-shadow: none;
    margin-left: 0;
}

/* 折叠按钮样式 */
.toggle-session-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #0052a5;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-session-btn:hover {
    background-color: rgba(0, 82, 165, 0.1);
}

/* 折叠状态下隐藏所有内容 */
.session-list.collapsed .session-list-header {
    padding: 20px 10px;
    background: transparent;
}

/* 确保折叠状态下所有内容都被隐藏 */
.session-list.collapsed .session-list-title,
.session-list.collapsed .clear-all-btn,
.session-list.collapsed .new-session-btn,
.session-list.collapsed .sessions-container {
    display: none !important;
}

/* 折叠状态下调整会话列表头部 */
.session-list.collapsed .session-header-row {
    justify-content: center;
}

/* 折叠状态下调整主内容区域 */
.session-list.collapsed+.chat-section {
    max-width: calc(100% - 60px);
}

/* 确保折叠按钮始终可见 */
.session-list.collapsed .toggle-session-btn {
    display: flex;
    margin-right: 0;
    position: relative;
    z-index: 10;
}

/* 切换图标旋转动画 */
.toggle-icon-rotated {
    transform: rotate(90deg);
}

#toggle-icon {
    transition: transform 0.3s ease;
}

.session-list:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.session-list-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.session-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.session-list-title {
    font-size: 18px;
    color: #0052a5;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.session-list-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #0078d4, #0052a5);
    border-radius: 2px;
    margin-right: 10px;
}

.session-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.new-session-btn {
    background-color: #f6faff;
    color: #0078d4;
    border: 0;
    box-shadow: 0px 0px 6px 0px rgba(87, 157, 237, 0.47);
    border-radius: 4px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.new-session-btn:hover {
    background-color: #f0f4ff;
    color: #0052a5;
}

.clear-all-btn {
    color: #666;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 12px;
    transition: all 0.2s ease;
    background-color: #f0f4ff;
    border: 1px solid #e0e7ff;
    width: 24px;
    height: 24px;
}

.clear-all-btn:hover {
    background-color: #e0e7ff;
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.sessions-container {
    height: 622px;
    overflow-y: auto;
    padding: 0 10px 20px 10px;
}

/* 滚动条美化 */
.sessions-container::-webkit-scrollbar {
    width: 8px;
}

.sessions-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.sessions-container::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
}

.sessions-container::-webkit-scrollbar-thumb:hover {
    background: #a0a7b0;
}

.session-item {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 7px;
    margin: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.session-item:hover {
    background-color: #f5f5f5;
}

.session-item.active {
    background-color: #f6faff;
    border-color: #0078d4;
    border: 0;
    box-shadow: 0px 0px 6px 0px rgba(87, 157, 237, 0.47);
    border-radius: 4px;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-title {
    font-size: 12px;
    line-height: 1;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-time {
    font-size: 12px;
    color: #999;
}

.session-actions {
    display: flex;
    margin-right: -4px;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.session-item:hover .session-actions {
    opacity: 1;
}

.session-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 12px;
    width: 24px;
    height: 24px;
    line-height: 12px;
    transition: all 0.2s ease;
}

.session-action-btn:hover {
    background-color: #e0e7ff;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 640px);
}

.chat-header {
    padding: 20px 25px;
    border-bottom: 2px solid #e0e7ff;
}

.chat-header h2 {
    font-size: 22px;
    color: #0052a5;
    font-weight: 600;
}

.chat-messages {
    height: 533px;
    overflow-y: auto;
    padding: 25px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a7b0;
}

/* textarea滚动条样式 */
.ds-textarea::-webkit-scrollbar {
    width: 8px;
}

.ds-textarea::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.ds-textarea::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
}

.ds-textarea::-webkit-scrollbar-thumb:hover {
    background: #a0a7b0;
}

/* 消息容器样式 */
.message-container {
    display: flex;
    margin-bottom: 15px;
    animation: messageSlideIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

/* 用户消息容器，头像在右 */
.user-message-container {
    justify-content: flex-end;
}

/* 机器人消息容器，头像在左 */
.bot-message-container {
    justify-content: flex-start;
}

/* 消息进入动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头像样式 */
.message-avatar {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 10px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 用户头像 */
.user-avatar {
    background-image: url('http://113.207.120.70:5000/static/images/user-avatar.png');
    order: 2;
}

/* 机器人头像 */
.bot-avatar {
    background-color: #e0e7ff;
    background-image: url('http://113.207.120.70:5000/static/images/bot-avatar.png');
    order: 1;
}

.message {
    max-width: 75%;
    padding: 15px;
    border-radius: 20px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 0;
    order: 1;
}

/* 用户消息样式 */
.user-message {
    background: linear-gradient(135deg, #0078d4, #0052a5);
    color: white;
    border-top-right-radius: 6px;
    animation-delay: 0.1s;
    order: 1;
}

/* 机器人消息样式 */
.bot-message {
    background-color: white;
    color: #333;
    border: 1px solid #e0e7ff;
    border-top-left-radius: 6px;
    animation-delay: 0.2s;
    min-width: 250px;
    order: 2;
}

/* 初始问题区域样式 */
.rt.agqmmp1w-box {
    background-color: #f6faff;
    padding: 15px;
    border-radius: 10px;
}

.agqmmp1wb-tit {
    font-size: 14px;
    color: #0052a5;
    margin-bottom: 12px;
    font-weight: bold;
}

.agqmmp1wb-list {
    margin: 0;
    padding: 0 !important;
    position: relative;
}

.agqmmp1wb-list ul {
    margin: 0;
    padding: 0 !important;
}

.agqmmp1wb-list li {
    line-height: 2;
    padding-left: 12px;
    position: relative;
    list-style-type: none;
}

.agqmmp1wb-list li::before {
    content: '•';
    color: #0078d4;
    font-size: 16px;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    line-height: 1.5;
}

.agqmmp1wb-list a {
    display: inline-block;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.agqmmp1wb-list a:hover {
    color: #0078d4;
}

.message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Markdown 样式 */
.message h1 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.5em 0;
    color: #333;
    border-bottom: 2px solid #0078d4;
    padding-bottom: 0.3em;
}

.message h2 {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0.5em 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.2em;
}

.message h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0.5em 0;
    color: #333;
}

.message pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.message code {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.message pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.message ul,
.message ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message li {
    margin: 5px 0;
    line-height: 1.6;
}

.message ul {
    list-style-type: disc;
}

.message ol {
    list-style-type: decimal;
}

.message blockquote {
    border-left: 4px solid #0078d4;
    padding-left: 15px;
    margin: 10px 0;
    color: #666;
    background-color: #f6faff;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
}

.message a {
    color: #0078d4;
    text-decoration: none;
    border-bottom: 1px dotted #0078d4;
    transition: all 0.3s ease;
}

.message a:hover {
    color: #0052a5;
    border-bottom-style: solid;
}

.message b,
.message strong {
    font-weight: bold;
    color: #333;
}

.message i,
.message em {
    font-style: italic;
    color: #555;
}

#user-input {
    padding: 15px 20px;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    resize: none;
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    height: 50px;
}

#user-input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
    background-color: white;
}

.chat-input-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 聊天输入区域 */
.chat-input-container {
    width: 100%;
    gap: 12px;
    padding: 15px 20px;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    resize: none;
}

.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 录入框样式 */
.ds-textarea {
    width: 100%;
    min-height: 56px;
    max-height: 150px;
    padding: 14px 20px;
    font-size: 15px;
    outline: none;
    resize: none;
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    color: #374151;
}

.ds-textarea::placeholder {
    color: #9ca3af;
    font-style: normal;
}

.ds-textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: white;
}

/* 操作按钮区域 */
.chat-input-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* 聊天按钮组 */
.chat-input-buttons {
    display: flex;
    gap: 8px;
}

/* 按钮基础样式 */
.ds-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1;
    padding: 0 8px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    white-space: nowrap;
}

/* 按钮尺寸 */
.ds-button--m {
    height: 28px;
}

/* 填充式按钮 */
.ds-button--filled {
    color: white;
}

/* 边框式按钮 */
.ds-button--bordered {
    background-color: transparent;
    border: 1px solid #e5e7eb;
}

/* 圆形按钮 */
.ds-button--circle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* 主色调按钮 */
.ds-button--primary.ds-button--filled {
    background-color: #3b82f6;
}

.ds-button--primary.ds-button--filled:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4), 0 2px 4px -1px rgba(59, 130, 246, 0.3);
}

/* 次要按钮 */
.ds-button--secondary.ds-button--bordered {
    background-color: #f6faff;
    color: #6b7280;
}

.ds-button--secondary.ds-button--bordered:hover {
    background-color: #f0f4ff;
    border: 1px solid #e0e7ff;
    color: #0052a5;
}

/* 警告按钮 */
.ds-button--warning.ds-button--filled {
    background-color: #f59e0b;
}

.ds-button--warning.ds-button--filled:hover {
    background-color: #d97706;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.4), 0 2px 4px -1px rgba(245, 158, 11, 0.3);
}

/* 按钮图标 */
.ds-button__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 更新聊天输入区域样式 */
.chat-input-area {
    padding: 20px 25px;
}

.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.sidebar-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
    font-size: 18px;
    color: #0052a5;
    margin-bottom: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #0078d4, #0052a5);
    border-radius: 2px;
    margin-right: 10px;
}

.quick-questions ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-questions li {
    padding: 12px 16px;
    background-color: #f0f4ff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #e0e7ff;
    color: #0052a5;
}

.quick-questions li:hover {
    background-color: #e0e7ff;
    border-color: #0078d4;
    color: #0052a5;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.popular-qna .qna-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e7ff;
}

.popular-qna .qna-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-qna .question {
    font-weight: 600;
    color: #0078d4;
    margin-bottom: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.popular-qna .question::before {
    content: 'Q';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #0078d4;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    margin-right: 8px;
    font-weight: bold;
}

.popular-qna .answer {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    padding-left: 28px;
}

.popular-qna .answer::before {
    content: 'A';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #6cb840;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    margin-right: 8px;
    font-weight: bold;
    margin-left: -28px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* 便民服务样式 */
.convenience-services {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

.service-item {
    width: calc(33.33% - 10px);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 15px 10px;
    border-radius: 8px;
    background: white;
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 28px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.service-item:hover .service-icon {
    transform: scale(1.05);
}

/* 柔和的背景色，参考图片中的颜色搭配 */
.service-icon-blue {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

.service-icon-orange {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57c00;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.2);
}

.service-icon-light-blue {
    background: linear-gradient(135deg, #e1f5fe, #b3e5fc);
    color: #0288d1;
    box-shadow: 0 2px 8px rgba(2, 136, 209, 0.2);
}

.service-icon-pink {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    color: #e91e63;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.2);
}

.service-icon-green {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #388e3c;
    box-shadow: 0 2px 8px rgba(56, 142, 60, 0.2);
}

.service-title {
    font-size: 12px;
    color: #333;
    line-height: 1.3;
}

.search-result {
    background-color: #e8f5e8;
    border-left: 4px solid #4caf50;
    padding: 12px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.search-result a {
    color: #2196f3;
    text-decoration: none;
}

.search-result a:hover {
    text-decoration: underline;
}

/* 加载状态样式 */
.loading {
    color: #666;
    font-size: 13px;
    position: relative;
    padding-left: 40px;
    display: inline-flex;
    align-items: center;
}

/* 加载动画 */
.loading::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e0e7ff;
    border-radius: 50%;
    border-top-color: #0052a5;
    animation: spin 1s linear infinite;
}

/* 旋转动画定义 */
@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    /* 在平板和手机上隐藏会话列表 */
    .session-list {
        display: none;
    }

    .session-list-header {
        padding: 0;
    }

    .chat-section {
        max-width: 100%;
    }

    .sidebar {
        width: 100%;
        border-left: none;
        border-top: 2px solid #e0e7ff;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-section {
        flex: 1;
        min-width: 300px;
    }

    .session-actions {
        opacity: 1;
    }

    .message {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .jqrtit {
        height: 90px;
    }

    .jqrtitr {
        display: none;
    }

    .chat-section {
        max-width: 100%;
    }

    .chat-messages {
        height: 500px;
        padding: 15px 5px;
    }

    .chat-input-area {
        padding: 15px;
    }

    .sidebar {
        flex-direction: column;
        padding: 15px;
    }

    .sidebar-section {
        min-width: 100%;
    }

    .message {
        max-width: 95%;
    }

    .ds-button {
        padding: 0 7px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    .chat-header h2 {
        font-size: 18px;
    }

    .chat-messages {
        height: 400px;
    }

    #user-input {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* 响应式地区列表 */
@media (max-width: 768px) {
    .area-item {
        width: calc(50% - 5px) !important;
    }
}

/* 引用容器样式 */
.citation-container {
    position: relative;
    display: inline;
    vertical-align: text-bottom;
    margin-left: 3px;
}

/* 移动端会话列表按钮样式 */
.mobile-session-btn {
    display: none;
}

/* 移动端会话列表弹出层样式 */
.mobile-session-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.mobile-session-panel {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: left 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.mobile-session-panel.open {
    left: 0;
}

.close-mobile-session {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-mobile-session:hover {
    color: #333;
}

/* 移动端会话列表样式 */
.mobile-sessions-container {
    margin: 15px 0;
    max-height: calc(100% - 120px);
    overflow-y: auto;
}

/* 在移动设备上显示提问记录按钮 */
@media (max-width: 1024px) {
    .mobile-session-btn {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        color: #6a85b5;
        background-color: rgba(0, 120, 212, 0.06);
        border: 1px solid #e0e7ff;
        transition: all 0.3s ease;
    }

    .mobile-session-btn:hover {
        background-color: rgba(0, 120, 212, 0.1);
        box-shadow: 0 2px 12px rgba(0, 120, 212, 0.15);
    }

    .mobile-session-btn:before {
        content: '📋';
        font-size: 9px;
    }
}

/* 在桌面设备上隐藏提问记录按钮 */
@media (min-width: 1025px) {
    .mobile-session-btn {
        display: none;
    }
}

/* 引用图标样式 */
.citation-icon {
    display: inline-block;
    cursor: pointer;
    width: 16px;
    height: 16px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
}

/* 引用弹窗样式 */
.citation-popup {
    position: absolute;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 400px;
    min-width: 300px;
    display: none;
    left: 0;
    top: 25px;
}

/* 确保消息容器不创建新的堆叠上下文，允许弹窗突破消息的层级限制 */
.message {
    position: relative;
    z-index: initial;
}

/* 引用容器需要更高的层级，确保弹窗显示在所有消息之上 */
.citation-container {
    position: relative;
    z-index: 1000;
}

/* 激活状态下显示弹窗 */
.citation-container.active .citation-popup {
    display: block;
}

/* 弹窗标题样式 */
.citation-popup .citation-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

/* 弹窗链接样式 */
.citation-popup .citation-title a {
    color: #007bff;
    text-decoration: none;
}

.citation-popup .citation-title a:hover {
    text-decoration: underline;
}

/* 弹窗内容样式 */
.citation-popup .citation-content {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    max-height: 150px;
    overflow-y: auto;
}

/* 弹窗内容滚动条样式 */
.citation-popup .citation-content::-webkit-scrollbar {
    width: 6px;
}

.citation-popup .citation-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.citation-popup .citation-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.citation-popup .citation-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 弹窗日期样式 */
.citation-popup .citation-date {
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* 免责声明按钮样式 */
.disclaimer-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #6a85b5;
    background-color: rgba(0, 120, 212, 0.06);
    border: 1px solid #e0e7ff;
    transition: all 0.3s ease;
}

.disclaimer-btn:hover {
    background-color: rgba(0, 120, 212, 0.1);
    box-shadow: 0 2px 12px rgba(0, 120, 212, 0.15);
}

.disclaimer-btn:before {
    content: '📄';
    font-size: 9px;
}

/* 免责声明弹窗样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 8% auto;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.modal .close {
    color: #666;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal .close:hover,
.modal .close:focus {
    color: #333;
    background-color: #f5f5f5;
    text-decoration: none;
    cursor: pointer;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 19px;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.modal-body {
    font-size: 14px;
    line-height: 1.8;
    color: #4a5568;
    padding: 10px;
}

.modal-body h4 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 4px solid #0078d4;
}

.modal-body p {
    margin-bottom: 12px;
    text-align: justify;
}

.modal-body p:first-child {
    margin-top: 0;
}

/* 弹窗内容区域滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 引用容器位置调整 */
.citation-wrapper {
    display: inline;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin: 15px 0;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.table-container table {
    border-collapse: collapse;
    width: -moz-max-content;
    width: max-content;
    max-width: -moz-max-content;
    max-width: max-content;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-container thead {
    background-color: #e0e7ff;
    color: #0052a5;
}

.table-container th {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 2px solid #e0e7ff;
    font-weight: 600;
    min-width: 100px;
}

.table-container tbody tr {
    background-color: white;
    transition: background-color 0.2s ease;
}

.table-container tbody tr:nth-child(even) {
    background-color: #f9fbff;
}

.table-container tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #e0e7ff;
    color: #333;
    min-width: 100px;
    max-width: 320px;
    max-width: min(30vw, 320px);
}