/* AntSK TreeChat - 扁平简约风格样式 */

/* 基础重置和变量 */
* {
    box-sizing: border-box;
}

/* 扁平化输入框样式 */
.chat-input {
    transition: all 0.2s ease;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 简化的消息动画 */
.message-in, .message-out {
    opacity: 0;
    transform: translateY(8px);
    animation: slideIn 0.2s ease forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 扁平化按钮效果 */
.ripple-btn {
    position: relative;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.ripple-btn:active {
    transform: scale(0.98);
}

/* 简化的输入指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 12px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 扁平化右键菜单 */
.context-menu {
    min-width: 160px;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: fixed;
    z-index: 9999;
    overflow: hidden;
    animation: contextMenuFadeIn 0.1s ease-out;
}

.context-menu button {
    width: 100%;
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    font-size: 14px;
    color: var(--gray-700);
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.context-menu button:hover {
    background-color: var(--gray-50);
}

.context-menu button:active {
    background-color: var(--gray-100);
}

.context-menu button.danger:hover {
    background-color: #fef2f2;
    color: var(--danger);
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 简化的菜单图标 */
.menu-icon {
    transition: color 0.15s ease;
    padding: var(--space-2);
    border-radius: var(--radius-md);
}

.menu-icon:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

/* 简化的状态指示器 */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background-color: var(--success);
}

.status-indicator.offline {
    background-color: var(--gray-300);
}

/* 简化的头像样式 */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--gray-100);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.badge-secondary {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 分隔线 */
.divider {
    height: 1px;
    background-color: var(--gray-200);
    border: none;
    margin: var(--space-4) 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px !important;
    }
    
    .message-bubble-user,
    .message-bubble-bot {
        max-width: 85%;
    }
    
    .agent-card {
        margin-bottom: var(--space-4);
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .nav-item {
        margin-bottom: var(--space-2);
    }
}

/* 辅助类 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: flex-start;
}

.flex-end {
    display: flex;
    align-items: flex-end;
}

.full-width {
    width: 100%;
}

.full-height {
    height: 100%;
}

/* 可访问性增强 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 禁用状态 */
button:disabled,
input:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 选择状态 */
.selected {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 简化的滚动条样式 */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 智能体卡片 - 极简设计 */
.agent-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.3);
}

/* 模型对比专用样式 */
.model-comparison-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 0;
    flex: 1;
}

.model-comparison-controls {
    width: 320px;
    max-width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--gray-200);
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
}

.model-comparison-results {
    flex: 1;
    min-width: 0;
    background: var(--gray-50);
    overflow: hidden;
}

/* 模型选择列表样式 */
.model-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: white;
}

.model-selection-item {
    display: flex;
    align-items: center;
    padding: var(--space-2) 0;
}

.model-selection-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

.model-selection-item input[type="checkbox"] {
    margin-right: var(--space-2);
    color: var(--primary);
}

.model-selection-item label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.model-selection-item:hover {
    background-color: var(--gray-50);
    border-radius: var(--radius-sm);
}

/* 模型结果卡片样式 */
.model-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4);
    height: 100%;
    overflow-y: auto;
}

.model-result-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    transition: all 0.15s ease;
}

.model-result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.model-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.model-result-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 16px;
}

.model-result-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.model-result-content {
    flex: 1;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.model-result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--gray-400);
    text-align: center;
}

.model-result-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--primary);
    text-align: center;
}

.model-result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--danger);
    text-align: center;
}

/* 加载动画 */
.processing-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 状态指示器 */
.status-processing {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
}

.status-completed {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
}

.status-error {
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
}

/* 参数滑块增强 */
.parameter-slider-container {
    margin: var(--space-3) 0;
}

.parameter-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.parameter-slider-value {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.parameter-slider-marks {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-1);
    font-size: 12px;
    color: var(--gray-500);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .model-comparison-container {
        flex-direction: column;
    }
    
    .model-comparison-controls {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        max-height: 60vh;
        flex-shrink: 0;
    }
    
    .model-comparison-results {
        flex: 1;
        min-height: 40vh;
    }
    
    .model-result-grid {
        grid-template-columns: 1fr;
        padding: var(--space-3);
    }
    
    .model-result-card {
        padding: var(--space-3);
    }
    
    .model-result-content {
        max-height: 300px;
        min-height: 150px;
    }
}

/* 复制按钮样式 */
.copy-button {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.copy-button:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.copy-button:active {
    transform: scale(0.95);
} 