/**
 * 流式响应折叠显示样式
 * 需求5: 折叠功能的CSS样式
 * 创建时间: 2025-10-28
 */

/* ==================== 外层容器 ==================== */
.stream-status-wrapper {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 摘要栏 ==================== */
.stream-status-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.stream-status-summary:hover {
    background: rgba(59, 130, 246, 0.12);
}

/* 摘要文本 */
.summary-text {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stream-status-summary.collapsed .summary-text {
    color: #3b82f6;
}

/* 摘要图标 */
.summary-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

/* 摘要标签（轮次、文档数） */
.summary-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
    font-size: 12px;
    color: #6366f1;
    font-weight: 500;
}

/* ==================== 展开/折叠按钮 ==================== */
.toggle-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    border-radius: 4px;
}

.toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.toggle-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 展开时图标向上旋转180度 */
.stream-status-summary:not(.collapsed) .toggle-btn i {
    transform: rotate(180deg);
}

/* ==================== 详情容器 ==================== */
.stream-status-detail {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 1;
}

/* 折叠时隐藏详情 */
.stream-status-summary.collapsed + .stream-status-detail {
    max-height: 0;
    opacity: 0;
}

/* ==================== 状态区域调整 ==================== */
/* 在折叠容器内的状态区域不需要 margin-bottom */
.stream-status-wrapper .stream-status-area {
    margin-bottom: 0;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .stream-status-summary {
        padding: 10px 12px;
    }

    .summary-text {
        font-size: 13px;
    }

    .summary-badge {
        font-size: 11px;
        padding: 1px 6px;
    }

    .toggle-btn {
        font-size: 14px;
        padding: 3px 6px;
    }
}

/* ==================== 辅助类 ==================== */
/* 防止文本选择影响用户体验 */
.stream-status-summary * {
    user-select: none;
}

/* 按钮聚焦样式 */
.toggle-btn:focus {
    outline: 2px solid rgba(59, 130, 246, 0.3);
    outline-offset: 2px;
}
