/**
 * 企业 AI 问数模块样式
 * Enterprise AI Data Query Module Styles
 */

/* 数据源列表项 */
.dq-ds-item {
    margin-bottom: 4px;
}

.dq-ds-item .group:hover .group-hover\\:opacity-100 {
    opacity: 1;
}

/* Schema 表格 */
.dq-schema-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.dark .dq-schema-table {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 查询结果表格 */
.dq-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table.query-result {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.query-result th {
    background: #f8fafc;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.dark table.query-result th {
    background: #1a1a1a;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

table.query-result td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.dark table.query-result td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

table.query-result tr:hover {
    background: #f8fafc;
}

.dark table.query-result tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 数据源对话框文件列表 */
#ds-file-list {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

#ds-file-list::-webkit-scrollbar {
    width: 6px;
}

#ds-file-list::-webkit-scrollbar-track {
    background: transparent;
}

#ds-file-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark #ds-file-list::-webkit-scrollbar-thumb {
    background: #475569;
}

#ds-file-list > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

#ds-file-drop {
    transition: all 0.2s ease;
}

#ds-file-drop.drag-over {
    border-color: #4abebd !important;
    background: #f0fdfa;
}

.dark #ds-file-drop.drag-over {
    background: rgba(74, 190, 189, 0.1);
}

/* 查询结果动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#dq-result-area > div {
    animation: fadeIn 0.3s ease;
}

/* 结果提示 */
.result-note {
    color: #64748b;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

.dark .result-note {
    color: #94a3b8;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #view-dataquery {
        flex-direction: column;
    }

    #view-dataquery > div {
        width: 100% !important;
        max-height: none !important;
    }

    #view-dataquery > div:first-child {
        order: 2;
        border-top: 1px solid #e2e8f0;
        border-right: none;
    }

    #view-dataquery > div:nth-child(2) {
        order: 1;
        min-height: 300px;
    }

    #view-dataquery > div:last-child {
        display: none;
    }
}

/* 表格响应式 */
table.query-result {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.dark .empty-state i {
    color: #475569;
}

.empty-state p {
    color: #64748b;
    margin: 0;
}

.dark .empty-state p {
    color: #94a3b8;
}

/* 查询提示 */
#dq-query-hint span {
    transition: color 0.2s ease;
}

#dq-query-hint span:hover {
    color: #35a85b;
}

.dark #dq-query-hint span:hover {
    color: #4abebd;
}

/* 成功状态 */
.dq-success {
    color: #10b981;
}

.dq-error {
    color: #ef4444;
}

/* Schema 展开动画 */
.dq-schema-table > div > div:last-child {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
}

.dq-schema-table > div > div:last-child.hidden {
    max-height: 0;
    opacity: 0;
}

/* 拖放区域样式增强 */
#ds-file-drop {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.3s ease;
}

.dark #ds-file-drop {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
}

#ds-file-drop:hover {
    border-color: #35a85b !important;
    box-shadow: 0 0 0 3px rgba(53, 168, 91, 0.1);
}

/* 文件列表动画 */
#ds-file-list > div {
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Schema Tab 切换样式 */
.schema-tab {
    color: #64748b;
}

.schema-tab.active {
    background: #fff;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .schema-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* ER 图容器 */
#dq-er-graph-container {
    position: relative;
    overflow: hidden;
}

#dq-er-graph-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ER 图 tooltip */
.er-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
}

.er-tooltip i {
    font-size: 8px;
}

/* ER 图节点文本 */
#dq-er-graph-container text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ER 图无关系提示 */
#dq-er-no-relations {
    pointer-events: none;
}

/* ER 图全屏模式 */
.er-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100 !important;
    background: #0f172a !important;
}

.dark .er-fullscreen {
    background: #0a0a0a !important;
}

.er-fullscreen #dq-er-graph-container {
    width: 100% !important;
    height: 100% !important;
}

.er-fullscreen #dq-er-toolbar {
    top: 16px !important;
    right: 16px !important;
}

/* =====================================================================
   API 开发指南样式
   ===================================================================== */

/* API 文档代码块样式 */
#view-dataquery-api pre {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

#view-dataquery-api pre code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    display: block;
}

/* API 文档折叠面板动画 */
#view-dataquery-api .fa-chevron-down {
    transition: transform 0.2s ease;
}

#view-dataquery-api .fa-chevron-down.fa-rotate-180 {
    transform: rotate(180deg);
}

/* API 端点表格样式 */
#view-dataquery-api table {
    border-collapse: collapse;
}

#view-dataquery-api tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.dark #view-dataquery-api tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* HTTP 方法标签样式 */
#view-dataquery-api code.language-bash,
#view-dataquery-api code.language-python,
#view-dataquery-api code.language-javascript {
    color: #e2e8f0;
}

/* 代码块复制按钮样式 */
#view-dataquery-api button {
    transition: all 0.15s ease;
}

#view-dataquery-api button:hover {
    transform: translateY(-1px);
}

/* 快速集成指南渐变背景增强 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#view-dataquery-api .bg-gradient-to-br {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #view-dataquery-api .max-w-5xl {
        padding: 0 16px;
    }

    #view-dataquery-api table {
        font-size: 12px;
    }

    #view-dataquery-api pre code {
        font-size: 12px;
    }
}

/* ============================================
   万能跨域查询弹窗样式
   Federated Chat Modal Styles
   ============================================ */

/* 弹窗遮罩层 */
#federated-chat-overlay {
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
}

#federated-chat-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 消息内容最大高度 */
#federated-chat-overlay .msg-content,
#view-aip-talk .msg-content {
    max-height: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 示例卡片 */
.example-card-mini {
    transition: all 0.2s ease;
}

.example-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .example-card-mini:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 用户消息气泡 */
#federated-chat-overlay .user-bubble,
#view-aip-talk .user-bubble {
    background: linear-gradient(135deg, #4ABE6E 0%, #35A85B 100%);
}

/* 机器人消息样式 */
#federated-chat-overlay .bot-message-group .msg-content,
#view-aip-talk .bot-message-group .msg-content {
    background: white;
    border: 1px solid #e2e8f0;
}

.dark #federated-chat-overlay .bot-message-group .msg-content,
.dark #view-aip-talk .bot-message-group .msg-content {
    background: #1A1A1A;
    border-color: rgba(255, 255, 255, 0.1);
}

/* 输入框样式 */
#federated-chat-input,
#aip-talk-chat-input {
    max-height: 120px;
    overflow-y: auto;
}

#federated-chat-input:focus,
#aip-talk-chat-input:focus {
    box-shadow: 0 0 0 2px rgba(74, 190, 110, 0.2);
}

/* 滚动条样式 */
#federated-chat-messages::-webkit-scrollbar,
#aip-talk-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#federated-chat-messages::-webkit-scrollbar-track,
#aip-talk-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#federated-chat-messages::-webkit-scrollbar-thumb,
#aip-talk-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark #federated-chat-messages::-webkit-scrollbar-thumb,
.dark #aip-talk-chat-messages::-webkit-scrollbar-thumb {
    background: #334155;
}

#federated-chat-messages::-webkit-scrollbar-thumb:hover,
#aip-talk-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark #federated-chat-messages::-webkit-scrollbar-thumb:hover,
.dark #aip-talk-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #federated-chat-overlay .w-\\[95vw\\] {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    #federated-chat-overlay .mx-4 {
        margin: 0;
    }

    #federated-chat-overlay .my-4 {
        margin: 0;
    }

    #federated-chat-overlay .max-w-6xl {
        max-width: none;
    }
}

/* ========== 思维工具样式 ========== */

/* 女娲导师芯片 */
.mentor-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    color: #78350f;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mentor-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.mentor-chip .mentor-icon {
    font-size: 16px;
}

.dark .mentor-chip {
    background: linear-gradient(135deg, #854d0e, #713f12);
    border-color: #b45309;
    color: #fef3c7;
}

/* 商业模型芯片 */
.model-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border: 2px solid #6366f1;
    color: #312e81;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.model-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.model-chip i {
    font-size: 12px;
}

.dark .model-chip {
    background: linear-gradient(135deg, #312e81, #3730a3);
    border-color: #818cf8;
    color: #e0e7ff;
}

/* 思维碰撞消息样式 */
.bot-message-group.business-model {
    margin-bottom: 12px;
}

.bot-message-group.business-model .bot-bubble {
    border-left: 4px solid #8b5cf6;
}

.bot-message-group.mentor-message {
    margin-bottom: 12px;
}

.bot-message-group.mentor-message .bot-bubble {
    border-left: 4px solid #f59e0b;
}

/* 思维工具提示 */
#active-tools-hint {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 激活状态指示 */
.mentor-chip.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-color: #b45309;
}

.model-chip.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-color: #4f46e5;
}

/* ========== 传奇思维与商业分析框架 - 科技感样式 ========== */

/* 导师派别按钮 */
.mentor-school {
    margin-bottom: 8px;
}

.mentor-school-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 6px;
    font-size: 13px;
    color: #475569 dark:text-slate-300;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mentor-school-btn:hover {
    background: #f1f5f9 dark:bg-slate-800;
    border-color: #cbd5e1 dark:border-slate-600;
}

.mentor-school-btn i {
    color: #64748b dark:text-slate-400;
}

.mentor-school-btn .count {
    margin-left: auto;
    background: #e2e8f0 dark:bg-slate-700;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    color: #64748b dark:text-slate-400;
}

/* 科技感模型芯片 */
.model-chip-tech {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 6px;
    font-size: 12px;
    color: #475569 dark:text-slate-300;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-chip-tech:hover {
    background: #f1f5f9 dark:bg-slate-800;
    border-color: #94a3b8 dark:border-slate-600;
}

.model-chip-tech i {
    color: #64748b dark:text-slate-400;
    font-size: 11px;
}

/* 科技感导师小项 */
.mentor-item-tech {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 6px;
    font-size: 12px;
    color: #475569 dark:text-slate-300;
    transition: all 0.2s ease;
}

.mentor-item-tech:hover {
    background: #f1f5f9 dark:bg-slate-800;
    border-color: #94a3b8 dark:border-slate-600;
}

.mentor-item-tech i {
    color: #64748b dark:text-slate-400;
    font-size: 11px;
}

/* 导师派别卡片 */
.mentor-school-card {
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 8px;
    padding: 12px;
}

/* 模型卡片 */
.model-card-tech {
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.2s ease;
}

.model-card-tech:hover {
    border-color: #94a3b8 dark:border-slate-600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 定量分类卡片 */
.quant-category-tech {
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 8px;
    padding: 10px;
}

/* 场景卡片 */
.scenario-card-tech {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) dark:linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 8px;
    padding: 12px;
}

.scenario-tag {
    display: inline-block;
    padding: 2px 8px;
    background: white dark:bg-slate-800;
    border: 1px solid #e2e8f0 dark:border-slate-600;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b dark:text-slate-300;
}

/* 帮助页面导航链接 */
.help-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b dark:text-slate-400;
    text-decoration: none;
    transition: all 0.2s ease;
}

.help-nav-link:hover {
    background: #f1f5f9 dark:bg-slate-800;
    color: #475569 dark:text-slate-300;
    border-color: #cbd5e1 dark:border-slate-600;
}

.help-nav-link i {
    font-size: 12px;
}

/* 平滑滚动到锚点 */
.scroll-mt-6 {
    scroll-margin-top: 6rem;
}

/* 帮助页面滚动条样式 */
#legendary-help-overlay .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#legendary-help-overlay .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#legendary-help-overlay .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark #legendary-help-overlay .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark #legendary-help-overlay .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ============================================
   Ontology 帮助弹窗样式
   Ontology Help Modal Styles
   ============================================ */

#ontology-help-overlay {
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
}

#ontology-help-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 帮助弹窗内容区域滚动条 */
#ontology-help-content::-webkit-scrollbar {
    width: 6px;
}

#ontology-help-content::-webkit-scrollbar-track {
    background: transparent;
}

#ontology-help-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark #ontology-help-content::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark #ontology-help-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 帮助弹窗内部导航链接在 dark 模式下的兼容 */
#ontology-help-overlay .help-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dark #ontology-help-overlay .help-nav-link {
    border-color: #334155;
    color: #94a3b8;
}

#ontology-help-overlay .help-nav-link:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.dark #ontology-help-overlay .help-nav-link:hover {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

/* 响应式：小屏幕下弹窗占满视口 */
@media (max-width: 768px) {
    #ontology-help-overlay .w-\[95vw\] {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    #ontology-help-overlay .mx-4 {
        margin-left: 0;
        margin-right: 0;
    }

    #ontology-help-overlay .my-4 {
        margin-top: 0;
        margin-bottom: 0;
    }

    #ontology-help-overlay .max-w-5xl {
        max-width: none;
    }
}

/* ========== 如何使用部分样式 ========== */

/* 使用方式卡片 */
.how-to-card {
    background: white dark:bg-[#0f172a];
    border: 1px solid #e2e8f0 dark:border-slate-700;
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s ease;
}

.how-to-card:hover {
    border-color: #cbd5e1 dark:border-slate-600;
}

/* 提问示例代码块 */
.example-prompt {
    background: #f1f5f9 dark:bg-[#1e293b];
    border-left: 3px solid #64748b dark:border-slate-500;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
}

.example-prompt code {
    color: #475569 dark:text-slate-300;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 列表项圆点 */
.example-bullet {
    display: inline-block;
    color: #64748b dark:text-slate-500;
    margin-right: 6px;
    font-weight: 500;
}

/* ============================================
   Ontology Graph Theme Tokens
   本体图谱主题令牌
   ============================================ */

:root {
    --graph-node-text: #334155;
    --graph-edge-color: #94a3b8;
    --graph-edge-text: #64748b;
    --graph-node-class: #69b3a2;
    --graph-node-object-property: #408090;
    --graph-node-data-property: #e0a040;
    --graph-node-instance: #a0a0a0;
    --graph-node-inferred: #94a3b8;
    --graph-node-default: #69b3a2;
}

.dark {
    --graph-node-text: #e8e8e8;
    --graph-edge-color: #999999;
    --graph-edge-text: #94a3b8;
    --graph-node-class: #69b3a2;
    --graph-node-object-property: #408090;
    --graph-node-data-property: #e0a040;
    --graph-node-instance: #a0a0a0;
    --graph-node-inferred: #f0f0f0;
    --graph-node-default: #69b3a2;
}

/* ============================================
   Ontology Guided Tour Styles
   新手引导 Tour 样式
   ============================================ */

/* 跟随 Tour 时禁止背景滚动 */
body.ontology-tour-active {
    overflow: hidden;
}

.ontology-tour-overlay {
    /* 由 JS 动态设置 z-index，这里保留默认 */
}

.ontology-tour-spotlight {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: all 0.3s ease;
    animation: ontology-tour-pulse 2s ease-in-out infinite;
}

@keyframes ontology-tour-pulse {
    0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(53, 168, 91, 0.4); }
    50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 0 6px rgba(53, 168, 91, 0.1); }
}

.ontology-tour-tooltip {
    position: absolute;
    max-width: 280px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    color: #334155;
    z-index: 381;
    transition: top 0.2s ease, left 0.2s ease;
}

.ontology-tour-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transform: rotate(45deg);
    z-index: -1;
}

.ontology-tour-arrow[data-placement="top"] {
    border-top-color: transparent;
    border-left-color: transparent;
}

.ontology-tour-arrow[data-placement="bottom"] {
    border-bottom-color: transparent;
    border-right-color: transparent;
}

.ontology-tour-arrow[data-placement="left"] {
    border-bottom-color: transparent;
    border-left-color: transparent;
}

.ontology-tour-arrow[data-placement="right"] {
    border-top-color: transparent;
    border-right-color: transparent;
}

.ontology-tour-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ontology-tour-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ontology-tour-dot.done {
    background: #35A85B;
}

.ontology-tour-dot.active {
    background: #35A85B;
    transform: scale(1.25);
}

.ontology-tour-dot:hover {
    background: #94a3b8;
}

/* Dark mode overrides */
.dark .ontology-tour-tooltip {
    background: #1A1A1A;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
}

.dark .ontology-tour-arrow {
    background: #1A1A1A;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .ontology-tour-dot {
    background: #475569;
}

.dark .ontology-tour-dot.done,
.dark .ontology-tour-dot.active {
    background: #35A85B;
}

.dark .ontology-tour-dot:hover {
    background: #64748b;
}

/* ========== 本体侧边栏折叠样式 ========== */

#ontology-sidebar {
    transition: width 0.3s ease;
}

/* 折叠状态 */
#ontology-sidebar.sidebar-collapsed {
    width: 4rem;
}

#ontology-sidebar.sidebar-collapsed .sidebar-header-text {
    display: none;
}

#ontology-sidebar.sidebar-collapsed #ontology-datasource-list {
    padding: 0.5rem 0.25rem;
}

#ontology-sidebar.sidebar-collapsed .datasource-item {
    justify-content: center;
    padding: 0.5rem;
}

#ontology-sidebar.sidebar-collapsed .datasource-item .flex-1,
#ontology-sidebar.sidebar-collapsed .datasource-item .text-xs,
#ontology-sidebar.sidebar-collapsed .datasource-item .font-medium {
    display: none;
}

#ontology-sidebar.sidebar-collapsed .datasource-item .w-8 {
    margin: 0;
}

#ontology-sidebar.sidebar-collapsed #ontology-generate-btn {
    padding: 0.5rem;
    justify-content: center;
}

#ontology-sidebar.sidebar-collapsed #ontology-generate-btn span,
#ontology-sidebar.sidebar-collapsed #ontology-generate-btn .mr-1 {
    display: none;
}

#ontology-sidebar.sidebar-collapsed #ontology-generate-btn i {
    margin: 0;
}

#ontology-sidebar.sidebar-collapsed #ontology-sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* 响应式：小屏幕默认折叠 */
@media (max-width: 1024px) {
    #ontology-sidebar {
        width: 4rem;
    }

    #ontology-sidebar .sidebar-header-text,
    #ontology-sidebar .datasource-item .flex-1,
    #ontology-sidebar .datasource-item .text-xs,
    #ontology-sidebar .datasource-item .font-medium,
    #ontology-sidebar #ontology-generate-btn span,
    #ontology-sidebar #ontology-generate-btn .mr-1 {
        display: none;
    }

    #ontology-sidebar .datasource-item {
        justify-content: center;
        padding: 0.5rem;
    }

    #ontology-sidebar .datasource-item .w-8 {
        margin: 0;
    }

    #ontology-sidebar #ontology-generate-btn {
        padding: 0.5rem;
        justify-content: center;
    }

    #ontology-sidebar #ontology-generate-btn i {
        margin: 0;
    }

    #ontology-sidebar-collapse-btn {
        display: none;
    }
}

/* ==========================================================================
   AIP TALK Message Actions / Drawer / Popup
   ========================================================================== */

/* ---- 数据来源脚注（信源 + 语义依据合并块） ---- */
.aip-sources-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding: 6px 10px;
    border-left: 3px solid #10b981;
    border-radius: 0 6px 6px 0;
    background: rgba(16, 185, 129, 0.06);
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.aip-sources-footer .aip-sources-ontology-line,
.aip-sources-footer .aip-sources-tables-line,
.aip-sources-footer .aip-sources-quality-line,
.aip-sources-footer .aip-sources-knowledge-line,
.aip-sources-footer .aip-sources-nolive-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.aip-sources-footer i {
    color: #10b981;
    font-size: 11px;
    align-self: center;
}

/* M-D4 质量行：校验通过用蓝；漂移警告行用琥珀警示 */
.aip-sources-footer .aip-sources-quality-line i.fa-circle-check {
    color: #3b82f6;
}

/* 知识库来源行：书本图标用靛蓝，与取数绿/质量蓝区分 */
.aip-sources-footer .aip-sources-knowledge-line i.fa-book-open {
    color: #6366f1;
}

/* 图文混排内嵌图（知识库图文召回）：图 + 可见图注，接近文档排版 */
.aip-inline-figure {
    margin: 10px 0;
}

.aip-inline-figure img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: block;
}

.aip-inline-figure figcaption {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
    line-height: 1.5;
}

.aip-sources-footer .aip-quality-drift i.fa-exclamation-triangle {
    color: #f59e0b;
}

.aip-sources-footer .aip-quality-drift .aip-sources-title,
.aip-sources-footer .aip-quality-drift .aip-sources-labels {
    color: #b45309;
}

/* 无实时取数诚实提示行：琥珀信息色，与质量警告同族但更弱 */
.aip-sources-footer .aip-sources-nolive-line i.fa-circle-info {
    color: #f59e0b;
}

.aip-sources-footer .aip-sources-nolive-line .aip-sources-labels {
    color: #b45309;
}

.dark .aip-sources-footer .aip-sources-nolive-line .aip-sources-labels {
    color: #fbbf24;
}

/* 「引用已删数据源」分级警示行：红色警示族，比诚实提示行更强（007 事故根修 H4） */
.aip-sources-footer .aip-sources-stale-line i.fa-exclamation-triangle {
    color: #ef4444;
}

.aip-sources-footer .aip-sources-stale-line .aip-sources-labels {
    color: #b91c1c;
    font-weight: 500;
}

.dark .aip-sources-footer .aip-sources-stale-line .aip-sources-labels {
    color: #f87171;
}

.dark .aip-sources-footer .aip-quality-drift .aip-sources-title,
.dark .aip-sources-footer .aip-quality-drift .aip-sources-labels {
    color: #fbbf24;
}

.aip-sources-footer .aip-sources-title {
    font-weight: 500;
    color: #475569;
    flex-shrink: 0;
}

.aip-sources-footer .aip-sources-labels {
    word-break: break-all;
}

.dark .aip-sources-footer {
    background: rgba(16, 185, 129, 0.10);
    color: #94a3b8;
}

.dark .aip-sources-footer .aip-sources-title {
    color: #cbd5e1;
}

/* ---- NL2SQL 链路呈现块（工程跟踪；蓝色调区别于信源绿） ---- */
.aip-nl2sql-chain {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-left: 3px solid #3B82F6;
    border-radius: 0 6px 6px 0;
    background: rgba(59, 130, 246, 0.05);
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.aip-nl2sql-chain .aip-nl2sql-chain-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #475569;
}

.aip-nl2sql-chain .aip-nl2sql-chain-title i {
    color: #3B82F6;
    font-size: 11px;
}

.aip-nl2sql-chain-item > summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-weight: 500;
    outline: none;
}

.aip-nl2sql-chain-item > summary::-webkit-details-marker {
    display: none;
}

.aip-nl2sql-chain-item > summary::before {
    content: '\f054';  /* fa-chevron-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    color: #3B82F6;
    transition: transform 0.15s ease;
}

.aip-nl2sql-chain-item[open] > summary::before {
    transform: rotate(90deg);
}

.aip-nl2sql-chain-item > summary i {
    color: #3B82F6;
    font-size: 10px;
}

.aip-nl2sql-chain-item .aip-nl2sql-detail {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(59, 130, 246, 0.25);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.aip-nl2sql-chain .aip-nl2sql-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.aip-nl2sql-chain .aip-nl2sql-label {
    flex-shrink: 0;
    font-weight: 500;
    color: #3B82F6;
    min-width: 52px;
}

.aip-nl2sql-chain .aip-nl2sql-value {
    word-break: break-all;
}

.aip-nl2sql-chain .aip-nl2sql-sql-row {
    align-items: center;
}

.aip-nl2sql-chain .aip-nl2sql-copy {
    border: none;
    background: transparent;
    color: #3B82F6;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    opacity: 0.8;
}

.aip-nl2sql-chain .aip-nl2sql-copy:hover {
    opacity: 1;
}

.aip-nl2sql-chain .aip-nl2sql-sql {
    margin: 2px 0 0 0;
    padding: 8px 10px;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 11.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    max-height: 240px;
    overflow-y: auto;
}

.aip-nl2sql-chain .aip-nl2sql-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.aip-nl2sql-chain .aip-nl2sql-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 11px;
    line-height: 1.5;
}

/* 意图理解头部段（确定性语义命中：KB 术语/同义词 + 本体概念） */
.aip-nl2sql-chain .aip-nl2sql-intent {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 0 2px 0;
    border-top: 1px dashed rgba(59, 130, 246, 0.25);
}

.aip-nl2sql-chain .aip-nl2sql-intent-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #475569;
}

.aip-nl2sql-chain .aip-nl2sql-intent-title i {
    color: #3B82F6;
    font-size: 11px;
}

.aip-nl2sql-chain .aip-nl2sql-intent-empty {
    color: #94a3b8;
    font-style: italic;
}

/* 决策路径摘要行（N 步 + 各动作计数） */
.aip-nl2sql-chain .aip-nl2sql-path-line {
    color: #64748b;
    font-weight: 500;
    padding: 2px 0;
}

/* 失败条目：红调变体（工程排障信号） */
.aip-nl2sql-chain-item.is-failed > summary {
    color: #b91c1c;
}

.aip-nl2sql-chain-item.is-failed > summary::before,
.aip-nl2sql-chain-item.is-failed > summary i {
    color: #ef4444;
}

.aip-nl2sql-chain .aip-nl2sql-error-text {
    color: #b91c1c;
}

/* 探索条目：紧凑灰显单行（schema 探索路径） */
.aip-nl2sql-chain-item.is-explore {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #94a3b8;
    font-size: 11.5px;
    padding: 1px 0;
}

.aip-nl2sql-chain-item.is-explore i {
    color: #94a3b8;
    font-size: 10px;
}

.aip-nl2sql-chain-item.is-explore .aip-nl2sql-explore-error {
    color: #b91c1c;
}

/* 当轮 LLM 思考/叙述（思维链捕捉） */
.aip-nl2sql-chain .aip-nl2sql-thought {
    color: #475569;
    font-style: italic;
    white-space: pre-wrap;
}

.dark .aip-nl2sql-chain {
    background: rgba(59, 130, 246, 0.10);
    color: #94a3b8;
}

.dark .aip-nl2sql-chain .aip-nl2sql-chain-title,
.dark .aip-nl2sql-chain-item > summary {
    color: #cbd5e1;
}

.dark .aip-nl2sql-chain .aip-nl2sql-badge {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
}

.dark .aip-nl2sql-chain .aip-nl2sql-intent-title {
    color: #cbd5e1;
}

.dark .aip-nl2sql-chain-item.is-failed > summary {
    color: #fca5a5;
}

.dark .aip-nl2sql-chain .aip-nl2sql-error-text {
    color: #fca5a5;
}

.dark .aip-nl2sql-chain .aip-nl2sql-thought {
    color: #cbd5e1;
}

/* ---- 消息操作按钮 ---- */
.aip-message-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.bot-message-group:hover .aip-message-actions,
.user-message-group:hover .aip-message-actions {
    opacity: 1;
}

.aip-action-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 12px;
}

.aip-action-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.dark .aip-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.aip-action-btn.active,
.aip-action-btn.has-value {
    color: #f59e0b;
}

.aip-action-btn.active i,
.aip-action-btn.has-value i {
    font-weight: 900;
}

/* ---- 抽屉 ---- */
.aip-talk-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 95vw;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
    z-index: 390;
    display: flex;
    flex-direction: column;
}

.dark .aip-talk-drawer {
    background: #0f172a;
    border-left-color: #334155;
}

.aip-drawer-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dark .aip-drawer-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: #334155;
}

.aip-drawer-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.dark .aip-drawer-header h3 {
    color: #e2e8f0;
}

.aip-drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.aip-drawer-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.aip-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ---- Dashboard Configuration Drawer ---- */
.dashboard-config-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 576px;
    max-width: 95vw;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
    z-index: 410;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out;
}

.dark .dashboard-config-drawer {
    background: #0f172a;
    border-left-color: #334155;
}

.dashboard-config-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dark .dashboard-config-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: #334155;
}

.dashboard-config-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.dark .dashboard-config-header h3 {
    color: #e2e8f0;
}

.dashboard-config-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.dashboard-config-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.dark .dashboard-config-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.dashboard-config-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.dashboard-config-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .dashboard-config-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: #334155;
}

.dashboard-config-section {
    margin-bottom: 16px;
}

.dashboard-config-section.flex-1 {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-config-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.dark .dashboard-config-label {
    color: #94a3b8;
}

.dashboard-config-readonly {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.dark .dashboard-config-readonly {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
}

.dashboard-config-bindings {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.dashboard-config-binding-card {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    margin-bottom: 12px;
}

.dark .dashboard-config-binding-card {
    border-color: #334155;
    background: rgba(255, 255, 255, 0.03);
}

.dashboard-config-binding-card:last-child {
    margin-bottom: 0;
}

.dashboard-config-binding-card .status-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.status-unbound {
    background: #f1f5f9;
    color: #64748b;
}

.dark .status-badge.status-unbound {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.status-badge.status-manual {
    background: #dbeafe;
    color: #1d4ed8;
}

.dark .status-badge.status-manual {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.dashboard-config-unbind {
    margin-top: 8px;
    font-size: 11px;
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}

.dashboard-config-unbind:hover {
    text-decoration: underline;
}

.dashboard-config-status {
    font-size: 12px;
    color: #f59e0b;
    display: flex;
    align-items: center;
}

.dark .dashboard-config-status {
    color: #fbbf24;
}

.dashboard-config-save-active {
    background: #10b981 !important;
}

.dashboard-config-save-active:hover {
    background: #059669 !important;
}

.dashboard-config-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 420;
    padding: 10px 16px;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    font-size: 13px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dashboard-config-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-config-toast.error {
    background: #ef4444;
}

.aip-drawer-loading,
.aip-drawer-empty {
    text-align: center;
    padding: 40px 16px;
    color: #94a3b8;
    font-size: 14px;
}

.aip-drawer-item {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
}

.dark .aip-drawer-item {
    background: rgba(255, 255, 255, 0.02);
    border-color: #334155;
}

.aip-drawer-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.aip-drawer-item-summary {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .aip-drawer-item-summary {
    color: #e2e8f0;
}

.aip-drawer-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

/* ---- 决策复盘抽屉 ---- */
.aip-decision-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.aip-decision-filters .aip-popup-input,
.aip-decision-filters .aip-popup-select {
    flex: 1 1 120px;
    min-width: 120px;
    margin-bottom: 0;
}

.aip-decision-filters .aip-popup-btn {
    flex: 0 0 auto;
}

.aip-decision-card {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background: #ffffff;
}

.dark .aip-decision-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: #334155;
}

.aip-decision-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #f8fafc;
}

.dark .aip-decision-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.aip-decision-card .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aip-decision-back {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

/* ---- 弹窗 ---- */
.aip-talk-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 400;
    display: flex;
    flex-direction: column;
}

.dark .aip-talk-popup {
    background: #1e293b;
    border-color: #334155;
}

.aip-popup-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
}

.dark .aip-popup-header {
    border-bottom-color: #334155;
}

.aip-popup-header span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.dark .aip-popup-header span {
    color: #e2e8f0;
}

.aip-popup-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.aip-popup-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.aip-popup-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aip-popup-input,
.aip-popup-textarea,
.aip-popup-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    outline: none;
}

.dark .aip-popup-input,
.dark .aip-popup-textarea,
.dark .aip-popup-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.aip-popup-textarea {
    resize: vertical;
    min-height: 60px;
}

.aip-popup-hint {
    font-size: 12px;
    color: #94a3b8;
}

.aip-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
}

.dark .aip-popup-footer {
    border-top-color: #334155;
}

.aip-popup-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

.aip-popup-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.dark .aip-popup-btn-cancel {
    background: #334155;
    color: #e2e8f0;
}

.aip-popup-btn-confirm {
    background: #3b82f6;
    color: #ffffff;
}

.aip-popup-btn-confirm:hover {
    background: #2563eb;
}

.aip-popup-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.aip-popup-btn-danger:hover {
    background: #dc2626;
}

/* ---- 标签/分类 chip ---- */
.aip-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 500;
}

.dark .aip-tag-chip {
    background: rgba(14, 165, 233, 0.15);
    color: #7dd3fc;
}

.aip-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
}

/* ============================================================
   AIP Talk 图片网格画廊
   ============================================================ */

.aip-talk-image-gallery {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.aip-talk-image-gallery.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.aip-talk-image-gallery.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.aip-talk-image-gallery.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 640px) {
    .aip-talk-image-gallery.cols-3,
    .aip-talk-image-gallery.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.aip-talk-image-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.aip-talk-image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aip-talk-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aip-talk-image-more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.aip-talk-image-more:hover {
    background: rgba(0, 0, 0, 0.6);
}

.dark .aip-talk-image-card {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .aip-talk-image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Rosie 缩略图片卡片（带标题）
   ============================================================ */

.aip-talk-image-gallery.rosie-gallery {
    gap: 12px;
}

.aip-talk-image-card.rosie-image-card {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.aip-talk-image-card.rosie-image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.rosie-image-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f5f9;
}

.rosie-image-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.rosie-image-card:hover .rosie-image-card-media img {
    transform: scale(1.03);
}

.rosie-image-card-caption {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
    background: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.aip-talk-image-card.rosie-image-more {
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    border: none;
}

.aip-talk-image-card.rosie-image-more:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Rosie 单张大图内联预览 */
.rosie-inline-image img {
    max-width: 520px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: block;
    cursor: zoom-in;
}

/* Dark mode */
.dark .aip-talk-image-card.rosie-image-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

.dark .rosie-image-card-media {
    background: #0f172a;
}

.dark .rosie-image-card-caption {
    color: #cbd5e1;
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* 展开后显示剩余图片 */
.aip-talk-image-gallery.expanded .aip-talk-image-more {
    display: none;
}

/* ============================================================
   决策复盘全页视图样式
   ============================================================ */

.decision-review-tab {
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.decision-review-tab:hover {
    color: #475569;
}

.decision-review-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.dark .decision-review-tab {
    color: #94a3b8;
}

.dark .decision-review-tab:hover {
    color: #cbd5e1;
}

.dark .decision-review-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.decision-review-panel {
    display: none;
}

.decision-review-panel.active {
    display: block;
}

/* 决策复盘详情 modal（全页模式） */
.decision-review-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.decision-review-detail-modal > div {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dark .decision-review-detail-modal > div {
    background: #1a1a1a;
}

