
/* ============================================================================
   ARTIFACT MODAL STYLES
   ============================================================================ */

/* 弹窗基础布局 - 默认为紧凑模式 */
.response-modal {
    width: 90% !important;
    max-width: 650px !important; /* 普通对话使用紧凑宽度 */
    height: auto !important;
    max-height: 80vh !important;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-elevated);
    border: 1px solid var(--nexus-primary-dim);
    border-radius: 16px;
}

/* 报告模式 - 自动切换为宽屏 */
.response-modal.artifact {
    width: 90vw !important;
    height: 85vh !important;
    max-width: 1400px !important;
    max-height: 90vh !important;
}

/* 极致沉浸全屏状态 - 强制覆盖所有尺寸（必须放在 artifact 之后） */
.response-modal.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    z-index: 100000 !important;
    border: none !important;
    transform: none !important;
}

/* 强制消除遮罩层内边距 */
.response-overlay:has(.fullscreen) {
    padding: 0 !important;
}

/* 标题组 */
.modal-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-icon {
    color: var(--nexus-primary);
    font-size: 1.2rem;
}

/* 工具栏 - 视图切换 */
.modal-toolbar {
    flex: 1;
    display: flex;
    justify-content: center;
}

.view-tabs {
    display: flex;
    background: var(--bg-surface);
    padding: 2px;
    border-radius: 10px;
    border: 1px solid var(--border-dim);
}

.view-tab {
    padding: var(--space-xs) var(--space-md);
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-tab:hover {
    color: var(--text-primary);
}

.view-tab.active {
    background: var(--bg-card);
    color: var(--nexus-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 操作按钮 */
.modal-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-action-btn:hover {
    background: var(--bg-surface);
    color: var(--nexus-primary);
}

/* 内容显示区域 */
.modal-body {
    flex: 1;
    position: relative;
    padding: 0 !important;
    background: #0d1117;
}

.modal-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* 美化滚动条 - 极致简约风格 */
.modal-content::-webkit-scrollbar,
#modal-content-source::-webkit-scrollbar,
#modal-content-markdown::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal-content::-webkit-scrollbar-track,
#modal-content-source::-webkit-scrollbar-track,
#modal-content-markdown::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb,
#modal-content-source::-webkit-scrollbar-thumb,
#modal-content-markdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: background 0.2s;
}

.modal-content::-webkit-scrollbar-thumb:hover,
#modal-content-source::-webkit-scrollbar-thumb:hover,
#modal-content-markdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Markdown 视图 */
#modal-content-markdown {
    padding: var(--space-xl);
}

/* 源码视图 */
#modal-content-source {
    background: #0d1117;
}

#modal-content-source pre {
    margin: 0;
    padding: var(--space-lg);
    background: transparent;
    white-space: pre-wrap; /* 解决溢出跳动 */
    word-break: break-all;
}

#modal-content-source code {
    background: transparent;
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}

/* 预览视图 (Iframe) */
#modal-content-preview {
    background: #0d1117;
    display: flex;
    flex-direction: column;
}

#artifact-iframe {
    flex: 1;
    border: none;
    background: #0d1117;
}
