/* basic_version/static/style.css - 更新版本 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn.primary {
    background: #4CAF50;
    color: white;
}

.btn.primary:hover {
    background: #45a049;
}

.btn.secondary {
    background: #008CBA;
    color: white;
}

.btn.secondary:hover {
    background: #007B9A;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    resize: vertical;
}

input[type="text"], input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.upload-area {
    margin-bottom: 15px;
}

.document-list {
    max-height: 200px;
    overflow-y: auto;
}

.document-item {
    padding: 8px;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 14px;
}

.chat-card {
    height: auto;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 15px;
    /* 添加滚动条样式 */
    max-height: 500px;
    border: 1px solid #e0e0e0;
}

/* 自定义滚动条样式 */
.chat-history::-webkit-scrollbar {
    width: 8px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.message.user {
    background: #e3f2fd;
    margin-left: 20px;
    border-left-color: #2196F3;
}

.message.assistant {
    background: #f5f5f5;
    margin-right: 20px;
    border-left-color: #4CAF50;
}

.message .timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px;
    font-size: 14px;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.active {
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-dot.inactive {
    background: #f44336;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .content {
        order: 1;
    }
    
    .chat-history {
        max-height: 300px;
    }
}

/* 消息加载动画 */
.message-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动到底部按钮 */
.scroll-to-bottom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: none;
}


/* basic_version/static/style.css - 添加删除按钮样式 */

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 14px;
}

.document-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background: #d32f2f;
}

.delete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.confirm-delete {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.confirm-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
}

.cancel-btn {
    background: #757575;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
}

.document-actions {
    display: flex;
    gap: 5px;
}