/* 历史记录页面样式 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--notion-border);
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--notion-gray);
}

.history-emoji {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(55, 53, 47, 0.05);
}

.history-content {
    flex: 1;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.history-name {
    font-weight: 600;
}

.history-time {
    color: rgba(55, 53, 47, 0.6);
    font-size: 0.85rem;
}

.history-message {
    margin-bottom: 8px;
}

.history-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.history-status .fa-check {
    color: var(--notion-blue);
}

.history-status .fa-times {
    color: #e55050;
}

.history-item.success {
    border-left: 3px solid var(--notion-blue);
}

.history-item.error {
    border-left: 3px solid #e55050;
}

.empty-state {
    text-align: center;
    padding: 8px 0;
    color: rgba(55, 53, 47, 0.6);
}
/* 历史记录容器 */
.history-item {
    display: flex;
    align-items: flex-start; /* 顶部对齐 */
    gap: 12px; /* 元素间距 */
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* 头像/emoji区域 */
.history-emoji {
    flex: 0 0 36px; /* 固定宽度 */
    font-size: 24px;
    text-align: center;
}

/* 内容区域 */
.history-content {
    flex: 1; /* 占据剩余空间 */
    min-width: 0; /* 防止文本溢出 */
}

/* 头部信息（名称+时间） */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline; /* 文字基线对齐 */
    margin-bottom: 4px;
}

/* 用户名 */
.history-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

/* 时间显示 */
.history-time {
    color: #666;
    font-size: 0.85em;
    white-space: nowrap;
}

/* 消息正文 */
.history-message {
    word-break: break-word; /* 允许单词内断行 */
    line-height: 1.4;
    text-align: left;
    margin-right: auto;
}
/* 确保时间显示不会换行 */
.history-time {
    white-space: nowrap;
    font-size: 0.85em;
    color: var(--notion-text-secondary);
}

/* 小屏幕优化 */
@media (max-width: 600px) {
    .history-time {
        font-size: 0.75em;
    }
}

.history-list {
    padding: 20px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.history-emoji {
    font-size: 24px;
    margin-right: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 错误状态特殊样式 */
.history-item.error {
    border-left: 4px solid #ff6b81;
}

.history-error {
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
}


/* ===== 修复历史记录宽度 ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-width: 800px; /* 最大宽度限制 */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--notion-border);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .history-list {
        max-width: 90%;
    }
    
    .history-item {
        padding: 14px;
    }
}

@media (max-width: 600px) {
    .history-list {
        max-width: 95%;
        gap: 10px;
    }
    
    .history-item {
        padding: 12px 16px;
        flex-direction: column;
        gap: 6px;
    }
    
    .history-header {
        flex-direction: column;
        gap: 4px;
    }
    
    .history-name,
    .history-time {
        max-width: 100%;
    }
}

/* 确保内容正确显示 */
.history-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.history-name {
    font-weight: 600;
    color: var(--notion-text);
    flex-shrink: 0;
    max-width: 60%;
}

.history-time {
    color: rgba(55, 53, 47, 0.6);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.history-message {
    color: var(--notion-text);
    line-height: 1.4;
    word-break: break-word;
    text-align: left;
    width: 100%;
}

/* 错误信息样式 */
.history-error {
    color: #e55050;
    font-size: 0.8rem;
    margin-top: 8px;
    font-family: monospace;
    background: rgba(229, 80, 80, 0.05);
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid #e55050;
}

/* 状态指示器 */
.history-item.success {
    border-left: 3px solid var(--notion-blue);
    background: linear-gradient(to right, 
        rgba(51, 126, 169, 0.02) 0%,
        rgba(51, 126, 169, 0.01) 3%,
        white 10%);
}

.history-item.error {
    border-left: 3px solid #e55050;
    background: linear-gradient(to right, 
        rgba(229, 80, 80, 0.02) 0%,
        rgba(229, 80, 80, 0.01) 3%,
        white 10%);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(55, 53, 47, 0.5);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 40px auto;
}

/* 历史记录页面容器 */
body.history-page {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.history-container {
    width: 100%;
    max-width: 800px;
    margin: 80px auto 40px;
    padding: 0 20px;
}


