/* 关键路径CSS - 首屏渲染必需的样式 */
/* 性能优化：仅包含首屏渲染必需的样式，减少阻塞时间 */

/* CSS变量定义 - 核心颜色 */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-600: #475569;
    --gray-800: #1E293B;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 8px;
}

/* 基础重置和字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* 基础按钮样式 */
.btn-upload, .send-button, .auth-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-upload:hover, .send-button:hover, .auth-btn:hover {
    background: var(--primary-hover);
}

/* 输入框样式 */
input[type="file"], .chat-textarea {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.chat-textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* 加载动画 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* 聊天输入框容器 */
.fixed-bottom-chat-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 16px;
    z-index: 1000;
}

.chat-input-container {
    max-width: 1200px;
    margin: 0 auto;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.send-button {
    min-width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 基础卡片样式 */
.section {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
}

.section-header {
    background: var(--gray-100);
    padding: 16px 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}

.section-content {
    padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .section-content {
        padding: 16px;
    }
    
    .fixed-bottom-chat-input {
        padding: 12px;
    }
}

/* 性能优化：减少重绘 */
.chat-textarea, .btn-upload, .send-button {
    will-change: transform;
}

/* 预加载关键字体 */
@font-face {
    font-family: 'system-ui';
    src: local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont');
    font-display: swap;
}
