/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0051CF;
    --primary-light: #1f6df2;
    --primary-dark: #003a9b;
    --secondary-color: #f8fafc;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --background: #ffffff;
    --background-secondary: #f9fafb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-secondary);
    overflow-x: hidden;
}

/* 加载状态 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* 页面基础布局 */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Agent选择页面 */
.agent-selection-page {
    background: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 100%);
    padding: 0 0 80px 0;
}

.page-header {
    text-align: center;
    padding: 60px 24px 40px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

.agent-categories {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.category-section {
    margin-bottom: 32px;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.agent-card {
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.agent-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.agent-card:hover::before {
    transform: scaleX(1);
}

.agent-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.agent-avatar {
    font-size: 40px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--background-secondary);
    border-radius: var(--radius-lg);
}

.agent-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.agent-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 对话页面 */
.chat-page {
    height: 100vh;
    background: var(--background-secondary);
}

.chat-header {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.back-button {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-color)08;
}

.chat-agent-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.chat-agent-info .agent-avatar {
    font-size: 32px;
    margin-right: 12px;
    width: 48px;
    height: 48px;
}

.agent-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.agent-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    border-color: var(--primary-color);
    background: var(--primary-color)08;
}

/* 消息区域 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 思考内容样式 - 简洁弱化版本 */
.thinking-container {
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.8rem;
    color: #6b7280;
}

.thinking-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.thinking-header:hover {
    background: #ebebeb;
}

.thinking-label {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-weight: 500;
}

.thinking-toggle-icon {
    font-size: 0.7rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
    line-height: 1;
}

.thinking-container.expanded .thinking-toggle-icon {
    transform: rotate(180deg);
}

.thinking-content {
    padding: 0.75rem;
    background: #fafafa;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
}

.thinking-container.collapsed .thinking-content {
    display: none;
}

.thinking-container.expanded .thinking-content {
    display: block;
}

.thinking-container.collapsed .thinking-toggle-icon {
    transform: rotate(0deg);
}

.thinking-container.expanded .thinking-toggle-icon {
    transform: rotate(180deg);
}

.messages {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message.user {
    justify-content: flex-end;
}

.message.user .message-content {
    background: #D1E3FF;
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.message-content {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-x: auto; /* 添加水平滚动支持 */
    min-width: 0; /* 允许flex子元素收缩 */
}

.message-content h1, .message-content h2, .message-content h3, 
.message-content h4, .message-content h5, .message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 16px; }
.message-content h4 { font-size: 15px; }

.message-content p {
    margin: 8px 0;
}

.message-content ul, .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
    table-layout: auto;
    min-width: 0; /* 允许表格收缩 */
}

/* 表格响应式处理已集成到上面的.message-content中 */

/* 表格响应式样式已合并到主要的table定义中 */

.message-content th, .message-content td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
    min-width: 80px; /* 最小列宽 */
    max-width: 200px; /* 最大列宽，防止单列过宽 */
}

.message-content th {
    background: var(--background-secondary);
    font-weight: 600;
    white-space: nowrap; /* 表头不换行 */
}

.message-content td {
    white-space: normal; /* 表格内容可以换行 */
    overflow-wrap: break-word;
}

/* 当表格内容过长时，创建一个可滚动的容器 */
@media (max-width: 768px) {
    .message-content table {
        font-size: 12px;
    }
    
    .message-content th, .message-content td {
        padding: 6px 8px;
        min-width: 60px;
        max-width: 120px;
    }
}

.message-content code {
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.message-content pre {
    background: var(--background-secondary);
    padding: 12px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 8px 0;
}

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

.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    object-fit: cover;
}

.message-avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-secondary);
    border-radius: 50%;
    flex-shrink: 0;
}

.message.user .message-avatar {
    order: 1;
    background: var(--primary-color)20;
}

/* 输入指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.typing-text {
    font-size: 13px;
    color: var(--text-light);
}

/* 推荐问题（在消息中显示） */
.inline-suggestions {
    margin-top: 16px;
    padding: 16px;
    background: var(--background-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.inline-suggestions h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.suggestion-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.4;
}

.suggestion-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* 输入区域 - 透明悬浮设计 */
.input-area {
    background: transparent;
    position: relative;
    z-index: 5;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 独立悬浮按钮容器 */
.floating-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* 独立悬浮按钮样式 */
.floating-btn {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.floating-btn:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* 拍照按钮 */
.floating-btn.image-upload-btn {
    padding: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.floating-btn.image-upload-btn:hover {
    color: var(--primary-color);
}

/* 深度思考按钮 */
.floating-btn.deep-thinking-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    user-select: none;
    min-height: 44px;
}

/* 深度思考开关（在悬浮按钮内部） */
.floating-btn.deep-thinking-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.floating-btn.deep-thinking-toggle .thinking-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.floating-btn.deep-thinking-toggle:hover .thinking-label {
    color: var(--primary-color);
}

.floating-btn.deep-thinking-toggle input[type="checkbox"]:checked + .thinking-label {
    color: var(--primary-color);
}

.image-preview {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--background-secondary);
    border-radius: var(--radius);
    position: relative;
}

.preview-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
}

.clear-images {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.clear-images:hover {
    background: var(--primary-color);
}

.input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    transition: all 0.2s ease;
    min-height: 48px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.input-row:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.input-row:hover {
    box-shadow: var(--shadow-lg);
}

/* 旧的image-upload-btn样式（已被floating-btn替代） */

#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 0;
    max-height: 120px;
    overflow-y: auto;
    background: transparent;
}

#message-input::placeholder {
    color: var(--text-light);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    box-shadow: 0 2px 4px rgba(0, 81, 207, 0.2);
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 81, 207, 0.3);
}

.send-btn:active:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 81, 207, 0.4);
}

.send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    color: white;
    opacity: 0.7;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-title {
        font-size: 32px;
    }
    
    .page-subtitle {
        font-size: 16px;
    }
    
    .agent-categories {
        padding: 20px 16px;
    }
    
    .category-section {
        margin-bottom: 24px;
    }
    
    .category-title {
        font-size: 18px;
    }
    
    .agents-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .agent-card {
        padding: 16px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .message-content {
        max-width: 85%;
        padding: 12px 16px;
    }
    
    .questions-container {
        padding: 16px;
    }
    
    .input-container {
        padding: 16px;
    }
    
    .floating-buttons {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .floating-btn.image-upload-btn {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .floating-btn.deep-thinking-toggle {
        min-height: 40px;
        padding: 6px 10px;
    }
    
    .floating-btn.deep-thinking-toggle .thinking-label {
        font-size: 13px;
    }
    
    .questions-list {
        flex-direction: column;
        gap: 8px;
    }
    
    .question-chip {
        text-align: left;
        border-radius: var(--radius);
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 40px 16px 24px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
    
    .agent-header {
        margin-bottom: 12px;
    }
    
    .agent-avatar {
        font-size: 32px;
        width: 48px;
        height: 48px;
    }
    
    .agent-info h3 {
        font-size: 16px;
    }
    
    .chat-agent-info .agent-avatar {
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
    
    .agent-details h3 {
        font-size: 16px;
    }
    
    .floating-buttons {
        gap: 6px;
    }
    
    .floating-btn.image-upload-btn {
        width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .floating-btn.deep-thinking-toggle {
        min-height: 36px;
        padding: 4px 8px;
    }
    
    .floating-btn.deep-thinking-toggle .thinking-label {
        font-size: 12px;
    }
}

/* 超窄屏幕优化 - 最大化内容空间 */
@media (max-width: 360px) {
    .page-header {
        padding: 32px 8px 20px;
    }
    
    .agent-categories {
        padding: 16px 8px;
    }
    
    .chat-header {
        padding: 12px 8px;
    }
    
    .messages-container {
        padding: 12px 8px;
    }
    
    .input-container {
        padding: 12px 8px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .floating-buttons {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .input-row {
        padding: 6px 10px;
        min-height: 44px;
    }
    
    .agent-config-modal .modal-content {
        width: 95%;
        margin: 0 8px;
    }
    
    .agent-config-modal .modal-header {
        padding: 16px 16px;
    }
    
    .agent-config-modal .modal-body {
        padding: 16px 16px;
    }
}

/* 极窄屏幕优化 - 针对老旧或小尺寸设备 */
@media (max-width: 320px) {
    .page-header {
        padding: 24px 4px 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .agent-categories {
        padding: 12px 4px;
    }
    
    .chat-header {
        padding: 10px 4px;
        gap: 8px;
    }
    
    .messages-container {
        padding: 10px 4px;
    }
    
    .input-container {
        padding: 10px 4px;
    }
    
    .message-content {
        max-width: 95%;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .input-row {
        padding: 4px 8px;
        min-height: 40px;
    }
    
    #message-input {
        font-size: 13px;
    }
    
    .send-btn {
        min-width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .floating-btn.image-upload-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .floating-btn.deep-thinking-toggle {
        min-height: 32px;
        padding: 2px 6px;
        gap: 4px;
    }
    
    .floating-btn.deep-thinking-toggle .thinking-label {
        font-size: 11px;
    }
    
    .floating-btn.deep-thinking-toggle input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    
    .back-button {
        padding: 6px;
    }
    
    .agent-config-modal .modal-content {
        width: 98%;
        margin: 0 4px;
    }
}

/* Agent配置弹窗样式 */
.agent-config-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.agent-config-modal.show {
    display: flex;
}

.agent-config-modal .modal-content {
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.agent-config-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.agent-config-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.agent-config-modal .modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.agent-config-modal .modal-close:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.agent-config-modal .modal-close svg,
.version-modal-close svg {
    width: 20px;
    height: 20px;
}

.version-modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.version-modal-close:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.agent-config-modal .modal-body {
    padding: 20px 24px;
}

.config-section {
    margin-bottom: 20px;
}

/* 历史对话弹窗样式 */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 600px;
    overflow-y: auto;
}

.session-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--background);
}

.session-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: var(--background-secondary);
}

.session-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.session-avatar {
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    margin-top: 1px; /* 与标题第一行对齐 */
}

.session-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
    margin: 0;
}

.session-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.session-agent {
    color: var(--primary-color);
    font-weight: 500;
}

.session-time {
    color: var(--text-secondary);
}

.session-stats {
    background: var(--background-secondary);
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: auto; /* 推到右侧 */
}

/* 移动端优化 */
@media (max-width: 768px) {
    .session-agent {
        display: none; /* 移动端隐藏代理名称以节省空间 */
    }
    
    .session-item {
        padding: 6px 8px;
    }
    
    .session-header {
        gap: 6px;
    }
    
    .session-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-top: 1px;
    }
    
    .session-title {
        font-size: 13px;
    }
    
    .session-meta {
        font-size: 10px;
        gap: 4px;
    }
    
    .session-stats {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .session-list {
        max-height: 500px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .agent-config-modal .modal-content {
        max-height: 92vh;
    }
    
    .session-list {
        max-height: 450px;
        gap: 3px;
    }
    
    .session-item {
        padding: 5px 6px;
    }
    
    .session-title {
        font-size: 12px;
    }
    
    .session-meta {
        font-size: 9px;
        gap: 3px;
    }
    
    .session-stats {
        font-size: 8px;
        padding: 0px 2px;
    }
}

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

.config-title {
    background: var(--background-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.config-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.config-item:last-child {
    border-bottom: none;
}

.config-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.config-value {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.config-prompt {
    background: var(--background-secondary);
    padding: 12px;
    border-radius: var(--radius);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

/* 语言切换弹窗样式 */
.language-switch-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.language-switch-modal.show {
    display: flex;
}

.language-switch-dialog {
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    padding: 24px;
}

.language-switch-dialog h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.language-switch-dialog p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.language-switch-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

/* 基础按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #20c997, #28a745);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}