/* =============================================
   M3.4 求索首页样式 — 对话式问答界面
   ============================================= */

/* ---- 基础布局 ---- */
.explore-page {
    display: flex;
    height: 100vh;  /* 6·21 结构：左侧栏导航，无顶栏 */
    background: var(--color-bg);
    font-family: var(--font-sans);
    color: var(--color-text);
    overflow: hidden;
}

/* ---- 左侧导航栏 ---- */
.explore-sidebar {
    width: 240px;
    background: var(--color-surface);
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: var(--space-5) var(--space-5) var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
    text-decoration: none;
    cursor: pointer;
}

.sidebar-brand img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
}

.sidebar-brand span {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-primary);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-3);
    overflow: hidden;
}

.sidebar-nav-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 0;
    min-height: 0;
}

.sidebar-nav-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-1);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.sidebar-nav-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.sidebar-nav-item .icon {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

/* ---- 左侧导航：求索历史会话 ---- */
.sidebar-conversations {
    display: none;
    margin: var(--space-2) var(--space-3) var(--space-3);
    padding: var(--space-2);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
}

.sidebar-conversations.visible {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.sidebar-conversations-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.sidebar-conversations .btn-new-conversation {
    flex: 1;
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
}

.sidebar-conversations .btn-export {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
}

.sidebar-conversations .export-menu {
    right: 0;
    min-width: 120px;
}

.sidebar-conversations .conversation-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    padding: 0;
    min-height: 0;
}

.sidebar-conversations-header {
    flex-shrink: 0;
}

.sidebar-conversations .conversation-item {
    padding: var(--space-2);
    gap: var(--space-2);
}

.sidebar-conversations .conversation-icon {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-xs);
}

.sidebar-conversations .conversation-title {
    font-size: var(--font-size-xs);
}

.sidebar-conversations .conversation-meta {
    font-size: 10px;
}

.sidebar-conversations .conversation-delete {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.sidebar-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

.sidebar-user-chevron {
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    transition: transform 0.2s;
}

.sidebar-user-dropdown.is-open .sidebar-user-chevron {
    transform: rotate(180deg);
}

.sidebar-user-dropdown {
    position: relative;
}

.sidebar-user-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    z-index: 50;
}

.sidebar-user-menu.hidden {
    display: none;
}

.sidebar-user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.sidebar-user-menu-item:hover {
    background: var(--color-bg);
}

.sidebar-user-menu-item.hidden {
    display: none;
}

/* ---- 主区域 ---- */
.explore-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.explore-main.practice-scroll {
    overflow-y: auto;
    overflow-x: hidden;
}

/* 顶部栏 */
.explore-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.explore-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

.explore-header-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.explore-header-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.btn-new-chat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-new-chat:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ---- 对话区 ---- */
.explore-chat {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* 欢迎页 */
.explore-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.explore-welcome-logo {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-5);
    opacity: 0.9;
}

.explore-welcome h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.explore-welcome p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
}

/* ---- W2：欢迎区方法墙 ---- */
.method-wall {
    width: min(980px, 100%);
    margin: 0 auto var(--space-8);
    text-align: left;
}

.method-wall-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.method-wall-title {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
}

.method-wall-subtitle,
.method-wall-more {
    color: var(--color-text-tertiary);
    font-size: var(--font-size-xs);
}

.method-wall-more {
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    padding: 4px 0;
    background: transparent;
    cursor: pointer;
}

.method-wall-more:hover {
    color: var(--color-primary, #4f46e5);
}

.method-library-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
}

.method-library-panel {
    display: flex;
    flex-direction: column;
    width: min(980px, 94vw);
    max-height: min(780px, 90vh);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.method-library-header,
.method-library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.method-library-header h2,
.method-library-header p {
    margin: 0;
}

.method-library-header h2 {
    color: #0f172a;
    font-size: 20px;
}

.method-library-header p {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.method-library-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
}

.method-library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.method-library-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbff;
}

.method-library-categories.hidden { display: none; }

.method-library-categories button {
    padding: 4px 10px;
    border: 1px solid #dbe3f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
}

.method-library-categories button.active,
.method-library-categories button:hover {
    border-color: #818cf8;
    background: #eef2ff;
    color: #4338ca;
}

.method-library-filters button,
.method-library-actions button {
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: 7px 12px;
    background: #fff;
    color: #475569;
    cursor: pointer;
}

.method-library-filters button.active,
.method-library-actions button.primary {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

#methodLibrarySearch {
    width: min(280px, 42vw);
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: 8px 11px;
    font: inherit;
}

.method-library-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 180px;
    padding: 18px 22px;
    overflow-y: auto;
    background: #f8fafc;
}

.method-library-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
    align-items: center;
    gap: 18px;
    min-height: 0;
    padding: 15px;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #fff;
}

.method-library-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.method-library-status {
    padding: 3px 8px;
    border-radius: 999px;
    color: #475569;
    background: #e2e8f0;
}

.method-library-status.ready { color: #15803d; background: #dcfce7; }
.method-library-status.draft { color: #a16207; background: #fef3c7; }
.method-library-status.saved { color: #15803d; background: #dcfce7; }
.method-library-status.needs_improvement { color: #b45309; background: #fef3c7; }
.method-library-status.suppressed { color: #64748b; background: #e2e8f0; }

.method-library-category {
    display: inline-flex;
    margin-top: 9px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
}

.method-library-card h3 {
    margin: 12px 0 6px;
    color: #0f172a;
    font-size: 16px;
}

.method-library-card p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.method-library-meta {
    margin: 12px 0 8px;
    color: #94a3b8;
    font-size: 12px;
}
.method-library-main { min-width: 0; }
.method-library-controls { display: grid; gap: 10px; min-width: 0; }
.method-library-controls .method-scenario-picker { margin-top: 0; }
.method-scenario-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 10px; color: #64748b; font-size: 12px; }
.method-scenario-picker span { font-weight: 600; color: #475569; }
.method-scenario-picker select { min-width: 0; width: 100%; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #334155; font: inherit; }
.method-scenario-picker select:focus { border-color: #6366f1; outline: 2px solid rgba(99, 102, 241, .14); }
.method-scenario-empty { margin-top: 9px; color: #94a3b8; font-size: 11px; }
.method-scenario-used { margin: 8px 0; padding: 7px 10px; border-radius: 7px; background: #f0fdf4; color: #166534; font-size: 12px; }
.method-scenario-preview { margin-top: 8px; padding: 9px 10px; border: 1px solid #e0e7ff; border-radius: 8px; background: #f8faff; color: #475569; font-size: 11px; line-height: 1.55; }
.method-scenario-preview strong { color: #334155; }
.method-scenario-preview.muted,
.method-scenario-preview .muted { color: #94a3b8; }
.method-scenario-materials { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 3px; }
.method-scenario-materials span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method-scenario-rule { margin-top: 4px; color: #818cf8; }
.mention-scenario-context { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 11px; line-height: 1.35; cursor: help; }
.mention-adjust-once { padding: 3px 7px; border: 0; background: transparent; color: #4f46e5; font-size: 11px; cursor: pointer; }
.mention-upload-material,
.mention-material-vault { padding: 3px 7px; border: 0; background: transparent; color: #2563eb; font-size: 11px; cursor: pointer; }
.mention-material-file { display: inline-flex; align-items: center; max-width: 230px; overflow: hidden; padding: 3px 5px 3px 7px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mention-material-file button { margin-left: 4px; border: 0; border-radius: 50%; background: transparent; color: #64748b; cursor: pointer; }
.mention-material-status { flex: 1 0 100%; padding: 5px 7px; border-radius: 6px; color: #475569; font-size: 10px; }
.mention-material-status.loading { background: #eff6ff; color: #1d4ed8; }
.mention-material-status.success { background: #f0fdf4; color: #15803d; }
.mention-material-status.warning { background: #fffbeb; color: #a16207; }
.mention-material-status.error { background: #fef2f2; color: #b91c1c; }
.mention-material-status.info { background: #f8fafc; color: #64748b; }
.mention-adjust-once.hidden { display: none; }
.material-vault-panel { flex: 1 0 100%; display: grid; gap: 8px; margin-top: 7px; padding: 10px; border: 1px solid #bfdbfe; border-radius: 9px; background: #f8fbff; }
.material-vault-title { display: flex; justify-content: space-between; gap: 8px; color: #1e3a8a; font-size: 12px; }
.material-vault-title span { color: #64748b; font-size: 10px; }
.material-vault-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.material-vault-group { display: grid; align-content: start; gap: 5px; padding: 7px; border-radius: 7px; background: #fff; color: #475569; font-size: 10px; }
.material-vault-group > strong { color: #334155; font-size: 11px; }
.material-vault-group p { margin: 2px 0; color: #94a3b8; }
.material-vault-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; padding-top: 5px; border-top: 1px solid #e2e8f0; }
.material-vault-item span { min-width: 0; overflow-wrap: anywhere; }
.material-vault-file { display: grid; gap: 5px; padding-top: 6px; border-top: 1px solid #e2e8f0; }
.material-vault-file > div:first-child { display: grid; gap: 2px; }
.material-vault-file span { color: #334155; overflow-wrap: anywhere; }
.material-vault-file small { color: #94a3b8; }
.material-vault-file-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.material-vault-file-actions button { padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #475569; font-size: 10px; cursor: pointer; }
.material-vault-file-actions button:disabled { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; cursor: default; }
.material-vault-item button { border: 0; background: transparent; color: #64748b; font-size: 10px; cursor: pointer; }
.material-vault-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.material-vault-footer button { border: 0; background: transparent; color: #2563eb; font-size: 10px; cursor: pointer; }
.material-vault-footer .material-vault-clear { color: #b91c1c; }
.material-vault-footer button:disabled { color: #94a3b8; cursor: wait; }
.material-vault-footer .hidden { display: none; }
.material-preview-host { grid-column: 1 / -1; display: grid; gap: 7px; padding: 9px; border: 1px solid #bfdbfe; border-radius: 7px; background: #fff; }
.material-preview-host.hidden { display: none; }
.material-preview-title { display: flex; justify-content: space-between; gap: 8px; color: #1e3a8a; font-size: 11px; }
.material-preview-title button { border: 0; background: transparent; color: #2563eb; font-size: 10px; cursor: pointer; }
.material-preview-note { padding: 6px; border-radius: 6px; background: #fffbeb; color: #92400e; font-size: 10px; line-height: 1.5; }
.material-preview-host pre { max-height: 260px; overflow: auto; margin: 0; padding: 8px; border-radius: 6px; background: #f8fafc; color: #334155; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.temporary-scenario-editor { flex: 1 0 100%; display: grid; gap: 8px; margin-top: 7px; padding: 10px; border: 1px solid #c7d2fe; border-radius: 9px; background: #f8faff; }
.temporary-editor-title { display: flex; justify-content: space-between; gap: 8px; color: #334155; font-size: 12px; }
.temporary-editor-title span { color: #818cf8; }
.temporary-scenario-editor label { display: grid; gap: 4px; color: #475569; font-size: 11px; }
.temporary-scenario-editor textarea,
.temporary-scenario-editor input { box-sizing: border-box; width: 100%; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; font: inherit; resize: vertical; }
.temporary-param-list { display: grid; gap: 5px; }
.temporary-param-row { display: grid; grid-template-columns: minmax(90px, .65fr) minmax(160px, 1.5fr) 28px; gap: 5px; }
.temporary-param-row button { border: 0; border-radius: 6px; background: #e2e8f0; color: #64748b; cursor: pointer; }
.temporary-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.temporary-editor-actions button { padding: 5px 9px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #475569; font-size: 11px; cursor: pointer; }
.temporary-editor-actions button.primary { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.material-preflight-panel { flex: 1 0 100%; display: grid; gap: 9px; margin-top: 7px; padding: 11px; border: 1px solid #fde68a; border-radius: 9px; background: #fffbeb; }
.material-preflight-title { display: flex; justify-content: space-between; gap: 8px; color: #92400e; font-size: 12px; }
.material-preflight-title span { color: #b45309; }
.material-preflight-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.material-preflight-field { display: grid; align-content: start; gap: 6px; }
.material-preflight-fields label { display: grid; gap: 4px; color: #78350f; font-size: 11px; font-weight: 600; }
.material-preflight-fields textarea { box-sizing: border-box; width: 100%; padding: 7px 8px; border: 1px solid #fcd34d; border-radius: 7px; background: #fff; color: #334155; font: inherit; font-weight: 400; resize: vertical; }
.material-reuse-suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 7px; padding: 7px; border: 1px solid #bfdbfe; border-radius: 7px; background: #eff6ff; }
.material-reuse-suggestion.accepted { border-color: #86efac; background: #f0fdf4; }
.material-reuse-suggestion span { color: #2563eb; font-size: 10px; font-weight: 600; }
.material-reuse-suggestion p { display: -webkit-box; overflow: hidden; margin: 3px 0 0; color: #475569; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.material-reuse-suggestion button { padding: 5px 7px; border: 1px solid #93c5fd; border-radius: 6px; background: #fff; color: #1d4ed8; font-size: 10px; cursor: pointer; white-space: nowrap; }
.material-reuse-suggestion button:disabled { border-color: #86efac; color: #15803d; cursor: default; }
.material-preflight-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.material-preflight-actions button { padding: 6px 9px; border: 1px solid #fcd34d; border-radius: 6px; background: #fff; color: #92400e; font-size: 11px; cursor: pointer; }
.material-preflight-actions button.primary { border-color: #d97706; background: #d97706; color: #fff; }
.material-remember { display: flex !important; grid-column: 1 / -1; grid-template-columns: auto 1fr !important; align-items: center; gap: 6px !important; color: #92400e !important; font-size: 10px !important; font-weight: 400 !important; }
.material-remember input { width: auto !important; }
.chat-source-tag-material { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.source-card-material { border-color: #bfdbfe; background: #f8fbff; cursor: default; }
.source-card-skill { border-color: #c7d2fe; background: #f8faff; cursor: default; }

.scenario-manager-overlay { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .48); }
.scenario-manager-overlay.hidden { display: none; }
.scenario-manager-panel { width: min(680px, 94vw); max-height: 90vh; overflow: auto; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.scenario-manager-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid #e2e8f0; }
.scenario-manager-header h2 { margin: 0 0 5px; color: #0f172a; font-size: 19px; }
.scenario-manager-header p { margin: 0; color: #64748b; font-size: 12px; }
.scenario-manager-header > button { border: 0; background: transparent; color: #64748b; font-size: 24px; cursor: pointer; }
.scenario-manager-form { display: grid; gap: 15px; padding: 18px 22px; }
.scenario-manager-form > label { display: grid; gap: 6px; color: #334155; font-size: 13px; font-weight: 600; }
.scenario-manager-form input,
.scenario-manager-form textarea { box-sizing: border-box; width: 100%; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px; color: #1e293b; font: inherit; font-weight: 400; resize: vertical; }
.scenario-manager-form input:focus,
.scenario-manager-form textarea:focus { border-color: #6366f1; outline: 2px solid rgba(99, 102, 241, .13); }
.scenario-params-head { display: flex; align-items: center; justify-content: space-between; color: #334155; font-size: 13px; }
.scenario-params-head button { border: 0; background: transparent; color: #4f46e5; cursor: pointer; }
.scenario-params-list { display: grid; gap: 8px; }
.scenario-param-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(180px, 1.5fr) 30px; gap: 7px; }
.scenario-param-row button { border: 0; border-radius: 7px; background: #f1f5f9; color: #64748b; cursor: pointer; }
.scenario-param-empty { padding: 12px; border-radius: 8px; background: #f8fafc; color: #94a3b8; font-size: 12px; }
.scenario-manager-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 20px; border-top: 1px solid #e2e8f0; }
.scenario-manager-actions button { padding: 8px 13px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; cursor: pointer; }
.scenario-manager-actions button.primary { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.scenario-manager-actions button:disabled { cursor: not-allowed; opacity: .55; }

.method-library-actions {
    display: flex;
    gap: 8px;
}

.method-library-empty {
    grid-column: 1 / -1;
    align-self: center;
    color: #94a3b8;
    text-align: center;
}

.method-library-footer {
    padding: 12px 22px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    text-align: right;
}

.method-library-footer a { color: #4f46e5; }

@media (max-width: 700px) {
    .method-library-overlay { padding: 0; }
    .method-library-panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
    .method-library-toolbar { align-items: stretch; flex-direction: column; }
    #methodLibrarySearch { width: 100%; box-sizing: border-box; }
    .method-library-list { grid-template-columns: 1fr; }
    .method-library-card { grid-template-columns: 1fr; align-items: stretch; }
}

.method-wall-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    justify-content: center;
    gap: 12px;
}

.method-wall-card {
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 14px;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.method-wall-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 11px;
}

.method-wall-badge {
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.method-wall-source {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.method-wall-card h3 {
    margin: 12px 0 6px;
    color: #172033;
    font-size: 15px;
    line-height: 1.45;
}

.method-wall-reason {
    margin: 0 0 10px !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.method-wall-recommend {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 7px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.method-wall-recommend span {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
}

.method-wall-recommend strong { flex: 0 0 auto; color: #475569; }

.method-wall-output {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}
.method-wall-output strong { color: #475569; }
.method-wall-detail-toggle {
    justify-self: start;
    margin: 7px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6366f1;
    font-size: 11px;
    cursor: pointer;
}
.method-wall-details { display: grid; gap: 6px; margin-top: 6px; color: #64748b; font-size: 11px; }
.method-wall-details > div:first-child { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; }
.method-wall-details.hidden { display: none; }

.method-wall-facts {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 12px;
}

.method-wall-facts div,
.ss-facts div {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 6px;
}

.method-wall-facts strong,
.ss-facts strong {
    color: #475569;
}

.method-wall-facts span,
.ss-facts span {
    color: #64748b;
    line-height: 1.45;
}

.method-wall-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.method-wall-suppress {
    align-self: flex-end;
    margin-top: 7px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
}

.method-wall-suppress:hover { color: #64748b; text-decoration: underline; }

.method-wall-btn {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #dbe3f0;
    border-radius: 7px;
    background: #fff;
    color: #475569;
    cursor: pointer;
}

.method-wall-btn.primary {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.method-wall-btn:hover {
    transform: translateY(-1px);
}

/* 推荐问题 */
.explore-suggested {
    width: 100%;
    max-width: 600px;
}

.explore-suggested-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-3);
    text-align: center;
}

.explore-suggested-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.explore-suggested-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.explore-suggested-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* 最近求索 */
.explore-recent {
    width: 100%;
    max-width: 600px;
    margin-top: var(--space-8);
}

.explore-recent-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-3);
    text-align: center;
}

.explore-recent-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-2);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.explore-recent-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.explore-recent-q {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.explore-recent-a {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 消息气泡 ---- */
.chat-message {
    display: flex;
    gap: var(--space-3);
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    align-items: flex-start;
}

.chat-message.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
}

.chat-message.assistant .chat-avatar {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.chat-message.user .chat-avatar {
    background: var(--color-primary);
    color: #fff;
}

.chat-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-base);
    line-height: 1.7;
    max-width: 100%;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.chat-message.assistant .chat-bubble {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text);
    padding: var(--space-1) 0;
    border-radius: var(--radius-md);
}

.chat-message.user .chat-avatar {
    display: none;
}

.chat-message.user .chat-bubble {
    background: var(--color-border-light);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-xl);
    width: fit-content;
    max-width: 78%;
}

/* Markdown 内容 */
.chat-bubble h1 { font-size: 1.35em; }
.chat-bubble h2 { font-size: 1.2em; }
.chat-bubble h3 { font-size: 1.1em; }

.chat-bubble h1,
.chat-bubble h2,
.chat-bubble h3 {
    font-weight: 700;
    margin: var(--space-4) 0 var(--space-2);
    color: inherit;
}

.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child { margin-bottom: 0; }

/* Markdown 表格：受限宽内横向滚动，避免撑破气泡 */
.chat-bubble table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: var(--space-2) 0;
    font-size: 0.92em;
}

.chat-bubble th,
.chat-bubble td {
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    text-align: left;
    white-space: nowrap;
}

.chat-bubble th {
    background: var(--color-border-light);
    font-weight: 600;
}

.chat-bubble p {
    margin: var(--space-2) 0;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: var(--space-2) 0;
    padding-left: var(--space-5);
}

.chat-bubble li {
    margin: var(--space-1) 0;
}

.chat-bubble code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.chat-bubble pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--space-2) 0;
}

.chat-bubble pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.chat-bubble strong {
    font-weight: 700;
}

.chat-bubble blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: var(--space-3);
    margin: var(--space-2) 0;
    color: var(--color-text-secondary);
}

/* 来源卡片 */
.chat-sources {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light);
}

.chat-source-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
}

.chat-source-tag:hover {
    background: var(--color-primary);
    color: #fff;
}

.chat-citation {
    font-size: 0.75em;
    line-height: 0;
    vertical-align: super;
    margin: 0 1px;
}

.chat-citation a {
    display: inline-block;
    padding: 0 3px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.chat-citation a:hover {
    background: var(--color-primary);
    color: #fff;
    text-decoration: underline;
}

.chat-citation-map {
    display: inline-block;
    margin: 0 2px;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.85em;
    text-decoration: none;
    white-space: nowrap;
}

.chat-citation-map:hover {
    background: var(--color-primary);
    color: #fff;
    text-decoration: underline;
}

/* ---- 思考中动画 ---- *
.chat-thinking {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-3) 0;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    animation: thinking-bounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.thinking-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.method-progress-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.method-progress-controls.hidden { display: none; }
.method-progress-controls button {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.method-progress-controls button:last-child {
    border-color: #fecaca;
    color: #b91c1c;
}
.method-result-status.assumption {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
}

/* ---- 输入区 ---- */
.explore-input-area {
    padding: var(--space-3) var(--space-6);
    border-top: none;
    background: transparent;
}

.explore-input-box {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.explore-input-row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
}

.explore-textarea {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    min-height: 44px;
    max-height: 160px;
    line-height: 1.5;
}

.explore-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
    min-height: 56px;
    padding: 12px 16px;
}

.explore-textarea::placeholder {
    color: var(--color-text-muted);
}

.explore-textarea.ghost-hint {
    color: var(--color-text-tertiary);
}

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-send:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.btn-send:disabled {
    background: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
}

/* 选择器行 */
.explore-selectors {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
}

.explore-select {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    outline: none;
}

.explore-select:focus {
    border-color: var(--color-primary);
}

.explore-input-hint {
    display: none;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .explore-sidebar {
        display: none;
    }
    .explore-header {
        padding: var(--space-3) var(--space-4);
    }
    .explore-chat {
        padding: var(--space-3);
    }
    .explore-input-area {
        padding: var(--space-2) var(--space-4);
    }
    .explore-input-row {
        gap: var(--space-2);
    }
    .explore-textarea {
        padding: 8px 12px;
        min-height: 36px;
        font-size: 16px; /* 防止 iOS 缩放 */
    }
    .btn-send {
        width: 36px;
        height: 36px;
    }
    .mode-btn .mode-label {
        display: none;
    }
    .mode-btn {
        min-width: 36px;
        padding: 6px;
    }
    .explore-selectors {
        gap: var(--space-2);
        flex-wrap: wrap;
    }
    .mode-hint-inline {
        display: none;
    }
    .explore-input-hint {
        display: none;
    }
}

/* =============================================
   M4.1 知识清单样式 — 卡片网格 + 列表 + 搜索
   ============================================= */

/* ---- 占位页面 ---- */
.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: var(--space-4);
    color: var(--color-text-tertiary);
}
.placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
}
.placeholder-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
}
.placeholder-subtitle {
    font-size: var(--font-size-sm);
}

/* ---- 知识清单页面 ---- */
.knowledge-page {
    padding: 24px 32px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 工具栏 */
.knowledge-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.knowledge-search {
    flex: 1;
    max-width: 400px;
}

.knowledge-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.knowledge-search input:focus {
    border-color: var(--color-primary);
}

.knowledge-view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    transition: all 0.15s ease;
}

.view-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.view-btn.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
}

/* ---- 卡片视图 ---- */
.knowledge-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.knowledge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.knowledge-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.knowledge-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.knowledge-card-title {
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    word-break: break-word;
}

.knowledge-card-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

/* ---- 列表视图 ---- */
.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.knowledge-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.15s ease;
}

.knowledge-list-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.knowledge-list-icon {
    font-size: 1.2rem;
}

.knowledge-list-title {
    flex: 1;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.knowledge-list-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

/* ---- 空状态 ---- */
.knowledge-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .knowledge-page {
        padding: 16px;
    }
    .knowledge-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .knowledge-search {
        max-width: none;
    }
    .knowledge-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   M4.2 知识卡片悬浮提示框
   ============================================= */

.knowledge-tooltip {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 16px 20px;
    width: 380px;
    max-height: 480px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.knowledge-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
}

.knowledge-tooltip-header {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--color-text);
    margin-bottom: 2px;
    line-height: 1.4;
}

.knowledge-tooltip-author {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.knowledge-tooltip-section {
    margin-bottom: 12px;
}

.knowledge-tooltip-section:last-child {
    margin-bottom: 0;
}

.knowledge-tooltip-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.knowledge-tooltip-list {
    margin: 0;
    padding-left: 16px;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.knowledge-tooltip-list li {
    margin-bottom: 4px;
}

.knowledge-tooltip-list li:last-child {
    margin-bottom: 0;
}

.knowledge-tooltip-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* =============================================
   M4.3 知识卡片封面背景
   ============================================= */

/* 卡片视图封面 */
.knowledge-card-cover {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background-color: var(--color-primary-light);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* 列表视图封面 */
.knowledge-list-cover {
    width: 48px;
    height: 64px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-sm);
    background-color: var(--color-primary-light);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* =============================================
   M4.4 AI 知识拆解快捷入口
   ============================================= */

.ai-parse-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.ai-parse-entry:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
}

.ai-parse-entry-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ai-parse-entry-content {
    flex: 1;
}

.ai-parse-entry-title {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--color-primary);
    margin-bottom: 4px;
}

.ai-parse-entry-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.ai-parse-entry-btn {
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ai-parse-entry-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

/* 响应式 */
@media (max-width: 768px) {
    .ai-parse-entry {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .ai-parse-entry-btn {
        width: 100%;
        text-align: center;
    }
}
/* =============================================
   M3.5 知识库列表样式
   ============================================= */

/* ---- 知识库页面容器 ---- */
.kb-list-page {
    padding: 24px 32px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 顶部栏 */
.kb-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.kb-search-box {
    position: relative;
    width: 360px;
    max-width: 50%;
}

.kb-search-box input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0 36px 0 14px;
    font-size: var(--font-size-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.kb-search-box input:focus {
    border-color: var(--color-primary);
}

.kb-search-box svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.kb-btn-primary {
    height: 36px;
    padding: 0 18px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.kb-btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* 横幅区 */
.kb-hero-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.kb-hero-banner::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.kb-hero-content { position: relative; z-index: 1; }

.kb-hero-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-hero-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
}

.kb-hero-illustration {
    position: relative;
    z-index: 1;
    width: 180px;
    height: 100px;
    flex-shrink: 0;
}

.kb-graph-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.kb-graph-node {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.kb-graph-node.n1 { width: 24px; height: 24px; top: 20px; left: 30px; }
.kb-graph-node.n2 { width: 18px; height: 18px; top: 50px; left: 70px; }
.kb-graph-node.n3 { width: 20px; height: 20px; top: 15px; left: 110px; }
.kb-graph-node.n4 { width: 16px; height: 16px; top: 60px; left: 130px; }
.kb-graph-node.n5 { width: 22px; height: 22px; top: 35px; left: 155px; }

.kb-graph-line {
    position: absolute;
    height: 1.5px;
    background: rgba(255,255,255,0.4);
    transform-origin: left center;
}

/* 筛选栏 */
.kb-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.kb-filter-tabs {
    display: flex;
    gap: 8px;
}

.kb-filter-tab {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.kb-filter-tab:hover { background: var(--color-border-light); }

.kb-filter-tab.active {
    background: var(--color-text);
    color: #fff;
    font-weight: 500;
}

.kb-sort-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.kb-sort-label:hover { background: var(--color-border-light); }

/* 卡片网格 */
.kb-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.kb-library-card {
    background: var(--color-surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.kb-library-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    border-color: var(--color-border);
}

.kb-library-card.kb-new {
    border-style: dashed;
    border-color: var(--color-border);
    background: var(--color-bg);
    min-height: 260px;
}

.kb-library-card.kb-new:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

/* 卡片顶部：迷你图谱 */
.kb-card-graph {
    height: 140px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-card-graph.has-nodes {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.kb-mini-graph {
    width: 140px;
    height: 80px;
    position: relative;
}

.kb-mg-node {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    user-select: none;
}

.kb-mg-line {
    position: absolute;
    height: 1.5px;
    transform-origin: left center;
    z-index: 1;
}

.kb-card-graph.empty {
    background: var(--color-bg);
}

.kb-empty-state {
    text-align: center;
    color: var(--color-text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.kb-empty-state svg {
    width: 36px;
    height: 36px;
    opacity: 0.4;
}

.kb-empty-state p { font-size: 13px; }

/* 卡片内容区 */
.kb-card-body {
    padding: 16px;
}

.kb-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.kb-card-soul {
    font-size: 12px;
    color: var(--color-text-tertiary);
    line-height: 1.4;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 32px;
}

.kb-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.kb-card-stats {
    display: flex;
    gap: 12px;
}

.kb-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kb-card-stat svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* 新建卡片 */
.kb-new-card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--color-text-tertiary);
}

.kb-new-card-content svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.kb-new-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.kb-new-desc {
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}

/* 登录提示层 */
.kb-login-prompt {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
}

.kb-login-prompt svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: 4px;
}

.kb-login-prompt h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.kb-login-prompt p {
    font-size: 14px;
    margin: 0;
    margin-bottom: 8px;
}

/* 空列表 */
.kb-empty-list {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
}

.kb-empty-list svg {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.kb-empty-list h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.kb-empty-list p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .kb-library-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    .kb-list-page { padding: 16px; }
    .kb-search-box { width: 200px; }
    .kb-library-grid { grid-template-columns: repeat(2, 1fr); }
}


/* =============================================
   P0 MVP 求索改造：三栏布局 + 会话列表 + 来源面板
   ============================================= */

/* ---- 求索页面三栏布局 ---- */
.explore-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.explore-center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    transition: flex 0.25s ease;
}

.explore-left-panel {
    width: 260px;
    background: var(--color-surface);
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.explore-right-panel {
    width: 320px;
    background: var(--color-bg);
    border-left: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    transition: width 0.25s ease, padding 0.25s ease;
}

.explore-right-panel.collapsed {
    width: 0;
    padding: 0;
    border-left: none;
    overflow: visible;
}

.explore-right-panel.collapsed .panel-tabs,
.explore-right-panel.collapsed .panel-tab-content {
    opacity: 0;
    pointer-events: none;
}

.panel-toggle-btn {
    position: absolute;
    top: 12px;
    left: -14px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.panel-toggle-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.explore-right-panel.collapsed .panel-toggle-btn {
    left: -28px;
}

/* ---- 左栏：会话列表 ---- */
.panel-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
}

.panel-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
}

.panel-subtitle {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.panel-toolbar {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-new-conversation {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-new-conversation:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.export-dropdown {
    position: relative;
}

.btn-export {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-export:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.export-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    padding: var(--space-1);
    z-index: 100;
}

.export-menu.hidden {
    display: none;
}

.export-menu button {
    width: 100%;
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    border-radius: var(--radius-md);
}

.export-menu button:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: var(--space-1);
    position: relative;
}

.conversation-item:hover {
    background: var(--color-primary-light);
}

.conversation-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.conversation-item.active .conversation-title,
.conversation-item.active .conversation-meta {
    color: var(--color-primary);
}

.conversation-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.conversation-delete {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-xs);
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete:hover {
    background: var(--color-danger-light, #fee2e2);
    color: var(--color-danger, #ef4444);
}

.conversation-empty {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
}

/* ---- 右栏：来源面板 ---- */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}

.source-card {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all 0.15s ease;
}

.source-card:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.source-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.source-index {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.source-title {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.source-book {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.source-sim {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: 600;
}

.source-card-external {
    border-left: 3px solid #ef4444;
}

.source-card-external:hover {
    border-left-color: #dc2626;
}

.source-card-chunk {
    border-left: 3px solid #f59e0b;
    cursor: default;
}

.source-card-chunk:hover {
    border-left-color: #d97706;
    background: var(--color-warning-light, #fffbeb);
}

.source-chunk-banner {
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    border-radius: var(--radius-lg);
    background: #fffbeb;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.chat-source-tag-chunk {
    background: #fffbeb;
    color: #92400e;
}

.chat-source-tag-chunk:hover {
    background: #f59e0b;
    color: #fff;
}

.source-page {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.source-internal-link {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    text-decoration: none;
    padding: 2px 8px;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
}

.source-internal-link:hover {
    text-decoration: underline;
}

.source-summary {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-empty {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    padding: var(--space-8) var(--space-4);
}

/* ---- 顶部工具栏 ---- */
.explore-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}

.explore-topbar-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
}

.explore-topbar-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ---- 推荐问题更新 ---- */
.explore-suggested-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
}

.explore-suggested-chip {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.explore-suggested-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ---- 角色选择启用 ---- */
.explore-select option:disabled {
    color: var(--color-text-muted);
}

/* ---- 流式输出光标 ---- */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--color-primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- 响应式 ---- */
@media (max-width: 1100px) {
    .explore-selectors {
        flex-wrap: wrap;
    }
    .explore-selectors .mode-hint-inline {
        flex: 1 0 100%;
        text-align: left;
    }
    .explore-input-hint {
        display: none;
    }
}

@media (max-width: 1024px) {
    .explore-right-panel {
        width: 0;
        padding: 0;
        border-left: none;
    }
    .explore-right-panel:not(.collapsed) {
        width: 320px;
        padding: 0;
        border-left: 1px solid var(--color-border);
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 20;
        box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    }
    .explore-right-panel:not(.collapsed) .panel-toggle-btn {
        left: -14px;
    }
}

@media (max-width: 768px) {
    .explore-left-panel {
        display: none;
    }
}


/* ---- 求索模式选择器 ---- */
.mode-selector {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 2px 4px;
    margin: 0 -4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mode-selector::-webkit-scrollbar {
    display: none;
}

.mode-selector.is-collapsed {
    max-width: 72px;
    mask-image: none;
    -webkit-mask-image: none;
    overflow: hidden;
    cursor: pointer;
}

.mode-selector.is-collapsed .mode-btn:not(.active) {
    display: none;
}

.mode-selector.is-collapsed .mode-btn.active {
    margin: 0 auto;
}

.prompt-scene-selector { display:flex; align-items:center; gap:8px; margin:8px 4px 0; color:var(--color-text-secondary); font-size:.78rem; }
.prompt-scene-selector > span { color:var(--color-text-tertiary); }
.prompt-scene-btn { border:1px solid var(--color-border); border-radius:999px; padding:5px 10px; background:var(--color-bg); color:var(--color-text-secondary); cursor:pointer; font-size:.76rem; }
.prompt-scene-btn:hover,.prompt-scene-btn.active { border-color:var(--color-primary); background:var(--color-primary-light); color:var(--color-primary); }
.prompt-scene-btn small { margin-left:3px; color:inherit; opacity:.75; }
@media (max-width:600px) { .prompt-scene-selector { flex-wrap:wrap; } }

.mode-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 48px;
    padding: 5px 8px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.mode-btn .mode-icon {
    font-size: 1.2em;
    line-height: 1;
}

.mode-btn .mode-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    line-height: 1;
}

.mode-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.mode-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 2px 8px var(--color-primary-light);
}

.mode-btn.active .mode-icon,
.mode-btn.active .mode-label {
    color: #fff;
}

.mode-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    min-height: 1.2em;
}

.mode-hint-inline {
    display: none;
}


/* ---- 右栏 Tabs ---- */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border-light);
    background: transparent;
}

.panel-tab {
    flex: 1;
    padding: var(--space-2) var(--space-1);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.panel-tab:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}

.panel-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 500;
}

.panel-tab-content {
    display: none;
    flex-direction: column;
    height: calc(100% - 41px);
    overflow: hidden;
}

.panel-tab-content.active {
    display: flex;
}

.graph-canvas {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.graph-canvas .graph-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-tertiary);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--space-4);
}


/* ---- 消息操作按钮 ---- */
.chat-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-left: var(--space-2);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-message.assistant:hover .chat-actions {
    opacity: 1;
}

.chat-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.chat-action-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: scale(1.05);
}

.chat-action-btn.feedback-btn.selected {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #a5b4fc;
}

/* ---- 收藏视图 ---- */
.favorites-view {
    padding: var(--space-6);
    max-width: 960px;
    margin: 0 auto;
}

.favorites-header {
    margin-bottom: var(--space-6);
}

.favorites-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--color-text);
}

.favorites-header p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.favorites-list {
    display: grid;
    gap: var(--space-4);
}

.favorites-empty {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--color-text-tertiary);
    font-size: 0.95rem;
}

.favorite-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: box-shadow 0.15s ease;
}

.favorite-card:hover {
    box-shadow: var(--shadow-sm);
}

.favorite-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.favorite-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.favorite-delete {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.favorite-card-content {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.favorite-card-content p:last-child {
    margin-bottom: 0;
}

.favorite-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
}


/* ---- 学习建议 ---- */
.learning-path-list {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.learning-path-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    text-align: left;
    transition: box-shadow 0.15s ease;
}

.learning-path-item:hover {
    box-shadow: var(--shadow-sm);
}

.learning-path-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.learning-path-reason {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
    line-height: 1.5;
}

.learning-path-source {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
}

/* ===== V3-T10 模式收敛 + 分析技能卡 ===== */

/* 收敛后隐藏的模式按钮（模板代码保留，仅隐藏） */
.mode-btn-hidden {
    display: none !important;
}

/* 分析技能卡 */
.skill-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 10px);
    background: var(--color-bg);
    overflow: hidden;
    margin-bottom: var(--space-2, 8px);
}

.skill-card-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.05));
    border-bottom: 1px solid var(--color-border);
}

.skill-card-badge {
    font-size: 0.78rem;
    color: var(--color-primary, #4f46e5);
    font-weight: 600;
    margin-bottom: 4px;
}

.skill-card-badge span {
    font-weight: 400;
    color: var(--color-text-tertiary);
    margin-left: 6px;
}

.skill-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
}

.skill-card-role {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.skill-card-objective {
    font-size: 0.85rem;
    color: var(--color-text);
    margin-top: 6px;
    line-height: 1.5;
}

.skill-card-objective span {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--color-primary, #4f46e5);
    border: 1px solid var(--color-primary, #4f46e5);
    border-radius: 4px;
    padding: 0 5px;
    margin-right: 6px;
    vertical-align: 1px;
}

.skill-card-section {
    border-bottom: 1px solid var(--color-border);
}

.skill-card-section summary {
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.skill-card-section summary::-webkit-details-marker {
    display: none;
}

.skill-card-section summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    color: var(--color-text-tertiary);
    transition: transform 0.15s ease;
}

.skill-card-section[open] summary::before {
    transform: rotate(90deg);
}

.skill-card-section summary:hover {
    background: var(--color-bg-hover, rgba(0, 0, 0, 0.03));
}

.skill-card-items {
    padding: 4px 14px 12px 14px;
}

.skill-card-item {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.02));
}

.skill-card-item:last-child {
    margin-bottom: 0;
}

.skill-card-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}

.skill-card-item-desc {
    font-size: 0.83rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    margin-top: 3px;
}

.skill-card-item-formula {
    font-size: 0.83rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    line-height: 1.5;
}

.skill-card-item-source {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.skill-card-ref-id {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-weight: 400;
}

.skill-card-field-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.83rem;
}

.skill-card-field-label {
    flex-shrink: 0;
    color: var(--color-text-secondary);
    padding-top: 2px;
}

.skill-card-chip {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--color-text);
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 1px 9px;
    margin: 0 4px 4px 0;
}

.skill-card-output-item {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.7;
}

.skill-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
}

.skill-card-btn {
    font-size: 0.82rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.skill-card-btn:hover {
    border-color: var(--color-primary, #4f46e5);
    color: var(--color-primary, #4f46e5);
}

/* =============================================
   域外问题降级 + 通用回答徽标
   ============================================= */

/* 通用回答徽标 */
.chat-bubble.general-bubble {
    position: relative;
}

.chat-bubble.general-bubble::before {
    content: '🌐 通用回答 · 非来自知识内容 · 请甄别';
    display: block;
    width: fit-content;
    margin-bottom: var(--space-3, 12px);
    padding: 4px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-full, 999px);
    color: #0369a1;
    font-size: var(--font-size-xs, 12px);
    font-weight: 500;
}

/* 域外降级卡片 */
.ood-bubble {
    background: #fffbf0;
    border-color: #fde68a;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
}

.ood-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
    margin-bottom: var(--space-2, 8px);
}

.ood-desc {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 14px);
    line-height: 1.6;
    margin-bottom: var(--space-4, 16px);
}

.ood-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3, 12px);
    margin-bottom: var(--space-3, 12px);
}

.ood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-3, 12px) var(--space-2, 8px);
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 10px);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.ood-btn:hover:not(:disabled) {
    border-color: var(--color-primary, #4f46e5);
    background: var(--color-primary-light, #eef2ff);
    transform: translateY(-1px);
}

.ood-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-bg, #f8fafc);
}

.ood-btn-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.ood-btn-text {
    font-size: var(--font-size-sm, 14px);
    font-weight: 600;
    color: var(--color-text);
}

.ood-btn-sub {
    font-size: 0.72rem;
    color: var(--color-text-tertiary);
    line-height: 1.3;
}

.ood-rec-hint {
    font-size: var(--font-size-xs, 12px);
    color: var(--color-text-tertiary);
    text-align: center;
    padding-top: var(--space-2, 8px);
    border-top: 1px dashed var(--color-border-light, #e2e8f0);
}

@media (max-width: 640px) {
    .ood-actions {
        grid-template-columns: 1fr;
    }
    .ood-btn {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    .ood-btn-sub {
        margin-left: auto;
    }
}

/* ===== B7 建议卡（求索回答上方的方法推荐） ===== */
.skill-suggestion-card {
    background: #f5f7ff;
    border-color: #c7d2fe;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
}

.task-fallback-message { margin-bottom: 8px; }
.task-fallback-card {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 720px;
    padding: 10px 14px;
    border: 1px solid #dbe4ff;
    border-radius: 10px;
    background: #f7f9ff;
    color: #475467;
    font-size: 13px;
    line-height: 1.55;
}
.task-fallback-card strong { color: #3448c5; white-space: nowrap; }
.task-discover-btn {
    border: 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e0e7ff;
    color: #3730a3;
    cursor: pointer;
    white-space: nowrap;
}

.ss-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 6px;
}

.ss-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ss-category,
.mention-category {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 11px;
    line-height: 1.4;
}

.ss-outputs {
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}

.ss-reason {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 10px;
}

.ss-facts {
    display: grid;
    gap: 6px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.ss-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ss-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ss-btn-use {
    border: 1px solid #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.ss-btn-use:hover {
    background: #4338ca;
}

.ss-btn-skip {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
}

.ss-btn-suppress {
    margin-left: auto;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
}

.ss-btn-suppress:hover { color: #64748b; text-decoration: underline; }

.ss-btn-skip:hover {
    border-color: #94a3b8;
    color: #334155;
}

.ss-accepted {
    font-size: 12px;
    color: #166534;
}

/* ===== B7 @方法入口 ===== */
.explore-input-row {
    position: relative;
}

.mention-popup {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    width: min(420px, 100%);
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 6px;
    box-sizing: border-box;
}

.mention-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.mention-item:hover,
.mention-item.active {
    background: #eef2ff;
}

.mention-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.mention-status {
    font-size: 11px;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 8px;
}

.mention-category {
    margin-left: 6px;
}

.mention-status-verified,
.mention-status-trusted {
    background: #dcfce7;
    color: #166534;
}

.mention-status-draft {
    background: #fef3c7;
    color: #92400e;
}

.mention-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mention-result {
    margin-top: 3px;
    color: #6366f1;
    font-size: 11px;
    line-height: 1.45;
}

.mention-empty {
    font-size: 12px;
    color: #94a3b8;
    padding: 10px;
    text-align: center;
}

.mention-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-lg);
    background: var(--color-border-light);
}

.mention-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 14px;
}

.mention-chip-x {
    border: none;
    background: none;
    color: #6366f1;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.mention-chip-x:hover {
    color: #312e81;
}

/* ---- W2：求索中的结构化方法成果 ---- */
.method-result-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
}

.task-result-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-bottom: 12px;
    padding: 9px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
}
.task-result-banner span { color: #64748b; }

.method-contribution-banner {
    margin: -4px 0 12px;
    padding: 10px 12px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 12px;
    line-height: 1.6;
}

.method-artifact-host .artifact-view { display: flex; flex-direction: column; gap: 10px; }
.method-artifact-host .artifact-header { padding: 14px 16px; border: 1px solid #dbeafe; border-radius: 10px; background: linear-gradient(135deg, #eff6ff, #f8fafc); }
.method-artifact-host .artifact-header h2 { margin: 0 0 5px; color: #0f172a; font-size: 17px; }
.method-artifact-host .artifact-header p { margin: 0; color: #475569; font-size: 12px; }
.method-artifact-host .artifact-blocks { display: flex; flex-direction: column; gap: 10px; }
.method-artifact-host .artifact-block { padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; }
.method-artifact-host .artifact-block h3 { margin: 0 0 8px; color: #334155; font-size: 13px; }
.method-artifact-host .artifact-text { color: #334155; line-height: 1.75; }
.method-artifact-host .artifact-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 0; }
.method-artifact-host .artifact-kv-item { padding: 8px 10px; background: #f8fafc; border-radius: 6px; }
.method-artifact-host .artifact-kv dt { color: #64748b; font-size: 11px; margin-bottom: 3px; }
.method-artifact-host .artifact-kv dd { margin: 0; color: #1e293b; white-space: pre-wrap; }
.method-artifact-host .artifact-table-wrap { max-width: 100%; overflow-x: auto; }
.method-artifact-host .artifact-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 12px; }
.method-artifact-host .artifact-table th,
.method-artifact-host .artifact-table td { padding: 8px 9px; border: 1px solid #e2e8f0; text-align: left; vertical-align: top; white-space: pre-wrap; }
.method-artifact-host .artifact-table th { background: #f8fafc; color: #475569; white-space: nowrap; }
.method-artifact-host .artifact-checklist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.method-artifact-host .artifact-checklist li { display: flex; align-items: flex-start; gap: 7px; color: #334155; }
.method-artifact-host .artifact-check { color: #2563eb; font-weight: 700; }
.method-artifact-host .artifact-contributions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; color: #065f46; font-size: 12px; }
.method-artifact-host .artifact-contributions span { padding: 2px 7px; background: #fff; border-radius: 999px; }
.method-artifact-host .artifact-raw { margin-top: 2px; color: #64748b; font-size: 11px; }
.method-artifact-host .artifact-raw summary { cursor: pointer; }
.method-artifact-host .artifact-raw pre { max-height: 220px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 6px; background: #0f172a; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; }
.method-artifact-host .artifact-markdown { color: #334155; font-size: 14px; line-height: 1.75; }
.method-artifact-host .artifact-markdown > :first-child { margin-top: 0; }
.method-artifact-host .artifact-markdown > :last-child { margin-bottom: 0; }
.method-artifact-host .artifact-markdown h1 { margin: 20px 0 10px; font-size: 20px; color: #0f172a; }
.method-artifact-host .artifact-markdown h2 { margin: 18px 0 9px; font-size: 17px; color: #172033; }
.method-artifact-host .artifact-markdown h3 { margin: 16px 0 8px; font-size: 15px; color: #1e293b; }
.method-artifact-host .artifact-markdown p { margin: 7px 0; }
.method-artifact-host .artifact-markdown ul,
.method-artifact-host .artifact-markdown ol { margin: 8px 0; padding-left: 24px; }
.method-artifact-host .artifact-markdown li { margin: 4px 0; }
.method-artifact-host .artifact-markdown blockquote { margin: 10px 0; padding: 9px 12px; border-left: 3px solid #818cf8; background: #f5f7ff; color: #475569; }
.method-artifact-host .artifact-markdown hr { margin: 18px 0; border: 0; border-top: 1px solid #e2e8f0; }
.method-artifact-host .artifact-markdown table { width: 100%; margin: 10px 0 14px; border-collapse: collapse; font-size: 12px; }
.method-artifact-host .artifact-markdown th,
.method-artifact-host .artifact-markdown td { padding: 8px 9px; border: 1px solid #dbe3ee; text-align: left; vertical-align: top; }
.method-artifact-host .artifact-markdown th { background: #f8fafc; color: #334155; font-weight: 600; }
.method-artifact-host .artifact-markdown code { padding: 1px 4px; border-radius: 4px; background: #f1f5f9; color: #be123c; font-size: .9em; }
.method-artifact-host .artifact-markdown pre { overflow-x: auto; padding: 12px; border-radius: 7px; background: #0f172a; color: #e2e8f0; }
.method-artifact-host .artifact-markdown pre code { padding: 0; background: transparent; color: inherit; }
.method-artifact-host .artifact-markdown a { color: #4f46e5; text-decoration: underline; }

/* ---- W3：成果操作、继续修改与保存 ---- */
.artifact-action-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #e2e8f0; }
.artifact-action-bar button,
.artifact-revise-panel button { border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #334155; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.artifact-action-bar button:hover,
.artifact-revise-panel button:hover { border-color: #818cf8; color: #4338ca; background: #eef2ff; }
.artifact-action-bar .artifact-save-btn { margin-left: auto; border-color: #4f46e5; background: #4f46e5; color: #fff; }
.artifact-action-bar .artifact-save-btn.saved { border-color: #059669; background: #059669; }
.artifact-action-bar button:disabled { cursor: not-allowed; opacity: .72; }
.artifact-action-bar button.is-saving:disabled { cursor: wait; }
.artifact-save-note { margin-top: 8px; padding: 8px 10px; border: 1px solid #a7f3d0; border-radius: 7px; background: #ecfdf5; color: #476358; font-size: 11px; line-height: 1.55; }
.artifact-save-note.hidden { display: none; }
.artifact-history-note { margin-top: 8px; padding: 8px 10px; border: 1px solid #fde68a; border-radius: 7px; background: #fffbeb; color: #854d0e; font-size: 11px; line-height: 1.55; }
.artifact-revise-panel { margin-top: 9px; padding: 11px; border: 1px solid #c7d2fe; border-radius: 9px; background: #f8faff; }
.artifact-revise-panel.hidden { display: none; }
.artifact-revise-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.artifact-revise-custom { display: flex; gap: 7px; }
.artifact-revise-custom input { flex: 1; min-width: 120px; border: 1px solid #cbd5e1; border-radius: 7px; padding: 8px 10px; font-size: 12px; }
.artifact-revise-status { min-height: 16px; margin-top: 6px; color: #6366f1; font-size: 11px; }
.saved-artifacts-section,
.saved-favorites-section { margin-bottom: 26px; }
.saved-artifacts-section > h3,
.saved-favorites-section > h3 { margin: 0 0 12px; font-size: 15px; color: #334155; }
.saved-artifacts-list { display: grid; gap: 14px; }
.saved-artifact-card .artifact-view { display: flex; flex-direction: column; gap: 8px; }
.saved-artifact-card .artifact-header h2 { margin: 0; font-size: 16px; }
.saved-artifact-card .artifact-header p { color: #64748b; font-size: 12px; }
.saved-artifact-card .artifact-block { padding: 9px 0; border-top: 1px solid #eef2f7; }
.saved-artifact-card .artifact-block h3 { margin: 0 0 7px; font-size: 13px; }
.saved-artifact-card .artifact-table-wrap { overflow-x: auto; }
.saved-artifact-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.saved-artifact-card th,
.saved-artifact-card td { border: 1px solid #e2e8f0; padding: 7px; text-align: left; vertical-align: top; }
.saved-artifact-card .artifact-raw { display: none; }
.saved-artifact-card .artifact-markdown { line-height: 1.7; }
.saved-artifact-card .artifact-markdown table { width: 100%; border-collapse: collapse; }
.saved-artifact-card .artifact-markdown th,
.saved-artifact-card .artifact-markdown td { padding: 7px; border: 1px solid #e2e8f0; text-align: left; }
.saved-artifact-card.saved-artifact-highlight {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

@media (max-width: 900px) {
    .method-wall-list { grid-template-columns: 1fr; }
    .method-wall-card { min-height: 0; }
    .artifact-action-bar .artifact-save-btn { margin-left: 0; }
    .artifact-revise-custom { flex-direction: column; }
}

/* =============================================
   求索对话区视觉优化（对标 Kimi/ChatGPT）
   仅样式：侧栏弹性让位 + 窄屏右栏悬浮
   ============================================= */
@media (max-width: 1200px) {
    .explore-left-panel { width: 220px; }
    .explore-right-panel { width: 280px; }
}

@media (max-width: 900px) {
    .explore-layout { position: relative; }
    .explore-right-panel {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 20;
        box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
    }
    .explore-right-panel.collapsed {
        box-shadow: none;
    }
    .explore-chat { padding: var(--space-4) var(--space-3); }
}

/* =============================================
   会话内导航：消息锚点轨 + 回到最新
   ============================================= */
.explore-center-panel { position: relative; }

.chat-anchor-rail {
    position: absolute;
    right: 12px;
    top: 42%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 15;
    padding: 8px 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(4px);
}

.chat-anchor-tick {
    width: 14px;
    height: 3px;
    padding: 0;
    border: none;
    border-radius: 2px;
    background: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-anchor-tick:hover {
    width: 20px;
    background: var(--color-primary-soft);
}

.chat-anchor-tick.active {
    width: 20px;
    background: var(--color-primary);
}

.chat-back-bottom {
    position: absolute;
    right: 20px;
    bottom: 140px; /* JS 会按输入区实际高度修正 */
    z-index: 15;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.chat-back-bottom:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

@media (max-width: 768px) {
    .chat-anchor-rail { display: none; }
}
.material-vault-policy {
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f6f8fc;
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
}
.method-error-card {
    display: grid;
    justify-items: start;
    gap: 7px;
    max-width: 520px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff7f7;
    color: #7f1d1d;
}
.method-error-card span { color: #991b1b; font-size: 13px; line-height: 1.55; }
.method-retry-btn {
    padding: 6px 11px;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
}
.method-retry-btn:disabled { color: #94a3b8; cursor: wait; }
.method-source-protocol {
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    line-height: 1.7;
}
.method-source-protocol summary { cursor: pointer; font-weight: 600; color: #334155; }
.method-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; font-size: 12px; color: #64748b; }
.method-feedback button { border: 1px solid #dbe3ee; border-radius: 999px; background: #fff; padding: 5px 9px; cursor: pointer; }
.method-feedback button:hover { border-color: #818cf8; color: #4338ca; }
.method-feedback-note { color: #475569; }
