* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Han Sans', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

/* 添加平滑滚动 */
html {
    scroll-behavior: smooth;
}

.container {
    display: flex;
    height: 100vh;
    background: #f7f9fc;
}

.sidebar {
    width: 280px;
    background-color: #f9fafb;
    color: #333333;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8eaed;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333333;
    font-weight: 600;
    padding-bottom: 10px;
    /* border-bottom: 2px solid #f0f0f0; */
}

/* 会话控制区域 */
.session-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.control-group {
    margin-bottom: 10px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666666;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 0.9rem;
}

.control-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.session-list {
    margin-top: 16px;
    margin-bottom: 20px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 260px;
    
    /* Firefox 滚动条样式 */
    /* scrollbar-width: thin;
    scrollbar-color: rgb(220, 220, 220) rgb(220, 220, 220); */
}

/* 会话分组标题 */
.session-group {
    margin-bottom: 15px;
}

.session-group-title {
    font-size: 0.75rem;
    color: #81858c;
    margin-bottom: 8px;
    padding: 5px 15px;
    /*background: transparent;*/
    /* background-color: #f9fafb; */
    border-radius: 4px;
    font-weight: 500;
  /*  position: sticky;
    top: 0;
    z-index: 20;*/
}

/* 分页控制 */
.pagination-info {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: #34495e;
    border-radius: 6px;
}

.pagination button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
}

.pagination button:hover:not(:disabled) {
    background: #2980b9;
}

.pagination button:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 0.8rem;
    color: #bdc3c7;
}

.session-item {
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    color: #333333;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    /***/
    height: 40px;
    padding: 9px 6px 9px 10px;
    line-height: 22px;
    text-decoration: none;
    position: relative;
    /***/
}

.session-item:hover {
    background: #f1f3f5;
    border-color: #e8eaed;
    transform: translateX(2px);
}

.session-item.active {
    background: #e3f2fd;
    color: #3964fe;
    /* border-color: transparent; */
    /* box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3); */
}

#newSessionBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    gap: 8px;
    background: rgba(0,0,0,0.9);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    margin-top: 10px;
}

#newSessionBtn:hover {
    background:rgba(0,0,0,0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

#newSessionBtn:active {
    transform: translateY(0);
}

/* 用户信息区域样式 */
.user-info-container {
    margin-top: auto;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.user-info-container:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #398ae1 0%, #007bff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.avatar-text {
    font-size: 16px;
    font-weight: 600;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-balance {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.user-menu-btn svg {
    width: 16px;
    height: 16px;
}

/* 用户菜单弹窗样式 */
.user-menu-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2900;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.user-menu-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 280px;
    max-width: 320px;
    overflow: hidden;
    animation: slideInFromBottom 0.2s ease-out;
    position: relative;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #007bff 100%);
    color: white;
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.menu-avatar-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.menu-user-details {
    flex: 1;
    min-width: 0;
}

.menu-user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-user-balance {
    font-size: 14px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-items {
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.menu-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.menu-item span {
    flex: 1;
}

.menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.logout-item {
    color: #dc2626;
}

.logout-item:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.logout-item svg {
    color: #dc2626;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
}

.chat-header {
    padding: 20px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.chat-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

#editTitleBtn {
    padding: 5px 10px;
    background: #000000;
    background: rgba(0,0,0,0.9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.chat-messages-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease; */
}


.user-message {
    align-self: flex-end;
    background: #edf3fe;
    color: #0f1115;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.ai-message {
    align-self: flex-start;
    background: #ffffff;
    color: #333333;
    /* border: 1px solid #e8eaed; */
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

/* Markdown样式 */
.ai-message h1,
.ai-message h2,
.ai-message h3,
.ai-message h4,
.ai-message h5,
.ai-message h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.25;
}

.ai-message h1 { font-size: 1.5em; }
.ai-message h2 { font-size: 1.3em; }
.ai-message h3 { font-size: 1.2em; }
.ai-message h4 { font-size: 1.1em; }
.ai-message h5 { font-size: 1em; }
.ai-message h6 { font-size: 0.9em; }

.ai-message p {
    margin: 8px 0;
    line-height: 1.6;
}

.ai-message ul,
.ai-message ol {
    margin: 8px 0;
    padding-left: 24px;
}

.ai-message li {
    margin: 4px 0;
}

.ai-message blockquote {
    margin: 8px 0;
    padding: 8px 16px;
    border-left: 4px solid #ddd;
    background: #f8f9fa;
    color: #666;
}

.ai-message code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.ai-message pre {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e1e4e8;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
}

.ai-message table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.ai-message th,
.ai-message td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.ai-message th {
    background: #f8f9fa;
    font-weight: 600;
}

.ai-message hr {
    margin: 16px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.ai-message a {
    color: #1abc9c;
    text-decoration: none;
}

.ai-message a:hover {
    text-decoration: underline;
}

.ai-message strong {
    font-weight: 600;
}

.ai-message em {
    font-style: italic;
}

/* 滚动条样式 */
.ai-message pre::-webkit-scrollbar {
    height: 8px;
}

.ai-message pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ai-message pre::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ai-message pre::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.input-area {
    padding: 20px;
    background: #ffffff;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #f8f9fa;
    border: 2px solid #e8eaed;
    border-radius: 24px;
    padding: 8px;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: rgba(0,0,0,0.9);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    resize: none;
    background: transparent;
    outline: none;
    min-height: 20px;
    max-height: 120px;
    line-height: 1.5;
}

#sendBtn {
    padding: 8px 16px;
    background: rgba(0,0,0,0.9);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

#sendBtn:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-1px);
}

#sendBtn:active {
    transform: translateY(0);
}

.usage-info {
    font-size: 0.85rem;
    color: #777;
    margin-top: 5px;
}

/* ========================
   登录界面样式
   ======================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #95a5a6;
}

.checkbox-group {
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    text-align: center;
}

.demo-hint {
    font-size: 12px;
    color: #de3813;
    background: rgba(149, 165, 166, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
}

/* 用户信息显示 */
.user-info {
    position: fixed;
    top: 5px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.user-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.user-balance {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 90px;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    margin: 4px auto;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
}

/* 侧边栏头部 */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: row;
        position: relative;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        border-right: none;
        border-top: none;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        background: #ffffff;
        z-index: 1999;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .close-sidebar-btn {
        display: block;
    }
    
    .chat-container {
        width: 100%;
        height: 100vh;
        position: relative;
    }
    
    .chat-messages {
        max-width: 100%;
        padding: 15px;
        height: calc(100vh - 140px);
    }
    
    .message {
        max-width: 90%;
        padding: 12px 16px;
        margin-bottom: 12px;
    }
    
    .input-area {
        max-width: 100%;
        padding: 15px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .login-box {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .user-info {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    /* 移动端会话列表优化 */
    .session-list {
        width: 100%;
        padding: 0 10px;
    }
    
    .session-item {
        margin-bottom: 8px;
        padding: 12px 16px;
        /* border-radius: 12px;
        background: #f8f9fa;
        border: 1px solid #e9ecef; */
        transition: all 0.2s ease;
    }
    
    .session-item:hover {
        background: #e9ecef;
        transform: translateX(2px);
    }
    
    .session-item.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .session-title {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 4px;
        line-height: 1.4;
    }
    
    .session-time {
        font-size: 12px;
        opacity: 0.7;
    }
    
    /* 移动端新建会话按钮 */
    #newSessionBtn {
        width: 100%;
        padding: 12px 16px;
        margin: 10px 0;
        border-radius: 12px;
        background: #007bff;
        color: white;
        border: none;
        font-size: 14px;
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s ease;
    }
    
    #newSessionBtn:hover {
        background: #0056b3;
        transform: translateY(-1px);
    }
    
    /* 移动端触摸优化 */
    .session-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }
    
    .session-item:active {
        transform: scale(0.98);
        background: #e9ecef;
    }
    
    /* 移动端滑动指示器 */
    .session-item::after {
        content: '';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 6px;
        height: 6px;
        background: #007bff;
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .session-item:hover::after {
        opacity: 1;
    }
    
    /* 移动端会话列表滚动优化 */
    .session-list {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 移动端输入框优化 */
    .input-container textarea {
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 12px;
        padding: 12px 16px;
        resize: none;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .input-container button {
        border-radius: 12px;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 500;
    }
    
    /* 移动端消息气泡优化 */
    .message {
        border-radius: 18px;
        margin-bottom: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .message.user {
        border-radius: 18px 18px 4px 18px;
    }
    
    .message.assistant {
        border-radius: 18px 18px 18px 4px;
    }

    .chat-title-container {
        justify-content:center;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 25px 15px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
}

/* ========================
   🔄 无限滚动相关样式
   ======================== */

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: #7f8c8d;
    font-size: 14px;
    gap: 8px;
}

/* 加载动画 */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载完成提示 */
.load-complete {
    text-align: center;
    padding: 15px;
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
    border-top: 1px solid #ecf0f1;
    margin-top: 10px;
}

/* 侧边栏滚动优化 */
.sidebar {
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* 滚动条样式优化 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    min-height: 20px;
    transition: all 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Webkit 浏览器滚动条样式 */
.session-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.session-list::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    margin: 2px;
}

.session-list::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
    min-height: 116px; /* 设置最小高度 */
    transition: all 0.2s ease;
}

.session-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.session-list::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.4);
}

/* 滚动条角落 */
.session-list::-webkit-scrollbar-corner {
    background: transparent;
}

/* 确保在移动设备上也能正常滚动 */
@media (max-width: 768px) {
    .session-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* 现代化动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 消息进入动画 */
.message {
    animation: fadeInUp 0.3s ease-out;
}

/* 会话项进入动画 */
.session-item {
    animation: slideInRight 0.2s ease-out;
}

/* 加载动画优化 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-spinner {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* 现代化阴影效果 */
.chat-container {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* 优化滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
