.history_container {
    padding: 0.5rem 0;
    max-width: 100%;
}

.history-filters .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.history-item .card-body {
    font-size: 0.9rem;
}

.history-type-badge {
    font-size: 0.75rem;
}

.history-summary {
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-question-content {
    white-space: pre-wrap;
}

.history-result-image {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.history-chat-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.history-chat-attach-img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.history-result-image {
    cursor: pointer;
}

/* 历史记录大图查看层 */
.history-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.history-image-viewer-img {
    max-width: min(1100px, 95vw);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    background: #111;
}
.history-image-viewer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 20001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.history-image-viewer-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.history-detail-btn {
    font-size: 0.85rem;
}

/* 历史记录对话内容与对话页一致的格式化样式 */
.history-markdown {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}
.history-markdown p {
    margin-bottom: 0.5rem;
}
.history-markdown pre {
    overflow-x: auto;
    max-width: 100%;
    padding: 0.75rem;
    background: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    margin: 0.5rem 0;
}
/* 代码块带复制按钮时与对话页一致 */
.history-markdown .chat-code-block {
    position: relative;
    margin: 0.5rem 0;
}
.history-markdown .chat-code-block pre {
    padding-top: 2.4rem;
}
.history-markdown .chat-code-copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    font-size: 0.85rem;
}
.history-markdown .chat-code-copy-btn:hover {
    color: #111827;
    background: #fff;
}
.history-markdown .chat-code-copy-btn.is-copied {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.12);
}
.history-markdown pre code {
    font-size: 0.85em;
    padding: 0;
    background: none;
}
.history-markdown code {
    padding: 0.2em 0.4em;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
}
.history-markdown h1, .history-markdown h2, .history-markdown h3 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.history-markdown ul, .history-markdown ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.history-markdown blockquote {
    margin: 0.5rem 0;
    padding-left: 1rem;
    border-left: 4px solid #ddd;
    color: #666;
}
