.deepseek-chat-container {
    max-width: 800px;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.chat-stats {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 12px;
    line-height: 1.5;
    max-width: 85%;
    position: relative;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: #007cba;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background: white;
    border: 1px solid #e0e0e0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 8px;
}

.search-results {
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    padding: 12px;
    margin: 12px 0;
    border-radius: 4px;
}

.search-result-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.search-result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.result-category {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.result-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.result-excerpt {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.4;
}

.result-link {
    color: #007cba;
    text-decoration: none;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.result-link:hover {
    text-decoration: underline;
}

.result-link::after {
    content: "↗";
    font-size: 0.8em;
}

.related-articles {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

.related-title {
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-item {
    margin-bottom: 6px;
}

.article-link {
    color: #007cba;
    text-decoration: none;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-link:hover {
    text-decoration: underline;
}

.article-link::before {
    content: "📄";
    font-size: 0.9em;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.input-group textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.input-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

.send-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    align-self: flex-end;
}

.send-button:hover:not(:disabled) {
    background: #005a87;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-options {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.option-group input[type="checkbox"] {
    margin: 0;
}

.chat-tips {
    text-align: center;
    color: #666;
    font-size: 0.85em;
    margin-top: 8px;
}

.chat-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.conversation-history {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: #f8f9fa;
    margin-bottom: 12px;
}

.history-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #007cba;
    background: #f0f7ff;
}

.history-item.active {
    border-color: #007cba;
    background: #e7f3ff;
}

.history-question {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.history-answer {
    font-size: 0.85em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clear-history {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: auto;
}

.clear-history:hover {
    background: #dc3545;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .deepseek-chat-container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .chat-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .chat-messages {
        height: 400px;
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .send-button {
        align-self: stretch;
    }
    
    .chat-options {
        flex-direction: column;
        align-items: flex-start;
    }
}